Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storybook #1645

Closed
wants to merge 18 commits into from
Prev Previous commit
Next Next commit
fix a11y
  • Loading branch information
SaraVieira committed Jun 7, 2019
commit 002b3f54f33b8f5ac213a34b80bca71cbb167526
28 changes: 28 additions & 0 deletions packages/common/.storybook/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react';
import { configure, addDecorator, addParameters } from '@storybook/react';
import { withKnobs } from '@storybook/addon-knobs';
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
import { withA11y } from '@storybook/addon-a11y';
import { ThemeProvider } from 'styled-components';
import theme from '../src/theme.ts';
import storybookTheme from './theme';

addParameters({
options: {
theme: storybookTheme,
},
});

addParameters({ viewport: INITIAL_VIEWPORTS });

// automatically import all files ending in *.stories.js
const req = require.context('../src/components/', true, /.stories.js$/);
function loadStories() {
req.keys().forEach(filename => req(filename));
}

addDecorator(story => <ThemeProvider theme={theme}>{story()}</ThemeProvider>);

configure(loadStories, module);
addDecorator(withKnobs);
addDecorator(withA11y);