@cakejp/design-system 0.17.1 → 0.20.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 (101) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/CLAUDE.md +16 -0
  3. package/bin/init.js +191 -28
  4. package/contracts/components.json +176 -17
  5. package/contracts/composition.json +1 -1
  6. package/contracts/rules.json +5 -1
  7. package/contracts/screen-patterns.json +1 -1
  8. package/dist/components/ec/admin-shell.js +7 -6
  9. package/dist/components/ec/order-summary.js +16 -15
  10. package/dist/components/ec/product-card.js +107 -102
  11. package/dist/components/ec/product-option.js +1 -0
  12. package/dist/components/ec/review-card.js +22 -20
  13. package/dist/components/ec/review-form.js +1 -0
  14. package/dist/components/foundations/accordion.js +23 -22
  15. package/dist/components/foundations/alert-dialog.js +7 -7
  16. package/dist/components/foundations/alert.js +1 -0
  17. package/dist/components/foundations/aspect-ratio.js +3 -2
  18. package/dist/components/foundations/avatar.js +1 -0
  19. package/dist/components/foundations/button.js +7 -1
  20. package/dist/components/foundations/calendar.js +1 -0
  21. package/dist/components/foundations/checkbox-group.js +1 -0
  22. package/dist/components/foundations/checkbox.js +1 -0
  23. package/dist/components/foundations/command.js +1 -0
  24. package/dist/components/foundations/context-menu.js +1 -0
  25. package/dist/components/foundations/data-table.js +489 -16
  26. package/dist/components/foundations/dialog.js +13 -13
  27. package/dist/components/foundations/drawer.js +6 -5
  28. package/dist/components/foundations/file-input.js +1 -0
  29. package/dist/components/foundations/form.js +26 -25
  30. package/dist/components/foundations/pagination.js +49 -46
  31. package/dist/components/foundations/popover.js +9 -8
  32. package/dist/components/foundations/radio-group.js +3 -2
  33. package/dist/components/foundations/responsive-dialog.js +1 -0
  34. package/dist/components/foundations/separator.js +7 -6
  35. package/dist/components/foundations/sheet.js +41 -34
  36. package/dist/components/foundations/slider.js +7 -6
  37. package/dist/components/foundations/social-icon.js +30 -10
  38. package/dist/components/foundations/sonner.js +5 -4
  39. package/dist/components/foundations/tabs.js +45 -25
  40. package/dist/components/foundations/toggle-group.js +6 -5
  41. package/dist/components/primitives/admin-header.js +1 -1
  42. package/dist/components/primitives/admin-side-nav.js +196 -86
  43. package/dist/components/primitives/bottom-tab-bar.js +20 -20
  44. package/dist/components/primitives/chat-composer.js +1 -0
  45. package/dist/components/primitives/combobox.js +1 -0
  46. package/dist/components/primitives/content-card.js +111 -0
  47. package/dist/components/primitives/content-carousel.js +9 -8
  48. package/dist/components/primitives/date-picker.js +9 -8
  49. package/dist/components/primitives/footer.js +169 -100
  50. package/dist/components/primitives/form-field.js +1 -0
  51. package/dist/components/primitives/header.js +226 -176
  52. package/dist/components/primitives/image-carousel.js +8 -7
  53. package/dist/components/primitives/image-gallery.js +15 -14
  54. package/dist/components/primitives/image-input.js +9 -8
  55. package/dist/components/primitives/list-item.js +9 -8
  56. package/dist/components/primitives/menu-drawer.js +60 -56
  57. package/dist/components/primitives/multi-select.js +7 -6
  58. package/dist/components/primitives/number-input.js +1 -0
  59. package/dist/components/primitives/prose.js +52 -0
  60. package/dist/components/primitives/search-bar.js +81 -66
  61. package/dist/components/primitives/section-header.js +58 -55
  62. package/dist/components/primitives/share-buttons.js +93 -85
  63. package/dist/components/primitives/status-count-tabs.js +8 -7
  64. package/dist/components/primitives/sticky-action-bar.js +2 -1
  65. package/dist/components/primitives/sub-nav.js +52 -52
  66. package/dist/index.css +1 -1
  67. package/dist/index.js +2027 -752
  68. package/dist/lib/field-labelling.js +7 -6
  69. package/dist/lib/link-component.js +6 -0
  70. package/dist/lib/use-value-length.js +1 -0
  71. package/dist/types/components/ec/product-card.d.ts +12 -19
  72. package/dist/types/components/ec/review-card.d.ts +6 -1
  73. package/dist/types/components/foundations/button.d.ts +1 -1
  74. package/dist/types/components/foundations/chip-variants.d.ts +1 -1
  75. package/dist/types/components/foundations/data-table.d.ts +9 -1
  76. package/dist/types/components/foundations/pagination.d.ts +7 -1
  77. package/dist/types/components/foundations/sheet.d.ts +6 -1
  78. package/dist/types/components/foundations/social-icon.d.ts +1 -1
  79. package/dist/types/components/foundations/tabs.d.ts +2 -1
  80. package/dist/types/components/primitives/admin-side-nav.d.ts +3 -0
  81. package/dist/types/components/primitives/content-card.d.ts +67 -0
  82. package/dist/types/components/primitives/footer.d.ts +21 -1
  83. package/dist/types/components/primitives/header.d.ts +30 -2
  84. package/dist/types/components/primitives/menu-drawer.d.ts +7 -1
  85. package/dist/types/components/primitives/prose.d.ts +35 -0
  86. package/dist/types/components/primitives/search-bar.d.ts +14 -1
  87. package/dist/types/components/primitives/section-header.d.ts +2 -1
  88. package/dist/types/components/primitives/share-buttons.d.ts +26 -4
  89. package/dist/types/components/primitives/sub-nav.d.ts +16 -1
  90. package/dist/types/index.d.ts +7 -2
  91. package/dist/types/lib/link-component.d.ts +35 -0
  92. package/package.json +5 -4
  93. package/src/components/COMPONENT_LOOKUP.md +8 -6
  94. package/src/preset-standalone.css +3 -0
  95. package/src/preset.css +21 -3
  96. package/src/styles/semantic.css +11 -0
  97. package/templates/AGENTS.md +4 -2
  98. package/templates/AGENTS.stub.md +25 -0
  99. package/templates/CLAUDE.md +4 -2
  100. package/templates/CLAUDE.stub.md +25 -0
  101. package/tokens.json +17 -1
