@cakejp/design-system 0.3.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 (131) hide show
  1. package/AGENTS.md +144 -0
  2. package/CHANGELOG.md +115 -0
  3. package/CLAUDE.md +188 -0
  4. package/CLAUDE_PRODUCTION.md +121 -0
  5. package/MIGRATION.md +228 -0
  6. package/README.md +79 -0
  7. package/RELEASE.md +205 -0
  8. package/bin/init.js +134 -0
  9. package/component-registry.json +1146 -0
  10. package/contracts/components.json +730 -0
  11. package/contracts/rules.json +559 -0
  12. package/dist/index.css +1 -0
  13. package/dist/index.js +9344 -0
  14. package/dist/types/components/ec/_mypage-menu-data.d.ts +15 -0
  15. package/dist/types/components/ec/admin-layout.d.ts +31 -0
  16. package/dist/types/components/ec/anniversary-card.d.ts +50 -0
  17. package/dist/types/components/ec/cake-logo.d.ts +22 -0
  18. package/dist/types/components/ec/chart-controls.d.ts +16 -0
  19. package/dist/types/components/ec/countdown-timer.d.ts +24 -0
  20. package/dist/types/components/ec/coupon-card.d.ts +47 -0
  21. package/dist/types/components/ec/delivery-calendar.d.ts +36 -0
  22. package/dist/types/components/ec/order-section.d.ts +29 -0
  23. package/dist/types/components/ec/order-summary.d.ts +36 -0
  24. package/dist/types/components/ec/payment-method.d.ts +41 -0
  25. package/dist/types/components/ec/product-card.d.ts +77 -0
  26. package/dist/types/components/ec/product-carousel.d.ts +56 -0
  27. package/dist/types/components/ec/product-cta.d.ts +35 -0
  28. package/dist/types/components/ec/product-detail-bar.d.ts +62 -0
  29. package/dist/types/components/ec/product-detail-sidebar.d.ts +115 -0
  30. package/dist/types/components/ec/product-list-item.d.ts +90 -0
  31. package/dist/types/components/ec/product-option.d.ts +62 -0
  32. package/dist/types/components/ec/rating-stars.d.ts +30 -0
  33. package/dist/types/components/ec/review-card.d.ts +44 -0
  34. package/dist/types/components/ec/review-form.d.ts +40 -0
  35. package/dist/types/components/ec/review-summary.d.ts +53 -0
  36. package/dist/types/components/ec/shop-card.d.ts +48 -0
  37. package/dist/types/components/ec/stat-card.d.ts +44 -0
  38. package/dist/types/components/foundations/accordion.d.ts +7 -0
  39. package/dist/types/components/foundations/alert-dialog.d.ts +18 -0
  40. package/dist/types/components/foundations/alert.d.ts +42 -0
  41. package/dist/types/components/foundations/aspect-ratio.d.ts +3 -0
  42. package/dist/types/components/foundations/avatar.d.ts +11 -0
  43. package/dist/types/components/foundations/badge.d.ts +9 -0
  44. package/dist/types/components/foundations/breadcrumb.d.ts +11 -0
  45. package/dist/types/components/foundations/button.d.ts +10 -0
  46. package/dist/types/components/foundations/calendar.d.ts +8 -0
  47. package/dist/types/components/foundations/card.d.ts +9 -0
  48. package/dist/types/components/foundations/checkbox-card.d.ts +30 -0
  49. package/dist/types/components/foundations/checkbox-group.d.ts +53 -0
  50. package/dist/types/components/foundations/checkbox.d.ts +4 -0
  51. package/dist/types/components/foundations/collapsible.d.ts +5 -0
  52. package/dist/types/components/foundations/command.d.ts +18 -0
  53. package/dist/types/components/foundations/context-menu.d.ts +25 -0
  54. package/dist/types/components/foundations/data-table.d.ts +104 -0
  55. package/dist/types/components/foundations/dialog.d.ts +17 -0
  56. package/dist/types/components/foundations/drawer.d.ts +13 -0
  57. package/dist/types/components/foundations/dropdown-menu.d.ts +25 -0
  58. package/dist/types/components/foundations/form.d.ts +24 -0
  59. package/dist/types/components/foundations/hover-card.d.ts +6 -0
  60. package/dist/types/components/foundations/input.d.ts +3 -0
  61. package/dist/types/components/foundations/label.d.ts +7 -0
  62. package/dist/types/components/foundations/menubar.d.ts +26 -0
  63. package/dist/types/components/foundations/navigation-menu.d.ts +14 -0
  64. package/dist/types/components/foundations/pagination.d.ts +13 -0
  65. package/dist/types/components/foundations/popover.d.ts +10 -0
  66. package/dist/types/components/foundations/progress.d.ts +4 -0
  67. package/dist/types/components/foundations/radio-group.d.ts +9 -0
  68. package/dist/types/components/foundations/responsive-dialog.d.ts +52 -0
  69. package/dist/types/components/foundations/scroll-area.d.ts +5 -0
  70. package/dist/types/components/foundations/select.d.ts +15 -0
  71. package/dist/types/components/foundations/separator.d.ts +4 -0
  72. package/dist/types/components/foundations/sheet.d.ts +14 -0
  73. package/dist/types/components/foundations/skeleton.d.ts +2 -0
  74. package/dist/types/components/foundations/slider.d.ts +4 -0
  75. package/dist/types/components/foundations/sonner.d.ts +3 -0
  76. package/dist/types/components/foundations/spinner.d.ts +6 -0
  77. package/dist/types/components/foundations/switch.d.ts +13 -0
  78. package/dist/types/components/foundations/table.d.ts +10 -0
  79. package/dist/types/components/foundations/tabs.d.ts +12 -0
  80. package/dist/types/components/foundations/textarea.d.ts +3 -0
  81. package/dist/types/components/foundations/toggle-group.d.ts +23 -0
  82. package/dist/types/components/foundations/toggle.d.ts +9 -0
  83. package/dist/types/components/foundations/tooltip.d.ts +7 -0
  84. package/dist/types/components/pages/cake/_mypage-shell.d.ts +41 -0
  85. package/dist/types/components/primitives/banner-carousel.d.ts +54 -0
  86. package/dist/types/components/primitives/bottom-tab-bar.d.ts +39 -0
  87. package/dist/types/components/primitives/bulk-action-bar.d.ts +32 -0
  88. package/dist/types/components/primitives/category-scroll.d.ts +70 -0
  89. package/dist/types/components/primitives/category-shortcuts.d.ts +44 -0
  90. package/dist/types/components/primitives/chip.d.ts +44 -0
  91. package/dist/types/components/primitives/coach-mark.d.ts +28 -0
  92. package/dist/types/components/primitives/empty-state.d.ts +36 -0
  93. package/dist/types/components/primitives/error-state.d.ts +41 -0
  94. package/dist/types/components/primitives/filter-bar.d.ts +56 -0
  95. package/dist/types/components/primitives/footer.d.ts +81 -0
  96. package/dist/types/components/primitives/form-field.d.ts +46 -0
  97. package/dist/types/components/primitives/header.d.ts +69 -0
  98. package/dist/types/components/primitives/image-carousel.d.ts +52 -0
  99. package/dist/types/components/primitives/image-gallery.d.ts +35 -0
  100. package/dist/types/components/primitives/image-uploader.d.ts +19 -0
  101. package/dist/types/components/primitives/kebab-menu.d.ts +38 -0
  102. package/dist/types/components/primitives/list-item.d.ts +60 -0
  103. package/dist/types/components/primitives/menu-drawer.d.ts +75 -0
  104. package/dist/types/components/primitives/notification-badge.d.ts +30 -0
  105. package/dist/types/components/primitives/notification-list.d.ts +45 -0
  106. package/dist/types/components/primitives/price-display.d.ts +33 -0
  107. package/dist/types/components/primitives/progress-steps.d.ts +27 -0
  108. package/dist/types/components/primitives/quantity-selector.d.ts +50 -0
  109. package/dist/types/components/primitives/search-bar.d.ts +31 -0
  110. package/dist/types/components/primitives/search-panel.d.ts +41 -0
  111. package/dist/types/components/primitives/section-header.d.ts +51 -0
  112. package/dist/types/components/primitives/share-buttons.d.ts +23 -0
  113. package/dist/types/components/primitives/side-nav.d.ts +62 -0
  114. package/dist/types/components/primitives/social-login-button.d.ts +24 -0
  115. package/dist/types/components/primitives/status-count-tabs.d.ts +14 -0
  116. package/dist/types/components/primitives/sticky-action-bar.d.ts +7 -0
  117. package/dist/types/components/primitives/sub-nav.d.ts +34 -0
  118. package/dist/types/components/primitives/tag.d.ts +19 -0
  119. package/dist/types/index.d.ts +109 -0
  120. package/dist/types/lib/utils.d.ts +2 -0
  121. package/package.json +186 -0
  122. package/scripts/codemod/check-migration.mjs +97 -0
  123. package/scripts/codemod/v0.2-to-v0.3.mjs +192 -0
  124. package/src/preset-standalone.css +109 -0
  125. package/src/preset.css +288 -0
  126. package/src/styles/primitive.css +139 -0
  127. package/src/styles/semantic.css +203 -0
  128. package/src/styles/typography.css +129 -0
  129. package/templates/AGENTS.md +56 -0
  130. package/templates/CLAUDE.md +56 -0
  131. package/tokens.json +127 -0
