2017-11-23 14:18:38 +02:00
const { NODE _ENV } = process . env ;
const env = NODE _ENV === 'production' ? 'prod' : 'dev' ;
// const resolvePkg = require('resolve-pkg');
const webpackConfig = require ( ` joyent-react-scripts/config/webpack.config. ${ env } .js ` ) ;
2017-05-18 21:21:33 +03:00
const { defaultHandlers } = require ( 'react-docgen' ) ;
const dnHandler = require ( 'react-docgen-displayname-handler' ) ;
const path = require ( 'path' ) ;
2017-09-26 14:12:15 +03:00
module . exports = {
2018-02-26 14:07:30 +02:00
editorConfig : {
theme : 'base16-light'
} ,
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' )
} )
} )
} ) ,
2017-12-15 16:09:09 +02:00
styleguideComponents : {
StyleGuideRenderer : path . join ( _ _dirname , 'src/styleguide/renderer' ) ,
TableOfContentsRenderer : path . join ( _ _dirname , 'src/styleguide/sidebar' ) ,
ReactComponentRenderer : path . join ( _ _dirname , 'src/styleguide/component' ) ,
PlaygroundRenderer : path . join ( _ _dirname , 'src/styleguide/playground' ) ,
TabButtonRenderer : path . join ( _ _dirname , 'src/styleguide/tabs' ) ,
SectionHeadingRenderer : path . join (
_ _dirname ,
'src/styleguide/sectionHeading'
) ,
SectionRenderer : path . join ( _ _dirname , 'src/styleguide/section' )
} ,
title : 'Design System' ,
showCode : true ,
2017-05-18 21:21:33 +03:00
sections : [
{
2017-12-15 16:09:09 +02:00
name : 'Base Language' ,
2017-09-26 14:12:15 +03:00
sections : [
{
2017-12-15 16:09:09 +02:00
name : 'Color Palette' ,
description :
'Triton’ s color palette aim to accessible and clear, whilst making distinctions between elements that are alive and elements that are static. We’ ve split our palette into two sections; Action colors and Greys. ' ,
content : 'src/theme/colors.md'
2017-09-26 14:12:15 +03:00
} ,
{
2017-12-15 16:09:09 +02:00
name : 'Typography' ,
content : 'src/text/Readme.md'
}
]
} ,
{
name : 'Basic Components' ,
components : ( ) => [
'src/button/index.js' ,
'src/form/input.js' ,
'src/form/radio.js' ,
'src/form/select.js' ,
'src/form/checkbox.js' ,
'src/form/toggle.js' ,
'src/card/card.js' ,
'src/tooltip/index.js' ,
'src/popover/index.js'
]
} ,
{
name : 'Compound Components' ,
components : ( ) => [
'src/table/index.js' ,
'src/message/index.js' ,
'src/section-list/index.js' ,
2017-12-18 15:42:56 +02:00
'src/breadcrumb/index.js'
2017-12-15 16:09:09 +02:00
]
} ,
{
name : 'Assets' ,
sections : [
2017-09-26 14:12:15 +03:00
{
2017-12-15 16:09:09 +02:00
name : 'Section Iconography' ,
content : 'src/icons/section.md'
2017-09-26 14:12:15 +03:00
} ,
{
2017-12-15 16:09:09 +02:00
name : 'Functional Iconography' ,
content : 'src/icons/functional.md'
2017-09-26 14:12:15 +03:00
}
]
} ,
{
2017-12-15 16:09:09 +02:00
name : 'Developer' ,
2017-09-26 14:12:15 +03:00
sections : [
{
2017-12-15 16:09:09 +02:00
name : 'Download' ,
content : 'src/download.md'
2017-09-26 14:12:15 +03:00
} ,
{
2017-12-15 16:09:09 +02:00
name : 'Contribute' ,
content : 'src/contribute.md'
2017-11-23 14:18:38 +02:00
} ,
{
2017-12-15 16:09:09 +02:00
name : 'FAQ' ,
content : 'src/faq.md'
2017-09-26 14:12:15 +03:00
}
]
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
} ;