UNPKG

672 BJavaScriptView Raw
1import { configure, addParameters } from '@storybook/react';
2
3// To control the order in which story folders are presented and keep the "Welcome" page at the top
4// https://storybook.js.org/docs/basics/writing-stories/#loading-stories
5const loaderFn = () => {
6 const allExports = [require('../src/story/StyleGuide/Welcome/components.stories.js')];
7 const req = require.context('../src/story', true, /\.stories\.js$/);
8 req.keys().forEach(fname => {
9 allExports.push(req(fname)
10 )
11 });
12 return allExports;
13};
14
15configure(loaderFn, module);
16
17addParameters({
18 backgrounds: [
19 { name: 'light', value: '#FFFFFF', default: true },
20 { name: 'grey', value: '#f3f3f4' }
21 ]
22});