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.
- package/AGENTS.md +190 -0
- package/CLAUDE.md +189 -0
- package/DESIGN.md +190 -0
- package/LICENSE +21 -0
- package/MIGRATION.md +107 -0
- package/PUBLISHING.md +160 -0
- package/README.md +59 -0
- package/RELEASE.md +82 -0
- package/bin/init.js +112 -0
- package/contracts/components.json +1443 -0
- package/contracts/rules.json +447 -0
- package/dist/class-names.js +4 -0
- package/dist/index.js +13157 -0
- package/dist/native/ui.js +4928 -0
- package/dist/native.js +1559 -0
- package/dist/server-variants-Dr_V3bDI.js +55 -0
- package/dist/types/class-names.d.ts +27 -0
- package/dist/types/components/patterns/admin/bulk-actions.d.ts +17 -0
- package/dist/types/components/patterns/admin/chart-controls.d.ts +16 -0
- package/dist/types/components/patterns/admin/data-table.d.ts +165 -0
- package/dist/types/components/patterns/admin/image-uploader.d.ts +14 -0
- package/dist/types/components/patterns/admin/kebab-menu.d.ts +17 -0
- package/dist/types/components/patterns/admin/notification-list.d.ts +16 -0
- package/dist/types/components/patterns/admin/search-panel.d.ts +9 -0
- package/dist/types/components/patterns/admin/status-tabs.d.ts +13 -0
- package/dist/types/components/patterns/app-header.d.ts +76 -0
- package/dist/types/components/patterns/banner-carousel.d.ts +25 -0
- package/dist/types/components/patterns/banner.d.ts +13 -0
- package/dist/types/components/patterns/bottom-sheet-form.d.ts +17 -0
- package/dist/types/components/patterns/category-nav.d.ts +43 -0
- package/dist/types/components/patterns/category-scroll.d.ts +53 -0
- package/dist/types/components/patterns/chip-selector.d.ts +20 -0
- package/dist/types/components/patterns/chip.d.ts +42 -0
- package/dist/types/components/patterns/coach-mark-overlay.d.ts +66 -0
- package/dist/types/components/patterns/commerce/bottom-tab-bar.d.ts +27 -0
- package/dist/types/components/patterns/commerce/filter-bar.d.ts +39 -0
- package/dist/types/components/patterns/commerce/image-carousel.d.ts +14 -0
- package/dist/types/components/patterns/commerce/order-summary.d.ts +26 -0
- package/dist/types/components/patterns/commerce/price-display.d.ts +20 -0
- package/dist/types/components/patterns/commerce/product-card.d.ts +50 -0
- package/dist/types/components/patterns/commerce/product-carousel.d.ts +15 -0
- package/dist/types/components/patterns/commerce/quantity-selector.d.ts +21 -0
- package/dist/types/components/patterns/commerce/rating-display.d.ts +15 -0
- package/dist/types/components/patterns/commerce/review-card.d.ts +22 -0
- package/dist/types/components/patterns/commerce/review-summary.d.ts +12 -0
- package/dist/types/components/patterns/confirm-dialog.d.ts +32 -0
- package/dist/types/components/patterns/cookie-consent.d.ts +62 -0
- package/dist/types/components/patterns/empty-state.d.ts +15 -0
- package/dist/types/components/patterns/error-state.d.ts +10 -0
- package/dist/types/components/patterns/file-upload.d.ts +31 -0
- package/dist/types/components/patterns/filter-chip.d.ts +26 -0
- package/dist/types/components/patterns/footer.d.ts +24 -0
- package/dist/types/components/patterns/form-field.d.ts +30 -0
- package/dist/types/components/patterns/form.d.ts +13 -0
- package/dist/types/components/patterns/list-item.d.ts +23 -0
- package/dist/types/components/patterns/list-skeletons.d.ts +43 -0
- package/dist/types/components/patterns/menu-drawer.d.ts +27 -0
- package/dist/types/components/patterns/notification-badge.d.ts +15 -0
- package/dist/types/components/patterns/progress-steps.d.ts +7 -0
- package/dist/types/components/patterns/review-overlay.d.ts +25 -0
- package/dist/types/components/patterns/search-bar.d.ts +6 -0
- package/dist/types/components/patterns/section-header.d.ts +8 -0
- package/dist/types/components/patterns/share-buttons.d.ts +13 -0
- package/dist/types/components/patterns/shells/admin-shell.d.ts +8 -0
- package/dist/types/components/patterns/shells/app-shell.d.ts +7 -0
- package/dist/types/components/patterns/shells/marketing-shell.d.ts +7 -0
- package/dist/types/components/patterns/simple-pagination.d.ts +69 -0
- package/dist/types/components/patterns/stat-card.d.ts +43 -0
- package/dist/types/components/patterns/sticky-action-bar.d.ts +27 -0
- package/dist/types/components/patterns/swipe-row.d.ts +17 -0
- package/dist/types/components/patterns/tag-input.d.ts +20 -0
- package/dist/types/components/patterns/tag.d.ts +7 -0
- package/dist/types/components/ui/accordion.d.ts +7 -0
- package/dist/types/components/ui/alert-dialog.d.ts +47 -0
- package/dist/types/components/ui/alert.d.ts +45 -0
- package/dist/types/components/ui/auto-grow-textarea.d.ts +40 -0
- package/dist/types/components/ui/avatar.d.ts +6 -0
- package/dist/types/components/ui/badge.d.ts +18 -0
- package/dist/types/components/ui/breadcrumb.d.ts +16 -0
- package/dist/types/components/ui/button.d.ts +29 -0
- package/dist/types/components/ui/calendar.d.ts +5 -0
- package/dist/types/components/ui/card.d.ts +28 -0
- package/dist/types/components/ui/checkbox-card.d.ts +29 -0
- package/dist/types/components/ui/checkbox-field.d.ts +24 -0
- package/dist/types/components/ui/checkbox-group.d.ts +33 -0
- package/dist/types/components/ui/checkbox.d.ts +44 -0
- package/dist/types/components/ui/coach-mark.d.ts +27 -0
- package/dist/types/components/ui/collapsible.d.ts +24 -0
- package/dist/types/components/ui/combobox.d.ts +19 -0
- package/dist/types/components/ui/countdown-timer.d.ts +39 -0
- package/dist/types/components/ui/date-picker.d.ts +53 -0
- package/dist/types/components/ui/dialog.d.ts +54 -0
- package/dist/types/components/ui/dropdown-filter.d.ts +35 -0
- package/dist/types/components/ui/dropdown-menu.d.ts +42 -0
- package/dist/types/components/ui/error-boundary.d.ts +66 -0
- package/dist/types/components/ui/form.d.ts +61 -0
- package/dist/types/components/ui/hover-card.d.ts +24 -0
- package/dist/types/components/ui/image-gallery.d.ts +28 -0
- package/dist/types/components/ui/input.d.ts +17 -0
- package/dist/types/components/ui/label.d.ts +4 -0
- package/dist/types/components/ui/multi-select.d.ts +21 -0
- package/dist/types/components/ui/navigation-bar.d.ts +58 -0
- package/dist/types/components/ui/number-input.d.ts +20 -0
- package/dist/types/components/ui/pagination.d.ts +26 -0
- package/dist/types/components/ui/pill-toggle.d.ts +16 -0
- package/dist/types/components/ui/popover.d.ts +7 -0
- package/dist/types/components/ui/progress-ring.d.ts +31 -0
- package/dist/types/components/ui/progress.d.ts +34 -0
- package/dist/types/components/ui/radio-group.d.ts +22 -0
- package/dist/types/components/ui/responsive-dialog.d.ts +31 -0
- package/dist/types/components/ui/scroll-area.d.ts +5 -0
- package/dist/types/components/ui/select.d.ts +22 -0
- package/dist/types/components/ui/separator.d.ts +4 -0
- package/dist/types/components/ui/sheet.d.ts +139 -0
- package/dist/types/components/ui/skeleton.d.ts +31 -0
- package/dist/types/components/ui/slider.d.ts +14 -0
- package/dist/types/components/ui/social-icon-data.d.ts +10 -0
- package/dist/types/components/ui/social-icon.d.ts +38 -0
- package/dist/types/components/ui/social-login-button.d.ts +10 -0
- package/dist/types/components/ui/spinner.d.ts +22 -0
- package/dist/types/components/ui/star-rating.d.ts +12 -0
- package/dist/types/components/ui/sub-nav.d.ts +17 -0
- package/dist/types/components/ui/switch.d.ts +4 -0
- package/dist/types/components/ui/sync-status-badge.d.ts +17 -0
- package/dist/types/components/ui/tabs.d.ts +15 -0
- package/dist/types/components/ui/textarea.d.ts +8 -0
- package/dist/types/components/ui/time-picker.d.ts +14 -0
- package/dist/types/components/ui/toast.d.ts +49 -0
- package/dist/types/components/ui/tooltip.d.ts +7 -0
- package/dist/types/index.d.ts +174 -0
- package/dist/types/lib/server-variants/button-variants.d.ts +20 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/types/native/components/Accordion.d.ts +12 -0
- package/dist/types/native/components/Alert.d.ts +9 -0
- package/dist/types/native/components/AlertDialog.d.ts +11 -0
- package/dist/types/native/components/AppHeader.d.ts +10 -0
- package/dist/types/native/components/AppShell.d.ts +13 -0
- package/dist/types/native/components/AutoGrowTextarea.d.ts +8 -0
- package/dist/types/native/components/Avatar.d.ts +8 -0
- package/dist/types/native/components/Badge.d.ts +8 -0
- package/dist/types/native/components/Banner.d.ts +10 -0
- package/dist/types/native/components/BannerCarousel.d.ts +8 -0
- package/dist/types/native/components/BottomSheetForm.d.ts +10 -0
- package/dist/types/native/components/BottomTabBar.d.ts +8 -0
- package/dist/types/native/components/Breadcrumb.d.ts +12 -0
- package/dist/types/native/components/Button.d.ts +9 -0
- package/dist/types/native/components/Calendar.d.ts +8 -0
- package/dist/types/native/components/Card.d.ts +11 -0
- package/dist/types/native/components/CategoryNav.d.ts +13 -0
- package/dist/types/native/components/CategoryScroll.d.ts +12 -0
- package/dist/types/native/components/Checkbox.d.ts +7 -0
- package/dist/types/native/components/CheckboxCard.d.ts +8 -0
- package/dist/types/native/components/CheckboxField.d.ts +8 -0
- package/dist/types/native/components/CheckboxGroup.d.ts +12 -0
- package/dist/types/native/components/Chip.d.ts +17 -0
- package/dist/types/native/components/ChipSelector.d.ts +13 -0
- package/dist/types/native/components/CoachMark.d.ts +12 -0
- package/dist/types/native/components/CoachMarkOverlay.d.ts +19 -0
- package/dist/types/native/components/Collapsible.d.ts +7 -0
- package/dist/types/native/components/Combobox.d.ts +14 -0
- package/dist/types/native/components/ConfirmDialog.d.ts +7 -0
- package/dist/types/native/components/CountdownTimer.d.ts +7 -0
- package/dist/types/native/components/DatePicker.d.ts +10 -0
- package/dist/types/native/components/Dialog.d.ts +12 -0
- package/dist/types/native/components/DropdownFilter.d.ts +12 -0
- package/dist/types/native/components/DropdownMenu.d.ts +19 -0
- package/dist/types/native/components/EmptyState.d.ts +8 -0
- package/dist/types/native/components/ErrorState.d.ts +8 -0
- package/dist/types/native/components/FileUpload.d.ts +12 -0
- package/dist/types/native/components/FilterBar.d.ts +13 -0
- package/dist/types/native/components/FilterChip.d.ts +7 -0
- package/dist/types/native/components/Footer.d.ts +9 -0
- package/dist/types/native/components/FormField.d.ts +9 -0
- package/dist/types/native/components/GlassView.d.ts +25 -0
- package/dist/types/native/components/ImageCarousel.d.ts +8 -0
- package/dist/types/native/components/ImageGallery.d.ts +7 -0
- package/dist/types/native/components/Input.d.ts +9 -0
- package/dist/types/native/components/Label.d.ts +7 -0
- package/dist/types/native/components/ListItem.d.ts +11 -0
- package/dist/types/native/components/ListSkeletons.d.ts +6 -0
- package/dist/types/native/components/MarketingShell.d.ts +9 -0
- package/dist/types/native/components/MenuDrawer.d.ts +21 -0
- package/dist/types/native/components/MultiSelect.d.ts +13 -0
- package/dist/types/native/components/NavigationBar.d.ts +18 -0
- package/dist/types/native/components/NotificationBadge.d.ts +9 -0
- package/dist/types/native/components/NumberInput.d.ts +9 -0
- package/dist/types/native/components/OrderSummary.d.ts +10 -0
- package/dist/types/native/components/Pagination.d.ts +7 -0
- package/dist/types/native/components/PillToggle.d.ts +12 -0
- package/dist/types/native/components/Popover.d.ts +14 -0
- package/dist/types/native/components/PriceDisplay.d.ts +8 -0
- package/dist/types/native/components/ProductCard.d.ts +14 -0
- package/dist/types/native/components/ProductCarousel.d.ts +11 -0
- package/dist/types/native/components/Progress.d.ts +7 -0
- package/dist/types/native/components/ProgressRing.d.ts +12 -0
- package/dist/types/native/components/ProgressSteps.d.ts +9 -0
- package/dist/types/native/components/QuantitySelector.d.ts +6 -0
- package/dist/types/native/components/RadioGroup.d.ts +13 -0
- package/dist/types/native/components/RatingDisplay.d.ts +7 -0
- package/dist/types/native/components/ResponsiveDialog.d.ts +7 -0
- package/dist/types/native/components/ReviewCard.d.ts +11 -0
- package/dist/types/native/components/ReviewOverlay.d.ts +7 -0
- package/dist/types/native/components/ReviewSummary.d.ts +7 -0
- package/dist/types/native/components/ScrollArea.d.ts +9 -0
- package/dist/types/native/components/SearchBar.d.ts +9 -0
- package/dist/types/native/components/SectionHeader.d.ts +10 -0
- package/dist/types/native/components/Select.d.ts +14 -0
- package/dist/types/native/components/Separator.d.ts +5 -0
- package/dist/types/native/components/ShareButtons.d.ts +11 -0
- package/dist/types/native/components/Sheet.d.ts +20 -0
- package/dist/types/native/components/SimplePagination.d.ts +7 -0
- package/dist/types/native/components/Skeleton.d.ts +11 -0
- package/dist/types/native/components/Slider.d.ts +9 -0
- package/dist/types/native/components/SocialIcon.d.ts +12 -0
- package/dist/types/native/components/SocialLoginButton.d.ts +8 -0
- package/dist/types/native/components/Spinner.d.ts +6 -0
- package/dist/types/native/components/Stack.d.ts +13 -0
- package/dist/types/native/components/StarRating.d.ts +9 -0
- package/dist/types/native/components/StatCard.d.ts +7 -0
- package/dist/types/native/components/StickyActionBar.d.ts +6 -0
- package/dist/types/native/components/SubNav.d.ts +12 -0
- package/dist/types/native/components/SwipeRow.d.ts +14 -0
- package/dist/types/native/components/Switch.d.ts +4 -0
- package/dist/types/native/components/SyncStatusBadge.d.ts +6 -0
- package/dist/types/native/components/Tabs.d.ts +23 -0
- package/dist/types/native/components/Tag.d.ts +10 -0
- package/dist/types/native/components/TagInput.d.ts +7 -0
- package/dist/types/native/components/Text.d.ts +10 -0
- package/dist/types/native/components/Textarea.d.ts +7 -0
- package/dist/types/native/components/TimePicker.d.ts +12 -0
- package/dist/types/native/components/Toast.d.ts +18 -0
- package/dist/types/native/components/index.d.ts +99 -0
- package/dist/types/native/components/social-icon-data.d.ts +5 -0
- package/dist/types/native/index.d.ts +4 -0
- package/dist/types/native/theme/ThemeProvider.d.ts +21 -0
- package/dist/types/native/typography.d.ts +8 -0
- package/dist/types/tokens/native/index.d.ts +13 -0
- package/dist/types/tokens/native/primitives.d.ts +116 -0
- package/dist/types/tokens/native/scales.d.ts +270 -0
- package/dist/types/tokens/native/themes.d.ts +1147 -0
- package/eslint/deprecated.js +104 -0
- package/eslint/no-colorless-border.js +217 -0
- package/package.json +215 -0
- package/scripts/codemod/README.md +51 -0
- package/scripts/codemod/template.mjs +164 -0
- package/src/components/COMPONENT_LOOKUP.md +190 -0
- package/src/preset.css +168 -0
- package/src/styles/categorical.css +161 -0
- package/src/styles/glass.css +365 -0
- package/src/styles/primitive.css +161 -0
- package/src/styles/semantic.css +247 -0
- package/src/styles/typography.css +140 -0
- package/src/themes/README.md +44 -0
- package/src/themes/blue.css +21 -0
- package/src/themes/default.css +12 -0
- package/src/themes/green.css +22 -0
- package/src/themes/orange.css +21 -0
- package/src/themes/violet.css +22 -0
- package/templates/AGENTS.md +77 -0
- package/templates/CLAUDE.md +77 -0
- package/tokens.json +607 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
このファイルは ksk-design-system の postinstall で自動設置されました。
|
|
3
|
+
最新ルールを取り込むには: npx ksk-ds init --force
|
|
4
|
+
-->
|
|
5
|
+
|
|
6
|
+
# このプロジェクトは ksk-design-system に準拠する
|
|
7
|
+
|
|
8
|
+
Claude Code は UI 作業を始める前に、以下のファイルを**必ず**読み込むこと。
|
|
9
|
+
|
|
10
|
+
## 必読ファイル(node_modules 配下)
|
|
11
|
+
|
|
12
|
+
| ファイル | 内容 |
|
|
13
|
+
|---------|------|
|
|
14
|
+
| `node_modules/ksk-design-system/CLAUDE.md` | DS 全体のルール・禁止パターン(Claude Code 用) |
|
|
15
|
+
| `node_modules/ksk-design-system/contracts/components.json` | 全コンポーネントの定義・バリアント |
|
|
16
|
+
| `node_modules/ksk-design-system/contracts/rules.json` | 禁止パターン31件・AIアンチパターン9件 |
|
|
17
|
+
| `node_modules/ksk-design-system/tokens.json` | カラー・余白・角丸・影・タイポ |
|
|
18
|
+
| `node_modules/ksk-design-system/src/components/COMPONENT_LOOKUP.md` | 全コンポーネントのバリアント・インポートパス一覧 |
|
|
19
|
+
|
|
20
|
+
> DS 側のルール更新は `npm update ksk-design-system` で自動反映されます。このファイルは書き換え不要。
|
|
21
|
+
|
|
22
|
+
## 書く前に必ず確認するパターン
|
|
23
|
+
|
|
24
|
+
| 書こうとしているもの | 代わりに使うもの |
|
|
25
|
+
|-------------------|----------------|
|
|
26
|
+
| カスタムカラー(`#xxxxxx` / `rgba(...)` ハードコード) | `var(--Brand-Primary)`, `var(--Surface-*)` 等のセマンティックトークン |
|
|
27
|
+
| カスタム余白(`margin: 17px` 等の非トークン値) | Tailwind の標準スペーシング(`p-4`, `gap-2` 等) |
|
|
28
|
+
| カスタム角丸(`rounded-md`, `rounded-xl` 等) | `rounded-none/sm/lg/2xl/full` のみ使用可 |
|
|
29
|
+
| カスタム影(`shadow-md` 以上) | `shadow-[var(--shadow-md)]`, `shadow-[var(--shadow-dialog)]` |
|
|
30
|
+
| `font-bold` / `font-semibold` 等の個別指定 | `typo-*` クラス(`typo-heading-md`, `typo-label-sm` 等) |
|
|
31
|
+
| `<button>` / `<input>` / `<a href>` 生タグ | `<Button>`, `<Input>`, `<Button variant="link">` |
|
|
32
|
+
| `text-white` / `bg-white` / Tailwind標準色 | `text-[var(--Text-on-Inverse)]`, `bg-[var(--Surface-Primary)]` |
|
|
33
|
+
| グラデーション(`bg-gradient-to-*`) | 単色背景 `bg-[var(--Surface-*)]` |
|
|
34
|
+
| カラーバー(`border-t-4` 等の太ボーダー) | 全周ボーダー `border border-[var(--Border-Low-Emphasis)]` |
|
|
35
|
+
|
|
36
|
+
DS に該当パターンが無い場合のみカスタム実装を許可。その場合は**必ずコメントで理由を記載**すること。
|
|
37
|
+
|
|
38
|
+
## 新規コンポーネントを作る前に必ず確認する
|
|
39
|
+
|
|
40
|
+
**`node_modules/ksk-design-system/src/components/COMPONENT_LOOKUP.md` を読んでから実装・提案すること。**
|
|
41
|
+
以下は「DSにない」と誤解されやすいが既に存在するもの:
|
|
42
|
+
|
|
43
|
+
| やりたいこと | 正しい使い方 |
|
|
44
|
+
|---|---|
|
|
45
|
+
| アイコンだけのボタン | `<Button size="icon">` / `"icon-sm"` / `"icon-lg"` |
|
|
46
|
+
| リンク見た目のボタン | `<Button variant="link">` |
|
|
47
|
+
| チェックボックス | `<Checkbox>` |
|
|
48
|
+
| ラジオボタン | `<RadioGroup><RadioGroupItem>` |
|
|
49
|
+
| Badge の色違い | `<Badge variant="success">` / `"caution"` / `"warning"` / `"info"` |
|
|
50
|
+
| 空状態の表示 | `<EmptyState>` |
|
|
51
|
+
| 数値カード | `<StatCard>` |
|
|
52
|
+
| トースト通知 | `<Toaster>` + `useToast()` |
|
|
53
|
+
| スケルトン | `<Skeleton>` |
|
|
54
|
+
| 下部ナビゲーション | `<BottomTabBar>` |
|
|
55
|
+
| プログレスバー | `<Progress>` |
|
|
56
|
+
| フォームフィールド | `<FormField>` |
|
|
57
|
+
| ケバブメニュー | `<KebabMenu>` |
|
|
58
|
+
| モーダル(PC) | `<Dialog>` |
|
|
59
|
+
| ドロワー(モバイル) | `<Sheet side="bottom">` |
|
|
60
|
+
| PC/モバイル自動切替モーダル | `<ResponsiveDialog>` |
|
|
61
|
+
|
|
62
|
+
## 使用方法
|
|
63
|
+
|
|
64
|
+
### CSS のセットアップ
|
|
65
|
+
|
|
66
|
+
```css
|
|
67
|
+
/* globals.css / app.css など */
|
|
68
|
+
@import "ksk-design-system/preset"; /* DS のトークン・スタイル */
|
|
69
|
+
@import "ksk-design-system/themes/default"; /* または orange / green / violet */
|
|
70
|
+
@import "tailwindcss";
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### コンポーネントの使用
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
import { Button, Card, Input, FormField } from "ksk-design-system"
|
|
77
|
+
```
|