@cakejp/design-system 0.12.0 → 0.14.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 (49) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/CLAUDE.md +12 -5
  3. package/MIGRATION.md +45 -0
  4. package/UPDATING.md +13 -0
  5. package/bin/check-duplicates.mjs +133 -9
  6. package/bin/exports-parser.mjs +54 -0
  7. package/bin/init.js +3 -0
  8. package/contracts/components.json +504 -209
  9. package/contracts/composition.json +11 -8
  10. package/contracts/rules.json +354 -113
  11. package/contracts/screen-patterns.json +1 -1
  12. package/dist/index.css +1 -1
  13. package/dist/index.js +4285 -3422
  14. package/dist/types/components/ec/admin-shell.d.ts +30 -2
  15. package/dist/types/components/ec/product-detail-sidebar.d.ts +1 -1
  16. package/dist/types/components/foundations/card.d.ts +27 -3
  17. package/dist/types/components/foundations/field.d.ts +26 -3
  18. package/dist/types/components/foundations/input.d.ts +3 -1
  19. package/dist/types/components/foundations/social-icon.d.ts +33 -0
  20. package/dist/types/components/foundations/textarea.d.ts +3 -1
  21. package/dist/types/components/primitives/chat-composer.d.ts +87 -0
  22. package/dist/types/components/primitives/combobox.d.ts +24 -0
  23. package/dist/types/components/primitives/content-carousel.d.ts +7 -1
  24. package/dist/types/components/primitives/date-picker.d.ts +15 -3
  25. package/dist/types/components/primitives/funnel-shell.d.ts +2 -0
  26. package/dist/types/components/primitives/image-input.d.ts +119 -0
  27. package/dist/types/components/primitives/multi-select.d.ts +24 -0
  28. package/dist/types/components/primitives/notification-badge.d.ts +1 -1
  29. package/dist/types/components/primitives/number-input.d.ts +84 -0
  30. package/dist/types/components/primitives/section-header.d.ts +9 -2
  31. package/dist/types/components/primitives/section.d.ts +35 -2
  32. package/dist/types/components/primitives/social-login-button.d.ts +3 -1
  33. package/dist/types/components/primitives/timeline.d.ts +23 -0
  34. package/dist/types/components/primitives/workspace-shell.d.ts +2 -0
  35. package/dist/types/index.d.ts +25 -7
  36. package/dist/types/lib/pagination-range.d.ts +16 -0
  37. package/dist/types/lib/use-value-length.d.ts +31 -0
  38. package/eslint/deprecated.js +44 -0
  39. package/package.json +8 -3
  40. package/scripts/codemod/README.md +14 -0
  41. package/scripts/codemod/template.mjs +62 -0
  42. package/src/components/COMPONENT_LOOKUP.md +166 -0
  43. package/src/preset-standalone.css +16 -0
  44. package/src/preset.css +17 -0
  45. package/src/styles/typography.css +7 -0
  46. package/templates/AGENTS.md +4 -0
  47. package/templates/CLAUDE.md +4 -0
  48. package/tokens.json +933 -87
  49. package/dist/types/components/primitives/quantity-selector.d.ts +0 -50
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "meta": {
3
3
  "name": "Cake.jp Design System — Composition Contracts",
4
- "version": "0.1.0",
4
+ "version": "0.14.0",
5
5
  "description": "ページ骨格・視覚階層・余白リズムの機械可読な正本。画面パターンを選んだ後の「実際の組み方」を規定する。ページの外枠(モバイル/デスクトップ/管理)、商品グリッドの列数、余白の4段リズム、Surface のネスト階層、テキスト階層、CTA の優先順位を構造化する。人間向けの解説は guidelines/composition/layout.md・guidelines/composition/hierarchy.md・guidelines/overview.md。",
6
6
  "source": "guidelines/composition/layout.md, guidelines/composition/hierarchy.md, guidelines/overview.md, guidelines/components/button.md(CTA 密度ルール)を正本化",
7
7
  "roleSeparation": "screen-patterns.json はページ種別(Standard Page / Focused Workspace / ResponsiveDialog / Dialog)を選ぶための契約。composition.json は選んだ後、その骨格をどう組むか(外枠構造・余白リズム・階層)の契約。前者=何を使うか、後者=どう並べるか。",
@@ -122,7 +122,8 @@
122
122
  { "depth": 2, "token": "--Surface-Secondary", "hex": "#FBF9F8", "usage": "ネストしたセクション・交互行" },
123
123
  { "depth": 3, "token": "--Surface-Tertiary", "hex": "#F4F2F1", "usage": "抑えたコンテナ・無効領域" }
124
124
  ],
