1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-12-05 10:18:09 +09:00
hotomoe/packages/frontend/.storybook/preview.ts

39 lines
839 B
TypeScript
Raw Normal View History

import { type Preview, setup } from '@storybook/vue3';
import { initialize, mswDecorator } from 'msw-storybook-addon';
import locale from './locale';
2023-03-19 22:22:14 +09:00
import theme from './theme';
import '../src/style.scss';
initialize();
localStorage.setItem("locale", JSON.stringify(locale));
Promise.all([
import('../src/components'),
import('../src/directives'),
import('../src/widgets'),
import('../src/scripts/theme').then(({ applyTheme }) => applyTheme(theme)),
]).then(([{ default: components }, { default: directives }, { default: widgets }]) => {
setup((app) => {
components(app);
directives(app);
widgets(app);
});
});
2023-03-19 22:22:14 +09:00
const preview = {
decorators: [
mswDecorator,
],
2023-03-19 22:22:14 +09:00
parameters: {
layout: 'centered',
},
argTypes: {
default: {
control: {
type: 'text',
},
},
},
2023-03-19 22:22:14 +09:00
} satisfies Preview;
export default preview;