Skip to content

Commit

Permalink
docs(staging): Enable tooltip in staging.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanoglesby08 committed Oct 4, 2017
1 parent 397fd80 commit 066e38e
Showing 1 changed file with 87 additions and 80 deletions.
167 changes: 87 additions & 80 deletions config/styleguide.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,25 @@ const { version } = require('../package.json')

const styleguidistEnv = process.env.STYLEGUIDIST_ENV || 'dev' // dev, staging, production

const enabledInStaging = ['Icon', 'Dividers']
const enabledInStaging = ['Icon', 'Dividers', 'Tooltip']

/* eslint-disable no-unused-vars */
const toggleByEnv = (component, toggledOffValue, toggledOnValue) => {
switch (styleguidistEnv) {
case 'dev': return toggledOffValue
case 'staging': return enabledInStaging.includes(component) ? toggledOffValue : toggledOnValue
case 'production': return toggledOnValue
default: return toggledOnValue
case 'dev':
return toggledOffValue
case 'staging':
return enabledInStaging.includes(component) ? toggledOffValue : toggledOnValue
case 'production':
return toggledOnValue
default:
return toggledOnValue
}
}

const compact = array => (
array.filter(element => element !== undefined)
)
const compact = array => array.filter(element => element !== undefined)
/* eslint-enable no-unused-vars */


module.exports = {
title: `TDS v${version}`,

Expand Down Expand Up @@ -71,67 +72,71 @@ module.exports = {
sections: [
{
name: 'Getting started',
content: path.resolve('docs/intro/getting-started.md')
content: path.resolve('docs/intro/getting-started.md'),
},
{
name: 'Design vision',
content: path.resolve('docs/intro/design-vision.md')
content: path.resolve('docs/intro/design-vision.md'),
},
{
name: 'Releases',
content: path.resolve('docs/intro/releases.md')
content: path.resolve('docs/intro/releases.md'),
},
{
name: 'Contributing',
content: path.resolve('docs/intro/contributions.md')
}
]
content: path.resolve('docs/intro/contributions.md'),
},
],
},
{
name: 'Foundational elements',
content: path.resolve('docs/elements/intro.md'),
sections: [
{
name: 'Buttons',
content: path.resolve('docs/elements/buttons.md')
content: path.resolve('docs/elements/buttons.md'),
},
{
name: 'Links',
content: path.resolve('docs/elements/links.md')
content: path.resolve('docs/elements/links.md'),
},
{
name: 'Colours',
content: path.resolve('docs/elements/colours.md')
content: path.resolve('docs/elements/colours.md'),
},
{
name: 'Forms',
content: path.resolve('docs/elements/forms-with-deprecated-input.md')
content: path.resolve('docs/elements/forms-with-deprecated-input.md'),
},
{
name: 'Grid',
content: path.resolve('docs/elements/grid.md')
content: path.resolve('docs/elements/grid.md'),
},
{
name: 'Lists',
content: path.resolve('docs/elements/lists-deprecated.md')
content: path.resolve('docs/elements/lists-deprecated.md'),
},
{
name: 'Typography',
content: path.resolve('docs/elements/typography.md')
content: path.resolve('docs/elements/typography.md'),
},
{
name: 'Utility icons',
content: toggleByEnv('Icon', path.resolve('docs/elements/utility-icons-deprecated.md'), path.resolve('docs/elements/utility-icons.md'))
content: toggleByEnv(
'Icon',
path.resolve('docs/elements/utility-icons-deprecated.md'),
path.resolve('docs/elements/utility-icons.md')
),
},
{
name: 'Utility mixins',
content: path.resolve('docs/elements/utility-mixins.md')
content: path.resolve('docs/elements/utility-mixins.md'),
},
{
name: 'Design tokens',
content: path.resolve('docs/elements/design-tokens.md')
}
]
content: path.resolve('docs/elements/design-tokens.md'),
},
],
},
{
name: 'Components',
Expand All @@ -142,16 +147,14 @@ module.exports = {
return [
path.resolve('src/old-components/Grid/Container/Container.jsx'),
path.resolve('src/old-components/Grid/Row/Row.jsx'),
path.resolve('src/old-components/Grid/Column/Column.jsx')
path.resolve('src/old-components/Grid/Column/Column.jsx'),
]
}
},
},
{
name: 'Content',
components() {
return [
path.resolve('src/old-components/Card/Card.jsx')
]
return [path.resolve('src/old-components/Card/Card.jsx')]
},
sections: compact([
{
Expand All @@ -160,40 +163,40 @@ module.exports = {
return [
path.resolve('src/components/Link/Link.jsx'),
path.resolve('src/components/Link/ChevronLink/ChevronLink.jsx'),
path.resolve('src/components/Link/ButtonLink/ButtonLink.jsx')
path.resolve('src/components/Link/ButtonLink/ButtonLink.jsx'),
]
}
},
},
{
name: 'Lists',
content: path.resolve('src/components/Lists/Lists.md'),
components() {
return [
path.resolve('src/components/Lists/UnorderedList/UnorderedList.jsx'),
path.resolve('src/components/Lists/OrderedList/OrderedList.jsx')
path.resolve('src/components/Lists/OrderedList/OrderedList.jsx'),
]
}
},
},
{
name: 'Expand collapse',
components() {
return [
path.resolve('src/old-components/ExpandCollapse/Group.jsx'),
path.resolve('src/old-components/ExpandCollapse/Panel.jsx')
path.resolve('src/old-components/ExpandCollapse/Panel.jsx'),
]
}
},
},
toggleByEnv('Dividers', {
name: 'Dividers',
components() {
return [
path.resolve('src/components/Dividers/WaveDivider/WaveDivider.jsx'),
path.resolve('src/components/Dividers/DimpleDivider/DimpleDivider.jsx'),
path.resolve('src/components/Dividers/HairlineDivider/HairlineDivider.jsx')
path.resolve('src/components/Dividers/HairlineDivider/HairlineDivider.jsx'),
]
}
})
])
},
}),
]),
},
{
name: 'Typography',
Expand All @@ -208,45 +211,53 @@ module.exports = {
path.resolve('src/components/Typography/Text/TextSup/TextSup.jsx'),
// Hiding Text subscripts until we identify a concrete use for them
path.resolve('src/components/Typography/Strong/Strong.jsx'),
path.resolve('src/components/Typography/Small/Small.jsx')
path.resolve('src/components/Typography/Small/Small.jsx'),
]
}
},
},
{
name: 'Headings',
components() {
return [
path.resolve('src/components/Typography/DisplayHeading/DisplayHeading.jsx'),
path.resolve('src/components/Typography/DisplayHeading/DisplayHeadingSup/DisplayHeadingSup.jsx'),
path.resolve(
'src/components/Typography/DisplayHeading/DisplayHeadingSup/DisplayHeadingSup.jsx'
),
// Hiding DisplayHeading subscripts until we identify a concrete use for them
path.resolve('src/components/Typography/Heading/Heading.jsx'),
path.resolve('src/components/Typography/Heading/HeadingSup/HeadingSup.jsx')
path.resolve('src/components/Typography/Heading/HeadingSup/HeadingSup.jsx'),
// Hiding Heading subscripts until we identify a concrete use for them
]
}
}
]
},
},
],
},
{
name: 'Icons',
content: toggleByEnv('Icon', path.resolve('src/components/Icons/icons.md')),
components() {
return compact([
toggleByEnv('Icon', path.resolve('src/components/Icons/DecorativeIcon/DecorativeIcon.jsx')),
toggleByEnv('Icon', path.resolve('src/components/Icons/StandaloneIcon/StandaloneIcon.jsx')),
path.resolve('src/old-components/Icon/Icon.jsx')
toggleByEnv(
'Icon',
path.resolve('src/components/Icons/DecorativeIcon/DecorativeIcon.jsx')
),
toggleByEnv(
'Icon',
path.resolve('src/components/Icons/StandaloneIcon/StandaloneIcon.jsx')
),
path.resolve('src/old-components/Icon/Icon.jsx'),
])
}
},
},
{
name: 'Feedback indicators',
components() {
return [
path.resolve('src/components/Notification/Notification.jsx'),
path.resolve('src/old-components/Spinner/Spinner.jsx'),
path.resolve('src/old-components/StepTracker/Steps/Steps.jsx')
path.resolve('src/old-components/StepTracker/Steps/Steps.jsx'),
]
}
},
},
{
name: 'Forms',
Expand All @@ -255,33 +266,29 @@ module.exports = {
path.resolve('src/components/Button/Button.jsx'),
path.resolve('src/components/Input/Input.jsx'),
toggleByEnv('Tooltip', path.resolve('src/components/Tooltip/Tooltip.jsx')),
path.resolve('src/old-components/SelectorCounter/SelectorCounter.jsx')
path.resolve('src/old-components/SelectorCounter/SelectorCounter.jsx'),
])
}
}
]
}
},
},
],
},
],


