mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-20 05:23:31 +01:00
chore: storybook
This commit is contained in:
21
packages/ui/.storybook/main.ts
Normal file
21
packages/ui/.storybook/main.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { StorybookConfig } from '@storybook/react-vite';
|
||||
|
||||
export default {
|
||||
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],
|
||||
addons: [
|
||||
'@storybook/addon-links',
|
||||
'@storybook/addon-essentials',
|
||||
'@storybook/addon-interactions',
|
||||
'@storybook/addon-styling',
|
||||
],
|
||||
core: {
|
||||
builder: '@storybook/builder-vite',
|
||||
},
|
||||
framework: {
|
||||
name: '@storybook/react-vite',
|
||||
options: {},
|
||||
},
|
||||
docs: {
|
||||
autodocs: 'tag',
|
||||
},
|
||||
} satisfies StorybookConfig;
|
||||
7
packages/ui/.storybook/preview.css
Normal file
7
packages/ui/.storybook/preview.css
Normal file
@@ -0,0 +1,7 @@
|
||||
html {
|
||||
color-scheme: light;
|
||||
}
|
||||
|
||||
html.dark {
|
||||
color-scheme: dark;
|
||||
}
|
||||
28
packages/ui/.storybook/preview.ts
Normal file
28
packages/ui/.storybook/preview.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { Preview } from '@storybook/react';
|
||||
import { withThemeByClassName } from '@storybook/addon-styling';
|
||||
|
||||
import '@unocss/reset/tailwind-compat.css';
|
||||
import './preview.css';
|
||||
import 'virtual:uno.css';
|
||||
|
||||
export default {
|
||||
parameters: {
|
||||
actions: { argTypesRegex: '^on[A-Z].*' },
|
||||
controls: {
|
||||
matchers: {
|
||||
color: /(background|color)$/i,
|
||||
date: /Date$/,
|
||||
},
|
||||
},
|
||||
},
|
||||
} satisfies Preview;
|
||||
|
||||
export const decorators = [
|
||||
withThemeByClassName({
|
||||
themes: {
|
||||
light: 'bg-light-600',
|
||||
dark: 'dark bg-dark-600',
|
||||
},
|
||||
defaultTheme: 'light',
|
||||
}),
|
||||
];
|
||||
Reference in New Issue
Block a user