14
packages/ui/.storybook/main.ts
Normal file
14
packages/ui/.storybook/main.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { StorybookConfig } from "@storybook/react-vite";
|
||||
|
||||
const config: StorybookConfig = {
|
||||
stories: ["../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
|
||||
addons: [
|
||||
import.meta.resolve("@chromatic-com/storybook"),
|
||||
import.meta.resolve("@storybook/addon-vitest"),
|
||||
],
|
||||
framework: {
|
||||
name: "@storybook/react-vite",
|
||||
options: {},
|
||||
},
|
||||
};
|
||||
export default config;
|
||||
5
packages/ui/.storybook/preview.css
Normal file
5
packages/ui/.storybook/preview.css
Normal file
@@ -0,0 +1,5 @@
|
||||
@import url("https://fonts.googleapis.com/css2?family=Geist:wght@100..900&display=swap");
|
||||
@import "tailwindcss";
|
||||
@import "tw-animate-css";
|
||||
@import "../src/theme.css";
|
||||
@source "../../helpers/src";
|
||||
33
packages/ui/.storybook/preview.tsx
Normal file
33
packages/ui/.storybook/preview.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { Preview } from "@storybook/react";
|
||||
import { useEffect } from "react";
|
||||
import { BrowserRouter } from "react-router";
|
||||
|
||||
import "../src/theme.css";
|
||||
import "./preview.css";
|
||||
|
||||
const preview: Preview = {
|
||||
parameters: {
|
||||
controls: {
|
||||
matchers: {
|
||||
color: /(background|color)$/i,
|
||||
date: /Date$/i,
|
||||
},
|
||||
},
|
||||
},
|
||||
decorators: [
|
||||
(Story) => {
|
||||
useEffect(() => {
|
||||
document.body.classList.add("bg-level-0");
|
||||
}, []);
|
||||
return (
|
||||
<BrowserRouter>
|
||||
<div className="text-txt-primary">
|
||||
<Story />
|
||||
</div>
|
||||
</BrowserRouter>
|
||||
);
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default preview;
|
||||
Reference in New Issue
Block a user