@cakejp/design-system 0.11.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 (43) hide show
  1. package/CHANGELOG.md +42 -1
  2. package/CLAUDE.md +18 -1
  3. package/README.md +48 -0
  4. package/UPDATING.md +9 -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 +17 -1
  9. package/dist/index.css +1 -1
  10. package/dist/index.js +5266 -3354
  11. package/dist/types/components/ec/admin-shell.d.ts +10 -1
  12. package/dist/types/components/ec/mypage-shell.d.ts +10 -1
  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/standard-page-shell.d.ts +11 -1
  35. package/dist/types/components/primitives/workspace-shell.d.ts +19 -1
  36. package/dist/types/index.d.ts +66 -2
  37. package/package.json +1 -1
  38. package/src/preset-standalone.css +306 -4
  39. package/src/styles/semantic.css +7 -0
  40. package/src/styles/typography.css +8 -1
  41. package/templates/AGENTS.md +9 -0
  42. package/templates/CLAUDE.md +9 -0
  43. 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;
@@ -81,6 +81,15 @@ export interface MypageShellProps {
81
81
  navItems?: HeaderNavItem[];
82
82
  /** SP の戻るボタン押下時のハンドラ(Header variant="back" に委譲) */
83
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;
84
93
  }
85
- declare function MypageShell({ title, activeMenu, currentPath, activeMatch, isActiveMenuItem, children, breadcrumbs, bottomNavItems, menuGroups, headerActions, logo, navItems, 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;
86
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 };
@@ -1,41 +1,68 @@
1
1
  import * as React from "react";
2
+ export type NotFoundIllustrationProps = React.SVGProps<SVGSVGElement>;
3
+ /**
4
+ * NotFound(404)向けの抽象イラスト(ケーキモチーフ / スライスが欠けた図)。
5
+ *
6
+ * 色は CSS 変数と currentColor のみで構成(HEX 直書きなし)。輪郭は
7
+ * currentColor を継承するため、親の text-color で線色を調整できる。
8
+ * 既定は装飾(`aria-hidden`)。単体で意味を持たせる場合は `aria-label` を渡す。
9
+ *
10
+ * ```tsx
11
+ * <NotFoundIllustration className="w-40 text-[var(--Border-Medium-Emphasis)]" />
12
+ * ```
13
+ */
14
+ declare function NotFoundIllustration({ className, "aria-label": ariaLabel, ...props }: NotFoundIllustrationProps): import("react/jsx-runtime").JSX.Element;
15
+ /** ErrorState の種別。既定は汎用エラー、notFound は 404 向けの定番構成 */
16
+ export type ErrorStateKind = "error" | "notFound";
2
17
  export interface ErrorStateProps extends React.HTMLAttributes<HTMLDivElement> {
3
- /** エラーアイコン */
18
+ /**
19
+ * 状態の種別。
20
+ * - `"error"`(既定): 汎用エラー。`icon` を Object-Caution 色で表示(現行不変)
21
+ * - `"notFound"`: 404 向け。既定でケーキイラスト + 見つからない旨の文言
22
+ */
23
+ kind?: ErrorStateKind;
24
+ /** アイコン / イラスト。省略時、notFound は既定イラスト、error は非表示 */
4
25
  icon?: React.ReactNode;
5
- /** エラータイトル */
6
- title: string;
7
- /** エラーの説明テキスト */
26
+ /** タイトル。省略時は kind に応じた既定文言 */
27
+ title?: string;
28
+ /** 説明テキスト。省略時、notFound は既定文言、error は非表示 */
8
29
  description?: React.ReactNode;
9
30
  /** 再試行ボタンのクリックハンドラ。指定すると再試行ボタンを表示 */
10
31
  onRetry?: () => void;
11
32
  /** 再試行ボタンのラベル */
12
33
  retryLabel?: string;
13
- /** 追加アクション(例: 「ホームに戻る」ボタン) */
34
+ /** 追加アクション(例: 「トップへ戻る」ボタン) */
14
35
  action?: React.ReactNode;
15
36
  }
16
37
  /**
17
- * エラー状態コンポーネント
38
+ * エラー状態 / 404 状態コンポーネント
18
39
  *
19
- * APIエラー、ネットワークエラー、タイムアウト等のエラー状態を表示するUI。
20
- * EmptyState と同様のレイアウトだが、再試行アクションに特化。
40
+ * APIエラー・ネットワークエラー・タイムアウト等(`kind="error"`)と、
41
+ * 404 Not Found(`kind="notFound"`)の定番構成を1つのコンポーネントで扱う。
42
+ * EmptyState と同様の中央寄せレイアウト。
21
43
  *
22
44
  * ### AI 向け使用ルール
23
45
  *
24
- * - `icon` にエラー種別に合ったアイコン(size-16)を渡す
25
- * - `title` でエラー内容を簡潔に伝える
26
- * - `description` で対処方法を案内
27
- * - `onRetry` を渡すと再試行ボタンが表示される
28
- * - `action` に追加のナビゲーションボタンを渡せる
29
- * - ページコンテンツの中央に配置
46
+ * - システムエラーは `kind="error"`(既定)。`icon`(size-16)+ `onRetry` を渡す
47
+ * - 404 ページは `kind="notFound"`。イラスト・見出し・説明は既定で入るため
48
+ * 基本は `action`(「トップへ戻る」等の導線)だけ渡せばよい
49
+ * - データが無いだけ(カート空・検索0件)は EmptyState を使う
30
50
  *
31
51
  * ```tsx
52
+ * // 汎用エラー
32
53
  * <ErrorState
33
54
  * icon={<WifiOff className="size-16" />}
34
55
  * title="接続エラー"
35
56
  * description="ネットワークに接続できませんでした。"
36
57
  * onRetry={() => location.reload()}
37
58
  * />
59
+ *
60
+ * // 404
61
+ * <ErrorState
62
+ * kind="notFound"
63
+ * action={<Button size="lg">トップへ戻る</Button>}
64
+ * />
38
65
  * ```
39
66
  */
40
- declare function ErrorState({ className, icon, title, description, onRetry, retryLabel, action, ...props }: ErrorStateProps): import("react/jsx-runtime").JSX.Element;
41
- export { ErrorState };
67
+ declare function ErrorState({ className, kind, icon, title, description, onRetry, retryLabel, action, ...props }: ErrorStateProps): import("react/jsx-runtime").JSX.Element;
68
+ export { ErrorState, NotFoundIllustration };
@@ -44,6 +44,15 @@ export interface FunnelShellProps {
44
44
  bottomAction?: React.ReactNode;
45
45
  /** ルート要素の追加クラス */
46
46
  className?: string;
47
+ /**
48
+ * `<main>` の id(既定 "main-content")。内蔵の SkipLink の飛び先(`#${mainId}`)と対になる。
49
+ */
50
+ mainId?: string;
51
+ /**
52
+ * DOM 先頭に SkipLink(キーボードで本文へ飛ぶ a11y リンク)を標準内蔵する。
53
+ * `sr-only` なので視覚には影響しない。`false` で無効化。
54
+ */
55
+ skipLink?: false;
47
56
  }
48
57
  /**
49
58
  * FunnelShell — EC 購入導線等のファネル用集中モード(Full Page)のシェル。
@@ -81,5 +90,5 @@ export interface FunnelShellProps {
81
90
  * 管理画面の集中編集は `WorkspaceShell`(EC 購入導線=本コンポーネント)。
82
91
  * 判断基準は contracts/screen-patterns.json(focused-workspace)を参照。
83
92
  */
84
- declare function FunnelShell({ logo, title, onBack, backLabel, steps, activeStep, children, bottomAction, className, }: FunnelShellProps): import("react/jsx-runtime").JSX.Element;
93
+ declare function FunnelShell({ logo, title, onBack, backLabel, steps, activeStep, children, bottomAction, className, mainId, skipLink, }: FunnelShellProps): import("react/jsx-runtime").JSX.Element;
85
94
  export { FunnelShell };