1
1
mirror of https://github.com/primer/css.git synced 2024-11-28 13:12:16 +03:00
css/.storybook/config.js

30 lines
656 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-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
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/',
showDownPanel: false,
})
2017-09-13 09:55:58 +03:00
addDecorator(story => (
<div className='p-4'>
{story()}
</div>
))
const contexts = [
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)