3.1 KiB
3.1 KiB
Frontend Design System
Principles
- Build product screens from shadcn/ui primitives and project-owned App components.
- Keep operational pages dense, quiet, and optimized for repeated use.
- Use semantic status colors for ticket state, priority, audit, AI, and system feedback.
- User-facing frontend text must be Chinese-first. Internal TypeScript names and API field names may stay English.
- Business pages must not create one-off table, filter, detail, status, or priority patterns.
- Admin UI should feel calm and enterprise-grade: clear hierarchy, restrained surfaces, compact actions, and no decorative marketing-style layout.
Tokens
Theme tokens live in frontend/src/styles/globals.css and are exposed through Tailwind in
frontend/tailwind.config.ts.
Core tokens:
background,foreground,surface,bordermuted,muted-foregroundprimary,success,warning,danger,info,aisidebar,sidebar-foreground,sidebar-primary,sidebar-accent,sidebar-border
Theme behavior:
AppThemeProviderusesnext-themeswithlight,dark, andsystem.AppThemeToggleis rendered inAppTopbarand exposes Chinese options:亮色,暗色,跟随系统.- Light and dark mode values must both be defined in
frontend/src/styles/globals.css; do not add one-offdark:color overrides in business pages. - Sidebar colors must come from
sidebar*tokens so the sidebar follows theme switching.
Components
shadcn/ui primitives live in frontend/src/components/ui and should remain close to generated shadcn APIs:
ButtonBadgeCard,CardHeader,CardContent,CardTitle,CardDescriptionInput,Textarea,SelectTableDialog,Sheet,DropdownMenu,Tabs,Tooltip,Skeleton,Sonner
Product App components live in frontend/src/components/app and are the preferred page-level API:
AppSidebarAppTopbarAppThemeProviderAppThemeToggleAppPageAppPageHeaderAppDataTableAppFilterBarAppDetailLayoutAppSectionAppEmptyStateAppStatusBadgeAppPriorityBadge
Business pages should use:
AppDataTablefor repeated table/list surfaces.AppFilterBarfor search and filter controls.AppDetailLayoutfor detail pages with main content and side panels.AppStatusBadgeandAppPriorityBadgefor ticket lifecycle and priority presentation.AppFieldfor form labels and required state; direct page-levelLabelusage should be avoided.SelectContent > SelectGroup > SelectItemfor every select menu.
Current Core Screens
- Ticket center uses an operations-table layout: the first column combines ticket number, title, requester, and description; workflow state and priority are grouped together.
- Ticket detail uses
AppDetailLayout, a ticket overview card, a real event timeline, and a side column for metadata, linked solutions, and AI analysis placeholder. - Ticket status transitions require a handling note through
TicketTransitionDialog. - System governance quick-create forms use
AppSection,FieldGroup, andAppField.
Preview page:
frontend/src/features/design-system/DesignSystemPreview.tsx