2017-09-13 09:55:58 +03:00
|
|
|
import React from 'react'
|
2019-03-06 09:07:53 +03:00
|
|
|
import {configure, addParameters, addDecorator} from '@storybook/react'
|
2019-03-06 08:43:02 +03:00
|
|
|
import {name, homepage, version} from '../package.json'
|
|
|
|
import {INITIAL_VIEWPORTS} from '@storybook/addon-viewport'
|
2017-08-15 00:44:26 +03:00
|
|
|
|
2019-03-06 22:12:20 +03:00
|
|
|
// this enables HMR for the SCSS source files
|
2019-03-06 08:43:02 +03:00
|
|
|
import '../src/index.scss'
|
2017-09-09 01:53:27 +03:00
|
|
|
|
2019-03-06 22:12:20 +03:00
|
|
|
// wrap every view in 4x padding
|
|
|
|
addDecorator(story => <div className="p-4">{story()}</div>)
|
|
|
|
|
2019-03-06 08:43:02 +03:00
|
|
|
addParameters({
|
|
|
|
options: {
|
|
|
|
brandTitle: `${name}@${version}`,
|
|
|
|
brandUrl: homepage,
|
|
|
|
showAddonsPanel: false
|
|
|
|
},
|
|
|
|
viewport: {
|
2019-03-06 22:01:24 +03:00
|
|
|
viewports: {
|
2019-03-06 08:43:02 +03:00
|
|
|
sm: {
|
2019-03-06 22:12:20 +03:00
|
|
|
name: 'Small ($width-sm)',
|
|
|
|
styles: {width: '544px', height: 'auto'}
|
2019-03-06 08:43:02 +03:00
|
|
|
},
|
|
|
|
md: {
|
2019-03-06 22:12:20 +03:00
|
|
|
name: 'Medium ($width-md)',
|
|
|
|
styles: {width: '768px', height: 'auto'}
|
2019-03-06 08:43:02 +03:00
|
|
|
},
|
|
|
|
lg: {
|
2019-03-06 22:12:20 +03:00
|
|
|
name: 'Large ($width-lg)',
|
|
|
|
styles: {width: '1012px', height: 'auto'}
|
2019-03-06 08:43:02 +03:00
|
|
|
},
|
|
|
|
xl: {
|
2019-03-06 22:12:20 +03:00
|
|
|
name: 'XL ($width-xl)',
|
|
|
|
styles: {width: '1280px', height: 'auto'}
|
2019-03-06 22:01:24 +03:00
|
|
|
},
|
|
|
|
...INITIAL_VIEWPORTS
|
|
|
|
}
|
2019-03-06 08:43:02 +03:00
|
|
|
}
|
|
|
|
})
|
2017-09-13 09:55:58 +03:00
|
|
|
|
2017-09-12 20:37:07 +03:00
|
|
|
configure(() => {
|
2019-03-08 01:41:36 +03:00
|
|
|
const loadMarkdown = require.context('../pages/css', true, /\.md$/)
|
2019-03-06 08:43:02 +03:00
|
|
|
for (const path of loadMarkdown.keys()) {
|
|
|
|
loadMarkdown(path)
|
|
|
|
}
|
2017-09-12 20:37:07 +03:00
|
|
|
}, module)
|