ksk-design-system 1.35.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 (261) hide show
  1. package/AGENTS.md +190 -0
  2. package/CLAUDE.md +189 -0
  3. package/DESIGN.md +190 -0
  4. package/LICENSE +21 -0
  5. package/MIGRATION.md +107 -0
  6. package/PUBLISHING.md +160 -0
  7. package/README.md +59 -0
  8. package/RELEASE.md +82 -0
  9. package/bin/init.js +112 -0
  10. package/contracts/components.json +1443 -0
  11. package/contracts/rules.json +447 -0
  12. package/dist/class-names.js +4 -0
  13. package/dist/index.js +13157 -0
  14. package/dist/native/ui.js +4928 -0
  15. package/dist/native.js +1559 -0
  16. package/dist/server-variants-Dr_V3bDI.js +55 -0
  17. package/dist/types/class-names.d.ts +27 -0
  18. package/dist/types/components/patterns/admin/bulk-actions.d.ts +17 -0
  19. package/dist/types/components/patterns/admin/chart-controls.d.ts +16 -0
  20. package/dist/types/components/patterns/admin/data-table.d.ts +165 -0
  21. package/dist/types/components/patterns/admin/image-uploader.d.ts +14 -0
  22. package/dist/types/components/patterns/admin/kebab-menu.d.ts +17 -0
  23. package/dist/types/components/patterns/admin/notification-list.d.ts +16 -0
  24. package/dist/types/components/patterns/admin/search-panel.d.ts +9 -0
  25. package/dist/types/components/patterns/admin/status-tabs.d.ts +13 -0
  26. package/dist/types/components/patterns/app-header.d.ts +76 -0
  27. package/dist/types/components/patterns/banner-carousel.d.ts +25 -0
  28. package/dist/types/components/patterns/banner.d.ts +13 -0
  29. package/dist/types/components/patterns/bottom-sheet-form.d.ts +17 -0
  30. package/dist/types/components/patterns/category-nav.d.ts +43 -0
  31. package/dist/types/components/patterns/category-scroll.d.ts +53 -0
  32. package/dist/types/components/patterns/chip-selector.d.ts +20 -0
  33. package/dist/types/components/patterns/chip.d.ts +42 -0
  34. package/dist/types/components/patterns/coach-mark-overlay.d.ts +66 -0
  35. package/dist/types/components/patterns/commerce/bottom-tab-bar.d.ts +27 -0
  36. package/dist/types/components/patterns/commerce/filter-bar.d.ts +39 -0
  37. package/dist/types/components/patterns/commerce/image-carousel.d.ts +14 -0
  38. package/dist/types/components/patterns/commerce/order-summary.d.ts +26 -0
  39. package/dist/types/components/patterns/commerce/price-display.d.ts +20 -0
  40. package/dist/types/components/patterns/commerce/product-card.d.ts +50 -0
  41. package/dist/types/components/patterns/commerce/product-carousel.d.ts +15 -0
  42. package/dist/types/components/patterns/commerce/quantity-selector.d.ts +21 -0
  43. package/dist/types/components/patterns/commerce/rating-display.d.ts +15 -0
  44. package/dist/types/components/patterns/commerce/review-card.d.ts +22 -0
  45. package/dist/types/components/patterns/commerce/review-summary.d.ts +12 -0
  46. package/dist/types/components/patterns/confirm-dialog.d.ts +32 -0
  47. package/dist/types/components/patterns/cookie-consent.d.ts +62 -0
  48. package/dist/types/components/patterns/empty-state.d.ts +15 -0
  49. package/dist/types/components/patterns/error-state.d.ts +10 -0
  50. package/dist/types/components/patterns/file-upload.d.ts +31 -0
  51. package/dist/types/components/patterns/filter-chip.d.ts +26 -0
  52. package/dist/types/components/patterns/footer.d.ts +24 -0
  53. package/dist/types/components/patterns/form-field.d.ts +30 -0
  54. package/dist/types/components/patterns/form.d.ts +13 -0
  55. package/dist/types/components/patterns/list-item.d.ts +23 -0
  56. package/dist/types/components/patterns/list-skeletons.d.ts +43 -0
  57. package/dist/types/components/patterns/menu-drawer.d.ts +27 -0
  58. package/dist/types/components/patterns/notification-badge.d.ts +15 -0
  59. package/dist/types/components/patterns/progress-steps.d.ts +7 -0
  60. package/dist/types/components/patterns/review-overlay.d.ts +25 -0
  61. package/dist/types/components/patterns/search-bar.d.ts +6 -0
  62. package/dist/types/components/patterns/section-header.d.ts +8 -0
  63. package/dist/types/components/patterns/share-buttons.d.ts +13 -0
  64. package/dist/types/components/patterns/shells/admin-shell.d.ts +8 -0
  65. package/dist/types/components/patterns/shells/app-shell.d.ts +7 -0
  66. package/dist/types/components/patterns/shells/marketing-shell.d.ts +7 -0
  67. package/dist/types/components/patterns/simple-pagination.d.ts +69 -0
  68. package/dist/types/components/patterns/stat-card.d.ts +43 -0
  69. package/dist/types/components/patterns/sticky-action-bar.d.ts +27 -0
  70. package/dist/types/components/patterns/swipe-row.d.ts +17 -0
  71. package/dist/types/components/patterns/tag-input.d.ts +20 -0
  72. package/dist/types/components/patterns/tag.d.ts +7 -0
  73. package/dist/types/components/ui/accordion.d.ts +7 -0
  74. package/dist/types/components/ui/alert-dialog.d.ts +47 -0
  75. package/dist/types/components/ui/alert.d.ts +45 -0
  76. package/dist/types/components/ui/auto-grow-textarea.d.ts +40 -0
  77. package/dist/types/components/ui/avatar.d.ts +6 -0
  78. package/dist/types/components/ui/badge.d.ts +18 -0
  79. package/dist/types/components/ui/breadcrumb.d.ts +16 -0
  80. package/dist/types/components/ui/button.d.ts +29 -0
  81. package/dist/types/components/ui/calendar.d.ts +5 -0
  82. package/dist/types/components/ui/card.d.ts +28 -0
  83. package/dist/types/components/ui/checkbox-card.d.ts +29 -0
  84. package/dist/types/components/ui/checkbox-field.d.ts +24 -0
  85. package/dist/types/components/ui/checkbox-group.d.ts +33 -0
  86. package/dist/types/components/ui/checkbox.d.ts +44 -0
  87. package/dist/types/components/ui/coach-mark.d.ts +27 -0
  88. package/dist/types/components/ui/collapsible.d.ts +24 -0
  89. package/dist/types/components/ui/combobox.d.ts +19 -0
  90. package/dist/types/components/ui/countdown-timer.d.ts +39 -0
  91. package/dist/types/components/ui/date-picker.d.ts +53 -0
  92. package/dist/types/components/ui/dialog.d.ts +54 -0
  93. package/dist/types/components/ui/dropdown-filter.d.ts +35 -0
  94. package/dist/types/components/ui/dropdown-menu.d.ts +42 -0
  95. package/dist/types/components/ui/error-boundary.d.ts +66 -0
  96. package/dist/types/components/ui/form.d.ts +61 -0
  97. package/dist/types/components/ui/hover-card.d.ts +24 -0
  98. package/dist/types/components/ui/image-gallery.d.ts +28 -0
  99. package/dist/types/components/ui/input.d.ts +17 -0
  100. package/dist/types/components/ui/label.d.ts +4 -0
  101. package/dist/types/components/ui/multi-select.d.ts +21 -0
  102. package/dist/types/components/ui/navigation-bar.d.ts +58 -0
  103. package/dist/types/components/ui/number-input.d.ts +20 -0
  104. package/dist/types/components/ui/pagination.d.ts +26 -0
  105. package/dist/types/components/ui/pill-toggle.d.ts +16 -0
  106. package/dist/types/components/ui/popover.d.ts +7 -0
  107. package/dist/types/components/ui/progress-ring.d.ts +31 -0
  108. package/dist/types/components/ui/progress.d.ts +34 -0
  109. package/dist/types/components/ui/radio-group.d.ts +22 -0
  110. package/dist/types/components/ui/responsive-dialog.d.ts +31 -0
  111. package/dist/types/components/ui/scroll-area.d.ts +5 -0
  112. package/dist/types/components/ui/select.d.ts +22 -0
  113. package/dist/types/components/ui/separator.d.ts +4 -0
  114. package/dist/types/components/ui/sheet.d.ts +139 -0
  115. package/dist/types/components/ui/skeleton.d.ts +31 -0
  116. package/dist/types/components/ui/slider.d.ts +14 -0
  117. package/dist/types/components/ui/social-icon-data.d.ts +10 -0
  118. package/dist/types/components/ui/social-icon.d.ts +38 -0
  119. package/dist/types/components/ui/social-login-button.d.ts +10 -0
  120. package/dist/types/components/ui/spinner.d.ts +22 -0
  121. package/dist/types/components/ui/star-rating.d.ts +12 -0
  122. package/dist/types/components/ui/sub-nav.d.ts +17 -0
  123. package/dist/types/components/ui/switch.d.ts +4 -0
  124. package/dist/types/components/ui/sync-status-badge.d.ts +17 -0
  125. package/dist/types/components/ui/tabs.d.ts +15 -0
  126. package/dist/types/components/ui/textarea.d.ts +8 -0
  127. package/dist/types/components/ui/time-picker.d.ts +14 -0
  128. package/dist/types/components/ui/toast.d.ts +49 -0
  129. package/dist/types/components/ui/tooltip.d.ts +7 -0
  130. package/dist/types/index.d.ts +174 -0
  131. package/dist/types/lib/server-variants/button-variants.d.ts +20 -0
  132. package/dist/types/lib/utils.d.ts +2 -0
  133. package/dist/types/native/components/Accordion.d.ts +12 -0
  134. package/dist/types/native/components/Alert.d.ts +9 -0
  135. package/dist/types/native/components/AlertDialog.d.ts +11 -0
  136. package/dist/types/native/components/AppHeader.d.ts +10 -0
  137. package/dist/types/native/components/AppShell.d.ts +13 -0
  138. package/dist/types/native/components/AutoGrowTextarea.d.ts +8 -0
  139. package/dist/types/native/components/Avatar.d.ts +8 -0
  140. package/dist/types/native/components/Badge.d.ts +8 -0
  141. package/dist/types/native/components/Banner.d.ts +10 -0
  142. package/dist/types/native/components/BannerCarousel.d.ts +8 -0
  143. package/dist/types/native/components/BottomSheetForm.d.ts +10 -0
  144. package/dist/types/native/components/BottomTabBar.d.ts +8 -0
  145. package/dist/types/native/components/Breadcrumb.d.ts +12 -0
  146. package/dist/types/native/components/Button.d.ts +9 -0
  147. package/dist/types/native/components/Calendar.d.ts +8 -0
  148. package/dist/types/native/components/Card.d.ts +11 -0
  149. package/dist/types/native/components/CategoryNav.d.ts +13 -0
  150. package/dist/types/native/components/CategoryScroll.d.ts +12 -0
  151. package/dist/types/native/components/Checkbox.d.ts +7 -0
  152. package/dist/types/native/components/CheckboxCard.d.ts +8 -0
  153. package/dist/types/native/components/CheckboxField.d.ts +8 -0
  154. package/dist/types/native/components/CheckboxGroup.d.ts +12 -0
  155. package/dist/types/native/components/Chip.d.ts +17 -0
  156. package/dist/types/native/components/ChipSelector.d.ts +13 -0
  157. package/dist/types/native/components/CoachMark.d.ts +12 -0
  158. package/dist/types/native/components/CoachMarkOverlay.d.ts +19 -0
  159. package/dist/types/native/components/Collapsible.d.ts +7 -0
  160. package/dist/types/native/components/Combobox.d.ts +14 -0
  161. package/dist/types/native/components/ConfirmDialog.d.ts +7 -0
  162. package/dist/types/native/components/CountdownTimer.d.ts +7 -0
  163. package/dist/types/native/components/DatePicker.d.ts +10 -0
  164. package/dist/types/native/components/Dialog.d.ts +12 -0
  165. package/dist/types/native/components/DropdownFilter.d.ts +12 -0
  166. package/dist/types/native/components/DropdownMenu.d.ts +19 -0
  167. package/dist/types/native/components/EmptyState.d.ts +8 -0
  168. package/dist/types/native/components/ErrorState.d.ts +8 -0
  169. package/dist/types/native/components/FileUpload.d.ts +12 -0
  170. package/dist/types/native/components/FilterBar.d.ts +13 -0
  171. package/dist/types/native/components/FilterChip.d.ts +7 -0
  172. package/dist/types/native/components/Footer.d.ts +9 -0
  173. package/dist/types/native/components/FormField.d.ts +9 -0
  174. package/dist/types/native/components/GlassView.d.ts +25 -0
  175. package/dist/types/native/components/ImageCarousel.d.ts +8 -0
  176. package/dist/types/native/components/ImageGallery.d.ts +7 -0
  177. package/dist/types/native/components/Input.d.ts +9 -0
  178. package/dist/types/native/components/Label.d.ts +7 -0
  179. package/dist/types/native/components/ListItem.d.ts +11 -0
  180. package/dist/types/native/components/ListSkeletons.d.ts +6 -0
  181. package/dist/types/native/components/MarketingShell.d.ts +9 -0
  182. package/dist/types/native/components/MenuDrawer.d.ts +21 -0
  183. package/dist/types/native/components/MultiSelect.d.ts +13 -0
  184. package/dist/types/native/components/NavigationBar.d.ts +18 -0
  185. package/dist/types/native/components/NotificationBadge.d.ts +9 -0
  186. package/dist/types/native/components/NumberInput.d.ts +9 -0
  187. package/dist/types/native/components/OrderSummary.d.ts +10 -0
  188. package/dist/types/native/components/Pagination.d.ts +7 -0
  189. package/dist/types/native/components/PillToggle.d.ts +12 -0
  190. package/dist/types/native/components/Popover.d.ts +14 -0
  191. package/dist/types/native/components/PriceDisplay.d.ts +8 -0
  192. package/dist/types/native/components/ProductCard.d.ts +14 -0
  193. package/dist/types/native/components/ProductCarousel.d.ts +11 -0
  194. package/dist/types/native/components/Progress.d.ts +7 -0
  195. package/dist/types/native/components/ProgressRing.d.ts +12 -0
  196. package/dist/types/native/components/ProgressSteps.d.ts +9 -0
  197. package/dist/types/native/components/QuantitySelector.d.ts +6 -0
  198. package/dist/types/native/components/RadioGroup.d.ts +13 -0
  199. package/dist/types/native/components/RatingDisplay.d.ts +7 -0
  200. package/dist/types/native/components/ResponsiveDialog.d.ts +7 -0
  201. package/dist/types/native/components/ReviewCard.d.ts +11 -0
  202. package/dist/types/native/components/ReviewOverlay.d.ts +7 -0
  203. package/dist/types/native/components/ReviewSummary.d.ts +7 -0
  204. package/dist/types/native/components/ScrollArea.d.ts +9 -0
  205. package/dist/types/native/components/SearchBar.d.ts +9 -0
  206. package/dist/types/native/components/SectionHeader.d.ts +10 -0
  207. package/dist/types/native/components/Select.d.ts +14 -0
  208. package/dist/types/native/components/Separator.d.ts +5 -0
  209. package/dist/types/native/components/ShareButtons.d.ts +11 -0
  210. package/dist/types/native/components/Sheet.d.ts +20 -0
  211. package/dist/types/native/components/SimplePagination.d.ts +7 -0
  212. package/dist/types/native/components/Skeleton.d.ts +11 -0
  213. package/dist/types/native/components/Slider.d.ts +9 -0
  214. package/dist/types/native/components/SocialIcon.d.ts +12 -0
  215. package/dist/types/native/components/SocialLoginButton.d.ts +8 -0
  216. package/dist/types/native/components/Spinner.d.ts +6 -0
  217. package/dist/types/native/components/Stack.d.ts +13 -0
  218. package/dist/types/native/components/StarRating.d.ts +9 -0
  219. package/dist/types/native/components/StatCard.d.ts +7 -0
  220. package/dist/types/native/components/StickyActionBar.d.ts +6 -0
  221. package/dist/types/native/components/SubNav.d.ts +12 -0
  222. package/dist/types/native/components/SwipeRow.d.ts +14 -0
  223. package/dist/types/native/components/Switch.d.ts +4 -0
  224. package/dist/types/native/components/SyncStatusBadge.d.ts +6 -0
  225. package/dist/types/native/components/Tabs.d.ts +23 -0
  226. package/dist/types/native/components/Tag.d.ts +10 -0
  227. package/dist/types/native/components/TagInput.d.ts +7 -0
  228. package/dist/types/native/components/Text.d.ts +10 -0
  229. package/dist/types/native/components/Textarea.d.ts +7 -0
  230. package/dist/types/native/components/TimePicker.d.ts +12 -0
  231. package/dist/types/native/components/Toast.d.ts +18 -0
  232. package/dist/types/native/components/index.d.ts +99 -0
  233. package/dist/types/native/components/social-icon-data.d.ts +5 -0
  234. package/dist/types/native/index.d.ts +4 -0
  235. package/dist/types/native/theme/ThemeProvider.d.ts +21 -0
  236. package/dist/types/native/typography.d.ts +8 -0
  237. package/dist/types/tokens/native/index.d.ts +13 -0
  238. package/dist/types/tokens/native/primitives.d.ts +116 -0
  239. package/dist/types/tokens/native/scales.d.ts +270 -0
  240. package/dist/types/tokens/native/themes.d.ts +1147 -0
  241. package/eslint/deprecated.js +104 -0
  242. package/eslint/no-colorless-border.js +217 -0
  243. package/package.json +215 -0
  244. package/scripts/codemod/README.md +51 -0
  245. package/scripts/codemod/template.mjs +164 -0
  246. package/src/components/COMPONENT_LOOKUP.md +190 -0
  247. package/src/preset.css +168 -0
  248. package/src/styles/categorical.css +161 -0
  249. package/src/styles/glass.css +365 -0
  250. package/src/styles/primitive.css +161 -0
  251. package/src/styles/semantic.css +247 -0
  252. package/src/styles/typography.css +140 -0
  253. package/src/themes/README.md +44 -0
  254. package/src/themes/blue.css +21 -0
  255. package/src/themes/default.css +12 -0
  256. package/src/themes/green.css +22 -0
  257. package/src/themes/orange.css +21 -0
  258. package/src/themes/violet.css +22 -0
  259. package/templates/AGENTS.md +77 -0
  260. package/templates/CLAUDE.md +77 -0
  261. package/tokens.json +607 -0
