thread-master/docs/product/haixun-console/tasks/T003-ui-primitives.md

50 lines
918 B
Markdown
Raw Normal View History

2026-07-09 03:45:28 +00:00
# T003 — UI primitives
2026-07-10 05:10:31 +00:00
> Status: `done`
2026-07-09 03:45:28 +00:00
> Milestone: `M1`
2026-07-10 05:10:31 +00:00
> Est. change: `~180 lines`
> Completed: 2026-07-09
2026-07-09 03:45:28 +00:00
## Goal
可重用基礎元件Button、Input、Textarea、Select、Card、Badge、EmptyState。
## Depends on
- T002
## Inputs
- Spec §9.3
- tokens from T002
## Outputs
### 程式變更
| 路徑 | 動作 | 說明 |
|------|------|------|
| `apps/web/src/components/ui/*.tsx` | add | 各元件 |
| `apps/web/src/components/ui/index.ts` | add | barrel export |
| 可選 `*.module.css` 或共用 class | add | 用 `--hb-*` |
### 行為變更
- Button variants: primary / ghost / danger
- Badge 可表達 success/danger/muted
## Out of scope
- Stepper、BellMenu、Toast可後續 task 用 primitive 組)
- 業務頁
## Acceptance
- [ ] 各元件有 children/label 可渲染
- [ ] `npm run build` 通過
- [ ] 無重型 UI 庫依賴
```bash
cd apps/web && npm run build
```