feat: migrate visual fixtures to storybook
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
export default {
|
||||
stories: ['../src/**/*.stories.js'],
|
||||
addons: ['@storybook/addon-essentials', '@storybook/addon-a11y'],
|
||||
framework: {
|
||||
name: '@storybook/vue3-vite',
|
||||
options: {},
|
||||
},
|
||||
viteFinal: async (config) => ({
|
||||
...config,
|
||||
resolve: {
|
||||
...config.resolve,
|
||||
alias: {
|
||||
...config.resolve?.alias,
|
||||
'@': fileURLToPath(new URL('../src', import.meta.url)),
|
||||
},
|
||||
},
|
||||
}),
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
import '../src/assets/styles/global.scss';
|
||||
|
||||
export const globalTypes = {
|
||||
theme: {
|
||||
description: 'Global color theme',
|
||||
defaultValue: 'light',
|
||||
toolbar: {
|
||||
icon: 'paintbrush',
|
||||
items: ['light', 'dark'],
|
||||
dynamicTitle: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const decorators = [
|
||||
(story, context) => {
|
||||
document.documentElement.dataset.theme = context.globals.theme;
|
||||
return story();
|
||||
},
|
||||
];
|
||||
|
||||
export const parameters = {
|
||||
controls: { expanded: true },
|
||||
a11y: { test: 'todo' },
|
||||
layout: 'fullscreen',
|
||||
};
|
||||
Reference in New Issue
Block a user