diff --git a/packages/react/src/components/Button/Button-story.js b/packages/react/src/components/Button/Button-story.js index c20068ab73e4..b7a12cd15735 100644 --- a/packages/react/src/components/Button/Button-story.js +++ b/packages/react/src/components/Button/Button-story.js @@ -6,7 +6,6 @@ */ import React from 'react'; -import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { withKnobs, boolean, select, text } from '@storybook/addon-knobs'; import { settings } from 'carbon-components'; @@ -123,116 +122,130 @@ const CustomLink = ({ children, href, ...other }) => ( ); -storiesOf('Button', module) - .addParameters({ +export default { + title: 'Button', + decorators: [withKnobs], + + parameters: { component: Button, + subcomponents: { ButtonSkeleton, }, - }) - .addDecorator(withKnobs) - .add( - 'Default', - () => { - const regularProps = props.regular(); - return ( -
- -   - -   - -   - -
- ); - }, - { - info: { - text: ` - Buttons are used to initialize an action, either in the background or - foreground of an experience. - - There are several kinds of buttons. - - Primary buttons should be used for the principle call to action - on the page. - - Secondary buttons should be used for secondary actions on each page. - - Danger buttons should be used for a negative action (such as Delete) on the page. - - Modify the behavior of the button by changing its event properties. - - Field buttons may be use directly next to an input element, to visually align their heights. - - Small buttons may be used when there is not enough space for a - regular sized button. This issue is most found in tables. Small button should have three words - or less. - - When words are not enough, icons can be used in buttons to better communicate what the button does. Icons are - always paired with text. - `, - }, - } - ) - .add('Icon-only buttons', () => - - - ); + }, +}; + +export const _Default = () => { + const regularProps = props.regular(); + return ( +
+ +   + +   + +   + +
+ ); +}; + +_Default.story = { + parameters: { + info: { + text: ` + Buttons are used to initialize an action, either in the background or + foreground of an experience. + + There are several kinds of buttons. + + Primary buttons should be used for the principle call to action + on the page. + + Secondary buttons should be used for secondary actions on each page. + + Danger buttons should be used for a negative action (such as Delete) on the page. + + Modify the behavior of the button by changing its event properties. + + Field buttons may be use directly next to an input element, to visually align their heights. + + Small buttons may be used when there is not enough space for a + regular sized button. This issue is most found in tables. Small button should have three words + or less. + + When words are not enough, icons can be used in buttons to better communicate what the button does. Icons are + always paired with text. + `, }, - { - info: { - text: ` - When an action required by the user has more than one option, always use a a negative action button (secondary) paired with a positive action button (primary) in that order. Negative action buttons will be on the left. Positive action buttons should be on the right. When these two types buttons are paired in the correct order, they will automatically space themselves apart. - `, - }, - } - ) - .add( - 'skeleton', - () => ( -
- -   - -   - -
- ), - { - info: { - text: ` - Placeholder skeleton state to use when content is loading. - `, - }, - } + }, +}; + +export const IconOnlyButtons = () => ( + + + ); +}; + +SetsOfButtons.story = { + name: 'Sets of Buttons', + + parameters: { + info: { + text: ` + When an action required by the user has more than one option, always use a a negative action button (secondary) paired with a positive action button (primary) in that order. Negative action buttons will be on the left. Positive action buttons should be on the right. When these two types buttons are paired in the correct order, they will automatically space themselves apart. + `, + }, + }, +}; + +export const Skeleton = () => ( +
+ +   + +   + +
+); + +Skeleton.story = { + name: 'skeleton', + + parameters: { + info: { + text: ` + Placeholder skeleton state to use when content is loading. + `, + }, + }, +};