1
1
mirror of https://github.com/primer/css.git synced 2024-12-24 22:53:58 +03:00
css/.storybook/config.js

30 lines
626 B
JavaScript
Raw Normal View History

2017-09-13 09:55:58 +03:00
import React from 'react'
import { configure, addDecorator } from '@storybook/react'
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
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>
))
const contexts = [
require.context('.', true, /\.js$/),
require.context('../modules', true, /stories.*\.js$/),
]
2017-08-15 00:44:26 +03:00
configure(() => {
contexts.forEach(context => {
context.keys()
.filter(key => !key.includes('node_modules'))
.forEach(context)
})
}, module)