1
1
import React from 'react'
2
2
import { storiesOf } from '@storybook/react'
3
3
import { action } from '@storybook/addon-actions'
4
- import { withKnobs , text } from '@storybook/addon-knobs'
4
+ import { withKnobs , color , text } from '@storybook/addon-knobs'
5
5
import { withReadme } from 'storybook-readme'
6
+ import { ThemeProvider } from 'styled-components'
6
7
8
+ import { GlobalStyle , createTheme } from '../../theme/src'
7
9
import CardReadme from '../README.md'
8
10
9
11
import Card from '.'
@@ -18,7 +20,27 @@ storiesOf('Card', module)
18
20
. addDecorator ( withKnobs )
19
21
. addDecorator ( withReadme ( CardReadme ) )
20
22
. addWithJSX ( 'default' , ( ) => {
21
- const cardTitle = text ( 'cardTitle' , 'Card' )
22
- const buttonText = text ( 'buttonText' , 'Click me' )
23
- return < Card buttonText = { buttonText } onClick = { onClick } title = { cardTitle } />
23
+ // data
24
+ const cardTitle = text ( 'Card Title' , 'Card' , 'Data' )
25
+ const cardText = text (
26
+ 'Card Text' ,
27
+ 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.' ,
28
+ )
29
+ const buttonText = text ( 'Button Text' , 'Click me' , 'Data' )
30
+
31
+ // styling and theme
32
+ const accent = color ( 'Accent Color' , '#9FB1BC' , 'Colors' )
33
+ const bodyColor = color ( 'Body Color' , '#465775' , 'Colors' )
34
+ const theme = createTheme ( { colors : { bodyColor, accent } } )
35
+
36
+ return (
37
+ < ThemeProvider theme = { theme } >
38
+ < div style = { { margin : '0 auto' , width : '300px' } } >
39
+ < GlobalStyle />
40
+ < Card buttonText = { buttonText } onClick = { onClick } title = { cardTitle } >
41
+ { cardText }
42
+ </ Card >
43
+ </ div >
44
+ </ ThemeProvider >
45
+ )
24
46
} )
0 commit comments