✨(frontend) add storybook to react repo
Add storybook for the react repo, this will make developing components enjoyable ! It can also serve as a single source of thruth.
This commit is contained in:
22
packages/react/.storybook/main.cjs
Normal file
22
packages/react/.storybook/main.cjs
Normal file
@@ -0,0 +1,22 @@
|
||||
module.exports = {
|
||||
"stories": [
|
||||
"../src/**/*.stories.mdx",
|
||||
"../src/**/*.stories.@(js|jsx|ts|tsx)"
|
||||
],
|
||||
"addons": [
|
||||
"@storybook/addon-links",
|
||||
"@storybook/addon-essentials",
|
||||
"@storybook/addon-interactions",
|
||||
'@storybook/preset-scss'
|
||||
],
|
||||
"framework": "@storybook/react",
|
||||
"core": {
|
||||
"builder": "@storybook/builder-vite"
|
||||
},
|
||||
staticDirs: [
|
||||
'dist',
|
||||
],
|
||||
"features": {
|
||||
"storyStoreV7": true
|
||||
}
|
||||
}
|
||||
4
packages/react/.storybook/preview-head.html
Normal file
4
packages/react/.storybook/preview-head.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<link rel='stylesheet' type='text/css' href='/src/index.scss'>
|
||||
<script>
|
||||
window.global = window;
|
||||
</script>
|
||||
9
packages/react/.storybook/preview.cjs
Normal file
9
packages/react/.storybook/preview.cjs
Normal file
@@ -0,0 +1,9 @@
|
||||
export const parameters = {
|
||||
actions: { argTypesRegex: "^on[A-Z].*" },
|
||||
controls: {
|
||||
matchers: {
|
||||
color: /(background|color)$/i,
|
||||
date: /Date$/,
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user