2017-05-18 21:21:33 +03:00
|
|
|
const webpackConfig = require('react-scripts/config/webpack.config.dev.js');
|
|
|
|
const { defaultHandlers } = require('react-docgen');
|
|
|
|
const dnHandler = require('react-docgen-displayname-handler');
|
2017-09-05 23:21:44 +03:00
|
|
|
const snapguidist = require('snapguidist');
|
2017-05-18 21:21:33 +03:00
|
|
|
const path = require('path');
|
|
|
|
|
2017-09-05 23:21:44 +03:00
|
|
|
module.exports = snapguidist({
|
2017-05-18 21:21:33 +03:00
|
|
|
webpackConfig: Object.assign(webpackConfig, {
|
|
|
|
resolve: Object.assign(webpackConfig.resolve, {
|
|
|
|
alias: Object.assign(webpackConfig.resolve.alias, {
|
|
|
|
'rsg-components/Wrapper': path.join(__dirname, 'src/styleguide/wrapper')
|
|
|
|
})
|
|
|
|
}),
|
|
|
|
module: Object.assign(webpackConfig.module, {
|
|
|
|
rules: webpackConfig.module.rules.map(rule => {
|
|
|
|
if (!(rule.loader || '').match(/babel-loader/)) {
|
|
|
|
return rule;
|
|
|
|
}
|
|
|
|
|
|
|
|
return Object.assign(rule, {
|
|
|
|
options: {
|
|
|
|
babelrc: true,
|
2017-06-27 17:22:05 +03:00
|
|
|
cacheDirectory: false
|
2017-05-18 21:21:33 +03:00
|
|
|
}
|
|
|
|
});
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}),
|
|
|
|
title: 'UI Toolkit',
|
|
|
|
sections: [
|
|
|
|
// {
|
|
|
|
// name: 'Getting Started',
|
|
|
|
// content: 'src/getting-started.md'
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// name: 'Guidelines',
|
|
|
|
// sections: [
|
|
|
|
// {
|
|
|
|
// name: 'Overview',
|
|
|
|
// content: 'src/guidelines/overview.md'
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// name: 'Layout',
|
|
|
|
// content: 'src/guidelines/layout.md'
|
|
|
|
// }
|
|
|
|
// ]
|
|
|
|
// },
|
|
|
|
{
|
|
|
|
name: 'Theme',
|
|
|
|
content: 'src/theme/colors.md'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Components',
|
|
|
|
components: () => [
|
|
|
|
'src/anchor/index.js',
|
|
|
|
'src/button/index.js',
|
2017-06-07 00:22:10 +03:00
|
|
|
'src/breadcrumb/index.js',
|
2017-05-18 21:21:33 +03:00
|
|
|
'src/card/card.js',
|
|
|
|
'src/form/input.js',
|
2017-06-16 17:12:28 +03:00
|
|
|
'src/form/number-input.js',
|
2017-05-18 21:21:33 +03:00
|
|
|
'src/form/checkbox.js',
|
2017-06-15 19:44:04 +03:00
|
|
|
'src/dropdown/index.js',
|
2017-06-27 17:22:05 +03:00
|
|
|
'src/progress-bar/index.js',
|
2017-05-18 21:21:33 +03:00
|
|
|
'src/form/radio.js',
|
|
|
|
'src/form/select.js',
|
|
|
|
'src/form/toggle.js',
|
2017-06-06 22:08:08 +03:00
|
|
|
'src/header/index.js',
|
2017-06-07 02:23:23 +03:00
|
|
|
'src/section-list/index.js',
|
2017-05-30 16:06:18 +03:00
|
|
|
'src/topology/index.js',
|
2017-06-16 17:12:28 +03:00
|
|
|
'src/tooltip/tooltip.js',
|
|
|
|
'src/close-button/index.js',
|
2017-09-08 15:01:37 +03:00
|
|
|
'src/icon-button/index.js',
|
2017-09-14 14:26:57 +03:00
|
|
|
'src/message/index.js',
|
|
|
|
'src/slider/index.js'
|
2017-05-18 21:21:33 +03:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Baseline',
|
|
|
|
content: 'src/baseline/readme.md'
|
|
|
|
}
|
|
|
|
// {
|
|
|
|
// name: 'F.A.Q.',
|
|
|
|
// content: 'src/faq.md'
|
|
|
|
// }
|
|
|
|
],
|
|
|
|
handlers: componentPath =>
|
|
|
|
defaultHandlers.concat(dnHandler.createDisplayNameHandler(componentPath))
|
2017-09-05 23:21:44 +03:00
|
|
|
});
|