@@ -0,0 +1,447 @@
1
+ {
2
+ "meta": {
3
+ "name": "KSK Design System — Rules Contracts",
4
+ "version": "1.1.0",
5
+ "description": "禁止パターン・アクセシビリティ要件・ライティングルールの構造化定義。lint-scratch.sh と check-drift.sh で自動検証。"
6
+ },
7
+ "prohibited": [
8
+ {
9
+ "id": "P001",
10
+ "severity": "error",
11
+ "category": "component",
12
+ "pattern": "<button\\b",
13
+ "excludes": ["data-slot", ".stories.", "components/ui/", "components/patterns/"],
14
+ "message": "生の <button> 禁止",
15
+ "fix": "<Button variant=\"...\" size=\"...\"> を使用"
16
+ },
17
+ {
18
+ "id": "P002",
19
+ "severity": "error",
20
+ "category": "component",
21
+ "pattern": "<input\\b",
22
+ "excludes": ["data-slot", ".stories.", "type=\"search\"", "type=\"file\"", "components/ui/", "components/patterns/"],
23
+ "message": "生の <input> 禁止",
24
+ "fix": "<Input> コンポーネントを使用"
25
+ },
26
+ {
27
+ "id": "P003",
28
+ "severity": "error",
29
+ "category": "component",
30
+ "pattern": "<textarea\\b",
31
+ "excludes": ["data-slot", ".stories.", "components/ui/", "components/patterns/"],
32
+ "message": "生の <textarea> 禁止",
33
+ "fix": "<Textarea> コンポーネントを使用"
34
+ },
35
+ {
36
+ "id": "P004",
37
+ "severity": "error",
38
+ "category": "component",
39
+ "pattern": "<select\\b",
40
+ "excludes": ["data-slot", ".stories.", "components/ui/", "components/patterns/"],
41
+ "message": "生の <select> 禁止",
42
+ "fix": "<Select><SelectItem> コンポーネントを使用"
43
+ },
44
+ {
45
+ "id": "P005",
46
+ "severity": "error",
47
+ "category": "component",
48
+ "pattern": "<table\\b",
49
+ "excludes": ["data-slot", ".stories.", "components/ui/", "components/patterns/"],
50
+ "message": "生の <table> 禁止(CLS・スタイル崩れの原因)",
51
+ "fix": "DataTable 等 DS のテーブルコンポーネントを使用"
52
+ },
53
+ {
54
+ "id": "P006",
55
+ "severity": "error",
56
+ "category": "component",
57
+ "pattern": "<a href",
58
+ "excludes": [".stories.", "data-slot", "asChild", "components/ui/", "components/patterns/"],
59
+ "message": "生の <a href> 禁止",
60
+ "fix": "<Button variant=\"link\"> を使用(<Button asChild><a href> も可)"
61
+ },
62
+ {
63
+ "id": "P007",
64
+ "severity": "error",
65
+ "category": "modal",
66
+ "pattern": "div.*fixed.*inset-0|fixed.*inset-0.*div",
67
+ "excludes": [".stories.", "components/ui/", "components/patterns/"],
68
+ "message": "div.fixed.inset-0 による自作モーダル禁止",
69
+ "fix": "<Dialog> または <Sheet> を使用"
70
+ },
71
+ {
72
+ "id": "P008",
73
+ "severity": "error",
74
+ "category": "color",
75
+ "pattern": "#[0-9A-Fa-f]{6}",
76
+ "excludes": [".stories.", ".css", "shadow", "fill=", "stroke="],
77
+ "message": "HEX ハードコード禁止",
78
+ "fix": "セマンティックトークン var(--...) を使用"
79
+ },
80
+ {
81
+ "id": "P009",
82
+ "severity": "error",
83
+ "category": "color",
84
+ "pattern": "(text|bg|border)-(gray|slate|zinc|neutral|stone|red|orange|amber|yellow|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-[0-9]+",
85
+ "excludes": [".stories."],
86
+ "message": "Tailwind 標準色クラス禁止",
87
+ "fix": "セマンティックトークン var(--...) を使用"
88
+ },
89
+ {
90
+ "id": "P010",
91
+ "severity": "error",
92
+ "category": "color",
93
+ "pattern": "text-white\\b|bg-white\\b",
94
+ "excludes": [".stories."],
95
+ "message": "text-white / bg-white 禁止(テーマ切替で追従できない)",
96
+ "fix": "text-[var(--Text-on-Inverse)] / bg-[var(--Surface-Primary)]"
97
+ },
98
+ {
99
+ "id": "P011",
100
+ "severity": "error",
101
+ "category": "typography",
102
+ "pattern": "text-\\[[0-9]+px\\]",
103
+ "excludes": [".stories."],
104
+ "message": "フォントサイズ直書き禁止",
105
+ "fix": "typo-* クラスを使用"
106
+ },
107
+ {
108
+ "id": "P012",
109
+ "severity": "error",
110
+ "category": "spacing",
111
+ "pattern": "(p|px|py|pt|pb|pl|pr|m|mx|my|mt|mb|ml|mr|gap|space-x|space-y)-\\[[0-9]+px\\]",
112
+ "excludes": [".stories."],
113
+ "message": "任意値スペーシング禁止(4px グリッド外)",
114
+ "fix": "gap-1〜gap-6 / p-1〜p-6 の Tailwind 標準クラスを使用"
115
+ },
116
+ {
117
+ "id": "P013",
118
+ "severity": "error",
119
+ "category": "ai-pattern",
120
+ "pattern": "border-l-4|border-t-4|border-r-4|border-b-4",
121
+ "excludes": [".stories."],
122
+ "message": "カラーバー(片側ボーダー太め)禁止(AI 生成パターン)",
123
+ "fix": "全周ボーダーを使用"
124
+ },
125
+ {
126
+ "id": "P014",
127
+ "severity": "error",
128
+ "category": "asset",
129
+ "pattern": "pravatar\\.cc",
130
+ "message": "pravatar.cc 禁止",
131
+ "fix": "DiceBear shapes を使用 (https://api.dicebear.com/9.x/shapes/svg?seed=...)"
132
+ },
133
+ {
134
+ "id": "P015",
135
+ "severity": "error",
136
+ "category": "theme",
137
+ "pattern": "--Primitive-Brand",
138
+ "excludes": ["src/styles/", "src/themes/", ".css"],
139
+ "message": "Primitive Brand トークン直接使用禁止(テーマ切替が機能しなくなる)",
140
+ "fix": "var(--Brand-Primary) 等セマンティックトークンを使用"
141
+ },
142
+ {
143
+ "id": "P016",
144
+ "severity": "warning",
145
+ "category": "typography",
146
+ "pattern": "\"font-bold|'font-bold| font-bold|\"font-semibold|'font-semibold| font-semibold|\"font-medium|'font-medium| font-medium",
147
+ "excludes": [".stories.", "cva(", "variants"],
148
+ "message": "font-bold / font-semibold / font-medium 直書き禁止",
149
+ "fix": "typo-* クラスを使用(例: typo-label-md)"
150
+ },
151
+ {
152
+ "id": "P017",
153
+ "severity": "warning",
154
+ "category": "typography",
155
+ "pattern": "tracking-tight|tracking-tighter",
156
+ "excludes": [".stories."],
157
+ "message": "tracking-tight 禁止(日本語の可読性が著しく低下)",
158
+ "fix": "letter-spacing は typo-* クラスに内包されている"
159
+ },
160
+ {
161
+ "id": "P018",
162
+ "severity": "warning",
163
+ "category": "color",
164
+ "pattern": "text-black\\b",
165
+ "excludes": [".stories."],
166
+ "message": "text-black 禁止",
167
+ "fix": "text-[var(--Text-High-Emphasis)]"
168
+ },
169
+ {
170
+ "id": "P019",
171
+ "severity": "warning",
172
+ "category": "layout",
173
+ "pattern": "rounded-3xl\\b",
174
+ "excludes": [".stories."],
175
+ "message": "DS 定義外の角丸禁止",
176
+ "fix": "rounded-none / rounded-sm / rounded-md / rounded-lg / rounded-xl / rounded-2xl / rounded-full のみ使用"
177
+ },
178
+ {
179
+ "id": "P020",
180
+ "severity": "warning",
181
+ "category": "layout",
182
+ "pattern": "shadow-md\\b|shadow-lg\\b|shadow-xl\\b|shadow-2xl\\b",
183
+ "excludes": [".stories.", "shadow-\\[", "components/ui/", "components/patterns/"],
184
+ "message": "DS 定義外のシャドウ禁止",
185
+ "fix": "shadow-[var(--shadow-sm/md/lg/dialog/tooltip)]"
186
+ },
187
+ {
188
+ "id": "P021",
189
+ "severity": "warning",
190
+ "category": "layout",
191
+ "pattern": "bg-gradient-to-",
192
+ "excludes": [".stories."],
193
+ "message": "グラデーション背景禁止(AI 生成パターン)",
194
+ "fix": "単色背景を使用(DS にグラデーション定義なし)"
195
+ },
196
+ {
197
+ "id": "P022",
198
+ "severity": "warning",
199
+ "category": "layout",
200
+ "pattern": "z-\\[9999\\]|z-\\[999\\]",
201
+ "message": "過剰な z-index 禁止",
202
+ "fix": "z-50 を使用"
203
+ },
204
+ {
205
+ "id": "P023",
206
+ "severity": "warning",
207
+ "category": "accessibility",
208
+ "pattern": "outline-none\\b",
209
+ "excludes": [".stories.", "focus-visible", "components/ui/", "components/patterns/"],
210
+ "message": "outline-none 禁止(フォーカスリング削除はアクセシビリティ違反)",
211
+ "fix": "focus-visible:ring-[3px] focus-visible:ring-[var(--Focus-High-Emphasis)]/50"
212
+ },
213
+ {
214
+ "id": "P024",
215
+ "severity": "warning",
216
+ "category": "accessibility",
217
+ "pattern": "<div.*onClick|<span.*onClick",
218
+ "excludes": [".stories."],
219
+ "message": "<div onClick> 禁止(キーボード操作・スクリーンリーダー不可)",
220
+ "fix": "<button> / <Button> を使用"
221
+ },
222
+ {
223
+ "id": "P025",
224
+ "severity": "warning",
225
+ "category": "accessibility",
226
+ "pattern": "<img(?![^>]*alt=)",
227
+ "excludes": [".stories.", "components/ui/", "components/patterns/"],
228
+ "message": "<img> に alt 属性なし禁止",
229
+ "fix": "alt=\"説明テキスト\" を必ず付ける(装飾画像は alt=\"\")"
230
+ },
231
+ {
232
+ "id": "P026",
233
+ "severity": "warning",
234
+ "category": "form",
235
+ "pattern": "placeholder=.*(?!.*<Label|.*<label)",
236
+ "excludes": [".stories.", "components/ui/", "components/patterns/"],
237
+ "message": "placeholder のみでラベルを省略しない",
238
+ "fix": "<Label> を必ず付ける(スクリーンリーダーはplaceholderを読まない)"
239
+ },
240
+ {
241
+ "id": "P027",
242
+ "severity": "warning",
243
+ "category": "form",
244
+ "pattern": "type=['\"]text['\"].*email|email.*type=['\"]text['\"]",
245
+ "excludes": [".stories."],
246
+ "message": "メールアドレス欄に type='text' 禁止",
247
+ "fix": "type=\"email\" を使用"
248
+ },
249
+ {
250
+ "id": "P028",
251
+ "severity": "warning",
252
+ "category": "layout",
253
+ "pattern": "style=.*margin|style=.*padding",
254
+ "excludes": [".stories."],
255
+ "message": "インラインスタイルで余白指定禁止",
256
+ "fix": "Tailwind スペーシングクラス(p-* / m-* / gap-*)を使用"
257
+ },
258
+ {
259
+ "id": "P029",
260
+ "severity": "warning",
261
+ "category": "component",
262
+ "pattern": "className=.*\\$\\{",
263
+ "excludes": [".stories.", "components/ui/", "components/patterns/", "cn("],
264
+ "message": "テンプレートリテラルで className を組み立てない",
265
+ "fix": "cn() / clsx() / CVA を使用"
266
+ },
267
+ {
268
+ "id": "P030",
269
+ "severity": "warning",
270
+ "category": "animation",
271
+ "pattern": "duration-[3-9][0-9]{2}|duration-[0-9]{4}",
272
+ "excludes": [".stories.", "components/ui/"],
273
+ "message": "300ms 以上の遅いアニメーション禁止",
274
+ "fix": "duration-150 / duration-200 を使用"
275
+ },
276
+ {
277
+ "id": "P031",
278
+ "severity": "warning",
279
+ "category": "layout",
280
+ "pattern": "w-\\[375px\\]|w-\\[390px\\]|w-\\[414px\\]|w-\\[428px\\]",
281
+ "excludes": [".stories."],
282
+ "message": "固定デバイス幅指定禁止(375px等)",
283
+ "fix": "w-full + max-w-* でレスポンシブに対応"
284
+ },
285
+ {
286
+ "id": "P032",
287
+ "severity": "warning",
288
+ "category": "token",
289
+ "pattern": "\\bborder(-[tblrxy])?\\b(?![^\"']*(border-(\\[|transparent)|:border-))",
290
+ "excludes": [".stories.", "border-0", "border-2", "border-4", "border-collapse", "border-separate", "border-spacing", "border-solid", "border-dashed", "border-dotted", "border-none"],
291
+ "message": "色を併記しないボーダー幅クラス(border / border-b 等)は避ける。Tailwind v4 では border-color の既定が currentColor になったため、色を書かないと要素の文字色が透けて出て、消費側が濃色テキストを敷くと枠線が黒ずむ(job board で実際に発生)。preset.css の base layer が --border にフォールバックする保険を張るが、コンポーネントは明示が原則。",
292
+ "fix": "border-[var(--Border-Low-Emphasis)](区切り線・淡いカード)/ border-[var(--Border-Medium-Emphasis)](入力・強調)を併記する。状態で出し分けるタブ/バッジ/チップは border-transparent を初期色に置き、data-[state=active]:border-[var(--Brand-Primary)] 等のペア状態クラスで色を上書きする。"
293
+ }
294
+ ],
295
+ "aiPatterns": {
296
+ "description": "AI(Claude / Copilot / Codex 等)がコード生成時に典型的に犯すパターン。コード生成前に必ず確認すること。",
297
+ "patterns": [
298
+ {
299
+ "id": "AI1",
300
+ "name": "カード上部カラーバー",
301
+ "pattern": "border-t-4|border-l-4",
302
+ "description": "カードの上部または左端に太いボーダーで色ストライプをつける AI 定番パターン",
303
+ "fix": "全周ボーダー + Badge でステータスを表現"
304
+ },
305
+ {
306
+ "id": "AI2",
307
+ "name": "グラデーション背景",
308
+ "pattern": "bg-gradient-to-",
309
+ "description": "bg-gradient-to-r from-blue-500 to-purple-600 などを安易に使う",
310
+ "fix": "DS にグラデーション定義なし。単色背景を使用"
311
+ },
312
+ {
313
+ "id": "AI3",
314
+ "name": "DS 定義外の角丸",
315
+ "pattern": "rounded-3xl",
316
+ "description": "rounded-3xl 等、許可セット外の角丸を場当たり的に使う",
317
+ "fix": "rounded-none / rounded-sm / rounded-md / rounded-lg / rounded-xl / rounded-2xl / rounded-full の7値のみ"
318
+ },
319
+ {
320
+ "id": "AI4",
321
+ "name": "tracking-tight(日本語不可)",
322
+ "pattern": "tracking-tight|tracking-tighter",
323
+ "description": "英語デザインを真似て文字間隔を詰める。日本語で使うと可読性が著しく低下する",
324
+ "fix": "letter-spacing は typo-* クラスに最適化済み。直接指定不要"
325
+ },
326
+ {
327
+ "id": "AI5",
328
+ "name": "Shadow 過剰使用",
329
+ "pattern": "shadow-xl|shadow-2xl",
330
+ "description": "カードや要素に過剰なシャドウを付けて「立体感」を演出する",
331
+ "fix": "shadow-[var(--shadow-sm)] か shadow-[var(--shadow-md)] のみ"
332
+ },
333
+ {
334
+ "id": "AI6",
335
+ "name": "Tailwind 標準色の使用",
336
+ "pattern": "(text|bg|border)-(blue|gray|red|green|yellow|indigo)-[0-9]+",
337
+ "description": "var(--...) を調べずに Tailwind 標準色クラスをそのまま使う",
338
+ "fix": "必ず var(--Brand-Primary) / var(--Text-High-Emphasis) 等のセマンティックトークンを使用"
339
+ },
340
+ {
341
+ "id": "AI7",
342
+ "name": "Primitive トークン直接参照",
343
+ "pattern": "var\\(--Primitive-Brand",
344
+ "description": "var(--Primitive-Brand-500) 等を直接使う(テーマ切替が壊れる)",
345
+ "fix": "var(--Brand-Primary) / var(--Brand-Secondary) 等セマンティック層を使用"
346
+ },
347
+ {
348
+ "id": "AI8",
349
+ "name": "div.fixed モーダル",
350
+ "pattern": "div.*fixed.*inset-0",
351
+ "description": "div.fixed.inset-0 で自作モーダルを作る(フォーカストラップなし・a11y 違反)",
352
+ "fix": "<Dialog> / <Sheet> コンポーネントを使用"
353
+ },
354
+ {
355
+ "id": "AI9",
356
+ "name": "常時ループアニメーション",
357
+ "pattern": "animate-spin|animate-bounce|animate-pulse",
358
+ "description": "ローディング以外の場所に常時動くアニメーションを付ける",
359
+ "fix": "アニメーションはローディング状態限定。静的 UI には使わない"
360
+ },
361
+ {
362
+ "id": "AI10",
363
+ "name": "継承・既定への依存(文脈非依存違反)",
364
+ "pattern": "",
365
+ "description": "text色・背景・border色を明示せず、親からの継承や Tailwind v4 の既定(border / ring / outline = currentColor)に委ねる。消費側が濃色テキストや色付き背景を敷くと、枠線・アイコン・文字色がその色に化ける(job board で実際に発生)。サーフェス(カード/ポップオーバー/シート/ダイアログ等)が bg 未指定だと親の背景が透ける。",
366
+ "fix": "コンポーネントは見た目を自前で固定する=文脈非依存に保つ: テキストを描く要素に text-[var(--Text-*)]、サーフェスに bg-[var(--Surface-*)] と border-[var(--Border-*)] を明示。Content/オーバーレイ系ラッパは既定 text色を pin して子を隔離する。Storybook ツールバーの『Hostile ctx』を loud にして漏れ(マゼンタ化・背景透け)を目視確認する。"
367
+ }
368
+ ]
369
+ },
370
+ "accessibility": {
371
+ "wcag": "2.1 AA",
372
+ "requirements": [
373
+ { "id": "A001", "rule": "通常テキストのコントラスト比 4.5:1 以上" },
374
+ { "id": "A002", "rule": "大テキスト(18px+ bold)のコントラスト比 3:1 以上" },
375
+ { "id": "A003", "rule": "UI 要素・アイコンのコントラスト比 3:1 以上" },
376
+ { "id": "A004", "rule": "タッチターゲット最小 44×44px(WCAG 2.5.5 AAA)" },
377
+ { "id": "A005", "rule": "フォーカスリング必須: focus-visible:ring-[3px] focus-visible:ring-[var(--Focus-High-Emphasis)]/50" },
378
+ { "id": "A006", "rule": "アイコンボタンに aria-label 必須" },
379
+ { "id": "A007", "rule": "フォーム入力に <Label> 必須(placeholder のみ禁止)" },
380
+ { "id": "A008", "rule": "エラー表示は 色 + アイコン + テキスト の3点セット必須(色のみ禁止)" },
381
+ { "id": "A009", "rule": "ステータス区別は 色 + アイコン + テキスト(色のみ禁止)" },
382
+ { "id": "A010", "rule": "<div onClick> 禁止: 操作可能要素は必ず <button> / <Button>" },
383
+ { "id": "A011", "rule": "<img> に alt 属性必須(装飾画像は alt=\"\")" },
384
+ { "id": "A012", "rule": "モーダルは <Dialog> を使用し、フォーカストラップを保証" }
385
+ ]
386
+ },
387
+ "typography": {
388
+ "rule": "必ず typo-* クラスを使用。text-sm font-bold 等の個別指定禁止。typo-* クラスに font-weight / line-height / letter-spacing が内包されているため、追加指定不要。",
389
+ "classes": [
390
+ { "class": "typo-display-xl", "size": "48px", "weight": "bold", "use": "ヒーロー" },
391
+ { "class": "typo-display-lg", "size": "36px", "weight": "bold", "use": "LP見出し" },
392
+ { "class": "typo-heading-3xl", "size": "28px", "weight": "bold", "use": "ページタイトル" },
393
+ { "class": "typo-heading-2xl", "size": "24px", "weight": "bold", "use": "主要セクション" },
394
+ { "class": "typo-heading-xl", "size": "21px", "weight": "bold", "use": "サブセクション" },
395
+ { "class": "typo-heading-lg", "size": "18px", "weight": "bold", "use": "グループ見出し" },
396
+ { "class": "typo-heading-md", "size": "16px", "weight": "bold", "use": "小見出し" },
397
+ { "class": "typo-heading-sm", "size": "14px", "weight": "bold", "use": "ラベル的見出し" },
398
+ { "class": "typo-body-lg", "size": "16px", "weight": "normal", "use": "本文(大)" },
399
+ { "class": "typo-body-md", "size": "14px", "weight": "normal", "use": "本文(標準)" },
400
+ { "class": "typo-body-sm", "size": "12px", "weight": "normal", "use": "補足テキスト" },
401
+ { "class": "typo-body-xs", "size": "10px", "weight": "normal", "use": "最小テキスト" },
402
+ { "class": "typo-label-lg", "size": "16px", "weight": "bold", "use": "ボタン大" },
403
+ { "class": "typo-label-md", "size": "14px", "weight": "bold", "use": "ボタン・ナビ" },
404
+ { "class": "typo-label-sm", "size": "12px", "weight": "medium", "use": "タグ・バッジ" },
405
+ { "class": "typo-label-xs", "size": "10px", "weight": "medium", "use": "小タグ" },
406
+ { "class": "typo-caption", "size": "11px", "weight": "normal", "use": "注釈" }
407
+ ]
408
+ },
409
+ "tokens": {
410
+ "spacing": {
411
+ "rule": "4px グリッド。gap-1〜gap-6 / p-1〜p-6 のみ使用。px-[17px] 等の任意値禁止。",
412
+ "allowed": ["gap-1 (4px)", "gap-2 (8px)", "gap-3 (12px)", "gap-4 (16px)", "gap-6 (24px)"]
413
+ },
414
+ "borderRadius": {
415
+ "rule": "7値のみ。rounded-3xl 等は禁止。",
416
+ "allowed": [
417
+ { "class": "rounded-none", "value": "0", "use": "角丸なし" },
418
+ { "class": "rounded-sm", "value": "4px", "use": "Tag・小要素" },
419
+ { "class": "rounded-md", "value": "6px", "use": "中間スケール(sm–lg)" },
420
+ { "class": "rounded-lg", "value": "8px", "use": "Input・Card・Dialog" },
421
+ { "class": "rounded-xl", "value": "12px", "use": "中間スケール(lg–2xl)" },
422
+ { "class": "rounded-2xl", "value": "16px", "use": "Modal・大Card" },
423
+ { "class": "rounded-full", "value": "50%", "use": "Button・Avatar・Badge・Chip" }
424
+ ]
425
+ },
426
+ "shadow": {
427
+ "rule": "DS 定義トークンのみ。Tailwind 標準(shadow-md 等)は禁止。",
428
+ "allowed": [
429
+ { "token": "var(--shadow-sm)", "use": "微細な浮き" },
430
+ { "token": "var(--shadow-md)", "use": "Card・標準浮き" },
431
+ { "token": "var(--shadow-lg)", "use": "Popover・Dropdown" },
432
+ { "token": "var(--shadow-dialog)", "use": "Dialog・Modal" },
433
+ { "token": "var(--shadow-tooltip)", "use": "Tooltip" }
434
+ ]
435
+ }
436
+ },
437
+ "writing": {
438
+ "rules": [
439
+ "和文は全角、欧文・算用数字は半角",
440
+ "見出し文末に「。」をつけない",
441
+ "バリデーションエラー文末に句読点をつけない",
442
+ "日付: YYYY/MM/DD(ゼロなし: 2026/4/7)",
443
+ "ボタン: 動詞で表記(「削除する」「保存する」)",
444
+ "エラーメッセージ: ユーザーが次に取るべき行動を明示する"
445
+ ]
446
+ }
447
+ }
@@ -0,0 +1,4 @@
1
+ import { b as o } from "./server-variants-Dr_V3bDI.js";
2
+ export {
3
+ o as buttonVariants
4
+ };