@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,15 @@
|
|
|
1
|
+
import type { SideNavGroup } from "../../components/primitives/side-nav";
|
|
2
|
+
/**
|
|
3
|
+
* Cake.jp マイページのメニュー定義
|
|
4
|
+
*
|
|
5
|
+
* `menu.ctp` 準拠の17項目。`SideNav` コンポーネントの `groups` prop に渡して使う。
|
|
6
|
+
*
|
|
7
|
+
* ### 使い方
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import { SideNav } from '../../components/primitives/side-nav'
|
|
10
|
+
* import { mypageMenuGroups } from '../../components/ec/_mypage-menu-data'
|
|
11
|
+
*
|
|
12
|
+
* <SideNav groups={mypageMenuGroups} activeMenu="news" ariaLabel="マイページメニュー" />
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare const mypageMenuGroups: SideNavGroup[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AdminLayout — 管理画面の共通レイアウト
|
|
3
|
+
*
|
|
4
|
+
* 本番の shop_layout.ctp を参考に、Header + SideNav + Main Content の構造を再現。
|
|
5
|
+
* 参照元:
|
|
6
|
+
* - admin-test-htdocs/app/views/layouts/shop_layout.ctp
|
|
7
|
+
* - admin-test-htdocs/app/views/elements/shop_layout/header.ctp
|
|
8
|
+
* - admin-test-htdocs/app/views/elements/shop_layout/side_menu.ctp
|
|
9
|
+
* - CSS: admin_shops/layout/nav_layout.css
|
|
10
|
+
*/
|
|
11
|
+
import * as React from "react";
|
|
12
|
+
export declare function MissingComponent({ name, children, className, }: {
|
|
13
|
+
name: string;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export interface AdminLayoutProps {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
/** 現在アクティブなナビアイテム */
|
|
20
|
+
activeNav?: string;
|
|
21
|
+
/** ページタイトル(ヘッダー表示用) */
|
|
22
|
+
title?: string;
|
|
23
|
+
/** パンくず */
|
|
24
|
+
breadcrumbs?: {
|
|
25
|
+
label: string;
|
|
26
|
+
href?: string;
|
|
27
|
+
}[];
|
|
28
|
+
/** ショップ名 */
|
|
29
|
+
shopName?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function AdminLayout({ children, activeNav, title, breadcrumbs, shopName, }: AdminLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface AnniversaryCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** 対象者の名前(例: "山田 花子") */
|
|
4
|
+
name: string;
|
|
5
|
+
/** 対象者との関係(例: "妻", "友人") */
|
|
6
|
+
relation: string;
|
|
7
|
+
/** 記念日の種類(例: "誕生日", "結婚記念日") */
|
|
8
|
+
type: string;
|
|
9
|
+
/** 記念日の日付表示(例: "06/15") */
|
|
10
|
+
date: string;
|
|
11
|
+
/** 記念日までの残り日数 */
|
|
12
|
+
daysLeft: number;
|
|
13
|
+
/** メモ(任意) */
|
|
14
|
+
memo?: string;
|
|
15
|
+
/** 編集リンクの href */
|
|
16
|
+
editHref?: string;
|
|
17
|
+
/** 編集ボタンのクリックハンドラ(editHref が無い場合に使用) */
|
|
18
|
+
onEdit?: () => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 記念日カード / AnniversaryCard
|
|
22
|
+
*
|
|
23
|
+
* マイページの記念日一覧で使用する個別の記念日表示カード。
|
|
24
|
+
* 本番の `.p-mypage-anniversary-card` 構造に準拠。
|
|
25
|
+
*
|
|
26
|
+
* ### インポート
|
|
27
|
+
* ```tsx
|
|
28
|
+
* import { AnniversaryCard } from '../../components/ec/anniversary-card'
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* ### Props(主要なもの)
|
|
32
|
+
* | Prop | 型 | デフォルト | 説明 |
|
|
33
|
+
* |------|-----|-----------|------|
|
|
34
|
+
* | name | string | — | 対象者の名前 |
|
|
35
|
+
* | relation | string | — | 対象者との関係 |
|
|
36
|
+
* | type | string | — | 記念日の種類 |
|
|
37
|
+
* | date | string | — | 記念日の日付表示 |
|
|
38
|
+
* | daysLeft | number | — | 残り日数 |
|
|
39
|
+
* | memo | string | — | メモ(任意) |
|
|
40
|
+
* | editHref | string | — | 編集リンクの href |
|
|
41
|
+
* | onEdit | () => void | — | 編集ボタンのクリックハンドラ |
|
|
42
|
+
*
|
|
43
|
+
* ### AI 向け使用ルール
|
|
44
|
+
* - マイページの記念日一覧タブ内で使用する
|
|
45
|
+
* - `daysLeft` が小さいほど直近の記念日であることを示す
|
|
46
|
+
* - `editHref` を渡すと編集ボタンが `<a>` リンクになる
|
|
47
|
+
* - `onEdit` を渡すと編集ボタンが `<button>` になる
|
|
48
|
+
*/
|
|
49
|
+
declare function AnniversaryCard({ name, relation, type, date, daysLeft, memo, editHref, onEdit, className, ...props }: AnniversaryCardProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export { AnniversaryCard };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface CakeLogoProps extends React.SVGAttributes<SVGSVGElement> {
|
|
3
|
+
/** ロゴの高さ(px) */
|
|
4
|
+
height?: number;
|
|
5
|
+
/** カラー(デフォルト: 現在のテキスト色) */
|
|
6
|
+
color?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Cake.jp ロゴ(本番SVG準拠)
|
|
10
|
+
*
|
|
11
|
+
* Cake.jp 本番サイトのヘッダーから取得した正確なSVGパスデータを使用。
|
|
12
|
+
* viewBox="0 0 568 108" のワードマーク。
|
|
13
|
+
*
|
|
14
|
+
* ### AI 向け使用ルール
|
|
15
|
+
*
|
|
16
|
+
* - ヘッダーロゴには `<CakeLogo height={24} />` を使用
|
|
17
|
+
* - フッターでは `<CakeLogo height={20} color="var(--Text-Low-Emphasis)" />`
|
|
18
|
+
* - ロゴの色はデフォルトで `currentColor`(親のテキスト色を継承)
|
|
19
|
+
* - ロゴの比率は固定(width は height から自動計算)
|
|
20
|
+
*/
|
|
21
|
+
declare function CakeLogo({ height, color, className, ...props }: CakeLogoProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export { CakeLogo };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type ChartGranularity = "daily" | "weekly" | "monthly";
|
|
2
|
+
export type ChartPeriod = "3M" | "6M" | "12M" | "all";
|
|
3
|
+
export interface ChartControlsProps {
|
|
4
|
+
/** 粒度 */
|
|
5
|
+
granularity?: ChartGranularity;
|
|
6
|
+
onGranularityChange?: (v: ChartGranularity) => void;
|
|
7
|
+
/** 期間 */
|
|
8
|
+
period?: ChartPeriod;
|
|
9
|
+
onPeriodChange?: (v: ChartPeriod) => void;
|
|
10
|
+
/** 前期比を重ねる */
|
|
11
|
+
showPrevious?: boolean;
|
|
12
|
+
onShowPreviousChange?: (v: boolean) => void;
|
|
13
|
+
/** 追加クラス */
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function ChartControls({ granularity, onGranularityChange, period, onPeriodChange, showPrevious, onShowPreviousChange, className, }: ChartControlsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface CountdownTimerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** カウントダウンの状態 */
|
|
4
|
+
variant?: "before" | "active" | "ended";
|
|
5
|
+
/** 残り時間(秒) */
|
|
6
|
+
remainingSeconds?: number;
|
|
7
|
+
/** ラベル(variant に応じてデフォルトあり) */
|
|
8
|
+
label?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* カウントダウンタイマー
|
|
12
|
+
*
|
|
13
|
+
* タイムセールの残り時間を表示。
|
|
14
|
+
* Figma: _カウントダウン表示
|
|
15
|
+
*
|
|
16
|
+
* ### AI 向け使用ルール
|
|
17
|
+
*
|
|
18
|
+
* - タイムセール開催前: `<CountdownTimer variant="before" remainingSeconds={3600} />`
|
|
19
|
+
* - タイムセール開催中: `<CountdownTimer variant="active" remainingSeconds={3600} />`
|
|
20
|
+
* - タイムセール終了後: `<CountdownTimer variant="ended" />`
|
|
21
|
+
* - remainingSeconds を渡すと自動で HH:MM:SS 形式に変換
|
|
22
|
+
*/
|
|
23
|
+
declare function CountdownTimer({ variant, remainingSeconds, label, className, ...props }: CountdownTimerProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export { CountdownTimer };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface CouponCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** クーポンタイトル(例: "【Example Patisserie】10%OFF" or "10%OFF") */
|
|
4
|
+
title: string;
|
|
5
|
+
/** クーポンの説明(例: "最低注文金額:3,000円 / 有効期限:2024年2月5日(月)11:59") */
|
|
6
|
+
description?: string;
|
|
7
|
+
/** 商品画像URL(vertical のみ) */
|
|
8
|
+
imageUrl?: string;
|
|
9
|
+
/** 商品画像alt */
|
|
10
|
+
imageAlt?: string;
|
|
11
|
+
/** ショップサムネイルURL(画像左下に重ねて表示、vertical のみ) */
|
|
12
|
+
shopThumbnailUrl?: string;
|
|
13
|
+
/** ショップ名(サムネイルのalt) */
|
|
14
|
+
shopName?: string;
|
|
15
|
+
/** クーポンの状態 */
|
|
16
|
+
status?: "available" | "acquiring" | "acquired" | "unavailable";
|
|
17
|
+
/** 獲得ボタンのクリックハンドラ */
|
|
18
|
+
onAcquire?: () => void;
|
|
19
|
+
/** 獲得ボタンのラベル */
|
|
20
|
+
acquireLabel?: string;
|
|
21
|
+
/** レイアウト(vertical: 縦型カード、horizontal: SP横長) */
|
|
22
|
+
layout?: "vertical" | "horizontal";
|
|
23
|
+
/** 限定ラベル(例: "先着200枚") — horizontal のみ */
|
|
24
|
+
limitLabel?: string;
|
|
25
|
+
/** 適用条件テキスト(例: "スイーツ限定で適用") — horizontal のみ */
|
|
26
|
+
conditionText?: string;
|
|
27
|
+
/** 有効期限テキスト(例: "有効期限:2023/5/11 (利用条件あり)") — horizontal のみ */
|
|
28
|
+
expiryText?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* クーポンカード
|
|
32
|
+
*
|
|
33
|
+
* Cake.jp のクーポン表示用カード。
|
|
34
|
+
*
|
|
35
|
+
* ### レイアウト
|
|
36
|
+
* - **vertical**: 縦型カード(画像 → タイトル → 点線 → CTAボタン)
|
|
37
|
+
* - **horizontal**: SP横長カード(左: 割引情報 | 点線区切り | 右: 獲得ボタン)
|
|
38
|
+
*
|
|
39
|
+
* ### AI 向け使用ルール
|
|
40
|
+
*
|
|
41
|
+
* - 縦型: `<CouponCard layout="vertical" title="【Example Patisserie】10%OFF" />`
|
|
42
|
+
* - SP横長: `<CouponCard layout="horizontal" title="10%OFF" limitLabel="先着200枚" conditionText="スイーツ限定で適用" expiryText="有効期限:2023/5/11" />`
|
|
43
|
+
* - 獲得可能: `status="available"`
|
|
44
|
+
* - 獲得済み: `status="acquired"`
|
|
45
|
+
*/
|
|
46
|
+
declare function CouponCard({ title, description, imageUrl, imageAlt, shopThumbnailUrl, shopName, status, onAcquire, acquireLabel, layout, limitLabel, conditionText, expiryText, className, ...props }: CouponCardProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export { CouponCard };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type DayAvailability = "available" | "unavailable" | "few";
|
|
3
|
+
export interface CalendarDay {
|
|
4
|
+
/** 日付 */
|
|
5
|
+
date: Date;
|
|
6
|
+
/** 予約可否 */
|
|
7
|
+
availability: DayAvailability;
|
|
8
|
+
}
|
|
9
|
+
export interface DeliveryCalendarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
10
|
+
/** 年 */
|
|
11
|
+
year: number;
|
|
12
|
+
/** 月(1-12) */
|
|
13
|
+
month: number;
|
|
14
|
+
/** 日ごとの予約状況 */
|
|
15
|
+
days: CalendarDay[];
|
|
16
|
+
/** 月変更ハンドラ */
|
|
17
|
+
onMonthChange?: (year: number, month: number) => void;
|
|
18
|
+
/** 日付選択ハンドラ */
|
|
19
|
+
onDaySelect?: (date: Date) => void;
|
|
20
|
+
/** 選択中の日付 */
|
|
21
|
+
selectedDate?: Date;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 配送カレンダー
|
|
25
|
+
*
|
|
26
|
+
* 配送可能日をカレンダー形式で表示。
|
|
27
|
+
* Figma: Input/calendar, _monthly
|
|
28
|
+
*
|
|
29
|
+
* ### AI 向け使用ルール
|
|
30
|
+
*
|
|
31
|
+
* - `<DeliveryCalendar year={2024} month={1} days={[...]} />`
|
|
32
|
+
* - ○ = 配送可、△ = 残りわずか、× = 配送不可
|
|
33
|
+
* - 日曜・土曜は色分け(赤・青)
|
|
34
|
+
*/
|
|
35
|
+
declare function DeliveryCalendar({ year, month, days, onMonthChange, onDaySelect, selectedDate, className, ...props }: DeliveryCalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export { DeliveryCalendar };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface OrderSectionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** セクションタイトル */
|
|
4
|
+
title: string;
|
|
5
|
+
/** 入力ステータス */
|
|
6
|
+
status?: "default" | "empty" | "error";
|
|
7
|
+
/** セクション概要テキスト */
|
|
8
|
+
summary?: string;
|
|
9
|
+
/** 編集ボタンのラベル */
|
|
10
|
+
editLabel?: string;
|
|
11
|
+
/** 編集ボタンのハンドラ */
|
|
12
|
+
onEdit?: () => void;
|
|
13
|
+
/** 子要素(セクション内容) */
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 注文セクション
|
|
18
|
+
*
|
|
19
|
+
* 購入確認画面の各セクション(注文者、お届け先、支払い方法等)。
|
|
20
|
+
* Figma: 注文内容の確認画面セクション
|
|
21
|
+
*
|
|
22
|
+
* ### AI 向け使用ルール
|
|
23
|
+
*
|
|
24
|
+
* - 入力済み: `<OrderSection title="注文者" status="default"><p>山田太郎</p></OrderSection>`
|
|
25
|
+
* - 未入力: `<OrderSection title="お届け先" status="empty" />`
|
|
26
|
+
* - エラー: `<OrderSection title="支払い方法" status="error" />`
|
|
27
|
+
*/
|
|
28
|
+
declare function OrderSection({ title, status, summary, editLabel, onEdit, children, className, ...props }: OrderSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export { OrderSection };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface OrderSummaryLineItem {
|
|
3
|
+
/** 項目ラベル(例: "商品合計(4点)") */
|
|
4
|
+
label: string;
|
|
5
|
+
/** 金額テキスト(例: "¥17,740")or ReactNode */
|
|
6
|
+
value: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export interface OrderSummaryProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
|
+
/** 明細行(小計・送料・クーポンなど) */
|
|
10
|
+
lineItems?: OrderSummaryLineItem[];
|
|
11
|
+
/** 合計ラベル(デフォルト: "合計(税込)") */
|
|
12
|
+
totalLabel?: string;
|
|
13
|
+
/** 合計金額テキスト */
|
|
14
|
+
totalValue: string;
|
|
15
|
+
/** CTAボタンテキスト */
|
|
16
|
+
ctaLabel: string;
|
|
17
|
+
/** CTAボタンクリック */
|
|
18
|
+
onCTAClick?: () => void;
|
|
19
|
+
/** セキュリティバッジを表示(チェックアウト画面用) */
|
|
20
|
+
showSecurityBadge?: boolean;
|
|
21
|
+
/** セキュリティバッジのテキスト */
|
|
22
|
+
securityText?: string;
|
|
23
|
+
/** fixed レイアウトを無効化(インライン表示用) */
|
|
24
|
+
disableFixed?: boolean;
|
|
25
|
+
/** CTAボタンを無効化 */
|
|
26
|
+
ctaDisabled?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 注文サマリー
|
|
30
|
+
*
|
|
31
|
+
* カート・チェックアウトで使われる合計金額+CTAボタン。
|
|
32
|
+
* 画面下部に固定表示するデフォルト、またはインライン表示が可能。
|
|
33
|
+
* セキュリティバッジ表示にも対応。
|
|
34
|
+
*/
|
|
35
|
+
declare function OrderSummary({ className, lineItems, totalLabel, totalValue, ctaLabel, onCTAClick, showSecurityBadge, securityText, disableFixed, ctaDisabled, ...props }: OrderSummaryProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export { OrderSummary };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type CreditCardBrand = "visa" | "mastercard" | "jcb" | "amex" | "diners";
|
|
3
|
+
export interface CreditCardIconProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, "src" | "alt"> {
|
|
4
|
+
brand: CreditCardBrand;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* クレジットカードブランドアイコン
|
|
8
|
+
*
|
|
9
|
+
* 本番CDN(assets.cake.jp)の公式ブランドロゴ画像を使用。
|
|
10
|
+
* 本番CSSの `.c-card-logo` と同じ `height: 30px; width: auto` を適用。
|
|
11
|
+
* Figma: creditcard
|
|
12
|
+
*/
|
|
13
|
+
declare function CreditCardIcon({ brand, className, ...props }: CreditCardIconProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export interface PaymentMethodDisplayProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
/** 支払い方法名(例: "クレジットカード") */
|
|
16
|
+
method: string;
|
|
17
|
+
/** カードブランド */
|
|
18
|
+
cardBrand?: CreditCardBrand;
|
|
19
|
+
/** カード末尾4桁 */
|
|
20
|
+
cardLast4?: string;
|
|
21
|
+
/** 有効期限 */
|
|
22
|
+
cardExpiry?: string;
|
|
23
|
+
/** 登録状態 */
|
|
24
|
+
status?: "registered" | "unregistered" | "expired";
|
|
25
|
+
/** 対応ブランド一覧(支払い方法の説明用) */
|
|
26
|
+
acceptedBrands?: CreditCardBrand[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 支払い方法表示
|
|
30
|
+
*
|
|
31
|
+
* クレジットカード情報やその他の支払い方法の表示。
|
|
32
|
+
* Figma: 支払い方法, creditcard
|
|
33
|
+
*
|
|
34
|
+
* ### AI 向け使用ルール
|
|
35
|
+
*
|
|
36
|
+
* - 登録済み: `<PaymentMethodDisplay method="クレジットカード" cardBrand="visa" cardLast4="1234" status="registered" />`
|
|
37
|
+
* - 未登録: `<PaymentMethodDisplay method="クレジットカード" status="unregistered" />`
|
|
38
|
+
* - 対応ブランド表示: `<PaymentMethodDisplay acceptedBrands={["visa","mastercard","jcb","amex","diners"]} />`
|
|
39
|
+
*/
|
|
40
|
+
declare function PaymentMethodDisplay({ method, cardBrand, cardLast4, cardExpiry, status, acceptedBrands, className, ...props }: PaymentMethodDisplayProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export { PaymentMethodDisplay, CreditCardIcon };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type TagProps } from "../../components/primitives/tag";
|
|
3
|
+
export interface ProductCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** 商品名 */
|
|
5
|
+
name: string;
|
|
6
|
+
/** 商品画像URL */
|
|
7
|
+
imageUrl: string;
|
|
8
|
+
/** 商品画像alt */
|
|
9
|
+
imageAlt?: string;
|
|
10
|
+
/** 金額(税込) */
|
|
11
|
+
price: number;
|
|
12
|
+
/** 元の金額(割引表示用) */
|
|
13
|
+
originalPrice?: number;
|
|
14
|
+
/** 評価値 (0〜5) */
|
|
15
|
+
rating?: number;
|
|
16
|
+
/** レビュー件数 */
|
|
17
|
+
reviewCount?: number;
|
|
18
|
+
/** ショップ名 */
|
|
19
|
+
shopName?: string;
|
|
20
|
+
/** ショップページURL(指定するとショップ名がリンク化、hover時アンダーライン) */
|
|
21
|
+
shopHref?: string;
|
|
22
|
+
/** タグリスト(配送方法・キャンペーンなど) */
|
|
23
|
+
tags?: Array<{
|
|
24
|
+
label: string;
|
|
25
|
+
variant?: TagProps["variant"];
|
|
26
|
+
}>;
|
|
27
|
+
/** お気に入り状態 */
|
|
28
|
+
isFavorite?: boolean;
|
|
29
|
+
/** お気に入りボタン押下時 */
|
|
30
|
+
onFavoriteToggle?: () => void;
|
|
31
|
+
/** カードクリック時 */
|
|
32
|
+
onCardClick?: () => void;
|
|
33
|
+
/** 商品リンクURL */
|
|
34
|
+
href?: string;
|
|
35
|
+
/** ランキング順位(1〜表示) */
|
|
36
|
+
ranking?: number;
|
|
37
|
+
/** 最短お届け日(例: "3/19") */
|
|
38
|
+
deliveryDate?: string;
|
|
39
|
+
/** カードの向き */
|
|
40
|
+
orientation?: "vertical" | "horizontal";
|
|
41
|
+
/** 割引率を画像に重ねて表示するか(originalPrice設定時に自動計算、falseで非表示) */
|
|
42
|
+
showDiscountBadge?: boolean;
|
|
43
|
+
/** 「カートに追加」ボタンを表示(verticalのみ) */
|
|
44
|
+
showCartButton?: boolean;
|
|
45
|
+
/** カート追加ボタンクリック時 */
|
|
46
|
+
onCartAdd?: () => void;
|
|
47
|
+
/** カートボタンのラベル */
|
|
48
|
+
cartButtonLabel?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* ブックマーク(しおり/リボン)アイコン — 本番 .m-bookmark-button 準拠
|
|
52
|
+
* 上が開いた長方形、下がV字に切れ込むリボン型。
|
|
53
|
+
*/
|
|
54
|
+
export declare function BookmarkRibbonIcon({ size, filled }: {
|
|
55
|
+
size?: number;
|
|
56
|
+
filled?: boolean;
|
|
57
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
/**
|
|
59
|
+
* 商品カードコンポーネント — Figma DS 準拠
|
|
60
|
+
*
|
|
61
|
+
* Cake.jp の商品一覧・検索結果に使用するカードUI。
|
|
62
|
+
* vertical(グリッド表示)と horizontal(リスト表示)の2レイアウト対応。
|
|
63
|
+
*
|
|
64
|
+
* ### Figma との対応
|
|
65
|
+
* - 画像エリア: 正方形、rounded-lg (8px)、4px パディング
|
|
66
|
+
* - ブックマーク: 画像右下に 36px 円形ボタン(本番 .m-bookmark-button--mid 準拠)
|
|
67
|
+
* - タグ: 画像左下に配置(PR、セールバッジ等)
|
|
68
|
+
* - 商品情報: gap-[2px]、商品名 → レビュー+最短日(同行) → 価格
|
|
69
|
+
* - カートボタン: h-[36px]、rounded-[12px]、Brand-Cake-Orange
|
|
70
|
+
*
|
|
71
|
+
* ### 機能
|
|
72
|
+
* - `shopHref` でショップ名リンク化(hover時アンダーライン付き)
|
|
73
|
+
* - `showCartButton` で「カートに追加」ボタン表示(verticalのみ)
|
|
74
|
+
* - ランキングバッジ、お気に入り、割引バッジなどEC必須要素を統合提供
|
|
75
|
+
*/
|
|
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;
|
|
77
|
+
export { ProductCard };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type SectionHeaderSize } from "../../components/primitives/section-header";
|
|
2
|
+
import { type ProductCardProps } from "../../components/ec/product-card";
|
|
3
|
+
export interface ProductCarouselProps {
|
|
4
|
+
/** セクションタイトル */
|
|
5
|
+
title: string;
|
|
6
|
+
/** サブタイトル */
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
/** セクション説明文(タイトル下に表示、コラボ・特集の説明等) */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** セクション画像URL(コラボロゴ、ブランドイメージ等。指定時はヘッダー左に画像表示) */
|
|
11
|
+
sectionImage?: string;
|
|
12
|
+
/** セクション画像のalt */
|
|
13
|
+
sectionImageAlt?: string;
|
|
14
|
+
/** セクション画像のリンクURL */
|
|
15
|
+
sectionImageHref?: string;
|
|
16
|
+
/** 「もっと見る」リンクURL */
|
|
17
|
+
moreHref?: string;
|
|
18
|
+
/** 「もっと見る」ラベル */
|
|
19
|
+
moreLabel?: string;
|
|
20
|
+
/** もっと見るクリック時 */
|
|
21
|
+
onMoreClick?: () => void;
|
|
22
|
+
/** SectionHeader size */
|
|
23
|
+
headerSize?: SectionHeaderSize;
|
|
24
|
+
/** 商品リスト */
|
|
25
|
+
products: ProductCardProps[];
|
|
26
|
+
/** カードの幅 (default: "sm"=160px, "md"=200px, "lg"=240px, "responsive"=本番準拠レスポンシブ) */
|
|
27
|
+
cardSize?: "sm" | "md" | "lg" | "responsive";
|
|
28
|
+
/** ランキング表示(true の場合 index+1 が ranking に渡される) */
|
|
29
|
+
showRanking?: boolean;
|
|
30
|
+
/** カートボタン表示 */
|
|
31
|
+
showCartButton?: boolean;
|
|
32
|
+
/** 追加クラス */
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* 商品カルーセルコンポーネント — Atomic Design Level 3 Organism
|
|
37
|
+
*
|
|
38
|
+
* SectionHeader + 横スクロール ProductCard 行を組み合わせたセクション。
|
|
39
|
+
* トップページで最も頻出するパターン(ランキング、新着、おすすめ等)。
|
|
40
|
+
*
|
|
41
|
+
* ### インポート
|
|
42
|
+
* ```tsx
|
|
43
|
+
* import { ProductCarousel } from '../../components/ec/product-carousel'
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* ### AI 向け使用ルール
|
|
47
|
+
* - トップページの各商品セクションに使う
|
|
48
|
+
* - `showRanking` で 1〜N のランキングバッジを自動付与
|
|
49
|
+
* - `cardSize` でカード幅を調整(デフォルト sm=160px)
|
|
50
|
+
* - `showCartButton` でカート追加ボタンを表示
|
|
51
|
+
* - `sectionImage` でコラボ・ブランドロゴ等の画像をヘッダー左に表示
|
|
52
|
+
* - `description` でセクション説明文を追加(コラボ紹介、特集説明等)
|
|
53
|
+
* - 横パディングは SectionHeader(px-4)とスクロールコンテナ(px-4)が持つ
|
|
54
|
+
*/
|
|
55
|
+
declare function ProductCarousel({ title, subtitle, description, sectionImage, sectionImageAlt, sectionImageHref, moreHref, moreLabel, onMoreClick, headerSize, products, cardSize, showRanking, showCartButton, className, }: ProductCarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
export { ProductCarousel };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type ProductCTAVariant = "add-to-cart" | "resale" | "timesale" | "not-logged-in" | "backorder" | "out-of-stock-waiting" | "pre-sale" | "countdown" | "sold-out" | "timesale-ended";
|
|
3
|
+
export interface ProductCTAProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** CTAバリエーション */
|
|
5
|
+
variant?: ProductCTAVariant;
|
|
6
|
+
/** 価格表示 */
|
|
7
|
+
price?: string;
|
|
8
|
+
/** カートに追加のハンドラ */
|
|
9
|
+
onAddToCart?: () => void;
|
|
10
|
+
/** ブックマーク追加/解除のハンドラ */
|
|
11
|
+
onBookmark?: () => void;
|
|
12
|
+
/** ブックマーク済み状態 */
|
|
13
|
+
isBookmarked?: boolean;
|
|
14
|
+
/** カウントダウンテキスト(variant="countdown"用) */
|
|
15
|
+
countdownText?: string;
|
|
16
|
+
/** 再販通知テキスト(variant="resale"用) */
|
|
17
|
+
resaleText?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 商品詳細CTA
|
|
21
|
+
*
|
|
22
|
+
* 商品詳細ページ下部のカートボタン。状態に応じて表示が切り替わる。
|
|
23
|
+
* Figma: cv - set
|
|
24
|
+
*
|
|
25
|
+
* ### AI 向け使用ルール
|
|
26
|
+
*
|
|
27
|
+
* - 通常: `<ProductCTA variant="add-to-cart" />`
|
|
28
|
+
* - タイムセール中: `<ProductCTA variant="timesale" />`
|
|
29
|
+
* - 完売: `<ProductCTA variant="sold-out" />`
|
|
30
|
+
* - 未ログイン: `<ProductCTA variant="not-logged-in" />`
|
|
31
|
+
* - 入荷待ち: `<ProductCTA variant="backorder" />`
|
|
32
|
+
* - 販売開始前: `<ProductCTA variant="pre-sale" />`
|
|
33
|
+
*/
|
|
34
|
+
declare function ProductCTA({ variant, onAddToCart, onBookmark, isBookmarked, countdownText, resaleText, className, ...props }: ProductCTAProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export { ProductCTA };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface ProductDetailBarTab {
|
|
3
|
+
/** タブラベル(例: "写真") */
|
|
4
|
+
label: string;
|
|
5
|
+
/** スクロール先の要素ID(例: "#detail-slider") */
|
|
6
|
+
href: string;
|
|
7
|
+
/** アクティブ状態 */
|
|
8
|
+
active?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ProductDetailBarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
/** タブ項目(写真・特徴・商品情報・販売店・口コミ) */
|
|
12
|
+
tabs: ProductDetailBarTab[];
|
|
13
|
+
/** 商品名 */
|
|
14
|
+
productName: string;
|
|
15
|
+
/** 価格(税込) */
|
|
16
|
+
price: number;
|
|
17
|
+
/** セール価格の場合 true(赤文字にする) */
|
|
18
|
+
isSale?: boolean;
|
|
19
|
+
/** レビュー平均点 */
|
|
20
|
+
rating?: number;
|
|
21
|
+
/** レビュー件数 */
|
|
22
|
+
reviewCount?: number;
|
|
23
|
+
/** CTAボタンのラベル */
|
|
24
|
+
ctaLabel?: string;
|
|
25
|
+
/** CTAボタンクリック */
|
|
26
|
+
onCtaClick?: () => void;
|
|
27
|
+
/** CTAボタンを無効化 */
|
|
28
|
+
ctaDisabled?: boolean;
|
|
29
|
+
/** タブクリック */
|
|
30
|
+
onTabClick?: (tab: ProductDetailBarTab) => void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 商品詳細スティッキーバー
|
|
34
|
+
*
|
|
35
|
+
* 商品詳細ページで右カラム(購入ボタン)がスクロールで見えなくなった時に
|
|
36
|
+
* ヘッダー下部に表示するPC専用のナビゲーション+商品概要バー。
|
|
37
|
+
*
|
|
38
|
+
* 本番の `.p-item-detail-header` に対応。
|
|
39
|
+
* Header の `bottomSlot` に渡して使う。
|
|
40
|
+
*
|
|
41
|
+
* ### 使い方
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <Header
|
|
44
|
+
* variant="logo"
|
|
45
|
+
* actions={[...]}
|
|
46
|
+
* bottomSlot={
|
|
47
|
+
* <ProductDetailBar
|
|
48
|
+
* tabs={[
|
|
49
|
+
* { label: "写真", href: "#slider", active: true },
|
|
50
|
+
* { label: "特徴", href: "#features" },
|
|
51
|
+
* ]}
|
|
52
|
+
* productName="苺のデコレーションケーキ 5号"
|
|
53
|
+
* price={4980}
|
|
54
|
+
* rating={4.89}
|
|
55
|
+
* reviewCount={567}
|
|
56
|
+
* />
|
|
57
|
+
* }
|
|
58
|
+
* />
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
declare function ProductDetailBar({ className, tabs, productName, price, isSale, rating, reviewCount, ctaLabel, onCtaClick, ctaDisabled, onTabClick, ...props }: ProductDetailBarProps): import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
export { ProductDetailBar };
|