ops(dashboard-v2): setup Storybook

This commit is contained in:
Michał Leszczyk 2022-02-17 12:50:59 +01:00
parent 0d108a8b82
commit 4871422060
No known key found for this signature in database
GPG Key ID: FA123CA8BAA2FBF4
8 changed files with 5295 additions and 170 deletions

View File

@ -1,3 +1,4 @@
node_modules/ node_modules/
.cache/ .cache/
public public/
storybook-build/

View File

@ -2,5 +2,5 @@ module.exports = {
globals: { globals: {
__PATH_PREFIX__: true, __PATH_PREFIX__: true,
}, },
extends: "react-app", extends: ['react-app', 'plugin:storybook/recommended'],
}; }

View File

@ -1,3 +1,4 @@
node_modules/ node_modules/
.cache/ .cache/
public public/
storybook-build/

View File

@ -1,3 +1,4 @@
node_modules/ node_modules/
.cache/ .cache/
public/ public/
storybook-build/

View File

@ -0,0 +1,18 @@
module.exports = {
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
{
name: '@storybook/addon-postcss',
options: {
postcssLoaderOptions: {
implementation: require('postcss'),
},
},
},
],
core: {
builder: 'webpack5',
},
}

View File

@ -0,0 +1,20 @@
import 'tailwindcss/tailwind.css'
import '@fontsource/sora/300.css' // light
import '@fontsource/sora/400.css' // normal
import '@fontsource/sora/500.css' // medium
import '@fontsource/sora/600.css' // semibold
import '@fontsource/source-sans-pro/400.css' // normal
import '@fontsource/source-sans-pro/600.css' // semibold
import '../src/styles/global.css'
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
layout: 'fullscreen',
}

View File

@ -14,7 +14,9 @@
"serve": "gatsby serve", "serve": "gatsby serve",
"clean": "gatsby clean", "clean": "gatsby clean",
"lint": "eslint .", "lint": "eslint .",
"prettier": "prettier ." "prettier": "prettier .",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook -o storybook-build"
}, },
"dependencies": { "dependencies": {
"@fontsource/sora": "^4.5.0", "@fontsource/sora": "^4.5.0",
@ -26,11 +28,23 @@
"tailwindcss": "^3.0.22" "tailwindcss": "^3.0.22"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.17.4",
"@storybook/addon-actions": "^6.4.19",
"@storybook/addon-essentials": "^6.4.19",
"@storybook/addon-interactions": "^6.4.19",
"@storybook/addon-links": "^6.4.19",
"@storybook/addon-postcss": "^2.0.0",
"@storybook/builder-webpack5": "^6.4.19",
"@storybook/manager-webpack5": "^6.4.19",
"@storybook/react": "^6.4.19",
"@storybook/testing-library": "^0.0.9",
"autoprefixer": "^10.4.2", "autoprefixer": "^10.4.2",
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
"babel-loader": "^8.2.3",
"babel-plugin-styled-components": "^2.0.2", "babel-plugin-styled-components": "^2.0.2",
"eslint": "^8.9.0", "eslint": "^8.9.0",
"eslint-config-react-app": "^7.0.0", "eslint-config-react-app": "^7.0.0",
"eslint-plugin-storybook": "^0.5.6",
"gatsby-plugin-alias-imports": "^1.0.5", "gatsby-plugin-alias-imports": "^1.0.5",
"gatsby-plugin-image": "^2.6.0", "gatsby-plugin-image": "^2.6.0",
"gatsby-plugin-postcss": "^5.7.0", "gatsby-plugin-postcss": "^5.7.0",

File diff suppressed because it is too large Load Diff