Files
UHD_Media_Tool/docs/design/README.md
T
umtandClaude Fable 5.1 b22c440139 chore: scaffold monorepo and migrate uhd_web design system (W0-A)
- pnpm workspace: apps/{web,server}, packages/{contracts,db,domain,adapters,tasks,agent,testkit}
- server: Hono + zod-openapi, API Key auth with scopes, redacting pino logger, SSE event bus with replay, worker heartbeat
- db: Kysely + pg, file migrator, 0001_init (settings/api_key/audit_event/outbox_event)
- web: React Router 7 SPA console shell with 12 workspace placeholders, uhd_web tokens/ui/guard scripts
- docs: ADR-001 (Node over Deno), dev runbook, design system rules

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-27 17:36:26 +08:00

1.8 KiB

设计系统

控制台(apps/web)沿用 /opt/uhd_web 的设计系统:token 定义在 app.css,shadcn 组件在 apps/web/app/components/ui/,控制台共享件在 apps/web/app/components/console/。

文档 内容
design-tokens.md 颜色 token 分层、命名与使用规则,字号/圆角/时长/缓动阶梯
interface-materials.md 材质:pg-chrome 贴边、pg-slab 内容卡、pg-float 悬浮层
ui-controls.md 按钮、选中态、状态反馈、动效与圆角角色

硬规则

  1. 新增语义先加 token 再用。 需要新的颜色、字号、圆角、时长或缓动时,先在 app.css 定义语义 token(日夜两套值都给),跑 pnpm --filter @umt/web gen:tokens,再在组件里引用。
  2. 禁止原色与十六进制。 组件里不写 #xxxxxx、text-[#..]、bg-red-500 这类 Tailwind 调色板色、white/10 之类的黑白透明度,也不写 text-[13px]、duration-300、ease-[cubic..]、裸 rounded。状态只用 success / warning / destructive,并且配文字,不只靠颜色。
  3. 材质按层级只有三种,不在玻璃上叠玻璃:已在卡片里的空态用 <EmptyState plain>。
  4. 确需例外(第三方库的颜色参数等),在该行或上一行写 token-allow: 原因。

以上规则由 pnpm check:tokens(apps/web/scripts/check-design-tokens.sh + 生成物校验)在 pnpm run ci 中守住。

控制台共享件

  • PageHeader:页面标题 + 一句说明 + 右侧操作区。
  • EmptyState:空态/建设中占位;plain 用于卡片内部。
  • StatusBadge:success | warning | destructive | neutral 四种语气,必须带文字。
  • nav.ts:12 个工作区的导航表,标题与说明同时供占位页使用。