This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
106 changed files
with
4,374 additions
and
6,407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
const chromaticTestStories = ['../src/**/*.stories.spec.@(tsx|mdx)']; | ||
const storybookStories = ['./**/*.stories.@(tsx|mdx)', '../src/**/*.stories.@(tsx|mdx)']; | ||
|
||
const chromaticTestStories = ['../src/**/__tests__/*.stories.@(tsx|mdx)']; | ||
const storybookStories = ['./**/*.stories.@(tsx|mdx)', '../src/components/*/*.stories.@(tsx|mdx)']; | ||
module.exports = { | ||
stories: process.env.CHROMATIC ? chromaticTestStories : storybookStories, | ||
addons: [ | ||
'@storybook/addon-backgrounds', | ||
'storybook-addon-designs', | ||
'@storybook/addon-designs', | ||
'@storybook/addon-docs', | ||
'@storybook/addon-controls', | ||
{ | ||
name: '@storybook/addon-postcss', | ||
name: '@storybook/addon-styling', | ||
options: { | ||
postcssLoaderOptions: { | ||
postCss: { | ||
implementation: require('postcss'), | ||
}, | ||
cssLoaderOptions: { | ||
sourceMap: true, | ||
modules: { | ||
localIdentName: '[name]__[local]___[hash:base64:5]', | ||
}, | ||
importLoaders: 1, | ||
cssModules: { | ||
localIdentName: '[name]__[local]___[hash:base64:5]', | ||
}, | ||
}, | ||
}, | ||
'@storybook/addon-mdx-gfm', | ||
], | ||
features: { | ||
// Use babel config from project root .babelrc file | ||
babelModeV7: true, | ||
}, | ||
core: { | ||
builder: 'webpack5', | ||
framework: { | ||
name: '@storybook/react-webpack5', | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: true, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,57 @@ | ||
import { addDecorator, addParameters } from '@storybook/react'; | ||
import { withDesign } from 'storybook-addon-designs'; | ||
import { Preview } from '@storybook/react'; | ||
import { COLOR } from '../src/constants'; | ||
import '../src/index.css'; | ||
|
||
import theme from './theme'; | ||
import { | ||
ABOUT_AHOY, | ||
CHANGELOG, | ||
COMPOSITIONS, | ||
FOUNDATION, | ||
LOW_LEVEL_BLOCKS, | ||
MARKETING, | ||
MID_LEVEL_BLOCKS, | ||
PLAYGROUND, | ||
} from './utils'; | ||
|
||
addParameters({ | ||
backgrounds: { | ||
values: [ | ||
{ name: 'Aqua lightest', value: COLOR.AQUA.LIGHTEST }, | ||
{ name: 'Neutral light', value: COLOR.NEUTRAL.LIGHT }, | ||
{ name: 'Gold lightest', value: COLOR.GOLD.LIGHTEST }, | ||
{ name: 'Mint lightest', value: COLOR.MINT.LIGHTEST }, | ||
{ name: 'Ruby lightest', value: COLOR.RUBY.LIGHTEST }, | ||
{ name: 'Teal lightest', value: COLOR.TEAL.LIGHTEST }, | ||
{ name: 'Violet lightest', value: COLOR.VIOLET.LIGHTEST }, | ||
{ name: 'Teal darkest', value: COLOR.TEAL.DARKEST }, | ||
], | ||
}, | ||
}); | ||
|
||
addParameters({ | ||
options: { | ||
storySort: { | ||
order: [ | ||
ABOUT_AHOY, | ||
CHANGELOG, | ||
FOUNDATION, | ||
LOW_LEVEL_BLOCKS, | ||
MID_LEVEL_BLOCKS, | ||
COMPOSITIONS, | ||
MARKETING, | ||
PLAYGROUND, | ||
const preview: Preview = { | ||
parameters: { | ||
backgrounds: { | ||
values: [ | ||
{ name: 'Aqua lightest', value: COLOR.AQUA.LIGHTEST }, | ||
{ name: 'Neutral light', value: COLOR.NEUTRAL.LIGHT }, | ||
{ name: 'Gold lightest', value: COLOR.GOLD.LIGHTEST }, | ||
{ name: 'Mint lightest', value: COLOR.MINT.LIGHTEST }, | ||
{ name: 'Ruby lightest', value: COLOR.RUBY.LIGHTEST }, | ||
{ name: 'Teal lightest', value: COLOR.TEAL.LIGHTEST }, | ||
{ name: 'Violet lightest', value: COLOR.VIOLET.LIGHTEST }, | ||
{ name: 'Teal darkest', value: COLOR.TEAL.DARKEST }, | ||
], | ||
}, | ||
}, | ||
}); | ||
|
||
addParameters({ | ||
docs: { | ||
theme, | ||
/** | ||
* @todo temporary workaround to avoid JSDOC parameters from being rendered | ||
* remove once there are no longer any @type annotations in any javascript files | ||
*/ | ||
description: { | ||
component: ' ', | ||
options: { | ||
storySort: { | ||
order: [ | ||
'About Ahoy', | ||
'Changelog', | ||
'Foundation', | ||
'Low level blocks', | ||
'Mid level blocks', | ||
'Compositions', | ||
'Marketing', | ||
'Playground', | ||
], | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
addParameters({ | ||
viewMode: 'docs', | ||
previewTabs: { | ||
canvas: { | ||
hidden: process.env.STORYBOOK_HIDE_CANVAS_TAB === 'true', | ||
docs: { | ||
theme, | ||
/** | ||
* @todo temporary workaround to avoid JSDOC parameters from being rendered | ||
* remove once there are no longer any @type annotations in any javascript files | ||
*/ | ||
description: { | ||
component: ' ', | ||
}, | ||
}, | ||
'storybook/docs/panel': { | ||
hidden: process.env.STORYBOOK_HIDE_DOCS_TAB === 'true', | ||
viewMode: 'docs', | ||
previewTabs: { | ||
canvas: { | ||
hidden: process.env.STORYBOOK_HIDE_CANVAS_TAB === 'true', | ||
}, | ||
'storybook/docs/panel': { | ||
hidden: process.env.STORYBOOK_HIDE_DOCS_TAB === 'true', | ||
}, | ||
}, | ||
}, | ||
}); | ||
}; | ||
|
||
// addon-designs | ||
addDecorator(withDesign()); | ||
export default preview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import { Meta, Description } from '@storybook/addon-docs'; | ||
|
||
import changelog from '../../CHANGELOG.md'; | ||
import { Meta, Markdown } from '@storybook/blocks'; | ||
import Changelog from '../../CHANGELOG.md'; | ||
|
||
<Meta title="Changelog" /> | ||
|
||
<Description markdown={changelog} /> | ||
<Markdown>{Changelog}</Markdown> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.