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-26 14:12:15 +03:00
|
|
|
module.exports = {
|
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: [
|
|
|
|
{
|
2017-09-26 14:12:15 +03:00
|
|
|
name: 'Get Started',
|
|
|
|
sections: [
|
|
|
|
{
|
|
|
|
name: 'Overview',
|
|
|
|
content: 'src/overview.md'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Purpose',
|
|
|
|
content: 'src/purpose.md'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'FAQ',
|
|
|
|
content: 'src/faq.md'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Support',
|
|
|
|
content: 'src/support.md'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'File Structure',
|
|
|
|
content: 'src/file-structure.md'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Download',
|
|
|
|
content: 'src/download.md'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Contribute',
|
|
|
|
content: 'src/contribute.md'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Base',
|
|
|
|
sections: [
|
|
|
|
{
|
|
|
|
name: 'Typography',
|
|
|
|
content: 'src/text/Readme.md'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Baseline',
|
|
|
|
content: 'src/baseline/readme.md'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Colours',
|
|
|
|
content: 'src/theme/colors.md'
|
|
|
|
}
|
|
|
|
]
|
2017-05-18 21:21:33 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Components',
|
|
|
|
components: () => [
|
|
|
|
'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',
|
2017-09-26 19:07:45 +03:00
|
|
|
'src/slider/index.js',
|
|
|
|
'src/icons/icons.js'
|
2017-05-18 21:21:33 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
2017-09-26 14:12:15 +03:00
|
|
|
theme: {
|
|
|
|
color: {
|
|
|
|
base: '#494949',
|
|
|
|
link: '#3B46CC',
|
|
|
|
linkHover: '#5a62c5'
|
|
|
|
},
|
|
|
|
fontSize: {
|
|
|
|
base: 15,
|
|
|
|
text: 15,
|
|
|
|
small: 13,
|
|
|
|
h1: 36,
|
|
|
|
h2: 30,
|
|
|
|
h3: 26,
|
|
|
|
h4: 15,
|
|
|
|
h5: 14,
|
|
|
|
h6: 12
|
|
|
|
},
|
|
|
|
fontFamily: {
|
|
|
|
base: '"Libre Franklin", -apple-system, cursive'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
styles: {
|
|
|
|
Logo: {
|
|
|
|
logo: {
|
|
|
|
'text-indent': -999,
|
|
|
|
'background-image': 'url("./etc/joyent-white.png")',
|
|
|
|
'background-size': 'cover',
|
|
|
|
width: 180,
|
|
|
|
'background-position': 0,
|
|
|
|
height: 39,
|
|
|
|
padding: 0,
|
|
|
|
margin: 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2017-05-18 21:21:33 +03:00
|
|
|
handlers: componentPath =>
|
|
|
|
defaultHandlers.concat(dnHandler.createDisplayNameHandler(componentPath))
|
2017-09-26 14:12:15 +03:00
|
|
|
};
|