twenty/front/.storybook/preview.ts

40 lines
934 B
TypeScript
Raw Normal View History

import { initialize, mswDecorator } from 'msw-storybook-addon';
import { Preview } from '@storybook/react';
2023-06-05 23:20:55 +03:00
import { ThemeProvider } from '@emotion/react';
import { withThemeFromJSXProvider } from '@storybook/addon-styling';
import { lightTheme, darkTheme } from '../src/modules/ui/themes/themes';
import { RootDecorator } from '../src/testing/decorators';
2023-06-05 23:20:55 +03:00
initialize();
const preview: Preview = {
2023-06-05 23:20:55 +03:00
decorators: [
mswDecorator,
withThemeFromJSXProvider({
themes: {
light: lightTheme,
dark: darkTheme,
},
defaultTheme: 'light',
Provider: ThemeProvider,
}),
RootDecorator,
2023-06-05 23:20:55 +03:00
],
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
options: {
storySort: {
order: ['UI', 'Modules', 'Pages'],
},
},
},
};
export default preview;