-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2275 from Spy-Seth/qa/extract-guidelines
Refactor addon-action to use glamorous
- Loading branch information
Showing
13 changed files
with
125 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,53 @@ | ||
export default { | ||
wrapper: { | ||
flex: 1, | ||
display: 'flex', | ||
position: 'relative', | ||
}, | ||
actions: { | ||
flex: 1, | ||
margin: 0, | ||
padding: '8px 2px 20px 0', | ||
overflowY: 'auto', | ||
color: '#666', | ||
}, | ||
action: { | ||
display: 'flex', | ||
padding: '3px 3px 3px 0', | ||
borderLeft: '5px solid white', | ||
borderBottom: '1px solid #fafafa', | ||
transition: 'all 0.1s', | ||
alignItems: 'start', | ||
}, | ||
countwrap: { | ||
paddingBottom: 2, | ||
}, | ||
counter: { | ||
margin: '0 5px 0 5px', | ||
backgroundColor: '#777777', | ||
color: '#ffffff', | ||
padding: '1px 5px', | ||
borderRadius: '20px', | ||
}, | ||
inspector: { | ||
flex: 1, | ||
padding: '0 0 0 5px', | ||
}, | ||
button: { | ||
position: 'absolute', | ||
bottom: 0, | ||
right: 0, | ||
border: 'none', | ||
borderTop: 'solid 1px rgba(0, 0, 0, 0.2)', | ||
borderLeft: 'solid 1px rgba(0, 0, 0, 0.2)', | ||
background: 'rgba(255, 255, 255, 0.5)', | ||
padding: '5px 10px', | ||
borderRadius: '4px 0 0 0', | ||
color: 'rgba(0, 0, 0, 0.5)', | ||
outline: 'none', | ||
}, | ||
}; | ||
import glamorous from 'glamorous'; | ||
import { Button as BaseButton } from '@storybook/components'; | ||
|
||
export const Actions = glamorous.pre({ | ||
flex: 1, | ||
margin: 0, | ||
padding: '8px 2px 20px 0', | ||
overflowY: 'auto', | ||
color: '#666', | ||
}); | ||
|
||
export const Action = glamorous.div({ | ||
display: 'flex', | ||
padding: '3px 3px 3px 0', | ||
borderLeft: '5px solid white', | ||
borderBottom: '1px solid #fafafa', | ||
transition: 'all 0.1s', | ||
alignItems: 'start', | ||
}); | ||
|
||
export const Button = glamorous(BaseButton)({ | ||
position: 'absolute', | ||
bottom: 0, | ||
right: 0, | ||
borderRadius: '4px 0 0 0', | ||
textTransform: 'uppercase', | ||
letterSpacing: 1, | ||
paddingTop: 5, | ||
paddingBootom: 5, | ||
}); | ||
|
||
export const Counter = glamorous.div({ | ||
margin: '0 5px 0 5px', | ||
backgroundColor: '#777777', | ||
color: '#ffffff', | ||
padding: '1px 5px', | ||
borderRadius: '20px', | ||
}); | ||
|
||
export const Countwrap = glamorous.div({ | ||
paddingBottom: 2, | ||
}); | ||
|
||
export const InspectorContainer = glamorous.div({ | ||
flex: 1, | ||
padding: '0 0 0 5px', | ||
}); | ||
|
||
export const Wrapper = glamorous.div({ | ||
flex: 1, | ||
display: 'flex', | ||
position: 'relative', | ||
}); |
10 changes: 10 additions & 0 deletions
10
lib/components/src/form/__snapshots__/button.stories.storyshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Storyshots Components|Form/Button with onclick 1`] = ` | ||
<button | ||
class="css-1ibnlbj" | ||
type="button" | ||
> | ||
Submit | ||
</button> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import glamorous from 'glamorous'; | ||
import { baseFonts } from '../theme'; | ||
|
||
export default glamorous | ||
.button({ | ||
...baseFonts, | ||
border: 'none', | ||
boxShadow: '0 0 0 1px rgba(0, 0, 0, 0.2)', | ||
backgroundColor: 'rgb(255, 255, 255)', | ||
padding: '4px 10px 7px', | ||
borderRadius: 4, | ||
cursor: 'pointer', | ||
transition: 'box-shadow 0.15s ease-out', | ||
':hover': { | ||
transition: 'background-color 0.15s ease-out', | ||
boxShadow: '0 0 0 1px rgba(0, 0, 0, 0.3)', | ||
}, | ||
':focus': { | ||
transition: 'background-color 0.15s ease-out', | ||
outline: 'none', | ||
boxShadow: '0 0 0 2px rgba(0, 0, 0, 0.3)', | ||
}, | ||
':active': { | ||
transition: 'none', | ||
backgroundColor: 'rgb(247, 247, 247)', | ||
}, | ||
}) | ||
.withProps({ type: 'button' }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react'; | ||
import { storiesOf } from '@storybook/react'; | ||
import { action } from '@storybook/addon-actions'; | ||
import { withKnobs, text } from '@storybook/addon-knobs'; | ||
|
||
import Button from './button'; | ||
|
||
storiesOf('Components|Form/Button', module) | ||
.addDecorator(withKnobs) | ||
.add('with onclick', () => <Button onClick={action('click')}>{text('Text', 'Submit')}</Button>); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
lib/components/src/navigation/__snapshots__/routed_link.stories.storyshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters