@cakejp/design-system 0.11.0 → 0.13.0

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 (53) hide show
  1. package/CHANGELOG.md +85 -1
  2. package/CLAUDE.md +22 -1
  3. package/README.md +48 -0
  4. package/UPDATING.md +9 -0
  5. package/bin/check-duplicates.mjs +256 -0
  6. package/bin/exports-parser.mjs +54 -0
  7. package/bin/init.js +11 -0
  8. package/contracts/components.json +395 -37
  9. package/contracts/composition.json +10 -7
  10. package/contracts/rules.json +21 -3
  11. package/dist/index.css +1 -1
  12. package/dist/index.js +6134 -3475
  13. package/dist/types/components/ec/admin-shell.d.ts +39 -2
  14. package/dist/types/components/ec/mypage-shell.d.ts +10 -1
  15. package/dist/types/components/ec/product-card.d.ts +3 -1
  16. package/dist/types/components/ec/product-list-item.d.ts +8 -1
  17. package/dist/types/components/foundations/alert.d.ts +5 -1
  18. package/dist/types/components/foundations/button.d.ts +1 -1
  19. package/dist/types/components/foundations/card.d.ts +36 -2
  20. package/dist/types/components/foundations/chip-variants.d.ts +17 -0
  21. package/dist/types/components/foundations/field.d.ts +81 -0
  22. package/dist/types/components/foundations/file-input.d.ts +75 -0
  23. package/dist/types/components/foundations/icon-badge.d.ts +2 -2
  24. package/dist/types/components/foundations/input.d.ts +11 -1
  25. package/dist/types/components/foundations/radio-group.d.ts +12 -2
  26. package/dist/types/components/foundations/skip-link.d.ts +39 -0
  27. package/dist/types/components/foundations/textarea.d.ts +11 -1
  28. package/dist/types/components/primitives/chat-composer.d.ts +87 -0
  29. package/dist/types/components/primitives/chip.d.ts +2 -7
  30. package/dist/types/components/primitives/content-carousel.d.ts +58 -0
  31. package/dist/types/components/primitives/date-picker.d.ts +44 -0
  32. package/dist/types/components/primitives/error-state.d.ts +43 -16
  33. package/dist/types/components/primitives/funnel-shell.d.ts +12 -1
  34. package/dist/types/components/primitives/header.d.ts +15 -1
  35. package/dist/types/components/primitives/image-input.d.ts +119 -0
  36. package/dist/types/components/primitives/section-header.d.ts +9 -2
  37. package/dist/types/components/primitives/section-nav.d.ts +28 -2
  38. package/dist/types/components/primitives/section.d.ts +35 -2
  39. package/dist/types/components/primitives/share-buttons.d.ts +8 -2
  40. package/dist/types/components/primitives/standard-page-shell.d.ts +11 -1
  41. package/dist/types/components/primitives/timeline.d.ts +23 -0
  42. package/dist/types/components/primitives/workspace-shell.d.ts +21 -1
  43. package/dist/types/index.d.ts +80 -4
  44. package/dist/types/lib/pagination-range.d.ts +16 -0
  45. package/dist/types/lib/use-value-length.d.ts +31 -0
  46. package/package.json +2 -1
  47. package/src/preset-standalone.css +322 -4
  48. package/src/preset.css +17 -0
  49. package/src/styles/semantic.css +7 -0
  50. package/src/styles/typography.css +15 -1
  51. package/templates/AGENTS.md +11 -0
  52. package/templates/CLAUDE.md +11 -0
  53. package/tokens.json +18 -2
@@ -90,6 +90,13 @@
90
90
  --Surface-Glass-Faint: var(--Primitive-White-alpha-700); /* rgba(255,255,255,0.698≈0.7) */
91
91
  --Surface-Brand-Ghost: rgba(255, 236, 217, 0.7); /* Orange-50 at 70%。閉じるボタン等 */
92
92
 
93
+ /* Overlay surfaces(画像・メディアの上に載せる半透過サーフェス)
94
+ * Surface-Glass と同じ半透過白でも用途を分けて命名: こちらは「画像上のボタン/ピル下地」専用。
95
+ * メディアの上に載るため、可読性を保つ目的で light/dark で切替えない(下は :root のみで .dark 上書きなし)。
96
+ * Button variant="overlay" / カルーセル矢印系の意匠に接続する。 */
97
+ --Surface-Overlay-Light: var(--Primitive-White-alpha-800); /* rgba(255,255,255,0.8) 半透過白の下地 */
98
+ --Surface-Overlay-Dark: var(--Primitive-Gray-alpha-400); /* rgba(0,0,0,0.4) 半透過黒の下地 */
99
+
93
100
  /* Border alphas */
94
101
  --Border-Hairline: rgba(28, 26, 26, 0.08); /* Gray-900 8%。微細ボーダー */
95
102
  --Border-Brand-Subtle: rgba(224, 75, 0, 0.16); /* Brand-Orange 16%。SNSリンクボーダー等 */
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * 命名規則: typo-{category}-{size}
10
10
  * category: heading | body | label
11
- * size: 3xl | 2xl | xl | lg | md | sm | xs
11
+ * size: 4xl | 3xl | 2xl | xl | lg | md | sm | xs
12
12
  *
13
13
  * ── 使い分けガイド ──
14
14
  *
@@ -32,6 +32,20 @@
32
32
 
33
33
  /* ─── Heading ─── */
34
34
 
35
+ @utility typo-heading-5xl {
36
+ font-size: 2.5rem; /* 40px */
37
+ line-height: 1.35; /* 54px */
38
+ letter-spacing: 0.04em;
39
+ font-weight: 700;
40
+ }
41
+
42
+ @utility typo-heading-4xl {
43
+ font-size: 2rem; /* 32px */
44
+ line-height: 1.4; /* 44.8px */
45
+ letter-spacing: 0.04em;
46
+ font-weight: 700;
47
+ }
48
+
35
49
  @utility typo-heading-3xl {
36
50
  font-size: 1.75rem; /* 28px */
37
51
  line-height: 1.5; /* 42px */
@@ -32,6 +32,17 @@ Codex(および他の AI エージェント)は UI 作業を始める前に
32
32
 
33
33
  DS に該当パターンが無い場合のみカスタム実装を許可。その場合は**必ずコメントで理由を記載**すること。
34
34
 
35
+ ## ❓「DS に無い」と思ったときのゲート(ローカル台帳禁止・issue 直行)
36
+
37
+ 部品が DS に無いと思っても、**手元の台帳・TODO リストで「昇格候補」を管理しないこと**。台帳は必ず drift する(実例: cake-api の昇格候補台帳が DS 0.10.0 で追加された `ImageUploader` / `ResponsiveDialog` / `DataTable` 等を反映せず、既に DS にある部品を「無い」と誤認してローカル実装を保持し続けた)。次の順で確認する:
38
+
39
+ 1. `node_modules/@cakejp/design-system/contracts/components.json` を名前で検索する(正典はここ)。
40
+ 2. `npx cakejp-ds check-duplicates` を実行し、ローカルに DS 同名の実装が無いか機械検出する(`--strict` で検出時 exit 1、CI に組み込める)。
41
+ 3. それでも無ければ、手元に台帳を作らず **flashpark/cake-design-system に issue を立てる**。
42
+ 4. やむを得ずローカル実装する場合は、「DS に X が追加されたら削除」の条件コメントを必ず添える。
43
+
44
+ **意図的にローカル実装を残すとき(check-duplicates の抑制)**: 対象 export の直前のコメント行(または行末コメント)に `// cakejp-ds-allow-duplicate: <理由>` を書くと、その 1 件だけ検出から外れる。**理由が空なら抑制されない**(形骸化防止)。抑制した件数と理由はサマリに出るので、`--strict` を CI に入れたまま運用できる。
45
+
35
46
  ## 使用方法
36
47
 
37
48
  ### CSS のセットアップ(重要)
@@ -34,6 +34,17 @@ Codex(および他の AI エージェント)は UI 作業を始める前に
34
34
 
35
35
  DS に該当パターンが無い場合のみカスタム実装を許可。その場合は**必ずコメントで理由を記載**すること。
36
36
 
37
+ ## ❓「DS に無い」と思ったときのゲート(ローカル台帳禁止・issue 直行)
38
+
39
+ 部品が DS に無いと思っても、**手元の台帳・TODO リストで「昇格候補」を管理しないこと**。台帳は必ず drift する(実例: cake-api の昇格候補台帳が DS 0.10.0 で追加された `ImageUploader` / `ResponsiveDialog` / `DataTable` 等を反映せず、既に DS にある部品を「無い」と誤認してローカル実装を保持し続けた)。次の順で確認する:
40
+
41
+ 1. `node_modules/@cakejp/design-system/contracts/components.json` を名前で検索する(正典はここ)。
42
+ 2. `npx cakejp-ds check-duplicates` を実行し、ローカルに DS 同名の実装が無いか機械検出する(`--strict` で検出時 exit 1、CI に組み込める)。
43
+ 3. それでも無ければ、手元に台帳を作らず **flashpark/cake-design-system に issue を立てる**。
44
+ 4. やむを得ずローカル実装する場合は、「DS に X が追加されたら削除」の条件コメントを必ず添える。
45
+
46
+ **意図的にローカル実装を残すとき(check-duplicates の抑制)**: 対象 export の直前のコメント行(または行末コメント)に `// cakejp-ds-allow-duplicate: <理由>` を書くと、その 1 件だけ検出から外れる。**理由が空なら抑制されない**(形骸化防止)。抑制した件数と理由はサマリに出るので、`--strict` を CI に入れたまま運用できる。
47
+
37
48
  ## 使用方法
38
49
 
39
50
  ### CSS のセットアップ(重要)
package/tokens.json CHANGED
@@ -26,7 +26,9 @@
26
26
  "accent-primary": { "value": "Primitive-Orange-700", "hex": "#E04B00", "usage": "アクセント背景" },
27
27
  "accent-primary-light": { "value": "Primitive-Orange-50", "hex": "#FFECD9", "usage": "アクセント背景(薄)" },
28
28
  "success": { "value": "Primitive-Forest-600", "hex": "#259D63", "usage": "成功背景" },
29
- "warning": { "value": "Primitive-Wood-50", "hex": "#F8F1E0", "usage": "警告背景" }
29
+ "warning": { "value": "Primitive-Wood-50", "hex": "#F8F1E0", "usage": "警告背景" },
30
+ "overlay-light": { "value": "Primitive-White-alpha-800", "hex": "#FFFFFFCC", "usage": "画像上の半透過白サーフェス(Button overlay / カルーセル矢印)" },
31
+ "overlay-dark": { "value": "Primitive-Gray-alpha-400", "hex": "#00000066", "usage": "画像上の半透過黒サーフェス" }
30
32
  },
