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-10-11 14:01:26 +03:00
|
|
|
highlightTheme: 'base16-light',
|
2017-10-04 20:30:10 +03:00
|
|
|
require: [path.join(__dirname, 'etc/style.css')],
|
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, {
|
2017-10-09 16:35:52 +03:00
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.svg$/,
|
|
|
|
loader: 'svg-inline-loader'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.css$/,
|
|
|
|
use: ['style-loader', 'css-loader']
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(js|jsx)$/,
|
|
|
|
use: ['babel-loader']
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(eot|ttf|woff|woff2)$/,
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: 'file-loader'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
|
|
|
|
loader: 'url-loader',
|
2017-05-18 21:21:33 +03:00
|
|
|
options: {
|
2017-10-09 16:35:52 +03:00
|
|
|
limit: 10000,
|
|
|
|
name: 'static/media/[name].[hash:8].[ext]'
|
2017-05-18 21:21:33 +03:00
|
|
|
}
|
2017-10-09 16:35:52 +03:00
|
|
|
}
|
|
|
|
]
|
2017-05-18 21:21:33 +03:00
|
|
|
})
|
|
|
|
}),
|
|
|
|
title: 'UI Toolkit',
|
|
|
|
sections: [
|
|
|
|
{
|
2017-10-04 16:27:57 +03:00
|
|
|
name: 'Get Started',
|
2017-09-26 14:12:15 +03:00
|
|
|
sections: [
|
|
|
|
{
|
|
|
|
name: 'Overview',
|
|
|
|
content: 'src/overview.md'
|
|
|
|
},
|
|
|
|
{
|
2017-10-03 17:30:45 +03:00
|
|
|
name: 'Download',
|
|
|
|
content: 'src/download.md'
|
2017-09-26 14:12:15 +03:00
|
|
|
},
|
|
|
|
{
|
2017-10-03 17:30:45 +03:00
|
|
|
name: 'Contribute',
|
|
|
|
content: 'src/contribute.md'
|
2017-09-26 14:12:15 +03:00
|
|
|
},
|
|
|
|
{
|
2017-10-03 17:30:45 +03:00
|
|
|
name: 'Support',
|
|
|
|
content: 'src/support.md'
|
2017-09-26 14:12:15 +03:00
|
|
|
},
|
|
|
|
{
|
2017-10-03 17:30:45 +03:00
|
|
|
name: 'FAQ',
|
|
|
|
content: 'src/faq.md'
|
2017-09-26 14:12:15 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Base',
|
|
|
|
sections: [
|
|
|
|
{
|
|
|
|
name: 'Typography',
|
|
|
|
content: 'src/text/Readme.md'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Baseline',
|
|
|
|
content: 'src/baseline/readme.md'
|
|
|
|
},
|
|
|
|
{
|
2017-10-03 17:30:45 +03:00
|
|
|
name: 'Colors',
|
2017-09-26 14:12:15 +03:00
|
|
|
content: 'src/theme/colors.md'
|
|
|
|
}
|
|
|
|
]
|
2017-05-18 21:21:33 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Components',
|
|
|
|
components: () => [
|
2017-06-07 00:22:10 +03:00
|
|
|
'src/breadcrumb/index.js',
|
2017-10-04 19:19:35 +03:00
|
|
|
'src/button/index.js',
|
2017-05-18 21:21:33 +03:00
|
|
|
'src/card/card.js',
|
|
|
|
'src/form/checkbox.js',
|
2017-10-04 19:19:35 +03:00
|
|
|
'src/header/index.js',
|
|
|
|
'src/icons/icons.js',
|
|
|
|
'src/form/input.js',
|
|
|
|
'src/message/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',
|
2017-10-04 19:19:35 +03:00
|
|
|
'src/section-list/index.js',
|
2017-05-18 21:21:33 +03:00
|
|
|
'src/form/select.js',
|
|
|
|
'src/form/toggle.js',
|
2017-10-10 13:15:35 +03:00
|
|
|
'src/topology/index.js'
|
2017-05-18 21:21:33 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
2017-09-26 14:12:15 +03:00
|
|
|
theme: {
|
|
|
|
color: {
|
|
|
|
base: '#494949',
|
|
|
|
link: '#3B46CC',
|
2017-10-04 20:30:10 +03:00
|
|
|
linkHover: '#5a62c5',
|
|
|
|
sidebarBackground: '#1E313B'
|
2017-09-26 14:12:15 +03:00
|
|
|
},
|
|
|
|
fontSize: {
|
|
|
|
base: 15,
|
|
|
|
text: 15,
|
|
|
|
small: 13,
|
|
|
|
h1: 36,
|
|
|
|
h2: 30,
|
|
|
|
h3: 26,
|
|
|
|
h4: 15,
|
|
|
|
h5: 14,
|
|
|
|
h6: 12
|
|
|
|
},
|
|
|
|
fontFamily: {
|
2017-10-04 20:30:10 +03:00
|
|
|
base: ['"Libre Franklin", -apple-system, sans-serif'],
|
|
|
|
monospace: [
|
|
|
|
'Roboto Mono',
|
|
|
|
'Consolas',
|
|
|
|
'"Liberation Mono"',
|
|
|
|
'Menlo',
|
|
|
|
'monospace'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
sidebarWidth: 300,
|
|
|
|
spaceFactor: 6
|
2017-09-26 14:12:15 +03:00
|
|
|
},
|
|
|
|
styles: {
|
2017-10-04 20:30:10 +03:00
|
|
|
Styleguide: {
|
|
|
|
sidebar: {
|
|
|
|
color: '#FFFFFF'
|
|
|
|
}
|
|
|
|
},
|
2017-09-26 14:12:15 +03:00
|
|
|
Logo: {
|
2017-10-04 20:30:10 +03:00
|
|
|
border: 'none',
|
2017-09-26 14:12:15 +03:00
|
|
|
logo: {
|
|
|
|
'text-indent': -999,
|
|
|
|
'background-image': 'url("./etc/joyent-white.png")',
|
|
|
|
'background-size': 'cover',
|
|
|
|
width: 180,
|
|
|
|
'background-position': 0,
|
|
|
|
height: 39,
|
|
|
|
padding: 0,
|
2017-10-04 20:30:10 +03:00
|
|
|
margin: '0 auto'
|
2017-09-26 14:12:15 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2017-05-18 21:21:33 +03:00
|
|
|
handlers: componentPath =>
|
|
|
|
defaultHandlers.concat(dnHandler.createDisplayNameHandler(componentPath))
|
2017-09-26 14:12:15 +03:00
|
|
|
};
|