Loëck Vézien
7 years ago
committed by
GitHub
6 changed files with 1094 additions and 62 deletions
@ -0,0 +1,19 @@ |
|||
import React from 'react' |
|||
import { configure, addDecorator } from '@storybook/react' |
|||
import { ThemeProvider } from 'styled-components' |
|||
|
|||
import 'styles/global' |
|||
import theme from 'styles/theme' |
|||
|
|||
const req = require.context('../src', true, /.stories.js$/) |
|||
function loadStories() { |
|||
req.keys().forEach(filename => req(filename)) |
|||
} |
|||
|
|||
addDecorator(story => ( |
|||
<ThemeProvider theme={theme}> |
|||
<div style={{ padding: 20 }}>{story()}</div> |
|||
</ThemeProvider> |
|||
)) |
|||
|
|||
configure(loadStories, module) |
@ -0,0 +1,20 @@ |
|||
import styled from 'styled-components' |
|||
|
|||
export default styled.input` |
|||
padding: 10px 15px; |
|||
border: 1px solid ${p => p.theme.colors.mouse}; |
|||
border-radius: 3px; |
|||
display: flex; |
|||
width: 100%; |
|||
color: ${p => p.theme.colors.steel}; |
|||
background: ${p => p.theme.colors.white}; |
|||
|
|||
&::placeholder { |
|||
color: ${p => p.theme.colors.mouse}; |
|||
} |
|||
|
|||
&:focus { |
|||
outline: none; |
|||
box-shadow: rgba(0, 0, 0, 0.05) 0 2px 2px; |
|||
} |
|||
` |
@ -0,0 +1,8 @@ |
|||
import React from 'react' |
|||
import { storiesOf } from '@storybook/react' |
|||
|
|||
import Input from 'components/base/Input' |
|||
|
|||
const stories = storiesOf('Input', module) |
|||
|
|||
stories.add('basic', () => <Input placeholder="Foo bar" />) |
File diff suppressed because it is too large
Loading…
Reference in new issue