Skip to content

Commit 643bfac

Browse files
zyx1121claude
andauthored
docs: list rows, row actions and status colors (#43)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 077373d commit 643bfac

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

‎DESIGN.md‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,35 @@ The interface is flat and has exactly two layers.
5050
- No helper text under a field. If a field needs explaining, its label says it ("備註(簽核人看得到)"); errors go in a toast.
5151
- A section title on a page is followed by more space (`gap-6`) than a field label (`gap-2`), so the two never read as the same level.
5252

53+
## Lists
54+
55+
- Rows are separated by dividers (`border-b`), never framed: no card per row, no border around the list. A row's text lines up with the page's left edge.
56+
- Row actions follow how many there are:
57+
58+
| Actions on a row | Shape |
59+
|------------------|-------|
60+
| One or two | Ghost icon buttons, each with a tooltip naming the verb ("編輯", "刪除") |
61+
| Three or more | One `⋯` button opening a `dropdown-menu`; the destructive action last, after a separator |
62+
63+
- A delete button stays muted on the row. Red belongs to the confirmation that follows, not to the trigger.
64+
- Every action that cannot be undone asks first, in the `confirm-dialog` block. Its confirm button names the verb ("刪除", "撤回"), never "確定".
65+
66+
## Status and categories
67+
68+
Color means state: something that changes as work moves on. A category (a kind, a tag, a group) never gets a color.
69+
70+
| What it is | Badge |
71+
|------------|-------|
72+
| Waiting on someone (審核中, 送簽中) | `warning` |
73+
| Done or accepted (已通過, 已完成) | `success` |
74+
| Rejected or failed (已拒絕, 失敗) | `destructive` |
75+
| Open, active, in progress (進行中) | `default` |
76+
| Closed, inactive, draft (已關閉, 停用, 草稿) | `muted` |
77+
| A category or tag, not a state | `outline` |
78+
79+
- Each app maps its status values to these variants in one place, next to the status labels, and every page reads that map.
80+
- A status that only applies to some rows shows nothing on the others; do not add a "normal" badge.
81+
5382
## Type
5483

5584
Two sizes, by role: `text-title` (24px) for page and dialog titles, `text-body` (16px) for everything else. Weight and the muted color carry the rest: section titles `font-semibold`, labels and buttons `font-medium`, secondary text `text-muted-foreground`.

0 commit comments

Comments
 (0)