@qijenchen/design-system 0.1.0-beta.37 → 0.1.0-beta.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,19 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
Agent 在執行時按需讀的深度 reference 檔 — audit protocol / FP 記憶 / workflow recipe / lookup tables。**不是 product design canonical**(那該進 spec.md / CLAUDE.md)。
|
|
6
6
|
|
|
7
|
-
## 當前居民(
|
|
7
|
+
## 當前居民(17 檔,2026-05-30 update)
|
|
8
8
|
|
|
9
9
|
| Ref | 用途 |
|
|
10
10
|
|-----|------|
|
|
11
11
|
| `audit-coverage-vs-24-checklist.md` | 業界 24-checklist 對照 + 為何不平行 audit 24 dim rationale |
|
|
12
12
|
| `build-ui-canonicals.md` | 建 UI 前 12 情境 + 8 layout primitive lookup |
|
|
13
|
+
| `composition-fidelity.md` | Composition fidelity visual diff SSOT — DS components 在 consumer 渲染必跟 DS canonical 一致(byte-identity 不夠,需 visual diff) |
|
|
13
14
|
| `cva-patterns.md` | cva 適用 / 不適用 + 例外清單(跟 CLAUDE.md shadcn 規範互補) |
|
|
14
15
|
| `drag-canonical.md` | 世界級 drag impl 對照 + dnd-kit collision strategy + Phase 1/2 fix plan |
|
|
15
16
|
| `item-anatomy-recipe.md` | 7 步建立新 row primitive workflow + audit grep guard |
|
|
16
17
|
| `naming-conventions.md` | 命名詳表 + 禁止清單(CLAUDE.md # 命名一致性 pointer) |
|
|
17
18
|
| `principle-dim-map.json` | M-rule / trait / hook → audit dim explicit mapping(SSOT for dim coverage) |
|
|
18
19
|
| `props-naming.md` | Props callback / Badge / icon canonical 詳表 |
|
|
20
|
+
| `scenario-definition.md` | Monorepo 2-Scenario architecture SSOT(Scenario A direct fork DS / Scenario B fork template + mirror chain + verify checkpoints)|
|
|
19
21
|
| `spec-rules.md` | SSOT 機制 / 邊界案例 scope default 詳展 |
|
|
22
|
+
| `story-baseline-registry.json` | Anti-drift registry — stories wrap 既有 primitive 的 machine-readable canonical archetype(hook `check_story_invariants.sh R8` 讀)|
|
|
20
23
|
| `ssot-consultation.md` | SSOT 消費完整對照表 |
|
|
21
24
|
| `ssot-index.md` | High-risk interface ownership map(propose 前 grep 找 owner) |
|
|
22
25
|
| `structural-token-retention.md` | 6 類結構性保留 token canonical(audit Dim 48 triple-verify) |
|
|
@@ -38,7 +38,7 @@ N. <SSOT 是否該抽到更上層 primitive?>
|
|
|
38
38
|
- 必產 3-column cite table(claim / path:line / reasoning)
|
|
39
39
|
|
|
40
40
|
## 🚨 三 invariant — 2026-05-23 user 永久 directive(缺一 = brief 不合格)
|
|
41
|
-
1. **全盤閱讀全部 source**(CLAUDE.md / 31 active M-rules / 5 rules/*.md /
|
|
41
|
+
1. **全盤閱讀全部 source**(CLAUDE.md / 31 active M-rules / 5 rules/*.md / 88 audit dims SKILL.md / 全 82 spec.md / 全 196 stories / 全 62 components / tokens / patterns / hooks / 20 memory files / planning),**禁憑記憶**
|
|
42
42
|
2. **Triple-verify per finding**:(a) grep DS-wide 確認 pattern 存在 (b) Read 對應 spec.md / tsx 確認 problem 真存在 (c) 對照既有 canonical 確認非 documented exception。任一 NO → 自動撤回,**禁無病呻吟**
|
|
43
43
|
3. **禁抽樣** — DS-wide ALL files 全掃,context 不夠拆 stage 全跑完;sub-agent admission「I sampled / spot-check / representative」= audit incomplete reject
|
|
44
44
|
```
|
package/ds-story-manifest.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"scripts/composition-fidelity-visual-diff.mjs",
|
|
8
8
|
"product-workspace apps/template/src/AllDsComponents.stories.tsx (DsCanonicalPortal)"
|
|
9
9
|
],
|
|
10
|
-
"generatedAt": "2026-05-
|
|
10
|
+
"generatedAt": "2026-05-30T04:06:32.550Z"
|
|
11
11
|
},
|
|
12
12
|
"components": {
|
|
13
13
|
"accordion": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qijenchen/design-system",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.38",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "World-class design system — components, patterns, tokens, hooks (single source of truth for team distribution).",
|
|
6
6
|
"type": "module",
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
# Spec.md 兩段式 chapter template(2026-05-17 codify,codex Q8 verdict (c) 兩段式)
|
|
2
|
-
|
|
3
|
-
**對齊**:Polaris 7-section component spec + Carbon Component Spec template + Material 3 component anatomy。比全寫死更適合複雜元件,比完全自由更能 audit。
|
|
4
|
-
|
|
5
|
-
## 必填 7 維(順序固定,hook 攔缺失或嚴重漂移)
|
|
6
|
-
|
|
7
|
-
```markdown
|
|
8
|
-
# <ComponentName> 設計原則
|
|
9
|
-
|
|
10
|
-
## 1. Layout Family / scope
|
|
11
|
-
- Layout Family: 1 / 2 / 3 / 4(或明示「self-contained / composite」+ rationale)
|
|
12
|
-
- Implementation base: 基於 Radix X / 基於 cmdk / native / 自建 + 理由
|
|
13
|
-
- Token / pattern 消費清單(SSOT 消費 canonical)
|
|
14
|
-
|
|
15
|
-
## 2. 何時用
|
|
16
|
-
- 真實業務情境(Jira / Stripe / Notion 可辨識)
|
|
17
|
-
- 預設使用案例(非邊緣 case)
|
|
18
|
-
|
|
19
|
-
## 3. 何時不用
|
|
20
|
-
- 近親元件分界(vs SiblingX / SiblingY)
|
|
21
|
-
- 反向 trigger:這些情境改用 Z
|
|
22
|
-
|
|
23
|
-
## 4. 近親分界(decision tree if multiple sibling)
|
|
24
|
-
- vs A:differentiate by axis-1
|
|
25
|
-
- vs B:differentiate by axis-2
|
|
26
|
-
|
|
27
|
-
## 5. 尺寸 / variant / state canonical
|
|
28
|
-
- Size:xs / sm / md / lg(field-height / table-row 等 token 對應)
|
|
29
|
-
- Variant:列 cva 預設值 + 為什麼
|
|
30
|
-
- State:default / hover / focus / active / disabled / loading / error 各自視覺定義 + state machine 疊加組合(M5)
|
|
31
|
-
|
|
32
|
-
## 6. 邊界案例 + a11y
|
|
33
|
-
- Empty / loading / error / dark mode / density / icon-only 各自處理
|
|
34
|
-
- ARIA roles + keyboard map(互動元件強制;純視覺 indicator 豁免明寫)
|
|
35
|
-
- Scope defaults 豁免清單(若適用,cite `spec-rules.md`)
|
|
36
|
-
|
|
37
|
-
## 7. 相關 SSOT links / reciprocal pointers
|
|
38
|
-
- 上游 pattern / token / primitive 引用(`xxx.spec.md「HEADING」`)
|
|
39
|
-
- 下游 consumer 元件 list
|
|
40
|
-
- Reciprocal check:被本 spec link 的對方有沒回連?
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## 自由 rationale(後段)— 不限格式
|
|
44
|
-
|
|
45
|
-
每 component spec 可在 7 維後加任意「為什麼」/ historical anchor / world-class benchmark cite / RFC link / 邊界討論 — hook **不**攔此段。
|
|
46
|
-
|
|
47
|
-
範例:
|
|
48
|
-
- Button.spec.md 加「Pill Layout 為什麼自建非 Family 3」rationale
|
|
49
|
-
- Field.spec.md 加「為什麼 block primitive 不自己變高」decision tree
|
|
50
|
-
- DataTable.spec.md 加 Phase 7 RFC archive
|
|
51
|
-
|
|
52
|
-
## Hook 機械強制
|
|
53
|
-
|
|
54
|
-
**Hook**:`check_spec_chapter_canonical.sh`(待 ship)— PreToolUse Write/Edit `*.spec.md` 檢:
|
|
55
|
-
- 必填 7 維 heading 全在(`## 1. Layout Family` 等)
|
|
56
|
-
- 順序對(1 < 2 < 3 ... < 7)
|
|
57
|
-
- 缺任一 heading → P0 BLOCKER(可 escape:檔頭 `// @spec-template-exempt: <reason>` 例外,用 ≥ 3 家 world-class DS 對照證該 component 不適用標準 template)
|
|
58
|
-
|
|
59
|
-
**Soft warn**:7 維外的 chapter 結構不限。但若 audit Dim 15 偵測跨 spec 命名漂移(如「為什麼 block」vs「為什麼不變高」相同概念兩寫法)→ flag 統一。
|
|
60
|
-
|
|
61
|
-
## 歷史錨點
|
|
62
|
-
|
|
63
|
-
- 2026-05-17 codex Q8 verdict:Button vs Field 章節 order 不一(Button 有「何時不用」/ Field 有「為什麼 block」rationale-heavy)→ 該兩段式
|
|
64
|
-
- Polaris template:https://github.com/Shopify/polaris/blob/main/polaris-react/.template/component.mdx
|
|
65
|
-
- Carbon Component Spec:https://carbondesignsystem.com/contributing/component-checklist/
|
|
66
|
-
- Material 3 anatomy:https://m3.material.io/components/<component>/specs
|