125
- "rule": "ネストは3層まで。4層目以降は情報設計を見直す。背景は Surface トークンで明示(未指定で親を透かさない)。"
125
+ "rule": "ネストは3層まで。4層目以降は情報設計を見直す。背景は Surface トークンで明示(未指定で親を透かさない)。",
126
+ "surfaceContext": "色地 Section(background='subtle'|'accent-subtle')と、地が Surface-Secondary のシェル(AdminShell / WorkspaceShell / FunnelShell)は配下に --card-surface: var(--Surface-Primary) を流すため、その中の Card は surface 未指定でも白(depth 1)になる。DS の Section を使わない自前の色地では、親要素に className='[--card-surface:var(--Surface-Primary)]' を宣言して同じ文脈を作る。dark は伝播値を Surface-Secondary に据え置く(半透明白が地に重なって浮くため、白を強制すると elevation が反転する)。"
126
127
  },
127
128
  "textHierarchy": {
128
129
  "description": "typo-* とテキスト強調トークンの組み合わせで階層を作るツリー。上ほど強い階層。トークン名は tokens.json の typography.* / semantic.text.* に対応。",
@@ -137,17 +138,19 @@
137
138
  "accentNote": "価格などの最強調は typo-label-lg + --Text-Accent-Primary(オレンジ)。強調は色ではなく typo 系(heading/label)で表現し、font-bold を足さない。"
138
139
  },
139
140
  "ctaHierarchy": {
140
- "description": "Button の variant 優先順位。1ビューポート内での CTA 密度を制御する。",
141
+ "description": "Button の variant 優先順位。1ビューポート内での CTA 密度を制御する。⚠️ これは「前進アクションの強さ」の序列であり、画面に並べた2番目のボタンが自動的に secondary になるわけではない。戻る/キャンセル/閉じるのような後退・中立アクションは序列ではなく役割で選ぶ(→ tertiary)。選ぶ前に各項目の appearance(実際の意匠)を必ず確認すること。",
141
142
  "priority": [
142
- { "variant": "default", "role": "Primary CTA(オレンジ)", "note": "1ビューポートに1つまで(唯一の主 CTA)" },
143
- { "variant": "secondary", "role": "Secondary action" },
144
- { "variant": "tertiary", "role": "Tertiary action" },
145
- { "variant": "ghost", "role": "Minimal action(メニュー・ツールバー内)" },
146
- { "variant": "link", "role": "Inline link" }
143
+ { "variant": "default", "role": "Primary CTA(前進・確定)", "appearance": "ブランドオレンジのベタ塗り", "note": "1ビューポートに1つまで(唯一の主 CTA)" },
144
+ { "variant": "secondary", "role": "Secondary action(前進系の副 CTA。例: 「サンプルを見る」「詳細を見る」)", "appearance": "⚠️ ブランドアクセント(Surface-Accent-Primary-Light 地 + Brand-Cake-Orange 文字)。Material / Bootstrap / shadcn の secondary(グレー・控えめ)とは別物", "note": "アクセント色が付くため、戻る・キャンセル・閉じる等の後退/中立アクションには使わない(→ tertiary)" },
145
+ { "variant": "tertiary", "role": "Tertiary action / 後退・中立アクション(戻る・キャンセル・閉じる・スキップ・あとで)", "appearance": "ニュートラルなグレー(Surface-Tertiary 地 + Text-High-Emphasis 文字)", "note": "他 DS の secondary に相当する見た目。主 CTA の隣に置く「戻る」「キャンセル」はこれを使う" },
146
+ { "variant": "ghost", "role": "Minimal action(メニュー・ツールバー内)", "appearance": "下地なし・hover で薄い下地" },
147
+ { "variant": "link", "role": "Inline link", "appearance": "テキストリンク意匠" }
147
148
  ],
148
149
  "rules": [
149
150
  "default(オレンジ)の CTA は1ビューポートに1つまで。主アクションを1つに絞る",
150
151
  "複数アクションを並べる時は default を tertiary / ghost と組み合わせる",
152
+ "「戻る」「キャンセル」「閉じる」「スキップ」「あとで」は tertiary(グレー)。secondary はアクセント色なので後退アクションに使わない",
153
+ "secondary を使うのは、主 CTA と別方向の“前進”を促す副 CTA のとき(例: 主=「購入する」に対し副=「サンプルを見る」)",
151
154
  "モバイルの全幅下部 CTA は size=\"xl\" + w-full(StickyActionBar 内)"
152
155
  ]
153
156
  }