2017-09-13 09:55:58 +03:00
|
|
|
import React from 'react'
|
|
|
|
import { configure, addDecorator } from '@storybook/react'
|
2017-09-09 01:53:27 +03:00
|
|
|
import { setOptions } from '@storybook/addon-options'
|
2017-11-09 20:41:18 +03:00
|
|
|
import '../modules/primer/index.scss'
|
2018-01-09 21:18:34 +03:00
|
|
|
import { version } from '../modules/primer/package.json'
|
2017-08-15 00:44:26 +03:00
|
|
|
|
2017-09-09 01:53:27 +03:00
|
|
|
setOptions({
|
2018-01-09 21:18:34 +03:00
|
|
|
name: `Primer v${version}`,
|
2017-11-09 20:41:18 +03:00
|
|
|
url: 'http://primer.github.io/',
|
2017-09-09 01:53:27 +03:00
|
|
|
showDownPanel: false,
|
|
|
|
})
|
|
|
|
|
2017-09-13 09:55:58 +03:00
|
|
|
addDecorator(story => (
|
|
|
|
<div className='p-4'>
|
|
|
|
{story()}
|
|
|
|
</div>
|
|
|
|
))
|
|
|
|
|
2017-09-12 20:37:07 +03:00
|
|
|
const contexts = [
|
|
|
|
require.context('../modules', true, /stories.*\.js$/),
|
|
|
|
]
|
2017-08-15 00:44:26 +03:00
|
|
|
|
2017-09-12 20:37:07 +03:00
|
|
|
configure(() => {
|
|
|
|
contexts.forEach(context => {
|
|
|
|
context.keys()
|
|
|
|
.filter(key => !key.includes('node_modules'))
|
|
|
|
.forEach(context)
|
|
|
|
})
|
|
|
|
}, module)
|