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';
44import { storiesOf } from '@storybook/react' ;
55import * as React from 'react' ;
66
7- import { Checkbox } from '../Checkbox' ;
8- import { boxKnobs } from './Box' ;
7+ import { Checkbox } from '../src/Checkbox' ;
98
109export const checkboxKnobs = ( tabName = 'Checkbox' ) => {
1110 return {
11+ checked : boolean ( 'checked' , false , tabName ) ,
1212 disabled : boolean ( 'disabled' , false , tabName ) ,
1313 } ;
1414} ;
1515
16- storiesOf ( 'components/ Checkbox' , module )
16+ storiesOf ( 'Checkbox' , module )
1717 . 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' ;
21import { action } from '@storybook/addon-actions' ;
32import { withKnobs } from '@storybook/addon-knobs' ;
43import { boolean } from '@storybook/addon-knobs/react' ;
54import { storiesOf } from '@storybook/react' ;
65import * as React from 'react' ;
76
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' ;
148
159export const toggleKnobs = ( tabName = 'Toggle' ) => {
1610 return {
11+ checked : boolean ( 'checked' , false , tabName ) ,
1712 disabled : boolean ( 'disabled' , false , tabName ) ,
1813 } ;
1914} ;
2015
21- storiesOf ( 'components/ Toggle' , module )
16+ storiesOf ( 'Toggle' , module )
2217 . 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 11import './Box' ;
22import './Button' ;
3+ import './Checkbox' ;
34import './Flex' ;
45import './Heading' ;
56import './Icon' ;
@@ -9,3 +10,4 @@ import './KitchenSink';
910import './List' ;
1011import './Text' ;
1112import './Textarea' ;
13+ import './Toggle' ;
You can’t perform that action at this time.
0 commit comments