1
1
mirror of https://github.com/primer/css.git synced 2024-12-19 04:01:49 +03:00
css/.storybook/config.js
2017-09-12 23:55:58 -07:00

30 lines
626 B
JavaScript

import React from 'react'
import { configure, addDecorator } from '@storybook/react'
import { setOptions } from '@storybook/addon-options'
import '../modules/primer-css/index.scss'
setOptions({
name: 'Primer',
url: 'http://primercss.io/',
showDownPanel: false,
})
addDecorator(story => (
<div className='p-4'>
{story()}
</div>
))
const contexts = [
require.context('.', true, /\.js$/),
require.context('../modules', true, /stories.*\.js$/),
]
configure(() => {
contexts.forEach(context => {
context.keys()
.filter(key => !key.includes('node_modules'))
.forEach(context)
})
}, module)