@cakejp/design-system 0.10.0 → 0.12.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 (44) hide show
  1. package/CHANGELOG.md +68 -1
  2. package/CLAUDE.md +19 -2
  3. package/README.md +78 -5
  4. package/UPDATING.md +45 -0
  5. package/bin/check-duplicates.mjs +132 -0
  6. package/bin/init.js +8 -0
  7. package/contracts/components.json +175 -21
  8. package/contracts/rules.json +19 -3
  9. package/dist/index.css +1 -1
  10. package/dist/index.js +5326 -3367
  11. package/dist/types/components/ec/admin-shell.d.ts +10 -1
  12. package/dist/types/components/ec/mypage-shell.d.ts +43 -7
  13. package/dist/types/components/ec/product-card.d.ts +3 -1
  14. package/dist/types/components/ec/product-list-item.d.ts +8 -1
  15. package/dist/types/components/foundations/alert.d.ts +5 -1
  16. package/dist/types/components/foundations/button.d.ts +1 -1
  17. package/dist/types/components/foundations/card.d.ts +12 -2
  18. package/dist/types/components/foundations/chip-variants.d.ts +17 -0
  19. package/dist/types/components/foundations/field.d.ts +58 -0
  20. package/dist/types/components/foundations/file-input.d.ts +75 -0
  21. package/dist/types/components/foundations/icon-badge.d.ts +2 -2
  22. package/dist/types/components/foundations/input.d.ts +9 -1
  23. package/dist/types/components/foundations/radio-group.d.ts +12 -2
  24. package/dist/types/components/foundations/skip-link.d.ts +39 -0
  25. package/dist/types/components/foundations/textarea.d.ts +9 -1
  26. package/dist/types/components/primitives/chip.d.ts +2 -7
  27. package/dist/types/components/primitives/content-carousel.d.ts +52 -0
  28. package/dist/types/components/primitives/date-picker.d.ts +32 -0
  29. package/dist/types/components/primitives/error-state.d.ts +43 -16
  30. package/dist/types/components/primitives/funnel-shell.d.ts +10 -1
  31. package/dist/types/components/primitives/header.d.ts +15 -1
  32. package/dist/types/components/primitives/section-nav.d.ts +28 -2
  33. package/dist/types/components/primitives/share-buttons.d.ts +8 -2
  34. package/dist/types/components/primitives/side-nav.d.ts +24 -3
  35. package/dist/types/components/primitives/standard-page-shell.d.ts +11 -1
  36. package/dist/types/components/primitives/workspace-shell.d.ts +19 -1
  37. package/dist/types/index.d.ts +66 -2
  38. package/package.json +8 -26
  39. package/src/preset-standalone.css +306 -4
  40. package/src/styles/semantic.css +7 -0
  41. package/src/styles/typography.css +8 -1
  42. package/templates/AGENTS.md +43 -7
  43. package/templates/CLAUDE.md +44 -7
  44. package/tokens.json +10 -1
@@ -42,5 +42,14 @@ export interface AdminShellProps {
42
42
  onBack?: () => void;
43
43
  /** 戻るボタンのラベル(既定="戻る") */
44
44
  backLabel?: string;
45
+ /**
46
+ * `<main>` の id(既定 "main-content")。内蔵の SkipLink の飛び先(`#${mainId}`)と対になる。
47
+ */
48
+ mainId?: string;
49
+ /**
50
+ * DOM 先頭に SkipLink(キーボードで本文へ飛ぶ a11y リンク)を標準内蔵する。
51
+ * `sr-only` なので視覚には影響しない。`false` で無効化。
52
+ */
53
+ skipLink?: false;
45
54
  }
46
- export declare function AdminShell({ children, activeNav, title, breadcrumbs, shopName, navItems, headerActions, onBack, backLabel, }: AdminShellProps): import("react/jsx-runtime").JSX.Element;
55
+ export declare function AdminShell({ children, activeNav, title, breadcrumbs, shopName, navItems, headerActions, onBack, backLabel, mainId, skipLink, }: AdminShellProps): import("react/jsx-runtime").JSX.Element;
@@ -20,12 +20,15 @@
20
20
  * ## 事業横断での再利用
21
21
  *
22
22
  * 骨格(ヘッダー+2カラム+BottomTabBar)は事業横断で再利用できる。
23
- * ジョブボード等の他事業では `menuGroups` / `breadcrumbs` / `bottomNavItems` / `headerActions`
24
- * を差し替えて骨格を再利用する。既定値は Cake.jp EC のマイページメニュー。
23
+ * ジョブボード・他ブランドの consumer では `logo` / `navItems` / `menuGroups` /
24
+ * `breadcrumbs` / `bottomNavItems` / `headerActions` を差し替えて骨格を再利用する。
25
+ * 既定値は Cake.jp EC(ロゴ=CakeLogo、メニュー=マイページメニュー)。
26
+ * `logo` / `navItems` を渡せば PC ヘッダーのブランドを差し替えられ、
27
+ * 「マイページ配下だけ Cake.jp ロゴに割れる」問題を避けられる。
25
28
  */
