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-08-16 21:29:47 +03:00
|
|
|
import '../modules/primer-css/index.scss'
|
2017-08-15 00:44:26 +03:00
|
|
|
|
2017-09-09 01:53:27 +03:00
|
|
|
setOptions({
|
|
|
|
name: 'Primer',
|
|
|
|
url: 'http://primercss.io/',
|
|
|
|
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('.', true, /\.js$/),
|
|
|
|
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)
|