Skip to content

Commit b348102

Browse files
committed
Add storybook
1 parent 5e7992d commit b348102

File tree

4 files changed

+26178
-13000
lines changed

4 files changed

+26178
-13000
lines changed

.config/storybook/main.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import type { StorybookConfig } from '@storybook/react-webpack5';
2+
3+
const path = require('path');
4+
const config: StorybookConfig = {
5+
stories: ['../../src/**/*.mdx', '../../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
6+
addons: [
7+
'@storybook/addon-links',
8+
'@storybook/addon-essentials',
9+
'@storybook/addon-onboarding',
10+
'@storybook/addon-interactions',
11+
],
12+
framework: {
13+
name: '@storybook/react-webpack5',
14+
options: {
15+
builder: {
16+
useSWC: true,
17+
},
18+
},
19+
},
20+
docs: {
21+
autodocs: 'tag',
22+
},
23+
webpackFinal: async (config) => {
24+
console.log(process.cwd())
25+
config.resolve = {
26+
...config.resolve,
27+
alias: {
28+
...config.resolve?.alias,
29+
'@': path.resolve(process.cwd(), "src"),
30+
}
31+
};
32+
return config;
33+
}
34+
};
35+
export default config;

.config/storybook/preview.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { Preview } from '@storybook/react';
2+
3+
const preview: Preview = {
4+
parameters: {
5+
actions: { argTypesRegex: '^on[A-Z].*' },
6+
controls: {
7+
matchers: {
8+
color: /(background|color)$/i,
9+
date: /Date$/i,
10+
},
11+
},
12+
},
13+
};
14+
15+
export default preview;

0 commit comments

Comments
 (0)