refactor(ui): extract reusable component package
This commit is contained in:
parent
e68eb2efee
commit
78a4e28dd4
85 changed files with 4144 additions and 0 deletions
51
.storybook/preview.ts
Normal file
51
.storybook/preview.ts
Normal 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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue