Initial Commit
This commit is contained in:
14
apps/testbed/.storybook/main.ts
Normal file
14
apps/testbed/.storybook/main.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { StorybookConfig } from "@storybook/react-vite";
|
||||
|
||||
const config: StorybookConfig = {
|
||||
framework: "@storybook/react-vite",
|
||||
stories: ["../src/**/*.stories.@(ts|tsx)"],
|
||||
addons: [
|
||||
"@storybook/addon-essentials",
|
||||
"@storybook/addon-interactions",
|
||||
"@storybook/test",
|
||||
],
|
||||
docs: { autodocs: "tag" },
|
||||
};
|
||||
|
||||
export default config;
|
||||
32
apps/testbed/.storybook/preview.tsx
Normal file
32
apps/testbed/.storybook/preview.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import type { Decorator, Preview } from "@storybook/react";
|
||||
|
||||
const ThemeDecorator: Decorator = (Story) => (
|
||||
<div style={{ display: "flex", gap: "16px" }}>
|
||||
<div data-theme="light" style={{ flex: 1 }}>
|
||||
<Story />
|
||||
</div>
|
||||
<div data-theme="dark" style={{ flex: 1, backgroundColor: "#09090b", padding: "8px" }}>
|
||||
<Story />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
const LocaleDecorator: Decorator = (Story) => (
|
||||
<div lang="en">
|
||||
<Story />
|
||||
</div>
|
||||
);
|
||||
|
||||
const preview: Preview = {
|
||||
decorators: [ThemeDecorator, LocaleDecorator],
|
||||
parameters: {
|
||||
controls: {
|
||||
matchers: {
|
||||
color: /(background|color)$/i,
|
||||
date: /Date$/i,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default preview;
|
||||
Reference in New Issue
Block a user