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,164 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Codemod テンプレート — ksk-design-system 破壊変更時に複製して使う
|
|
4
|
+
*
|
|
5
|
+
* 使い方:
|
|
6
|
+
* cp scripts/codemod/template.mjs scripts/codemod/v1-to-v2.mjs
|
|
7
|
+
* # RENAMES と PACKAGE_PATTERN を編集
|
|
8
|
+
* node scripts/codemod/v1-to-v2.mjs --dry ../my-app/src # 事前確認
|
|
9
|
+
* node scripts/codemod/v1-to-v2.mjs ../my-app/src # 実行
|
|
10
|
+
*
|
|
11
|
+
* 利用側プロジェクトへの公開:
|
|
12
|
+
* npx ksk-design-system codemod v1-to-v2 ./src
|
|
13
|
+
* または
|
|
14
|
+
* node node_modules/ksk-design-system/scripts/codemod/v1-to-v2.mjs ./src
|
|
15
|
+
*
|
|
16
|
+
* 注意:
|
|
17
|
+
* - 正規表現ベースなので 100% 正確ではない(複雑なケースは手動確認推奨)
|
|
18
|
+
* - --dry オプションで事前確認可能
|
|
19
|
+
* - 必ずコミット済みの状態で実行すること(git diff で変更確認)
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import fs from "node:fs"
|
|
23
|
+
import path from "node:path"
|
|
24
|
+
|
|
25
|
+
// ============================================================
|
|
26
|
+
// このテンプレートを複製した後、ここを編集してください
|
|
27
|
+
// ============================================================
|
|
28
|
+
|
|
29
|
+
/** 対象パッケージの import 文を含むファイルだけを処理 */
|
|
30
|
+
const PACKAGE_PATTERN = /@ksk\/design-system/
|
|
31
|
+
|
|
32
|
+
/** 単純な識別子 rename: [oldName, newName] */
|
|
33
|
+
const RENAMES = [
|
|
34
|
+
// 例:
|
|
35
|
+
// ["OldComponent", "NewComponent"],
|
|
36
|
+
// ["OldComponentProps", "NewComponentProps"],
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
/** prop 名 rename: [componentName, oldProp, newProp] */
|
|
40
|
+
const PROP_RENAMES = [
|
|
41
|
+
// 例:
|
|
42
|
+
// ["Button", "kind", "variant"],
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
/** 手動移行が必要な箇所の警告 */
|
|
46
|
+
const WARNINGS = [
|
|
47
|
+
// { pattern: /\bOldThing\b/, message: "OldThing は廃止されました。NewThing への移行ガイドは MIGRATION.md を参照。" },
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
// ============================================================
|
|
51
|
+
// CLI 引数
|
|
52
|
+
// ============================================================
|
|
53
|
+
|
|
54
|
+
const args = process.argv.slice(2)
|
|
55
|
+
const dry = args.includes("--dry")
|
|
56
|
+
const targetDir = args.find((a) => !a.startsWith("--")) || "./src"
|
|
57
|
+
|
|
58
|
+
if (!fs.existsSync(targetDir)) {
|
|
59
|
+
console.error(`✗ Directory not found: ${targetDir}`)
|
|
60
|
+
process.exit(1)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
console.log(`\n🔧 ksk-design-system codemod`)
|
|
64
|
+
console.log(` Target: ${path.resolve(targetDir)}`)
|
|
65
|
+
console.log(` Mode: ${dry ? "DRY RUN (no changes written)" : "APPLY"}`)
|
|
66
|
+
console.log("")
|
|
67
|
+
|
|
68
|
+
// 長い名前から順にマッチさせる(部分マッチ防止)
|
|
69
|
+
const sortedRenames = [...RENAMES].sort((a, b) => b[0].length - a[0].length)
|
|
70
|
+
|
|
71
|
+
// ============================================================
|
|
72
|
+
// ファイル探索
|
|
73
|
+
// ============================================================
|
|
74
|
+
|
|
75
|
+
function findFiles(dir) {
|
|
76
|
+
const results = []
|
|
77
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
78
|
+
const full = path.join(dir, entry.name)
|
|
79
|
+
if (entry.isDirectory()) {
|
|
80
|
+
if (entry.name === "node_modules" || entry.name === "dist" || entry.name.startsWith(".")) continue
|
|
81
|
+
results.push(...findFiles(full))
|
|
82
|
+
} else if (/\.(ts|tsx|js|jsx|mjs|cjs)$/.test(entry.name)) {
|
|
83
|
+
results.push(full)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return results
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// ============================================================
|
|
90
|
+
// 変換
|
|
91
|
+
// ============================================================
|
|
92
|
+
|
|
93
|
+
let totalFiles = 0
|
|
94
|
+
let totalChanges = 0
|
|
95
|
+
const fileChanges = []
|
|
96
|
+
|
|
97
|
+
for (const file of findFiles(targetDir)) {
|
|
98
|
+
const original = fs.readFileSync(file, "utf-8")
|
|
99
|
+
let updated = original
|
|
100
|
+
let fileChangeCount = 0
|
|
101
|
+
|
|
102
|
+
// 対象パッケージを使っていないファイルはスキップ
|
|
103
|
+
if (!PACKAGE_PATTERN.test(original)) continue
|
|
104
|
+
|
|
105
|
+
// 識別子 rename
|
|
106
|
+
for (const [oldName, newName] of sortedRenames) {
|
|
107
|
+
const re = new RegExp(`\\b${oldName}\\b`, "g")
|
|
108
|
+
const matches = updated.match(re)
|
|
109
|
+
if (matches) {
|
|
110
|
+
updated = updated.replace(re, newName)
|
|
111
|
+
fileChangeCount += matches.length
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// prop rename
|
|
116
|
+
for (const [componentName, oldProp, newProp] of PROP_RENAMES) {
|
|
117
|
+
// <Component oldProp= → <Component newProp=
|
|
118
|
+
const re = new RegExp(`(<${componentName}[^>]*\\s)${oldProp}=`, "g")
|
|
119
|
+
const matches = updated.match(re)
|
|
120
|
+
if (matches) {
|
|
121
|
+
updated = updated.replace(re, `$1${newProp}=`)
|
|
122
|
+
fileChangeCount += matches.length
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// 警告のみ
|
|
127
|
+
for (const { pattern, message } of WARNINGS) {
|
|
128
|
+
if (pattern.test(original)) {
|
|
129
|
+
console.log(` ⚠ ${file}`)
|
|
130
|
+
console.log(` ${message}`)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (fileChangeCount > 0) {
|
|
135
|
+
totalFiles++
|
|
136
|
+
totalChanges += fileChangeCount
|
|
137
|
+
fileChanges.push({ file, count: fileChangeCount })
|
|
138
|
+
if (!dry) {
|
|
139
|
+
fs.writeFileSync(file, updated, "utf-8")
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// ============================================================
|
|
145
|
+
// 結果
|
|
146
|
+
// ============================================================
|
|
147
|
+
|
|
148
|
+
console.log(`\n📊 結果`)
|
|
149
|
+
console.log(` ファイル: ${totalFiles}`)
|
|
150
|
+
console.log(` 置換数: ${totalChanges}`)
|
|
151
|
+
console.log("")
|
|
152
|
+
|
|
153
|
+
if (totalFiles > 0) {
|
|
154
|
+
for (const { file, count } of fileChanges) {
|
|
155
|
+
console.log(` ${dry ? "[dry]" : "✓"} ${count.toString().padStart(3)} 件: ${path.relative(process.cwd(), file)}`)
|
|
156
|
+
}
|
|
157
|
+
if (dry) {
|
|
158
|
+
console.log(`\n💡 --dry を外すと実際に書き込みます。`)
|
|
159
|
+
} else {
|
|
160
|
+
console.log(`\n✅ 完了。git diff で変更を確認してください。`)
|
|
161
|
+
}
|
|
162
|
+
} else {
|
|
163
|
+
console.log(`変更対象なし。`)
|
|
164
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Component Lookup(AI必読)
|
|
2
|
+
|
|
3
|
+
> **このファイルは `node scripts/generate-component-lookup.mjs` で自動生成されています。手動編集しないでください。**
|
|
4
|
+
|
|
5
|
+
コンポーネントを使う前に必ずこのファイルを確認し、既存コンポーネントを再利用すること。
|
|
6
|
+
独自でコンポーネントを定義する前に、ここに同等品がないか確認すること。
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## UI Components(src/components/ui/)
|
|
11
|
+
|
|
12
|
+
| Component | Import | Variants | Stories |
|
|
13
|
+
|-----------|--------|----------|---------|
|
|
14
|
+
| Accordion, AccordionItem, AccordionTrigger, AccordionContent | `@/components/ui/accordion` | — | ThreeItems, MultipleOpen |
|
|
15
|
+
| AlertDialog, AlertDialogTrigger, AlertDialogPortal, AlertDialogOverlay, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel | `@/components/ui/alert-dialog` | — | Default, Small |
|
|
16
|
+
| Alert, AlertTitle, AlertDescription | `@/components/ui/alert` | **variant**: `success`, `info`, `error`, `warning`, `inline-info`, `inline-caution`, `inline-warning` | Info, Success, Error, Warning, InlineInfo, InlineCaution, InlineWarning, AllVariants, Prop-based API (auto icon), Prop-based + action |
|
|
17
|
+
| AutoGrowTextarea | `@/components/ui/auto-grow-textarea` | — | — |
|
|
18
|
+
| Avatar, AvatarImage, AvatarFallback | `@/components/ui/avatar` | — | WithImage, Fallback, Sizes, Group |
|
|
19
|
+
| Badge | `@/components/ui/badge` | **variant**: `default`, `secondary`, `outline`, `destructive`, `success`, `warning`, `info`, `subtle`, `ghost` | Default, Secondary, Outline, Destructive, Success, Warning, Info, Subtle, Ghost, AllVariants |
|
|
20
|
+
| Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis | `@/components/ui/breadcrumb` | — | ThreeLevel, WithEllipsis |
|
|
21
|
+
| Button | `@/components/ui/button` | **variant**: `default`, `secondary`, `secondary-switch`, `tertiary`, `ghost`, `destructive`, `link`, `glass`, `accent`, `inverse`, `ghost-inverse`<br>**size**: `xs`, `sm`, `default`, `lg`, `xl`, `hero`, `icon`, `icon-sm`, `icon-lg`, `icon-xl`, `match`<br>**layout**: `horizontal`, `vertical` | Default, Secondary, SecondarySwitch, Tertiary, Ghost, Destructive, Link, AllVariants, AllSizes, Hero, Inverse on Dark Background, Real UI — Hero Section CTAs, Disabled, DisabledAllVariants, IconButton, Glass — Liquid Glass (iOS 26), WithIcon |
|
|
22
|
+
| Calendar | `@/components/ui/calendar` | — | Single, Range |
|
|
23
|
+
| Card, CardHeader, CardTitle, CardDescription, CardAction, CardContent, CardFooter | `@/components/ui/card` | **variant**: `default`, `media` | FullCard, MinimalCard, HeaderOnly |
|
|
24
|
+
| CheckboxCardGroup, CheckboxCardItem | `@/components/ui/checkbox-card` | — | Default, WithDescription, WithExpandedContent, Disabled |
|
|
25
|
+
| CheckboxField | `@/components/ui/checkbox-field` | — | Default, WithDescription, WithError, LongLabelWrap, Disabled |
|
|
26
|
+
| CheckboxGroup, CheckboxGroupItem | `@/components/ui/checkbox-group` | — | Default, Required, WithError, SingleColumn |
|
|
27
|
+
| Checkbox | `@/components/ui/checkbox` | — | Default, Checked, Disabled, DisabledChecked, WithLabel, MultipleOptions, Row Layout (label/description/count), Real UI — Filter Sidebar |
|
|
28
|
+
| CoachMark | `@/components/ui/coach-mark` | — | Default, Brand, Placements, Onboarding, Hover |
|
|
29
|
+
| Collapsible, CollapsibleTrigger, CollapsibleContent | `@/components/ui/collapsible` | — | Default, FAQ |
|
|
30
|
+
| Combobox | `@/components/ui/combobox` | — | Default, WithDisabledOption |
|
|
31
|
+
| CountdownTimer | `@/components/ui/countdown-timer` | — | Filled, Ghost, Compact, Ended, AllVariants |
|
|
32
|
+
| DatePicker, DateRangePicker | `@/components/ui/date-picker` | — | Default, WithInitialValue, Disabled, RangePicker, CalendarOnly, CalendarRange |
|
|
33
|
+
| Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger | `@/components/ui/dialog` | — | WithTrigger, WithForm, ReportShop, StackedFooter |
|
|
34
|
+
| DropdownFilter | `@/components/ui/dropdown-filter` | — | Default, ActiveFilter, WithIcons(ビュー切替・アイコン付き), MultipleFilters |
|
|
35
|
+
| DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent | `@/components/ui/dropdown-menu` | — | Default, WithCheckbox, WithRadio, WithSubmenu |
|
|
36
|
+
| ErrorBoundary | `@/components/ui/error-boundary` | — | — |
|
|
37
|
+
| Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField | `@/components/ui/form` | — | BasicForm, WithSelect |
|
|
38
|
+
| HoverCard, HoverCardTrigger, HoverCardContent | `@/components/ui/hover-card` | — | Default |
|
|
39
|
+
| ImageGallery | `@/components/ui/image-gallery` | — | Thumbnail, Dot, Square, Single |
|
|
40
|
+
| Input | `@/components/ui/input` | — | Default, WithPlaceholder, Disabled, Error, WithLabel, FileInput |
|
|
41
|
+
| Label | `@/components/ui/label` | — | Default, WithRequiredMarker, DisabledState |
|
|
42
|
+
| MultiSelect | `@/components/ui/multi-select` | — | Default |
|
|
43
|
+
| NavigationBar | `@/components/ui/navigation-bar` | — | Default, WithCloseButton, TitleOnly, CustomRightSlot, Liquid Glass — over gradient, Liquid Glass — over photo tone |
|
|
44
|
+
| NumberInput | `@/components/ui/number-input` | — | Default, WithMinMax, WithStep, CurrencyFormat, Disabled |
|
|
45
|
+
| Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PaginationEllipsis | `@/components/ui/pagination` | — | FivePages, WithEllipsis |
|
|
46
|
+
| PillToggle | `@/components/ui/pill-toggle` | — | Default, TwoState, Small |
|
|
47
|
+
| Popover, PopoverTrigger, PopoverContent, PopoverAnchor | `@/components/ui/popover` | — | ClickToShow, SimpleContent |
|
|
48
|
+
| ProgressRing | `@/components/ui/progress-ring` | — | Default, Empty, Full, AllSizes, CustomLabel, Animated |
|
|
49
|
+
| Progress | `@/components/ui/progress` | — | Default, Empty, Half, Full, AllStates |
|
|
50
|
+
| RadioGroup, RadioGroupItem | `@/components/ui/radio-group` | — | ThreeOptions, WithDisabled, WithDescription, HoverState |
|
|
51
|
+
| ResponsiveDialog, ResponsiveDialogTrigger, ResponsiveDialogContent, ResponsiveDialogHeader, ResponsiveDialogTitle, ResponsiveDialogDescription, ResponsiveDialogFooter, ResponsiveDialogClose | `@/components/ui/responsive-dialog` | — | Default |
|
|
52
|
+
| ScrollArea, ScrollBar | `@/components/ui/scroll-area` | — | VerticalScroll, LongText |
|
|
53
|
+
| Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue | `@/components/ui/select` | **size**: `sm`, `default`, `lg` | WithPlaceholder, WithGroups, WithDisabledItem, DisabledSelect |
|
|
54
|
+
| Separator | `@/components/ui/separator` | — | Horizontal, Vertical |
|
|
55
|
+
| Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, SheetDragIndicator | `@/components/ui/sheet` | **side**: `top`, `bottom`, `left`, `right`, `float`, `float-glass`, `bottom-glass` | BottomSheet, FloatSheet, RightSheet, Float Glass (Liquid Glass), Bottom Glass (Liquid Glass), BottomSheet — swipeToClose, BottomSheet — swipeToClose (full height / scrollable), BottomSheet — Snap 0.4/0.9, BottomSheet — Snap (push-up layout) |
|
|
56
|
+
| Skeleton | `@/components/ui/skeleton` | — | CardSkeleton, TextSkeleton, AvatarWithText |
|
|
57
|
+
| Slider | `@/components/ui/slider` | — | Default, Range, WithLabel, Disabled |
|
|
58
|
+
| SOCIAL_ICON_LABELS, SOCIAL_ICON_DATA, SOCIAL_ICON_PLATFORMS | `@/components/ui/social-icon-data` | — | — |
|
|
59
|
+
| SocialIcon, SOCIAL_ICON_PLATFORMS, SOCIAL_ICON_LABELS | `@/components/ui/social-icon` | — | Default, AllPlatforms, AllMono, Tones |
|
|
60
|
+
| SocialLoginButton | `@/components/ui/social-login-button` | — | Line, Google, Apple, Amazon, AllProviders, Loading |
|
|
61
|
+
| Spinner | `@/components/ui/spinner` | — | Default, AllSizes |
|
|
62
|
+
| StarRating | `@/components/ui/star-rating` | — | Interactive, ReadOnly, Sizes |
|
|
63
|
+
| SubNav | `@/components/ui/sub-nav` | — | Underline, Chip, WithBadge |
|
|
64
|
+
| Switch | `@/components/ui/switch` | — | Default, Checked, Disabled, DisabledChecked, WithLabel, SettingsList |
|
|
65
|
+
| SyncStatusBadge | `@/components/ui/sync-status-badge` | — | Syncing, Success, Error, Offline, AllStates |
|
|
66
|
+
| Tabs, TabsList, TabsTrigger, TabsContent | `@/components/ui/tabs` | — | ThreeTabs, WithDisabledTab |
|
|
67
|
+
| Textarea | `@/components/ui/textarea` | — | Default, WithPlaceholder, Disabled, Error, AutoGrow |
|
|
68
|
+
| TimePicker | `@/components/ui/time-picker` | — | Default, 15分刻み |
|
|
69
|
+
| Toaster | `@/components/ui/toast` | **variant**: `default`, `success`, `caution`, `warning`, `info` | Default, Success, Caution, Warning, Info, AllVariants, Fire-and-forget (no <Toaster />) |
|
|
70
|
+
| Tooltip, TooltipTrigger, TooltipContent, TooltipProvider | `@/components/ui/tooltip` | — | HoverToShow, OnIconButton |
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Pattern Components(src/components/patterns/)
|
|
75
|
+
|
|
76
|
+
### patterns/admin/
|
|
77
|
+
|
|
78
|
+
| Component | Import | Variants | Stories |
|
|
79
|
+
|-----------|--------|----------|---------|
|
|
80
|
+
| BulkActions | `@/components/patterns/admin/bulk-actions` | — | Default, ManySelected |
|
|
81
|
+
| ChartControls | `@/components/patterns/admin/chart-controls` | — | Default, PeriodOnly |
|
|
82
|
+
| DataTable, DataTableTable, DataTableHeader, DataTableBody, DataTableRow, DataTableHead, DataTableCell, DataTableAvatarCell, DataTableImageCell, DataTableCheckboxCell, DataTableActionCell, DataTableInputCell, DataTableSelectCell, DataTableNumberCell, DataTableDragHandleCell, DataTableLinkCell, DataTableBulkActions, DataTableSectionRow, DataTableAddRow, DataTableEmptyState | `@/components/patterns/admin/data-table` | **align**: `left`, `center`, `right`<br>**width**: `auto`, `narrow`, `checkbox`, `action`, `sm`, `md`, `lg`, `xl` | Default, Empty, WithSections, CellVariants, Sticky Columns (左端固定), Drag & Drop (行の並べ替え) |
|
|
83
|
+
| ImageUploader | `@/components/patterns/admin/image-uploader` | — | Default, Empty |
|
|
84
|
+
| KebabMenu | `@/components/patterns/admin/kebab-menu` | — | Default |
|
|
85
|
+
| NotificationList | `@/components/patterns/admin/notification-list` | — | Vertical, Horizontal, Empty |
|
|
86
|
+
| SearchPanel | `@/components/patterns/admin/search-panel` | — | Default |
|
|
87
|
+
| StatusTabs | `@/components/patterns/admin/status-tabs` | — | Default |
|
|
88
|
+
|
|
89
|
+
### patterns/(汎用)
|
|
90
|
+
|
|
91
|
+
| Component | Import | Variants | Stories |
|
|
92
|
+
|-----------|--------|----------|---------|
|
|
93
|
+
| AppHeader | `@/components/patterns/app-header` | — | Default, WithBack, WithSubtitle, WithMenu, Sticky, Glass — Liquid Glass (over gradient), Transparent — scrollable reveal |
|
|
94
|
+
| BannerCarousel | `@/components/patterns/banner-carousel` | — | Default, NoHeader, Tall |
|
|
95
|
+
| Banner | `@/components/patterns/banner` | **variant**: `info`, `success`, `warning`, `caution` | Info, Success, Warning, Caution, WithAction, AllVariants |
|
|
96
|
+
| BottomSheetForm | `@/components/patterns/bottom-sheet-form` | — | Default, WithLoading |
|
|
97
|
+
| CategoryNav | `@/components/patterns/category-nav` | — | Default, WithSelection |
|
|
98
|
+
| CategoryScroll | `@/components/patterns/category-scroll` | — | Default, CircleShape, GridLayout |
|
|
99
|
+
| ChipSelector | `@/components/patterns/chip-selector` | — | MultiSelect, SingleSelect, WithMax |
|
|
100
|
+
| Chip | `@/components/patterns/chip` | **variant**: `filled`, `accent`, `outline`<br>**size**: `sm`, `md`, `lg`, `tile`<br>**shape**: `pill`, `square` | Filled, Accent, Outline, AllVariants, AllSizes, Selected, Removable, SquareShape, WithCount, TileAndSoldOut, AsLink, Real UI — Filters & Status |
|
|
101
|
+
| CoachMarkOverlay | `@/components/patterns/coach-mark-overlay` | — | — |
|
|
102
|
+
| ConfirmDialog | `@/components/patterns/confirm-dialog` | — | Default, Destructive, WithLoading |
|
|
103
|
+
| CookieConsent | `@/components/patterns/cookie-consent` | — | — |
|
|
104
|
+
| EmptyState | `@/components/patterns/empty-state` | — | WithAction, Minimal, WithIconOnly, With dual action (recommended layout) |
|
|
105
|
+
| ErrorState | `@/components/patterns/error-state` | — | DefaultWithRetry, CustomMessages, WithoutRetry |
|
|
106
|
+
| FileUpload | `@/components/patterns/file-upload` | — | Default, Multiple |
|
|
107
|
+
| FilterChip | `@/components/patterns/filter-chip` | — | — |
|
|
108
|
+
| Footer | `@/components/patterns/footer` | — | Default, Minimal |
|
|
109
|
+
| FormField | `@/components/patterns/form-field` | — | WithInput, Required, WithError, WithDescription, WithTextarea, WithSelect, CompleteForm |
|
|
110
|
+
| FormRoot, FormSection, FormActions | `@/components/patterns/form` | — | Default |
|
|
111
|
+
| ListItem | `@/components/patterns/list-item` | — | WithSlots, Interactive, WithBottomSlot |
|
|
112
|
+
| ListSkeleton, GridSkeleton | `@/components/patterns/list-skeletons` | — | — |
|
|
113
|
+
| MenuDrawer | `@/components/patterns/menu-drawer` | — | Default, NoBanner |
|
|
114
|
+
| NotificationBadge | `@/components/patterns/notification-badge` | — | SingleDigit, DoubleDigit, MaxOverflow, CustomMax, Zero, VariousCounts, WithIcon |
|
|
115
|
+
| ProgressSteps | `@/components/patterns/progress-steps` | — | Step2Active, FirstStep, ThirdStep, AllComplete, ThreeSteps |
|
|
116
|
+
| ReviewOverlay | `@/components/patterns/review-overlay` | — | Default, WithPins |
|
|
117
|
+
| SearchBar | `@/components/patterns/search-bar` | — | Default, WithValue, Disabled, WithOnSearch |
|
|
118
|
+
| SectionHeader | `@/components/patterns/section-header` | — | WithAction, WithoutAction, TitleOnly, WithGhostButton |
|
|
119
|
+
| ShareButtons | `@/components/patterns/share-buttons` | — | Circle, Inline, SelectiveProviders |
|
|
120
|
+
| SimplePagination | `@/components/patterns/simple-pagination` | — | アイテム数指定 (items), ページ数指定 (pages), compact (モバイル省略表示), 境界での disabled, 0 件 |
|
|
121
|
+
| StatCard | `@/components/patterns/stat-card` | — | TrendUp, TrendDown, NoTrend, Variants, MultipleCards |
|
|
122
|
+
| StickyActionBar | `@/components/patterns/sticky-action-bar` | — | Default, TwoButtons, NoBorder |
|
|
123
|
+
| SwipeRow | `@/components/patterns/swipe-row` | — | Default, SingleAction |
|
|
124
|
+
| TagInput | `@/components/patterns/tag-input` | — | Default, WithInitialTags, WithMax, Disabled |
|
|
125
|
+
| Tag | `@/components/patterns/tag` | **variant**: `default`, `brand`, `caution`, `success`, `warning`, `info` | Default, Brand, Caution, Success, Warning, Info, AllVariants |
|
|
126
|
+
|
|
127
|
+
### patterns/commerce/
|
|
128
|
+
|
|
129
|
+
| Component | Import | Variants | Stories |
|
|
130
|
+
|-----------|--------|----------|---------|
|
|
131
|
+
| BottomTabBar | `@/components/patterns/commerce/bottom-tab-bar` | — | Default, Pill — iOS 26 Liquid Glass, Pill — on light background |
|
|
132
|
+
| FilterBar | `@/components/patterns/commerce/filter-bar` | — | Default, Interactive |
|
|
133
|
+
| ImageCarousel | `@/components/patterns/commerce/image-carousel` | — | Banner, Square, Video, AutoPlay |
|
|
134
|
+
| OrderSummary | `@/components/patterns/commerce/order-summary` | — | Default, Simple |
|
|
135
|
+
| PriceDisplay | `@/components/patterns/commerce/price-display` | **size**: `sm`, `md`, `lg`, `xl` | Default, Sale, Range, AllSizes |
|
|
136
|
+
| ProductCard | `@/components/patterns/commerce/product-card` | — | Vertical, VerticalWithDiscount, VerticalWithCart, VerticalWithRanking, Horizontal, Grid |
|
|
137
|
+
| ProductCarousel | `@/components/patterns/commerce/product-carousel` | — | Default, WithRanking, WithCartButton, LargeCards |
|
|
138
|
+
| QuantitySelector | `@/components/patterns/commerce/quantity-selector` | — | Medium, Small, WithTrash, Disabled |
|
|
139
|
+
| RatingDisplay | `@/components/patterns/commerce/rating-display` | — | Default, AllSizes, ValueOnly |
|
|
140
|
+
| ReviewCard, StarRow | `@/components/patterns/commerce/review-card` | — | Default, LowRating, WithSummary |
|
|
141
|
+
| ReviewSummary | `@/components/patterns/commerce/review-summary` | — | Default, HighRating |
|
|
142
|
+
|
|
143
|
+
### patterns/shells/
|
|
144
|
+
|
|
145
|
+
| Component | Import | Variants | Stories |
|
|
146
|
+
|-----------|--------|----------|---------|
|
|
147
|
+
| AdminShell | `@/components/patterns/shells/admin-shell` | — | Default |
|
|
148
|
+
| AppShell | `@/components/patterns/shells/app-shell` | — | Default |
|
|
149
|
+
| MarketingShell | `@/components/patterns/shells/marketing-shell` | — | Default |
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## よくある間違い
|
|
154
|
+
|
|
155
|
+
| 禁止(手書き) | 正しい書き方 |
|
|
156
|
+
|---|---|
|
|
157
|
+
| `<button className="...">` | `<Button variant="..." size="...">` |
|
|
158
|
+
| `<input className="...">` | `<Input>` |
|
|
159
|
+
| `<textarea className="...">` | `<Textarea>` |
|
|
160
|
+
| `<select>...</select>` | `<Select><SelectItem>` |
|
|
161
|
+
| `function SectionHeader()` をページ内で定義 | `import { SectionHeader }` |
|
|
162
|
+
| `function FormField()` をページ内で定義 | `import { FormField }` |
|
|
163
|
+
| `<div className="rounded-xl border p-4">` | `<Card><CardContent>` |
|
|
164
|
+
| `text-blue-500` 等 Tailwind 標準色 | `text-[var(--Brand-Primary)]` 等セマンティックトークン |
|
|
165
|
+
| `font-bold` 直書き | `typo-body-md-bold` 等 typo-* クラス |
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## 「DSにない」と誤解されやすいコンポーネント対応表
|
|
170
|
+
|
|
171
|
+
> **新規コンポーネントを提案・実装する前に必ずこの表を確認すること。**
|
|
172
|
+
|
|
173
|
+
| やりたいこと | 正しい使い方 | インポート |
|
|
174
|
+
|---|---|---|
|
|
175
|
+
| アイコンだけのボタン | `<Button size="icon">` / `"icon-sm"` / `"icon-lg"` | `Button` |
|
|
176
|
+
| リンク見た目のボタン | `<Button variant="link">` | `Button` |
|
|
177
|
+
| チェックボックス | `<Checkbox>` | `Checkbox` |
|
|
178
|
+
| ラジオボタン | `<RadioGroup><RadioGroupItem>` | `RadioGroup, RadioGroupItem` |
|
|
179
|
+
| Badge の色違い | `<Badge variant="success">` / `"destructive"` / `"warning"` / `"info"` | `Badge` |
|
|
180
|
+
| 空状態の表示 | `<EmptyState>` | `EmptyState` |
|
|
181
|
+
| 数値カード | `<StatCard>` | `StatCard` |
|
|
182
|
+
| トースト通知 | `<Toaster>` + `useToast()` | `Toaster, useToast` |
|
|
183
|
+
| スケルトン | `<Skeleton>` | `Skeleton` |
|
|
184
|
+
| 下部ナビゲーション | `<BottomTabBar>` | `BottomTabBar` |
|
|
185
|
+
| プログレスバー | `<Progress>` | `Progress` |
|
|
186
|
+
| フォームフィールド | `<FormField>` | `FormField` |
|
|
187
|
+
| ケバブメニュー | `<KebabMenu>` | `KebabMenu` |
|
|
188
|
+
| モーダル(PC) | `<Dialog>` | `Dialog, DialogContent, ...` |
|
|
189
|
+
| ドロワー(モバイル) | `<Sheet side="bottom">` | `Sheet, SheetContent, ...` |
|
|
190
|
+
| PC/モバイル自動切替モーダル | `<ResponsiveDialog>` | `ResponsiveDialog, ...` |
|
package/src/preset.css
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/* =============================================================
|
|
2
|
+
KSK Design System — Preset CSS
|
|
3
|
+
|
|
4
|
+
外部プロジェクト向けプリセット。
|
|
5
|
+
1行の @import で全トークン + shadcn互換 + アニメーションが有効になる。
|
|
6
|
+
|
|
7
|
+
使い方:
|
|
8
|
+
@import "ksk-design-system/preset";
|
|
9
|
+
|
|
10
|
+
─── Tailwind CSS v4 の @source 設定(重要) ───────────────────
|
|
11
|
+
Tailwind v4 はデフォルトで node_modules を走査しません。
|
|
12
|
+
コンポーネントの Tailwind クラスを検出するため、CSS ファイルに
|
|
13
|
+
@source ディレクティブで dist フォルダを指定してください。
|
|
14
|
+
詳細は CLAUDE.md / README を参照。
|
|
15
|
+
============================================================= */
|
|
16
|
+
|
|
17
|
+
@import "./styles/primitive.css";
|
|
18
|
+
@import "./styles/semantic.css";
|
|
19
|
+
@import "./styles/categorical.css";
|
|
20
|
+
@import "./styles/typography.css";
|
|
21
|
+
@import "./styles/glass.css";
|
|
22
|
+
|
|
23
|
+
/* ─── Bridge Layer: shadcn/ui 互換マッピング ─── */
|
|
24
|
+
:root {
|
|
25
|
+
--radius: 0.5rem;
|
|
26
|
+
|
|
27
|
+
--background: var(--Surface-Primary);
|
|
28
|
+
--foreground: var(--Text-High-Emphasis);
|
|
29
|
+
|
|
30
|
+
--card: var(--Surface-Primary);
|
|
31
|
+
--card-foreground: var(--Text-High-Emphasis);
|
|
32
|
+
|
|
33
|
+
--popover: var(--Surface-Primary);
|
|
34
|
+
--popover-foreground: var(--Text-High-Emphasis);
|
|
35
|
+
|
|
36
|
+
--primary: var(--Brand-Primary);
|
|
37
|
+
--primary-foreground: var(--Text-on-Inverse);
|
|
38
|
+
|
|
39
|
+
--secondary: var(--Surface-Secondary);
|
|
40
|
+
--secondary-foreground: var(--Text-High-Emphasis);
|
|
41
|
+
|
|
42
|
+
--muted: var(--Surface-Tertiary);
|
|
43
|
+
--muted-foreground: var(--Text-Low-Emphasis);
|
|
44
|
+
|
|
45
|
+
--accent: var(--Surface-Secondary);
|
|
46
|
+
--accent-foreground: var(--Text-High-Emphasis);
|
|
47
|
+
|
|
48
|
+
--destructive: var(--Caution-Base);
|
|
49
|
+
--destructive-foreground: var(--Text-on-Inverse);
|
|
50
|
+
|
|
51
|
+
--border: var(--Border-Medium-Emphasis);
|
|
52
|
+
--input: var(--Border-Medium-Emphasis);
|
|
53
|
+
--ring: var(--Focus-High-Emphasis);
|
|
54
|
+
|
|
55
|
+
--sidebar-background: var(--Surface-Primary);
|
|
56
|
+
--sidebar-foreground: var(--Text-High-Emphasis);
|
|
57
|
+
--sidebar-primary: var(--Brand-Primary);
|
|
58
|
+
--sidebar-primary-foreground: var(--Text-on-Inverse);
|
|
59
|
+
--sidebar-accent: var(--Surface-Accent-Primary-Light);
|
|
60
|
+
--sidebar-accent-foreground: var(--Text-Accent-Primary);
|
|
61
|
+
--sidebar-border: var(--Border-Low-Emphasis);
|
|
62
|
+
--sidebar-ring: var(--Focus-High-Emphasis);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.dark {
|
|
66
|
+
--background: var(--Surface-Primary);
|
|
67
|
+
--foreground: var(--Text-High-Emphasis);
|
|
68
|
+
--card: var(--Surface-Secondary);
|
|
69
|
+
--card-foreground: var(--Text-High-Emphasis);
|
|
70
|
+
--popover: var(--Surface-Secondary);
|
|
71
|
+
--popover-foreground: var(--Text-High-Emphasis);
|
|
72
|
+
--primary: var(--Brand-Primary);
|
|
73
|
+
--primary-foreground: var(--Text-on-Inverse);
|
|
74
|
+
--secondary: var(--Surface-Tertiary);
|
|
75
|
+
--secondary-foreground: var(--Text-High-Emphasis);
|
|
76
|
+
--muted: var(--Surface-Tertiary);
|
|
77
|
+
--muted-foreground: var(--Text-Low-Emphasis);
|
|
78
|
+
--accent: var(--Surface-Tertiary);
|
|
79
|
+
--accent-foreground: var(--Text-High-Emphasis);
|
|
80
|
+
--destructive: var(--Caution-Base);
|
|
81
|
+
--destructive-foreground: var(--Text-on-Inverse);
|
|
82
|
+
--border: var(--Border-Medium-Emphasis);
|
|
83
|
+
--input: var(--Border-Medium-Emphasis);
|
|
84
|
+
--ring: var(--Focus-High-Emphasis);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* ─── Radius Tokens ───
|
|
88
|
+
角丸の意味別トークン。コンポーネントは rounded-[var(--Radius-*)] で参照し、
|
|
89
|
+
rounded-lg / rounded-[32px] のベタ書き(=ドリフトの元)を避ける。
|
|
90
|
+
テーマ非依存(Brand / Light-Dark で変わらない固定値)。
|
|
91
|
+
面 < モーダル < シート の順に丸くなる階層。 */
|
|
92
|
+
:root {
|
|
93
|
+
--Radius-Surface: 0.5rem; /* 8px — Card / Popover パネル / 面の既定。丸くしたいならここを上げる */
|
|
94
|
+
--Radius-Modal: 1.5rem; /* 24px — 中央モーダル(Dialog / AlertDialog)。ピル/シートの丸い言語に合わせる */
|
|
95
|
+
--Radius-Sheet: 2rem; /* 32px — 端寄せ Sheet(bottom / float) */
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* ─── Shadow Tokens ───
|
|
99
|
+
影色はテーマ非依存の neutral(Gray-900 ベース rgba(17,24,39,…))。
|
|
100
|
+
旧来の青寄り rgba(24,39,75) は default=Blue 前提で、violet/orange/green
|
|
101
|
+
テーマや地の色とわずかにケンカするため neutral に統一。
|
|
102
|
+
ダークモードでは黒影が機能しない(glow 方向が必要)ため、.dark 側は別途調整する。 */
|
|
103
|
+
:root {
|
|
104
|
+
--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
105
|
+
--shadow-md: 0 0 8px rgba(20, 20, 20, 0.08);
|
|
106
|
+
--shadow-lg: 0px 12px 32px -4px rgba(17, 24, 39, 0.12), 0px 8px 16px -6px rgba(17, 24, 39, 0.12);
|
|
107
|
+
--shadow-dialog: 0px 12px 32px -4px rgba(17, 24, 39, 0.12), 0px 8px 16px -6px rgba(17, 24, 39, 0.12), 0px 1px 4px 1px rgba(0, 0, 0, 0.2);
|
|
108
|
+
--shadow-tooltip: 0px 8px 8px -4px rgba(17, 24, 39, 0.08), 0px 4px 6px -4px rgba(17, 24, 39, 0.12);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* ─── Animation ─── */
|
|
112
|
+
@keyframes slide-in-right {
|
|
113
|
+
from { transform: translateX(100%); opacity: 0; }
|
|
114
|
+
to { transform: translateX(0); opacity: 1; }
|
|
115
|
+
}
|
|
116
|
+
@keyframes slide-in-left {
|
|
117
|
+
from { transform: translateX(-100%); opacity: 0; }
|
|
118
|
+
to { transform: translateX(0); opacity: 1; }
|
|
119
|
+
}
|
|
120
|
+
@keyframes fade-in {
|
|
121
|
+
from { opacity: 0; }
|
|
122
|
+
to { opacity: 1; }
|
|
123
|
+
}
|
|
124
|
+
@keyframes fade-in-up {
|
|
125
|
+
from { opacity: 0; transform: translateY(8px); }
|
|
126
|
+
to { opacity: 1; transform: translateY(0); }
|
|
127
|
+
}
|
|
128
|
+
@keyframes scale-in {
|
|
129
|
+
from { opacity: 0; transform: scale(0.95); }
|
|
130
|
+
to { opacity: 1; transform: scale(1); }
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@theme inline {
|
|
134
|
+
--animate-slide-in-right: slide-in-right 200ms ease-out;
|
|
135
|
+
--animate-slide-in-left: slide-in-left 200ms ease-out;
|
|
136
|
+
--animate-fade-in: fade-in 150ms ease-out;
|
|
137
|
+
--animate-fade-in-up: fade-in-up 200ms ease-out;
|
|
138
|
+
--animate-scale-in: scale-in 150ms ease-out;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* ─── Scrollbar Hide Utility ─── */
|
|
142
|
+
@utility scrollbar-hide {
|
|
143
|
+
-ms-overflow-style: none;
|
|
144
|
+
scrollbar-width: none;
|
|
145
|
+
&::-webkit-scrollbar {
|
|
146
|
+
display: none;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* ─── Base Layer: ボーダー / アウトライン色のセーフティネット ───
|
|
151
|
+
Tailwind CSS v4 の破壊的変更で、border / outline の既定色は
|
|
152
|
+
gray-200 ではなく `currentColor`(=要素の文字色)になった。
|
|
153
|
+
そのため `border` `border-b` のように「幅だけで色を指定しない」
|
|
154
|
+
クラスは、消費側が親に濃い文字色(例: --Text-High-Emphasis = #1C1A1A)
|
|
155
|
+
を敷くと枠線が黒ずむ。これを防ぐため、shadcn / 多くの DS と同じく
|
|
156
|
+
全要素のフォールバック色をテーマ追従の --border / --ring に固定する。
|
|
157
|
+
|
|
158
|
+
※ これは「保険」。コンポーネント側は引き続き
|
|
159
|
+
border-[var(--Border-Low-Emphasis)] のように明示色を指定すること
|
|
160
|
+
(明示色を持つ要素は utilities レイヤが base を上書きするため不変)。 */
|
|
161
|
+
@layer base {
|
|
162
|
+
*,
|
|
163
|
+
::after,
|
|
164
|
+
::before {
|
|
165
|
+
border-color: var(--border);
|
|
166
|
+
outline-color: var(--ring);
|
|
167
|
+
}
|
|
168
|
+
}
|