-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.js
31 lines (28 loc) · 1.03 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { storiesOf, configure, addDecorator } from '@storybook/react'
import { withMarkdownNotes } from '@storybook/addon-notes'
import { withKnobs } from '@storybook/addon-knobs'
import { setOptions } from '@storybook/addon-options'
import { withConsole } from '@storybook/addon-console'
import * as picturebook from '../../dist/picturebook.web'
/**
* Some addons can be defined globally, e.g options or knobs. This is the
* simplest use case
*/
setOptions({
name: 'Test Storybook',
})
addDecorator(withKnobs)
addDecorator((storyFn, context) => withConsole()(storyFn)(context))
function loadStories() {
picturebook.loadStories({
storiesOf,
/**
* For components that we want to customize on a per-story basis like
* providing component-specific documentation, the decorators array allows
* specifying any modifiers to each story
*/
decorators: [(story, { doc }) => doc && withMarkdownNotes(doc)(story)],
stories: require.context('../stories', true, /\.(js|md|png)/),
})
}
configure(loadStories, module)