2023-05-29 12:02:38 +03:00
|
|
|
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/layout/styles/themes';
|
|
|
|
|
2023-05-29 12:02:38 +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,
|
|
|
|
})
|
|
|
|
],
|
2023-05-29 12:02:38 +03:00
|
|
|
parameters: {
|
|
|
|
actions: { argTypesRegex: '^on[A-Z].*' },
|
|
|
|
controls: {
|
|
|
|
matchers: {
|
|
|
|
color: /(background|color)$/i,
|
|
|
|
date: /Date$/,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export default preview;
|