@cakejp/design-system 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +144 -0
- package/CHANGELOG.md +115 -0
- package/CLAUDE.md +188 -0
- package/CLAUDE_PRODUCTION.md +121 -0
- package/MIGRATION.md +228 -0
- package/README.md +79 -0
- package/RELEASE.md +205 -0
- package/bin/init.js +134 -0
- package/component-registry.json +1146 -0
- package/contracts/components.json +730 -0
- package/contracts/rules.json +559 -0
- package/dist/index.css +1 -0
- package/dist/index.js +9344 -0
- package/dist/types/components/ec/_mypage-menu-data.d.ts +15 -0
- package/dist/types/components/ec/admin-layout.d.ts +31 -0
- package/dist/types/components/ec/anniversary-card.d.ts +50 -0
- package/dist/types/components/ec/cake-logo.d.ts +22 -0
- package/dist/types/components/ec/chart-controls.d.ts +16 -0
- package/dist/types/components/ec/countdown-timer.d.ts +24 -0
- package/dist/types/components/ec/coupon-card.d.ts +47 -0
- package/dist/types/components/ec/delivery-calendar.d.ts +36 -0
- package/dist/types/components/ec/order-section.d.ts +29 -0
- package/dist/types/components/ec/order-summary.d.ts +36 -0
- package/dist/types/components/ec/payment-method.d.ts +41 -0
- package/dist/types/components/ec/product-card.d.ts +77 -0
- package/dist/types/components/ec/product-carousel.d.ts +56 -0
- package/dist/types/components/ec/product-cta.d.ts +35 -0
- package/dist/types/components/ec/product-detail-bar.d.ts +62 -0
- package/dist/types/components/ec/product-detail-sidebar.d.ts +115 -0
- package/dist/types/components/ec/product-list-item.d.ts +90 -0
- package/dist/types/components/ec/product-option.d.ts +62 -0
- package/dist/types/components/ec/rating-stars.d.ts +30 -0
- package/dist/types/components/ec/review-card.d.ts +44 -0
- package/dist/types/components/ec/review-form.d.ts +40 -0
- package/dist/types/components/ec/review-summary.d.ts +53 -0
- package/dist/types/components/ec/shop-card.d.ts +48 -0
- package/dist/types/components/ec/stat-card.d.ts +44 -0
- package/dist/types/components/foundations/accordion.d.ts +7 -0
- package/dist/types/components/foundations/alert-dialog.d.ts +18 -0
- package/dist/types/components/foundations/alert.d.ts +42 -0
- package/dist/types/components/foundations/aspect-ratio.d.ts +3 -0
- package/dist/types/components/foundations/avatar.d.ts +11 -0
- package/dist/types/components/foundations/badge.d.ts +9 -0
- package/dist/types/components/foundations/breadcrumb.d.ts +11 -0
- package/dist/types/components/foundations/button.d.ts +10 -0
- package/dist/types/components/foundations/calendar.d.ts +8 -0
- package/dist/types/components/foundations/card.d.ts +9 -0
- package/dist/types/components/foundations/checkbox-card.d.ts +30 -0
- package/dist/types/components/foundations/checkbox-group.d.ts +53 -0
- package/dist/types/components/foundations/checkbox.d.ts +4 -0
- package/dist/types/components/foundations/collapsible.d.ts +5 -0
- package/dist/types/components/foundations/command.d.ts +18 -0
- package/dist/types/components/foundations/context-menu.d.ts +25 -0
- package/dist/types/components/foundations/data-table.d.ts +104 -0
- package/dist/types/components/foundations/dialog.d.ts +17 -0
- package/dist/types/components/foundations/drawer.d.ts +13 -0
- package/dist/types/components/foundations/dropdown-menu.d.ts +25 -0
- package/dist/types/components/foundations/form.d.ts +24 -0
- package/dist/types/components/foundations/hover-card.d.ts +6 -0
- package/dist/types/components/foundations/input.d.ts +3 -0
- package/dist/types/components/foundations/label.d.ts +7 -0
- package/dist/types/components/foundations/menubar.d.ts +26 -0
- package/dist/types/components/foundations/navigation-menu.d.ts +14 -0
- package/dist/types/components/foundations/pagination.d.ts +13 -0
- package/dist/types/components/foundations/popover.d.ts +10 -0
- package/dist/types/components/foundations/progress.d.ts +4 -0
- package/dist/types/components/foundations/radio-group.d.ts +9 -0
- package/dist/types/components/foundations/responsive-dialog.d.ts +52 -0
- package/dist/types/components/foundations/scroll-area.d.ts +5 -0
- package/dist/types/components/foundations/select.d.ts +15 -0
- package/dist/types/components/foundations/separator.d.ts +4 -0
- package/dist/types/components/foundations/sheet.d.ts +14 -0
- package/dist/types/components/foundations/skeleton.d.ts +2 -0
- package/dist/types/components/foundations/slider.d.ts +4 -0
- package/dist/types/components/foundations/sonner.d.ts +3 -0
- package/dist/types/components/foundations/spinner.d.ts +6 -0
- package/dist/types/components/foundations/switch.d.ts +13 -0
- package/dist/types/components/foundations/table.d.ts +10 -0
- package/dist/types/components/foundations/tabs.d.ts +12 -0
- package/dist/types/components/foundations/textarea.d.ts +3 -0
- package/dist/types/components/foundations/toggle-group.d.ts +23 -0
- package/dist/types/components/foundations/toggle.d.ts +9 -0
- package/dist/types/components/foundations/tooltip.d.ts +7 -0
- package/dist/types/components/pages/cake/_mypage-shell.d.ts +41 -0
- package/dist/types/components/primitives/banner-carousel.d.ts +54 -0
- package/dist/types/components/primitives/bottom-tab-bar.d.ts +39 -0
- package/dist/types/components/primitives/bulk-action-bar.d.ts +32 -0
- package/dist/types/components/primitives/category-scroll.d.ts +70 -0
- package/dist/types/components/primitives/category-shortcuts.d.ts +44 -0
- package/dist/types/components/primitives/chip.d.ts +44 -0
- package/dist/types/components/primitives/coach-mark.d.ts +28 -0
- package/dist/types/components/primitives/empty-state.d.ts +36 -0
- package/dist/types/components/primitives/error-state.d.ts +41 -0
- package/dist/types/components/primitives/filter-bar.d.ts +56 -0
- package/dist/types/components/primitives/footer.d.ts +81 -0
- package/dist/types/components/primitives/form-field.d.ts +46 -0
- package/dist/types/components/primitives/header.d.ts +69 -0
- package/dist/types/components/primitives/image-carousel.d.ts +52 -0
- package/dist/types/components/primitives/image-gallery.d.ts +35 -0
- package/dist/types/components/primitives/image-uploader.d.ts +19 -0
- package/dist/types/components/primitives/kebab-menu.d.ts +38 -0
- package/dist/types/components/primitives/list-item.d.ts +60 -0
- package/dist/types/components/primitives/menu-drawer.d.ts +75 -0
- package/dist/types/components/primitives/notification-badge.d.ts +30 -0
- package/dist/types/components/primitives/notification-list.d.ts +45 -0
- package/dist/types/components/primitives/price-display.d.ts +33 -0
- package/dist/types/components/primitives/progress-steps.d.ts +27 -0
- package/dist/types/components/primitives/quantity-selector.d.ts +50 -0
- package/dist/types/components/primitives/search-bar.d.ts +31 -0
- package/dist/types/components/primitives/search-panel.d.ts +41 -0
- package/dist/types/components/primitives/section-header.d.ts +51 -0
- package/dist/types/components/primitives/share-buttons.d.ts +23 -0
- package/dist/types/components/primitives/side-nav.d.ts +62 -0
- package/dist/types/components/primitives/social-login-button.d.ts +24 -0
- package/dist/types/components/primitives/status-count-tabs.d.ts +14 -0
- package/dist/types/components/primitives/sticky-action-bar.d.ts +7 -0
- package/dist/types/components/primitives/sub-nav.d.ts +34 -0
- package/dist/types/components/primitives/tag.d.ts +19 -0
- package/dist/types/index.d.ts +109 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/package.json +186 -0
- package/scripts/codemod/check-migration.mjs +97 -0
- package/scripts/codemod/v0.2-to-v0.3.mjs +192 -0
- package/src/preset-standalone.css +109 -0
- package/src/preset.css +288 -0
- package/src/styles/primitive.css +139 -0
- package/src/styles/semantic.css +203 -0
- package/src/styles/typography.css +129 -0
- package/templates/AGENTS.md +56 -0
- package/templates/CLAUDE.md +56 -0
- package/tokens.json +127 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface FooterLink {
|
|
3
|
+
label: string;
|
|
4
|
+
href: string;
|
|
5
|
+
/** 外部リンクかどうか(target="_blank" を付与) */
|
|
6
|
+
external?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface FooterLinkGroup {
|
|
9
|
+
/** グループタイトル */
|
|
10
|
+
title: string;
|
|
11
|
+
/** リンクリスト */
|
|
12
|
+
links: FooterLink[];
|
|
13
|
+
/** サブグループ(「法人のお客様へ」内の「催事・販売情報」「マガジン」等) */
|
|
14
|
+
subGroups?: Array<{
|
|
15
|
+
title: string;
|
|
16
|
+
links: FooterLink[];
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
19
|
+
export interface FooterPaymentMethod {
|
|
20
|
+
/** 決済方法名(alt テキスト) */
|
|
21
|
+
label: string;
|
|
22
|
+
/** アイコン(ReactNode: img, svg 等) */
|
|
23
|
+
icon: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export interface FooterTrustBadge {
|
|
26
|
+
/** バッジ画像/アイコン */
|
|
27
|
+
icon: React.ReactNode;
|
|
28
|
+
/** バッジリンク先 */
|
|
29
|
+
href?: string;
|
|
30
|
+
/** 説明テキスト */
|
|
31
|
+
description?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface FooterProps extends React.HTMLAttributes<HTMLElement> {
|
|
34
|
+
/** リンクグループ(アコーディオン形式で表示) */
|
|
35
|
+
linkGroups?: FooterLinkGroup[];
|
|
36
|
+
/** コピーライト表示 */
|
|
37
|
+
copyright?: string;
|
|
38
|
+
/** ロゴ(テキストまたはReactNode) */
|
|
39
|
+
logo?: React.ReactNode;
|
|
40
|
+
/** ロゴリンク先 */
|
|
41
|
+
logoHref?: string;
|
|
42
|
+
/** SNSリンク */
|
|
43
|
+
socialLinks?: Array<{
|
|
44
|
+
label: string;
|
|
45
|
+
href: string;
|
|
46
|
+
icon: React.ReactNode;
|
|
47
|
+
}>;
|
|
48
|
+
/** フッター下部の説明文 */
|
|
49
|
+
description?: string;
|
|
50
|
+
/** 決済方法アイコン一覧 */
|
|
51
|
+
paymentMethods?: FooterPaymentMethod[];
|
|
52
|
+
/** 信頼バッジ(TRUSTe 等) */
|
|
53
|
+
trustBadge?: FooterTrustBadge;
|
|
54
|
+
/** フッター下部の補助リンク(特定商取引法、プライバシーポリシー等) */
|
|
55
|
+
bottomLinks?: FooterLink[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* フッターコンポーネント
|
|
59
|
+
*
|
|
60
|
+
* Cake.jp 本番サイトのフッターを再現。
|
|
61
|
+
* モバイルではアコーディオン形式のリンクグループ、SNSアイコン、
|
|
62
|
+
* 決済方法、信頼バッジ、ロゴ・説明文・コピーライトを表示。
|
|
63
|
+
*
|
|
64
|
+
* 本番テンプレート参照:
|
|
65
|
+
* - `app/views/elements/v2/footer/footer.ctp`(リンクグループ + SNS)
|
|
66
|
+
* - `app/views/elements/v2/footer/footer_bottom.ctp`(ロゴ + 説明 + コピーライト)
|
|
67
|
+
*
|
|
68
|
+
* ### AI 向け使用ルール
|
|
69
|
+
*
|
|
70
|
+
* - BottomTabBar の上、ページ最下部に配置
|
|
71
|
+
* - `linkGroups` でアコーディオン形式のリンクセクションを表示
|
|
72
|
+
* - `socialLinks` で SNS アイコンリンクを横並び表示
|
|
73
|
+
* - `paymentMethods` で決済方法アイコンを横並び表示
|
|
74
|
+
* - `trustBadge` で信頼バッジ(TRUSTe 等)を表示
|
|
75
|
+
* - `bottomLinks` でフッター下部の補助リンクを表示
|
|
76
|
+
* - `description` でサイト説明文を表示
|
|
77
|
+
* - `copyright` でコピーライト表示
|
|
78
|
+
* - BottomTabBar と併用する場合は `pb-16` 等でマージン確保
|
|
79
|
+
*/
|
|
80
|
+
declare function Footer({ className, linkGroups, copyright, logo, logoHref, socialLinks, description, paymentMethods, trustBadge, bottomLinks, ...props }: FooterProps): import("react/jsx-runtime").JSX.Element;
|
|
81
|
+
export { Footer };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## FormField / フォームフィールド
|
|
3
|
+
*
|
|
4
|
+
* ラベル + 必須/任意バッジ + 説明文 + 入力要素 のセット。
|
|
5
|
+
* 管理画面の c-form-header パターンを DS コンポーネント化。
|
|
6
|
+
*
|
|
7
|
+
* ### インポート
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import { FormField } from '../../components/primitives/form-field'
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* ### Props
|
|
13
|
+
* | Prop | 型 | デフォルト | 説明 |
|
|
14
|
+
* |------|-----|-----------|------|
|
|
15
|
+
* | label | string | — | フィールドラベル |
|
|
16
|
+
* | required | boolean | false | 必須バッジ表示 |
|
|
17
|
+
* | optional | boolean | false | 任意バッジ表示 |
|
|
18
|
+
* | description | string | — | 補足テキスト |
|
|
19
|
+
* | error | string | — | エラーメッセージ |
|
|
20
|
+
* | children | ReactNode | — | 入力要素 |
|
|
21
|
+
*
|
|
22
|
+
* ### AI 向け使用ルール
|
|
23
|
+
* - フォームの各入力欄に必ず使用する
|
|
24
|
+
* - Label + Input を直接書かず、このコンポーネントでラップする
|
|
25
|
+
* - 管理画面・フロントどちらでも使用可
|
|
26
|
+
*/
|
|
27
|
+
import * as React from "react";
|
|
28
|
+
export interface FormFieldProps {
|
|
29
|
+
/** フィールドラベル */
|
|
30
|
+
label: string;
|
|
31
|
+
/** 必須バッジを表示 */
|
|
32
|
+
required?: boolean;
|
|
33
|
+
/** 任意バッジを表示 */
|
|
34
|
+
optional?: boolean;
|
|
35
|
+
/** 補足テキスト */
|
|
36
|
+
description?: string;
|
|
37
|
+
/** エラーメッセージ */
|
|
38
|
+
error?: string;
|
|
39
|
+
/** htmlFor 属性 */
|
|
40
|
+
htmlFor?: string;
|
|
41
|
+
/** 入力要素 */
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
/** 追加クラス */
|
|
44
|
+
className?: string;
|
|
45
|
+
}
|
|
46
|
+
export declare function FormField({ label, required, optional, description, error, htmlFor, children, className, }: FormFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface HeaderAction {
|
|
3
|
+
/** アイコン要素 */
|
|
4
|
+
icon: React.ReactNode;
|
|
5
|
+
/** アクセシビリティラベル */
|
|
6
|
+
label: string;
|
|
7
|
+
/** クリックハンドラ */
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
/** バッジ数(通知やカート件数) */
|
|
10
|
+
badge?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export interface HeaderNavItem {
|
|
13
|
+
/** 表示ラベル */
|
|
14
|
+
label: string;
|
|
15
|
+
/** リンク先 */
|
|
16
|
+
href?: string;
|
|
17
|
+
/** クリックハンドラ */
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
/** アクティブ状態 */
|
|
20
|
+
isActive?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface HeaderProps extends React.HTMLAttributes<HTMLElement> {
|
|
23
|
+
/**
|
|
24
|
+
* ヘッダーのレイアウトバリエーション
|
|
25
|
+
* - `logo` : ロゴ+右側アクションボタン(トップ・一覧ページ用)
|
|
26
|
+
* - `logo-center` : ロゴ中央配置(決済・申し込みページ用)
|
|
27
|
+
* - `back` : 戻るボタン+中央タイトル(サブページ用)
|
|
28
|
+
* - `back-search` : 戻るボタン+検索バー(検索ページ用)
|
|
29
|
+
*/
|
|
30
|
+
variant?: "logo" | "logo-center" | "back" | "back-search";
|
|
31
|
+
/**
|
|
32
|
+
* ロゴ表示(variant="logo" / "logo-center" のみ)。
|
|
33
|
+
* 文字列 or ReactNode(CakeLogo, jobboard ロゴ等を渡す)
|
|
34
|
+
*/
|
|
35
|
+
logo?: React.ReactNode;
|
|
36
|
+
/** ページタイトル(variant="back"のみ) */
|
|
37
|
+
title?: string;
|
|
38
|
+
/** 戻るボタンのクリックハンドラ */
|
|
39
|
+
onBack?: () => void;
|
|
40
|
+
/** 戻るボタンのラベル */
|
|
41
|
+
backLabel?: string;
|
|
42
|
+
/** 右側アクションボタン群(variant="logo"で使用) */
|
|
43
|
+
actions?: HeaderAction[];
|
|
44
|
+
/**
|
|
45
|
+
* PC(@[768px]+)でヘッダー内インライン表示するグローバルナビ項目。
|
|
46
|
+
* SP では非表示。本番の "ケーキ / スイーツ / ランキング…" メニューに対応。
|
|
47
|
+
*/
|
|
48
|
+
navItems?: HeaderNavItem[];
|
|
49
|
+
/** 右側に配置するカスタム要素(variant="back"で使用) */
|
|
50
|
+
rightSlot?: React.ReactNode;
|
|
51
|
+
/** 検索バーなど中央に配置するカスタム要素(variant="back-search"で使用) */
|
|
52
|
+
centerSlot?: React.ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* ヘッダー下部に追加表示するスロット。
|
|
55
|
+
* 商品詳細のスティッキーバー(ProductDetailBar)等を配置する。
|
|
56
|
+
* ヘッダーの border-b の内側に描画される。
|
|
57
|
+
*/
|
|
58
|
+
bottomSlot?: React.ReactNode;
|
|
59
|
+
/** sticky 配置を無効化 */
|
|
60
|
+
disableSticky?: boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* ページヘッダー
|
|
64
|
+
*
|
|
65
|
+
* アプリ全体で使われるヘッダーの3パターンを1コンポーネントで提供。
|
|
66
|
+
* ロゴ+アクション、戻るボタン+タイトル、戻るボタン+検索の3バリエーション。
|
|
67
|
+
*/
|
|
68
|
+
declare function Header({ className, variant, logo, title, onBack, backLabel, actions, navItems, rightSlot, centerSlot, bottomSlot, disableSticky, ...props }: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
export { Header };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface ImageCarouselProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** スライド画像リスト */
|
|
4
|
+
images: Array<{
|
|
5
|
+
src: string;
|
|
6
|
+
alt: string;
|
|
7
|
+
href?: string;
|
|
8
|
+
}>;
|
|
9
|
+
/** アスペクト比 */
|
|
10
|
+
aspectRatio?: "square" | "video" | "banner" | "ogp";
|
|
11
|
+
/** ドットインジケーター表示 */
|
|
12
|
+
showDots?: boolean;
|
|
13
|
+
/** 矢印ナビゲーション表示 */
|
|
14
|
+
showArrows?: boolean;
|
|
15
|
+
/** 自動再生(ミリ秒、0で無効) */
|
|
16
|
+
autoPlay?: number;
|
|
17
|
+
/**
|
|
18
|
+
* SP: 隣スライドをのぞかせる(peek)表示。
|
|
19
|
+
* true にすると各スライドが `calc(100% - 48px)` 幅になり、
|
|
20
|
+
* 右端に次スライドが見える。PC (@md:) は常に全幅。
|
|
21
|
+
*/
|
|
22
|
+
peek?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* PC(960px+)での同時表示枚数 (default: 1)
|
|
25
|
+
* 3 を指定すると Figma "big slider" — 3枚横並び表示になる
|
|
26
|
+
* SP は常に peek/1枚表示のまま
|
|
27
|
+
*/
|
|
28
|
+
pcSlidesPerView?: 1 | 2 | 3;
|
|
29
|
+
/**
|
|
30
|
+
* タブレット(768-959px)で centeredSlides 表示。
|
|
31
|
+
* 本番MV slider のタブレット設定(slidesPerView: 768/426≈1.803, centeredSlides: true,
|
|
32
|
+
* spaceBetween: 16)を CSS scroll-snap で再現する。
|
|
33
|
+
* SP は全幅1枚のまま、PC(960px+)は pcSlidesPerView に従う。
|
|
34
|
+
*/
|
|
35
|
+
centeredSlides?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 画像カルーセル — Figma Carousel 準拠
|
|
39
|
+
*
|
|
40
|
+
* CSS scroll-snap ベースのカルーセル。@container クエリでレスポンシブ切替。
|
|
41
|
+
* - SP(狭幅): スワイプ操作 + ドットインジケーター、左右余白付き
|
|
42
|
+
* - PC(@md: 以上): 左右矢印ボタン(ホバーで出現)、ドット非表示、余白なし
|
|
43
|
+
*
|
|
44
|
+
* ### AI 向け使用ルール
|
|
45
|
+
*
|
|
46
|
+
* - ヒーローバナー: `<ImageCarousel aspectRatio="banner" />`
|
|
47
|
+
* - 商品画像: `<ImageCarousel aspectRatio="square" />`
|
|
48
|
+
* - OGP比率: `<ImageCarousel aspectRatio="ogp" />`
|
|
49
|
+
* - 自動再生: `<ImageCarousel autoPlay={5000} />`
|
|
50
|
+
*/
|
|
51
|
+
declare function ImageCarousel({ images, aspectRatio, showDots, showArrows, autoPlay, peek, pcSlidesPerView, centeredSlides, className, ...props }: ImageCarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export { ImageCarousel };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface ImageGalleryProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** 画像URL配列 */
|
|
4
|
+
images: string[];
|
|
5
|
+
/** 画像のalt(省略時は "画像 N" ) */
|
|
6
|
+
alts?: string[];
|
|
7
|
+
/** アスペクト比 */
|
|
8
|
+
aspectRatio?: "square" | "4:3" | "16:9" | "auto";
|
|
9
|
+
/** サムネイル表示 */
|
|
10
|
+
showThumbnails?: boolean;
|
|
11
|
+
/** ドット表示 */
|
|
12
|
+
showDots?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* レイアウトバリアント
|
|
15
|
+
* - `default`: サムネイル下部横並び(SP向け)
|
|
16
|
+
* - `pc-detail`: サムネイル左側縦並び(PC商品詳細向け、本番 p-detail-slider 準拠)
|
|
17
|
+
*/
|
|
18
|
+
layout?: "default" | "pc-detail";
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* イメージギャラリー
|
|
22
|
+
*
|
|
23
|
+
* 商品画像の閲覧。メイン画像 + サムネイル or ドット。
|
|
24
|
+
* Figma: _kv, Image
|
|
25
|
+
*
|
|
26
|
+
* ### AI 向け使用ルール
|
|
27
|
+
*
|
|
28
|
+
* - サムネイル付き: `<ImageGallery images={[...]} showThumbnails />`
|
|
29
|
+
* - ドット付き: `<ImageGallery images={[...]} showDots />`
|
|
30
|
+
* - 商品詳細(SP): square アスペクト比、サムネイル付き
|
|
31
|
+
* - 商品詳細(PC): `layout="pc-detail"` でサムネイル左側縦並び
|
|
32
|
+
* - バナー: 16:9 アスペクト比、ドット付き
|
|
33
|
+
*/
|
|
34
|
+
declare function ImageGallery({ images, alts, aspectRatio, showThumbnails, showDots, layout, className, ...props }: ImageGalleryProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export { ImageGallery };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ImageUploaderImage {
|
|
2
|
+
src: string;
|
|
3
|
+
alt: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ImageUploaderProps {
|
|
6
|
+
/** 現在の画像一覧 */
|
|
7
|
+
images?: ImageUploaderImage[];
|
|
8
|
+
/** 追加ボタンクリック */
|
|
9
|
+
onAdd?: () => void;
|
|
10
|
+
/** 削除ボタンクリック */
|
|
11
|
+
onRemove?: (index: number) => void;
|
|
12
|
+
/** 最大画像数 */
|
|
13
|
+
maxImages?: number;
|
|
14
|
+
/** グリッドカラム数 */
|
|
15
|
+
columns?: number;
|
|
16
|
+
/** 追加クラス */
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function ImageUploader({ images, onAdd, onRemove, maxImages, columns, className, }: ImageUploaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## KebabMenu / ケバブメニュー
|
|
3
|
+
*
|
|
4
|
+
* テーブル行末等に表示する「…」メニュー。
|
|
5
|
+
* 本番の p-kebab-overlay パターンを DS コンポーネント化。
|
|
6
|
+
*
|
|
7
|
+
* ### インポート
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import { KebabMenu } from '../../components/primitives/kebab-menu'
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* ### Props
|
|
13
|
+
* | Prop | 型 | デフォルト | 説明 |
|
|
14
|
+
* |------|-----|-----------|------|
|
|
15
|
+
* | items | { label, icon?, onClick, destructive? }[] | — | メニュー項目 |
|
|
16
|
+
*
|
|
17
|
+
* ### AI 向け使用ルール
|
|
18
|
+
* - テーブル行のアクション列に使用
|
|
19
|
+
* - DropdownMenu を内部で利用
|
|
20
|
+
*/
|
|
21
|
+
import * as React from "react";
|
|
22
|
+
export interface KebabMenuItem {
|
|
23
|
+
/** メニューラベル */
|
|
24
|
+
label: string;
|
|
25
|
+
/** アイコン */
|
|
26
|
+
icon?: React.ReactNode;
|
|
27
|
+
/** クリック時の処理 */
|
|
28
|
+
onClick?: () => void;
|
|
29
|
+
/** 破壊的操作(赤文字) */
|
|
30
|
+
destructive?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface KebabMenuProps {
|
|
33
|
+
/** メニュー項目 */
|
|
34
|
+
items: KebabMenuItem[];
|
|
35
|
+
/** 追加クラス */
|
|
36
|
+
className?: string;
|
|
37
|
+
}
|
|
38
|
+
export declare function KebabMenu({ items, className }: KebabMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface ListItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** メインタイトル */
|
|
4
|
+
title: string;
|
|
5
|
+
/** キャプション(サブテキスト) */
|
|
6
|
+
caption?: string;
|
|
7
|
+
/**
|
|
8
|
+
* 右側コンテンツの種類
|
|
9
|
+
* - `arrow-right` : 右矢印(デフォルト・リンク行)
|
|
10
|
+
* - `arrow-down` : 下矢印(アコーディオン)
|
|
11
|
+
* - `text` : テキスト値
|
|
12
|
+
* - `badge` : バッジ(未読数など)
|
|
13
|
+
* - `toggle` : スイッチ
|
|
14
|
+
* - `none` : なし
|
|
15
|
+
*/
|
|
16
|
+
rightType?: "arrow-right" | "arrow-down" | "text" | "badge" | "toggle" | "none";
|
|
17
|
+
/** `rightType="text"` 時に表示するテキスト */
|
|
18
|
+
rightText?: string;
|
|
19
|
+
/** `rightType="badge"` 時に表示するバッジ数 */
|
|
20
|
+
badgeCount?: number;
|
|
21
|
+
/** `rightType="toggle"` 時のトグル値 */
|
|
22
|
+
toggleChecked?: boolean;
|
|
23
|
+
/** トグル変更ハンドラ */
|
|
24
|
+
onToggleChange?: (checked: boolean) => void;
|
|
25
|
+
/** 左側アイコン(ReactNode) */
|
|
26
|
+
leftIcon?: React.ReactNode;
|
|
27
|
+
/** 左側画像URL */
|
|
28
|
+
leftImageUrl?: string;
|
|
29
|
+
/**
|
|
30
|
+
* 行の高さ
|
|
31
|
+
* - `"sm"` : 44px(テキストのみ)
|
|
32
|
+
* - `"md"` : 56px(キャプション付き)
|
|
33
|
+
* - `"lg"` : 64px(アイコン/画像付き)
|
|
34
|
+
*/
|
|
35
|
+
size?: "sm" | "md" | "lg";
|
|
36
|
+
/** 選択状態(背景色変化) */
|
|
37
|
+
selected?: boolean;
|
|
38
|
+
/** ボーダー表示 */
|
|
39
|
+
showBorder?: boolean;
|
|
40
|
+
/** バッジドット(64px のみ、未読通知) */
|
|
41
|
+
showBadgeDot?: boolean;
|
|
42
|
+
/** リンク先(指定すると `<a>` でラップ) */
|
|
43
|
+
href?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* リストアイテム — Figma List/Item 準拠
|
|
47
|
+
*
|
|
48
|
+
* マイページ・設定画面などのメニュー行コンポーネント。
|
|
49
|
+
* 右側に矢印・テキスト・バッジ・トグルを配置できる。
|
|
50
|
+
*
|
|
51
|
+
* ### AI 向け使用ルール
|
|
52
|
+
*
|
|
53
|
+
* - 基本のナビ行: `<ListItem title="マイページトップ" href="/mypage/" />`
|
|
54
|
+
* - キャプション付き: `<ListItem title="お名前" caption="山田 太郎" size="md" />`
|
|
55
|
+
* - アイコン付き: `<ListItem title="注文履歴" leftIcon={<Icon />} size="lg" />`
|
|
56
|
+
* - トグル行: `<ListItem title="通知設定" rightType="toggle" toggleChecked={true} />`
|
|
57
|
+
* - テキスト値付き: `<ListItem title="言語" rightType="text" rightText="日本語" />`
|
|
58
|
+
*/
|
|
59
|
+
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;
|
|
60
|
+
export { ListItem };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface MenuSection {
|
|
3
|
+
/** セクションタイトル */
|
|
4
|
+
title?: string;
|
|
5
|
+
/** セクションタイトルのアイコン(ReactNode) */
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
/** メニューアイテム群 */
|
|
8
|
+
items: MenuItem[];
|
|
9
|
+
/** 「すべて表示」で展開されるメニューアイテム群 */
|
|
10
|
+
itemsExtra?: MenuItem[];
|
|
11
|
+
/** セクション上部にボーダーを表示するか */
|
|
12
|
+
border?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface MenuItem {
|
|
15
|
+
/** アイコン(ReactNode) — アイコンフォントや SVG を渡す */
|
|
16
|
+
icon?: React.ReactNode;
|
|
17
|
+
/** サムネイル画像URL(カテゴリメニュー用、36px 正方形) */
|
|
18
|
+
thumb?: string;
|
|
19
|
+
/** ラベル */
|
|
20
|
+
label: string;
|
|
21
|
+
/** リンク先 */
|
|
22
|
+
href?: string;
|
|
23
|
+
/** クリックハンドラ */
|
|
24
|
+
onClick?: () => void;
|
|
25
|
+
/** バッジテキスト */
|
|
26
|
+
badge?: string;
|
|
27
|
+
/** サブテキスト */
|
|
28
|
+
subText?: string;
|
|
29
|
+
/** サブメニューがあるか(矢印アイコンを表示) */
|
|
30
|
+
hasChildren?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface MenuBanner {
|
|
33
|
+
/** バナー画像URL */
|
|
34
|
+
imageUrl: string;
|
|
35
|
+
/** バナーのalt */
|
|
36
|
+
alt: string;
|
|
37
|
+
/** リンク先 */
|
|
38
|
+
href?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface MenuDrawerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
41
|
+
/** ユーザー名(ログイン時) */
|
|
42
|
+
userName?: string;
|
|
43
|
+
/** ログイン状態 */
|
|
44
|
+
isLoggedIn?: boolean;
|
|
45
|
+
/** ログイン・新規会員登録リンクを非表示にする(ガイドサイドバーなど認証不要な文脈で使用) */
|
|
46
|
+
hideLoginLink?: boolean;
|
|
47
|
+
/** メニューセクション群 */
|
|
48
|
+
sections: MenuSection[];
|
|
49
|
+
/** バナー群 */
|
|
50
|
+
banners?: MenuBanner[];
|
|
51
|
+
/** 閉じるハンドラ */
|
|
52
|
+
onClose?: () => void;
|
|
53
|
+
/** ログインボタンのハンドラ */
|
|
54
|
+
onLogin?: () => void;
|
|
55
|
+
/** ログインリンクのhref(デフォルト: /security/login_link/) */
|
|
56
|
+
loginHref?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* メニュードロワー
|
|
60
|
+
*
|
|
61
|
+
* ハンバーガーメニューの中身。本番サイドナビと同じ構造。
|
|
62
|
+
* Figma: Menu - Contents
|
|
63
|
+
*
|
|
64
|
+
* ### AI 向け使用ルール
|
|
65
|
+
*
|
|
66
|
+
* - ログイン時: `<MenuDrawer isLoggedIn userName="田中花子" sections={[...]} />`
|
|
67
|
+
* - 未ログイン: `<MenuDrawer isLoggedIn={false} sections={[...]} />`
|
|
68
|
+
* - Drawer コンポーネントの中に配置して使用
|
|
69
|
+
* - セクションの `border` を true にするとセクション上部に区切り線を表示
|
|
70
|
+
* - アイテムの `hasChildren` を true にすると右矢印(ドリルダウン)を表示
|
|
71
|
+
* - カテゴリ系アイテムは `thumb` にサムネイル画像URLを指定
|
|
72
|
+
* - `itemsExtra` は「すべて表示」で展開されるアイテム群
|
|
73
|
+
*/
|
|
74
|
+
declare function MenuDrawer({ userName, isLoggedIn, hideLoginLink, sections, banners, onClose, onLogin, loginHref, className, ...props }: MenuDrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
export { MenuDrawer };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
/**
|
|
4
|
+
* サイズは dot/number/multi-digit で動的に決まるため、
|
|
5
|
+
* CVA では color のみ管理し、サイズは条件分岐で適用する。
|
|
6
|
+
*/
|
|
7
|
+
declare const notificationBadgeVariants: (props?: {
|
|
8
|
+
color?: "red" | "green";
|
|
9
|
+
size?: "sm" | "md";
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) => string;
|
|
11
|
+
export interface NotificationBadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "color">, VariantProps<typeof notificationBadgeVariants> {
|
|
12
|
+
/** バッジの数値(省略するとドットバッジ) */
|
|
13
|
+
count?: number;
|
|
14
|
+
/** 最大表示数(超えると "99+" のように表示) */
|
|
15
|
+
max?: number;
|
|
16
|
+
/** ドットバッジ(数値なし)として表示 */
|
|
17
|
+
dot?: boolean;
|
|
18
|
+
/** バッジを非表示にする */
|
|
19
|
+
hidden?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 通知バッジコンポーネント
|
|
23
|
+
*
|
|
24
|
+
* アイコンに数字バッジ(カート数)やドットバッジ(未読通知)を重ねて表示。
|
|
25
|
+
* children にアイコンを渡すラッパーパターン。
|
|
26
|
+
* `count` で数値バッジ(99+で自動切り捨て)、`dot` でドットバッジ。
|
|
27
|
+
* BottomTabBar 内部でも使用されています。
|
|
28
|
+
*/
|
|
29
|
+
declare function NotificationBadge({ className, children, count, max, dot, hidden, color, size, ...props }: NotificationBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export { NotificationBadge, notificationBadgeVariants };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## NotificationList / お知らせリスト
|
|
3
|
+
*
|
|
4
|
+
* お知らせ・通知の一覧表示。フロント・管理画面共用。
|
|
5
|
+
*
|
|
6
|
+
* ### インポート
|
|
7
|
+
* ```tsx
|
|
8
|
+
* import { NotificationList } from '../../components/primitives/notification-list'
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* ### Props(主要なもの)
|
|
12
|
+
* | Prop | 型 | デフォルト | 説明 |
|
|
13
|
+
* |------|-----|-----------|------|
|
|
14
|
+
* | notifications | NotificationItem[] | — | 通知アイテム |
|
|
15
|
+
* | variant | "vertical"\|"horizontal" | "vertical" | レイアウト |
|
|
16
|
+
* | emptyMessage | string | — | 空の場合のメッセージ |
|
|
17
|
+
*
|
|
18
|
+
* ### AI 向け使用ルール
|
|
19
|
+
* - `vertical`: フロントの通知モーダル等(未読ドット + メッセージ上 + 日付下)
|
|
20
|
+
* - `horizontal`: 管理画面のお知らせセクション等(日付左 + NEW バッジ + タイトル + 矢印)
|
|
21
|
+
* - 空の場合はベルアイコン + メッセージ表示
|
|
22
|
+
*/
|
|
23
|
+
import * as React from "react";
|
|
24
|
+
export interface NotificationItem {
|
|
25
|
+
/** 通知ID */
|
|
26
|
+
id: string;
|
|
27
|
+
/** 通知テキスト */
|
|
28
|
+
message: string;
|
|
29
|
+
/** 日付 */
|
|
30
|
+
date: string;
|
|
31
|
+
/** 未読か(vertical: 未読ドット表示、horizontal: NEW バッジ表示) */
|
|
32
|
+
isUnread?: boolean;
|
|
33
|
+
/** リンク先 */
|
|
34
|
+
href?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface NotificationListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
37
|
+
/** 通知リスト */
|
|
38
|
+
notifications: NotificationItem[];
|
|
39
|
+
/** レイアウトバリアント */
|
|
40
|
+
variant?: "vertical" | "horizontal";
|
|
41
|
+
/** 空の場合のメッセージ */
|
|
42
|
+
emptyMessage?: string;
|
|
43
|
+
}
|
|
44
|
+
declare function NotificationList({ notifications, variant, emptyMessage, className, ...props }: NotificationListProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export { NotificationList };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const priceDisplayVariants: (props?: {
|
|
4
|
+
size?: "sm" | "lg" | "xl" | "md";
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) => string;
|
|
6
|
+
export interface PriceDisplayProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof priceDisplayVariants> {
|
|
7
|
+
/** 表示金額(税込) */
|
|
8
|
+
price: number;
|
|
9
|
+
/** 上限金額(価格レンジ表示用 — 指定すると "¥2,500〜¥4,000" 形式に) */
|
|
10
|
+
maxPrice?: number;
|
|
11
|
+
/** 元の金額(割引表示用 — 指定するとセール表示になる) */
|
|
12
|
+
originalPrice?: number;
|
|
13
|
+
/** 「税込」ラベルを表示するか */
|
|
14
|
+
showTaxLabel?: boolean;
|
|
15
|
+
/** 通貨記号 */
|
|
16
|
+
currency?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 価格表示コンポーネント
|
|
20
|
+
*
|
|
21
|
+
* 税込価格を ¥3,980 税込 の形式で表示。
|
|
22
|
+
* `originalPrice` 指定でセール表示(取消線 + 赤色)に自動切替。
|
|
23
|
+
* `maxPrice` 指定でレンジ表示(¥2,500〜¥4,000)に自動切替。
|
|
24
|
+
* スクリーンリーダー用の `aria-label` を自動生成します。
|
|
25
|
+
*
|
|
26
|
+
* ### 本番準拠フォーマット
|
|
27
|
+
*
|
|
28
|
+
* - 通常: `¥4,980 税込`(括弧なし)
|
|
29
|
+
* - セール: `¥4,280` (取消線) + `¥2,980 税込` (赤色)
|
|
30
|
+
* - レンジ: `¥2,500〜¥4,000 税込`
|
|
31
|
+
*/
|
|
32
|
+
declare function PriceDisplay({ className, price, maxPrice, originalPrice, showTaxLabel, currency, size, ...props }: PriceDisplayProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export { PriceDisplay, priceDisplayVariants };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface ProgressStepsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** ステップのラベル一覧 */
|
|
4
|
+
steps: string[];
|
|
5
|
+
/** 現在のステップ(0始まり) */
|
|
6
|
+
currentStep: number;
|
|
7
|
+
/** 完了済みステップにチェックマークを表示する */
|
|
8
|
+
showCheckmark?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* ステップインジケーターコンポーネント
|
|
12
|
+
*
|
|
13
|
+
* チェックアウトフロー(カート → 注文内容 → 確認 → 完了)などの
|
|
14
|
+
* 段階的なプロセスを視覚的に表現するナビゲーション。
|
|
15
|
+
*
|
|
16
|
+
* チェック/番号アイコンとテキストラベルを**縦に積む**レイアウト。
|
|
17
|
+
* ステップ間はコネクタライン(横線)で接続。
|
|
18
|
+
*
|
|
19
|
+
* ### AI 向け使用ルール
|
|
20
|
+
*
|
|
21
|
+
* - チェックアウト・会員登録など段階フロー画面で使用
|
|
22
|
+
* - `currentStep` で現在のステップをハイライト
|
|
23
|
+
* - 完了済みステップにはチェックマークアイコン
|
|
24
|
+
* - アクティブ/完了: Brand-Cake-Orange、未到達: Surface-Tertiary
|
|
25
|
+
*/
|
|
26
|
+
declare function ProgressSteps({ className, steps, currentStep, showCheckmark, ...props }: ProgressStepsProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export { ProgressSteps };
|