@qijenchen/design-system 0.1.0-beta.35 → 0.1.0-beta.37

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.
Files changed (60) hide show
  1. package/CLAUDE.md +3 -3
  2. package/ds-canonical/hooks/check_dim_count_drift.sh +3 -3
  3. package/ds-canonical/hooks/check_pattern_invariants.sh +3 -1
  4. package/ds-canonical/hooks/check_post_main_ssot_propagate.sh +1 -1
  5. package/ds-canonical/hooks/check_storybook_addon_preset_cjs.sh +7 -2
  6. package/ds-canonical/hooks/inject_deploy_url_after_push.sh +5 -1
  7. package/ds-canonical/hooks/lib/_token_hygiene.sh +3 -2
  8. package/ds-canonical/hooks/session_start_governance_check.sh +32 -3
  9. package/ds-canonical/hooks/tests/test_check_token_hygiene.sh +1 -1
  10. package/ds-canonical/references/build-ui-canonicals.md +2 -2
  11. package/ds-canonical/references/item-anatomy-recipe.md +1 -1
  12. package/ds-canonical/references/ssot-consultation.md +1 -1
  13. package/ds-canonical/references/tailwind-gotchas.md +1 -1
  14. package/ds-canonical/rules/meta-patterns.md +2 -2
  15. package/ds-canonical/rules/story-rules.md +4 -4
  16. package/ds-canonical/skills/README.md +2 -2
  17. package/ds-canonical/skills/bug-fix-rhythm/SKILL.md +1 -1
  18. package/ds-canonical/skills/code-quality-audit/SKILL.md +2 -2
  19. package/ds-canonical/skills/codex-collab/SKILL.md +4 -4
  20. package/ds-canonical/skills/codify-corrections/SKILL.md +5 -5
  21. package/ds-canonical/skills/codify-principle/SKILL.md +2 -2
  22. package/ds-canonical/skills/component-quality-gate/SKILL.md +6 -6
  23. package/ds-canonical/skills/deep-audit-cross-codex/SKILL.md +5 -58
  24. package/ds-canonical/skills/deep-audit-cross-codex/references/phase-a-workflow.md +2 -2
  25. package/ds-canonical/skills/deep-audit-cross-codex/references/phase-b-codex-brief.md +23 -2
  26. package/ds-canonical/skills/deep-audit-cross-codex/references/skill-relationships-antipatterns-benchmarks.md +30 -0
  27. package/ds-canonical/skills/deep-audit-cross-codex/references/upstream-directives-r-mapping.md +33 -0
  28. package/ds-canonical/skills/design-system-audit/SKILL.md +24 -10
  29. package/ds-canonical/skills/design-system-audit/references/audit-prompts.md +16 -16
  30. package/ds-canonical/skills/design-system-audit/references/principle-audit-protocol.md +1 -1
  31. package/ds-canonical/skills/design-system-audit/references/rule-placement.md +10 -10
  32. package/ds-canonical/skills/ensure-canonical/SKILL.md +2 -2
  33. package/ds-canonical/skills/governance-health/SKILL.md +3 -2
  34. package/ds-canonical/skills/knowledge-prune/SKILL.md +10 -77
  35. package/ds-canonical/skills/knowledge-prune/references/phase-z-cross-repo-ssot-propagation.md +11 -0
  36. package/ds-canonical/skills/knowledge-prune/references/prune-dimensions-d5-d10.md +55 -0
  37. package/ds-canonical/skills/knowledge-prune/references/world-class-prune-alignment.md +7 -0
  38. package/ds-canonical/skills/new-component/SKILL.md +1 -1
  39. package/ds-canonical/skills/new-component/references/new-component-checklist.md +1 -1
  40. package/ds-canonical/skills/product-ui-audit/SKILL.md +9 -9
  41. package/ds-canonical/skills/product-ui-audit/references/audit-checks.md +3 -3
  42. package/ds-canonical/skills/product-ui-audit/references/report-template.md +1 -1
  43. package/ds-canonical/skills/propose-options/SKILL.md +18 -18
  44. package/ds-canonical/skills/prototype/SKILL.md +2 -2
  45. package/ds-canonical/skills/prototype/references/audit-checks.md +1 -1
  46. package/ds-canonical/skills/prototype/references/evaluation-matrix.md +1 -1
  47. package/ds-canonical/skills/prototype/references/proposal-template.md +1 -1
  48. package/ds-canonical/skills/scan-similar-bugs/SKILL.md +5 -5
  49. package/ds-canonical/skills/story-auto-compile-migrate/SKILL.md +2 -2
  50. package/ds-canonical/skills/story-writing/SKILL.md +3 -3
  51. package/ds-canonical/skills/story-writing/references/anatomy-standard.md +2 -2
  52. package/ds-canonical/skills/story-writing/references/category-templates.md +2 -2
  53. package/ds-canonical/skills/visual-audit/SKILL.md +3 -3
  54. package/ds-canonical/skills/visual-audit/references/visual-checklist.md +3 -3
  55. package/ds-canonical/skills/visual-audit/references/world-class-benchmarks.md +2 -2
  56. package/ds-story-manifest.json +1 -1
  57. package/package.json +1 -1
  58. package/src/styles/base.css +42 -5
  59. package/src/styles/tokens.css +1 -1
  60. package/src/tokens/color/primitives.css +7 -0
@@ -15,7 +15,7 @@ description: Pixel-level visual audit for design-system components based on user
15
15
  - **Carousel** prev/next 箭頭覆蓋 content
16
16
  - **Rating** 星星有多餘邊框
17
17
  - **Image viewer** 滾輪縮放跳大步(對標 Figma 該每 notch ~1.1×)
18
- - **Button 群 gap** 被 hover bg overflow 吃掉(CLAUDE.md 有「同 flex 列互動 slot 幾何鐵律」但缺視覺 audit gate 鎖住)
18
+ - **Button 群 gap** 被 hover bg overflow 吃掉(.claude/references/ui-dev-rules.md 有「同 flex 列互動 slot 幾何鐵律」但缺視覺 audit gate 鎖住)
19
19
  - **FileViewer 工具列** dark mode 切換後對比跑掉
20
20
  - **FileUpload / FileItem** 沒 fill container
21
21
 
@@ -84,7 +84,7 @@ description: Pixel-level visual audit for design-system components based on user
84
84
  |---|------|---------|
85
85
  | 1 | **4 邊邊距對稱** | 容器 top / right / bottom / left padding 實測值相等(除明文 asymmetric spec 外) |
86
86
  | 2 | **垂直對稱(to-top ↔ to-bottom)** | 最外層 element 到容器頂 = 最內層 element 到容器底(DatePicker 箭頭 vs 最後排日期) |
87
- | 3 | **水平 gap 實際值 == gap token 宣告值** | hover bg / ring / focus outline 不可溢出 box 吃掉宣告 gap(CLAUDE.md「同 flex 列互動 slot 幾何鐵律」) |
87
+ | 3 | **水平 gap 實際值 == gap token 宣告值** | hover bg / ring / focus outline 不可溢出 box 吃掉宣告 gap(.claude/references/ui-dev-rules.md「同 flex 列互動 slot 幾何鐵律」) |
88
88
  | 4 | **Overlay 定位(badge / popover / hover-card)** | anchor-offset / side-offset 對稱;不覆蓋 anchor 內容 |
89
89
  | 5 | **Typography baseline 對齊** | icon 與同行 text 的 baseline 對齊(非 geometric center 誤植) |
90
90
  | 6 | **Icon ↔ text gap 一致** | 同類型 row 裡所有 icon-to-text 距離相等 |
@@ -240,6 +240,6 @@ FAIL 項摘要:
240
240
  - `.claude/skills/design-system-audit/SKILL.md` — 全 dim code/spec audit(per design-system-audit SSOT);本 skill 是其 pixel-level 補位
241
241
  - `.claude/skills/product-ui-audit/SKILL.md` — consumer UI 對 DS 消費 audit(code 層),不處理視覺
242
242
  - `.claude/skills/component-quality-gate/SKILL.md` — 元件合入 DS 前的 45 項 checklist;Ship phase 可 chain 本 skill
