Initial Commit
This commit is contained in:
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