chore: Add RTL, Storybook, eslint rules and AGENTS
This commit is contained in:
24 files changed
+7288
-5186
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import path from 'path';
|
||||
|
||||
import { mergeConfig } from 'vite';
|
||||
|
||||
import type { StorybookConfig } from '@storybook/react-vite';
|
||||
|
||||
const config: StorybookConfig = {
|
||||
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
||||
addons: [
|
||||
'@storybook/addon-essentials',
|
||||
'@storybook/addon-interactions',
|
||||
'@storybook/addon-a11y',
|
||||
'@storybook/addon-themes',
|
||||
],
|
||||
framework: {
|
||||
name: '@storybook/react-vite',
|
||||
options: {},
|
||||
},
|
||||
viteFinal: async (config) => {
|
||||
const tailwindcss = (await import('@tailwindcss/vite')).default;
|
||||
return mergeConfig(config, {
|
||||
plugins: [tailwindcss()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, '../src'),
|
||||
'@shadcn': path.resolve(__dirname, '../src/shadcn'),
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -0,0 +1,39 @@
|
||||
import { withThemeByClassName } from '@storybook/addon-themes';
|
||||
|
||||
import type { Preview } from '@storybook/react';
|
||||
import '../src/global.css';
|
||||
|
||||
const preview: Preview = {
|
||||
parameters: {
|
||||
controls: {
|
||||
matchers: {
|
||||
color: /(background|color)$/i,
|
||||
date: /Date$/i,
|
||||
},
|
||||
},
|
||||
backgrounds: {
|
||||
default: 'light',
|
||||
values: [
|
||||
{
|
||||
name: 'light',
|
||||
value: '#ffffff',
|
||||
},
|
||||
{
|
||||
name: 'dark',
|
||||
value: '#0a0a0a',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
decorators: [
|
||||
withThemeByClassName({
|
||||
themes: {
|
||||
light: '',
|
||||
dark: 'dark',
|
||||
},
|
||||
defaultTheme: 'light',
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
||||
export default preview;
|
||||
Reference in new issue
Block a user