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
package/AGENTS.md ADDED
@@ -0,0 +1,190 @@
1
+ # KSK Design System — 設計ルールブック(Codex向け)
2
+
3
+ ## このDSについて
4
+
5
+ **KSK Design System** は、フリーランスデザイナー / エンジニア / PdM が **複数クライアント案件を1つのDSで高速に回す** ために設計された統合デザインシステムです。
6
+
7
+ 2つのドメインの設計思想を統合:
8
+ - BtoB / SaaS / リクルート系(信頼感・業務効率を重視)
9
+ - EC / BtoC / コマース系(購買体験・温かみを重視)
10
+
11
+ ---
12
+
13
+ ## 必須: セッション開始時に読み込むファイル
14
+
15
+ コードを書く前に、以下を必ず読み込むこと:
16
+
17
+ ```
18
+ contracts/rules.json # 禁止パターン32件・AIアンチパターン10件・a11y要件
19
+ contracts/components.json # 全110コンポーネントの定義・バリアント・ルール
20
+ tokens.json # カラー・スペーシング・シャドウトークン
21
+ src/components/COMPONENT_LOOKUP.md # バリアント・インポートパス一覧(自動生成)
22
+ ```
23
+
24
+ **必ず `contracts/rules.json` の `prohibited` と `aiPatterns` を確認してから実装すること。**
25
+ 特に `aiPatterns` は AI が典型的に犯すパターン集 — 自分が生成しようとしているコードと照合すること。
26
+
27
+ コンポーネントを新規作成する前に `COMPONENT_LOOKUP.md` で同等品がないか確認すること。
28
+
29
+ ---
30
+
31
+ ## 必須: ファイル編集後に実行するコマンド
32
+
33
+ **.tsx ファイルを作成・編集した後は必ず実行:**
34
+
35
+ ```bash
36
+ bash scripts/lint-scratch.sh
37
+ ```
38
+
39
+ **.css を編集した後は必ず実行:**
40
+
41
+ ```bash
42
+ node scripts/check-prefix-order.mjs
43
+ ```
44
+
45
+ ベンダープレフィックスは **`-webkit-` を先・標準形を後** に書く(消費側の
46
+ minifier が同一プロパティとして dedupe し後勝ちのみ残すため、逆順だと
47
+ 標準形が消えて Firefox で静かに無効化される)。
48
+
49
+ **コンポーネントを追加・削除した後は必ず実行:**
50
+
51
+ ```bash
52
+ bash scripts/check-drift.sh
53
+ node scripts/generate-component-lookup.mjs
54
+ ```
55
+
56
+ エラーが出た場合は修正してから次に進むこと。
57
+
58
+ ---
59
+
60
+ ## 最大の特徴: マルチテーマ対応
61
+
62
+ **Brand色の10行を差し替えるだけで、全コンポーネントの見た目が自動的に切り替わります。**
63
+
64
+ ```
65
+ Brand色を差し替え(10行)→ Primitive Layer → Semantic Layer → Bridge Layer → 全コンポーネント
66
+ ```
67
+
68
+ | テーマ | Brand-500 | 想定業種 |
69
+ |--------|-----------|---------|
70
+ | Default (Blue) | `#3B82F6` | 汎用・SaaS・BtoB |
71
+ | Orange | `#F97316` | EC・フード・エンタメ |
72
+ | Green | `#16A34A` | ヘルスケア・サステナ・金融 |
73
+ | Violet | `#7C3AED` | プレミアム・クリエイティブ・教育 |
74
+
75
+ ---
76
+
77
+ ## 技術スタック
78
+
79
+ - React 19 + TypeScript / Vite / **Tailwind CSS v4**(`@import "tailwindcss"` 構文)
80
+ - shadcn/ui(Radix UI ベース) / CVA(バリアント管理)
81
+ - **iconsax-reactjs**(アイコン。lucide-react や heroicons は使わない)
82
+ - Storybook(ドキュメント)
83
+
84
+ > **注意**: Tailwind CSS は v4 です。`@tailwind base` 等の v3 構文は使わないこと。
85
+
86
+ ---
87
+
88
+ ## ドキュメント構成
89
+
90
+ | ファイル | 内容 |
91
+ |---------|------|
92
+ | **AGENTS.md**(本ファイル) | 概要・技術スタック・コマンド・クイックスタート |
93
+ | **contracts/components.json** | 全110コンポーネントの構造化定義(バリアント・アクセシビリティ要件) |
94
+ | **contracts/rules.json** | 禁止パターン32件・AIアンチパターン10件・アクセシビリティ要件 |
95
+ | **tokens.json** | カラー・スペーシング・シャドウトークンの機械可読定義 |
96
+ | **src/components/COMPONENT_LOOKUP.md** | 全110コンポーネントのバリアント・インポートパス(自動生成) |
97
+ | **DESIGN.md** | AI エージェント向け視覚言語サマリ(トークン+意図・voice・motion) |
98
+
99
+ ---
100
+
101
+ ## ディレクトリ構成
102
+
103
+ ```
104
+ src/
105
+ ├── components/
106
+ │ ├── ui/ # 汎用UIコンポーネント 55個
107
+ │ ├── patterns/
108
+ │ │ ├── commerce/ # EC系 11個
109
+ │ │ ├── admin/ # 管理画面系 8個
110
+ │ │ ├── shells/ # レイアウトシェル 3個
111
+ │ │ └── ... # 汎用パターン 33個
112
+ │ └── icons/
113
+ ├── styles/
114
+ │ ├── primitive.css # Layer 1: 原色パレット
115
+ │ ├── semantic.css # Layer 2: 用途別トークン
116
+ │ └── typography.css # typo-* ユーティリティ 17クラス
117
+ ├── themes/ # default / orange / green / violet / blue
118
+ ├── preset.css # 外部プロジェクト向けプリセット
119
+ └── index.ts # Public API(110コンポーネント)
120
+ ```
121
+
122
+ ---
123
+
124
+ ## カラートークン体系(3層構造)
125
+
126
+ ```
127
+ Layer 1 — Primitive : --Primitive-{ColorName}-{Shade} (10色ファミリー × 10シェード)
128
+ Layer 2 — Semantic : --{Category}-{Role} (Surface / Text / Border / Brand / Focus 等)
129
+ Layer 3 — Bridge : --primary / --secondary 等 (shadcn/ui 互換マッピング)
130
+ ```
131
+
132
+ セマンティックトークン早見表:
133
+
134
+ | 用途 | トークン |
135
+ |------|---------|
136
+ | 背景(白) | `var(--Surface-Primary)` |
137
+ | 背景(薄灰) | `var(--Surface-Secondary)` |
138
+ | テキスト(強) | `var(--Text-High-Emphasis)` |
139
+ | テキスト(中) | `var(--Text-Medium-Emphasis)` |
140
+ | テキスト(弱) | `var(--Text-Low-Emphasis)` |
141
+ | テキスト(白抜き) | `var(--Text-on-Inverse)` |
142
+ | ブランド色 | `var(--Brand-Primary)` |
143
+ | フォーカス | `var(--Focus-High-Emphasis)` |
144
+
145
+ **カテゴリ識別色(質的パレット・テーマ非依存):**
146
+ `var(--Categorical-{1..16})`(ドット/アイコン)/ `-Subtle`(背景ティント)/ `-Bold`(文字・ラベル)。
147
+ Brand に連動しない固定値で、カレンダー予定ドット・カテゴリ chip・グラフ系列など「N 番目のカテゴリ」を色で区別する用途専用。
148
+ 文字には必ず `-Bold` を使う(base は明色相だと白背景でコントラスト不足)。詳細・WCAG/CVD 注記は `src/styles/categorical.css`。
149
+
150
+ ---
151
+
152
+ ## クイックスタート(新規クライアント案件)
153
+
154
+ **1. テーマファイルを作成:**
155
+
156
+ ```css
157
+ /* src/themes/my-client.css */
158
+ @theme {
159
+ --Primitive-Brand-500: #0EA5E9; /* ← クライアントのブランドカラー */
160
+ /* ... Brand-50 〜 900 の10行 */
161
+ }
162
+ ```
163
+
164
+ **2. プロジェクトで import:**
165
+
166
+ ```css
167
+ @import "ksk-design-system/preset";
168
+ @import "./themes/my-client.css";
169
+ ```
170
+
171
+ **3. コンポーネントを使う:**
172
+
173
+ ```tsx
174
+ import { Button, Card, Input, FormField } from "ksk-design-system"
175
+ ```
176
+
177
+ 以上で完了。全コンポーネントがクライアントのブランドカラーで動作します。
178
+
179
+ ---
180
+
181
+ ## コンポーネント追加時のチェックリスト
182
+
183
+ 新しいコンポーネントを追加したら、以下を必ず更新:
184
+
185
+ - [ ] `src/index.ts` にエクスポートを追加
186
+ - [ ] `contracts/components.json` にコンポーネント定義を追加
187
+ - [ ] `contracts/components.json` の `meta.counts` を更新
188
+ - [ ] `bash scripts/check-drift.sh` を実行して乖離がないことを確認
189
+ - [ ] Storybook のストーリーファイル(`.stories.tsx`)を作成
190
+ - [ ] `node scripts/generate-component-lookup.mjs` を実行して COMPONENT_LOOKUP.md を更新
package/CLAUDE.md ADDED
@@ -0,0 +1,189 @@
1
+ # KSK Design System — 設計ルールブック
2
+
3
+ ## 実装前セルフチェック(AI必読・最優先)
4
+
5
+ UI を書く前に必ず確認すること:
6
+
7
+ - [ ] 既存コンポーネントを `src/components/COMPONENT_LOOKUP.md` で確認したか(手書き・再定義は禁止)
8
+ - [ ] 色は semantic token(`var(--Surface-*)` / `var(--Brand-Primary)` 等)か。Tailwind標準色・生 `#hex` は禁止
9
+ - [ ] `border` は色を併記したか(`border-[var(--Border-Low-Emphasis)]` 等)。Tailwind v4 では無色 border は currentColor になり、消費側の濃色テキストで黒ずむ(preset.css の base layer が保険だが明示が原則)
10
+ - [ ] **文脈非依存**か(テキスト要素に `text-[var(--Text-*)]`、サーフェス/オーバーレイに `bg-[var(--Surface-*)]` を明示)。親の継承や currentColor に頼ると消費側の色文脈で崩れる。Storybook ツールバーの **Hostile ctx** を loud にして、文字/アイコンがマゼンタ化・背景が透けないか確認する
11
+ - [ ] typography は `typo-*` クラスか(`font-bold` 等の直書きは禁止)
12
+ - [ ] アイコンは `iconsax-reactjs` か(`lucide-react` / `heroicons` は使わない)
13
+ - [ ] 生タグ(`<button>` / `<input>` / `<a href>`)でなく DS コンポーネントを使ったか
14
+ - [ ] CSS でベンダープレフィックス併記する場合、**`-webkit-` を先・標準形を後**に書いたか(消費側の minifier が同一プロパティとして dedupe し後勝ちのみ残すため。逆順だと Firefox で静かに無効化。`node scripts/check-prefix-order.mjs` が CI で検出)
15
+ - [ ] `.tsx` 編集後に `bash scripts/lint-scratch.sh`、コンポーネント増減時は `npm run check` を実行したか
16
+
17
+ ---
18
+
19
+ ## このDSについて
20
+
21
+ **KSK Design System** は、フリーランスデザイナー / エンジニア / PdM が **複数クライアント案件を1つのDSで高速に回す** ために設計された統合デザインシステムです。
22
+
23
+ 2つのドメインの設計思想を統合:
24
+ - BtoB / SaaS / リクルート系(信頼感・業務効率を重視)
25
+ - EC / BtoC / コマース系(購買体験・温かみを重視)
26
+
27
+ ---
28
+
29
+ ## 最大の特徴: マルチテーマ対応
30
+
31
+ **Brand色の10行を差し替えるだけで、全コンポーネントの見た目が自動的に切り替わります。**
32
+
33
+ ```
34
+ Brand色を差し替え(10行)→ Primitive Layer → Semantic Layer → Bridge Layer → 全コンポーネント
35
+ ```
36
+
37
+ | テーマ | Brand-500 | 想定業種 |
38
+ |--------|-----------|---------|
39
+ | Default (Blue) | `#3B82F6` | 汎用・SaaS・BtoB |
40
+ | Orange | `#F97316` | EC・フード・エンタメ |
41
+ | Green | `#16A34A` | ヘルスケア・サステナ・金融 |
42
+ | Violet | `#7C3AED` | プレミアム・クリエイティブ・教育 |
43
+
44
+ ---
45
+
46
+ ## 技術スタック
47
+
48
+ - React 19 + TypeScript / Vite / **Tailwind CSS v4**(`@import "tailwindcss"` 構文。`@tailwind base` 等の v3 構文は使わない)
49
+ - shadcn/ui(Radix UI ベース) / CVA(バリアント管理)
50
+ - **iconsax-reactjs**(アイコン。`lucide-react` / `heroicons` は使わない) / Storybook(ドキュメント)
51
+
52
+ ---
53
+
54
+ ## ドキュメント構成
55
+
56
+ | ファイル | 内容 |
57
+ |---------|------|
58
+ | **CLAUDE.md**(本ファイル) | 概要・技術スタック・コマンド・クイックスタート(Claude Code用) |
59
+ | **AGENTS.md** | 同上(Codex用。セッション開始時の読み込み指示・編集後コマンドを明記) |
60
+ | **contracts/components.json** | 全110コンポーネントの構造化定義(バリアント・アクセシビリティ要件) |
61
+ | **contracts/rules.json** | 禁止パターン32件・AIアンチパターン10件・アクセシビリティ要件 |
62
+ | **tokens.json** | カラー・スペーシング・シャドウトークンの機械可読定義 |
63
+ | **src/components/COMPONENT_LOOKUP.md** | 全110コンポーネントのバリアント・インポートパス一覧(自動生成) |
64
+ | **DESIGN.md** | AI エージェント向け視覚言語サマリ(トークン+意図・voice・motion) |
65
+
66
+ **セッション開始時 / コードを書く前に必ず読む:**
67
+ 1. `contracts/rules.json` の `prohibited` と `aiPatterns`(AIが典型的に犯すパターン集)を確認
68
+ 2. `contracts/components.json` でコンポーネント定義・バリアントを確認
69
+ 3. `src/components/COMPONENT_LOOKUP.md` で既存コンポーネントを確認(手書き・再定義の防止)
70
+ 4. `tokens.json` でカラー・余白・影・タイポのトークンを確認
71
+
72
+ **`.tsx` を編集したら `bash scripts/lint-scratch.sh`、コンポーネント増減時は `npm run check` を実行すること。**
73
+
74
+ ---
75
+
76
+ ## ディレクトリ構成
77
+
78
+ ```
79
+ src/
80
+ ├── components/
81
+ │ ├── ui/ # 汎用UIコンポーネント 55個
82
+ │ ├── patterns/
83
+ │ │ ├── commerce/ # EC系 11個
84
+ │ │ ├── admin/ # 管理画面系 8個
85
+ │ │ ├── shells/ # レイアウトシェル 3個
86
+ │ │ └── ... # 汎用パターン 33個
87
+ │ └── icons/
88
+ ├── styles/
89
+ │ ├── primitive.css # Layer 1: 原色パレット
90
+ │ ├── semantic.css # Layer 2: 用途別トークン
91
+ │ └── typography.css # typo-* ユーティリティ 17クラス
92
+ ├── themes/ # default / orange / green / violet / blue
93
+ ├── preset.css # 外部プロジェクト向けプリセット
94
+ └── index.ts # Public API(110コンポーネント)
95
+ ```
96
+
97
+ ---
98
+
99
+ ## コマンド
100
+
101
+ ```bash
102
+ # 開発サーバー(Storybook)
103
+ npm run storybook
104
+
105
+ # ビルド
106
+ npm run build-storybook
107
+
108
+ # スクラッチ検出(実装後に必ず実行)
109
+ bash scripts/lint-scratch.sh
110
+
111
+ # ドリフト検出(コンポーネント追加後に実行)
112
+ bash scripts/check-drift.sh
113
+
114
+ # COMPONENT_LOOKUP.md 再生成(コンポーネント追加後に実行)
115
+ npm run generate:lookup
116
+
117
+ # 全チェック(tsc + lint + drift + lookup 一括)
118
+ npm run check
119
+ ```
120
+
121
+ ---
122
+
123
+ ## カラートークン体系(3層構造)
124
+
125
+ ```
126
+ Layer 1 — Primitive : --Primitive-{ColorName}-{Shade} (10色ファミリー × 10シェード)
127
+ Layer 2 — Semantic : --{Category}-{Role} (Surface / Text / Border / Brand / Focus 等)
128
+ Layer 3 — Bridge : --primary / --secondary 等 (shadcn/ui 互換マッピング)
129
+ ```
130
+
131
+ セマンティックトークン早見表:
132
+
133
+ | 用途 | トークン |
134
+ |------|---------|
135
+ | 背景(白) | `var(--Surface-Primary)` |
136
+ | 背景(薄灰) | `var(--Surface-Secondary)` |
137
+ | テキスト(強) | `var(--Text-High-Emphasis)` |
138
+ | テキスト(中) | `var(--Text-Medium-Emphasis)` |
139
+ | テキスト(弱) | `var(--Text-Low-Emphasis)` |
140
+ | テキスト(白抜き) | `var(--Text-on-Inverse)` |
141
+ | ブランド色 | `var(--Brand-Primary)` |
142
+ | フォーカス | `var(--Focus-High-Emphasis)` |
143
+
144
+ **カテゴリ識別色(質的パレット・テーマ非依存):**
145
+ `var(--Categorical-{1..16})`(ドット/アイコン)/ `-Subtle`(背景ティント)/ `-Bold`(文字・ラベル)。
146
+ Brand に連動しない固定値で、カレンダー予定ドット・カテゴリ chip・グラフ系列など「N 番目のカテゴリ」を色で区別する用途専用。
147
+ 文字には必ず `-Bold` を使う(base は明色相だと白背景でコントラスト不足)。詳細・WCAG/CVD 注記は `src/styles/categorical.css`。
148
+
149
+ ---
150
+
151
+ ## クイックスタート(新規クライアント案件)
152
+
153
+ **1. テーマファイルを作成:**
154
+
155
+ ```css
156
+ /* src/themes/my-client.css */
157
+ @theme {
158
+ --Primitive-Brand-500: #0EA5E9; /* ← クライアントのブランドカラー */
159
+ /* ... Brand-50 〜 900 の10行 */
160
+ }
161
+ ```
162
+
163
+ **2. プロジェクトで import:**
164
+
165
+ ```css
166
+ @import "ksk-design-system/preset";
167
+ @import "./themes/my-client.css";
168
+ ```
169
+
170
+ **3. コンポーネントを使う:**
171
+
172
+ ```tsx
173
+ import { Button, Card, Input, FormField } from "ksk-design-system"
174
+ ```
175
+
176
+ 以上で完了。全コンポーネントがクライアントのブランドカラーで動作します。
177
+
178
+ ---
179
+
180
+ ## コンポーネント追加時のチェックリスト
181
+
182
+ 新しいコンポーネントを追加したら、以下を必ず更新:
183
+
184
+ - [ ] `src/index.ts` にエクスポートを追加
185
+ - [ ] `contracts/components.json` にコンポーネント定義を追加
186
+ - [ ] `contracts/components.json` の `meta.counts` を更新
187
+ - [ ] `bash scripts/check-drift.sh` を実行して乖離がないことを確認
188
+ - [ ] Storybook のストーリーファイル(`.stories.tsx`)を作成
189
+ - [ ] `npm run generate:lookup` を実行して COMPONENT_LOOKUP.md を更新
package/DESIGN.md ADDED
@@ -0,0 +1,190 @@
1
+ ---
2
+ version: alpha
3
+ name: KSK Design System
4
+ description: >-
5
+ フリーランス / 受託で複数案件を1つのDSで高速に回すためのマルチテーマ対応
6
+ デザインシステム。Brand 色を差し替えるだけで全コンポーネントの見た目が
7
+ 切り替わる。デフォルトは信頼感のある Blue。
8
+ colors:
9
+ # --- Brand(テーマ差し替え対象。下記は default=Blue) ---
10
+ primary: "#2563EB" # Brand-Primary / var(--Brand-Primary)
11
+ primaryAction: "#1D4ED8" # Brand-Action(hover/active)
12
+ onPrimary: "#FFFFFF"
13
+ # --- Neutral scale ---
14
+ neutral0: "#FFFFFF"
15
+ neutral50: "#F9FAFB"
16
+ neutral100: "#F3F4F6"
17
+ neutral200: "#E5E7EB"
18
+ neutral500: "#6B7280"
19
+ neutral900: "#111827"
20
+ # --- Surface / Text / Border(semantic) ---
21
+ surface: "#FFFFFF" # var(--Surface-Primary)
22
+ surfaceMuted: "#F9FAFB" # var(--Surface-Secondary)
23
+ textHigh: "#111827" # var(--Text-High-Emphasis)
24
+ textMedium: "#374151" # var(--Text-Medium-Emphasis)
25
+ textLow: "#6B7280" # var(--Text-Low-Emphasis)
26
+ border: "#E5E7EB" # var(--Border-Low-Emphasis)
27
+ focus: "#60A5FA" # var(--Focus-High-Emphasis)
28
+ # --- Semantic(status) ---
29
+ success: "#16A34A"
30
+ warning: "#EA580C"
31
+ error: "#DC2626" # Caution
32
+ info: "#2563EB"
33
+ typography:
34
+ fontFamily: "system-ui, -apple-system, 'Hiragino Sans', 'Noto Sans JP', sans-serif"
35
+ display: { fontSize: "48px", lineHeight: "1.2", fontWeight: 700 } # typo-display-xl
36
+ heading: { fontSize: "18px", lineHeight: "1.5", fontWeight: 700 } # typo-heading-lg(基準)
37
+ body: { fontSize: "14px", lineHeight: "1.75", fontWeight: 400 } # typo-body-md(基準)
38
+ label: { fontSize: "12px", lineHeight: "1.5", fontWeight: 500 } # typo-label-sm
39
+ caption: { fontSize: "11px", lineHeight: "1.5", fontWeight: 400 } # typo-caption(注釈/法的表記専用。本文の下限は body=12px。10px の typo-body-xs は補助ラベル専用で本文禁止)
40
+ rounded:
41
+ sm: "4px"
42
+ surface: "8px" # Card / Input / Popover → var(--Radius-Surface)
43
+ modal: "24px" # 中央 Dialog / AlertDialog → var(--Radius-Modal)
44
+ sheet: "32px" # bottom / float Sheet → var(--Radius-Sheet)
45
+ full: "9999px" # Button / Chip
46
+ spacing:
47
+ unit: "4px" # 4px グリッド(scale: 0,4,8,12,16,20,24,28,32,36,40,44,48,...)
48
+ page: "16px" # 画面端マージン var(--page-px)
49
+ elevation: # 影色は neutral(Gray-900 ベース rgba(17,24,39,…))でテーマ非依存
50
+ sm: "0 1px 2px rgba(0,0,0,0.05)"
51
+ md: "0 0 8px rgba(20,20,20,0.08)"
52
+ lg: "0 12px 32px -4px rgba(17,24,39,0.12), 0 8px 16px -6px rgba(17,24,39,0.12)"
53
+ dialog: "0 12px 32px -4px rgba(17,24,39,0.12), 0 8px 16px -6px rgba(17,24,39,0.12), 0 1px 4px 1px rgba(0,0,0,0.2)"
54
+ motion:
55
+ microIn: "150ms ease-out" # fade-in / scale-in
56
+ enter: "200ms ease-out" # fade-in-up / slide-in
57
+ sheetSpring: "280ms cubic-bezier(0.32,0.72,0,1)" # Sheet / Dialog のドラッグ・展開
58
+ components:
59
+ button:
60
+ background: "{colors.primary}"
61
+ color: "{colors.onPrimary}"
62
+ rounded: "{rounded.full}"
63
+ minHeight: "48px"
64
+ card:
65
+ background: "{colors.surface}"
66
+ border: "{colors.border}"
67
+ rounded: "{rounded.surface}"
68
+ elevation: "{elevation.md}"
69
+ dialog:
70
+ rounded: "{rounded.modal}"
71
+ elevation: "{elevation.dialog}"
72
+ sheet:
73
+ rounded: "{rounded.sheet}"
74
+ input:
75
+ border: "{colors.border}"
76
+ rounded: "{rounded.surface}"
77
+ minHeight: "48px"
78
+ ---
79
+
80
+ # KSK Design System — DESIGN.md
81
+
82
+ > AI コーディングエージェント向けの視覚言語サマリ。**1ファイルで KSK の見た目を
83
+ > 再現できる**ことを目的に、トークン(front-matter)と「なぜ・どう使うか」(本文)を併記する。
84
+ > 実装で実際に使う正準ソースは `tokens.json` と `src/styles/*.css`。本ファイルはその要約+意図。
85
+
86
+ ## Overview
87
+
88
+ KSK は **マルチテーマ統合 DS**。Brand 色(10行)を差し替えるだけで、Primitive → Semantic →
89
+ Bridge の3層を伝って全コンポーネントの色が切り替わる。1つの DS で複数案件(BtoB/SaaS 系、
90
+ EC/BtoC 系)を回すのが狙い。
91
+
92
+ - **既定の人格**: 端正・信頼感(Blue)。情報密度は中、余白で呼吸させる。角は適度に丸い(ピル型ボタン+丸い面)。
93
+ - **基盤**: React 19 + Tailwind v4 + shadcn/Radix + iconsax。
94
+ - **判断基準**: 色・余白・タイポは必ずトークン経由。生の値を書かない(後述 Do/Don't)。
95
+
96
+ ## Colors
97
+
98
+ 3層トークン。コンポーネントは**必ず Semantic 層を `var()` で参照**する(Primitive 直参照・生 hex 禁止)。
99
+
100
+ | 用途 | トークン | 既定値(Blue) |
101
+ |---|---|---|
102
+ | ブランド | `var(--Brand-Primary)` | `#2563EB` |
103
+ | 背景(白/薄灰) | `var(--Surface-Primary)` / `-Secondary` | `#FFFFFF` / `#F9FAFB` |
104
+ | 文字(強/中/弱) | `var(--Text-High/Medium/Low-Emphasis)` | `#111827` / `#374151` / `#6B7280` |
105
+ | 罫線 | `var(--Border-Low-Emphasis)` | `#E5E7EB` |
106
+ | 状態 | `--Success/Warning/Caution/Info-Base` | `#16A34A` / `#EA580C` / `#DC2626` / `#2563EB` |
107
+
108
+ - **状態色の正本**: 上記は `*-Base`(テキスト/アイコン基準=Primitive **600**)。`tokens.json` を正本とし、本表はその要約。
109
+ バッジ/ピル等の強調 **fill** は別ロール `--Surface-*-Strong`(Primitive **500**)で、わざと一段明るい。役割が違うだけで矛盾ではない。
110
+ - **Dark mode**: `.dark` で Semantic 層が自動反転(コンポーネント側の変更不要)。テーマ差し替え(Brand)と
111
+ light/dark は**直交2軸**。dark の semantic 値は `src/styles/semantic.css` の `.dark` が実装で、`tokens.json` の
112
+ `colors.semanticDark` に機械可読ミラーを持つ(契約テストで同期を保証)。
113
+ - **Categorical(質的)**: `var(--Categorical-{1..16})` + `-Subtle`(背景) / `-Bold`(文字)。
114
+ カテゴリの色分け専用でテーマ非依存。WCAG/色覚多様性を検証済み。文字には必ず `-Bold`。
115
+
116
+ ## Typography
117
+
118
+ `typo-*` ユーティリティ1クラスに size/line-height/weight/tracking を集約。`text-sm`/`font-bold` 等の個別指定は禁止。
119
+
120
+ - 見出し: `typo-heading-{sm..3xl}`(14→28px, line-height 1.5, 700)
121
+ - 本文: `typo-body-{xs..lg}`(10→16px, line-height 1.75 系)
122
+ - ラベル: `typo-label-{xs..lg}`(10→16px, 500)/ 特大: `typo-display-xl`(48px)
123
+ - 色は別指定: `className="typo-body-sm text-[var(--Text-Low-Emphasis)]"`
124
+
125
+ ## Layout & Spacing
126
+
127
+ - **4px グリッド**。余白・サイズは 4 の倍数(scale 0–60)。
128
+ - 画面端マージン: `var(--page-px)`(既定 16px)。
129
+ - **タッチターゲット**(モバイル): WCAG 2.5.5 / Apple HIG に従い主要操作(ボタン/アイコンボタン/入力/ナビ)の
130
+ **min は 44px** 以上、推奨 48px。44 未満が避けられない **チップ(min 32px)は hitSlop**(不可視の拡張タップ領域)で
131
+ 実効 44px を確保する。値の正本は `tokens.json` の `touchTargets`。
132
+
133
+ ## Elevation & Depth
134
+
135
+ 影は5段(`--shadow-sm/md/lg/dialog/tooltip`)。面は md、浮く要素(dropdown/popover)は lg、
136
+ モーダルは dialog。**境界は影+1px罫線**で表現し、濃い影の多用は避ける。
137
+
138
+ ## Shapes
139
+
140
+ 角丸はトークン化(ベタ書き禁止)。**面 < モーダル < シート**の順で丸くなる。
141
+
142
+ | 用途 | トークン | 値 |
143
+ |---|---|---|
144
+ | Card / Input / Popover | `var(--Radius-Surface)` | 8px |
145
+ | 中央 Dialog / AlertDialog | `var(--Radius-Modal)` | 24px |
146
+ | Sheet(下/フロート) | `var(--Radius-Sheet)` | 32px |
147
+ | Button / Chip | `rounded-full` | 9999px |
148
+
149
+ > 素の `rounded-*` を使う場合、キーは **Tailwind v4 のユーティリティ名**と一致し値もその実描画 px と同じ
150
+ > (`tokens.json` の `borderRadius`: none→sm(4)→md(6)→lg(8)→xl(12)→2xl(16)→full の連続スケール)。
151
+ > 独自の `--radius-*` 上書きはしていないため、`rounded-md`/`rounded-xl` は Tailwind v4 既定の 6px/12px を描画する。
152
+
153
+ ## Motion
154
+
155
+ - マイクロ(出現/スケール): **150ms ease-out**。
156
+ - 入場(fade-up/slide): **200ms ease-out**。
157
+ - Sheet/Dialog の展開・ドラッグ: **cubic-bezier(0.32, 0.72, 0, 1)(iOS 風スプリング)**。
158
+ - 控えめが基本。バウンドや派手な動きはしない。`prefers-reduced-motion` を尊重。
159
+
160
+ ## Components
161
+
162
+ 代表例(トークン参照で構成)。
163
+
164
+ - **Button**: bg `{colors.primary}` / text 白 / `rounded-full` / 高さ 48px。variant: default·secondary·tertiary·ghost·destructive·link。
165
+ - **Card**: bg `{colors.surface}` + 1px `{colors.border}` + `{elevation.md}` + `{rounded.surface}`。
166
+ - **Dialog(中央モーダル)**= タスク面(フォーム/絞り込み)。`role="dialog"`、`{rounded.modal}`。
167
+ - **AlertDialog / ConfirmDialog(割り込み確認)**= 削除等の"止める"操作。`role="alertdialog"`、背景タップで閉じない・中央表示。
168
+ - **Sheet(端寄せ)**: `side="bottom"` でボトムシート。`swipeToClose` で全面下スワイプ閉じ。`{rounded.sheet}`。
169
+ - **Input**: 1px `{colors.border}` + `{rounded.surface}` + 高さ 48px。
170
+
171
+ ## Voice & Tone
172
+
173
+ - UI コピー: 日本語・**敬体(ですます)**・簡潔。専門用語を避け、操作の結果を端的に。
174
+ - 確認/破壊操作は明示的に選ばせる("削除する" 等、動詞で)。
175
+ - テーマ別の人格: **Blue=端正/信頼**(BtoB·SaaS), **Orange=温かみ**(EC·フード), **Green=安心**(ヘルス·金融), **Violet=上質**(プレミアム·教育)。
176
+
177
+ ## Do's and Don'ts
178
+
179
+ **Do**
180
+ - 色は Semantic トークン `var(--Surface-*)` / `var(--Brand-Primary)` を使う。
181
+ - タイポは `typo-*` クラス。角丸は `var(--Radius-*)`。
182
+ - アイコンは `iconsax-reactjs`。UI は DS コンポーネント(`<Button>`/`<Input>` 等)。
183
+ - **文脈非依存に保つ**: 見た目を自前で固定する。テキストを描く要素は `text-[var(--Text-*)]`、サーフェス(カード/ポップオーバー/シート/ダイアログ等)は `bg-[var(--Surface-*)]`、枠線は `border-[var(--Border-*)]` を明示。親の継承や Tailwind v4 既定(`border`/`ring`/`outline` = currentColor)に依存しない。
184
+
185
+ **Don't**
186
+ - 生 `#hex` / Tailwind 標準色(`bg-blue-500` 等)を直書きしない。
187
+ - `font-bold` / `text-sm` / `rounded-lg` / `rounded-[24px]` 等のベタ書きをしない(トークン経由)。
188
+ - `lucide-react` / `heroicons` を使わない。生の `<button>`/`<input>`/`<a>` を使わない。
189
+ - 確認ダイアログを `Dialog`(タスク面)で作らない(割り込みは `AlertDialog`/`ConfirmDialog`)。
190
+ - 色なし `border` / 色未指定の text・bg を親の継承や currentColor 任せにしない。漏れは Storybook の **Hostile ctx** トグルで検出できる。
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 奥野圭祐 (Keisuke Okuno)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.