-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): configure Storybook Docs (#495)
* cleanup warnings + more deps updates Co-authored-by: Dmitri Voronianski <[email protected]> * remove deprecacted storybook methods * feat(docs): upgrade to Storybook 5.2 * feat(docs): update Storybook config and tweak theme * feat(docs): configure addon-docs Co-authored-by: lucent1090 <[email protected]> * feat(docs): remove Storybook group enums * feat(docs): run codemod to add component parameter https://github.com/storybookjs/storybook/blob/next/lib/codemod/README.md#add-component-parameters * feat(docs): run codemod to transform stories to CSF https://github.com/storybookjs/storybook/blob/next/lib/codemod/README.md#storiesof-to-csf * feat(docs): simplify Storybook configs * fix(components): update snapshots * fix(docs): update image paths * feat(docs): add a11y and viewport addons
- Loading branch information
1 parent
119e83e
commit fe9b44b
Showing
91 changed files
with
4,942 additions
and
3,783 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"plugins": [ | ||
"@babel/plugin-proposal-class-properties", | ||
"lodash", | ||
"inline-react-svg" | ||
], | ||
"presets": [ | ||
["@babel/preset-env", { "loose": true }], | ||
"@babel/preset-react", | ||
[ | ||
"@emotion/babel-preset-css-prop", | ||
{ | ||
"autoLabel": false, | ||
"labelFormat": "[filename]--[local]" | ||
} | ||
] | ||
] | ||
} |
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,6 +1,7 @@ | ||
import '@storybook/addon-options/register'; | ||
import '@storybook/addon-storysource/register'; | ||
import '@storybook/addon-actions/register'; | ||
import '@storybook/addon-links/register'; | ||
import '@storybook/addon-jest/register'; | ||
import '@storybook/addon-knobs/register'; | ||
import '@storybook/addon-a11y/register'; | ||
import '@storybook/addon-viewport/register'; |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<link rel="icon" type="image/png" href="/storybook/images/logo-icon.png" /> | ||
<style> | ||
@font-face { | ||
font-family: 'aktiv-grotesk'; | ||
font-weight: 400; | ||
src: url('https://static.sumup.com/fonts/latin-greek-cyrillic/aktiv-grotest-400.woff2') | ||
format('woff2'), | ||
url('https://static.sumup.com/fonts/latin-greek-cyrillic/aktiv-grotest-400.woff') | ||
format('woff'), | ||
url('https://static.sumup.com/fonts/latin-greek-cyrillic/aktiv-grotest-400.eot') | ||
format('embedded-opentype'); | ||
} | ||
|
||
@font-face { | ||
font-family: 'aktiv-grotesk'; | ||
font-weight: 700; | ||
src: url('https://static.sumup.com/fonts/latin-greek-cyrillic/aktiv-grotest-700.woff2') | ||
format('woff2'), | ||
url('https://static.sumup.com/fonts/latin-greek-cyrillic/aktiv-grotest-700.woff') | ||
format('woff'), | ||
url('https://static.sumup.com/fonts/latin-greek-cyrillic/aktiv-grotest-700.eot') | ||
format('embedded-opentype'); | ||
} | ||
</style> |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = ['@storybook/addon-docs/react/preset']; |
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,2 +1,22 @@ | ||
<link rel="preload" href="https://use.typekit.net/dxb5kvg.css" as="style" crossorigin> | ||
<style >@import url("https://use.typekit.net/dxb5kvg.css");</style> | ||
<style> | ||
@font-face { | ||
font-family: 'aktiv-grotesk'; | ||
font-weight: 400; | ||
src: url('https://static.sumup.com/fonts/latin-greek-cyrillic/aktiv-grotest-400.woff2') | ||
format('woff2'), | ||
url('https://static.sumup.com/fonts/latin-greek-cyrillic/aktiv-grotest-400.woff') | ||
format('woff'), | ||
url('https://static.sumup.com/fonts/latin-greek-cyrillic/aktiv-grotest-400.eot') | ||
format('embedded-opentype'); | ||
} | ||
@font-face { | ||
font-family: 'aktiv-grotesk'; | ||
font-weight: 700; | ||
src: url('https://static.sumup.com/fonts/latin-greek-cyrillic/aktiv-grotest-700.woff2') | ||
format('woff2'), | ||
url('https://static.sumup.com/fonts/latin-greek-cyrillic/aktiv-grotest-700.woff') | ||
format('woff'), | ||
url('https://static.sumup.com/fonts/latin-greek-cyrillic/aktiv-grotest-700.eot') | ||
format('embedded-opentype'); | ||
} | ||
</style> |
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { create } from '@storybook/theming'; | ||
import { circuit } from '../src/themes'; | ||
|
||
const theme = create({ | ||
base: 'light', | ||
brandTitle: 'Circuit UI', | ||
brandUrl: 'https://github.com/sumup/circuit-ui', | ||
brandImage: '/storybook/images/logo-name.svg', | ||
fontBase: circuit.fontStack.default, | ||
colorPrimary: circuit.colors.p500, | ||
colorSecondary: circuit.colors.p500, | ||
appBg: circuit.colors.n100 | ||
}); | ||
|
||
export default theme; |
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,55 +1,15 @@ | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
|
||
module.exports = ({ config, mode }) => { | ||
const isProduction = mode === 'PRODUCTION'; | ||
|
||
// modify storybook's file-loader rule to avoid conflicts with svgr | ||
config.module.rules.find(rule => | ||
rule.test.test('.svg') | ||
).exclude = path.resolve(__dirname, '../src/'); | ||
|
||
config.module.rules.push({ | ||
test: /\.story\.jsx?$/, | ||
loaders: [require.resolve('@storybook/addon-storysource/loader')], | ||
enforce: 'pre' | ||
}); | ||
|
||
config.module.rules.push({ | ||
test: /.svg$/, | ||
use: [ | ||
{ | ||
loader: '@svgr/webpack', | ||
options: { | ||
svgoConfig: { | ||
plugins: { | ||
removeViewBox: false | ||
} | ||
} | ||
} | ||
}, | ||
'url-loader' | ||
] | ||
}); | ||
|
||
config.plugins.push( | ||
new webpack.DefinePlugin({ | ||
STORYBOOK: JSON.stringify(true), | ||
PRODUCTION: JSON.stringify(isProduction), | ||
__TEST__: JSON.stringify(false), | ||
// Show deprecation warnings in storybook | ||
__DEV__: JSON.stringify(true), | ||
__PRODUCTION__: JSON.stringify(false) | ||
__PRODUCTION__: JSON.stringify(true), | ||
// Show deprecation warnings in Storybook | ||
__DEV__: JSON.stringify(true) | ||
}) | ||
); | ||
|
||
if (isProduction) { | ||
config.module.rules.push({ | ||
test: /\.css$/, | ||
loaders: ['style-loader', 'css-loader'], | ||
include: path.resolve(__dirname) | ||
}); | ||
} | ||
|
||
return config; | ||
}; |
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
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.