@@ -1,7 +1,8 @@
1
- import * as a from "react";
2
- const n = a.createContext(null);
3
- function t() {
4
- return a.useContext(n);
1
+ "use client";
2
+ import * as n from "react";
3
+ const t = n.createContext(null);
4
+ function a() {
5
+ return n.useContext(t);
5
6
  }
6
7
  function d(r, e) {
7
8
  if (!e) return {};
@@ -22,8 +23,8 @@ function o(r, e) {
22
23
  };
23
24
  }
24
25
  export {
25
- n as FieldLabellingContext,
26
+ t as FieldLabellingContext,
26
27
  d as resolveFieldAria,
27
28
  o as resolveNativeFieldAria,
28
- t as useFieldLabelling
29
+ a as useFieldLabelling
29
30
  };
@@ -0,0 +1,6 @@
1
+ function n(r, e) {
2
+ return e || !r ? "a" : r;
3
+ }
4
+ export {
5
+ n as resolveLinkComponent
6
+ };
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import * as u from "react";
2
3
  function a(e, c) {
3
4
  if (typeof e == "function") {
@@ -19,6 +19,17 @@ export interface ProductCardProps extends React.HTMLAttributes<HTMLDivElement> {
19
19
  reviewCount?: number;
20
20
  /** ショップ名 */
21
21
  shopName?: string;
22
+ /**
23
+ * ホバー時の画像演出。
24
+ * - `zoom` : 画像をわずかに拡大
25
+ * - `fade` : 拡大せず画像をわずかに明るくする(本番 EC 準拠)
26
+ * - `none` : 演出なし
27
+ *
28
+ * 未指定時の既定は orientation で変わる(従来の見た目を維持するため):
29
+ * `vertical` = `zoom` / `horizontal` = `none`。明示指定すればどちらの
30
+ * orientation でも同じように効く。
31
+ */
32
+ hoverEffect?: "zoom" | "fade" | "none";
22
33
  /** ショップページURL(指定するとショップ名がリンク化、hover時アンダーライン) */
23
34
  shopHref?: string;
24
35
  /** タグリスト(配送方法・キャンペーンなど) */
@@ -57,23 +68,5 @@ export declare function BookmarkRibbonIcon({ size, filled }: {
57
68
  size?: number;
58
69
  filled?: boolean;
59
70
  }): import("react/jsx-runtime").JSX.Element;
60
- /**
61
- * 商品カードコンポーネント — Figma DS 準拠
62
- *
63
- * Cake.jp の商品一覧・検索結果に使用するカードUI。
64
- * vertical(グリッド表示)と horizontal(リスト表示)の2レイアウト対応。
65
- *
66
- * ### Figma との対応
67
- * - 画像エリア: 正方形、rounded-lg (8px)、4px パディング
68
- * - ブックマーク: 画像右下に 36px 円形ボタン(本番 .m-bookmark-button--mid 準拠)
69
- * - タグ: 画像左下に配置(PR、セールバッジ等)
70
- * - 商品情報: gap-[2px]、商品名 → レビュー+最短日(同行) → 価格
71
- * - カートボタン: h-[36px]、rounded-[12px]、Brand-Cake-Orange
72
- *
73
- * ### 機能
74
- * - `shopHref` でショップ名リンク化(hover時アンダーライン付き)
75
- * - `showCartButton` で「カートに追加」ボタン表示(verticalのみ)
76
- * - ランキングバッジ、お気に入り、割引バッジなどEC必須要素を統合提供
77
- */
78
- declare function ProductCard({ className, name, imageUrl, imageAlt, price, originalPrice, caption, rating, reviewCount, shopName, shopHref, tags, isFavorite, onFavoriteToggle, onCardClick, href, ranking, deliveryDate, orientation, showDiscountBadge, showCartButton, onCartAdd, cartButtonLabel, ...props }: ProductCardProps): import("react/jsx-runtime").JSX.Element;
71
+ declare function ProductCard({ className, name, imageUrl, imageAlt, price, originalPrice, caption, rating, reviewCount, shopName, shopHref, hoverEffect, tags, isFavorite, onFavoriteToggle, onCardClick, href, ranking, deliveryDate, orientation, showDiscountBadge, showCartButton, onCartAdd, cartButtonLabel, ...props }: ProductCardProps): import("react/jsx-runtime").JSX.Element;
79
72
  export { ProductCard };
@@ -2,6 +2,11 @@ import * as React from "react";
2
2
  export interface ReviewCardProps extends React.HTMLAttributes<HTMLDivElement> {
3
3
  /** レビューバリアント */
4
4
  variant?: "list" | "card" | "pc";
5
+ /**
6
+ * 枠線を出すか(既定 true)。
7
+ * 商品詳細などページ全体をフラットに統一する画面では false にする。
8
+ */
9
+ bordered?: boolean;
5
10
  /** 星評価(1〜5) */
6
11
  rating: number;
7
12
  /** 投稿日 */
@@ -40,5 +45,5 @@ export interface ReviewCardProps extends React.HTMLAttributes<HTMLDivElement> {
40
45
  * - 既存の `RatingStars` の `SparkleIcon` を星表示に使用
41
46
  * - 「もっと見る」はオレンジテキスト
42
47
  */
43
- declare function ReviewCard({ className, variant, rating, date, text, imageUrl, productName, productImageUrl, helpfulCount, isLiked, onLikeClick, onMoreClick, maxLength, ...props }: ReviewCardProps): import("react/jsx-runtime").JSX.Element;
48
+ declare function ReviewCard({ className, variant, bordered, rating, date, text, imageUrl, productName, productImageUrl, helpfulCount, isLiked, onLikeClick, onMoreClick, maxLength, ...props }: ReviewCardProps): import("react/jsx-runtime").JSX.Element;
44
49
  export { ReviewCard };
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
  import { type VariantProps } from "class-variance-authority";
3
3
  declare const buttonVariants: (props?: {
4
4
  variant?: "link" | "default" | "secondary" | "tertiary" | "destructive" | "ghost" | "inverse" | "ghost-inverse" | "overlay";
5
- size?: "default" | "icon" | "xs" | "sm" | "lg" | "xl" | "hero" | "icon-xs" | "icon-sm" | "icon-lg";
5
+ size?: "default" | "icon" | "xs" | "sm" | "lg" | "xl" | "hero" | "icon-xs" | "icon-sm" | "icon-lg" | "icon-xl";
6
6
  } & import("class-variance-authority/types").ClassProp) => string;
7
7
  declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
8
8
  asChild?: boolean;
@@ -12,6 +12,6 @@ import { type VariantProps } from "class-variance-authority";
12
12
  export declare const chipVariants: (props?: {
13
13
  variant?: "accent" | "filled";
14
14
  size?: "sm" | "lg" | "md" | "tile";
15
- shape?: "pill" | "square";
15
+ shape?: "square" | "pill";
16
16
  } & import("class-variance-authority/types").ClassProp) => string;
17
17
  export type ChipVariantProps = VariantProps<typeof chipVariants>;
@@ -9,12 +9,20 @@ declare const dataTableRowVariants: (props?: {
9
9
  } & import("class-variance-authority/types").ClassProp) => string;
10
10
  declare function DataTableRow({ className, state, ...props }: React.ComponentProps<"tr"> & VariantProps<typeof dataTableRowVariants>): import("react/jsx-runtime").JSX.Element;
11
11
  type SortDirection = "asc" | "desc" | null;
12
- declare function DataTableHead({ className, sortable, sortDirection, onSort, width, children, ...props }: React.ComponentProps<"th"> & {
12
+ declare function DataTableHead({ className, sortable, sortDirection, onSort, width, srLabel, children, ...props }: React.ComponentProps<"th"> & {
13
13
  sortable?: boolean;
14
14
  sortDirection?: SortDirection;
15
15
  onSort?: () => void;
16
16
  /** セル幅バリアント: max=320-360px, hug=最小 */
17
17
  width?: "auto" | "max" | "hug";
18
+ /**
19
+ * 見出し文字を出さない列(チェックボックス選択列・操作列など)の読み上げ用ラベル。
20
+ * 画面には出さず、スクリーンリーダーにだけ列の意味を伝える。
21
+ *
22
+ * 空の `<th>` は「この列が何か」が支援技術に伝わらない(axe: empty-table-header)。
23
+ * 見出しを出したくない列には必ず指定する。
24
+ */
25
+ srLabel?: string;
18
26
  }): import("react/jsx-runtime").JSX.Element;
19
27
  declare const dataTableCellVariants: (props?: {
20
28
  width?: "auto" | "max" | "hug";
@@ -1,12 +1,18 @@
1
1
  import * as React from "react";
2
+ import { type LinkComponent } from "../../lib/link-component";
2
3
  import { type Button } from "../../components/foundations/button";
3
4
  declare function Pagination({ className, ...props }: React.ComponentProps<"nav">): import("react/jsx-runtime").JSX.Element;
4
5
  declare function PaginationContent({ className, ...props }: React.ComponentProps<"ul">): import("react/jsx-runtime").JSX.Element;
5
6
  declare function PaginationItem({ ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
6
7
  type PaginationLinkProps = {
7
8
  isActive?: boolean;
9
+ /**
10
+ * リンクの描画に使うコンポーネント(既定 `a`)。
11
+ * `next/link` 等を渡すとクライアント遷移になる(#236)。
12
+ */
13
+ linkComponent?: LinkComponent;
8
14
  } & Pick<React.ComponentProps<typeof Button>, "size"> & React.ComponentProps<"a">;
9
- declare function PaginationLink({ className, isActive, size, ...props }: PaginationLinkProps): import("react/jsx-runtime").JSX.Element;
15
+ declare function PaginationLink({ className, isActive, size, linkComponent, ...props }: PaginationLinkProps): import("react/jsx-runtime").JSX.Element;
10
16
  declare function PaginationPrevious({ className, ...props }: React.ComponentProps<typeof PaginationLink>): import("react/jsx-runtime").JSX.Element;
11
17
  declare function PaginationNext({ className, ...props }: React.ComponentProps<typeof PaginationLink>): import("react/jsx-runtime").JSX.Element;
12
18
  declare function PaginationEllipsis({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
@@ -3,9 +3,14 @@ import { Dialog as SheetPrimitive } from "radix-ui";
3
3
  declare function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
4
  declare function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
5
  declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
6
- declare function SheetContent({ className, children, side, showCloseButton, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & {
6
+ declare function SheetContent({ className, children, side, showCloseButton, autoFocus, onOpenAutoFocus, onCloseAutoFocus, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & {
7
7
  side?: "top" | "right" | "bottom" | "left";
8
8
  showCloseButton?: boolean;
9
+ /**
10
+ * 開閉時のフォーカス自動移動。既定 true(Radix 既定=開いたら中へ入り、閉じたらトリガーへ戻る)。
11
+ * WCAG 2.4.3 を満たすため、止めたい特別な事情があるときだけ false にする。
12
+ */
13
+ autoFocus?: boolean;
9
14
  }): import("react/jsx-runtime").JSX.Element;
10
15
  declare function SheetHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
11
16
  declare function SheetFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- export type SocialPlatform = "line" | "x" | "facebook" | "amazon" | "google" | "apple";
2
+ export type SocialPlatform = "line" | "x" | "facebook" | "amazon" | "google" | "apple" | "hatena";
3
3
  export interface SocialIconProps extends Omit<React.ComponentProps<"svg">, "children"> {
4
4
  platform: SocialPlatform;
5
5
  /**
@@ -5,8 +5,9 @@ declare function Tabs({ className, ...props }: React.ComponentProps<typeof TabsP
5
5
  declare const tabsListVariants: (props?: {
6
6
  variant?: "underbar" | "segment";
7
7
  scrollable?: boolean;
8
+ size?: "sm" | "md";
8
9
  } & 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 TabsList({ className, variant, scrollable, size, ...props }: React.ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>): import("react/jsx-runtime").JSX.Element;
10
11
  declare function TabsTrigger({ className, children, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
11
12
  declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
12
13
  export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
@@ -65,6 +65,9 @@ export interface AdminSideNavProps {
65
65
  *
66
66
  * メイン項目・サブメニュー項目とも 44px(WCAG 2.5.5 の最小ターゲット)以上にする。
67
67
  * 行高が小さいテキストで縦 padding だけに頼ると割り込むため、`min-h-11` で下限を固定する。
68
+ * PC のサブメニューは `DropdownMenu` の Portal / collision handling を利用し、
69
+ * viewport 端では位置と最大高を自動調整する。hover ではフォーカスを奪わず、
70
+ * Enter / Space / ArrowDown / Escape では標準のメニュー操作に従う。
68
71
  *
69
72
  * ### インポート
70
73
  * ```tsx
@@ -0,0 +1,67 @@
1
+ import * as React from "react";
2
+ import { type LinkComponent } from "../../lib/link-component";
3
+ import { type TagProps } from "../../components/primitives/tag";
4
+ export type ContentCardOrientation = "vertical" | "horizontal" | "list";
5
+ export type ContentCardAspect = "16/10" | "16/9" | "1/1";
6
+ export interface ContentCardProps extends Omit<React.HTMLAttributes<HTMLElement>, "title"> {
7
+ /** 記事タイトル。一覧で高さが割れないよう常に 2 行ぶんの高さを取る */
8
+ title: string;
9
+ /** 遷移先。カード全体がリンクになる */
10
+ href: string;
11
+ /**
12
+ * 画像。`next/image` や CMS の img、図版をそのまま渡す。
13
+ * 縦横比とクリップはカード側が持つので、中身は `h-full w-full object-cover` を想定。
14
+ */
15
+ imageSlot?: React.ReactNode;
16
+ /** 画像左下に重ねるラベル(カテゴリ等)。長いラベルは省略記号で切る */
17
+ tag?: {
18
+ label: string;
19
+ variant?: TagProps["variant"];
20
+ };
21
+ /** 日付・著者などの補足。**必ず 1 行**に収まる内容にする(複数行だと一覧で高さが割れる) */
22
+ meta?: React.ReactNode;
23
+ /**
24
+ * カードの向き。
25
+ * - `vertical`(既定): 画像が上、本文が下。グリッド一覧向け
26
+ * - `horizontal` : 画像が左、本文が右
27
+ * - `list` : 本文が左、サムネイルが右(記事一覧の Medium 型)
28
+ */
29
+ orientation?: ContentCardOrientation;
30
+ /** 画像の縦横比(既定 `16/10`。記事のアイキャッチは横長素材が前提) */
31
+ aspect?: ContentCardAspect;
32
+ /**
33
+ * リンクの描画に使うコンポーネント(既定 `a`)。
34
+ * `next/link` 等を渡すとクライアント遷移になる(#236)。
35
+ */
36
+ linkComponent?: LinkComponent;
37
+ }
38
+ /**
39
+ * 記事・特集・お知らせなど「画像 + タイトル + メタ」のカード。
40
+ *
41
+ * `ProductCard`(商品)/ `ShopCard`(店舗)の兄弟で、記事メディア向け。
42
+ * 汎用の `Card` に載せて組むと、枠線・タイトル行数・カード高さが揃わない
43
+ * (実測で高さ 268 と 312 に割れる事例あり)ため、この部品を使う。
44
+ *
45
+ * ### 作法
46
+ *
47
+ * - 枠線なし・`rounded-lg`・サーフェスは親から伝播(`Section background="subtle"` 配下では白)
48
+ * - タイトルは 2 行で省略し、常に 2 行ぶんの高さを取る(一覧で下端が揃う)
49
+ * - `meta` は 1 行固定でカード下端へ寄る
50
+ * - 画像は `imageSlot` で consumer が用意する(`next/image` / CMS / 図版を吸収する)
51
+ *
52
+ * ### AI 向け使用ルール
53
+ *
54
+ * - 記事一覧・関連記事・注目記事は `Card` + `CardContent` で組まずこれを使う
55
+ * - グリッド一覧は `orientation="vertical"`、Medium 型の縦リストは `orientation="list"` +
56
+ * `ContentList`(区切り線つき)
57
+ * - タイトルの文字装飾を利用側で足さない(`font-bold` にしない。既定は `font-medium`)
58
+ */
59
+ declare function ContentCard({ className, title, href, imageSlot, tag, meta, orientation, aspect, linkComponent, ...props }: ContentCardProps): import("react/jsx-runtime").JSX.Element;
60
+ /**
61
+ * `ContentCard` を区切り線つきで縦に並べるリスト(記事一覧の Medium 型)。
62
+ *
63
+ * 一覧ページで `orientation="list"` の `ContentCard` を並べるときに使う。
64
+ * 区切り線と項目間の余白だけを持ち、幅・背景は持たない。
65
+ */
66
+ declare function ContentList({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
67
+ export { ContentCard, ContentList };
@@ -1,4 +1,5 @@
1
1
  import * as React from "react";
2
+ import { type LinkComponent } from "../../lib/link-component";
2
3
  export interface FooterLink {
3
4
  label: string;
4
5
  href: string;
@@ -53,6 +54,25 @@ export interface FooterProps extends React.HTMLAttributes<HTMLElement> {
53
54
  trustBadge?: FooterTrustBadge;
54
55
  /** フッター下部の補助リンク(特定商取引法、プライバシーポリシー等) */
55
56
  bottomLinks?: FooterLink[];
57
+ /**
58
+ * リンクの描画に使うコンポーネント(既定 `a`)。
59
+ * `next/link` 等を渡すとクライアント遷移になる(#236)。
60
+ * `external: true` のリンクは常に素の `<a target="_blank">` で描く。
61
+ */
62
+ linkComponent?: LinkComponent;
63
+ /**
64
+ * レイアウト(既定 `default`)。
65
+ * - `default` : ロゴ・説明文を最下部に中央寄せ(本番 Cake.jp 準拠)
66
+ * - `brand-first` : ロゴ・説明文を先頭カラムに置き、その右にリンク群を並べる。
67
+ * 下部バーはコピーライト左・`bottomRightSlot` 右の左右振り分けになる
68
+ * (求人ケーキ屋さん.jp / 仕入れケーキ屋さん.JP のフッター構成)
69
+ */
70
+ variant?: "default" | "brand-first";
71
+ /**
72
+ * 下部バーの右側に置く要素(`Powered by` 等)。
73
+ * `variant="brand-first"` でのみ配置され、既定レイアウトでは無視される。
74
+ */
75
+ bottomRightSlot?: React.ReactNode;
56
76
  }
57
77
  /**
58
78
  * フッターコンポーネント
@@ -77,5 +97,5 @@ export interface FooterProps extends React.HTMLAttributes<HTMLElement> {
77
97
  * - `copyright` でコピーライト表示
78
98
  * - BottomTabBar と併用する場合は `pb-16` 等でマージン確保
79
99
  */
80
- declare function Footer({ className, linkGroups, copyright, logo, logoHref, socialLinks, description, paymentMethods, trustBadge, bottomLinks, ...props }: FooterProps): import("react/jsx-runtime").JSX.Element;
100
+ declare function Footer({ className, linkGroups, copyright, logo, logoHref, socialLinks, description, paymentMethods, trustBadge, bottomLinks, variant, bottomRightSlot, linkComponent, ...props }: FooterProps): import("react/jsx-runtime").JSX.Element;
81
101
  export { Footer };
@@ -1,4 +1,9 @@
1
1
  import * as React from "react";
2
+ /**
3
+ * ヘッダー内側の最大幅。`Container` の同名 size と同じ値を使う(値の正本は Container)。
4
+ * 本文を `Container size="page"` で中央寄せしているサイトで、ロゴ・ナビの左端を本文に揃える。
5
+ */
6
+ export type HeaderContainerSize = "page" | "wide" | "fluid";
2
7
  export interface HeaderAction {
3
8
  /** アイコン要素 */
4
9
  icon: React.ReactNode;
@@ -14,6 +19,12 @@ export interface HeaderAction {
14
19
  href?: string;
15
20
  /** バッジ数(通知やカート件数) */
16
21
  badge?: React.ReactNode;
22
+ /**
23
+ * `label` をアイコンの右に可視テキストとして出す(既定 false = アイコンのみ)。
24
+ * 「ログイン」等、文字が無いと意味が伝わりにくい導線に使う。
25
+ * true のときは正方形のアイコンボタンではなく、枠線付きのピル型で描画する。
26
+ */
27
+ showLabel?: boolean;
17
28
  }
18
29
  export interface HeaderNavItem {
19
30
  /** 表示ラベル */
@@ -56,7 +67,7 @@ export interface HeaderProps extends React.HTMLAttributes<HTMLElement> {
56
67
  /**
57
68
  * インラインナビ(navItems / searchSlot 行)を出し始めるコンテナ幅。
58
69
  * - `md`(既定): `@[768px]`+
59
- * - `lg` : `@[1024px]`+(ロゴが多段で横幅を食う等、中幅での同居を避けたいとき)
70
+ * - `lg` : `@[960px]`+(ロゴが多段で横幅を食う等、中幅での同居を避けたいとき)
60
71
  * 未満の幅では SP 行(ロゴ + actions)になる。
61
72
  */
62
73
  navBreakpoint?: "md" | "lg";
@@ -70,6 +81,16 @@ export interface HeaderProps extends React.HTMLAttributes<HTMLElement> {
70
81
  * navItems が無く searchSlot だけを渡した場合も PC 行を描画する。
71
82
  */
72
83
  searchSlot?: React.ReactNode;
84
+ /**
85
+ * `searchSlot` を出し始めるコンテナ幅(既定はインラインナビ行と同じ)。
86
+ * tokens.json の切替段に一致する `md`(768px)/ `lg`(960px)のみ。
87
+ * `xl`(1280) はコンテンツ上限段でレイアウトの切替段ではないため受け付けない。
88
+ *
89
+ * 中身を consumer 側の CSS で隠しても、このスロットの器は `flex-1` の幅を
90
+ * 確保し続けてインラインナビを潰す(#243)。狭い帯で検索を出さない場合は
91
+ * CSS ではなくこの prop で器ごと畳むこと。
92
+ */
93
+ searchBreakpoint?: "md" | "lg";
73
94
  /** 右側に配置するカスタム要素(variant="back"で使用) */
74
95
  rightSlot?: React.ReactNode;
75
96
  /** 検索バーなど中央に配置するカスタム要素(variant="back-search"で使用) */
@@ -82,6 +103,13 @@ export interface HeaderProps extends React.HTMLAttributes<HTMLElement> {
82
103
  bottomSlot?: React.ReactNode;
83
104
  /** sticky 配置を無効化 */
84
105
  disableSticky?: boolean;
106
+ /**
107
+ * ヘッダー内側の最大幅(`Container` と同じ段)。
108
+ * 指定すると背景・border・sticky は全幅のまま、**中身だけ**を中央寄せする。
109
+ * 本文を `Container size="page"` で組んでいるサイトで、ロゴ・ナビの左端が本文と揃う。
110
+ * 未指定なら従来どおり全幅(DOM も従来どおりで内側ラッパーを足さない)。
111
+ */
112
+ containerSize?: HeaderContainerSize;
85
113
  }
86
114
  /**
87
115
  * ページヘッダー
@@ -89,5 +117,5 @@ export interface HeaderProps extends React.HTMLAttributes<HTMLElement> {
89
117
  * アプリ全体で使われるヘッダーの3パターンを1コンポーネントで提供。
90
118
  * ロゴ+アクション、戻るボタン+タイトル、戻るボタン+検索の3バリエーション。
91
119
  */
92
- declare function Header({ className, variant, logo, title, onBack, backLabel, actions, navItems, navBreakpoint, navOverflowLabel, searchSlot, rightSlot, centerSlot, bottomSlot, disableSticky, ...props }: HeaderProps): import("react/jsx-runtime").JSX.Element;
120
+ declare function Header({ className, variant, logo, title, onBack, backLabel, actions, navItems, navBreakpoint, navOverflowLabel, searchSlot, searchBreakpoint, rightSlot, centerSlot, bottomSlot, disableSticky, containerSize, ...props }: HeaderProps): import("react/jsx-runtime").JSX.Element;
93
121
  export { Header };
@@ -1,4 +1,5 @@
1
1
  import * as React from "react";
2
+ import { type LinkComponent } from "../../lib/link-component";
2
3
  export interface MenuSection {
3
4
  /** セクションタイトル */
4
5
  title?: string;
@@ -38,6 +39,11 @@ export interface MenuBanner {
38
39
  href?: string;
39
40
  }
40
41
  export interface MenuDrawerProps extends React.HTMLAttributes<HTMLDivElement> {
42
+ /**
43
+ * リンクの描画に使うコンポーネント(既定 `a`)。
44
+ * `next/link` 等を渡すとクライアント遷移になる(#236)。
45
+ */
46
+ linkComponent?: LinkComponent;
41
47
  /** ユーザー名(ログイン時) */
42
48
  userName?: string;
43
49
  /** ログイン状態 */
@@ -55,5 +61,5 @@ export interface MenuDrawerProps extends React.HTMLAttributes<HTMLDivElement> {
55
61
  /** ログインリンクのhref(デフォルト: /security/login_link/) */
56
62
  loginHref?: string;
57
63
  }
58
- declare function MenuDrawer({ userName, isLoggedIn, hideLoginLink, sections, banners, onClose, onLogin, loginHref, className, ...props }: MenuDrawerProps): import("react/jsx-runtime").JSX.Element;
64
+ declare function MenuDrawer({ userName, isLoggedIn, hideLoginLink, sections, banners, onClose, onLogin, loginHref, className, linkComponent, ...props }: MenuDrawerProps): import("react/jsx-runtime").JSX.Element;
59
65
  export { MenuDrawer };
@@ -0,0 +1,35 @@
1
+ import * as React from "react";
2
+ export interface ProseProps extends React.HTMLAttributes<HTMLElement> {
3
+ /**
4
+ * CMS(microCMS 等)のリッチテキスト HTML。
5
+ *
6
+ * **サニタイズ済みの HTML だけを渡すこと。** この部品は体裁を当てるだけで、
7
+ * 中身の無害化は行わない(`dangerouslySetInnerHTML` に素通しする)。
8
+ * 未指定なら `children` をそのまま包む。
9
+ */
10
+ html?: string;
11
+ /** ラップする要素(既定 `div`。記事本文なら `article`) */
12
+ as?: "div" | "article" | "section";
13
+ }
14
+ /**
15
+ * 記事本文の体裁(見出し・段落・リスト・引用・表・画像・リンク)をトークンで揃える。
16
+ *
17
+ * 各要素の余白・サイズ・線・色を 1 箇所に集約し、記事メディアごとに CSS Modules を
18
+ * 書き分けて見た目がばらつくのを防ぐ。`Container size="narrow"`(760px)と
19
+ * 組み合わせて使う前提の行長になっている。
20
+ *
21
+ * ### AI 向け使用ルール
22
+ *
23
+ * - CMS のリッチテキストを描くときは、consumer 側で `h2` / `p` / `ul` の CSS を書かず
24
+ * これを使う(`ArticleBody.module.css` のような独自 CSS を作らない)
25
+ * - `html` に渡す HTML は **利用側でサニタイズ済み**であること
26
+ * - 記事幅は `Container size="narrow"` で決める。この部品は幅を持たない
27
+ * - 見出しレベルは CMS の出力に従う(この部品は体裁だけを当て、階層は変えない)
28
+ *
29
+ * @example
30
+ * <Container size="narrow">
31
+ * <Prose as="article" html={sanitizedHtml} />
32
+ * </Container>
33
+ */
34
+ declare function Prose({ className, html, as: Comp, children, ...props }: ProseProps): import("react/jsx-runtime").JSX.Element;
35
+ export { Prose };
@@ -6,6 +6,17 @@ export interface SearchBarProps extends Omit<React.InputHTMLAttributes<HTMLInput
6
6
  size?: "sm" | "md";
7
7
  /** 検索リンクURL({query} はクエリに置換) */
8
8
  searchHref?: string;
9
+ /**
10
+ * 指定すると `<form method="get" action={action}>` として描画し、素のフォーム送信で遷移する。
11
+ * JS を必要としないので、スクリプト無効環境やクローラでも検索が成立する(SEO 重視のサイト向け)。
12
+ * 送信するクエリのキーは `name`(既定 `"q"`)。`searchHref` とは併用しない(`action` が優先)。
13
+ */
14
+ action?: string;
15
+ /**
16
+ * 送信するクエリのキー(`action` 指定時の既定 `"q"`)。
17
+ * そのまま input の `name` 属性になる。
18
+ */
19
+ name?: string;
9
20
  }
10
21
  /**
11
22
  * 検索バーコンポーネント
@@ -25,7 +36,9 @@ export interface SearchBarProps extends Omit<React.InputHTMLAttributes<HTMLInput
25
36
  * - `size="sm"` はコンパクトなヘッダー向け
26
37
  * - `size="md"` は検索専用ページ向け
27
38
  * - `onSearch` で検索クエリを受け取る
28
- * - `searchHref` で検索結果ページへの遷移リンクを生成
39
+ * - `searchHref` で検索結果ページへの遷移リンクを生成(JS が必要)
40
+ * - **JS 無効環境・SEO を考慮するサイトは `action` を使う**。`<form method="get">` として
41
+ * 描画され、素のフォーム送信で遷移する(`Input` + `Button` で `<form>` を手組みしない)
29
42
  */
30
43
  declare const SearchBar: React.ForwardRefExoticComponent<SearchBarProps & React.RefAttributes<HTMLInputElement>>;
31
44
  export { SearchBar };
@@ -58,7 +58,8 @@ export interface SectionHeaderProps extends React.HTMLAttributes<HTMLDivElement>
58
58
  * - セクション見出し(ランキング等): `size="xl"` or `size="lg"`(デフォルト)
59
59
  * - 小見出し・グループラベル: `size="md"` or `size="sm"`
60
60
  * - `as` で見出しレベルを上書き可能(同一ページに h1 が複数必要な場合など)
61
- * - `moreHref` 指定時はタイトル+サブタイトル全体がリンクになる(クリック領域拡大)
61
+ * - `moreHref` 指定時はタイトル行がリンクになる(クリック領域拡大)。`subtitle` は
62
+ * 右側アクションの下も含めた全幅で折り返すため、リンクの外に置く(issue #232)
62
63
  * - `action` に任意の ReactNode(Button 等)を渡して右側にアクションを配置可能
63
64
  * - `align="center"` でランディング/ガイド系の中央寄せ大見出しに切替(`eyebrow` に Badge 等を載せられる)
64
65
  */
@@ -1,9 +1,29 @@
1
1
  import * as React from "react";
2
+ /** 組み込みの共有先 */
3
+ export type ShareService = "line" | "x" | "facebook" | "hatena" | "copy";
4
+ /** 組み込みに無い共有先を足すための指定 */
5
+ export interface ShareCustomService {
6
+ /** 一意なキー(React の key に使う) */
7
+ key: string;
8
+ /** ボタンの可視ラベル */
9
+ label: string;
10
+ /** 共有先 URL。`{url}` / `{text}` は共有対象に置換される(どちらも URL エンコード済み) */
11
+ href: string;
12
+ /** ラベル左のアイコン */
13
+ icon?: React.ReactNode;
14
+ /** 読み上げ名(未指定ならラベルをそのまま使う) */
15
+ ariaLabel?: string;
16
+ }
2
17
  export interface ShareButtonsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onCopy"> {
3
18
  /** シェアURL */
4
19
  url?: string;
5
20
  /** シェアテキスト */
6
21
  text?: string;
22
+ /**
23
+ * 表示する共有先と並び順(既定 `["line", "x", "copy"]`)。
24
+ * 組み込みに無い共有先は `ShareCustomService` を混ぜて足す。
25
+ */
26
+ services?: Array<ShareService | ShareCustomService>;
7
27
  /** コピーボタンのラベル */
8
28
  copyLabel?: string;
9
29
  /** コピー成功時に一時表示するラベル(約2秒) */
@@ -16,14 +36,16 @@ export interface ShareButtonsProps extends Omit<React.HTMLAttributes<HTMLDivElem
16
36
  /**
17
37
  * シェアボタンコンポーネント
18
38
  *
19
- * 商品をSNSやURLでシェアするためのボタン群。
20
- * LINE、X(Twitter)、URLコピーに対応。
39
+ * 記事や商品を SNS・URL コピーで共有するためのボタン群。
21
40
  *
22
41
  * ### AI 向け使用ルール
23
42
  *
24
- * - 商品詳細ページの共有セクションに使用
43
+ * - 商品詳細ページ・記事ページの共有セクションに使用
25
44
  * - `url` と `text` でシェア内容を指定
45
+ * - 共有先は `services` で選ぶ(既定は LINE / X / コピー)。
46
+ * **同じ意匠を `Button asChild` で組み直さない**
47
+ * - 組み込みに無い共有先は `services` に `{ key, label, href, icon }` を混ぜて足す
26
48
  * - ボタンは横並び、等幅表示
27
49
  */
28
- declare function ShareButtons({ className, url, text, copyLabel, copiedLabel, copyErrorLabel, onCopy, ...props }: ShareButtonsProps): import("react/jsx-runtime").JSX.Element;
50
+ declare function ShareButtons({ className, url, text, services, copyLabel, copiedLabel, copyErrorLabel, onCopy, ...props }: ShareButtonsProps): import("react/jsx-runtime").JSX.Element;
29
51
  export { ShareButtons };
@@ -1,4 +1,5 @@
1
1
  import * as React from "react";
2
+ import { type LinkComponent } from "../../lib/link-component";
2
3
  export interface SubNavItem {
3
4
  /** 表示ラベル */
4
5
  label: string;
@@ -10,10 +11,22 @@ export interface SubNavItem {
10
11
  isActive?: boolean;
11
12
  }
12
13
  export interface SubNavProps extends React.HTMLAttributes<HTMLDivElement> {
14
+ /**
15
+ * リンクの描画に使うコンポーネント(既定 `a`)。
16
+ * `next/link` 等を渡すとクライアント遷移になる(#236)。
17
+ */
18
+ linkComponent?: LinkComponent;
13
19
  /** ナビゲーション項目 */
14
20
  items: SubNavItem[];
15
21
  /** スタイルバリアント */
16
22
  variant?: "text" | "chip";
23
+ /**
24
+ * ナビ内側の最大幅(`Container` と同じ段)。
25
+ * 指定すると下線(border)は全幅のまま、**中身だけ**を中央寄せする。
26
+ * 本文を `Container size="page"` で組んでいるサイトで、項目の左端が本文と揃う。
27
+ * 未指定なら従来どおり全幅(DOM も従来どおりで内側ラッパーを足さない)。
28
+ */
29
+ containerSize?: "page" | "wide" | "fluid";
17
30
  }
18
31
  /**
19
32
  * ナビゲーションリボンコンポーネント
@@ -29,6 +42,8 @@ export interface SubNavProps extends React.HTMLAttributes<HTMLDivElement> {
29
42
  * - アクティブ項目は `isActive: true` で下線を強調
30
43
  * - テキスト色: アクティブ = 黒(High-Emphasis)、非アクティブ = グレー(Medium-Emphasis)
31
44
  * - 必ず `overflow-x-auto` + `scrollbar-hide` で横スクロール対応
45
+ * - 左右の余白は `Container` と同じ(SP 16 / PC 24)。本文を `Container` で中央寄せしている
46
+ * サイトでは `containerSize="page"` を指定すると項目の左端が本文と揃う
32
47
  */
33
- declare function SubNav({ className, items, variant, ...props }: SubNavProps): import("react/jsx-runtime").JSX.Element;
48
+ declare function SubNav({ className, items, variant, linkComponent, containerSize, ...props }: SubNavProps): import("react/jsx-runtime").JSX.Element;
34
49
  export { SubNav };
@@ -20,7 +20,8 @@ export type { CheckboxGroupProps } from "./components/foundations/checkbox-group
20
20
  export { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/foundations/collapsible";
21
21
  export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from "./components/foundations/command";
22
22
  export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger } from "./components/foundations/context-menu";
23
- export { DataTable } from "./components/foundations/data-table";
23
+ export { DataTable, DataTableTable, DataTableHeader, DataTableBody, DataTableRow, DataTableHead, DataTableCell, DataTableAvatarCell, DataTableImageCell, DataTableLinkCell, DataTableCheckboxCell, DataTableActionCell, DataTableInputCell, DataTableSelectCell, DataTableNumberCell, DataTableDragHandleCell, DataTableBulkActions, DataTableSectionRow, DataTableAddRow, DataTableEmptyState, } from "./components/foundations/data-table";
24
+ export type { SortDirection } from "./components/foundations/data-table";
24
25
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./components/foundations/dialog";
25
26
  export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger } from "./components/foundations/drawer";
26
27
  export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./components/foundations/dropdown-menu";
@@ -91,6 +92,10 @@ export { ChatComposer } from "./components/primitives/chat-composer";
91
92
  export type { ChatComposerProps, ChatComposerAttachmentError } from "./components/primitives/chat-composer";
92
93
  export { Chip, chipVariants } from "./components/primitives/chip";
93
94
  export type { ChipProps } from "./components/primitives/chip";
95
+ export { Prose } from "./components/primitives/prose";
96
+ export type { ProseProps } from "./components/primitives/prose";
97
+ export { ContentCard, ContentList } from "./components/primitives/content-card";
98
+ export type { ContentCardProps, ContentCardOrientation, ContentCardAspect, } from "./components/primitives/content-card";
94
99
  export { StandardPageShell } from "./components/primitives/standard-page-shell";
95
100
  export type { StandardPageShellProps } from "./components/primitives/standard-page-shell";
96
101
  /**
@@ -205,7 +210,7 @@ export { OrderSummary } from "./components/ec/order-summary";
205
210
  export type { OrderSummaryProps, OrderSummaryLineItem } from "./components/ec/order-summary";
206
211
  export { PaymentMethodDisplay, CreditCardIcon } from "./components/ec/payment-method";
207
212
  export type { PaymentMethodDisplayProps, CreditCardIconProps, CreditCardBrand } from "./components/ec/payment-method";
208
- export { ProductCard } from "./components/ec/product-card";
213
+ export { ProductCard, BookmarkRibbonIcon } from "./components/ec/product-card";
209
214
  export type { ProductCardProps } from "./components/ec/product-card";
210
215
  export { ProductCarousel } from "./components/ec/product-carousel";
211
216
  export type { ProductCarouselProps } from "./components/ec/product-carousel";