@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
@@ -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
  }
@@ -527,7 +527,7 @@
527
527
  "category": "component",
528
528
  "pattern": "<input type=\"date\"|<input type='date'",
529
529
  "message": "input type='date' のネイティブ日付ピッカー禁止",
530
- "fix": "<Popover> + <Calendar> でDS準拠の日付ピッカーを組む"
530
+ "fix": "実装済みの正解形 <DatePicker />(日付)/ <DateTimePicker />(日時)を使う(内部で Popover+Calendar を DS 意匠で組み済み・M月D日(曜日)表記・日本語カレンダー)。特殊要件で手組みが要る場合のみ <Popover> + <Calendar>"
531
531
  },
532
532
  {
533
533
  "id": "R51",
@@ -542,6 +542,21 @@
542
542
  "category": "component",
543
543
  "message": "管理画面のテーブルをui/tableで組まない",
544
544
  "fix": "<DataTable> を使う(ソート・選択行・アクションメニュー対応)"
545
+ },
546
+ {
547
+ "id": "R54",
548
+ "severity": "error",
549
+ "category": "component",
550
+ "pattern": "<input type=\"file\"|<input type='file'",
551
+ "message": "ネイティブ <input type='file'> を直接使わない",
552
+ "fix": "汎用の添付(PDF/CSV/画像混在)は <FileInput />(foundations)を使う。画像1枚の入力(プレビュー+形式/サイズ検証+値のバインド)は <ImageInput />(primitives)、複数枚のグリッド管理は <ImageUploader />(primitives)を使う"
553
+ },
554
+ {
555
+ "id": "R55",
556
+ "severity": "warning",
557
+ "category": "component",
558
+ "message": "画像・メディアの上に載せる操作ボタンを rgba 直書きの半透過下地で手組みしない",
559
+ "fix": "<Button variant='overlay'>(半透過白 Surface-Overlay-Light + shadow-md + backdrop-blur-sm)を使う。ImageCarousel 矢印と同系の意匠。円形は size='icon' + className='rounded-full'"
545
560
  }
546
561
  ],
547
562
  "accessibility": {
@@ -569,7 +584,9 @@
569
584
  "typography": {
570
585
  "rule": "必ず typo-* クラスを使用。text-sm font-bold 等の個別指定禁止。",
571
586
  "classes": [
572
- { "class": "typo-heading-3xl", "size": "28px", "weight": "bold" },
587
+ { "class": "typo-heading-5xl", "size": "40px", "weight": "bold", "usage": "LP・マーケティング系ヒーローの PC 見出し限定" },
588
+ { "class": "typo-heading-4xl", "size": "32px", "weight": "bold", "usage": "LP・マーケティング系ヒーローの PC 見出し限定(5xlより抑えた表現)" },
589
+ { "class": "typo-heading-3xl", "size": "28px", "weight": "bold", "usage": "通常ページの主見出し・ページタイトル。LPではSP側にも使用" },
573
590
  { "class": "typo-heading-2xl", "size": "24px", "weight": "bold" },
574
591
  { "class": "typo-heading-xl", "size": "21px", "weight": "bold" },
575
592
  { "class": "typo-heading-lg", "size": "18px", "weight": "bold" },
@@ -599,7 +616,8 @@
599
616
  { "element": "Text input", "min": "44px", "recommended": "48px" },
600
617
  { "element": "Chip/Filter", "min": "32px", "recommended": "36px" },
601
618
  { "element": "Navigation item", "min": "44px", "recommended": "48px" }
602
- ]
619
+ ],
620
+ "utility": "見た目が44px未満の小型操作部品をSPで使う場合は className=\"tap-target\" を付け、透明な疑似要素で実効操作領域を44×44px以上にする。隣接ターゲットと重なる密度では使わず親のgapを広げる"
603
621
  }
604
622
  },
605
623
  "writing": {