243
- - CLAUDE.md `# 同 flex 列的互動 slot 幾何鐵律` — 本 skill checklist #3 的主要 canonical 來源
243
+ - .claude/references/ui-dev-rules.md `# 同 flex 列的互動 slot 幾何鐵律` — 本 skill checklist #3 的主要 canonical 來源
244
244
  - `.claude/rules/ui-development.md`「建立 UI 前必讀」 → layout primitive / token spec 清單 — 本 skill「合格標準」的對照錨
245
245
  - `memory/project_pending_tasks`「視覺 regression 基建」條目 — 長期 tech debt(Chromatic / screenshot-diff)
@@ -34,7 +34,7 @@
34
34
 
35
35
  **FAIL 範例**:DatePicker 量到 top=12 / right=12 / bottom=8 / left=12,spec 未宣告 bottom asymmetric → FAIL,建議討論是對齊 12 還是補 spec rationale
36
36
 
37
- **對應規則**:CLAUDE.md `# Consistency Audit 原則`(actual == canonical OR rationale-for-deviation)
37
+ **對應規則**:CLAUDE.md `# 稽核 canonical`「Consistency 類稽核必 Phase 0 全掃再判」(actual == canonical OR rationale-for-deviation;design-system-audit Dim 13 enforce)
38
38
 
39
39
  ---
40
40
 
@@ -60,7 +60,7 @@
60
60
 
61
61
  ## 3. 水平 gap 實際值 == gap token 宣告值(hover bg 不可吃掉)
62
62
 
63
- **Canonical source**: CLAUDE.md `# 同 flex 列的互動 slot 幾何鐵律`(gap 鐵律)
63
+ **Canonical source**: .claude/references/ui-dev-rules.md `# 同 flex 列的互動 slot 幾何鐵律`(gap 鐵律)
64
64
 
65
65
  **怎麼量**:
66
66
  1. 量同一 flex row 相鄰兩 interactive slot 的 **box 邊** 之間距離(不是「視覺中心距離」,是右邊 slot 左緣 - 左邊 slot 右緣)
@@ -70,7 +70,7 @@
70
70
 
71
71
  **合格標準**:
72
72
  - default + hover 兩態的 gap 都 == 宣告值(±1px) → PASS
73
- - hover 狀態 gap 被 bg overflow 吃掉 → FAIL(違反 CLAUDE.md「同 flex 列幾何鐵律」)
73
+ - hover 狀態 gap 被 bg overflow 吃掉 → FAIL(違反 .claude/references/ui-dev-rules.md「同 flex 列幾何鐵律」)
74
74
 
75
75
  **FAIL 範例**:FileItem 2026-04-19 bug,Button hover-bg 24px 超出 16px box,`gap-2`(8px)實際剩 ~4px
76
76
 
@@ -32,7 +32,7 @@
32
32
  | **Atlassian Button group** | 8px gap;ring/focus outline 限制在 box 內,不 overflow |
33
33
  | **Ant Design Space** | default `gap-8`,hover bg 限制 box 內 |
34
34
 
35
- **世界級 idiom**:**hover bg / ring / focus outline 不超出 slot box**,保護 gap token 如實呈現。這對齊 CLAUDE.md`# 同 flex 列的互動 slot 幾何鐵律`。
35
+ **世界級 idiom**:**hover bg / ring / focus outline 不超出 slot box**,保護 gap token 如實呈現。這對齊 .claude/references/ui-dev-rules.md`# 同 flex 列的互動 slot 幾何鐵律`。
36
36
 
37
37
  ---
38
38
 
@@ -114,7 +114,7 @@
114
114
  - **Web DS 用 overlay scrollbar 跨 OS 一致**(Radix ScrollArea / Ant Design Scrollbar 都這樣做)
115
115
  - **原因**:Windows native scrollbar 吃寬度會讓同一 page 在 Mac 和 Windows 上 layout 不同,違反「設計在任何平台視覺一致」
116
116
 
117
- 對應 DS:`components/ScrollArea/` + CLAUDE.mdoverflow 使用三規則」。
117
+ 對應 DS:`components/ScrollArea/` + `.claude/references/build-ui-canonicals.md`「overflow 使用三規則」。
118
118
 
