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

50 lines
918 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# T003 — UI primitives
> Status: `done`
> Milestone: `M1`
> Est. change: `~180 lines`
> Completed: 2026-07-09
## 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
```