@@ -0,0 +1,559 @@
1
+ {
2
+ "meta": {
3
+ "name": "Cake.jp Design System — Rules Contracts",
4
+ "version": "0.1.0",
5
+ "description": "禁止パターン・アクセシビリティ要件・ライティングルールの構造化定義。lint-scratch.sh と check-drift.sh で自動検証。"
6
+ },
7
+ "prohibited": [
8
+ {
9
+ "id": "P1",
10
+ "severity": "error",
11
+ "category": "production",
12
+ "message": "本番実装を確認せずにコンポーネントを新規作成する",
13
+ "fix": "まず www-test-htdocs/app/views/elements/2023/ を検索する"
14
+ },
15
+ {
16
+ "id": "P2",
17
+ "severity": "error",
18
+ "category": "production",
19
+ "message": "本番CDN画像(assets.cake.jp)をSVGやコードで再現する",
20
+ "fix": "CDN URLをそのまま <img src> で使う"
21
+ },
22
+ {
23
+ "id": "P3",
24
+ "severity": "error",
25
+ "category": "production",
26
+ "message": "CDNアセットをダウンロードしてリポジトリに含める",
27
+ "fix": "CDN URLを直接参照する"
28
+ },
29
+ {
30
+ "id": "P4",
31
+ "severity": "error",
32
+ "category": "production",
33
+ "message": "本番のCSSバリアント体系を無視して独自命名する",
34
+ "fix": "cakejp.css のバリアント体系(--sale, --coupon 等)を尊重する"
35
+ },
36
+ {
37
+ "id": "R1",
38
+ "severity": "warning",
39
+ "category": "typography",
40
+ "pattern": "font-bold|font-semibold|font-medium|font-light",
41
+ "excludes": [".stories.", "cva", "variants", "components/foundations/", "components/primitives/", "components/ec/"],
42
+ "message": "text-sm font-bold 等の個別クラス組み合わせ禁止",
43
+ "fix": "typo-label-md 等 typo-* クラスを使う"
44
+ },
45
+ {
46
+ "id": "R2",
47
+ "severity": "warning",
48
+ "category": "typography",
49
+ "pattern": "typo-[a-z-]+ font-(bold|semibold|medium)",
50
+ "message": "typo-* に font-weight を追加禁止(typo-* が既に含んでいる)",
51
+ "fix": "太字が必要なら typo-label-* に変更する"
52
+ },
53
+ {
54
+ "id": "R3",
55
+ "severity": "warning",
56
+ "category": "typography",
57
+ "pattern": "typo-[a-z-]+ text-[a-z]",
58
+ "message": "typo-* にtext-sizeを追加禁止(二重定義)",
59
+ "fix": "typo-* だけを使う"
60
+ },
61
+ {
62
+ "id": "R4",
63
+ "severity": "warning",
64
+ "category": "typography",
65
+ "pattern": "text-\\[[0-9]+px\\]|leading-\\[[0-9.]+\\]",
66
+ "excludes": [".stories."],
67
+ "message": "px直書き・leading直書き禁止",
68
+ "fix": "typo-body-md 等 typo-* クラスを使う"
69
+ },
70
+ {
71
+ "id": "R5",
72
+ "severity": "warning",
73
+ "category": "typography",
74
+ "pattern": "tracking-tight",
75
+ "message": "tracking-tight禁止(日本語の可読性が著しく低下)",
76
+ "fix": "typo-* のデフォルト字間のままにする"
77
+ },
78
+ {
79
+ "id": "R6",
80
+ "severity": "warning",
81
+ "category": "color",
82
+ "pattern": "text-gray-|text-orange-|text-red-|text-green-|text-blue-|bg-gray-|bg-orange-|bg-red-|bg-green-|bg-blue-",
83
+ "excludes": [".stories.", "components/foundations/", "components/primitives/", "components/ec/"],
84
+ "message": "Tailwind標準色クラス禁止",
85
+ "fix": "text-[var(--Text-High-Emphasis)] 等セマンティックトークンを使う"
86
+ },
87
+ {
88
+ "id": "R7",
89
+ "severity": "warning",
90
+ "category": "color",
91
+ "pattern": "bg-orange-[0-9]+|text-orange-[0-9]+",
92
+ "excludes": [".stories.", "components/foundations/", "components/primitives/", "components/ec/"],
93
+ "message": "Primitiveカラー直接使用禁止",
94
+ "fix": "bg-[var(--Brand-Cake-Orange)] 等セマンティックトークンを使う"
95
+ },
96
+ {
97
+ "id": "R8",
98
+ "severity": "warning",
99
+ "category": "color",
100
+ "pattern": "#[0-9A-Fa-f]{6}",
101
+ "excludes": [".stories.", ".css", "shadow", "components/foundations/", "components/primitives/", "components/ec/"],
102
+ "message": "HEXハードコード禁止",
103
+ "fix": "var(--Brand-Cake-Orange) 等セマンティックトークンを使う"
104
+ },
105
+ {
106
+ "id": "R9",
107
+ "severity": "error",
108
+ "category": "accessibility",
109
+ "message": "赤色だけでエラーを伝える",
110
+ "fix": "赤色 + ⚠ アイコン + テキストの3点セット必須"
111
+ },
112
+ {
113
+ "id": "R10",
114
+ "severity": "warning",
115
+ "category": "color",
116
+ "pattern": "text-black\\b",
117
+ "excludes": [".stories."],
118
+ "message": "text-black (#000) 禁止",
119
+ "fix": "text-[var(--Text-High-Emphasis)](#1C1A1A)"
120
+ },
121
+ {
122
+ "id": "R10b",
123
+ "severity": "warning",
124
+ "category": "color",
125
+ "pattern": "Border-High-Emphasis",
126
+ "excludes": ["hover:", "focus:", "active:", "components/foundations/", "components/primitives/", "components/ec/"],
127
+ "message": "Border-High-Emphasis を静的なカード・コンテナに使用禁止",
128
+ "fix": "通常枠は Border-Medium-Emphasis。hover時のみ hover:border-[var(--Border-High-Emphasis)]"
129
+ },
130
+ {
131
+ "id": "R11",
132
+ "severity": "warning",
133
+ "category": "spacing",
134
+ "pattern": "p-\\[[0-9]*[13579]px\\]|m-\\[[0-9]*[13579]px\\]",
135
+ "message": "4pxグリッド外の余白値禁止",
136
+ "fix": "p-3(12px)等4の倍数のTailwindクラスを使う"
137
+ },
138
+ {
139
+ "id": "R12",
140
+ "severity": "warning",
141
+ "category": "spacing",
142
+ "pattern": "gap-\\[[0-9]*[13579]px\\]",
143
+ "message": "4pxグリッド外のgap値禁止",
144
+ "fix": "gap-1.5(6px)or gap-2(8px)"
145
+ },
146
+ {
147
+ "id": "R13",
148
+ "severity": "warning",
149
+ "category": "spacing",
150
+ "pattern": "style=\\{\\{.*margin|style=\\{\\{.*padding",
151
+ "message": "インラインスタイルで余白を指定禁止",
152
+ "fix": "m-* / p-* 等Tailwindクラスで指定する"
153
+ },
154
+ {
155
+ "id": "R14",
156
+ "severity": "error",
157
+ "category": "component",
158
+ "pattern": "<button\\b",
159
+ "excludes": ["data-slot", ".stories.", "components/foundations/", "components/primitives/", "components/ec/"],
160
+ "message": "生の <button> 禁止",
161
+ "fix": "<Button variant='...' size='...'> を使う"
162
+ },
163
+ {
164
+ "id": "R15",
165
+ "severity": "error",
166
+ "category": "component",
167
+ "pattern": "<input\\b",
168
+ "excludes": ["data-slot", ".stories.", "type=\"search\"", "type=\"file\"", "components/foundations/", "components/primitives/", "components/ec/"],
169
+ "message": "生の <input> 禁止",
170
+ "fix": "<Input> コンポーネントを使う"
171
+ },
172
+ {
173
+ "id": "R16",
174
+ "severity": "warning",
175
+ "category": "component",
176
+ "pattern": "<Tag.*onClick|onClick.*<Tag",
177
+ "message": "TagにonClickを付けない(Tag は表示専用)",
178
+ "fix": "押せるようにしたいなら <Chip> を使う"
179
+ },
180
+ {
181
+ "id": "R17",
182
+ "severity": "warning",
183
+ "category": "component",
184
+ "message": "Badgeに×ボタンを付けない(Badge はステータス表示専用)",
185
+ "fix": "削除できるラベルは <Chip> を使う"
186
+ },
187
+ {
188
+ "id": "R18",
189
+ "severity": "warning",
190
+ "category": "component",
191
+ "pattern": "`\\$\\{.*\\?.*\\}`",
192
+ "excludes": ["components/foundations/", "components/primitives/", "components/ec/"],
193
+ "message": "テンプレートリテラルでclassNameを組み立てない",
194
+ "fix": "cn(base, active && 'bg-red') を使う"
195
+ },
196
+ {
197
+ "id": "R18b",
198
+ "severity": "warning",
199
+ "category": "component",
200
+ "message": "CardのpaddingをCard本体とchildで分離しない",
201
+ "fix": "Card本体が p-4 で管理。全幅コンテンツは -mx-4 で突き破る"
202
+ },
203
+ {
204
+ "id": "R19",
205
+ "severity": "error",
206
+ "category": "image",
207
+ "pattern": "<img\\b",
208
+ "excludes": ["AspectRatio", "aspect-ratio", ".stories.", "components/foundations/", "components/primitives/", "components/ec/", "object-cover"],
209
+ "message": "裸の <img> 禁止(CLS発生)",
210
+ "fix": "<AspectRatio ratio={1}> で囲む"
211
+ },
212
+ {
213
+ "id": "R20",
214
+ "severity": "warning",
215
+ "category": "image",
216
+ "message": "商品画像に object-cover を付け忘れない",
217
+ "fix": "<img className='object-cover w-full h-full'>"
218
+ },
219
+ {
220
+ "id": "R21",
221
+ "severity": "warning",
222
+ "category": "accessibility",
223
+ "pattern": "alt=\"\"",
224
+ "excludes": ["components/foundations/", "components/primitives/", "components/ec/"],
225
+ "message": "alt='' 禁止(スクリーンリーダーが読めない)",
226
+ "fix": "alt='苺のショートケーキ' のように日本語で内容を書く"
227
+ },
228
+ {
229
+ "id": "R22",
230
+ "severity": "warning",
231
+ "category": "form",
232
+ "message": "placeholderだけ書いてLabelを省略しない",
233
+ "fix": "<Label>お名前</Label> + placeholder='例: 山田太郎'"
234
+ },
235
+ {
236
+ "id": "R23",
237
+ "severity": "warning",
238
+ "category": "form",
239
+ "message": "必須項目に * を付け忘れない",
240
+ "fix": "<span className='text-[var(--Text-Caution)]'>*</span>"
241
+ },
242
+ {
243
+ "id": "R24",
244
+ "severity": "warning",
245
+ "category": "form",
246
+ "pattern": "type=\"text\"",
247
+ "message": "メールアドレス欄に type='text' を使わない",
248
+ "fix": "type='email'。電話は type='tel'"
249
+ },
250
+ {
251
+ "id": "R25",
252
+ "severity": "error",
253
+ "category": "component",
254
+ "pattern": "<select\\b",
255
+ "excludes": ["components/foundations/"],
256
+ "message": "HTMLネイティブの <select> 禁止",
257
+ "fix": "<Select> コンポーネントを使う"
258
+ },
259
+ {
260
+ "id": "R26",
261
+ "severity": "error",
262
+ "category": "modal",
263
+ "message": "モーダル内のボタン配置を間違えない(削除=左、キャンセル=右は逆)",
264
+ "fix": "左=キャンセル(secondary)、右=削除する(destructive)"
265
+ },
266
+ {
267
+ "id": "R27",
268
+ "severity": "error",
269
+ "category": "modal",
270
+ "pattern": "fixed inset-0",
271
+ "excludes": ["components/foundations/"],
272
+ "message": "div.fixed.inset-0 で自作モーダル禁止",
273
+ "fix": "<Dialog> or <Sheet> を使う(ESC・Tab・背景スクロールを自動処理)"
274
+ },
275
+ {
276
+ "id": "R28",
277
+ "severity": "error",
278
+ "category": "modal",
279
+ "message": "削除ボタン押下で即削除しない",
280
+ "fix": "<AlertDialog> で確認を挟む"
281
+ },
282
+ {
283
+ "id": "R29",
284
+ "severity": "warning",
285
+ "category": "table",
286
+ "message": "金額列を左寄せにしない",
287
+ "fix": "<TableCell className='text-right'>"
288
+ },
289
+ {
290
+ "id": "R30",
291
+ "severity": "warning",
292
+ "category": "table",
293
+ "message": "テーブル行にhoverを付け忘れない",
294
+ "fix": "<TableRow> に hover:bg-muted/50 が既に入っている"
295
+ },
296
+ {
297
+ "id": "R31",
298
+ "severity": "warning",
299
+ "category": "table",
300
+ "message": "truncateで切ったテキストを放置しない",
301
+ "fix": "<Tooltip> で全文をホバー表示する"
302
+ },
303
+ {
304
+ "id": "R32",
305
+ "severity": "warning",
306
+ "category": "layout",
307
+ "pattern": "width:\\s*375px|w-\\[375px\\]",
308
+ "message": "固定幅375px等を指定しない",
309
+ "fix": "w-full max-w-[375px]"
310
+ },
311
+ {
312
+ "id": "R33",
313
+ "severity": "warning",
314
+ "category": "layout",
315
+ "pattern": "position:\\s*absolute",
316
+ "excludes": ["components/foundations/", "components/primitives/", "components/ec/"],
317
+ "message": "position: absolute で要素を並べない",
318
+ "fix": "Flexbox / Grid を使う"
319
+ },
320
+ {
321
+ "id": "R34",
322
+ "severity": "warning",
323
+ "category": "layout",
324
+ "pattern": "z-\\[9999\\]|z-\\[999\\]|z-index:\\s*9999",
325
+ "message": "z-index: 9999 禁止",
326
+ "fix": "z-50 を使う"
327
+ },
328
+ {
329
+ "id": "R35",
330
+ "severity": "warning",
331
+ "category": "layout",
332
+ "message": "セクション間の余白を毎回違う値にしない",
333
+ "fix": "gap-4(16px)を基準に統一"
334
+ },
335
+ {
336
+ "id": "R47",
337
+ "severity": "warning",
338
+ "category": "component",
339
+ "pattern": "border-l-4|border-t-4|border-r-4|border-b-4",
340
+ "excludes": [".stories.", "components/foundations/", "components/primitives/", "components/ec/"],
341
+ "message": "トーストに左ボーダーで状態色を付けない",
342
+ "fix": "背景色全体で状態を表現(!bg-[var(--Surface-Caution-Light)])"
343
+ },
344
+ {
345
+ "id": "R36",
346
+ "severity": "warning",
347
+ "category": "animation",
348
+ "pattern": "duration-[3-9][0-9][0-9]|duration-[0-9]{4}",
349
+ "message": "duration-300以上の遅いアニメーション禁止",
350
+ "fix": "hover は duration-150、開閉は duration-200"
351
+ },
352
+ {
353
+ "id": "R38",
354
+ "severity": "warning",
355
+ "category": "component",
356
+ "message": "disabledボタンを色だけで表現しない",
357
+ "fix": "opacity-50 cursor-not-allowed + disabled属性"
358
+ },
359
+ {
360
+ "id": "R39",
361
+ "severity": "error",
362
+ "category": "accessibility",
363
+ "pattern": "aria-label=\"\"",
364
+ "message": "アイコンのみボタンにaria-labelなし禁止",
365
+ "fix": "aria-label='閉じる' を日本語で付ける"
366
+ },
367
+ {
368
+ "id": "R40",
369
+ "severity": "warning",
370
+ "category": "accessibility",
371
+ "pattern": "aria-label=\"[A-Z][a-z]",
372
+ "excludes": ["components/foundations/", "components/primitives/", "components/ec/"],
373
+ "message": "aria-labelを英語で書かない(cake.jpは日本語サービス)",
374
+ "fix": "aria-label='閉じる'('Close'にしない)"
375
+ },
376
+ {
377
+ "id": "R41",
378
+ "severity": "error",
379
+ "category": "accessibility",
380
+ "pattern": "outline-none\\b",
381
+ "excludes": ["focus-visible", "components/foundations/", "components/primitives/", "components/ec/"],
382
+ "message": "outline-none でフォーカスリングを消す禁止",
383
+ "fix": "focus-visible:ring-[3px] focus-visible:ring-[var(--Focus-High-Emphasis)]/50"
384
+ },
385
+ {
386
+ "id": "R42",
387
+ "severity": "error",
388
+ "category": "accessibility",
389
+ "pattern": "<div.*onClick|<span.*onClick",
390
+ "excludes": ["components/foundations/", "components/primitives/", "components/ec/"],
391
+ "message": "<div onClick> でクリック処理禁止",
392
+ "fix": "<button> か <a> を使う"
393
+ },
394
+ {
395
+ "id": "AI1",
396
+ "severity": "warning",
397
+ "category": "ai-pattern",
398
+ "pattern": "border-t-4 border-.*-[0-9]+",
399
+ "message": "AI生成パターン: カード上部カラーバー禁止",
400
+ "fix": "border border-[var(--Border-Low-Emphasis)] で全周ボーダー"
401
+ },
402
+ {
403
+ "id": "AI2",
404
+ "severity": "warning",
405
+ "category": "ai-pattern",
406
+ "pattern": "border-l-4 border-.*-[0-9]+",
407
+ "message": "AI生成パターン: 左端カラーストライプ禁止(Alert含む)",
408
+ "fix": "border rounded-lg で全周ボーダー"
409
+ },
410
+ {
411
+ "id": "AI3",
412
+ "severity": "warning",
413
+ "category": "ai-pattern",
414
+ "pattern": "bg-gradient-to-",
415
+ "excludes": [".stories.", "components/foundations/", "components/primitives/", "components/ec/"],
416
+ "message": "AI生成パターン: グラデーション背景禁止",
417
+ "fix": "セマンティックトークンの単色背景"
418
+ },
419
+ {
420
+ "id": "AI4",
421
+ "severity": "warning",
422
+ "category": "ai-pattern",
423
+ "pattern": "tracking-tight",
424
+ "message": "AI生成パターン: tracking-tight禁止(日本語の可読性が著しく低下)",
425
+ "fix": "typo-* クラスに含まれる値を使う"
426
+ },
427
+ {
428
+ "id": "AI6",
429
+ "severity": "warning",
430
+ "category": "ai-pattern",
431
+ "pattern": "animate-spin|animate-bounce|animate-ping",
432
+ "excludes": [".stories.", "components/foundations/"],
433
+ "message": "AI生成パターン: 常時ループアニメーション禁止",
434
+ "fix": "スケルトンのpulseのみ許可"
435
+ },
436
+ {
437
+ "id": "AI7",
438
+ "severity": "warning",
439
+ "category": "ai-pattern",
440
+ "pattern": "rounded-md\\b|rounded-xl\\b|rounded-3xl\\b",
441
+ "excludes": [".stories.", "components/foundations/", "components/primitives/", "components/ec/"],
442
+ "message": "AI生成パターン: DS定義外の角丸禁止(rounded-md/xl/3xl)",
443
+ "fix": "DS定義の角丸のみ使用する"
444
+ },
445
+ {
446
+ "id": "R44",
447
+ "severity": "warning",
448
+ "category": "storybook",
449
+ "pattern": "title:.*[ぁ-んァ-ン一-龥]",
450
+ "message": "Storybookタイトルを日本語にしない",
451
+ "fix": "\"UI/Button\" 形式(英語)で統一"
452
+ },
453
+ {
454
+ "id": "R46",
455
+ "severity": "warning",
456
+ "category": "storybook",
457
+ "pattern": "max-w-\\[.*\\]|style=\\{\\{.*maxWidth",
458
+ "message": "Storybookラッパーに固定幅を入れない",
459
+ "fix": "幅はStorybookのビューポート切替に委ねる"
460
+ },
461
+ {
462
+ "id": "R48",
463
+ "severity": "warning",
464
+ "category": "component",
465
+ "message": "SectionHeaderをCardTitle+Buttonで手書きしない",
466
+ "fix": "<SectionHeader title='お知らせ' moreHref='#' moreLabel='すべて見る' />"
467
+ },
468
+ {
469
+ "id": "R49",
470
+ "severity": "error",
471
+ "category": "component",
472
+ "pattern": "<input type=\"date\"|<input type='date'",
473
+ "message": "input type='date' のネイティブ日付ピッカー禁止",
474
+ "fix": "<Popover> + <Calendar> でDS準拠の日付ピッカーを組む"
475
+ },
476
+ {
477
+ "id": "R51",
478
+ "severity": "warning",
479
+ "category": "component",
480
+ "message": "テーブル選択時の一括操作バーをdivで手書きしない",
481
+ "fix": "<BulkActionBar selectedCount={selected.size}> を使う"
482
+ },
483
+ {
484
+ "id": "R52",
485
+ "severity": "warning",
486
+ "category": "component",
487
+ "message": "管理画面のテーブルをui/tableで組まない",
488
+ "fix": "<DataTable> を使う(ソート・選択行・アクションメニュー対応)"
489
+ }
490
+ ],
491
+ "accessibility": {
492
+ "wcag": "2.1 AA",
493
+ "requirements": [
494
+ { "id": "A001", "rule": "通常テキスト(18px未満)のコントラスト比 4.5:1 以上" },
495
+ { "id": "A002", "rule": "大テキスト(18px以上bold/24px以上normal)のコントラスト比 3:1 以上" },
496
+ { "id": "A003", "rule": "UIコンポーネント境界・アイコンのコントラスト比 3:1 以上" },
497
+ { "id": "A004", "rule": "フォーカスインジケーターのコントラスト比 3:1(隣接色との差)" },
498
+ { "id": "A005", "rule": "フォーカスリング必須: focus-visible:ring-[3px] focus-visible:ring-[var(--Focus-High-Emphasis)]/50" },
499
+ { "id": "A006", "rule": "アイコンのみボタンに日本語のaria-label必須" },
500
+ { "id": "A007", "rule": "全フォーム入力に <Label> または aria-label を紐付ける" },
501
+ { "id": "A008", "rule": "フォームエラーは aria-describedby でエラーメッセージを紐付ける" },
502
+ { "id": "A009", "rule": "動的に変化する情報は aria-live='polite' で通知する" },
503
+ { "id": "A010", "rule": "セマンティックHTML: nav/main/section/header/footer を適切に使用する" }
504
+ ]
505
+ },
506
+ "darkMode": {
507
+ "rule": "全コンポーネント・ストーリーはライトモード・ダークモード両方で確認必須",
508
+ "commonMistakes": [
509
+ "bg-[var(--Text-High-Emphasis)] をダーク固定背景として使う → ダークモードで白背景になる。bg-[var(--Primitive-Gray-900)] を使うこと",
510
+ "text-white をダーク固定背景上で使う → text-[var(--Primitive-White-alpha-1000)] を使うこと"
511
+ ]
512
+ },
513
+ "typography": {
514
+ "rule": "必ず typo-* クラスを使用。text-sm font-bold 等の個別指定禁止。",
515
+ "classes": [
516
+ { "class": "typo-heading-3xl", "size": "28px", "weight": "bold" },
517
+ { "class": "typo-heading-2xl", "size": "24px", "weight": "bold" },
518
+ { "class": "typo-heading-xl", "size": "21px", "weight": "bold" },
519
+ { "class": "typo-heading-lg", "size": "18px", "weight": "bold" },
520
+ { "class": "typo-heading-md", "size": "16px", "weight": "bold" },
521
+ { "class": "typo-heading-sm", "size": "14px", "weight": "bold" },
522
+ { "class": "typo-body-lg", "size": "16px", "weight": "normal" },
523
+ { "class": "typo-body-md", "size": "14px", "weight": "normal" },
524
+ { "class": "typo-body-sm", "size": "12px", "weight": "normal" },
525
+ { "class": "typo-body-xs", "size": "10px", "weight": "normal" },
526
+ { "class": "typo-label-lg", "size": "16px", "weight": "bold" },
527
+ { "class": "typo-label-md", "size": "14px", "weight": "bold" },
528
+ { "class": "typo-label-sm", "size": "12px", "weight": "semibold" },
529
+ { "class": "typo-label-xs", "size": "10px", "weight": "semibold" }
530
+ ]
531
+ },
532
+ "tokens": {
533
+ "spacing": {
534
+ "rule": "4pxグリッド。gap-1〜gap-6 / p-1〜p-6 のみ使用。",
535
+ "base": "4px",
536
+ "grid": "8px"
537
+ },
538
+ "touchTarget": {
539
+ "rule": "タッチターゲット最小サイズを守ること",
540
+ "values": [
541
+ { "element": "Button(CTA)", "min": "40px", "recommended": "48px" },
542
+ { "element": "Icon button", "min": "40px", "recommended": "44px" },
543
+ { "element": "Text input", "min": "44px", "recommended": "48px" },
544
+ { "element": "Chip/Filter", "min": "32px", "recommended": "36px" },
545
+ { "element": "Navigation item", "min": "44px", "recommended": "48px" }
546
+ ]
547
+ }
548
+ },
549
+ "writing": {
550
+ "rules": [
551
+ "和文は全角、欧文・算用数字は半角",
552
+ "見出し文末に「。」をつけない",
553
+ "バリデーションエラー文末に句読点をつけない",
554
+ "日付: YYYY/MM/DD(0なし: 2024/8/1)",
555
+ "お届け日: M月D日(曜日)(例: 8月1日(木))",
556
+ "価格: ¥{数字,区切り}(税込)(例: ¥3,980(税込))"
557
+ ]
558
+ }
559
+ }