Skip to content

Commit

Permalink
Add storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
ddelemeny committed Feb 20, 2024
1 parent 5e7992d commit b348102
Show file tree
Hide file tree
Showing 4 changed files with 26,178 additions and 13,000 deletions.
35 changes: 35 additions & 0 deletions .config/storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import type { StorybookConfig } from '@storybook/react-webpack5';

const path = require('path');
const config: StorybookConfig = {
stories: ['../../src/**/*.mdx', '../../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-onboarding',
'@storybook/addon-interactions',
],
framework: {
name: '@storybook/react-webpack5',
options: {
builder: {
useSWC: true,
},
},
},
docs: {
autodocs: 'tag',
},
webpackFinal: async (config) => {
console.log(process.cwd())
config.resolve = {
...config.resolve,
alias: {
...config.resolve?.alias,
'@': path.resolve(process.cwd(), "src"),
}
};
return config;
}
};
export default config;
15 changes: 15 additions & 0 deletions .config/storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Preview } from '@storybook/react';

const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};

export default preview;
Loading

0 comments on commit b348102

Please sign in to comment.