- 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/**
14 lines
400 B
TypeScript
14 lines
400 B
TypeScript
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
import { ThemeSwitcher } from '../../src/ui/ThemeSwitcher/ThemeSwitcher';
|
|
|
|
const meta: Meta<typeof ThemeSwitcher> = {
|
|
title: 'UI/ThemeSwitcher',
|
|
component: ThemeSwitcher,
|
|
parameters: { layout: 'centered' },
|
|
tags: ['autodocs'],
|
|
};
|
|
export default meta;
|
|
type Story = StoryObj<typeof ThemeSwitcher>;
|
|
|
|
export const Default: Story = {};
|