31
33
  "text": {
32
34
  "high-emphasis": { "value": "Primitive-Gray-900", "hex": "#1C1A1A", "usage": "本文テキスト" },
@@ -56,7 +58,21 @@
56
58
 
57
59
  "typography": {
58
60
  "heading": {
59
- "3xl": { "fontSize": "28px", "lineHeight": 1.5, "letterSpacing": "0.04em", "fontWeight": 700, "usage": "ページタイトル" },
61
+ "5xl": {
62
+ "fontSize": "40px",
63
+ "lineHeight": 1.35,
64
+ "letterSpacing": "0.04em",
65
+ "fontWeight": 700,
66
+ "usage": "LP・マーケティング系ヒーローの PC 見出し。SP は 3xl(28px)を基準に段階を上げる。通常ページでは使わない"
67
+ },
68
+ "4xl": {
69
+ "fontSize": "32px",
70
+ "lineHeight": 1.4,
71
+ "letterSpacing": "0.04em",
72
+ "fontWeight": 700,
73
+ "usage": "LP・マーケティング系ヒーローの PC 見出し(5xlより抑えた表現)。通常ページでは使わない"
74
+ },
75
+ "3xl": { "fontSize": "28px", "lineHeight": 1.5, "letterSpacing": "0.04em", "fontWeight": 700, "usage": "通常ページの主見出し・ページタイトル。LPではSP側のヒーロー見出しにも使用" },
60
76
  "2xl": { "fontSize": "24px", "lineHeight": 1.5, "letterSpacing": "0.04em", "fontWeight": 700, "usage": "主要セクション見出し" },
61
77
  "xl": { "fontSize": "21px", "lineHeight": 1.5, "letterSpacing": "0.04em", "fontWeight": 700, "usage": "サブセクション見出し" },
62
78
  "lg": { "fontSize": "18px", "lineHeight": 1.5, "letterSpacing": "0.04em", "fontWeight": 700, "usage": "グループ見出し" },