codex/design-system-foundation #33
9
packages/design-system/.storybook/main.ts
Normal file
9
packages/design-system/.storybook/main.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import type { StorybookConfig } from '@storybook/react-vite';
|
||||
|
||||
const config: StorybookConfig = {
|
||||
framework: '@storybook/react-vite',
|
||||
stories: ['../src/**/*.stories.@(ts|tsx)'],
|
||||
addons: ['@storybook/addon-a11y', '@storybook/addon-vitest'],
|
||||
};
|
||||
|
||||
export default config;
|
||||
24
packages/design-system/.storybook/preview.tsx
Normal file
24
packages/design-system/.storybook/preview.tsx
Normal file
@ -0,0 +1,24 @@
|
||||
import type { Preview } from '@storybook/react';
|
||||
import { MoexVibeThemeProvider } from '../src/theme';
|
||||
|
||||
const preview: Preview = {
|
||||
decorators: [
|
||||
(Story) => (
|
||||
<MoexVibeThemeProvider>
|
||||
<Story />
|
||||
</MoexVibeThemeProvider>
|
||||
),
|
||||
],
|
||||
parameters: {
|
||||
a11y: {
|
||||
test: 'error',
|
||||
},
|
||||
layout: 'centered',
|
||||
backgrounds: {
|
||||
default: 'canvas',
|
||||
values: [{ name: 'canvas', value: '#f5f5f5' }],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default preview;
|
||||
5
packages/design-system/.storybook/vitest.setup.ts
Normal file
5
packages/design-system/.storybook/vitest.setup.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import '@storybook/addon-a11y/preview';
|
||||
import { setProjectAnnotations } from '@storybook/react';
|
||||
import preview from './preview';
|
||||
|
||||
setProjectAnnotations(preview);
|
||||
19
packages/design-system/vitest.workspace.ts
Normal file
19
packages/design-system/vitest.workspace.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { defineWorkspace } from 'vitest/config';
|
||||
|
||||
export default defineWorkspace([
|
||||
'vitest.config.ts',
|
||||
{
|
||||
test: {
|
||||
name: 'storybook',
|
||||
browser: {
|
||||
enabled: true,
|
||||
name: 'chromium',
|
||||
provider: 'playwright',
|
||||
headless: true,
|
||||
},
|
||||
setupFiles: ['./.storybook/vitest.setup.ts'],
|
||||
include: ['src/**/*.stories.test.{ts,tsx}'],
|
||||
passWithNoTests: true,
|
||||
},
|
||||
},
|
||||
]);
|
||||
Loading…
x
Reference in New Issue
Block a user