@cakejp/design-system 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +179 -0
- package/CLAUDE.md +5 -3
- package/MIGRATION.md +3 -3
- package/README.md +31 -11
- package/contracts/components.json +424 -62
- package/contracts/composition.json +38 -4
- package/contracts/rules.json +27 -5
- package/contracts/screen-patterns.json +6 -4
- package/dist/components/ec/admin-shell.js +62 -60
- package/dist/components/ec/anniversary-card.js +13 -12
- package/dist/components/ec/coupon-card.js +11 -11
- package/dist/components/ec/delivery-calendar.js +51 -45
- package/dist/components/ec/mypage-shell.js +80 -69
- package/dist/components/ec/product-card.js +93 -76
- package/dist/components/ec/product-carousel.js +65 -60
- package/dist/components/ec/product-detail-bar.js +13 -11
- package/dist/components/ec/product-detail-sidebar.js +60 -58
- package/dist/components/ec/product-list-item.js +64 -63
- package/dist/components/ec/product-option.js +30 -26
- package/dist/components/ec/rating-stars.js +27 -27
- package/dist/components/ec/review-card.js +32 -32
- package/dist/components/ec/review-form.js +37 -37
- package/dist/components/ec/shop-card.js +21 -19
- package/dist/components/foundations/accordion.js +33 -31
- package/dist/components/foundations/alert-dialog.js +4 -5
- package/dist/components/foundations/badge.js +5 -5
- package/dist/components/foundations/breadcrumb.js +27 -26
- package/dist/components/foundations/button.js +144 -25
- package/dist/components/foundations/calendar.js +28 -26
- package/dist/components/foundations/checkbox-card.js +71 -47
- package/dist/components/foundations/checkbox-group.js +30 -27
- package/dist/components/foundations/checkbox.js +69 -52
- package/dist/components/foundations/chip-variants.js +13 -0
- package/dist/components/foundations/command.js +81 -79
- package/dist/components/foundations/confirm-dialog.js +136 -0
- package/dist/components/foundations/context-menu.js +43 -38
- package/dist/components/foundations/data-table.js +88 -84
- package/dist/components/foundations/dialog.js +45 -36
- package/dist/components/foundations/dropdown-menu.js +47 -42
- package/dist/components/foundations/file-input.js +97 -67
- package/dist/components/foundations/hover-card.js +21 -21
- package/dist/components/foundations/menubar.js +75 -69
- package/dist/components/foundations/navigation-menu.js +31 -26
- package/dist/components/foundations/pagination.js +54 -50
- package/dist/components/foundations/popover.js +7 -7
- package/dist/components/foundations/progress.js +10 -6
- package/dist/components/foundations/radio-group.js +6 -3
- package/dist/components/foundations/responsive-dialog.js +73 -55
- package/dist/components/foundations/scroll-area.js +18 -14
- package/dist/components/foundations/select.js +44 -39
- package/dist/components/foundations/sheet.js +45 -37
- package/dist/components/foundations/skeleton.js +6 -6
- package/dist/components/foundations/skip-link.js +10 -8
- package/dist/components/foundations/slider.js +73 -48
- package/dist/components/foundations/sonner.js +5 -4
- package/dist/components/foundations/spinner.js +7 -5
- package/dist/components/foundations/switch.js +11 -10
- package/dist/components/foundations/tabs.js +54 -39
- package/dist/components/foundations/toggle-group.js +29 -21
- package/dist/components/foundations/toggle.js +20 -16
- package/dist/components/primitives/admin-side-nav.js +65 -62
- package/dist/components/primitives/banner-carousel.js +32 -29
- package/dist/components/primitives/bottom-tab-bar.js +16 -15
- package/dist/components/primitives/category-scroll.js +39 -29
- package/dist/components/primitives/category-shortcuts.js +9 -9
- package/dist/components/primitives/chat-composer.js +77 -74
- package/dist/components/primitives/chip.js +84 -61
- package/dist/components/primitives/combobox.js +63 -47
- package/dist/components/primitives/container.js +9 -9
- package/dist/components/primitives/content-card.js +15 -17
- package/dist/components/primitives/content-carousel.js +79 -68
- package/dist/components/primitives/date-picker.js +137 -99
- package/dist/components/primitives/footer.js +36 -37
- package/dist/components/primitives/header.js +175 -168
- package/dist/components/primitives/image-carousel.js +107 -87
- package/dist/components/primitives/image-gallery.js +32 -27
- package/dist/components/primitives/image-uploader.js +43 -22
- package/dist/components/primitives/list-item.js +59 -51
- package/dist/components/primitives/menu-drawer.js +36 -38
- package/dist/components/primitives/multi-select.js +89 -58
- package/dist/components/primitives/notification-list.js +10 -9
- package/dist/components/primitives/number-input.js +116 -105
- package/dist/components/primitives/scroll-row.js +21 -0
- package/dist/components/primitives/search-bar.js +31 -28
- package/dist/components/primitives/section-header.js +54 -53
- package/dist/components/primitives/side-nav.js +57 -56
- package/dist/components/primitives/sub-nav.js +13 -14
- package/dist/components/primitives/tag.js +4 -2
- package/dist/index.css +1 -1
- package/dist/index.js +3076 -929
- package/dist/lib/field-labelling.js +31 -21
- package/dist/lib/focus-ring.js +22 -4
- package/dist/lib/high-contrast.js +4 -0
- package/dist/lib/image-index.js +8 -0
- package/dist/lib/use-prefers-reduced-motion.js +21 -0
- package/dist/types/components/ec/admin-shell.d.ts +11 -1
- package/dist/types/components/ec/anniversary-card.d.ts +9 -1
- package/dist/types/components/ec/mypage-shell.d.ts +12 -1
- package/dist/types/components/ec/product-card.d.ts +13 -1
- package/dist/types/components/ec/product-carousel.d.ts +13 -1
- package/dist/types/components/ec/product-detail-bar.d.ts +12 -1
- package/dist/types/components/ec/product-detail-sidebar.d.ts +11 -1
- package/dist/types/components/ec/product-list-item.d.ts +9 -1
- package/dist/types/components/ec/rating-stars.d.ts +2 -0
- package/dist/types/components/ec/review-card.d.ts +1 -1
- package/dist/types/components/ec/shop-card.d.ts +8 -1
- package/dist/types/components/foundations/badge.d.ts +1 -1
- package/dist/types/components/foundations/breadcrumb.d.ts +8 -1
- package/dist/types/components/foundations/button.d.ts +38 -3
- package/dist/types/components/foundations/checkbox-card.d.ts +7 -1
- package/dist/types/components/foundations/checkbox.d.ts +1 -1
- package/dist/types/components/foundations/chip-variants.d.ts +2 -2
- package/dist/types/components/foundations/confirm-dialog.d.ts +61 -0
- package/dist/types/components/foundations/data-table.d.ts +9 -2
- package/dist/types/components/foundations/dialog.d.ts +16 -1
- package/dist/types/components/foundations/pagination.d.ts +1 -1
- package/dist/types/components/foundations/responsive-dialog.d.ts +2 -1
- package/dist/types/components/foundations/sheet.d.ts +12 -1
- package/dist/types/components/foundations/skeleton.d.ts +6 -0
- package/dist/types/components/foundations/slider.d.ts +15 -1
- package/dist/types/components/foundations/tabs.d.ts +7 -0
- package/dist/types/components/primitives/admin-side-nav.d.ts +22 -2
- package/dist/types/components/primitives/banner-carousel.d.ts +9 -1
- package/dist/types/components/primitives/bottom-tab-bar.d.ts +13 -2
- package/dist/types/components/primitives/category-scroll.d.ts +10 -1
- package/dist/types/components/primitives/category-shortcuts.d.ts +11 -2
- package/dist/types/components/primitives/chip.d.ts +22 -3
- package/dist/types/components/primitives/combobox.d.ts +7 -2
- package/dist/types/components/primitives/container.d.ts +3 -0
- package/dist/types/components/primitives/content-card.d.ts +1 -1
- package/dist/types/components/primitives/content-carousel.d.ts +12 -4
- package/dist/types/components/primitives/date-picker.d.ts +10 -3
- package/dist/types/components/primitives/footer.d.ts +1 -1
- package/dist/types/components/primitives/header.d.ts +14 -2
- package/dist/types/components/primitives/image-carousel.d.ts +23 -5
- package/dist/types/components/primitives/list-item.d.ts +10 -1
- package/dist/types/components/primitives/menu-drawer.d.ts +1 -1
- package/dist/types/components/primitives/multi-select.d.ts +7 -2
- package/dist/types/components/primitives/notification-list.d.ts +10 -1
- package/dist/types/components/primitives/number-input.d.ts +18 -5
- package/dist/types/components/primitives/scroll-row.d.ts +43 -0
- package/dist/types/components/primitives/section-header.d.ts +9 -2
- package/dist/types/components/primitives/side-nav.d.ts +13 -1
- package/dist/types/components/primitives/sub-nav.d.ts +1 -1
- package/dist/types/components/primitives/tag.d.ts +1 -1
- package/dist/types/index.d.ts +7 -1
- package/dist/types/lib/field-labelling.d.ts +23 -8
- package/dist/types/lib/focus-ring.d.ts +70 -3
- package/dist/types/lib/high-contrast.d.ts +25 -0
- package/dist/types/lib/image-index.d.ts +2 -0
- package/dist/types/lib/link-component.d.ts +26 -21
- package/dist/types/lib/use-prefers-reduced-motion.d.ts +9 -0
- package/package.json +11 -3
- package/src/components/COMPONENT_LOOKUP.md +19 -17
- package/src/preset-standalone.css +42 -0
- package/src/preset.css +20 -1
- package/src/styles/semantic.css +57 -0
- package/templates/AGENTS.md +5 -1
- package/templates/CLAUDE.md +3 -1
- package/tokens.json +49 -0
- package/dist/lib/link-component.js +0 -6
|
@@ -5,8 +5,23 @@ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogP
|
|
|
5
5
|
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
|
|
8
|
+
type DialogSize = "sm" | "md" | "lg" | "xl";
|
|
9
|
+
declare function DialogContent({ className, children, showCloseButton, size, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
10
|
showCloseButton?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 幅の段。sm 以上の画面で効く(SP は段に関係なく画面端から 16px を残して収まる)。
|
|
13
|
+
* - "sm": 400px(短い確認・1 項目の入力)
|
|
14
|
+
* - "md": 512px(標準的なフォーム)
|
|
15
|
+
* - "lg": 640px(複数項目のフォーム)
|
|
16
|
+
* - "xl": 800px(表やプレビューを載せる広いダイアログ)
|
|
17
|
+
*
|
|
18
|
+
* 未指定は従来の幅(`sm:max-w-lg`)のまま。DS の preset が `--container-lg` を 960px に
|
|
19
|
+
* 再定義しているため、preset を読み込んだ環境の未指定の実幅は 512px ではなく 960px。
|
|
20
|
+
* 幅を決めたい画面は size を明示する。
|
|
21
|
+
* 段に無い幅は `className="sm:max-w-[…]"` で上書きできる(size より className が勝つ)。
|
|
22
|
+
* `AlertDialogContent` の `size`("default" | "sm")とは別物で、値も意味も異なる。
|
|
23
|
+
*/
|
|
24
|
+
size?: DialogSize;
|
|
10
25
|
}): import("react/jsx-runtime").JSX.Element;
|
|
11
26
|
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
12
27
|
declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<"div"> & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import type { LinkComponent } from "../../lib/link-component";
|
|
3
3
|
import { type Button } from "../../components/foundations/button";
|
|
4
4
|
declare function Pagination({ className, ...props }: React.ComponentProps<"nav">): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare function PaginationContent({ className, ...props }: React.ComponentProps<"ul">): import("react/jsx-runtime").JSX.Element;
|
|
@@ -39,11 +39,12 @@ interface ResponsiveDialogProps {
|
|
|
39
39
|
* - 確認ダイアログ、フォーム入力、フィルター選択等に使用
|
|
40
40
|
* - Dialog / Drawer を個別に使い分ける必要がなくなる
|
|
41
41
|
* - 768px未満 → Drawer (bottom)、768px以上 → Dialog (center)
|
|
42
|
+
* - PC の Dialog の幅は `ResponsiveDialogContent` の `size`(sm 400 / md 512 / lg 640 / xl 800。未指定は従来の幅)で選ぶ。SP の Drawer は全幅のボトムシートなので size は無視される
|
|
42
43
|
* - 二重ネスト禁止(CLAUDE.md ダイアログ規約参照)
|
|
43
44
|
*/
|
|
44
45
|
declare function ResponsiveDialog({ children, ...props }: ResponsiveDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
45
46
|
declare function ResponsiveDialogTrigger({ className, ...props }: React.ComponentProps<typeof DialogTrigger>): import("react/jsx-runtime").JSX.Element;
|
|
46
|
-
declare function ResponsiveDialogContent({ className, children, ...props }: React.ComponentProps<typeof DialogContent>): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
declare function ResponsiveDialogContent({ className, children, size, ...props }: React.ComponentProps<typeof DialogContent>): import("react/jsx-runtime").JSX.Element;
|
|
47
48
|
declare function ResponsiveDialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
48
49
|
declare function ResponsiveDialogFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
49
50
|
declare function ResponsiveDialogTitle({ className, ...props }: React.ComponentProps<typeof DialogTitle>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,8 +3,19 @@ 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
|
-
|
|
6
|
+
type SheetSize = "sm" | "md" | "lg";
|
|
7
|
+
declare function SheetContent({ className, children, side, size, showCloseButton, autoFocus, onOpenAutoFocus, onCloseAutoFocus, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
7
8
|
side?: "top" | "right" | "bottom" | "left";
|
|
9
|
+
/**
|
|
10
|
+
* 幅の段。`side="left"` / `"right"` のときだけ効く(top / bottom は全幅なので無視)。
|
|
11
|
+
* sm 以上の画面で効き、SP は段に関係なく従来どおり画面の 3/4 幅。
|
|
12
|
+
* - "sm"(既定): 384px(従来の幅)
|
|
13
|
+
* - "md": 576px(詳細パネル)
|
|
14
|
+
* - "lg": 768px(表やプレビューを載せる広いパネル)
|
|
15
|
+
*
|
|
16
|
+
* 段に無い幅は `className="sm:max-w-[…]"` で上書きできる(size より className が勝つ)。
|
|
17
|
+
*/
|
|
18
|
+
size?: SheetSize;
|
|
8
19
|
showCloseButton?: boolean;
|
|
9
20
|
/**
|
|
10
21
|
* 開閉時のフォーカス自動移動。既定 true(Radix 既定=開いたら中へ入り、閉じたらトリガーへ戻る)。
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skeleton — 読み込み中の場所取り。
|
|
3
|
+
*
|
|
4
|
+
* 動きを減らす設定(prefers-reduced-motion: reduce)では明滅(animate-pulse)を止め、面だけを残す。
|
|
5
|
+
* 読み込み中であることは、包んでいる領域の aria-busy や Spinner の文言で伝える。
|
|
6
|
+
*/
|
|
1
7
|
declare function Skeleton({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
2
8
|
export { Skeleton };
|
|
@@ -12,5 +12,19 @@ export interface SliderProps extends React.ComponentProps<typeof SliderPrimitive
|
|
|
12
12
|
*/
|
|
13
13
|
thumbLabels?: string[];
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Slider — 数値スライダー(Radix UI Slider ラッパー。範囲指定の 2 つまみにも対応)。
|
|
17
|
+
*
|
|
18
|
+
* ### キーボード(範囲スライダー)
|
|
19
|
+
* Home / End は WAI-ARIA APG の Multi-Thumb Slider に合わせ、**フォーカス中のつまみ**を
|
|
20
|
+
* そのつまみが動ける範囲の端(隣のつまみ ± `minStepsBetweenThumbs` × `step`、
|
|
21
|
+
* 無ければ `min` / `max`)へ動かす。Radix の既定は先頭 / 末尾のつまみを動かしてしまうため、
|
|
22
|
+
* 各つまみの keydown で横取りする(preventDefault 済みの keydown を Radix は無視する)。
|
|
23
|
+
* 値の更新は onValueChange / onValueCommit に流す。つまみが 1 つのときは Radix の既定のまま。
|
|
24
|
+
*
|
|
25
|
+
* ### つまみの数
|
|
26
|
+
* `value` / `defaultValue` の配列の長さだけ描く。どちらも無いときは Radix の既定値 `[min]`
|
|
27
|
+
* に合わせて 1 つ(以前は 2 つ描いて、2 つ目が値を持たない壊れた状態になっていた)。
|
|
28
|
+
*/
|
|
29
|
+
declare function Slider({ className, defaultValue, value, min, max, step, minStepsBetweenThumbs, onValueChange, onValueCommit, disabled, thumbLabels, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ...props }: SliderProps): import("react/jsx-runtime").JSX.Element;
|
|
16
30
|
export { Slider };
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
4
|
+
/**
|
|
5
|
+
* Tabs — 同一コンテキスト内のビュー切り替え。
|
|
6
|
+
*
|
|
7
|
+
* `orientation="vertical"` で縦向き: タブの列を左(幅は Tabs の半分まで)、パネルを右に置く。
|
|
8
|
+
* underbar は右端の線、segment は地の色で選択中を示す。設定画面など PC 幅でタブが多い・
|
|
9
|
+
* ラベルが長いときに使う。幅 390px 前後では横向き(既定)を選ぶ。
|
|
10
|
+
*/
|
|
4
11
|
declare function Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
5
12
|
declare const tabsListVariants: (props?: {
|
|
6
13
|
variant?: "underbar" | "segment";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import type { LinkComponent } from "../../lib/link-component";
|
|
2
3
|
export interface AdminNavSubItem {
|
|
3
4
|
/** サブメニューのラベル */
|
|
4
5
|
label: string;
|
|
@@ -36,10 +37,22 @@ export interface AdminSideNavProps {
|
|
|
36
37
|
drawerTitle?: React.ReactNode;
|
|
37
38
|
/** モバイルドロワーの開閉状態(制御コンポーネント) */
|
|
38
39
|
open?: boolean;
|
|
39
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* モバイルドロワーの開閉要求ハンドラ。背景・閉じるボタンに加え、ドロワー内のリンク
|
|
42
|
+
* (項目・サブ項目)を押したときも `onOpenChange(false)` が呼ばれる
|
|
43
|
+
* (`linkComponent` でクライアント遷移するとページが再読み込みされず、開いたままになるため)。
|
|
44
|
+
*/
|
|
40
45
|
onOpenChange?: (open: boolean) => void;
|
|
41
46
|
/** nav の aria-label */
|
|
42
47
|
ariaLabel?: string;
|
|
48
|
+
/**
|
|
49
|
+
* リンクの描画に使うコンポーネント(既定 `a`)。
|
|
50
|
+
* `next/link` 等を渡すとクライアント遷移になる(#236)。
|
|
51
|
+
* PC レールの項目・サブメニューのポップアップ・SP ドロワーの項目とサブ項目のすべてに効く。
|
|
52
|
+
* ポップアップ内のリンクは Radix の `asChild` 越しに描かれるため、`ref` と任意の属性を
|
|
53
|
+
* `<a>` まで転送する実装を渡すこと(next/link は転送する)。
|
|
54
|
+
*/
|
|
55
|
+
linkComponent?: LinkComponent;
|
|
43
56
|
}
|
|
44
57
|
/**
|
|
45
58
|
* 管理画面向けサイドナビゲーション
|
|
@@ -83,6 +96,13 @@ export interface AdminSideNavProps {
|
|
|
83
96
|
* | open | boolean | false | SP ドロワーの開閉状態 |
|
|
84
97
|
* | onOpenChange | (open) => void | — | 開閉要求ハンドラ |
|
|
85
98
|
* | ariaLabel | string | "管理メニュー" | nav の aria-label |
|
|
99
|
+
* | linkComponent | LinkComponent | "a" | リンクの描画に使うコンポーネント(next/link 等) |
|
|
100
|
+
*
|
|
101
|
+
* ### linkComponent(Next.js App Router)
|
|
102
|
+
*
|
|
103
|
+
* この部品は Client Component のため、Server Component から `linkComponent` を渡すと
|
|
104
|
+
* `Functions cannot be passed directly to Client Components` で落ちる。呼び出し側のファイルを
|
|
105
|
+
* `"use client"` にする(エラーメッセージは `"use server"` を示唆するが正解は逆)。
|
|
86
106
|
*/
|
|
87
|
-
declare function AdminSideNav({ items, activeKey, drawerTitle, open, onOpenChange, ariaLabel, }: AdminSideNavProps): import("react/jsx-runtime").JSX.Element;
|
|
107
|
+
declare function AdminSideNav({ items, activeKey, drawerTitle, open, onOpenChange, ariaLabel, linkComponent, }: AdminSideNavProps): import("react/jsx-runtime").JSX.Element;
|
|
88
108
|
export { AdminSideNav };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LinkComponent } from "../../lib/link-component";
|
|
1
2
|
import { type SectionHeaderSize } from "../../components/primitives/section-header";
|
|
2
3
|
export interface BannerItem {
|
|
3
4
|
/** バナー画像URL */
|
|
@@ -30,6 +31,13 @@ export interface BannerCarouselProps {
|
|
|
30
31
|
bannerSize?: "sm" | "md" | "lg";
|
|
31
32
|
/** 追加クラス */
|
|
32
33
|
className?: string;
|
|
34
|
+
/**
|
|
35
|
+
* リンクの描画に使うコンポーネント(既定 `a`)。
|
|
36
|
+
* 「もっと見る」(`moreHref`)と各バナー(`items[].href`)のリンクに効く。
|
|
37
|
+
* `next/link` 等を渡すとクライアント遷移になる(#236)。
|
|
38
|
+
* この部品は Server Component のまま使える。
|
|
39
|
+
*/
|
|
40
|
+
linkComponent?: LinkComponent;
|
|
33
41
|
}
|
|
34
42
|
/**
|
|
35
43
|
* バナーカルーセル(Organism)
|
|
@@ -50,5 +58,5 @@ export interface BannerCarouselProps {
|
|
|
50
58
|
* - `items` 配列に `href` を指定するとリンクカードになる
|
|
51
59
|
* - SectionHeader は内部で合成される(子として渡さない)
|
|
52
60
|
*/
|
|
53
|
-
declare function BannerCarousel({ title, subtitle, moreHref, moreLabel, headerSize, items, aspectRatio, bannerSize, className, }: BannerCarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
declare function BannerCarousel({ title, subtitle, moreHref, moreLabel, headerSize, items, aspectRatio, bannerSize, className, linkComponent, }: BannerCarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
54
62
|
export { BannerCarousel };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import type { LinkComponent } from "../../lib/link-component";
|
|
2
3
|
export interface BottomTabBarItem {
|
|
3
4
|
/** ナビゲーションアイテムのラベル */
|
|
4
5
|
label: string;
|
|
@@ -8,7 +9,7 @@ export interface BottomTabBarItem {
|
|
|
8
9
|
activeIcon?: React.ReactNode;
|
|
9
10
|
/** リンク先URL */
|
|
10
11
|
href?: string;
|
|
11
|
-
/**
|
|
12
|
+
/** クリックハンドラ(`href` を持つ項目でもクリック時に呼ばれる。遷移は止めない) */
|
|
12
13
|
onClick?: () => void;
|
|
13
14
|
/** バッジ数(カートアイテム数など) */
|
|
14
15
|
badgeCount?: number;
|
|
@@ -20,6 +21,13 @@ export interface BottomTabBarProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
20
21
|
items: BottomTabBarItem[];
|
|
21
22
|
/** バナースロット(ナビゲーション上部に表示するキャンペーンバナーなど) */
|
|
22
23
|
banner?: React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* リンクの描画に使うコンポーネント(既定 `a`)。
|
|
26
|
+
* `next/link` 等を渡すとクライアント遷移になる(#236)。
|
|
27
|
+
* `href` を持つ項目だけが対象で、`href` の無い項目は従来どおり `<button>`。
|
|
28
|
+
* 項目の `onClick` は `href` の有無によらず呼ばれる(linkComponent 経由でも同じ)。
|
|
29
|
+
*/
|
|
30
|
+
linkComponent?: LinkComponent;
|
|
23
31
|
}
|
|
24
32
|
/**
|
|
25
33
|
* ボトムナビゲーションコンポーネント
|
|
@@ -34,6 +42,9 @@ export interface BottomTabBarProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
34
42
|
* - 高さ 52px、左右 px-4
|
|
35
43
|
*
|
|
36
44
|
* 使用時は `body` に `pb-16` を追加してコンテンツ重なりを防止。
|
|
45
|
+
*
|
|
46
|
+
* この部品は Server Component のまま使える。`linkComponent` を渡すためだけに、
|
|
47
|
+
* Next.js App Router の呼び出し側を `"use client"` にする必要はない。
|
|
37
48
|
*/
|
|
38
|
-
declare function BottomTabBar({ className, items, banner, ...props }: BottomTabBarProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
declare function BottomTabBar({ className, items, banner, linkComponent, ...props }: BottomTabBarProps): import("react/jsx-runtime").JSX.Element;
|
|
39
50
|
export { BottomTabBar };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LinkComponent } from "../../lib/link-component";
|
|
1
2
|
import { type SectionHeaderSize } from "../../components/primitives/section-header";
|
|
2
3
|
export interface CategoryItem {
|
|
3
4
|
/** カテゴリ名 */
|
|
@@ -38,6 +39,13 @@ export interface CategoryScrollProps {
|
|
|
38
39
|
pcGridCols?: number;
|
|
39
40
|
/** 追加クラス */
|
|
40
41
|
className?: string;
|
|
42
|
+
/**
|
|
43
|
+
* リンクの描画に使うコンポーネント(既定 `a`)。
|
|
44
|
+
* 「もっと見る」(`moreHref`)と各カテゴリ(`items[].href`)のリンクに効く。
|
|
45
|
+
* `next/link` 等を渡すとクライアント遷移になる(#236)。
|
|
46
|
+
* この部品は Server Component のまま使える。
|
|
47
|
+
*/
|
|
48
|
+
linkComponent?: LinkComponent;
|
|
41
49
|
}
|
|
42
50
|
/**
|
|
43
51
|
* カテゴリスクロールコンポーネント
|
|
@@ -59,6 +67,7 @@ export interface CategoryScrollProps {
|
|
|
59
67
|
* | headerSize | SectionHeaderSize | "lg" | SectionHeader のサイズ |
|
|
60
68
|
* | thumbnailSize | "sm" \| "md" \| "lg" | "md" | サムネイルサイズ |
|
|
61
69
|
* | thumbnailShape | "square" \| "circle" | "square" | サムネイル角丸 |
|
|
70
|
+
* | linkComponent | LinkComponent | "a" | リンクの描画に使うコンポーネント(next/link 等) |
|
|
62
71
|
*
|
|
63
72
|
* ### AI 向け使用ルール
|
|
64
73
|
* - Atomic Design Level 3(organism): SectionHeader を内包する
|
|
@@ -66,5 +75,5 @@ export interface CategoryScrollProps {
|
|
|
66
75
|
* - thumbnailShape="circle" + thumbnailSize="sm" でクイックアクセスアイコン風に
|
|
67
76
|
* - 横スクロールは scrollbar-hide でスクロールバー非表示
|
|
68
77
|
*/
|
|
69
|
-
declare function CategoryScroll({ title, moreHref, headerSize, items, thumbnailSize, thumbnailShape, layout, gridRows, pcGridCols, className, }: CategoryScrollProps): import("react/jsx-runtime").JSX.Element;
|
|
78
|
+
declare function CategoryScroll({ title, moreHref, headerSize, items, thumbnailSize, thumbnailShape, layout, gridRows, pcGridCols, className, linkComponent, }: CategoryScrollProps): import("react/jsx-runtime").JSX.Element;
|
|
70
79
|
export { CategoryScroll };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LinkComponent } from "../../lib/link-component";
|
|
1
2
|
export interface CategoryShortcutsItem {
|
|
2
3
|
/** カテゴリ名 */
|
|
3
4
|
name: string;
|
|
@@ -9,7 +10,7 @@ export interface CategoryShortcutsItem {
|
|
|
9
10
|
imageAlt?: string;
|
|
10
11
|
/** 選択中フラグ */
|
|
11
12
|
isSelected?: boolean;
|
|
12
|
-
/**
|
|
13
|
+
/** クリックハンドラ(`href` を持つ項目でもクリック時に呼ばれる。遷移は止めない) */
|
|
13
14
|
onClick?: () => void;
|
|
14
15
|
}
|
|
15
16
|
export interface CategoryShortcutsProps {
|
|
@@ -17,6 +18,14 @@ export interface CategoryShortcutsProps {
|
|
|
17
18
|
items: CategoryShortcutsItem[];
|
|
18
19
|
/** 追加クラス */
|
|
19
20
|
className?: string;
|
|
21
|
+
/**
|
|
22
|
+
* リンクの描画に使うコンポーネント(既定 `a`)。`href` を持つ項目だけが対象で、
|
|
23
|
+
* `href` の無い項目は従来どおり `<button>`。
|
|
24
|
+
* 項目の `onClick` は `href` の有無によらず呼ばれる(linkComponent 経由でも同じ)。
|
|
25
|
+
* `next/link` 等を渡すとクライアント遷移になる(#236)。
|
|
26
|
+
* この部品は Server Component のまま使える。
|
|
27
|
+
*/
|
|
28
|
+
linkComponent?: LinkComponent;
|
|
20
29
|
}
|
|
21
30
|
/**
|
|
22
31
|
* 小アイコンカテゴリストリップ
|
|
@@ -40,5 +49,5 @@ export interface CategoryShortcutsProps {
|
|
|
40
49
|
* - `isSelected` で現在のカテゴリをハイライト
|
|
41
50
|
* - `onClick` でフィルター切り替えイベントを処理
|
|
42
51
|
*/
|
|
43
|
-
declare function CategoryShortcuts({ items, className }: CategoryShortcutsProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
declare function CategoryShortcuts({ items, className, linkComponent }: CategoryShortcutsProps): import("react/jsx-runtime").JSX.Element;
|
|
44
53
|
export { CategoryShortcuts };
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import type { LinkComponent } from "../../lib/link-component";
|
|
2
3
|
import { chipVariants, type ChipVariantProps } from "../../components/foundations/chip-variants";
|
|
3
4
|
export interface ChipProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, ChipVariantProps {
|
|
4
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* リンクとして使う場合のURL。`<a>` で描画し、`onClick` などのハンドラや `aria-*` / `data-*` も `<a>` に渡る
|
|
7
|
+
* (遷移は止めない)。`type` / `disabled` / `form*` / `name` / `value` など button 専用の属性は渡さない。
|
|
8
|
+
*/
|
|
5
9
|
href?: string;
|
|
6
10
|
/** 選択状態 */
|
|
7
11
|
selected?: boolean;
|
|
@@ -11,8 +15,22 @@ export interface ChipProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
11
15
|
removable?: boolean;
|
|
12
16
|
/** 削除時のコールバック */
|
|
13
17
|
onRemove?: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* 削除ボタンの読み上げ名(日本語)。既定「削除」。
|
|
20
|
+
* 削除可能な Chip が複数並ぶ場面では「{ラベル}を削除」のように対象が分かる名前を渡す。
|
|
21
|
+
*/
|
|
22
|
+
removeLabel?: string;
|
|
14
23
|
/** カウントバッジ(例: 件数表示) */
|
|
15
24
|
count?: number;
|
|
25
|
+
/**
|
|
26
|
+
* `href` 指定時のリンクの描画に使うコンポーネント(既定 `a`)。`removable` のときは本体のリンクに効く。
|
|
27
|
+
* `next/link` 等を渡すとクライアント遷移になる(#236)。
|
|
28
|
+
* `removable` を指定するときは、削除ボタンに `onClick` を付けるため React Server Components では
|
|
29
|
+
* Server Component から描けない(`Event handlers cannot be passed to Client Component props` で落ちる)。
|
|
30
|
+
* その場合、Next.js App Router では呼び出し側のファイルを `"use client"` にする。`removable` で
|
|
31
|
+
* なければ Server Component のまま使える。
|
|
32
|
+
*/
|
|
33
|
+
linkComponent?: LinkComponent;
|
|
16
34
|
}
|
|
17
35
|
/**
|
|
18
36
|
* チップコンポーネント
|
|
@@ -35,7 +53,8 @@ export interface ChipProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
35
53
|
* - カウント付き: `<Chip selected count={156}>すべて</Chip>`
|
|
36
54
|
* - ステータスフィルター: Chip + count でステータス別件数タブを構成
|
|
37
55
|
*
|
|
38
|
-
* removable 時は本体(`data-slot="chip-trigger"
|
|
56
|
+
* removable 時は本体(`data-slot="chip-trigger"`)と削除ボタン(`data-slot="chip-remove"`)が兄弟の2タブストップ構造(ルートは `span[data-slot="chip"]`)。
|
|
57
|
+
* 削除ボタンの読み上げ名は `removeLabel`(既定「削除」)。
|
|
39
58
|
*/
|
|
40
|
-
declare function Chip({ className, variant, size, shape, href, selected, soldOut, removable, onRemove, count, children, ...props }: ChipProps): import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
declare function Chip({ className, variant, size, shape, href, selected, soldOut, removable, onRemove, removeLabel, count, linkComponent, children, ...props }: ChipProps): import("react/jsx-runtime").JSX.Element;
|
|
41
60
|
export { Chip, chipVariants };
|
|
@@ -15,9 +15,14 @@ export interface ComboboxProps {
|
|
|
15
15
|
className?: string;
|
|
16
16
|
/** trigger の id。FormField / FieldLabel の htmlFor と揃える */
|
|
17
17
|
id?: string;
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* 検証エラー時に true。トリガーに赤 1px の内側リング(Border-Caution)を出す。
|
|
20
|
+
* FormField 配下では error があると自動で true になる(明示指定が優先)
|
|
21
|
+
*/
|
|
19
22
|
"aria-invalid"?: boolean;
|
|
20
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* 説明・エラー文の id。FormField 配下では FormField の説明・エラーの id と連結される
|
|
25
|
+
*/
|
|
21
26
|
"aria-describedby"?: string;
|
|
22
27
|
/**
|
|
23
28
|
* トリガーのアクセシブルネーム(日本語)。
|
|
@@ -9,6 +9,9 @@ import { type VariantProps } from "class-variance-authority";
|
|
|
9
9
|
* - **左右 padding は Container だけが持つ。** これを使うコンポーネント/親(Section 等)は
|
|
10
10
|
* 自身で左右 padding を持たない。両方が持つと「左右余白の二重がけ」になる(実バグ)。
|
|
11
11
|
* - 縦余白・背景色は持たない(それは Section の責務)。
|
|
12
|
+
* - 自分の gutter 幅を CSS 変数 `--Container-Gutter` で子孫に渡す。横スクロールの行
|
|
13
|
+
* (ScrollRow / ContentCarousel・ImageCarousel の peek)がこれを読み、Container の外へはみ出しつつ
|
|
14
|
+
* 1 枚目の左端を見出しとそろえる。値は下の gutter と必ず同じにする。
|
|
12
15
|
*/
|
|
13
16
|
declare const containerVariants: (props?: {
|
|
14
17
|
size?: "page" | "narrow" | "wide" | "fluid";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import type { LinkComponent } from "../../lib/link-component";
|
|
3
3
|
import { type TagProps } from "../../components/primitives/tag";
|
|
4
4
|
export type ContentCardOrientation = "vertical" | "horizontal" | "list";
|
|
5
5
|
export type ContentCardAspect = "16/10" | "16/9" | "1/1";
|
|
@@ -13,12 +13,20 @@ export interface ContentCarouselProps extends Omit<React.HTMLAttributes<HTMLDivE
|
|
|
13
13
|
showDots?: boolean;
|
|
14
14
|
/** 矢印ナビゲーション表示 */
|
|
15
15
|
showArrows?: boolean;
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* 自動再生(ミリ秒、0で無効)。
|
|
18
|
+
* 動きを減らす設定(prefers-reduced-motion: reduce)では自動再生しない(停止ボタンは持たない)。
|
|
19
|
+
*/
|
|
17
20
|
autoPlay?: number;
|
|
18
21
|
/**
|
|
19
|
-
* SP: 隣スライドをのぞかせる(peek)表示。
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
+
* SP: 隣スライドをのぞかせる(peek)表示。PC (@[960px]:) では peek しない。
|
|
23
|
+
*
|
|
24
|
+
* - 左右に端の余白を持ち、スクロール後・最後のスライドでもその余白を保つ(scroll-padding)
|
|
25
|
+
* - `Container` の直下に置くと、Container の gutter 分だけ外へはみ出して Container の外縁(SP では画面端)まで
|
|
26
|
+
* スクロールさせ、1 枚目の左端を見出し(Container の内側)にそろえる。端の余白は Container の gutter と同じ
|
|
27
|
+
* - Card など余白を持つ親の中には peek で置かない(gutter の変数は Container の子孫すべてに届くため、gutter 分はみ出す)
|
|
28
|
+
* - `Container` の外(全幅)に置くと、端の余白は 16px
|
|
29
|
+
* - 右端に次スライドが 48px(端の余白 16px のとき)見える
|
|
22
30
|
*/
|
|
23
31
|
peek?: boolean;
|
|
24
32
|
/**
|
|
@@ -23,15 +23,22 @@ export interface DatePickerProps {
|
|
|
23
23
|
clearable?: boolean;
|
|
24
24
|
/** クリアボタンの aria-label。既定「日付をクリア」 */
|
|
25
25
|
clearLabel?: string;
|
|
26
|
-
/** trigger の id
|
|
26
|
+
/** trigger の id。FormField 配下では未指定でも FormField の htmlFor と同じ id になる */
|
|
27
27
|
id?: string;
|
|
28
|
+
/**
|
|
29
|
+
* 検証エラー時に true。trigger の枠が Border-Caution になる。
|
|
30
|
+
* FormField 配下では error があると自動で true になる(明示指定が優先)
|
|
31
|
+
*/
|
|
32
|
+
"aria-invalid"?: boolean;
|
|
33
|
+
/** 説明・エラー文の id。FormField 配下では FormField の説明・エラーの id と連結される */
|
|
34
|
+
"aria-describedby"?: string;
|
|
28
35
|
/**
|
|
29
36
|
* 追加クラス。**外側のラッパー要素**に付与する(クリアボタンを trigger の
|
|
30
37
|
* 兄弟として絶対配置するため、幅・レイアウト指定はラッパーが受け取る)。
|
|
31
38
|
*/
|
|
32
39
|
className?: string;
|
|
33
40
|
}
|
|
34
|
-
declare function DatePicker({ value, onChange, placeholder, min, max, disabledDates, disabled, clearable, clearLabel, id, className, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
declare function DatePicker({ value, onChange, placeholder, min, max, disabledDates, disabled, clearable, clearLabel, id, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedby, className, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
35
42
|
export interface DateTimePickerProps extends DatePickerProps {
|
|
36
43
|
/** 分の刻み(分 Select の選択肢間隔)。既定 5 分 */
|
|
37
44
|
minuteStep?: number;
|
|
@@ -40,5 +47,5 @@ export interface DateTimePickerProps extends DatePickerProps {
|
|
|
40
47
|
/** 分 Select の aria-label。既定「分」 */
|
|
41
48
|
minuteLabel?: string;
|
|
42
49
|
}
|
|
43
|
-
declare function DateTimePicker({ value, onChange, minuteStep, hourLabel, minuteLabel, clearLabel, disabled, className, ...dateProps }: DateTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
declare function DateTimePicker({ value, onChange, minuteStep, hourLabel, minuteLabel, clearLabel, disabled, className, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedby, ...dateProps }: DateTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
44
51
|
export { DatePicker, DateTimePicker };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import type { LinkComponent } from "../../lib/link-component";
|
|
2
3
|
/**
|
|
3
4
|
* ヘッダー内側の最大幅。`Container` の同名 size と同じ値を使う(値の正本は Container)。
|
|
4
5
|
* 本文を `Container size="page"` で中央寄せしているサイトで、ロゴ・ナビの左端を本文に揃える。
|
|
@@ -31,7 +32,7 @@ export interface HeaderNavItem {
|
|
|
31
32
|
label: string;
|
|
32
33
|
/** リンク先 */
|
|
33
34
|
href?: string;
|
|
34
|
-
/**
|
|
35
|
+
/** クリックハンドラ(`href` を持つ項目でもクリック時に呼ばれる。遷移は止めない) */
|
|
35
36
|
onClick?: () => void;
|
|
36
37
|
/** アクティブ状態 */
|
|
37
38
|
isActive?: boolean;
|
|
@@ -110,6 +111,17 @@ export interface HeaderProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
110
111
|
* 未指定なら従来どおり全幅(DOM も従来どおりで内側ラッパーを足さない)。
|
|
111
112
|
*/
|
|
112
113
|
containerSize?: HeaderContainerSize;
|
|
114
|
+
/**
|
|
115
|
+
* リンクの描画に使うコンポーネント(既定 `a`)。
|
|
116
|
+
* `next/link` 等を渡すとクライアント遷移になる(#236)。
|
|
117
|
+
* `navItems` の `href`(「その他」メニュー内のリンクを含む)と `actions` の `href` に効く。
|
|
118
|
+
* `logo` は ReactNode をそのまま描く(Header は `<a>` を足さない)ため対象外で、
|
|
119
|
+
* ロゴをリンクにするなら `logo` に `<Link>` を含めて渡す。
|
|
120
|
+
* この部品は Client Component のため、Server Component から渡すと
|
|
121
|
+
* `Functions cannot be passed directly to Client Components` で落ちる。
|
|
122
|
+
* Next.js App Router では呼び出し側のファイルを `"use client"` にする。
|
|
123
|
+
*/
|
|
124
|
+
linkComponent?: LinkComponent;
|
|
113
125
|
}
|
|
114
126
|
/**
|
|
115
127
|
* ページヘッダー
|
|
@@ -117,5 +129,5 @@ export interface HeaderProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
117
129
|
* アプリ全体で使われるヘッダーの3パターンを1コンポーネントで提供。
|
|
118
130
|
* ロゴ+アクション、戻るボタン+タイトル、戻るボタン+検索の3バリエーション。
|
|
119
131
|
*/
|
|
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;
|
|
132
|
+
declare function Header({ className, variant, logo, title, onBack, backLabel, actions, navItems, navBreakpoint, navOverflowLabel, searchSlot, searchBreakpoint, rightSlot, centerSlot, bottomSlot, disableSticky, containerSize, linkComponent, ...props }: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
121
133
|
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 ImageCarouselProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
4
|
/** スライド画像リスト */
|
|
4
5
|
images: Array<{
|
|
@@ -12,12 +13,21 @@ export interface ImageCarouselProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
12
13
|
showDots?: boolean;
|
|
13
14
|
/** 矢印ナビゲーション表示 */
|
|
14
15
|
showArrows?: boolean;
|
|
15
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* 自動再生(ミリ秒、0で無効)。
|
|
18
|
+
* 動きを減らす設定(prefers-reduced-motion: reduce)では自動再生しない(停止ボタンは持たない)。
|
|
19
|
+
*/
|
|
16
20
|
autoPlay?: number;
|
|
17
21
|
/**
|
|
18
|
-
* SP: 隣スライドをのぞかせる(peek)表示。
|
|
19
|
-
*
|
|
20
|
-
*
|
|
22
|
+
* SP: 隣スライドをのぞかせる(peek)表示。PC (@[960px]:) では peek しない。
|
|
23
|
+
*
|
|
24
|
+
* - 左右に端の余白を持ち、スクロール後・最後のスライドでもその余白を保つ(scroll-padding)
|
|
25
|
+
* - `Container` の直下に置くと、Container の gutter 分だけ外へはみ出して Container の外縁(SP では画面端)まで
|
|
26
|
+
* スクロールさせ、1 枚目の左端を見出し(Container の内側)にそろえる。端の余白は Container の gutter と同じ
|
|
27
|
+
* - Card など余白を持つ親の中には peek で置かない(gutter の変数は Container の子孫すべてに届くため、gutter 分はみ出す)
|
|
28
|
+
* - `Container` の外(全幅)に置くと、端の余白は 16px
|
|
29
|
+
* - 右端に次スライドが 48px(端の余白 16px のとき)見える
|
|
30
|
+
* - `centeredSlides` と併用したときは、タブレット(@[768px]:)で centeredSlides の表示に切り替わる
|
|
21
31
|
*/
|
|
22
32
|
peek?: boolean;
|
|
23
33
|
/**
|
|
@@ -33,6 +43,14 @@ export interface ImageCarouselProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
33
43
|
* SP は全幅1枚のまま、PC(960px+)は pcSlidesPerView に従う。
|
|
34
44
|
*/
|
|
35
45
|
centeredSlides?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* `images[].href` のリンクの描画に使うコンポーネント(既定 `a`)。
|
|
48
|
+
* `next/link` 等を渡すとクライアント遷移になる(#236)。
|
|
49
|
+
* この部品は Client Component のため、Server Component から渡すと
|
|
50
|
+
* `Functions cannot be passed directly to Client Components` で落ちる。
|
|
51
|
+
* Next.js App Router では呼び出し側のファイルを `"use client"` にする。
|
|
52
|
+
*/
|
|
53
|
+
linkComponent?: LinkComponent;
|
|
36
54
|
}
|
|
37
55
|
/**
|
|
38
56
|
* 画像カルーセル — Figma Carousel 準拠
|
|
@@ -48,5 +66,5 @@ export interface ImageCarouselProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
48
66
|
* - OGP比率: `<ImageCarousel aspectRatio="ogp" />`
|
|
49
67
|
* - 自動再生: `<ImageCarousel autoPlay={5000} />`
|
|
50
68
|
*/
|
|
51
|
-
declare function ImageCarousel({ images, aspectRatio, showDots, showArrows, autoPlay, peek, pcSlidesPerView, centeredSlides, className, ...props }: ImageCarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
declare function ImageCarousel({ images, aspectRatio, showDots, showArrows, autoPlay, peek, pcSlidesPerView, centeredSlides, linkComponent, className, ...props }: ImageCarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
52
70
|
export { ImageCarousel };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import type { LinkComponent } from "../../lib/link-component";
|
|
2
3
|
export interface ListItemProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
4
|
/** メインタイトル */
|
|
4
5
|
title: string;
|
|
@@ -41,6 +42,14 @@ export interface ListItemProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
41
42
|
showBadgeDot?: boolean;
|
|
42
43
|
/** リンク先(指定すると `<a>` でラップ) */
|
|
43
44
|
href?: string;
|
|
45
|
+
/**
|
|
46
|
+
* リンクの描画に使うコンポーネント(既定 `a`)。`href` 指定時だけ使われる。
|
|
47
|
+
* `next/link` 等を渡すとクライアント遷移になる(#236)。
|
|
48
|
+
* この部品は Client Component のため、Server Component から渡すと
|
|
49
|
+
* `Functions cannot be passed directly to Client Components` で落ちる。
|
|
50
|
+
* Next.js App Router では呼び出し側のファイルを `"use client"` にする。
|
|
51
|
+
*/
|
|
52
|
+
linkComponent?: LinkComponent;
|
|
44
53
|
}
|
|
45
54
|
/**
|
|
46
55
|
* リストアイテム — Figma List/Item 準拠
|
|
@@ -59,5 +68,5 @@ export interface ListItemProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
59
68
|
* `href` か `onClick` を渡すとインタラクティブ行になり、hover 背景と focus リングが付く。
|
|
60
69
|
* 表示専用(href/onClick なし)の行は状態スタイルが付かない。
|
|
61
70
|
*/
|
|
62
|
-
declare function ListItem({ title, caption, rightType, rightText, badgeCount, toggleChecked, onToggleChange, leftIcon, leftImageUrl, size, selected, showBorder, showBadgeDot, href, className, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
declare function ListItem({ title, caption, rightType, rightText, badgeCount, toggleChecked, onToggleChange, leftIcon, leftImageUrl, size, selected, showBorder, showBadgeDot, href, linkComponent, className, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
63
72
|
export { ListItem };
|
|
@@ -15,9 +15,14 @@ export interface MultiSelectProps {
|
|
|
15
15
|
className?: string;
|
|
16
16
|
/** trigger の id。FormField / FieldLabel の htmlFor と揃える */
|
|
17
17
|
id?: string;
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* 検証エラー時に true。トリガーに赤 1px の内側リング(Border-Caution)を出す。
|
|
20
|
+
* FormField 配下では error があると自動で true になる(明示指定が優先)
|
|
21
|
+
*/
|
|
19
22
|
"aria-invalid"?: boolean;
|
|
20
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* 説明・エラー文の id。FormField 配下では FormField の説明・エラーの id と連結される
|
|
25
|
+
*/
|
|
21
26
|
"aria-describedby"?: string;
|
|
22
27
|
/**
|
|
23
28
|
* トリガーのアクセシブルネーム(日本語)。
|