@cakejp/design-system 0.12.0 → 0.14.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/CHANGELOG.md +77 -0
- package/CLAUDE.md +12 -5
- package/MIGRATION.md +45 -0
- package/UPDATING.md +13 -0
- package/bin/check-duplicates.mjs +133 -9
- package/bin/exports-parser.mjs +54 -0
- package/bin/init.js +3 -0
- package/contracts/components.json +504 -209
- package/contracts/composition.json +11 -8
- package/contracts/rules.json +354 -113
- package/contracts/screen-patterns.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +4285 -3422
- package/dist/types/components/ec/admin-shell.d.ts +30 -2
- package/dist/types/components/ec/product-detail-sidebar.d.ts +1 -1
- package/dist/types/components/foundations/card.d.ts +27 -3
- package/dist/types/components/foundations/field.d.ts +26 -3
- package/dist/types/components/foundations/input.d.ts +3 -1
- package/dist/types/components/foundations/social-icon.d.ts +33 -0
- package/dist/types/components/foundations/textarea.d.ts +3 -1
- package/dist/types/components/primitives/chat-composer.d.ts +87 -0
- package/dist/types/components/primitives/combobox.d.ts +24 -0
- package/dist/types/components/primitives/content-carousel.d.ts +7 -1
- package/dist/types/components/primitives/date-picker.d.ts +15 -3
- package/dist/types/components/primitives/funnel-shell.d.ts +2 -0
- package/dist/types/components/primitives/image-input.d.ts +119 -0
- package/dist/types/components/primitives/multi-select.d.ts +24 -0
- package/dist/types/components/primitives/notification-badge.d.ts +1 -1
- package/dist/types/components/primitives/number-input.d.ts +84 -0
- package/dist/types/components/primitives/section-header.d.ts +9 -2
- package/dist/types/components/primitives/section.d.ts +35 -2
- package/dist/types/components/primitives/social-login-button.d.ts +3 -1
- package/dist/types/components/primitives/timeline.d.ts +23 -0
- package/dist/types/components/primitives/workspace-shell.d.ts +2 -0
- package/dist/types/index.d.ts +25 -7
- package/dist/types/lib/pagination-range.d.ts +16 -0
- package/dist/types/lib/use-value-length.d.ts +31 -0
- package/eslint/deprecated.js +44 -0
- package/package.json +8 -3
- package/scripts/codemod/README.md +14 -0
- package/scripts/codemod/template.mjs +62 -0
- package/src/components/COMPONENT_LOOKUP.md +166 -0
- package/src/preset-standalone.css +16 -0
- package/src/preset.css +17 -0
- package/src/styles/typography.css +7 -0
- package/templates/AGENTS.md +4 -0
- package/templates/CLAUDE.md +4 -0
- package/tokens.json +933 -87
- package/dist/types/components/primitives/quantity-selector.d.ts +0 -50
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# Component Lookup (AI必読)
|
|
2
|
+
|
|
3
|
+
> **このファイルは `node scripts/generate-component-lookup.mjs` で自動生成されています。手動編集しないでください。**
|
|
4
|
+
|
|
5
|
+
ページストーリーを書く前に、このファイルを確認して既存コンポーネントを必ず使うこと。
|
|
6
|
+
独自でコンポーネントを定義する(function Xxx)前に、ここに同等品がないか確認すること。
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Foundations Components (src/components/foundations/)
|
|
11
|
+
|
|
12
|
+
| Component | Import | Variants | Stories |
|
|
13
|
+
|-----------|--------|----------|---------|
|
|
14
|
+
| Accordion, AccordionItem, AccordionTrigger, AccordionContent | `@/components/foundations/accordion` | — | Default(単一展開), 複数展開, 商品ページFAQ例 |
|
|
15
|
+
| AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger | `@/components/foundations/alert-dialog` | — | Default, 破壊的操作(アカウント削除), コンパクトサイズ |
|
|
16
|
+
| Alert, AlertTitle, AlertDescription | `@/components/foundations/alert` | **variant**: `success`, `info`, `error`, `warning`, `inline-info`, `inline-caution`<br>**variant**: `success`, `info`, `error`, `warning`, `inline-info`, `inline-caution`, `inline-warning` | Success(成功), Info(お知らせ), Error(エラー), Warning(注意), Inline Info(インライン情報), Inline Caution(インラインエラー), Inline Warning(インライン警告), Prop-based Warning(旧 Banner 相当), Prop-based Error(エラー), Prop-based Info(お知らせ), Prop-based Success(成功), Prop-based with Action(アクション付き), Prop-based Inline Info(インライン情報), Prop-based Inline Caution(インラインエラー), Prop-based Inline Warning(インライン警告), Info + ボタン, Error(複数メッセージ), 全 Bordered バリアント, 全 Inline バリアント |
|
|
17
|
+
| AspectRatio | `@/components/foundations/aspect-ratio` | — | Square, Banner16x9, ProductImage4x3, RatioComparison |
|
|
18
|
+
| Avatar, AvatarImage, AvatarFallback, AvatarBadge, AvatarGroup, AvatarGroupCount | `@/components/foundations/avatar` | — | Default, フォールバック, サイズ比較, バッジ付き, グループ表示, レビュー表示例 |
|
|
19
|
+
| Badge | `@/components/foundations/badge` | **variant**: `default`, `destructive`, `success`, `info-subtle`, `success-subtle`, `accent-subtle`, `caution-subtle`, `warning-subtle`, `muted-subtle`, `secondary`, `outline`, `ghost` | Default(商品ハイライト), Secondary(カテゴリ), Success(成功・完了), Warning(注意), Destructive(エラー), Outline(枠線), WithIcon, 注文ステータス例, 全バリアント一覧 |
|
|
20
|
+
| Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis | `@/components/foundations/breadcrumb` | — | Default, 省略表示, 長いパス, 商品ページ例 |
|
|
21
|
+
| Button | `@/components/foundations/button` | **variant**: `default`, `secondary`, `tertiary`, `destructive`, `ghost` | Default(CTA), Secondary(副次的), Secondary(追加済み), Tertiary(低優先度), Ghost(透明), Destructive(破壊的), Link(リンク), Inverse(暗背景用 primary), Ghost Inverse(暗背景用 secondary), Inverse + Ghost Inverse(dark CTA 帯), Overlay(画像上), サイズ比較, XL(56px / rounded-18px), Hero(56px / pill), Large, FullWidth, Disabled(無効), Loading(読込中), WithIcon, IconOnly |
|
|
22
|
+
| Calendar, CalendarDayButton | `@/components/foundations/calendar` | — | Default, お届け日選択, 日付範囲選択 |
|
|
23
|
+
| Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent | `@/components/foundations/card` | **surface**: `default`, `primary` | Default, アクション付き, surface=, サーフェス文脈の伝播, 注文サマリー例 |
|
|
24
|
+
| CheckboxCardGroup, CheckboxCardItem | `@/components/foundations/checkbox-card` | — | Default, 説明付き, 無効状態, 展開コンテンツ付き, ギフトオプション選択例, アレルギー情報例, バッジ付き, エラー状態 |
|
|
25
|
+
| CheckboxGroup, CheckboxGroupItem | `@/components/foundations/checkbox-group` | — | Default, 選択済み, エラー, 非活性, ヘルプテキスト付き, 1カラム, 説明付き |
|
|
26
|
+
| Checkbox | `@/components/foundations/checkbox` | — | Default, チェック済み, 件数バッジ付き, 説明テキスト付き, 非活性, HoverState, filter sidebar 実用例, 素の Checkbox(label なし), エラーパターン, グループ例 |
|
|
27
|
+
| Collapsible, CollapsibleTrigger, CollapsibleContent | `@/components/foundations/collapsible` | — | Default, CouponCodeInput, OrderOptions |
|
|
28
|
+
| Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator | `@/components/foundations/command` | — | Default, ProductSearch, DeliveryOptions |
|
|
29
|
+
| ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup | `@/components/foundations/context-menu` | — | Default, WithCheckboxItems |
|
|
30
|
+
| DataTable, DataTableTable, DataTableHeader, DataTableBody, DataTableRow, DataTableHead, DataTableCell, DataTableAvatarCell, DataTableImageCell, DataTableLinkCell, DataTableCheckboxCell, DataTableActionCell, DataTableInputCell, DataTableSelectCell, DataTableNumberCell, DataTableDragHandleCell, DataTableBulkActions, DataTableSectionRow, DataTableAddRow, DataTableEmptyState | `@/components/foundations/data-table` | **state**: `default`, `selected`<br>**width**: `auto`, `max`, `hug`<br>**align**: `left`, `right`, `center` | Default, チェックボックス選択, タイトル固定, セクション, 空状態, 新規追加行, セル型バリエーション, 実用例(注文管理), 入力系セル一覧, ソートヘッダー, D&D並び替え |
|
|
31
|
+
| Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger | `@/components/foundations/dialog` | — | Default, 確認ダイアログ, フォーム入力 |
|
|
32
|
+
| Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription | `@/components/foundations/drawer` | — | Default, カート追加クイックビュー, お届け日選択 |
|
|
33
|
+
| DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent | `@/components/foundations/dropdown-menu` | — | Default, グループ付き, 注文アクション例 |
|
|
34
|
+
| Field, FieldLabel, FieldSet, FieldLegend, FieldGroup, FieldDescription, FieldError, FieldSeparator | `@/components/foundations/field` | — | フォーム一式, ラベル付き区切り, Field / FieldLabel(1フィールドの箱) |
|
|
35
|
+
| FileInput | `@/components/foundations/file-input` | — | Default, 複数選択 + accept, 無効, maxSize 超過エラー, FormField 連携 |
|
|
36
|
+
| Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField | `@/components/foundations/form` | — | RHF register / reset 統合, DeliveryAddressForm, ReviewForm, ContactForm, RHF: register() + 保存済みの初期値, RHF: Controller + 保存済みの初期値 |
|
|
37
|
+
| HoverCard, HoverCardTrigger, HoverCardContent | `@/components/foundations/hover-card` | — | Default, DeliveryInfo, RatingDetail |
|
|
38
|
+
| IconBadge | `@/components/foundations/icon-badge` | **size**: `md`, `ml`, `lg` | md(44px), ml(48px), lg(72px), サイズ比較, Card 内(間隔=Card の gap-4), リスト見出し(md) |
|
|
39
|
+
| Input | `@/components/foundations/input` | — | Default, WithLabel, Email, Password, Tel, Search, WithIcon, Disabled, Invalid(エラー), Textarea, フォーム例(配送先), 文字数カウンタ |
|
|
40
|
+
| Label | `@/components/foundations/label` | — | Default, 必須ラベル, ヘルプテキスト付き, 登録フォームパターン, エラーパターン |
|
|
41
|
+
| Menubar, MenubarPortal, MenubarMenu, MenubarTrigger, MenubarContent, MenubarGroup, MenubarSeparator, MenubarLabel, MenubarItem, MenubarShortcut, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarSub, MenubarSubTrigger, MenubarSubContent | `@/components/foundations/menubar` | — | Default, WithOptions |
|
|
42
|
+
| NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport | `@/components/foundations/navigation-menu` | — | Default, WithoutViewport |
|
|
43
|
+
| Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis | `@/components/foundations/pagination` | — | Default, 省略付き, 表示窓を自動計算, 最初のページ, 商品一覧ページ例 |
|
|
44
|
+
| Popover, PopoverTrigger, PopoverContent, PopoverAnchor, PopoverHeader, PopoverTitle, PopoverDescription | `@/components/foundations/popover` | — | Default, DeliveryDatePicker, AllergyInfo |
|
|
45
|
+
| Progress | `@/components/foundations/progress` | — | Default, 送料無料まで, 送料無料達成 |
|
|
46
|
+
| RadioGroup, RadioGroupItem | `@/components/foundations/radio-group` | — | Default, 説明付き, 選択済み, 無効状態, エラーパターン, 補足説明なし, 配送方法選択例, チップ型(choice chip), チップ型(制御・無効), チップ型(エラー), 支払い方法(クレカ入力済), 支払い方法(クレカ未入力) |
|
|
47
|
+
| ResponsiveDialog, ResponsiveDialogTrigger, ResponsiveDialogContent, ResponsiveDialogHeader, ResponsiveDialogFooter, ResponsiveDialogTitle, ResponsiveDialogDescription, ResponsiveDialogClose | `@/components/foundations/responsive-dialog` | — | 確認ダイアログ, フォーム入力, お知らせ(閉じるのみ) |
|
|
48
|
+
| ScrollArea, ScrollBar | `@/components/foundations/scroll-area` | — | Default, HorizontalTagScroll, OrderHistoryList |
|
|
49
|
+
| Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue | `@/components/foundations/select` | — | Default, ラベル付き, グループ分け, サイズ比較, 注文フォーム例, エラーパターン, 横並びパターン(氏名・住所), Input と並置(高さが揃う) |
|
|
50
|
+
| Separator | `@/components/foundations/separator` | — | Default(水平), 垂直, 注文確認ページ例 |
|
|
51
|
+
| Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription | `@/components/foundations/sheet` | — | Default, モバイルメニュー, 商品フィルター, スライド方向 |
|
|
52
|
+
| Skeleton | `@/components/foundations/skeleton` | — | Default, 円形(アバター用), 商品カードスケルトン, 商品グリッドスケルトン, レビュースケルトン, 商品詳細ページスケルトン |
|
|
53
|
+
| SkipLink | `@/components/foundations/skip-link` | — | Default, CustomTarget |
|
|
54
|
+
| Slider | `@/components/foundations/slider` | — | Default, PriceRangeFilter, ServingSizeSelector, RatingFilter |
|
|
55
|
+
| SocialIcon | `@/components/foundations/social-icon` | — | Brand, Mono |
|
|
56
|
+
| Toaster | `@/components/foundations/sonner` | — | Default, AddToCart, FavoriteAdded, StockError, OrderProcessing |
|
|
57
|
+
| Spinner | `@/components/foundations/spinner` | — | Default, Small, Large, InlineWithText, FullPage |
|
|
58
|
+
| Switch | `@/components/foundations/switch` | — | Default, ON 状態, 無効, サイズ比較, ブロック型, 通知設定例(リスト型) |
|
|
59
|
+
| Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption | `@/components/foundations/table` | — | Default, フッター付き, 商品比較例, カート注文サマリー |
|
|
60
|
+
| Tabs, TabsList, TabsTrigger, TabsContent | `@/components/foundations/tabs` | **variant**: `underbar`, `segment`<br>**scrollable**: `true` | Default(Underbar), タブ数バリエーション, 横スクロール(多数タブ), PC モード(文字幅ベース), Segment(ピル型), Segment 3択 |
|
|
61
|
+
| Textarea | `@/components/foundations/textarea` | — | Default, 無効, メッセージカード入力例, エラーパターン, レビュー投稿例, 文字数カウンタ |
|
|
62
|
+
| ToggleGroup, ToggleGroupItem | `@/components/foundations/toggle-group` | **width**: `fit`, `full`<br>**variant**: `default`, `outline`<br>**size**: `default`, `sm`, `lg`<br>**variant**: `default`, `outline`<br>**size**: `default`, `sm`, `lg` | Default, 複数選択, サイズ, アイコン付き, アイコンのみ, 無効 |
|
|
63
|
+
| Toggle | `@/components/foundations/toggle` | **variant**: `default`, `outline`<br>**size**: `default`, `sm`, `lg` | Default, TextFormatting, FavoriteToggle, Outline, Sizes |
|
|
64
|
+
| Tooltip, TooltipTrigger, TooltipContent, TooltipProvider | `@/components/foundations/tooltip` | — | Default, 表示位置, アイコンボタン例 |
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Primitives Components (src/components/primitives/)
|
|
69
|
+
|
|
70
|
+
| Component | Import | Variants | Stories |
|
|
71
|
+
|-----------|--------|----------|---------|
|
|
72
|
+
| AdminHeader | `@/components/primitives/admin-header` | — | — |
|
|
73
|
+
| AdminSideNav | `@/components/primitives/admin-side-nav` | — | — |
|
|
74
|
+
| BannerCarousel | `@/components/primitives/banner-carousel` | — | Default, SmallBanners, LargeBanners |
|
|
75
|
+
| BottomTabBar | `@/components/primitives/bottom-tab-bar` | — | Default(ホーム), アクティブ状態, バッジ付き, バッジオーバーフロー(99+), バナー付き, 記念日アクティブ |
|
|
76
|
+
| BulkActionBar | `@/components/primitives/bulk-action-bar` | — | — |
|
|
77
|
+
| CategoryScroll | `@/components/primitives/category-scroll` | — | Default, CircleThumbnails |
|
|
78
|
+
| CategoryShortcuts | `@/components/primitives/category-shortcuts` | — | Default, 選択あり, インタラクティブ(onClick), 商品一覧ページでの使用例 |
|
|
79
|
+
| ChatComposer | `@/components/primitives/chat-composer` | — | 基本, 添付あり, ⌘Enter 送信, 送信中, 無効化, 文字数カウンタ |
|
|
80
|
+
| Chip | `@/components/primitives/chip` | **variant**: `filled`, `accent`<br>**size**: `sm`, `md`, `lg`, `tile`<br>**shape**: `pill`, `square` | Default, 人気キーワード, 全バリアント, States(hover / disabled), サイズ比較, フィルター選択, 削除可能(選択済みフィルター), 検索画面での使用例 |
|
|
81
|
+
| CoachMark | `@/components/primitives/coach-mark` | — | オンボーディング, 全方向, オンボーディング各方向 |
|
|
82
|
+
| Combobox | `@/components/primitives/combobox` | — | Default |
|
|
83
|
+
| Container | `@/components/primitives/container` | — | Default(page / default gutter), サイズ比較, gutter 比較 |
|
|
84
|
+
| ContentCarousel | `@/components/primitives/content-carousel` | — | ヒーローバナー, 自動再生(5秒), peek表示, 多列カード(PC 3枚), 1枚のみ |
|
|
85
|
+
| DatePicker, DateTimePicker | `@/components/primitives/date-picker` | — | 日付ピッカー, 初期値あり, 選択範囲を制限, 特定日を無効化, FormField 連携, 無効化, クリア可能(任意項目) |
|
|
86
|
+
| EmptyState | `@/components/primitives/empty-state` | — | お気に入り商品(空), カート(空), ブックマーク(空), 検索結果なし, 汎用(説明のみ) |
|
|
87
|
+
| ErrorState, NotFoundIllustration | `@/components/primitives/error-state` | — | ネットワークエラー, サーバーエラー, ページが見つからない, タイムアウト, 404(notFound variant), 404(文言上書き), イラスト単体 |
|
|
88
|
+
| FilterBar | `@/components/primitives/filter-bar` | — | SP, SP(選択済み), PC, 地域フィルター, もっと絞り込む |
|
|
89
|
+
| Footer | `@/components/primitives/footer` | — | Default, 最小構成, SNSリンク付き, 決済方法付き |
|
|
90
|
+
| FormField | `@/components/primitives/form-field` | — | — |
|
|
91
|
+
| FunnelShell | `@/components/primitives/funnel-shell` | — | 注文内容の確認(ご購入手続き) |
|
|
92
|
+
| Header | `@/components/primitives/header` | — | ロゴ+アクション, ロゴ+未ログイン, ロゴ+グローバルナビ+検索スロット(PC), ロゴセンター(決済・申し込み用), 戻る+タイトル, 戻る+検索バー, 戻る+右側アクション, カスタムロゴ |
|
|
93
|
+
| ImageCarousel | `@/components/primitives/image-carousel` | — | バナーカルーセル, 横長バナー, 正方形(商品画像), OGP比率, 自動再生(3秒), PC幅(ビューポート切替で確認), トップページ ヒーローバナー |
|
|
94
|
+
| ImageGallery | `@/components/primitives/image-gallery` | — | ドット付き, サムネイル付き, バナー(16:9), PC商品詳細, 単一画像 |
|
|
95
|
+
| ImageInput | `@/components/primitives/image-input` | **aspect**: `square`, `landscape`<br>**size**: `sm`, `md`, `lg` | 基本, 保存済み画像あり, 表示サイズ, FormField 連携, 検証エラー, クリア不可, 無効化 |
|
|
96
|
+
| ImageUploader | `@/components/primitives/image-uploader` | — | — |
|
|
97
|
+
| KebabMenu | `@/components/primitives/kebab-menu` | — | — |
|
|
98
|
+
| ListItem | `@/components/primitives/list-item` | — | デフォルト(矢印), キャプション付き, アイコン付き, テキスト値, バッジ付き, トグル, 矢印なし, 選択状態, メニューリスト(複数行), アイコン付きメニュー, インタラクティブ(hover / focus) |
|
|
99
|
+
| MenuDrawer | `@/components/primitives/menu-drawer` | — | デフォルト(最小構成), ログイン済 (ユーザー名表示), 未ログイン (ログインボタン表示), サムネイル付きカテゴリ, バナー付き, 全部入り (大規模アプリ向け), ログインリンク非表示 |
|
|
100
|
+
| MultiSelect | `@/components/primitives/multi-select` | — | Default |
|
|
101
|
+
| NotificationBadge | `@/components/primitives/notification-badge` | **color**: `red`, `green`<br>**size**: `sm`, `md` | Default, ドットバッジ, 数値バッジ, カラーバリエーション, ヘッダーでの使用例, 非表示状態 |
|
|
102
|
+
| NotificationList | `@/components/primitives/notification-list` | — | デフォルト, 横並び(管理画面向け), 空の状態 |
|
|
103
|
+
| NumberInput, QuantitySelector | `@/components/primitives/number-input` | — | Default, コンパクト型(sm), サイズ比較, 最小・最大値, 無効状態, エラー状態, ゴミ箱アイコン, ゴミ箱+削除確認ダイアログ, 直接入力パターン, 商品詳細での使用例, カート内での使用例, 価格・在庫入力(管理画面) |
|
|
104
|
+
| PriceDisplay | `@/components/primitives/price-display` | — | Default, セール価格, サイズ比較, セール × サイズ, 税込ラベルなし, 高額商品, 価格レンジ |
|
|
105
|
+
| ProgressSteps | `@/components/primitives/progress-steps` | — | ステップ1(カート), ステップ2(注文内容), ステップ3(確認), ステップ4(完了), 全ステップ一覧, 会員登録フロー |
|
|
106
|
+
| SearchBar | `@/components/primitives/search-bar` | — | Default, Small(ヘッダー向け), カスタムプレースホルダー |
|
|
107
|
+
| SearchPanel | `@/components/primitives/search-panel` | — | — |
|
|
108
|
+
| SectionHeader | `@/components/primitives/section-header` | — | Default, サブタイトル付き, リンクなし, カスタムラベル, カルーセルナビ付き, ナビのみ, ナビ(先頭位置), アクションボタン付き, サブタイトル + アクション, サイズ一覧, キャプション付きサイズ比較, align=, LPヒーロー(SP 3xl / PC 5xl), align=, start / center 比較 |
|
|
109
|
+
| SectionNav | `@/components/primitives/section-nav` | — | Vertical, Horizontal |
|
|
110
|
+
| Section | `@/components/primitives/section` | — | 推奨: Section + Container, 背景画像 + scrim, 背景バリアント, 縦 spacing バリアント, 配下 Card のサーフェス伝播, ランディング見出し |
|
|
111
|
+
| ShareButtons | `@/components/primitives/share-buttons` | — | Default, コピーフィードバック |
|
|
112
|
+
| SideNav | `@/components/primitives/side-nav` | — | Default, WithGroupLabels, MypageExample, PrefixMatch |
|
|
113
|
+
| SocialLoginButton | `@/components/primitives/social-login-button` | — | LINE, フルサイズ一覧, アイコンのみ |
|
|
114
|
+
| StandardPageShell | `@/components/primitives/standard-page-shell` | — | 検索結果ページ |
|
|
115
|
+
| StatusCountTabs | `@/components/primitives/status-count-tabs` | — | — |
|
|
116
|
+
| StickyActionBar | `@/components/primitives/sticky-action-bar` | — | SingleButton, TwoButtons, WithPrice |
|
|
117
|
+
| SubNav | `@/components/primitives/sub-nav` | — | テキスト(本番準拠), チップ型, アクティブなし |
|
|
118
|
+
| Tag | `@/components/primitives/tag` | **variant**: `default`, `caution`, `sale`, `warning`, `info`, `info-fill`, `success`, `accent`, `timesale`, `berry`, `coupon`<br>**size**: `sm`, `md` | Default, 全バリアント一覧, サイズ比較, アイコン付き, 配送方法タグ, 商品カード内の例 |
|
|
119
|
+
| Timeline | `@/components/primitives/timeline` | — | Default, カスタムマーカー |
|
|
120
|
+
| WorkspaceShell | `@/components/primitives/workspace-shell` | — | 集中編集ワークスペース, ヘッダー中央寄せ(headerLayout=center), 1カラム集中編集 |
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## EC Components (src/components/ec/)
|
|
125
|
+
|
|
126
|
+
| Component | Import | Variants | Stories |
|
|
127
|
+
|-----------|--------|----------|---------|
|
|
128
|
+
| MissingComponent, AdminShell | `@/components/ec/admin-shell` | — | 管理画面の骨格, 他ブランドでの再利用(brand / sidebarHeader 差し替え), 長いレールラベル |
|
|
129
|
+
| AnniversaryCard | `@/components/ec/anniversary-card` | — | — |
|
|
130
|
+
| CakeLogo | `@/components/ec/cake-logo` | — | Default, カラー, ヘッダー配置例 |
|
|
131
|
+
| ChartControls | `@/components/ec/chart-controls` | — | Default, WithPreviousPeriod, Interactive, InCard |
|
|
132
|
+
| CountdownTimer | `@/components/ec/countdown-timer` | — | 開始前, 開催中, 終了後, 全バリエーション |
|
|
133
|
+
| CouponCard | `@/components/ec/coupon-card` | — | 縦型 / 獲得可能, 縦型 / 獲得済み, 縦型 / 獲得不可, 縦型 / 画像なし, SP横長 / 獲得可能, SP横長 / 獲得済み, SP横長 / お店限定クーポン一覧, 縦型 / 一覧 |
|
|
134
|
+
| DeliveryCalendar | `@/components/ec/delivery-calendar` | — | デフォルト, 日付選択あり, 3月 |
|
|
135
|
+
| MypageShell | `@/components/ec/mypage-shell` | — | ブックマークした商品, 他ブランドでの再利用(logo / navItems 差し替え) |
|
|
136
|
+
| OrderSection | `@/components/ec/order-section` | — | 入力済み, 未入力, エラー, 購入確認画面 |
|
|
137
|
+
| OrderSummary | `@/components/ec/order-summary` | — | カート合計, チェックアウト合計, クーポン適用時, 合計のみ |
|
|
138
|
+
| PaymentMethodDisplay, CreditCardIcon | `@/components/ec/payment-method` | — | 登録済み, 未登録, 期限切れ, 対応ブランド一覧, カードブランドアイコン |
|
|
139
|
+
| ProductCard, BookmarkRibbonIcon | `@/components/ec/product-card` | — | ストロベリーショートケーキ 5号(15cm), お気に入りボタン付き, タグ付き, ランキング, 配送日表示, 規格・仕様キャプション, 横向き, グリッドレイアウト(標準コンテナクエリ), 割引バッジ, カートボタン付き, ショップ名リンク付き, 最小構成 |
|
|
140
|
+
| ProductCarousel | `@/components/ec/product-carousel` | — | Default, WithRanking, LargeCards, WithSectionImage, WithDescription, WithCartButton |
|
|
141
|
+
| ProductCTA | `@/components/ec/product-cta` | — | カートに追加, タイムセール中, 完売, 全バリエーション |
|
|
142
|
+
| ProductDetailBar | `@/components/ec/product-detail-bar` | — | — |
|
|
143
|
+
| ProductDetailSidebar | `@/components/ec/product-detail-sidebar` | — | フルセット(未作成ハイライト), 最小構成, クーポンなし, ブックマーク済み |
|
|
144
|
+
| ProductListItem | `@/components/ec/product-list-item` | — | デフォルト, 規格・仕様キャプション, 小サイズ, レビュー画面, 注文履歴, レビュー付き, 広告掲載, 一覧表示, レビュー画面一覧, カート, カート(小計付き), カート一覧 |
|
|
145
|
+
| ProductOption, OptionQuantity, OptionSelect, OptionText, OptionImageUpload | `@/components/ec/product-option` | — | 数量選択, プルダウン選択, テキスト入力, チェックボックス, 画像アップロード, 全オプション一覧 |
|
|
146
|
+
| RatingStars, SparkleIcon | `@/components/ec/rating-stars` | — | Default, サイズ比較, 評価値バリエーション, 件数なし, アイコンのみ, 大量レビュー |
|
|
147
|
+
| ReviewCard | `@/components/ec/review-card` | — | リスト(SP), リスト(いいね済み), カード(商品付き), カード(商品なし), PC, 画像なし, インタラクティブ |
|
|
148
|
+
| ReviewForm | `@/components/ec/review-form` | — | デフォルト, 商品ヘッダーなし, 入力済み, 送信中, キャンセルなし |
|
|
149
|
+
| ReviewSummary, ReviewItem | `@/components/ec/review-summary` | — | レビュー集計, 簡易集計, レビュー一覧 |
|
|
150
|
+
| ShopCard | `@/components/ec/shop-card` | — | デフォルト, コンパクト, ルビ付き, グリッド表示 |
|
|
151
|
+
| StatCard | `@/components/ec/stat-card` | — | — |
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## よくある間違い
|
|
156
|
+
|
|
157
|
+
| やっていたこと(禁止) | 正しい書き方 |
|
|
158
|
+
|---|---|
|
|
159
|
+
| `function SectionHeader()` を story 内で定義 | `import { SectionHeader } from '@/components/primitives/section-header'` |
|
|
160
|
+
| `function FieldRow()` を定義してラベル+入力表示 | `import { FormField } from '@/components/primitives/form-field'` |
|
|
161
|
+
| `<div className="rounded-xl bg-[var(--Surface-Primary)] border p-4">` | `<Card><CardContent className="p-4">` |
|
|
162
|
+
| `<button className="...">` でボタンを作成 | `<Button variant="..." size="...">` |
|
|
163
|
+
| `function StarRating()` を定義 | `import { RatingStars } from '@/components/ec/rating-stars'` |
|
|
164
|
+
| `function CartSummaryTable()` を定義 | `import { OrderSummary } from '@/components/ec/order-summary'` |
|
|
165
|
+
| 数量変更の +/- ボタンを raw button で実装 | `import { QuantitySelector } from '@/components/primitives/quantity-selector'` |
|
|
166
|
+
| 配送切替を `ToggleGroup` で実装 | `<Tabs variant="segment">` で Segment(ピル型)タブを使う |
|
|
@@ -405,6 +405,7 @@
|
|
|
405
405
|
*/
|
|
406
406
|
|
|
407
407
|
/* Heading */
|
|
408
|
+
.typo-heading-5xl { font-size: 40px; line-height: 1.35; letter-spacing: 0.04em; font-weight: 700; }
|
|
408
409
|
.typo-heading-4xl { font-size: 32px; line-height: 1.4; letter-spacing: 0.04em; font-weight: 700; }
|
|
409
410
|
.typo-heading-3xl { font-size: 28px; line-height: 1.5; letter-spacing: 0.04em; font-weight: 700; }
|
|
410
411
|
.typo-heading-2xl { font-size: 24px; line-height: 1.5; letter-spacing: 0.04em; font-weight: 700; }
|
|
@@ -424,3 +425,18 @@
|
|
|
424
425
|
.typo-label-md { font-size: 14px; line-height: 1.5; letter-spacing: 0.04em; font-weight: 700; }
|
|
425
426
|
.typo-label-sm { font-size: 12px; line-height: 1.5; font-weight: 500; }
|
|
426
427
|
.typo-label-xs { font-size: 10px; line-height: 1.5; font-weight: 500; }
|
|
428
|
+
|
|
429
|
+
/* --- Touch target utility ---
|
|
430
|
+
* Tailwind を使わない consumer でも preset と同じ44px操作領域を利用できる。 */
|
|
431
|
+
.tap-target {
|
|
432
|
+
position: relative;
|
|
433
|
+
}
|
|
434
|
+
.tap-target::after {
|
|
435
|
+
content: "";
|
|
436
|
+
position: absolute;
|
|
437
|
+
top: 50%;
|
|
438
|
+
left: 50%;
|
|
439
|
+
width: max(100%, 2.75rem);
|
|
440
|
+
height: max(100%, 2.75rem);
|
|
441
|
+
transform: translate(-50%, -50%);
|
|
442
|
+
}
|
package/src/preset.css
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* - Tailwind 標準色 → Cake.jp マッピング(bg-red-600 等)
|
|
19
19
|
* - シャドウ・角丸トークン
|
|
20
20
|
* - アニメーションユーティリティ
|
|
21
|
+
* - 見た目を変えず44pxの操作領域を確保する tap-target ユーティリティ
|
|
21
22
|
* ============================================ */
|
|
22
23
|
|
|
23
24
|
/* --- Layer 1: Primitive Colors --- */
|
|
@@ -302,6 +303,22 @@
|
|
|
302
303
|
animation: slide-in-left 200ms ease-out;
|
|
303
304
|
}
|
|
304
305
|
|
|
306
|
+
/* --- Touch target utility ---
|
|
307
|
+
* 見た目が44px未満の小型操作部品に付け、透明な疑似要素で実効操作領域だけを拡張する。
|
|
308
|
+
* 隣接ターゲットと重なる密度では使わず、親レイアウト側の gap も確保する。 */
|
|
309
|
+
.tap-target {
|
|
310
|
+
position: relative;
|
|
311
|
+
}
|
|
312
|
+
.tap-target::after {
|
|
313
|
+
content: "";
|
|
314
|
+
position: absolute;
|
|
315
|
+
top: 50%;
|
|
316
|
+
left: 50%;
|
|
317
|
+
width: max(100%, 2.75rem);
|
|
318
|
+
height: max(100%, 2.75rem);
|
|
319
|
+
transform: translate(-50%, -50%);
|
|
320
|
+
}
|
|
321
|
+
|
|
305
322
|
/* --- Base layer --- */
|
|
306
323
|
@layer base {
|
|
307
324
|
* {
|
|
@@ -32,6 +32,13 @@
|
|
|
32
32
|
|
|
33
33
|
/* ─── Heading ─── */
|
|
34
34
|
|
|
35
|
+
@utility typo-heading-5xl {
|
|
36
|
+
font-size: 2.5rem; /* 40px */
|
|
37
|
+
line-height: 1.35; /* 54px */
|
|
38
|
+
letter-spacing: 0.04em;
|
|
39
|
+
font-weight: 700;
|
|
40
|
+
}
|
|
41
|
+
|
|
35
42
|
@utility typo-heading-4xl {
|
|
36
43
|
font-size: 2rem; /* 32px */
|
|
37
44
|
line-height: 1.4; /* 44.8px */
|
package/templates/AGENTS.md
CHANGED
|
@@ -13,10 +13,12 @@ Codex(および他の AI エージェント)は UI 作業を始める前に
|
|
|
13
13
|
|---------|------|
|
|
14
14
|
| `node_modules/@cakejp/design-system/CLAUDE.md` | DS 利用ガイド・禁止パターン |
|
|
15
15
|
| `node_modules/@cakejp/design-system/contracts/components.json` | 全コンポーネントの定義・バリアント |
|
|
16
|
+
| `node_modules/@cakejp/design-system/src/components/COMPONENT_LOOKUP.md` | 125コンポーネントの軽量な早見表 |
|
|
16
17
|
| `node_modules/@cakejp/design-system/contracts/rules.json` | 禁止パターン・アクセシビリティ要件 |
|
|
17
18
|
| `node_modules/@cakejp/design-system/tokens.json` | カラー・余白・角丸・影・タイポ |
|
|
18
19
|
|
|
19
20
|
> DS 側のルール更新は `npm update @cakejp/design-system` で自動反映されます。このファイルは書き換え不要。
|
|
21
|
+
> 旧exportの残存は `@cakejp/design-system/eslint/deprecated` の `no-deprecated` ルールで継続検出できます。
|
|
20
22
|
|
|
21
23
|
## ❌ 書く前に必ず確認するパターン
|
|
22
24
|
|
|
@@ -41,6 +43,8 @@ DS に該当パターンが無い場合のみカスタム実装を許可。そ
|
|
|
41
43
|
3. それでも無ければ、手元に台帳を作らず **flashpark/cake-design-system に issue を立てる**。
|
|
42
44
|
4. やむを得ずローカル実装する場合は、「DS に X が追加されたら削除」の条件コメントを必ず添える。
|
|
43
45
|
|
|
46
|
+
**意図的にローカル実装を残すとき(check-duplicates の抑制)**: 対象 export の直前のコメント行(または行末コメント)に `// cakejp-ds-allow-duplicate: <理由>` を書くと、その 1 件だけ検出から外れる。**理由が空なら抑制されない**(形骸化防止)。抑制した件数と理由はサマリに出るので、`--strict` を CI に入れたまま運用できる。
|
|
47
|
+
|
|
44
48
|
## 使用方法
|
|
45
49
|
|
|
46
50
|
### CSS のセットアップ(重要)
|
package/templates/CLAUDE.md
CHANGED
|
@@ -13,12 +13,14 @@ Codex(および他の AI エージェント)は UI 作業を始める前に
|
|
|
13
13
|
|---------|------|
|
|
14
14
|
| `node_modules/@cakejp/design-system/CLAUDE.md` | DS 利用ガイド・禁止パターン |
|
|
15
15
|
| `node_modules/@cakejp/design-system/contracts/components.json` | 全コンポーネントの定義・バリアント |
|
|
16
|
+
| `node_modules/@cakejp/design-system/src/components/COMPONENT_LOOKUP.md` | 125コンポーネントの軽量な早見表 |
|
|
16
17
|
| `node_modules/@cakejp/design-system/contracts/screen-patterns.json` | 画面パターン判断基準(CRUD・編集/作成/削除UIの選択) |
|
|
17
18
|
| `node_modules/@cakejp/design-system/contracts/composition.json` | ページ骨格・余白リズム・視覚階層の組み方 |
|
|
18
19
|
| `node_modules/@cakejp/design-system/contracts/rules.json` | 禁止パターン・アクセシビリティ要件 |
|
|
19
20
|
| `node_modules/@cakejp/design-system/tokens.json` | カラー・余白・角丸・影・タイポ |
|
|
20
21
|
|
|
21
22
|
> DS 側のルール更新は `npm update @cakejp/design-system` で自動反映されます。このファイルは書き換え不要。
|
|
23
|
+
> 旧exportの残存は `@cakejp/design-system/eslint/deprecated` の `no-deprecated` ルールで継続検出できます。
|
|
22
24
|
|
|
23
25
|
## ❌ 書く前に必ず確認するパターン
|
|
24
26
|
|
|
@@ -43,6 +45,8 @@ DS に該当パターンが無い場合のみカスタム実装を許可。そ
|
|
|
43
45
|
3. それでも無ければ、手元に台帳を作らず **flashpark/cake-design-system に issue を立てる**。
|
|
44
46
|
4. やむを得ずローカル実装する場合は、「DS に X が追加されたら削除」の条件コメントを必ず添える。
|
|
45
47
|
|
|
48
|
+
**意図的にローカル実装を残すとき(check-duplicates の抑制)**: 対象 export の直前のコメント行(または行末コメント)に `// cakejp-ds-allow-duplicate: <理由>` を書くと、その 1 件だけ検出から外れる。**理由が空なら抑制されない**(形骸化防止)。抑制した件数と理由はサマリに出るので、`--strict` を CI に入れたまま運用できる。
|
|
49
|
+
|
|
46
50
|
## 使用方法
|
|
47
51
|
|
|
48
52
|
### CSS のセットアップ(重要)
|