template: path.resolve('docs/index.html'),
assetsDir: path.resolve('docs/assets/'),
styleguideDir: path.resolve('styleguide', styleguidistEnv),
require: [
path.resolve('src/scss/global.scss'),
path.resolve('docs/scss/styleguide.scss')
],
require: [path.resolve('src/scss/global.scss'), path.resolve('docs/scss/styleguide.scss')],
styleguideComponents: {
Logo: path.resolve('docs/components/Logo/Logo'),
Markdown: path.resolve('docs/components/Markdown/Markdown.js')
Markdown: path.resolve('docs/components/Markdown/Markdown.js'),
},
webpackConfig: {
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: 'babel-loader'
use: 'babel-loader',
},
{
test: /\.modules.scss$/,
Expand All @@ -292,33 +299,33 @@ module.exports = {
options: {
modules: true,
localIdentName: 'TDS_[name]__[local]___[hash:base64:5]',
importLoaders: 1 // Number of loaders applied before CSS loader
}
importLoaders: 1, // Number of loaders applied before CSS loader
},
},
'sass-loader'
]
'sass-loader',
],
},
{
test: /\.scss$/,
exclude: /\.modules.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
use: ['style-loader', 'css-loader', 'sass-loader'],
},
{
test: /\.(png|jpg|svg)$/,
use: 'url-loader'
}
]
}
use: 'url-loader',
},
],
},
},
theme: {
fontFamily: {
base: ['TELUS-Web', 'Helvetica Neue', 'Helvetica', 'Arial', 'sans-serif']
base: ['TELUS-Web', 'Helvetica Neue', 'Helvetica', 'Arial', 'sans-serif'],
},
color: {
link: '#4B286D',
linkHover: '#54595F',
sidebarBackground: '#FFFFFF'
sidebarBackground: '#FFFFFF',
},
sidebarWidth: 240
}
sidebarWidth: 240,
},
}

0 comments on commit 066e38e

Please sign in to comment.