feat: add Storybook for WealthLedger components
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
const base = require("../dependency-cruiser.cjs");
|
||||
|
||||
module.exports = {
|
||||
...base,
|
||||
forbidden: [
|
||||
...base.forbidden,
|
||||
{
|
||||
name: "stories-must-not-reach-application-data",
|
||||
severity: "error",
|
||||
from: { path: "\\.stories\\.tsx$|^\\.storybook/preview\\.tsx$" },
|
||||
to: {
|
||||
path: "^src/(shared/api|features/auth|app/routes|app/ui)/|^src/(entities|features)/[^/]+/api/|\\.vm\\.ts$|^src/pages/[^/]+/ui/[^/]+Page\\.tsx$|node_modules/(@tanstack/react-query|openapi-fetch|openapi-react-query)/",
|
||||
reachable: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
options: { ...base.options, tsPreCompilationDeps: false },
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
import type { StorybookConfig } from "@storybook/react-vite";
|
||||
|
||||
const config: StorybookConfig = {
|
||||
stories: ["../src/**/*.stories.tsx"],
|
||||
addons: ["@storybook/addon-docs"],
|
||||
framework: "@storybook/react-vite",
|
||||
core: { disableTelemetry: true },
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -0,0 +1,36 @@
|
||||
import "@mantine/core/styles.css";
|
||||
import "@mantine/dates/styles.css";
|
||||
import "dayjs/locale/ru";
|
||||
import "../src/app/styles.css";
|
||||
import "../src/shared/i18n";
|
||||
import { MantineProvider } from "@mantine/core";
|
||||
import type { Preview } from "@storybook/react-vite";
|
||||
import { theme } from "../src/app/theme";
|
||||
|
||||
const colorSchemeManager = {
|
||||
get: () => "light" as const,
|
||||
set: () => {},
|
||||
clear: () => {},
|
||||
subscribe: () => {},
|
||||
unsubscribe: () => {},
|
||||
};
|
||||
|
||||
const preview: Preview = {
|
||||
parameters: {
|
||||
layout: "padded",
|
||||
controls: { expanded: true },
|
||||
},
|
||||
decorators: [
|
||||
(Story) => (
|
||||
<MantineProvider
|
||||
theme={theme}
|
||||
forceColorScheme="light"
|
||||
colorSchemeManager={colorSchemeManager}
|
||||
>
|
||||
<Story />
|
||||
</MantineProvider>
|
||||
),
|
||||
],
|
||||
};
|
||||
|
||||
export default preview;
|
||||
Reference in New Issue
Block a user