diff --git a/.storybook/config.js b/.storybook/config.js index cdd47d7a1..e19b1087c 100644 --- a/.storybook/config.js +++ b/.storybook/config.js @@ -2,7 +2,7 @@ import '@babel/polyfill'; import svg4everybody from 'svg4everybody'; import { configure, setAddon, addDecorator } from '@storybook/react'; import { withKnobs } from '@storybook/addon-knobs'; -import infoAddon, { setDefaults } from '@storybook/addon-info'; +import { withInfo } from '@storybook/addon-info'; import wrapContent from './wrapContent'; import infoAddonDefaults from './infoAddonDefaults'; @@ -19,8 +19,7 @@ if (typeof location !== 'undefined') { } } -setDefaults(infoAddonDefaults); -setAddon(infoAddon); +addDecorator(withInfo(infoAddonDefaults)); addDecorator(withKnobs); addDecorator(wrapContent({ assetRoot })); diff --git a/stories/BadgeStories.js b/stories/BadgeStories.js index 731081dce..e5aad6bd6 100644 --- a/stories/BadgeStories.js +++ b/stories/BadgeStories.js @@ -1,12 +1,10 @@ import React from 'react'; import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { withInfo } from '@storybook/addon-info'; import { Badge } from '../src/scripts'; storiesOf('Badge', module).add( 'Default', - withInfo('Default badge')(() => ( - Badge Label - )) + () => Badge Label, + { info: 'Default badge' } ); diff --git a/stories/BreadCrumbsStories.js b/stories/BreadCrumbsStories.js index c6fd94179..adb69f11b 100644 --- a/stories/BreadCrumbsStories.js +++ b/stories/BreadCrumbsStories.js @@ -1,15 +1,15 @@ import React from 'react'; import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { withInfo } from '@storybook/addon-info'; import { BreadCrumbs, Crumb } from '../src/scripts'; storiesOf('BreadCrumbs', module).add( 'Default', - withInfo('Default BreadCrumbs')(() => ( + () => ( Parent Entity Parent Record Name - )) + ), + { info: 'Default BreadCrumbs' } ); diff --git a/stories/ButtonGroupStories.js b/stories/ButtonGroupStories.js index 234380610..03494cee0 100644 --- a/stories/ButtonGroupStories.js +++ b/stories/ButtonGroupStories.js @@ -1,7 +1,6 @@ import React from 'react'; import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { withInfo } from '@storybook/addon-info'; import { ButtonGroup, Button, DropdownButton, MenuItem } from '../src/scripts'; const darkBgStyle = { backgroundColor: '#16325c', padding: 4 }; @@ -9,7 +8,7 @@ const darkBgStyle = { backgroundColor: '#16325c', padding: 4 }; const stories = storiesOf('ButtonGroup', module) .add( 'Default', - withInfo('Default grouped buttons')(() => ( + () => ( - )) + ), + { info: 'Default grouped buttons' } ) .add( 'Default disalbed', - withInfo('Grouped buttons with disabled button')(() => ( + () => ( - )) + ), + { info: 'Grouped buttons with disabled button' } ) .add( 'More', - withInfo('Grouped buttons with dropdown button in right')(() => ( + () => ( - )) + }, + { info: 'Button controlled with knobs' } ) + .add('Reset', () => , { + info: 'Button with no type property assigned', + }) .add( 'Neutral', - withInfo('Neutral type button')(() => ( + () => ( - )) + ), + { info: 'Neutral type button' } ) .add( 'Neutral disabled', - withInfo('Neutral type button but disabled')(() => ( + () => ( - )) + ), + + { info: 'Neutral type button but disabled' } ) .add( 'Brand', - withInfo('Brand type button')(() => ( + () => ( - )) + ), + { info: 'Brand type button' } ) .add( 'Brand disabled', - withInfo('Brand type button but disabled')(() => ( + () => ( - )) + ), + { info: 'Brand type button but disabled' } ) .add( 'Destructive', - withInfo('Destructive type button')(() => ( + () => ( - )) + ), + { info: 'Destructive type button' } ) .add( 'Destructive disabled', - withInfo('Destructive type button but disabled')(() => ( + () => ( - )) + ), + { info: 'Destructive type button but disabled' } ) .add( 'Neutral with left icon', - withInfo('Neutral type button with download icon in left side')(() => ( + () => ( - )) + ), + { info: 'Neutral type button with download icon in left side' } ) .add( 'Neutral with right icon', - withInfo('Neutral type button with down icon in right side')(() => ( + () => ( - )) + ), + { info: 'Neutral type button with down icon in right side' } ) .add( 'Inverse', - withInfo('Inverse type button in dark background')(() => ( + () => (
- )) + ), + { info: 'Inverse type button in dark background' } ) .add( 'Inverse Disabled', - withInfo('Inverse type button in dark background but disabled')(() => ( + () => (
- )) + ), + { info: 'Inverse type button in dark background but disabled' } ) .add( 'Button Icon', - withInfo('Default button with icon')(() => ( + () => (