119
119
  ---
120
120
 
@@ -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-29T08:01:40.949Z"
10
+ "generatedAt": "2026-05-30T02:15:38.027Z"
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.35",
3
+ "version": "0.1.0-beta.37",
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,10 +1,9 @@
1
- /* @qijenchen/design-system/styles/base — consumer base layer SSOT
1
+ /* @qijenchen/design-system/styles/base — consumer runtime CSS SSOT
2
2
  *
3
3
  * Why(2026-05-29 fix:ds-product-template storybook 字體 drift,user「請你追根究底去解決」授權):
4
- * `styles/tokens` ship token 變數(`--font-sans` / `--canvas` / `--foreground` 等),
5
- * 不含「把變數套到 body」的 base 層。DS repo `src/globals.css` 自帶此 base 層,但 consumer
6
- * (apps/template globals + storybook.css)只 import tokens → body 字體/底色/前景退回瀏覽器預設
7
- * → consumer storybook 跟 DS storybook 字體不同。
4
+ * `styles/tokens` is the single consumer import. It must include the runtime CSS
5
+ * needed by shipped DS components: base element styles plus custom utilities
6
+ * backed by DS-owned keyframes.
8
7
  *
9
8
  * 本檔抽出 base 層為單一 SSOT:DS `src/globals.css` + consumer 都 import,字體/reset 永不 drift。
10
9
  * codex 2026-05-29 dual-track 共識 option (a)。
@@ -46,3 +45,41 @@
46
45
  cursor: pointer;
47
46
  }
48
47
  }
48
+
49
+ /* Radix Collapsible height animation — consumed by TreeView. */
50
+ @keyframes collapsible-down {
51
+ from { height: 0; }
52
+ to { height: var(--radix-collapsible-content-height); }
53
+ }
54
+
55
+ @keyframes collapsible-up {
56
+ from { height: var(--radix-collapsible-content-height); }
57
+ to { height: 0; }
58
+ }
59
+
60
+ @utility animate-collapsible-down {
61
+ animation: collapsible-down 150ms ease-out;
62
+ }
63
+
64
+ @utility animate-collapsible-up {
65
+ animation: collapsible-up 150ms ease-out;
66
+ }
67
+
68
+ /* Radix Accordion height animation — Radix exposes a different content-height var. */
69
+ @keyframes accordion-down {
70
+ from { height: 0; }
71
+ to { height: var(--radix-accordion-content-height); }
72
+ }
73
+
74
+ @keyframes accordion-up {
75
+ from { height: var(--radix-accordion-content-height); }
76
+ to { height: 0; }
77
+ }
78
+
79
+ @utility animate-accordion-down {
80
+ animation: accordion-down 200ms ease-out;
81
+ }
82
+
83
+ @utility animate-accordion-up {
84
+ animation: accordion-up 200ms ease-out;
85
+ }
@@ -34,7 +34,7 @@
34
34
  @import './../tokens/opacity/opacity.css';
35
35
  @import './../tokens/motion/motion.css';
36
36
 
37
- /* Non-token CSS (patterns/ + components/) containing :root token declarations
37
+ /* Non-token CSS (patterns/ + components/) containing token/runtime declarations
38
38
  or component-internal styles — auto-detected by generator scan. Per 2026-05-27
39
39
  root-cause fix: src/globals.css 已 import for DS internal, 但 consumer-facing
40
40
  tokens.css aggregator 必須也包含, 不然 consumer 拿不到 → 跑版。 */
@@ -245,6 +245,13 @@
245
245
 
246
246
  }
247
247
 
248
+ /* Tailwind bridge for absolute anchors.
249
+ Keep the bridge in the primitive color SSOT so text-white/bg-white ship to consumers. */
250
+ @theme inline {
251
+ --color-white: oklch(1 0 0);
252
+ --color-black: oklch(0 0 0);
253
+ }
254
+
248
255
 
249
256
  /* ── Layer 1 — Dark Mode Overrides ── */
250
257
  [data-theme="dark"] {