File tree Expand file tree Collapse file tree 4 files changed +1739
-214
lines changed Expand file tree Collapse file tree 4 files changed +1739
-214
lines changed Original file line number Diff line number Diff line change @@ -4,15 +4,15 @@ import { boolean } from '@storybook/addon-knobs/react';
4
4
import { storiesOf } from '@storybook/react' ;
5
5
import * as React from 'react' ;
6
6
7
- import { Checkbox } from '../Checkbox' ;
8
- import { boxKnobs } from './Box' ;
7
+ import { Checkbox } from '../src/Checkbox' ;
9
8
10
9
export const checkboxKnobs = ( tabName = 'Checkbox' ) => {
11
10
return {
11
+ checked : boolean ( 'checked' , false , tabName ) ,
12
12
disabled : boolean ( 'disabled' , false , tabName ) ,
13
13
} ;
14
14
} ;
15
15
16
- storiesOf ( 'components/ Checkbox' , module )
16
+ storiesOf ( 'Checkbox' , module )
17
17
. addDecorator ( withKnobs )
18
- . add ( 'with defaults' , ( ) => < Checkbox { ...checkboxKnobs ( ) } { ... boxKnobs ( ) } onChange = { action ( 'onChange' ) } /> ) ;
18
+ . add ( 'with defaults' , ( ) => < Checkbox { ...checkboxKnobs ( ) } onChange = { action ( 'onChange' ) } /> ) ;
Original file line number Diff line number Diff line change 1
- import { StateDecorator , Store } from '@sambego/storybook-state' ;
2
1
import { action } from '@storybook/addon-actions' ;
3
2
import { withKnobs } from '@storybook/addon-knobs' ;
4
3
import { boolean } from '@storybook/addon-knobs/react' ;
5
4
import { storiesOf } from '@storybook/react' ;
6
5
import * as React from 'react' ;
7
6
8
- import { Toggle } from '../Toggle' ;
9
- import { boxKnobs } from './Box' ;
10
-
11
- const store = new Store ( {
12
- checked : false ,
13
- } ) ;
7
+ import { Toggle } from '../src/Toggle' ;
14
8
15
9
export const toggleKnobs = ( tabName = 'Toggle' ) => {
16
10
return {
11
+ checked : boolean ( 'checked' , false , tabName ) ,
17
12
disabled : boolean ( 'disabled' , false , tabName ) ,
18
13
} ;
19
14
} ;
20
15
21
- storiesOf ( 'components/ Toggle' , module )
16
+ storiesOf ( 'Toggle' , module )
22
17
. addDecorator ( withKnobs )
23
- . addDecorator ( StateDecorator ( store ) )
24
- . add ( 'with defaults' , ( ) => (
25
- < Toggle
26
- { ...toggleKnobs ( ) }
27
- { ...boxKnobs ( ) }
28
- checked = { store . get ( 'checked' ) }
29
- onChange = { e => {
30
- action ( 'onChange' ) ( e ) ;
31
- store . set ( { checked : e . target . checked } ) ;
32
- } }
33
- />
34
- ) ) ;
18
+ . add ( 'with defaults' , ( ) => < Toggle { ...toggleKnobs ( ) } onChange = { action ( 'onChange' ) } /> ) ;
Original file line number Diff line number Diff line change 1
1
import './Box' ;
2
2
import './Button' ;
3
+ import './Checkbox' ;
3
4
import './Flex' ;
4
5
import './Heading' ;
5
6
import './Icon' ;
@@ -9,3 +10,4 @@ import './KitchenSink';
9
10
import './List' ;
10
11
import './Text' ;
11
12
import './Textarea' ;
13
+ import './Toggle' ;
You can’t perform that action at this time.
0 commit comments