26
29
  import React from "react";
27
- import { type HeaderAction } from "../../components/primitives/header";
28
- import { type SideNavGroup } from "../../components/primitives/side-nav";
30
+ import { type HeaderAction, type HeaderNavItem } from "../../components/primitives/header";
31
+ import { type SideNavGroup, type SideNavItem } from "../../components/primitives/side-nav";
29
32
  import { type BottomTabBarItem } from "../../components/primitives/bottom-tab-bar";
30
33
  export interface MypageShellBreadcrumb {
31
34
  label: string;
@@ -34,8 +37,20 @@ export interface MypageShellBreadcrumb {
34
37
  export interface MypageShellProps {
35
38
  /** ページタイトル(SP の h1 + PC の main h1 + 末尾パンくず に使用) */
36
39
  title: string;
37
- /** SideNav の activeMenu に渡すキー */
38
- activeMenu: string;
40
+ /** SideNav の activeMenu に渡すキー(完全一致)。`currentPath` / `isActiveMenuItem` 使用時は省略可。 */
41
+ activeMenu?: string;
42
+ /**
43
+ * 現在の URL パス。渡すと SideNav が `href` と照合してアクティブ項目を自動判定する
44
+ * (`activeMenu` の手動指定が不要になる)。既定の照合は完全一致(`activeMatch="prefix"` で配下ページ全体を対象に)。
45
+ */
46
+ currentPath?: string;
47
+ /**
48
+ * `currentPath` と SideNav 各項目 `href` の照合方法(既定 `"exact"`)。
49
+ * `"prefix"` にすると詳細・配下ページ(例: `/mypage/orders/123/`)でも一覧項目(`/mypage/orders/`)がアクティブになる。
50
+ */
51
+ activeMatch?: "exact" | "prefix";
52
+ /** SideNav のアクティブ判定を上書きする述語(最優先)。consumer 固有の URL 集約ロジックを注入する。 */
53
+ isActiveMenuItem?: (item: SideNavItem) => boolean;
39
54
  /** コンテンツ */
40
55
  children: React.ReactNode;
41
56
  /** パンくず(省略時はデフォルト: ホーム > 山田 太郎 さまのマイページ > {title}) */
@@ -52,8 +67,29 @@ export interface MypageShellProps {
52
67
  * 他事業では差し替えて骨格を再利用する。
53
68
  */
54
69
  headerActions?: HeaderAction[];
70
+ /**
71
+ * PC ヘッダーのロゴ(既定=`CakeLogo`)。
72
+ * 他ブランドの consumer は自社ロゴを渡してマイページのブランド割れを防ぐ。
73
+ * ※ SP は `Header variant="back"`(戻るボタン)でロゴを表示しないため、この prop は PC ヘッダーにのみ作用する。
74
+ */
75
+ logo?: React.ReactNode;
76
+ /**
77
+ * PC ヘッダーのグローバルナビ(既定=なし)。
78
+ * 他ブランドの consumer は自社ナビ(例: 商品を探す/ご利用ガイド/よくある質問)を渡して骨格を再利用する。
79
+ * SP では非表示(`Header` の仕様)。
80
+ */
81
+ navItems?: HeaderNavItem[];
55
82
  /** SP の戻るボタン押下時のハンドラ(Header variant="back" に委譲) */
56
83
  onBack?: () => void;
84
+ /**
85
+ * メインコンテンツ `<main>` の id(既定 "main-content")。内蔵の SkipLink の飛び先(`#${mainId}`)と対になる。
86
+ */
87
+ mainId?: string;
88
+ /**
89
+ * DOM 先頭に SkipLink(キーボードで本文へ飛ぶ a11y リンク)を標準内蔵する。
90
+ * `sr-only` なので視覚には影響しない。`false` で無効化。
91
+ */
92
+ skipLink?: false;
57
93
  }
58
- declare function MypageShell({ title, activeMenu, children, breadcrumbs, bottomNavItems, menuGroups, headerActions, onBack, }: MypageShellProps): import("react/jsx-runtime").JSX.Element;
94
+ declare function MypageShell({ title, activeMenu, currentPath, activeMatch, isActiveMenuItem, children, breadcrumbs, bottomNavItems, menuGroups, headerActions, logo, navItems, onBack, mainId, skipLink, }: MypageShellProps): import("react/jsx-runtime").JSX.Element;
59
95
  export { MypageShell };
@@ -11,6 +11,8 @@ export interface ProductCardProps extends React.HTMLAttributes<HTMLDivElement> {
11
11
  price: number;
12
12
  /** 元の金額(割引表示用) */
13
13
  originalPrice?: number;
14
+ /** 規格・仕様の短い自由記述(例: "1kg / 冷蔵")。価格表示の直下に表示。tags(配送方法等のenum)とは別物 */
15
+ caption?: string;
14
16
  /** 評価値 (0〜5) */
15
17
  rating?: number;
16
18
  /** レビュー件数 */
@@ -73,5 +75,5 @@ export declare function BookmarkRibbonIcon({ size, filled }: {
73
75
  * - `showCartButton` で「カートに追加」ボタン表示(verticalのみ)
74
76
  * - ランキングバッジ、お気に入り、割引バッジなどEC必須要素を統合提供
75
77
  */
76
- declare function ProductCard({ className, name, imageUrl, imageAlt, price, originalPrice, rating, reviewCount, shopName, shopHref, tags, isFavorite, onFavoriteToggle, onCardClick, href, ranking, deliveryDate, orientation, showDiscountBadge, showCartButton, onCartAdd, cartButtonLabel, ...props }: ProductCardProps): import("react/jsx-runtime").JSX.Element;
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;
77
79
  export { ProductCard };
@@ -10,6 +10,8 @@ export interface ProductListItemProps extends React.HTMLAttributes<HTMLDivElemen
10
10
  imageUrl?: string;
11
11
  /** 価格 */
12
12
  price?: number;
13
+ /** 規格・仕様の短い自由記述(例: "1kg / 冷蔵")。価格表示の直下に表示。tags(配送方法等のenum)とは別物 */
14
+ caption?: string;
13
15
  /** ショップ名 */
14
16
  shopName?: string;
15
17
  /** ショップリンクURL */
@@ -64,6 +66,10 @@ export interface ProductListItemProps extends React.HTMLAttributes<HTMLDivElemen
64
66
  onSaveForLater?: () => void;
65
67
  /** 画像サイズクラス(cart variant、デフォルト: "size-20") */
66
68
  imageSize?: string;
69
+ /** 商品ごとの小計(cart variantのみ)。数量セレクタ行の右側(収まらなければ下)に表示 */
70
+ subtotal?: number;
71
+ /** 小計のラベル(cart variantのみ、既定: "小計") */
72
+ subtotalLabel?: string;
67
73
  /** 左側スロット(画像の代わりに任意コンテンツ) */
68
74
  leftSlot?: React.ReactNode;
69
75
  /** 右側スロット(ブックマークの代わりに任意コンテンツ) */
@@ -82,9 +88,10 @@ export interface ProductListItemProps extends React.HTMLAttributes<HTMLDivElemen
82
88
  * - 注文履歴: `<ListItem variant="order-history" />`
83
89
  * - カート内: `<ListItem variant="cart" quantity={1} price={4980} onQuantityChange={...} />`
84
90
  * - cart variant は `CartItem` ラッパーコンポーネント経由でも使用可能
91
+ * - ロット購入等で商品ごとの小計を出す場合: `subtotal={4980 * quantity}`(既定ラベル「小計」、`subtotalLabel` で変更可)
85
92
  * - レビュー画面: `<ListItem variant="review" showDetailButton showCartButton />`
86
93
  * - 小さい: `<ListItem variant="small" />`
87
94
  * - 極小: `<ListItem variant="xsm" />`
88
95
  */
89
- declare function ProductListItem({ name, imageUrl, price, shopName, shopHref, brandName, tags, hashTags, statusLabel, variant, showCartButton, onAddToCart, showDetailButton, onViewDetail, showBookmark, href, orderDate, deliveryInfo, totalPrice, showReviewButton, optionInfo, quantity, onQuantityChange, quantitySize, originalPrice, priceLabel, deliveryText, onDelete, onSaveForLater, imageSize, leftSlot, rightSlot, bottomSlot, className, ...props }: ProductListItemProps): import("react/jsx-runtime").JSX.Element;
96
+ declare function ProductListItem({ name, imageUrl, price, caption, shopName, shopHref, brandName, tags, hashTags, statusLabel, variant, showCartButton, onAddToCart, showDetailButton, onViewDetail, showBookmark, href, orderDate, deliveryInfo, totalPrice, showReviewButton, optionInfo, quantity, onQuantityChange, quantitySize, originalPrice, priceLabel, deliveryText, onDelete, onSaveForLater, imageSize, subtotal, subtotalLabel, leftSlot, rightSlot, bottomSlot, className, ...props }: ProductListItemProps): import("react/jsx-runtime").JSX.Element;
90
97
  export { ProductListItem };
@@ -14,9 +14,13 @@ import { type VariantProps } from "class-variance-authority";
14
14
  * - Tinted background, no border
15
15
  * - Compact: padding 8px 12px, rounded-sm (3px), gap 4px
16
16
  * - Icon (20px) + content column layout
17
+ * - **prop-based API 対応**(#109): title / description / icon / action を直接渡せる
17
18
  *
18
19
  * 旧 `<Banner>` の用途は bordered variant + prop-based API で完全カバー:
19
20
  * <Alert variant="warning" title="..." description="..." action={<Button />} />
21
+ *
22
+ * フォーム内・セクション内の軽量な補足情報は inline variant + prop-based API で組める:
23
+ * <Alert variant="inline-info" title="..." description="..." />
20
24
  */
21
25
  declare const alertVariants: (props?: {
22
26
  variant?: "success" | "info" | "error" | "warning" | "inline-info" | "inline-caution" | "inline-warning";
@@ -24,7 +28,7 @@ declare const alertVariants: (props?: {
24
28
  type AlertProps = React.ComponentProps<"div"> & VariantProps<typeof alertVariants> & {
25
29
  /**
26
30
  * prop-based API のタイトル(旧 Banner.title 相当)。
27
- * children と排他(children 優先)。bordered variant でのみ有効。
31
+ * children と排他(children 優先)。bordered / inline 両 variant で有効。
28
32
  */
29
33
  title?: React.ReactNode;
30
34
  /** prop-based API の説明テキスト(旧 Banner.description 相当) */
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { type VariantProps } from "class-variance-authority";
3
3
  declare const buttonVariants: (props?: {
4
- variant?: "link" | "default" | "secondary" | "tertiary" | "destructive" | "ghost" | "inverse" | "ghost-inverse";
4
+ variant?: "link" | "default" | "secondary" | "tertiary" | "destructive" | "ghost" | "inverse" | "ghost-inverse" | "overlay";
5
5
  size?: "default" | "icon" | "xs" | "sm" | "lg" | "xl" | "hero" | "icon-xs" | "icon-sm" | "icon-lg";
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> & {
@@ -1,9 +1,19 @@
1
1
  import * as React from "react";
2
- declare function Card({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
2
+ import { type VariantProps } from "class-variance-authority";
3
+ /**
4
+ * Card の背景サーフェス。
5
+ * - `default`: `bg-card`(= Surface-Secondary)。通常の白/明るい地の上で使う既定値。
6
+ * - `primary`: `Surface-Primary`(白)。グレー Section(Surface-Tertiary)の地の上に
7
+ * 置く際、既定の `bg-card` ではコントラストが不足するため白背景に切り替える。
8
+ */
9
+ declare const cardVariants: (props?: {
10
+ surface?: "default" | "primary";
11
+ } & import("class-variance-authority/types").ClassProp) => string;
12
+ declare function Card({ className, surface, ...props }: React.ComponentProps<"div"> & VariantProps<typeof cardVariants>): import("react/jsx-runtime").JSX.Element;
3
13
  declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
4
14
  declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
5
15
  declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
6
16
  declare function CardAction({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
7
17
  declare function CardContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
8
18
  declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
9
- export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
19
+ export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, cardVariants, };
@@ -0,0 +1,17 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ /**
3
+ * Chip / choice-chip の共有バリアント(CVA)。
4
+ *
5
+ * foundations 層に置くことで、Chip(primitives)と RadioGroup の
6
+ * `variant="chip"`(foundations)の双方が同じ意匠を import して再利用できる
7
+ * (primitives→foundations / foundations→foundations はいずれも正方向の依存)。
8
+ *
9
+ * ここが chip 意匠の単一の正典。size / shape / typo / focus リング等を変更すると
10
+ * Chip と RadioGroup の chip variant の両方へ自動追従する。
11
+ */
12
+ export declare const chipVariants: (props?: {
13
+ variant?: "filled" | "accent";
14
+ size?: "sm" | "lg" | "md" | "tile";
15
+ shape?: "pill" | "square";
16
+ } & import("class-variance-authority/types").ClassProp) => string;
17
+ export type ChipVariantProps = VariantProps<typeof chipVariants>;
@@ -0,0 +1,58 @@
1
+ /**
2
+ * ## Field 群 / フォームレイアウト primitive
3
+ *
4
+ * `FormField`(Label + 入力 + エラーのセット)を核に、フォーム全体の
5
+ * レイアウト(見出し・グループ・説明・エラー・区切り)を組む補助群。
6
+ * shadcn の field パターンを DS の Label / Separator / トークンに合わせて実装。
7
+ *
8
+ * ### インポート
9
+ * ```tsx
10
+ * import { FieldSet, FieldLegend, FieldGroup, FieldDescription, FieldError, FieldSeparator } from "../../components/foundations/field"
11
+ * ```
12
+ *
13
+ * ### 構成要素
14
+ * | 要素 | DOM | 役割 |
15
+ * |------|-----|------|
16
+ * | `FieldSet` | `<fieldset>` | フォーム全体 or 大セクション。legend + 複数グループを縦リズム gap-6 で並べる |
17
+ * | `FieldLegend` | `<legend>` | FieldSet の見出し |
18
+ * | `FieldGroup` | `<div role="group">` | 関連する複数フィールドを section-content リズム gap-4 で束ねる |
19
+ * | `FieldDescription` | `<p>` | 補足テキスト(FormField の description と同意匠) |
20
+ * | `FieldError` | `<p role="alert">` | エラーメッセージ(children が空なら描画しない) |
21
+ * | `FieldSeparator` | `<Separator>` ラップ | フィールド群の区切り。children を渡すと中央ラベル付き |
22
+ *
23
+ * ### AI 向け使用ルール
24
+ * - 個々の入力欄は `FormField`(primitives)を使う。Field 群はその外側の骨格を組む
25
+ * - 余白は composition.json の縦リズムに従う(FieldSet=gap-6 / FieldGroup=gap-4)。手で mt-/mb- を足さない
26
+ * - 見出しは `FieldLegend`、グループ横断の区切りは `FieldSeparator` を使う
27
+ */
28
+ import * as React from "react";
29
+ /**
30
+ * FieldSet — フォーム全体 or 大きなセクションの枠。
31
+ * `<fieldset>` の既定スタイル(ブラウザ枠線・padding)をリセットし、
32
+ * legend + 複数 `FieldGroup` を gap-6 の縦リズムで並べる。
33
+ */
34
+ declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">): import("react/jsx-runtime").JSX.Element;
35
+ /**
36
+ * FieldLegend — FieldSet の見出し。`<legend>` として描画。
37
+ */
38
+ declare function FieldLegend({ className, ...props }: React.ComponentProps<"legend">): import("react/jsx-runtime").JSX.Element;
39
+ /**
40
+ * FieldGroup — 関連する複数フィールドを束ねるコンテナ。
41
+ * section-content リズム(gap-4)で縦に並べる。
42
+ */
43
+ declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
44
+ /**
45
+ * FieldDescription — 補足テキスト。FormField の description と同じ意匠。
46
+ */
47
+ declare function FieldDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
48
+ /**
49
+ * FieldError — エラーメッセージ。children が空なら何も描画しない。
50
+ * `role="alert"` でスクリーンリーダーに即時通知する。
51
+ */
52
+ declare function FieldError({ className, children, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
53
+ /**
54
+ * FieldSeparator — フィールド群の区切り。DS の Separator をラップし
55
+ * 上下に余白を持たせる。children を渡すと中央にラベル(「または」等)を表示。
56
+ */
57
+ declare function FieldSeparator({ className, children, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
58
+ export { FieldSet, FieldLegend, FieldGroup, FieldDescription, FieldError, FieldSeparator, };
@@ -0,0 +1,75 @@
1
+ /** maxSize 超過などの理由でファイルが受理されなかったときのコールバック引数。 */
2
+ export interface FileInputError {
3
+ /** エラー種別。現状は maxSize 超過のみ。 */
4
+ code: "max-size";
5
+ /** 対象ファイル */
6
+ file: File;
7
+ /** 上限バイト数 */
8
+ maxSize: number;
9
+ }
10
+ export interface FileInputProps {
11
+ /** `<input>` の id。外側 Label の htmlFor と揃えて紐付ける。 */
12
+ id?: string;
13
+ /** input name(フォーム送信用) */
14
+ name?: string;
15
+ /** 受け付ける MIME/拡張子(例: "image/*,.pdf") */
16
+ accept?: string;
17
+ /** 複数選択を許可。true のとき選択済みは「n件選択」で集約表示する。 */
18
+ multiple?: boolean;
19
+ /** 1ファイルあたりの上限バイト数。超過ファイルは受理せず onError を呼ぶ。 */
20
+ maxSize?: number;
21
+ /** 無効化 */
22
+ disabled?: boolean;
23
+ /** 未選択時のプレースホルダ文言 */
24
+ placeholder?: string;
25
+ /** 「ファイルを選択」ボタンの文言 */
26
+ buttonLabel?: string;
27
+ /**
28
+ * 制御用の選択ファイル。指定すると表示はこの値に従う(controlled)。
29
+ * 未指定なら内部 state で保持する(uncontrolled)。
30
+ */
31
+ value?: File[];
32
+ /** 選択ファイルが変わったときのコールバック(受理されたファイルのみ)。 */
33
+ onFilesChange?: (files: File[]) => void;
34
+ /** maxSize 超過など、ファイルが受理されなかったときのコールバック。 */
35
+ onError?: (error: FileInputError) => void;
36
+ /** Field 群のエラー表示等と紐付ける(`<input>` に付与) */
37
+ "aria-describedby"?: string;
38
+ /** エラー状態(`<input>` に付与) */
39
+ "aria-invalid"?: boolean | "true" | "false";
40
+ /** 追加クラス(ルート要素) */
41
+ className?: string;
42
+ }
43
+ /**
44
+ * 選択ファイルの表示名を組み立てる。0件=空文字、1件=ファイル名、複数=「n件選択」。
45
+ */
46
+ export declare function formatFileNames(files: File[]): string;
47
+ /**
48
+ * maxSize でファイルを受理/非受理に振り分ける。maxSize 未指定なら全件受理。
49
+ */
50
+ export declare function validateFileSize(files: File[], maxSize?: number): {
51
+ accepted: File[];
52
+ rejected: File[];
53
+ };
54
+ /**
55
+ * ## FileInput / ファイル入力
56
+ *
57
+ * 汎用ファイル添付の1行フォーム部品。「ファイルを選択」ボタン + 選択済みファイル名 + クリアボタン。
58
+ * ネイティブ `<input type="file">` を visually-hidden で内包し、キーボード・スクリーンリーダーで操作可能。
59
+ *
60
+ * ### ImageUploader との使い分け
61
+ * - プレビュー付きの画像管理(並び替え・複数サムネイル)→ `ImageUploader`
62
+ * - 画像以外も含む汎用の添付(PDF・CSV 等)→ `FileInput`
63
+ *
64
+ * ### インポート
65
+ * ```tsx
66
+ * import { FileInput } from '../../components/foundations/file-input'
67
+ * ```
68
+ *
69
+ * ### AI 向け使用ルール
70
+ * - `<input type="file">` を直接書かず FileInput を使う
71
+ * - `id` を外側の Label / FormField の htmlFor と揃えて紐付ける
72
+ * - エラー表示は `aria-describedby` で FieldError と接続する
73
+ */
74
+ declare function FileInput({ id, name, accept, multiple, maxSize, disabled, placeholder, buttonLabel, value, onFilesChange, onError, className, "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, }: FileInputProps): import("react/jsx-runtime").JSX.Element;
75
+ export { FileInput };
@@ -9,10 +9,10 @@ import { type VariantProps } from "class-variance-authority";
9
9
  * バッジ側に `mt-/mb-` を内蔵すると Card の gap と二重がけになり間延びするため。
10
10
  * - アイコン色は `currentColor`(= `--Object-Accent-Primary`)を継承する。
11
11
  * 中の Lucide / iconsax アイコンに `color` を渡す必要はない。
12
- * - 内部 SVG のサイズはバッジが固定する(md=20px / lg=38px)。アイコン側の `size` は不要。
12
+ * - 内部 SVG のサイズはバッジが固定する(md=20px / ml=24px / lg=38px)。アイコン側の `size` は不要。
13
13
  */
14
14
  declare const iconBadgeVariants: (props?: {
15
- size?: "lg" | "md";
15
+ size?: "lg" | "md" | "ml";
16
16
  } & import("class-variance-authority/types").ClassProp) => string;
17
17
  declare function IconBadge({ className, size, ...props }: React.ComponentProps<"div"> & VariantProps<typeof iconBadgeVariants>): import("react/jsx-runtime").JSX.Element;
18
18
  export { IconBadge, iconBadgeVariants };
@@ -1,3 +1,11 @@
1
1
  import * as React from "react";
2
- declare function Input({ className, type, ...props }: React.ComponentProps<"input">): import("react/jsx-runtime").JSX.Element;
2
+ export interface InputProps extends React.ComponentProps<"input"> {
3
+ /**
4
+ * 文字数カウンタを表示する。`maxLength` とセットで使い、入力欄の
5
+ * 右下に `{現在}/{max}` を表示する。上限に達すると Text-Caution 色になる。
6
+ * 制御(`value`)/ 非制御(`defaultValue`)どちらでも追従する。
7
+ */
8
+ showCount?: boolean;
9
+ }
10
+ declare function Input({ className, type, showCount, maxLength, value, defaultValue, onChange, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
3
11
  export { Input };
@@ -1,9 +1,19 @@
1
1
  import * as React from "react";
2
2
  import { RadioGroup as RadioGroupPrimitive } from "radix-ui";
3
- declare function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
3
+ /** RadioGroup の描画スタイル。tile=タイル型(既定)/ chip=チップ型(choice chip)。 */
4
+ export type RadioGroupVariant = "tile" | "chip";
5
+ declare function RadioGroup({ className, variant, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root> & {
6
+ /**
7
+ * 描画スタイル。
8
+ * - `"tile"`(既定): タイル型。ラジオ丸 + ラベル + 補足説明 + 展開コンテンツ。
9
+ * - `"chip"`: choice chip 型。ラベルを内包した Chip 意匠で排他選択を組む(タグ選択・絞り込み等)。
10
+ * Radix RadioGroup のキーボード操作・a11y はそのまま維持される。
11
+ */
12
+ variant?: RadioGroupVariant;
13
+ }): import("react/jsx-runtime").JSX.Element;
4
14
  declare function RadioGroupItem({ className, children, description, expandedContent, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item> & {
5
15
  description?: React.ReactNode;
6
- /** 選択時に展開表示するコンテンツ */
16
+ /** 選択時に展開表示するコンテンツ(tile variant のみ) */
7
17
  expandedContent?: React.ReactNode;
8
18
  }): import("react/jsx-runtime").JSX.Element;
9
19
  export { RadioGroup, RadioGroupItem };
@@ -0,0 +1,39 @@
1
+ import * as React from "react";
2
+ export interface SkipLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
3
+ /** スキップ先アンカー(既定 `#main-content`。シェルの `mainId` と対応させる) */
4
+ href?: string;
5
+ /** リンクの文言(既定「コンテンツへ移動」) */
6
+ label?: string;
7
+ }
8
+ /**
9
+ * SkipLink — キーボード操作でグローバルナビを飛ばして本文へ移動する a11y リンク。
10
+ *
11
+ * 通常は視覚的に隠れており(`sr-only`)、Tab フォーカスが当たった瞬間だけ
12
+ * 左上に可視化される。スクリーンリーダー/キーボードユーザーがヘッダーの
13
+ * 反復リンクをスキップして `#main-content`(= シェルの `<main id>`)へ直接
14
+ * 到達できるようにする。WCAG 2.4.1(Bypass Blocks)対応の定番部品。
15
+ *
16
+ * 各シェル(StandardPageShell / FunnelShell / WorkspaceShell / AdminShell /
17
+ * MypageShell)は本コンポーネントを DOM 先頭に標準内蔵するため、シェルを使う限り
18
+ * 個別ページで手組みする必要はない(`skipLink={false}` で無効化可能)。
19
+ *
20
+ * ### インポート
21
+ * ```tsx
22
+ * import { SkipLink } from '../../components/foundations/skip-link'
23
+ * ```
24
+ *
25
+ * ### 使い方(シェルを使わず素の DOM に置く場合)
26
+ * ```tsx
27
+ * <SkipLink />
28
+ * <main id="main-content">…</main>
29
+ * ```
30
+ *
31
+ * ### Props
32
+ * | Prop | 型 | デフォルト | 説明 |
33
+ * |------|-----|-----------|------|
34
+ * | href | string | "#main-content" | スキップ先アンカー |
35
+ * | label | string | "コンテンツへ移動" | リンク文言 |
36
+ * | className | string | — | 追加CSSクラス |
37
+ */
38
+ declare function SkipLink({ href, label, className, ...props }: SkipLinkProps): import("react/jsx-runtime").JSX.Element;
39
+ export { SkipLink };
@@ -1,3 +1,11 @@
1
1
  import * as React from "react";
2
- declare function Textarea({ className, ...props }: React.ComponentProps<"textarea">): import("react/jsx-runtime").JSX.Element;
2
+ export interface TextareaProps extends React.ComponentProps<"textarea"> {
3
+ /**
4
+ * 文字数カウンタを表示する。`maxLength` とセットで使い、入力欄の
5
+ * 右下に `{現在}/{max}` を表示する。上限に達すると Text-Caution 色になる。
6
+ * 制御(`value`)/ 非制御(`defaultValue`)どちらでも追従する。
7
+ */
8
+ showCount?: boolean;
9
+ }
10
+ declare function Textarea({ className, showCount, maxLength, value, defaultValue, onChange, ...props }: TextareaProps): import("react/jsx-runtime").JSX.Element;
3
11
  export { Textarea };
@@ -1,11 +1,6 @@
1
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> {
2
+ import { chipVariants, type ChipVariantProps } from "../../components/foundations/chip-variants";
3
+ export interface ChipProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, ChipVariantProps {
9
4
  /** リンクとして使う場合のURL */
10
5
  href?: string;
11
6
  /** 選択状態 */
@@ -0,0 +1,52 @@
1
+ import * as React from "react";
2
+ export interface ContentCarouselProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
3
+ /**
4
+ * スライド内容(ReactNode)のリスト。
5
+ * 画像URLではなく任意の JSX を受けるため、eyebrow / タイトル / 本文 / 価格 /
6
+ * バッジで構成したテキスト主体のヒーローバナー等を組める。
7
+ * 各スライドは DS コンポーネント(Badge, Button 等)と typo-* / セマンティック
8
+ * トークンで組むこと(スクラッチ禁止ルール準拠)。
9
+ */
10
+ slides: React.ReactNode[];
11
+ /** ドットインジケーター表示 */
12
+ showDots?: boolean;
13
+ /** 矢印ナビゲーション表示 */
14
+ showArrows?: boolean;
15
+ /** 自動再生(ミリ秒、0で無効) */
16
+ autoPlay?: number;
17
+ /**
18
+ * SP: 隣スライドをのぞかせる(peek)表示。
19
+ * true にすると各スライドが `calc(100% - 48px)` 幅になり、
20
+ * 右端に次スライドが見える。PC (@[960px]:) は常に全幅。
21
+ */
22
+ peek?: boolean;
23
+ /** カルーセル全体の aria-label(スクリーンリーダー向け説明) */
24
+ ariaLabel?: string;
25
+ }
26
+ /**
27
+ * コンテンツカルーセル — ReactNode スライド対応
28
+ *
29
+ * `ImageCarousel` と同じ CSS scroll-snap ベースの実装だが、`images: string[]` ではなく
30
+ * `slides: ReactNode[]` を受け取る。テキスト主体のプロモスライド(eyebrow / タイトル /
31
+ * 本文 / 価格 / バッジ、画像は任意)を DS が autoplay / 矢印 / ドット / スワイプ付きで
32
+ * 提供し、consumer 側の手組みカルーセル(→意匠ドリフト)を不要にする。
33
+ *
34
+ * 矢印・ドットの意匠は `ImageCarousel` と同一(同じ markup を流用)。
35
+ *
36
+ * - SP(狭幅): スワイプ操作 + ドットインジケーター、矢印は非表示
37
+ * - PC(@md: 以上): 左右矢印ボタン(ホバーで出現)、ドット非表示
38
+ *
39
+ * ### インポート
40
+ * ```tsx
41
+ * import { ContentCarousel } from '../../components/primitives/content-carousel'
42
+ * ```
43
+ *
44
+ * ### AI 向け使用ルール
45
+ *
46
+ * - スライド内容は DS コンポーネント(Badge, Button, PriceDisplay 等)と
47
+ * typo-* / セマンティックトークンで組む(生の色・影・角丸は禁止)
48
+ * - 画像だけのバナーは `ImageCarousel` を使う(こちらはテキスト主体向け)
49
+ * - 自動再生: `<ContentCarousel autoPlay={5000} />`
50
+ */
51
+ declare function ContentCarousel({ slides, showDots, showArrows, autoPlay, peek, ariaLabel, className, ...props }: ContentCarouselProps): import("react/jsx-runtime").JSX.Element;
52
+ export { ContentCarousel };
@@ -0,0 +1,32 @@
1
+ import type { Matcher } from "react-day-picker";
2
+ export interface DatePickerProps {
3
+ /** 選択中の日付 */
4
+ value?: Date;
5
+ /** 日付が変わったときに呼ばれる。クリアされると `undefined` */
6
+ onChange?: (date?: Date) => void;
7
+ /** 未選択時の trigger 表示 */
8
+ placeholder?: string;
9
+ /** 選択可能な最小日(これより前を無効化) */
10
+ min?: Date;
11
+ /** 選択可能な最大日(これより後を無効化) */
12
+ max?: Date;
13
+ /** 個別に無効化する日(Calendar の disabled マッチャーをそのまま透過) */
14
+ disabledDates?: Matcher | Matcher[];
15
+ /** trigger を無効化する */
16
+ disabled?: boolean;
17
+ /** trigger の id(FormField の htmlFor と接続) */
18
+ id?: string;
19
+ /** 追加クラス(trigger に付与) */
20
+ className?: string;
21
+ }
22
+ declare function DatePicker({ value, onChange, placeholder, min, max, disabledDates, disabled, id, className, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
23
+ export interface DateTimePickerProps extends DatePickerProps {
24
+ /** 分の刻み(分 Select の選択肢間隔)。既定 5 分 */
25
+ minuteStep?: number;
26
+ /** 時 Select の aria-label。既定「時」 */
27
+ hourLabel?: string;
28
+ /** 分 Select の aria-label。既定「分」 */
29
+ minuteLabel?: string;
30
+ }
31
+ declare function DateTimePicker({ value, onChange, minuteStep, hourLabel, minuteLabel, disabled, className, ...dateProps }: DateTimePickerProps): import("react/jsx-runtime").JSX.Element;
32
+ export { DatePicker, DateTimePicker };