|
1
|
// Brings Vite's ambient module declarations into scope, notably |
|
2
|
// `declare module "*.css"`, so the side-effect import below typechecks. Needed |
|
3
|
// here because triple-slash references are file-scoped and this package's |
|
4
|
// tsconfig sets no `types`, so the reference in `vite.config.ts` doesn't apply. |
|
5
|
/// <reference types="vite/client" /> |
|
6
|
|
|
7
|
import { withThemeByDataAttribute } from "@storybook/addon-themes" |
|
8
|
import type { Preview } from "@storybook/react" |
|
9
|
|
|
10
|
import "../src/main.css" |
|
11
|
|
|
12
|
export const decorators = [ |
|
13
|
withThemeByDataAttribute({ |
|
14
|
themes: { |
|
15
|
Light: "light", |
|
16
|
Dark: "dark", |
|
17
|
}, |
|
18
|
defaultTheme: "light", |
|
19
|
attributeName: "data-mode", |
|
20
|
}), |
|
21
|
] |
|
22
|
|
|
23
|
const preview: Preview = { |
|
24
|
parameters: { |
|
25
|
actions: { argTypesRegex: "^on[A-Z].*" }, |
|
26
|
controls: { |
|
27
|
matchers: { |
|
28
|
color: /(background|color)$/i, |
|
29
|
date: /Date$/, |
|
30
|
}, |
|
31
|
}, |
|
32
|
}, |
|
33
|
} |
|
34
|
|
|
35
|
export default preview |