@cakejp/design-system 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/AGENTS.md +144 -0
  2. package/CHANGELOG.md +115 -0
  3. package/CLAUDE.md +188 -0
  4. package/CLAUDE_PRODUCTION.md +121 -0
  5. package/MIGRATION.md +228 -0
  6. package/README.md +79 -0
  7. package/RELEASE.md +205 -0
  8. package/bin/init.js +134 -0
  9. package/component-registry.json +1146 -0
  10. package/contracts/components.json +730 -0
  11. package/contracts/rules.json +559 -0
  12. package/dist/index.css +1 -0
  13. package/dist/index.js +9344 -0
  14. package/dist/types/components/ec/_mypage-menu-data.d.ts +15 -0
  15. package/dist/types/components/ec/admin-layout.d.ts +31 -0
  16. package/dist/types/components/ec/anniversary-card.d.ts +50 -0
  17. package/dist/types/components/ec/cake-logo.d.ts +22 -0
  18. package/dist/types/components/ec/chart-controls.d.ts +16 -0
  19. package/dist/types/components/ec/countdown-timer.d.ts +24 -0
  20. package/dist/types/components/ec/coupon-card.d.ts +47 -0
  21. package/dist/types/components/ec/delivery-calendar.d.ts +36 -0
  22. package/dist/types/components/ec/order-section.d.ts +29 -0
  23. package/dist/types/components/ec/order-summary.d.ts +36 -0
  24. package/dist/types/components/ec/payment-method.d.ts +41 -0
  25. package/dist/types/components/ec/product-card.d.ts +77 -0
  26. package/dist/types/components/ec/product-carousel.d.ts +56 -0
  27. package/dist/types/components/ec/product-cta.d.ts +35 -0
  28. package/dist/types/components/ec/product-detail-bar.d.ts +62 -0
  29. package/dist/types/components/ec/product-detail-sidebar.d.ts +115 -0
  30. package/dist/types/components/ec/product-list-item.d.ts +90 -0
  31. package/dist/types/components/ec/product-option.d.ts +62 -0
  32. package/dist/types/components/ec/rating-stars.d.ts +30 -0
  33. package/dist/types/components/ec/review-card.d.ts +44 -0
  34. package/dist/types/components/ec/review-form.d.ts +40 -0
  35. package/dist/types/components/ec/review-summary.d.ts +53 -0
  36. package/dist/types/components/ec/shop-card.d.ts +48 -0
  37. package/dist/types/components/ec/stat-card.d.ts +44 -0
  38. package/dist/types/components/foundations/accordion.d.ts +7 -0
  39. package/dist/types/components/foundations/alert-dialog.d.ts +18 -0
  40. package/dist/types/components/foundations/alert.d.ts +42 -0
  41. package/dist/types/components/foundations/aspect-ratio.d.ts +3 -0
  42. package/dist/types/components/foundations/avatar.d.ts +11 -0
  43. package/dist/types/components/foundations/badge.d.ts +9 -0
  44. package/dist/types/components/foundations/breadcrumb.d.ts +11 -0
  45. package/dist/types/components/foundations/button.d.ts +10 -0
  46. package/dist/types/components/foundations/calendar.d.ts +8 -0
  47. package/dist/types/components/foundations/card.d.ts +9 -0
  48. package/dist/types/components/foundations/checkbox-card.d.ts +30 -0
  49. package/dist/types/components/foundations/checkbox-group.d.ts +53 -0
  50. package/dist/types/components/foundations/checkbox.d.ts +4 -0
  51. package/dist/types/components/foundations/collapsible.d.ts +5 -0
  52. package/dist/types/components/foundations/command.d.ts +18 -0
  53. package/dist/types/components/foundations/context-menu.d.ts +25 -0
  54. package/dist/types/components/foundations/data-table.d.ts +104 -0
  55. package/dist/types/components/foundations/dialog.d.ts +17 -0
  56. package/dist/types/components/foundations/drawer.d.ts +13 -0
  57. package/dist/types/components/foundations/dropdown-menu.d.ts +25 -0
  58. package/dist/types/components/foundations/form.d.ts +24 -0
  59. package/dist/types/components/foundations/hover-card.d.ts +6 -0
  60. package/dist/types/components/foundations/input.d.ts +3 -0
  61. package/dist/types/components/foundations/label.d.ts +7 -0
  62. package/dist/types/components/foundations/menubar.d.ts +26 -0
  63. package/dist/types/components/foundations/navigation-menu.d.ts +14 -0
  64. package/dist/types/components/foundations/pagination.d.ts +13 -0
  65. package/dist/types/components/foundations/popover.d.ts +10 -0
  66. package/dist/types/components/foundations/progress.d.ts +4 -0
  67. package/dist/types/components/foundations/radio-group.d.ts +9 -0
  68. package/dist/types/components/foundations/responsive-dialog.d.ts +52 -0
  69. package/dist/types/components/foundations/scroll-area.d.ts +5 -0
  70. package/dist/types/components/foundations/select.d.ts +15 -0
  71. package/dist/types/components/foundations/separator.d.ts +4 -0
  72. package/dist/types/components/foundations/sheet.d.ts +14 -0
  73. package/dist/types/components/foundations/skeleton.d.ts +2 -0
  74. package/dist/types/components/foundations/slider.d.ts +4 -0
  75. package/dist/types/components/foundations/sonner.d.ts +3 -0
  76. package/dist/types/components/foundations/spinner.d.ts +6 -0
  77. package/dist/types/components/foundations/switch.d.ts +13 -0
  78. package/dist/types/components/foundations/table.d.ts +10 -0
  79. package/dist/types/components/foundations/tabs.d.ts +12 -0
  80. package/dist/types/components/foundations/textarea.d.ts +3 -0
  81. package/dist/types/components/foundations/toggle-group.d.ts +23 -0
  82. package/dist/types/components/foundations/toggle.d.ts +9 -0
  83. package/dist/types/components/foundations/tooltip.d.ts +7 -0
  84. package/dist/types/components/pages/cake/_mypage-shell.d.ts +41 -0
  85. package/dist/types/components/primitives/banner-carousel.d.ts +54 -0
  86. package/dist/types/components/primitives/bottom-tab-bar.d.ts +39 -0
  87. package/dist/types/components/primitives/bulk-action-bar.d.ts +32 -0
  88. package/dist/types/components/primitives/category-scroll.d.ts +70 -0
  89. package/dist/types/components/primitives/category-shortcuts.d.ts +44 -0
  90. package/dist/types/components/primitives/chip.d.ts +44 -0
  91. package/dist/types/components/primitives/coach-mark.d.ts +28 -0
  92. package/dist/types/components/primitives/empty-state.d.ts +36 -0
  93. package/dist/types/components/primitives/error-state.d.ts +41 -0
  94. package/dist/types/components/primitives/filter-bar.d.ts +56 -0
  95. package/dist/types/components/primitives/footer.d.ts +81 -0
  96. package/dist/types/components/primitives/form-field.d.ts +46 -0
  97. package/dist/types/components/primitives/header.d.ts +69 -0
  98. package/dist/types/components/primitives/image-carousel.d.ts +52 -0
  99. package/dist/types/components/primitives/image-gallery.d.ts +35 -0
  100. package/dist/types/components/primitives/image-uploader.d.ts +19 -0
  101. package/dist/types/components/primitives/kebab-menu.d.ts +38 -0
  102. package/dist/types/components/primitives/list-item.d.ts +60 -0
  103. package/dist/types/components/primitives/menu-drawer.d.ts +75 -0
  104. package/dist/types/components/primitives/notification-badge.d.ts +30 -0
  105. package/dist/types/components/primitives/notification-list.d.ts +45 -0
  106. package/dist/types/components/primitives/price-display.d.ts +33 -0
  107. package/dist/types/components/primitives/progress-steps.d.ts +27 -0
  108. package/dist/types/components/primitives/quantity-selector.d.ts +50 -0
  109. package/dist/types/components/primitives/search-bar.d.ts +31 -0
  110. package/dist/types/components/primitives/search-panel.d.ts +41 -0
  111. package/dist/types/components/primitives/section-header.d.ts +51 -0
  112. package/dist/types/components/primitives/share-buttons.d.ts +23 -0
  113. package/dist/types/components/primitives/side-nav.d.ts +62 -0
  114. package/dist/types/components/primitives/social-login-button.d.ts +24 -0
  115. package/dist/types/components/primitives/status-count-tabs.d.ts +14 -0
  116. package/dist/types/components/primitives/sticky-action-bar.d.ts +7 -0
  117. package/dist/types/components/primitives/sub-nav.d.ts +34 -0
  118. package/dist/types/components/primitives/tag.d.ts +19 -0
  119. package/dist/types/index.d.ts +109 -0
  120. package/dist/types/lib/utils.d.ts +2 -0
  121. package/package.json +186 -0
  122. package/scripts/codemod/check-migration.mjs +97 -0
  123. package/scripts/codemod/v0.2-to-v0.3.mjs +192 -0
  124. package/src/preset-standalone.css +109 -0
  125. package/src/preset.css +288 -0
  126. package/src/styles/primitive.css +139 -0
  127. package/src/styles/semantic.css +203 -0
  128. package/src/styles/typography.css +129 -0
  129. package/templates/AGENTS.md +56 -0
  130. package/templates/CLAUDE.md +56 -0
  131. package/tokens.json +127 -0
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ interface SpinnerProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ size?: "sm" | "md" | "lg";
4
+ }
5
+ declare function Spinner({ className, size, ...props }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
6
+ export { Spinner };
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import { Switch as SwitchPrimitive } from "radix-ui";
3
+ /**
4
+ * トグルスイッチ(Airbnb風)
5
+ *
6
+ * - checked: ダーク背景 + 白丸にチェックマーク
7
+ * - unchecked: グレー背景 + 白丸
8
+ * - サイズ: default (32×52px) / sm (24×40px)
9
+ */
10
+ declare function Switch({ className, size, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root> & {
11
+ size?: "sm" | "default";
12
+ }): import("react/jsx-runtime").JSX.Element;
13
+ export { Switch };
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ declare function Table({ className, ...props }: React.ComponentProps<"table">): import("react/jsx-runtime").JSX.Element;
3
+ declare function TableHeader({ className, ...props }: React.ComponentProps<"thead">): import("react/jsx-runtime").JSX.Element;
4
+ declare function TableBody({ className, ...props }: React.ComponentProps<"tbody">): import("react/jsx-runtime").JSX.Element;
5
+ declare function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">): import("react/jsx-runtime").JSX.Element;
6
+ declare function TableRow({ className, ...props }: React.ComponentProps<"tr">): import("react/jsx-runtime").JSX.Element;
7
+ declare function TableHead({ className, ...props }: React.ComponentProps<"th">): import("react/jsx-runtime").JSX.Element;
8
+ declare function TableCell({ className, ...props }: React.ComponentProps<"td">): import("react/jsx-runtime").JSX.Element;
9
+ declare function TableCaption({ className, ...props }: React.ComponentProps<"caption">): import("react/jsx-runtime").JSX.Element;
10
+ export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ import { Tabs as TabsPrimitive } from "radix-ui";
4
+ declare function Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
5
+ declare const tabsListVariants: (props?: {
6
+ variant?: "underbar" | "segment";
7
+ scrollable?: boolean;
8
+ } & import("class-variance-authority/types").ClassProp) => string;
9
+ declare function TabsList({ className, variant, scrollable, ...props }: React.ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>): import("react/jsx-runtime").JSX.Element;
10
+ declare function TabsTrigger({ className, children, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
11
+ declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
12
+ export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare function Textarea({ className, ...props }: React.ComponentProps<"textarea">): import("react/jsx-runtime").JSX.Element;
3
+ export { Textarea };
@@ -0,0 +1,23 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
4
+ /**
5
+ * ChipGroup / チップグループ
6
+ *
7
+ * Figma: ChipGroup (node 14538:1053)
8
+ *
9
+ * 横並びのピル型チップで選択肢を切り替えるコンポーネント。
10
+ * コンテナは水平 flex、gap-1.5 (6px)、py-1.5。
11
+ * ※ コンテナに横パディング(px-*)は含めない。親要素の px で制御すること。
12
+ * 各チップは rounded-full、h-9 (36px)、px-3、typo-label-md (14px bold)。
13
+ */
14
+ declare const toggleGroupVariants: (props?: {
15
+ width?: "fit" | "full";
16
+ } & import("class-variance-authority/types").ClassProp) => string;
17
+ declare const toggleGroupItemVariants: (props?: {
18
+ variant?: "default" | "outline";
19
+ size?: "default" | "sm" | "lg";
20
+ } & import("class-variance-authority/types").ClassProp) => string;
21
+ declare function ToggleGroup({ className, variant, size, width, children, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleGroupVariants> & VariantProps<typeof toggleGroupItemVariants>): import("react/jsx-runtime").JSX.Element;
22
+ declare function ToggleGroupItem({ className, children, variant, size, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleGroupItemVariants>): import("react/jsx-runtime").JSX.Element;
23
+ export { ToggleGroup, ToggleGroupItem, toggleGroupItemVariants };
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ import { Toggle as TogglePrimitive } from "radix-ui";
4
+ declare const toggleVariants: (props?: {
5
+ variant?: "default" | "outline";
6
+ size?: "default" | "sm" | "lg";
7
+ } & import("class-variance-authority/types").ClassProp) => string;
8
+ declare function Toggle({ className, variant, size, ...props }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>): import("react/jsx-runtime").JSX.Element;
9
+ export { Toggle, toggleVariants };
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import { Tooltip as TooltipPrimitive } from "radix-ui";
3
+ declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): import("react/jsx-runtime").JSX.Element;
4
+ declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
5
+ declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
+ declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
7
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
@@ -0,0 +1,41 @@
1
+ /**
2
+ * マイページ共通レイアウトシェル
3
+ *
4
+ * 本番の mypage_layout.ctp + menu.ctp 準拠。
5
+ * マイページ配下のサブページ(注文履歴 / ポイント / 会員情報 / ブックマーク等)で共通利用する。
6
+ *
7
+ * ## レイアウト構造
8
+ *
9
+ * - **SP**: Header (variant="back") + h1 タイトル + コンテンツ + BottomTabBar
10
+ * - **PC**: Header (variant="logo") + Breadcrumb + 2カラム (sidebar 256px + main)
11
+ * - @container クエリ (@md:) でレスポンシブ切替
12
+ *
13
+ * ## 適用対象
14
+ *
15
+ * ✅ 注文履歴 / ポイント / クーポン / 会員情報 / お届け先 / ブックマーク / 口コミ / 記念日 etc.
16
+ * ❌ マイページトップ (Dashboard) — メインカラムに白背景を持たず、セクションごとにカード化
17
+ *
18
+ * 上記の例外は意図的な別パターンなのでこのシェルを使わない。
19
+ */
20
+ import React from "react";
21
+ import { type BottomTabBarItem } from "../../../components/primitives/bottom-tab-bar";
22
+ export interface MypageShellBreadcrumb {
23
+ label: string;
24
+ href?: string;
25
+ }
26
+ export interface MypageShellProps {
27
+ /** ページタイトル(SP の h1 + PC の main h1 + 末尾パンくず に使用) */
28
+ title: string;
29
+ /** SideNav の activeMenu に渡すキー */
30
+ activeMenu: string;
31
+ /** コンテンツ */
32
+ children: React.ReactNode;
33
+ /** パンくず(省略時はデフォルト: ホーム > 山田 太郎 さまのマイページ > {title}) */
34
+ breadcrumbs?: MypageShellBreadcrumb[];
35
+ /** BottomTabBar items(省略時はデフォルト。isActive 等を渡したい場合はこちら) */
36
+ bottomNavItems?: BottomTabBarItem[];
37
+ /** SP の戻るボタン押下時のハンドラ(Header variant="back" に委譲) */
38
+ onBack?: () => void;
39
+ }
40
+ declare function MypageShell({ title, activeMenu, children, breadcrumbs, bottomNavItems, onBack, }: MypageShellProps): import("react/jsx-runtime").JSX.Element;
41
+ export { MypageShell };
@@ -0,0 +1,54 @@
1
+ import { type SectionHeaderSize } from "../../components/primitives/section-header";
2
+ export interface BannerItem {
3
+ /** バナー画像URL */
4
+ imageUrl: string;
5
+ /** 画像alt */
6
+ alt: string;
7
+ /** リンクURL */
8
+ href?: string;
9
+ /** バナー下のラベル(任意) */
10
+ label?: string;
11
+ /** サブラベル(任意) */
12
+ sublabel?: string;
13
+ }
14
+ export interface BannerCarouselProps {
15
+ /** セクションタイトル */
16
+ title: string;
17
+ /** サブタイトル */
18
+ subtitle?: string;
19
+ /** 「もっと見る」リンクURL */
20
+ moreHref?: string;
21
+ /** 「もっと見る」ラベル */
22
+ moreLabel?: string;
23
+ /** SectionHeader size */
24
+ headerSize?: SectionHeaderSize;
25
+ /** バナーリスト */
26
+ items: BannerItem[];
27
+ /** バナーのアスペクト比 (default: "16/9") */
28
+ aspectRatio?: "16/9" | "1/1" | "4/3" | "3/4";
29
+ /** バナーの幅 (default: "md") sm=48vw, md=70vw, lg=85vw, PC時は固定幅 */
30
+ bannerSize?: "sm" | "md" | "lg";
31
+ /** 追加クラス */
32
+ className?: string;
33
+ }
34
+ /**
35
+ * バナーカルーセル(Organism)
36
+ *
37
+ * 水平スクロール可能なバナー/コンテンツカードの行。
38
+ * SectionHeader をセクションタイトルとして内包する。
39
+ * 特集バナー、カテゴリショーケース、マガジン記事などに使用。
40
+ *
41
+ * ### インポート
42
+ * ```tsx
43
+ * import { BannerCarousel } from '../../components/primitives/banner-carousel'
44
+ * ```
45
+ *
46
+ * ### AI 向け使用ルール
47
+ * - 特集バナー行: `bannerSize="md"` + `aspectRatio="16/9"`(デフォルト)
48
+ * - カテゴリアイコン行: `bannerSize="sm"` + `aspectRatio="1/1"`
49
+ * - 大型プロモーション: `bannerSize="lg"` + `aspectRatio="16/9"`
50
+ * - `items` 配列に `href` を指定するとリンクカードになる
51
+ * - SectionHeader は内部で合成される(子として渡さない)
52
+ */
53
+ declare function BannerCarousel({ title, subtitle, moreHref, moreLabel, headerSize, items, aspectRatio, bannerSize, className, }: BannerCarouselProps): import("react/jsx-runtime").JSX.Element;
54
+ export { BannerCarousel };
@@ -0,0 +1,39 @@
1
+ import * as React from "react";
2
+ export interface BottomTabBarItem {
3
+ /** ナビゲーションアイテムのラベル */
4
+ label: string;
5
+ /** アイコン(Lucide React icon など) */
6
+ icon: React.ReactNode;
7
+ /** アクティブ時のアイコン(省略時は icon を使用) */
8
+ activeIcon?: React.ReactNode;
9
+ /** リンク先URL */
10
+ href?: string;
11
+ /** クリックハンドラ */
12
+ onClick?: () => void;
13
+ /** バッジ数(カートアイテム数など) */
14
+ badgeCount?: number;
15
+ /** このアイテムがアクティブか */
16
+ isActive?: boolean;
17
+ }
18
+ export interface BottomTabBarProps extends React.HTMLAttributes<HTMLElement> {
19
+ /** ナビゲーションアイテムリスト */
20
+ items: BottomTabBarItem[];
21
+ /** バナースロット(ナビゲーション上部に表示するキャンペーンバナーなど) */
22
+ banner?: React.ReactNode;
23
+ }
24
+ /**
25
+ * ボトムナビゲーションコンポーネント
26
+ *
27
+ * モバイル画面下部に固定表示するメインナビゲーション。
28
+ * 最大5アイテム、カートバッジ(NotificationBadge)、
29
+ * キャンペーンバナースロットをサポート。
30
+ *
31
+ * Figma準拠:
32
+ * - アクティブ: オレンジ丸ピル背景 + アイコン色オレンジ + ラベル太字
33
+ * - 非アクティブ: ピルなし + 高コントラスト文字色 + 通常ウェイト
34
+ * - 高さ 52px、左右 px-4
35
+ *
36
+ * 使用時は `body` に `pb-16` を追加してコンテンツ重なりを防止。
37
+ */
38
+ declare function BottomTabBar({ className, items, banner, ...props }: BottomTabBarProps): import("react/jsx-runtime").JSX.Element;
39
+ export { BottomTabBar };
@@ -0,0 +1,32 @@
1
+ import * as React from "react";
2
+ export interface BulkActionBarProps {
3
+ /** 選択件数 */
4
+ selectedCount: number;
5
+ /** 子要素(Select やボタンなど) */
6
+ children: React.ReactNode;
7
+ /** 追加クラス */
8
+ className?: string;
9
+ }
10
+ /**
11
+ * 一括操作バー
12
+ *
13
+ * テーブルのチェックボックスで1件以上選択した時に表示する操作バー。
14
+ * 薄オレンジ背景 + 選択件数ラベル + 操作UI(Select, Button など)。
15
+ *
16
+ * ### AI 向け使用ルール
17
+ *
18
+ * - `selectedCount > 0` の時だけ描画する(親側で制御 or 自動非表示)
19
+ * - children に Select + Button を配置する
20
+ * - 右寄せしたいボタンは `ml-auto` を付ける
21
+ *
22
+ * ```tsx
23
+ * {selected.size > 0 && (
24
+ * <BulkActionBar selectedCount={selected.size}>
25
+ * <Select .../>
26
+ * <Button className="ml-auto">一括保存</Button>
27
+ * </BulkActionBar>
28
+ * )}
29
+ * ```
30
+ */
31
+ declare function BulkActionBar({ selectedCount, children, className }: BulkActionBarProps): import("react/jsx-runtime").JSX.Element;
32
+ export { BulkActionBar };
@@ -0,0 +1,70 @@
1
+ import { type SectionHeaderSize } from "../../components/primitives/section-header";
2
+ export interface CategoryItem {
3
+ /** カテゴリ名 */
4
+ name: string;
5
+ /** リンクURL */
6
+ href: string;
7
+ /** サムネイル画像URL */
8
+ imageUrl: string;
9
+ }
10
+ export interface CategoryScrollProps {
11
+ /** セクションタイトル */
12
+ title: string;
13
+ /** 「もっと見る」リンクURL */
14
+ moreHref?: string;
15
+ /** SectionHeader size */
16
+ headerSize?: SectionHeaderSize;
17
+ /** カテゴリリスト */
18
+ items: CategoryItem[];
19
+ /** サムネイルサイズ (default: "md") sm=60px, md=100px, lg=120px */
20
+ thumbnailSize?: "sm" | "md" | "lg";
21
+ /** サムネイル角丸 (default: "square") square=rounded-lg, circle=rounded-full */
22
+ thumbnailShape?: "square" | "circle";
23
+ /**
24
+ * レイアウト (default: "scroll")
25
+ * - scroll: 横スクロール1行
26
+ * - grid: 4列×N行の横スクロールグリッド(本番カテゴリ準拠)
27
+ */
28
+ layout?: "scroll" | "grid";
29
+ /** グリッドの行数 (default: 3) — layout="grid" 時のみ */
30
+ gridRows?: number;
31
+ /** グリッドの列数 (default: 4) — layout="grid" 時のみ */
32
+ gridCols?: number;
33
+ /**
34
+ * PC(@md:)でのグリッド列数 (default: undefined = SP と同じ横スクロール)
35
+ * 指定すると @md: で横スクロールなし・折り返しグリッドに切り替わる
36
+ * Figma PC デザイン準拠: カテゴリ/シーン = 8列
37
+ */
38
+ pcGridCols?: number;
39
+ /** 追加クラス */
40
+ className?: string;
41
+ }
42
+ /**
43
+ * カテゴリスクロールコンポーネント
44
+ *
45
+ * カテゴリサムネイル(画像+ラベル)を横スクロールで表示するオーガニズム。
46
+ * SectionHeader を内包し、カテゴリナビゲーションセクションとして使用する。
47
+ *
48
+ * ### インポート
49
+ * ```tsx
50
+ * import { CategoryScroll } from '../../components/primitives/category-scroll'
51
+ * ```
52
+ *
53
+ * ### Props(主要なもの)
54
+ * | Prop | 型 | デフォルト | 説明 |
55
+ * |------|-----|-----------|------|
56
+ * | title | string | — | セクションタイトル |
57
+ * | items | CategoryItem[] | — | カテゴリリスト |
58
+ * | moreHref | string | — | 「もっと見る」リンクURL |
59
+ * | headerSize | SectionHeaderSize | "lg" | SectionHeader のサイズ |
60
+ * | thumbnailSize | "sm" \| "md" \| "lg" | "md" | サムネイルサイズ |
61
+ * | thumbnailShape | "square" \| "circle" | "square" | サムネイル角丸 |
62
+ *
63
+ * ### AI 向け使用ルール
64
+ * - Atomic Design Level 3(organism): SectionHeader を内包する
65
+ * - カテゴリナビゲーションに使用する
66
+ * - thumbnailShape="circle" + thumbnailSize="sm" でクイックアクセスアイコン風に
67
+ * - 横スクロールは scrollbar-hide でスクロールバー非表示
68
+ */
69
+ declare function CategoryScroll({ title, moreHref, headerSize, items, thumbnailSize, thumbnailShape, layout, gridRows, gridCols, pcGridCols, className, }: CategoryScrollProps): import("react/jsx-runtime").JSX.Element;
70
+ export { CategoryScroll };
@@ -0,0 +1,44 @@
1
+ export interface CategoryShortcutsItem {
2
+ /** カテゴリ名 */
3
+ name: string;
4
+ /** リンクURL */
5
+ href?: string;
6
+ /** アイコン画像URL(CDN) */
7
+ imageUrl: string;
8
+ /** アイコンの代替テキスト */
9
+ imageAlt?: string;
10
+ /** 選択中フラグ */
11
+ isSelected?: boolean;
12
+ /** クリックハンドラ */
13
+ onClick?: () => void;
14
+ }
15
+ export interface CategoryShortcutsProps {
16
+ /** カテゴリリスト */
17
+ items: CategoryShortcutsItem[];
18
+ /** 追加クラス */
19
+ className?: string;
20
+ }
21
+ /**
22
+ * 小アイコンカテゴリストリップ
23
+ *
24
+ * 商品一覧・検索結果ページ上部に設置する、コンパクトなカテゴリフィルター行。
25
+ * 小さな円アイコン(40px)+ラベルを横スクロールで並べる。
26
+ *
27
+ * CategoryScroll との違い:
28
+ * - セクションタイトルなし(フィルターとして使用)
29
+ * - アイコンが xs サイズ(40px)— CategoryScroll sm(60px)より小さい
30
+ * - 選択状態を持てる(isSelected)
31
+ *
32
+ * ### インポート
33
+ * ```tsx
34
+ * import { CategoryShortcuts } from '../../components/primitives/category-shortcuts'
35
+ * ```
36
+ *
37
+ * ### AI 向け使用ルール
38
+ * - 商品一覧ページのカテゴリフィルターとして使用
39
+ * - 検索結果ページのカテゴリナビとして使用
40
+ * - `isSelected` で現在のカテゴリをハイライト
41
+ * - `onClick` でフィルター切り替えイベントを処理
42
+ */
43
+ declare function CategoryShortcuts({ items, className }: CategoryShortcutsProps): import("react/jsx-runtime").JSX.Element;
44
+ export { CategoryShortcuts };
@@ -0,0 +1,44 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const chipVariants: (props?: {
4
+ variant?: "filled" | "accent";
5
+ size?: "sm" | "lg" | "md" | "tile";
6
+ shape?: "square" | "pill";
7
+ } & import("class-variance-authority/types").ClassProp) => string;
8
+ export interface ChipProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof chipVariants> {
9
+ /** リンクとして使う場合のURL */
10
+ href?: string;
11
+ /** 選択状態 */
12
+ selected?: boolean;
13
+ /** 売り切れ状態(斜線表示 + disabled) */
14
+ soldOut?: boolean;
15
+ /** 削除可能(×ボタン表示) */
16
+ removable?: boolean;
17
+ /** 削除時のコールバック */
18
+ onRemove?: () => void;
19
+ /** カウントバッジ(例: 件数表示) */
20
+ count?: number;
21
+ }
22
+ /**
23
+ * チップコンポーネント
24
+ *
25
+ * クリック可能なキーワード・フィルターチップ。
26
+ * 検索ページの「人気キーワード」や、フィルター選択に使用。
27
+ *
28
+ * Tag(表示専用ラベル)との違い:
29
+ * - Chip はインタラクティブ(クリック可能)
30
+ * - Chip は丸形(rounded-full)/ 正方形(shape="square")
31
+ * - Chip は選択状態・削除ボタンを持てる
32
+ *
33
+ * ### AI 向け使用ルール
34
+ *
35
+ * - キーワードチップ(塗りつぶし): `<Chip>キーワード</Chip>`
36
+ * - フィルター選択: `<Chip selected>選択済み</Chip>`
37
+ * - 削除可能: `<Chip removable onRemove={fn}>タグ</Chip>`
38
+ * - サイズタイル: `<Chip shape="square" size="tile" selected={isSelected}>3号</Chip>`
39
+ * - 売り切れタイル: `<Chip shape="square" size="tile" soldOut>5号</Chip>`
40
+ * - カウント付き: `<Chip selected count={156}>すべて</Chip>`
41
+ * - ステータスフィルター: Chip + count でステータス別件数タブを構成
42
+ */
43
+ declare function Chip({ className, variant, size, shape, href, selected, soldOut, removable, onRemove, count, children, ...props }: ChipProps): import("react/jsx-runtime").JSX.Element;
44
+ export { Chip, chipVariants };
@@ -0,0 +1,28 @@
1
+ import * as React from "react";
2
+ export type CoachMarkDirection = "top" | "top-left" | "top-right" | "bottom" | "bottom-left" | "bottom-right" | "left" | "right";
3
+ export interface CoachMarkProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ /** 矢印の方向(バルーン本体から見た矢印の向き) */
5
+ direction?: CoachMarkDirection;
6
+ /** 閉じるボタン表示 */
7
+ onClose?: () => void;
8
+ /** オンボーディングステップ(例: "2/5") */
9
+ step?: string;
10
+ /** 「次へ」ボタン押下時 */
11
+ onNext?: () => void;
12
+ /** 次へボタンのラベル */
13
+ nextLabel?: string;
14
+ }
15
+ /**
16
+ * CoachMark(バルーン / コーチマーク)
17
+ *
18
+ * オンボーディング専用のダーク背景ポップアップ。矢印の方向を指定可能。
19
+ * ステップ表示+次へボタンで順番にガイドする用途。
20
+ *
21
+ * ### AI 向け使用ルール
22
+ *
23
+ * - **オンボーディング(コーチマーク)専用** で使う
24
+ * - 汎用ツールチップには shadcn の `<Tooltip>` を使うこと
25
+ * - `step` + `onNext` + `onClose` でステップ送りUIを構成
26
+ */
27
+ declare function CoachMark({ className, direction, onClose, step, onNext, nextLabel, children, ...props }: CoachMarkProps): import("react/jsx-runtime").JSX.Element;
28
+ export { CoachMark };
@@ -0,0 +1,36 @@
1
+ import * as React from "react";
2
+ export interface EmptyStateProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** 中央に表示するアイコン */
4
+ icon: React.ReactNode;
5
+ /** タイトル(太字) */
6
+ title: string;
7
+ /** 補足説明テキスト */
8
+ description?: React.ReactNode;
9
+ /** CTAボタンなどのアクション要素 */
10
+ action?: React.ReactNode;
11
+ }
12
+ /**
13
+ * 空状態コンポーネント
14
+ *
15
+ * データが無い状態を表示するUI。
16
+ * カート空、検索結果なし、お気に入り空などに使用。
17
+ *
18
+ * ### AI 向け使用ルール
19
+ *
20
+ * - `icon` にページテーマに合ったアイコン(size-16)を渡す
21
+ * - `title` で状態を簡潔に伝える
22
+ * - `description` で次のアクションを案内
23
+ * - `action` に `Button` を渡してCTA導線を作る
24
+ * - ページコンテンツの中央に配置
25
+ *
26
+ * ```tsx
27
+ * <EmptyState
28
+ * icon={<ShoppingCart className="size-16" />}
29
+ * title="カートに商品がありません"
30
+ * description="気になる商品を探してみましょう"
31
+ * action={<Button size="lg">商品を探す</Button>}
32
+ * />
33
+ * ```
34
+ */
35
+ declare function EmptyState({ className, icon, title, description, action, ...props }: EmptyStateProps): import("react/jsx-runtime").JSX.Element;
36
+ export { EmptyState };
@@ -0,0 +1,41 @@
1
+ import * as React from "react";
2
+ export interface ErrorStateProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** エラーアイコン */
4
+ icon?: React.ReactNode;
5
+ /** エラータイトル */
6
+ title: string;
7
+ /** エラーの説明テキスト */
8
+ description?: React.ReactNode;
9
+ /** 再試行ボタンのクリックハンドラ。指定すると再試行ボタンを表示 */
10
+ onRetry?: () => void;
11
+ /** 再試行ボタンのラベル */
12
+ retryLabel?: string;
13
+ /** 追加アクション(例: 「ホームに戻る」ボタン) */
14
+ action?: React.ReactNode;
15
+ }
16
+ /**
17
+ * エラー状態コンポーネント
18
+ *
19
+ * APIエラー、ネットワークエラー、タイムアウト等のエラー状態を表示するUI。
20
+ * EmptyState と同様のレイアウトだが、再試行アクションに特化。
21
+ *
22
+ * ### AI 向け使用ルール
23
+ *
24
+ * - `icon` にエラー種別に合ったアイコン(size-16)を渡す
25
+ * - `title` でエラー内容を簡潔に伝える
26
+ * - `description` で対処方法を案内
27
+ * - `onRetry` を渡すと再試行ボタンが表示される
28
+ * - `action` に追加のナビゲーションボタンを渡せる
29
+ * - ページコンテンツの中央に配置
30
+ *
31
+ * ```tsx
32
+ * <ErrorState
33
+ * icon={<WifiOff className="size-16" />}
34
+ * title="接続エラー"
35
+ * description="ネットワークに接続できませんでした。"
36
+ * onRetry={() => location.reload()}
37
+ * />
38
+ * ```
39
+ */
40
+ declare function ErrorState({ className, icon, title, description, onRetry, retryLabel, action, ...props }: ErrorStateProps): import("react/jsx-runtime").JSX.Element;
41
+ export { ErrorState };
@@ -0,0 +1,56 @@
1
+ import * as React from "react";
2
+ export interface FilterChip {
3
+ /** フィルターのラベル(例: "お届け日", "価格") */
4
+ label: string;
5
+ /** 選択中の値(表示用。アクティブ時に label の代わりに表示される。例: "¥3,000〜¥5,000") */
6
+ value?: string;
7
+ /** アクティブ状態 */
8
+ isActive?: boolean;
9
+ /** クリックハンドラ */
10
+ onClick?: () => void;
11
+ }
12
+ export interface FilterBarProps extends React.HTMLAttributes<HTMLDivElement> {
13
+ /** フィルターチップ群 */
14
+ filters: FilterChip[];
15
+ /** 対象商品件数 */
16
+ resultCount?: number;
17
+ /** 並び替えの現在値(SP: ボタンラベルとして表示。PC: ドロップダウンラベルとして表示) */
18
+ sortLabel?: string;
19
+ /** 並び替えクリックハンドラ */
20
+ onSortClick?: () => void;
21
+ /** 「他のフィルタ」ボタンのハンドラ */
22
+ onMoreFilters?: () => void;
23
+ /** 戻るボタンのハンドラ(地域フィルタ等で使用) */
24
+ onBack?: () => void;
25
+ /** アクティブなフィルター件数(フィルターアイコン上のバッジに表示) */
26
+ activeFilterCount?: number;
27
+ /** レイアウト */
28
+ variant?: "sp" | "pc";
29
+ }
30
+ /**
31
+ * フィルターバー
32
+ *
33
+ * 商品一覧ページ上部の絞り込み&並び替えバー。
34
+ * 本番実装 `p-search-filter-nav` + `p-search-filter-nav__container` を再現。
35
+ *
36
+ * ### 本番との対応
37
+ *
38
+ * | 本番クラス | DS 要素 |
39
+ * |-----------|---------|
40
+ * | `p-search-filter-nav__icon` | フィルターアイコン(SlidersHorizontal) |
41
+ * | `p-search-filter-nav__button` | FilterChip(各絞り込みチップ) |
42
+ * | `p-search-filter-nav__button--other` | 「他のフィルタ」リンク |
43
+ * | `p-search-filter-nav__count` | `activeFilterCount` バッジ |
44
+ * | `p-search-filter-nav__result` | 対象商品件数 |
45
+ * | `p-search-filter-nav__sort` | 並び替えボタン |
46
+ *
47
+ * ### AI 向け使用ルール
48
+ *
49
+ * - `<FilterBar filters={[...]} resultCount={689} sortLabel="おすすめ順" onSortClick={...} onMoreFilters={...} />`
50
+ * - SP/PC の並び替え表示は @container クエリで自動切替(variant prop は非推奨)
51
+ * - フィルターチップは横スクロール
52
+ * - SP では並び替えは結果行の右側にソートボタンとして表示(本番同様)
53
+ * - PC では並び替えは select 風ドロップダウンとして表示(本番 m_sort_pc 同様)
54
+ */
55
+ declare function FilterBar({ filters, resultCount, sortLabel, onSortClick, onMoreFilters, onBack, activeFilterCount, variant, className, ...props }: FilterBarProps): import("react/jsx-runtime").JSX.Element;
56
+ export { FilterBar };