- add lucide-react for Sun/Moon icons - add useTheme hook persisting choice to localStorage with prefers-color-scheme fallback - add ThemeSwitcher button component wired into SidePanel header - add blocking inline script to index.html to prevent flash-of-wrong-theme - move all *.stories.tsx from src/ into .storybook/stories/ and update imports - update main.ts stories glob to .storybook/stories/**
27 lines
1.2 KiB
TypeScript
27 lines
1.2 KiB
TypeScript
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
import { Button } from '../../src/ui/Button/Button';
|
|
|
|
const meta: Meta<typeof Button> = {
|
|
title: 'UI/Button',
|
|
component: Button,
|
|
parameters: { layout: 'centered' },
|
|
tags: ['autodocs'],
|
|
argTypes: {
|
|
variant: { control: 'select', options: ['primary', 'secondary', 'ghost', 'danger'] },
|
|
size: { control: 'select', options: ['sm', 'md', 'lg'] },
|
|
loading: { control: 'boolean' },
|
|
disabled: { control: 'boolean' },
|
|
},
|
|
};
|
|
export default meta;
|
|
type Story = StoryObj<typeof Button>;
|
|
|
|
export const Primary: Story = { args: { children: 'Button', variant: 'primary' } };
|
|
export const Secondary: Story = { args: { children: 'Button', variant: 'secondary' } };
|
|
export const Ghost: Story = { args: { children: 'Button', variant: 'ghost' } };
|
|
export const Danger: Story = { args: { children: 'Delete', variant: 'danger' } };
|
|
export const Small: Story = { args: { children: 'Small', size: 'sm' } };
|
|
export const Large: Story = { args: { children: 'Large', size: 'lg' } };
|
|
export const Loading: Story = { args: { children: 'Saving…', loading: true } };
|
|
export const Disabled: Story = { args: { children: 'Button', disabled: true } };
|