Skip to content

Commit

Permalink
Merge pull request #265 from edx/fix-readme-addons
Browse files Browse the repository at this point in the history
docs(readme-storybook-addons): update storybook README addons
  • Loading branch information
jaebradley authored May 25, 2018
2 parents 7c97e22 + b56fd08 commit 9b868e4
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/Button/Button.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ import { action } from '@storybook/addon-actions';
import centered from '@storybook/addon-centered';
import { checkA11y } from '@storybook/addon-a11y';
import { withInfo } from '@storybook/addon-info';
import { withReadme } from 'storybook-readme';
import README from './README.md';

import Button from './index';

storiesOf('Button', module)
.addDecorator((story, context) => withInfo({}, README)(story)(context))
.addDecorator((story, context) => withInfo()(story)(context))
.addDecorator(centered)
.addDecorator(checkA11y)
.addDecorator(withReadme(README))
.add('basic usage', () => (
<Button
label="Click me and check the console!"
Expand Down
4 changes: 3 additions & 1 deletion src/CheckBox/CheckBox.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { storiesOf } from '@storybook/react';
import centered from '@storybook/addon-centered';
import { checkA11y } from '@storybook/addon-a11y';
import { withInfo } from '@storybook/addon-info';
import { withReadme } from 'storybook-readme';

import CheckBox from './index';
import Button from '../Button';
Expand Down Expand Up @@ -46,9 +47,10 @@ class CheckBoxWrapper extends React.Component {
}

storiesOf('CheckBox', module)
.addDecorator((story, context) => withInfo({}, README)(story)(context))
.addDecorator((story, context) => withInfo()(story)(context))
.addDecorator(centered)
.addDecorator(checkA11y)
.addDecorator(withReadme(README))
.add('basic usage', () => (
<CheckBox
name="checkbox"
Expand Down
4 changes: 3 additions & 1 deletion src/Dropdown/Dropdown.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import { storiesOf } from '@storybook/react';
import centered from '@storybook/addon-centered';
import { checkA11y } from '@storybook/addon-a11y';
import { withInfo } from '@storybook/addon-info';
import { withReadme } from 'storybook-readme';

import Dropdown from './index';
import README from './README.md';

storiesOf('Dropdown', module)
.addDecorator((story, context) => withInfo({}, README)(story)(context))
.addDecorator((story, context) => withInfo()(story)(context))
.addDecorator(centered)
.addDecorator(checkA11y)
.addDecorator(withReadme(README))
.add('basic usage', () => (
<Dropdown
title="Search Engines"
Expand Down
4 changes: 3 additions & 1 deletion src/Fieldset/Fieldset.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { storiesOf } from '@storybook/react';
import centered from '@storybook/addon-centered';
import { checkA11y } from '@storybook/addon-a11y';
import { withInfo } from '@storybook/addon-info';
import { withReadme } from 'storybook-readme';

import Fieldset from './index';
import InputText from '../InputText/index';
Expand Down Expand Up @@ -74,9 +75,10 @@ class ValidatedForm extends React.Component {
}

storiesOf('Fieldset', module)
.addDecorator((story, context) => withInfo({}, README)(story)(context))
.addDecorator((story, context) => withInfo()(story)(context))
.addDecorator(centered)
.addDecorator(checkA11y)
.addDecorator(withReadme(README))
.add('basic usage', () => (
<form>
<Fieldset
Expand Down
8 changes: 6 additions & 2 deletions src/Hyperlink/Hyperlink.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { checkA11y } from '@storybook/addon-a11y';
import { action } from '@storybook/addon-actions';
import { setConsoleOptions } from '@storybook/addon-console';
import { withInfo } from '@storybook/addon-info';
import FontAwesomeStyles from 'font-awesome/css/font-awesome.min.css';
import { withReadme } from 'storybook-readme';

import 'font-awesome/css/font-awesome.min.css';

import README from './README.md';

import Hyperlink from './index';
Expand All @@ -22,9 +25,10 @@ const onClick = (event) => {
};

storiesOf('HyperLink', module)
.addDecorator((story, context) => withInfo({ styles: FontAwesomeStyles }, README)(story)(context))
.addDecorator((story, context) => withInfo()(story)(context))
.addDecorator(centered)
.addDecorator(checkA11y)
.addDecorator(withReadme(README))
.add('minimal usage', () => <Hyperlink destination="https://en.wikipedia.org/wiki/Hyperlink" content="edX.org" />)
.add('with blank target', () => (
<Hyperlink
Expand Down
4 changes: 3 additions & 1 deletion src/Icon/Icon.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ import { storiesOf } from '@storybook/react';
import centered from '@storybook/addon-centered';
import { checkA11y } from '@storybook/addon-a11y';
import { withInfo } from '@storybook/addon-info';
import { withReadme } from 'storybook-readme';

import FontAwesomeStyles from 'font-awesome/css/font-awesome.min.css';
import Icon from './index';
import README from './README.md';

storiesOf('Icon', module)
.addDecorator((story, context) => withInfo({}, README)(story)(context))
.addDecorator((story, context) => withInfo()(story)(context))
.addDecorator(centered)
.addDecorator(checkA11y)
.addDecorator(withReadme(README))
.add('basic usage', () => (
<Icon
className={[
Expand Down
4 changes: 3 additions & 1 deletion src/MailtoLink/MailtoLink.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { setConsoleOptions } from '@storybook/addon-console';
import { withInfo } from '@storybook/addon-info';
import centered from '@storybook/addon-centered';
import { checkA11y } from '@storybook/addon-a11y';
import { withReadme } from 'storybook-readme';

import MailtoLink from './index';
import README from './README.md';
Expand All @@ -21,9 +22,10 @@ const onClick = (event) => {
};

storiesOf('MailtoLink', module)
.addDecorator((story, context) => withInfo({}, README)(story)(context))
.addDecorator((story, context) => withInfo()(story)(context))
.addDecorator(centered)
.addDecorator(checkA11y)
.addDecorator(withReadme(README))
.add('minimal usage', () => (
<MailtoLink
to="[email protected]"
Expand Down
5 changes: 4 additions & 1 deletion src/RadioButtonGroup/RadioButtonGroup.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { checkA11y } from '@storybook/addon-a11y';
import { action } from '@storybook/addon-actions';
import { setConsoleOptions } from '@storybook/addon-console';
import { withInfo } from '@storybook/addon-info';
import { withReadme } from 'storybook-readme';

import README from './README.md';

import RadioButtonGroup, { RadioButton } from './index';
Expand Down Expand Up @@ -42,9 +44,10 @@ const onKeyDown = (event) => {
};

storiesOf('RadioButtonGroup', module)
.addDecorator((story, context) => withInfo({}, README)(story)(context))
.addDecorator((story, context) => withInfo()(story)(context))
.addDecorator(centered)
.addDecorator(checkA11y)
.addDecorator(withReadme(README))
.add('unselected minimal usage', () => (
<RadioButtonGroup
name="rbg"
Expand Down
4 changes: 3 additions & 1 deletion src/SearchField/SearchField.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import { action } from '@storybook/addon-actions';
import centered from '@storybook/addon-centered';
import { checkA11y } from '@storybook/addon-a11y';
import { withInfo } from '@storybook/addon-info';
import { withReadme } from 'storybook-readme';

import SearchField from './index';
import README from './README.md';

storiesOf('SearchField', module)
.addDecorator((story, context) => withInfo({}, README)(story)(context))
.addDecorator((story, context) => withInfo()(story)(context))
.addDecorator(centered)
.addDecorator(checkA11y)
.addDecorator(withReadme(README))
.add('basic usage', () => (
<SearchField
onSubmit={action('search-submitted')}
Expand Down

0 comments on commit 9b868e4

Please sign in to comment.