49 lines
892 B
Markdown
49 lines
892 B
Markdown
|
|
# T003 — UI primitives
|
|||
|
|
|
|||
|
|
> Status: `todo`
|
|||
|
|
> Milestone: `M1`
|
|||
|
|
> Est. change: `~180 lines`
|
|||
|
|
|
|||
|
|
## 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
|
|||
|
|
```
|