feat(ui): migrate to shadcn/ui component framework

This commit introduces shadcn/ui as the base component framework for the
application, providing a modern design system with built-in dark mode support.

## Core Infrastructure
- Add cn() utility function for className merging
- Add useThemeStore for theme state management (light/dark/system)
- Add ThemeProvider component for app-wide theme context
- Add ThemeSwitcher component for user theme selection
- Add shadcn CSS variables for theming in main.css

## shadcn Components Added
- button, dialog, toast, dropdown-menu, select, tabs
- label, separator, alert-dialog, input, card
- table, scroll-area, tooltip, progress, slot

## Existing Components Updated (API Compatible)
- Button: now uses shadcn button internally
- Modal: now uses shadcn dialog internally
- Toast: enhanced with dark mode support

## Dependencies Added
- @radix-ui/*: UI primitives for accessibility
- class-variance-authority: variant management
- framer-motion: animations
- clsx, tailwind-merge: className utilities

All existing component APIs are maintained for backward compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-04-01 10:32:44 +08:00
parent d004f8e9f8
commit 5695634ac3
32 changed files with 3533 additions and 131 deletions

View File

@@ -37,11 +37,26 @@
"@electron-toolkit/preload": "^3.0.2",
"@electron-toolkit/utils": "^4.0.0",
"@headlessui/react": "^2.2.9",
"@radix-ui/react-alert-dialog": "^1.1.15",
"@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-dropdown-menu": "^2.1.16",
"@radix-ui/react-label": "^2.1.8",
"@radix-ui/react-progress": "^1.1.8",
"@radix-ui/react-scroll-area": "^1.2.10",
"@radix-ui/react-select": "^2.2.6",
"@radix-ui/react-separator": "^1.1.8",
"@radix-ui/react-slot": "^1.2.4",
"@radix-ui/react-tabs": "^1.1.13",
"@radix-ui/react-toast": "^1.2.15",
"@radix-ui/react-tooltip": "^1.2.8",
"@tailwindcss/vite": "^4.2.1",
"@types/js-yaml": "^4.0.9",
"chromium-bidi": "^15.0.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"exceljs": "^4.4.0",
"framer-motion": "^12.38.0",
"github-markdown-css": "^5.9.0",
"js-yaml": "^4.1.1",
"lucide-react": "^0.575.0",
@@ -57,6 +72,7 @@
"rehype-highlight": "^7.0.2",
"rehype-slug": "^6.0.0",
"remark-gfm": "^4.0.1",
"tailwind-merge": "^3.5.0",
"typeorm": "^0.3.28",
"uuid": "^13.0.0",
"winston": "^3.19.0",