refactor(ui): extract reusable component package

This commit is contained in:
vince 2026-06-20 05:27:09 +02:00
parent e68eb2efee
commit 78a4e28dd4
85 changed files with 4144 additions and 0 deletions

15
.storybook/main.ts Normal file
View file

@ -0,0 +1,15 @@
import type { StorybookConfig } from "@storybook/react-vite";
const config: StorybookConfig = {
stories: ["../src/**/*.stories.@(js|ts|tsx)"],
addons: [
"@storybook/addon-a11y",
"@storybook/addon-vitest",
],
framework: {
name: "@storybook/react-vite",
options: {},
},
};
export default config;

51
.storybook/preview.ts Normal file
View file

@ -0,0 +1,51 @@
import "../src/styles.css";
import type { Preview } from "@storybook/react-vite";
const preview: Preview = {
decorators: [
(Story, context) => {
const theme = context.globals.theme === "light" ? "light" : "dark";
if (typeof document !== "undefined") {
document.documentElement.setAttribute("data-ui-theme", theme);
}
return Story();
},
],
globalTypes: {
theme: {
description: "Dashboard component theme",
defaultValue: "dark",
toolbar: {
title: "Theme",
icon: "circlehollow",
items: [
{ value: "dark", title: "Dark" },
{ value: "light", title: "Light" },
],
dynamicTitle: true,
},
},
},
parameters: {
backgrounds: {
default: "canvas",
values: [
{ name: "canvas", value: "#0b0f0d" },
{ name: "raised", value: "#151d18" },
{ name: "light canvas", value: "#eef2e7" },
{ name: "light raised", value: "#f1f5ea" },
],
},
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
layout: "fullscreen",
},
};
export default preview;