@cakejp/design-system 0.22.0 → 0.23.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 +96 -0
- package/CLAUDE.md +5 -1
- package/MIGRATION.md +43 -0
- package/UPDATING.md +2 -0
- package/bin/check-tokens.mjs +136 -0
- package/bin/init.js +9 -0
- package/contracts/components.json +87 -25
- package/contracts/composition.json +9 -9
- package/contracts/rules.json +1 -1
- package/contracts/screen-patterns.json +1 -1
- package/dist/components/ec/admin-shell.js +7 -7
- package/dist/components/ec/anniversary-card.js +1 -1
- package/dist/components/ec/chart-controls.js +7 -7
- package/dist/components/ec/coupon-card.js +10 -10
- package/dist/components/ec/delivery-calendar.js +1 -1
- package/dist/components/ec/mypage-shell.js +1 -1
- package/dist/components/ec/order-section.js +1 -1
- package/dist/components/ec/order-summary.js +7 -5
- package/dist/components/ec/product-card.js +32 -30
- package/dist/components/ec/product-detail-sidebar.js +1 -1
- package/dist/components/ec/product-list-item.js +57 -56
- package/dist/components/ec/product-option.js +30 -30
- package/dist/components/ec/review-summary.js +1 -1
- package/dist/components/ec/shop-card.js +7 -7
- package/dist/components/foundations/accordion.js +1 -1
- package/dist/components/foundations/alert-dialog.js +65 -43
- package/dist/components/foundations/alert.js +74 -68
- package/dist/components/foundations/badge.js +4 -4
- package/dist/components/foundations/button.js +15 -15
- package/dist/components/foundations/checkbox-card.js +18 -18
- package/dist/components/foundations/checkbox.js +6 -6
- package/dist/components/foundations/chip-variants.js +8 -8
- package/dist/components/foundations/data-table.js +244 -209
- package/dist/components/foundations/dialog.js +84 -60
- package/dist/components/foundations/drawer.js +61 -53
- package/dist/components/foundations/field.js +51 -35
- package/dist/components/foundations/file-input.js +1 -1
- package/dist/components/foundations/input.js +9 -8
- package/dist/components/foundations/popover.js +15 -12
- package/dist/components/foundations/progress.js +19 -18
- package/dist/components/foundations/radio-group.js +26 -23
- package/dist/components/foundations/select.js +9 -8
- package/dist/components/foundations/sheet.js +82 -59
- package/dist/components/foundations/skeleton.js +6 -6
- package/dist/components/foundations/slider.js +7 -7
- package/dist/components/foundations/sonner.js +9 -8
- package/dist/components/foundations/switch.js +3 -2
- package/dist/components/foundations/tabs.js +5 -5
- package/dist/components/foundations/textarea.js +7 -6
- package/dist/components/foundations/toggle-group.js +5 -5
- package/dist/components/primitives/admin-header.js +3 -3
- package/dist/components/primitives/admin-side-nav.js +101 -92
- package/dist/components/primitives/category-shortcuts.js +6 -6
- package/dist/components/primitives/chat-composer.js +1 -1
- package/dist/components/primitives/chip.js +25 -25
- package/dist/components/primitives/combobox.js +74 -63
- package/dist/components/primitives/content-carousel.js +64 -62
- package/dist/components/primitives/date-picker.js +99 -96
- package/dist/components/primitives/error-state.js +9 -9
- package/dist/components/primitives/filter-bar.js +4 -4
- package/dist/components/primitives/footer.js +1 -1
- package/dist/components/primitives/form-field.js +8 -8
- package/dist/components/primitives/funnel-shell.js +5 -5
- package/dist/components/primitives/header.js +16 -16
- package/dist/components/primitives/image-carousel.js +42 -41
- package/dist/components/primitives/image-gallery.js +61 -58
- package/dist/components/primitives/image-input.js +2 -2
- package/dist/components/primitives/image-uploader.js +1 -1
- package/dist/components/primitives/kebab-menu.js +20 -16
- package/dist/components/primitives/list-item.js +17 -17
- package/dist/components/primitives/menu-drawer.js +11 -11
- package/dist/components/primitives/multi-select.js +66 -66
- package/dist/components/primitives/notification-list.js +13 -13
- package/dist/components/primitives/number-input.js +118 -112
- package/dist/components/primitives/progress-steps.js +3 -3
- package/dist/components/primitives/search-bar.js +6 -6
- package/dist/components/primitives/section-nav.js +1 -1
- package/dist/components/primitives/side-nav.js +1 -1
- package/dist/components/primitives/sub-nav.js +12 -12
- package/dist/components/primitives/tag.js +3 -3
- package/dist/components/primitives/workspace-shell.js +8 -8
- package/dist/index.css +1 -1
- package/dist/index.js +1479 -704
- package/dist/lib/focus-restore.js +67 -0
- package/dist/lib/focus-ring.js +1 -1
- package/dist/lib/ime.js +17 -0
- package/dist/lib/search-normalize.js +30 -0
- package/dist/types/components/ec/admin-shell.d.ts +1 -1
- package/dist/types/components/foundations/alert-dialog.d.ts +2 -2
- package/dist/types/components/foundations/alert.d.ts +14 -1
- package/dist/types/components/foundations/card.d.ts +3 -3
- package/dist/types/components/foundations/confirm-dialog.d.ts +3 -3
- package/dist/types/components/foundations/data-table.d.ts +1 -1
- package/dist/types/components/foundations/dialog.d.ts +2 -2
- package/dist/types/components/foundations/drawer.d.ts +1 -1
- package/dist/types/components/foundations/field.d.ts +23 -3
- package/dist/types/components/foundations/popover.d.ts +1 -1
- package/dist/types/components/foundations/sheet.d.ts +4 -3
- package/dist/types/components/foundations/sonner.d.ts +3 -2
- package/dist/types/components/primitives/admin-side-nav.d.ts +2 -0
- package/dist/types/components/primitives/combobox.d.ts +6 -0
- package/dist/types/components/primitives/date-picker.d.ts +8 -3
- package/dist/types/components/primitives/funnel-shell.d.ts +1 -1
- package/dist/types/components/primitives/kebab-menu.d.ts +10 -1
- package/dist/types/components/primitives/number-input.d.ts +20 -1
- package/dist/types/components/primitives/progress-steps.d.ts +1 -1
- package/dist/types/components/primitives/section.d.ts +1 -1
- package/dist/types/components/primitives/workspace-shell.d.ts +2 -2
- package/dist/types/index.d.ts +3 -4
- package/dist/types/lib/focus-restore.d.ts +52 -0
- package/dist/types/lib/focus-ring.d.ts +3 -0
- package/dist/types/lib/ime.d.ts +36 -0
- package/dist/types/lib/search-normalize.d.ts +28 -0
- package/package.json +3 -1
- package/src/components/COMPONENT_LOOKUP.md +12 -12
- package/src/preset-standalone.css +43 -21
- package/src/preset.css +36 -18
- package/src/styles/primitive.css +1 -0
- package/src/styles/semantic.css +12 -2
- package/tokens.json +22 -3
|
@@ -12,13 +12,13 @@ function P({
|
|
|
12
12
|
shopName: a,
|
|
13
13
|
status: n = "available",
|
|
14
14
|
onAcquire: c,
|
|
15
|
-
acquireLabel:
|
|
15
|
+
acquireLabel: h = "クーポンを獲得する",
|
|
16
16
|
layout: p = "vertical",
|
|
17
17
|
limitLabel: f,
|
|
18
18
|
conditionText: b,
|
|
19
19
|
expiryText: x,
|
|
20
20
|
className: m,
|
|
21
|
-
...
|
|
21
|
+
...u
|
|
22
22
|
}) {
|
|
23
23
|
return p === "horizontal" ? /* @__PURE__ */ e(
|
|
24
24
|
w,
|
|
@@ -30,7 +30,7 @@ function P({
|
|
|
30
30
|
status: n,
|
|
31
31
|
onAcquire: c,
|
|
32
32
|
className: m,
|
|
33
|
-
...
|
|
33
|
+
...u
|
|
34
34
|
}
|
|
35
35
|
) : /* @__PURE__ */ i(
|
|
36
36
|
"div",
|
|
@@ -41,9 +41,9 @@ function P({
|
|
|
41
41
|
n === "unavailable" && "opacity-50",
|
|
42
42
|
m
|
|
43
43
|
),
|
|
44
|
-
...
|
|
44
|
+
...u,
|
|
45
45
|
children: [
|
|
46
|
-
l && /* @__PURE__ */ i("div", { className: "relative aspect-[5/2] w-full overflow-hidden bg-[var(--Surface-Secondary)]", children: [
|
|
46
|
+
l && /* @__PURE__ */ i("div", { className: "relative aspect-[5/2] w-full overflow-hidden bg-[var(--Surface-Neutral-Secondary)]", children: [
|
|
47
47
|
/* @__PURE__ */ e(
|
|
48
48
|
"img",
|
|
49
49
|
{
|
|
@@ -68,7 +68,7 @@ function P({
|
|
|
68
68
|
t && /* @__PURE__ */ e("p", { className: "mt-1 break-words typo-body-md text-[var(--Text-Medium-Emphasis)]", children: t })
|
|
69
69
|
] }),
|
|
70
70
|
/* @__PURE__ */ e("div", { className: "px-4 py-3", children: /* @__PURE__ */ e("div", { className: "border-t border-dashed border-[var(--Border-Medium-Emphasis)]" }) }),
|
|
71
|
-
/* @__PURE__ */ e("div", { className: "px-4 pb-4", children: /* @__PURE__ */ e(
|
|
71
|
+
/* @__PURE__ */ e("div", { className: "px-4 pb-4", children: /* @__PURE__ */ e(v, { status: n, onAcquire: c, label: h, size: "lg" }) })
|
|
72
72
|
]
|
|
73
73
|
}
|
|
74
74
|
);
|
|
@@ -100,12 +100,12 @@ function w({
|
|
|
100
100
|
] })
|
|
101
101
|
] }),
|
|
102
102
|
/* @__PURE__ */ e("div", { className: "flex items-stretch justify-center", children: /* @__PURE__ */ e("svg", { width: "2", height: "100%", preserveAspectRatio: "none", className: "text-[var(--Border-Medium-Emphasis)]", children: /* @__PURE__ */ e("line", { x1: "1", y1: "0", x2: "1", y2: "100%", stroke: "currentColor", strokeWidth: "2", strokeDasharray: "4 3" }) }) }),
|
|
103
|
-
/* @__PURE__ */ e("div", { className: "flex shrink-0 items-center justify-center rounded-r-lg border-b border-r border-t border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] px-3", children: /* @__PURE__ */ e(
|
|
103
|
+
/* @__PURE__ */ e("div", { className: "flex shrink-0 items-center justify-center rounded-r-lg border-b border-r border-t border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] px-3", children: /* @__PURE__ */ e(v, { status: s, onAcquire: a, label: "獲得する", size: "sm" }) })
|
|
104
104
|
]
|
|
105
105
|
}
|
|
106
106
|
);
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function v({
|
|
109
109
|
status: r,
|
|
110
110
|
onAcquire: t,
|
|
111
111
|
label: l,
|
|
@@ -126,10 +126,10 @@ function h({
|
|
|
126
126
|
l
|
|
127
127
|
]
|
|
128
128
|
}
|
|
129
|
-
) : r === "acquiring" ? /* @__PURE__ */ e("div", { className: d(a, "bg-[var(--Brand-Cake-Orange)] text-[var(--Text-on-Inverse)]"), children: /* @__PURE__ */ e(g, { className: "size-5 animate-spin motion-reduce:animate-none" }) }) : r === "acquired" ? /* @__PURE__ */ i("div", { className: d(a, "bg-[var(--Surface-Secondary)] text-[var(--Text-Medium-Emphasis)] animate-in fade-in duration-[var(--Motion-Duration-Slow)] gap-1.5"), children: [
|
|
129
|
+
) : r === "acquiring" ? /* @__PURE__ */ e("div", { className: d(a, "bg-[var(--Brand-Cake-Orange)] text-[var(--Text-on-Inverse)]"), children: /* @__PURE__ */ e(g, { className: "size-5 animate-spin motion-reduce:animate-none" }) }) : r === "acquired" ? /* @__PURE__ */ i("div", { className: d(a, "bg-[var(--Surface-Neutral-Secondary)] text-[var(--Text-Medium-Emphasis)] animate-in fade-in duration-[var(--Motion-Duration-Slow)] gap-1.5"), children: [
|
|
130
130
|
/* @__PURE__ */ e(N, { className: "size-4" }),
|
|
131
131
|
"獲得済み"
|
|
132
|
-
] }) : /* @__PURE__ */ e("div", { className: d(a, "bg-[var(--Surface-Secondary)] text-[var(--Text-Low-Emphasis)]"), children: "獲得不可" });
|
|
132
|
+
] }) : /* @__PURE__ */ e("div", { className: d(a, "bg-[var(--Surface-Neutral-Secondary)] text-[var(--Text-Low-Emphasis)]"), children: "獲得不可" });
|
|
133
133
|
}
|
|
134
134
|
export {
|
|
135
135
|
P as CouponCard
|
|
@@ -78,7 +78,7 @@ function W({
|
|
|
78
78
|
onClick: () => g && f?.(i.date),
|
|
79
79
|
className: v(
|
|
80
80
|
"flex flex-col items-center gap-0.5 rounded-md py-1.5 typo-body-md transition-colors",
|
|
81
|
-
g && "cursor-pointer hover:bg-[var(--Surface-Secondary)]",
|
|
81
|
+
g && "cursor-pointer hover:bg-[var(--Surface-Neutral-Secondary)]",
|
|
82
82
|
d && "relative z-10 bg-[var(--Brand-Cake-Orange)]/10 ring-1 ring-inset ring-[var(--Brand-Cake-Orange)]",
|
|
83
83
|
// forced-colors(Windows ハイコントラスト)では薄い地が Canvas に、枠(ring = box-shadow)が
|
|
84
84
|
// 消えて選んだ日が見えなかった。選んだ日だけ OS の選択色で示し、日付と ○△× も
|
|
@@ -65,7 +65,7 @@ function lr({
|
|
|
65
65
|
/* @__PURE__ */ r(M, { children: L ? /* @__PURE__ */ r(F, { children: m.label }) : /* @__PURE__ */ r(G, { href: m.href ?? "#", linkComponent: i, children: m.label }) })
|
|
66
66
|
] }, d);
|
|
67
67
|
}) });
|
|
68
|
-
return /* @__PURE__ */ a("div", { className: "@container min-h-screen bg-[var(--Surface-Secondary)]", children: [
|
|
68
|
+
return /* @__PURE__ */ a("div", { className: "@container min-h-screen bg-[var(--Surface-Neutral-Secondary)]", children: [
|
|
69
69
|
k !== !1 && /* @__PURE__ */ r(I, { href: `#${o}` }),
|
|
70
70
|
/* @__PURE__ */ a("div", { className: "@md:hidden bg-[var(--Surface-Primary)]", children: [
|
|
71
71
|
/* @__PURE__ */ r(t, { variant: "back", onBack: S }),
|
|
@@ -19,7 +19,7 @@ function y({
|
|
|
19
19
|
className: l(
|
|
20
20
|
"flex items-center gap-2 rounded-xl border bg-[var(--Surface-Primary)] p-4 transition-colors duration-[var(--Motion-Duration-Fast)]",
|
|
21
21
|
e === "error" || e === "empty" ? "border-[var(--Border-Caution)]" : "border-[var(--Border-Medium-Emphasis)]",
|
|
22
|
-
a && "cursor-pointer hover:bg-[var(--Surface-Secondary)] hover:border-[var(--Border-High-Emphasis)]",
|
|
22
|
+
a && "cursor-pointer hover:bg-[var(--Surface-Neutral-Secondary)] hover:border-[var(--Border-High-Emphasis)]",
|
|
23
23
|
m
|
|
24
24
|
),
|
|
25
25
|
...d,
|
|
@@ -7,8 +7,8 @@ import { Separator as y } from "../foundations/separator.js";
|
|
|
7
7
|
function T({
|
|
8
8
|
className: t,
|
|
9
9
|
lineItems: a,
|
|
10
|
-
totalLabel:
|
|
11
|
-
totalValue:
|
|
10
|
+
totalLabel: o = "合計(税込)",
|
|
11
|
+
totalValue: d,
|
|
12
12
|
ctaLabel: c,
|
|
13
13
|
onCTAClick: n,
|
|
14
14
|
showSecurityBadge: p = !1,
|
|
@@ -31,8 +31,8 @@ function T({
|
|
|
31
31
|
)),
|
|
32
32
|
a && a.length > 0 && /* @__PURE__ */ e(y, {}),
|
|
33
33
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
|
|
34
|
-
/* @__PURE__ */ e("span", { className: "typo-heading-md text-[var(--Text-High-Emphasis)]", children:
|
|
35
|
-
/* @__PURE__ */ e("span", { className: "typo-heading-lg text-[var(--Text-High-Emphasis)]", children:
|
|
34
|
+
/* @__PURE__ */ e("span", { className: "typo-heading-md text-[var(--Text-High-Emphasis)]", children: o }),
|
|
35
|
+
/* @__PURE__ */ e("span", { className: "typo-heading-lg text-[var(--Text-High-Emphasis)]", children: d })
|
|
36
36
|
] }),
|
|
37
37
|
/* @__PURE__ */ e(
|
|
38
38
|
u,
|
|
@@ -66,7 +66,9 @@ function T({
|
|
|
66
66
|
"data-slot": "order-summary",
|
|
67
67
|
className: l(
|
|
68
68
|
// fixed 表示はスクロール内容の上に重なるため地は Surface-Elevated(disableFixed 側はページ内フローなので Surface-Primary のまま)
|
|
69
|
-
|
|
69
|
+
// bottom: BottomTabBar(高さ 52px + 下端の safe-area)の真上に重ねる。
|
|
70
|
+
// safe-area の分を足さないと、ホームインジケータのある iPhone(viewport-fit=cover)でタブバーに重なる。safe-area が 0 の環境では 52px のまま
|
|
71
|
+
"fixed inset-x-0 bottom-[calc(52px+env(safe-area-inset-bottom))] z-[var(--Z-Sticky)] mx-auto max-w-[430px] border-t border-[var(--Border-Low-Emphasis)] bg-[var(--Surface-Elevated)]",
|
|
70
72
|
t
|
|
71
73
|
),
|
|
72
74
|
...i,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { cn as c } from "../../lib/utils.js";
|
|
4
|
-
import {
|
|
4
|
+
import { FOCUS_RING_ONLY as $ } from "../../lib/focus-ring.js";
|
|
5
|
+
import { buttonVariants as D } from "../foundations/button.js";
|
|
5
6
|
import { PriceDisplay as B } from "../primitives/price-display.js";
|
|
6
7
|
import { RatingStars as M } from "./rating-stars.js";
|
|
7
8
|
import { Tag as b } from "../primitives/tag.js";
|
|
@@ -9,11 +10,11 @@ function j({
|
|
|
9
10
|
href: a,
|
|
10
11
|
onClick: r,
|
|
11
12
|
name: t,
|
|
12
|
-
linkComponent:
|
|
13
|
+
linkComponent: o
|
|
13
14
|
}) {
|
|
14
|
-
const
|
|
15
|
+
const i = o ?? "a";
|
|
15
16
|
return a ? /* @__PURE__ */ e(
|
|
16
|
-
|
|
17
|
+
i,
|
|
17
18
|
{
|
|
18
19
|
href: a,
|
|
19
20
|
className: "absolute inset-0 z-[var(--Z-Local-1)]",
|
|
@@ -65,11 +66,12 @@ function Z({
|
|
|
65
66
|
{
|
|
66
67
|
type: "button",
|
|
67
68
|
className: c(
|
|
68
|
-
"relative z-10 flex items-center justify-center rounded-full border border-[var(--Border-Control,var(--Border-Medium-Emphasis))] bg-[var(--Surface-Primary)]/80 backdrop-blur-sm transition-colors hover:border-[var(--Border-High-Emphasis)] hover:bg-[var(--Surface-Tertiary)]",
|
|
69
|
+
"relative z-10 flex items-center justify-center rounded-full border border-[var(--Border-Control,var(--Border-Medium-Emphasis))] bg-[var(--Surface-Primary)]/80 backdrop-blur-sm transition-colors hover:border-[var(--Border-High-Emphasis)] hover:bg-[var(--Surface-Neutral-Tertiary)] focus-visible:outline-none",
|
|
70
|
+
$,
|
|
69
71
|
t === "sm" ? "size-[30px]" : "size-9"
|
|
70
72
|
),
|
|
71
|
-
onClick: (
|
|
72
|
-
|
|
73
|
+
onClick: (o) => {
|
|
74
|
+
o.preventDefault(), o.stopPropagation(), r();
|
|
73
75
|
},
|
|
74
76
|
"aria-label": a ? "お気に入りから削除" : "お気に入りに追加",
|
|
75
77
|
children: /* @__PURE__ */ e(
|
|
@@ -96,39 +98,39 @@ function S({ rank: a }) {
|
|
|
96
98
|
function q(a, r) {
|
|
97
99
|
return r == null || r <= a ? null : `${Math.round((r - a) / r * 100)}%OFF`;
|
|
98
100
|
}
|
|
99
|
-
function
|
|
101
|
+
function O({
|
|
100
102
|
name: a,
|
|
101
103
|
href: r,
|
|
102
104
|
linkComponent: t
|
|
103
105
|
}) {
|
|
104
|
-
const
|
|
106
|
+
const o = t ?? "a";
|
|
105
107
|
return r ? /* @__PURE__ */ e(
|
|
106
|
-
|
|
108
|
+
o,
|
|
107
109
|
{
|
|
108
110
|
href: r,
|
|
109
111
|
className: "relative z-10 truncate typo-body-sm text-[var(--Text-Low-Emphasis)] hover:text-[var(--Text-Medium-Emphasis)] hover:underline",
|
|
110
|
-
onClick: (
|
|
112
|
+
onClick: (i) => i.stopPropagation(),
|
|
111
113
|
children: a
|
|
112
114
|
}
|
|
113
115
|
) : /* @__PURE__ */ e("p", { className: "truncate typo-body-sm text-[var(--Text-Low-Emphasis)]", children: a });
|
|
114
116
|
}
|
|
115
|
-
function
|
|
117
|
+
function H(a) {
|
|
116
118
|
if (a !== "none")
|
|
117
119
|
return a === "fade" ? "transition-[filter] group-hover:brightness-110" : "transition-transform group-hover:scale-105";
|
|
118
120
|
}
|
|
119
|
-
function
|
|
121
|
+
function A({
|
|
120
122
|
className: a,
|
|
121
123
|
name: r,
|
|
122
124
|
imageUrl: t,
|
|
123
|
-
imageAlt:
|
|
124
|
-
price:
|
|
125
|
+
imageAlt: o,
|
|
126
|
+
price: i,
|
|
125
127
|
originalPrice: x,
|
|
126
128
|
caption: h,
|
|
127
129
|
rating: d,
|
|
128
130
|
reviewCount: y,
|
|
129
131
|
shopName: p,
|
|
130
132
|
shopHref: z,
|
|
131
|
-
hoverEffect:
|
|
133
|
+
hoverEffect: C,
|
|
132
134
|
tags: N = [],
|
|
133
135
|
isFavorite: w = !1,
|
|
134
136
|
onFavoriteToggle: v,
|
|
@@ -137,14 +139,14 @@ function Y({
|
|
|
137
139
|
ranking: n,
|
|
138
140
|
deliveryDate: m,
|
|
139
141
|
orientation: T = "vertical",
|
|
140
|
-
showDiscountBadge:
|
|
142
|
+
showDiscountBadge: P = !0,
|
|
141
143
|
showCartButton: R = !1,
|
|
142
|
-
onCartAdd:
|
|
143
|
-
cartButtonLabel:
|
|
144
|
+
onCartAdd: I,
|
|
145
|
+
cartButtonLabel: _ = "カートに追加",
|
|
144
146
|
linkComponent: f,
|
|
145
147
|
...E
|
|
146
148
|
}) {
|
|
147
|
-
const k =
|
|
149
|
+
const k = C ?? (T === "horizontal" ? "none" : "zoom"), u = P ? q(i, x) : null;
|
|
148
150
|
return T === "horizontal" ? /* @__PURE__ */ l(
|
|
149
151
|
"div",
|
|
150
152
|
{
|
|
@@ -162,14 +164,14 @@ function Y({
|
|
|
162
164
|
/* @__PURE__ */ e(j, { href: L, onClick: g, name: r, linkComponent: f }),
|
|
163
165
|
n != null && /* @__PURE__ */ e(S, { rank: n }),
|
|
164
166
|
/* @__PURE__ */ l("div", { className: "relative h-auto w-28 shrink-0 overflow-hidden rounded-lg @sm:w-36", children: [
|
|
165
|
-
/* @__PURE__ */ e("img", { src: t, alt:
|
|
167
|
+
/* @__PURE__ */ e("img", { src: t, alt: o ?? r, className: c("h-full w-full object-cover duration-[var(--Motion-Duration-Base)]", H(k)), loading: "lazy" }),
|
|
166
168
|
u && /* @__PURE__ */ e(b, { variant: "sale", size: "sm", className: "absolute bottom-1.5 left-1.5 z-[var(--Z-Local-2)]", children: u }),
|
|
167
169
|
N.length > 0 && /* @__PURE__ */ e("div", { className: "absolute bottom-1.5 left-1.5 z-[var(--Z-Local-2)] flex flex-wrap gap-1", children: !u && N.map((s) => /* @__PURE__ */ e(b, { variant: s.variant, size: "sm", children: s.label }, s.label)) }),
|
|
168
170
|
v && /* @__PURE__ */ e("div", { className: "absolute bottom-1 right-1 z-10", children: /* @__PURE__ */ e(Z, { isFavorite: w, onToggle: v, size: "sm" }) })
|
|
169
171
|
] }),
|
|
170
172
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col justify-between py-1 pl-3 pr-1", children: [
|
|
171
173
|
/* @__PURE__ */ l("div", { className: "space-y-0.5", children: [
|
|
172
|
-
p && /* @__PURE__ */ e(
|
|
174
|
+
p && /* @__PURE__ */ e(O, { name: p, href: z, linkComponent: f }),
|
|
173
175
|
/* @__PURE__ */ e("h3", { className: "line-clamp-2 typo-body-md text-[var(--Text-High-Emphasis)]", children: r })
|
|
174
176
|
] }),
|
|
175
177
|
/* @__PURE__ */ l("div", { className: "mt-1 min-w-0 space-y-0.5", children: [
|
|
@@ -180,7 +182,7 @@ function Y({
|
|
|
180
182
|
m
|
|
181
183
|
] })
|
|
182
184
|
] }),
|
|
183
|
-
/* @__PURE__ */ e(B, { price:
|
|
185
|
+
/* @__PURE__ */ e(B, { price: i, originalPrice: x, size: "sm", showTaxLabel: !1 }),
|
|
184
186
|
h && /* @__PURE__ */ e("p", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: h })
|
|
185
187
|
] })
|
|
186
188
|
] })
|
|
@@ -207,7 +209,7 @@ function Y({
|
|
|
207
209
|
n != null && /* @__PURE__ */ e(S, { rank: n }),
|
|
208
210
|
/* @__PURE__ */ l("div", { className: "relative", children: [
|
|
209
211
|
/* @__PURE__ */ l("div", { className: "aspect-square overflow-hidden rounded-lg", children: [
|
|
210
|
-
/* @__PURE__ */ e("img", { src: t, alt:
|
|
212
|
+
/* @__PURE__ */ e("img", { src: t, alt: o ?? r, className: c("h-full w-full object-cover duration-[var(--Motion-Duration-Base)]", H(k)), loading: "lazy" }),
|
|
211
213
|
/* @__PURE__ */ e("div", { className: "absolute inset-x-1 bottom-1 z-[var(--Z-Local-3)] flex items-end", children: /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-1", children: [
|
|
212
214
|
u && /* @__PURE__ */ e(b, { variant: "sale", size: "sm", children: u }),
|
|
213
215
|
N.map((s) => /* @__PURE__ */ e(
|
|
@@ -224,7 +226,7 @@ function Y({
|
|
|
224
226
|
v && /* @__PURE__ */ e("div", { className: "absolute bottom-1.5 right-1.5 z-[var(--Z-Local-4)]", children: /* @__PURE__ */ e(Z, { isFavorite: w, onToggle: v }) })
|
|
225
227
|
] }),
|
|
226
228
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
227
|
-
p && /* @__PURE__ */ e(
|
|
229
|
+
p && /* @__PURE__ */ e(O, { name: p, href: z, linkComponent: f }),
|
|
228
230
|
/* @__PURE__ */ e("h3", { className: "line-clamp-2 min-h-[2lh] typo-body-md text-[var(--Text-High-Emphasis)]", children: r }),
|
|
229
231
|
(d != null || m) && /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [
|
|
230
232
|
d != null && /* @__PURE__ */ e(M, { rating: d, reviewCount: y, size: "sm" }),
|
|
@@ -233,18 +235,18 @@ function Y({
|
|
|
233
235
|
m
|
|
234
236
|
] })
|
|
235
237
|
] }),
|
|
236
|
-
/* @__PURE__ */ e(B, { price:
|
|
238
|
+
/* @__PURE__ */ e(B, { price: i, originalPrice: x, size: "md", showTaxLabel: !1 }),
|
|
237
239
|
h && /* @__PURE__ */ e("p", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: h })
|
|
238
240
|
] }),
|
|
239
241
|
R && /* @__PURE__ */ e(
|
|
240
242
|
"button",
|
|
241
243
|
{
|
|
242
244
|
type: "button",
|
|
243
|
-
className: c(
|
|
245
|
+
className: c(D({ variant: "outline", size: "sm" }), "relative z-10 h-9 w-full gap-0.5"),
|
|
244
246
|
onClick: (s) => {
|
|
245
|
-
s.preventDefault(), s.stopPropagation(),
|
|
247
|
+
s.preventDefault(), s.stopPropagation(), I?.();
|
|
246
248
|
},
|
|
247
|
-
children:
|
|
249
|
+
children: _
|
|
248
250
|
}
|
|
249
251
|
)
|
|
250
252
|
]
|
|
@@ -253,5 +255,5 @@ function Y({
|
|
|
253
255
|
}
|
|
254
256
|
export {
|
|
255
257
|
V as BookmarkRibbonIcon,
|
|
256
|
-
|
|
258
|
+
A as ProductCard
|
|
257
259
|
};
|
|
@@ -51,7 +51,7 @@ function oe({
|
|
|
51
51
|
{
|
|
52
52
|
"data-slot": "product-detail-sidebar",
|
|
53
53
|
className: G(
|
|
54
|
-
"flex w-[400px] max-w-full flex-col rounded-2xl border-2 border-[var(--Surface-Tertiary)] bg-[var(--Surface-Primary)]",
|
|
54
|
+
"flex w-[400px] max-w-full flex-col rounded-2xl border-2 border-[var(--Surface-Neutral-Tertiary)] bg-[var(--Surface-Primary)]",
|
|
55
55
|
w
|
|
56
56
|
),
|
|
57
57
|
...P,
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { cn as r } from "../../lib/utils.js";
|
|
4
|
+
import { FOCUS_RING_INSET as F } from "../../lib/focus-ring.js";
|
|
4
5
|
import { Button as m } from "../foundations/button.js";
|
|
5
6
|
import { Tag as q } from "../primitives/tag.js";
|
|
6
|
-
import { NumberInput as
|
|
7
|
+
import { NumberInput as U } from "../primitives/number-input.js";
|
|
7
8
|
import { PriceDisplay as D } from "../primitives/price-display.js";
|
|
8
|
-
import { BookmarkRibbonIcon as
|
|
9
|
-
function
|
|
10
|
-
name:
|
|
11
|
-
imageUrl:
|
|
9
|
+
import { BookmarkRibbonIcon as ee } from "./product-card.js";
|
|
10
|
+
function oe({
|
|
11
|
+
name: o,
|
|
12
|
+
imageUrl: n,
|
|
12
13
|
price: p,
|
|
13
14
|
caption: h,
|
|
14
15
|
shopName: f,
|
|
@@ -19,11 +20,11 @@ function de({
|
|
|
19
20
|
statusLabel: x,
|
|
20
21
|
variant: i = "default",
|
|
21
22
|
showCartButton: j = !1,
|
|
22
|
-
onAddToCart:
|
|
23
|
-
showDetailButton:
|
|
24
|
-
onViewDetail:
|
|
25
|
-
showBookmark:
|
|
26
|
-
href:
|
|
23
|
+
onAddToCart: _,
|
|
24
|
+
showDetailButton: S = !1,
|
|
25
|
+
onViewDetail: G,
|
|
26
|
+
showBookmark: V = !1,
|
|
27
|
+
href: M,
|
|
27
28
|
orderDate: C,
|
|
28
29
|
deliveryInfo: H,
|
|
29
30
|
totalPrice: v,
|
|
@@ -31,25 +32,25 @@ function de({
|
|
|
31
32
|
optionInfo: B,
|
|
32
33
|
// cart variant props
|
|
33
34
|
quantity: b,
|
|
34
|
-
onQuantityChange:
|
|
35
|
-
quantitySize:
|
|
36
|
-
originalPrice:
|
|
37
|
-
priceLabel:
|
|
38
|
-
deliveryText:
|
|
39
|
-
onDelete:
|
|
35
|
+
onQuantityChange: W,
|
|
36
|
+
quantitySize: A = "sm",
|
|
37
|
+
originalPrice: J,
|
|
38
|
+
priceLabel: N,
|
|
39
|
+
deliveryText: I,
|
|
40
|
+
onDelete: g,
|
|
40
41
|
onSaveForLater: w,
|
|
41
|
-
imageSize:
|
|
42
|
-
subtotal:
|
|
43
|
-
subtotalLabel:
|
|
42
|
+
imageSize: K = "size-20",
|
|
43
|
+
subtotal: O,
|
|
44
|
+
subtotalLabel: Q = "小計",
|
|
44
45
|
// slot props
|
|
45
46
|
leftSlot: E,
|
|
46
47
|
rightSlot: $,
|
|
47
|
-
bottomSlot:
|
|
48
|
-
linkComponent:
|
|
49
|
-
className:
|
|
50
|
-
...
|
|
48
|
+
bottomSlot: P,
|
|
49
|
+
linkComponent: X,
|
|
50
|
+
className: Y,
|
|
51
|
+
...Z
|
|
51
52
|
}) {
|
|
52
|
-
const T =
|
|
53
|
+
const T = X ?? "a", t = i === "small" || i === "xsm", c = i === "review", a = i === "cart", R = a ? K : i === "xsm" ? "size-10" : t ? "size-14" : "size-[102px]";
|
|
53
54
|
return /* @__PURE__ */ s(
|
|
54
55
|
"div",
|
|
55
56
|
{
|
|
@@ -57,9 +58,9 @@ function de({
|
|
|
57
58
|
className: r(
|
|
58
59
|
"flex flex-col bg-[var(--Surface-Primary)]",
|
|
59
60
|
i === "lp" && "flex-col rounded-xl bg-[var(--Surface-Secondary)] p-4",
|
|
60
|
-
|
|
61
|
+
Y
|
|
61
62
|
),
|
|
62
|
-
...
|
|
63
|
+
...Z,
|
|
63
64
|
children: [
|
|
64
65
|
/* @__PURE__ */ s("div", { className: r(
|
|
65
66
|
"flex gap-2 px-4 py-2 min-w-0 overflow-hidden",
|
|
@@ -67,12 +68,12 @@ function de({
|
|
|
67
68
|
a && "gap-3 p-4",
|
|
68
69
|
i === "lp" && "gap-3 px-0 py-0"
|
|
69
70
|
), children: [
|
|
70
|
-
E ? /* @__PURE__ */ e("div", { className: "shrink-0", children: E }) :
|
|
71
|
+
E ? /* @__PURE__ */ e("div", { className: "shrink-0", children: E }) : n && !a ? /* @__PURE__ */ s(T, { href: M ?? "#", className: "relative shrink-0", children: [
|
|
71
72
|
/* @__PURE__ */ e(
|
|
72
73
|
"img",
|
|
73
74
|
{
|
|
74
|
-
src:
|
|
75
|
-
alt:
|
|
75
|
+
src: n,
|
|
76
|
+
alt: o,
|
|
76
77
|
className: r(
|
|
77
78
|
"rounded-lg object-cover",
|
|
78
79
|
R,
|
|
@@ -82,19 +83,19 @@ function de({
|
|
|
82
83
|
),
|
|
83
84
|
x && /* @__PURE__ */ e("span", { className: "absolute top-1.5 left-1.5 rounded bg-[var(--Surface-Primary)]/80 px-1.5 py-0.5 typo-label-xs text-[var(--Text-Medium-Emphasis)]", children: x })
|
|
84
85
|
] }) : null,
|
|
85
|
-
!E &&
|
|
86
|
+
!E && n && a && /* @__PURE__ */ s(
|
|
86
87
|
"div",
|
|
87
88
|
{
|
|
88
89
|
className: r(
|
|
89
|
-
"relative shrink-0 overflow-hidden rounded-lg bg-[var(--Surface-Secondary)]",
|
|
90
|
+
"relative shrink-0 overflow-hidden rounded-lg bg-[var(--Surface-Neutral-Secondary)]",
|
|
90
91
|
R
|
|
91
92
|
),
|
|
92
93
|
children: [
|
|
93
94
|
/* @__PURE__ */ e(
|
|
94
95
|
"img",
|
|
95
96
|
{
|
|
96
|
-
src:
|
|
97
|
-
alt:
|
|
97
|
+
src: n,
|
|
98
|
+
alt: o,
|
|
98
99
|
className: "h-full w-full object-cover"
|
|
99
100
|
}
|
|
100
101
|
),
|
|
@@ -120,15 +121,15 @@ function de({
|
|
|
120
121
|
f,
|
|
121
122
|
d && ` / ${d}`
|
|
122
123
|
] })),
|
|
123
|
-
a ? /* @__PURE__ */ e("h3", { className: "line-clamp-2 typo-body-md text-[var(--Text-High-Emphasis)] min-w-0 break-words", children:
|
|
124
|
+
a ? /* @__PURE__ */ e("h3", { className: "line-clamp-2 typo-body-md text-[var(--Text-High-Emphasis)] min-w-0 break-words", children: o }) : /* @__PURE__ */ e(
|
|
124
125
|
T,
|
|
125
126
|
{
|
|
126
|
-
href:
|
|
127
|
+
href: M ?? "#",
|
|
127
128
|
className: r(
|
|
128
129
|
"block text-[var(--Text-High-Emphasis)]",
|
|
129
130
|
t ? "truncate typo-body-sm" : "line-clamp-2 typo-label-md"
|
|
130
131
|
),
|
|
131
|
-
children:
|
|
132
|
+
children: o
|
|
132
133
|
}
|
|
133
134
|
),
|
|
134
135
|
u && u.length > 0 && !t && !c && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-x-1", children: u.map((l) => /* @__PURE__ */ s("span", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: [
|
|
@@ -136,28 +137,28 @@ function de({
|
|
|
136
137
|
l
|
|
137
138
|
] }, l)) }),
|
|
138
139
|
y && y.length > 0 && !t && !c && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: y.map((l, k) => /* @__PURE__ */ e(q, { variant: l.variant, size: a ? "sm" : void 0, children: l.label }, k)) }),
|
|
139
|
-
a &&
|
|
140
|
+
a && I && /* @__PURE__ */ e("p", { className: "typo-body-sm text-[var(--Text-Low-Emphasis)]", children: I }),
|
|
140
141
|
a && p !== void 0 && /* @__PURE__ */ s("div", { className: "flex items-center justify-between min-w-0 gap-2 overflow-hidden", children: [
|
|
141
|
-
|
|
142
|
-
/* @__PURE__ */ e("div", { className: r("min-w-0 shrink-0", !
|
|
142
|
+
N && /* @__PURE__ */ e("span", { className: "typo-body-sm text-[var(--Text-Low-Emphasis)] shrink-0", children: N }),
|
|
143
|
+
/* @__PURE__ */ e("div", { className: r("min-w-0 shrink-0", !N && "ml-auto"), children: /* @__PURE__ */ e(
|
|
143
144
|
D,
|
|
144
145
|
{
|
|
145
146
|
price: p,
|
|
146
|
-
originalPrice:
|
|
147
|
+
originalPrice: J,
|
|
147
148
|
size: "sm",
|
|
148
149
|
showTaxLabel: !1
|
|
149
150
|
}
|
|
150
151
|
) })
|
|
151
152
|
] }),
|
|
152
153
|
a && h && /* @__PURE__ */ e("p", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: h }),
|
|
153
|
-
a && (b !== void 0 ||
|
|
154
|
+
a && (b !== void 0 || g || w) && /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
|
|
154
155
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
|
|
155
|
-
|
|
156
|
+
g && /* @__PURE__ */ e(
|
|
156
157
|
m,
|
|
157
158
|
{
|
|
158
159
|
variant: "tertiary",
|
|
159
160
|
size: "sm",
|
|
160
|
-
onClick:
|
|
161
|
+
onClick: g,
|
|
161
162
|
"aria-label": "削除",
|
|
162
163
|
children: "削除"
|
|
163
164
|
}
|
|
@@ -170,7 +171,7 @@ function de({
|
|
|
170
171
|
onClick: w,
|
|
171
172
|
"aria-label": "あとで買う",
|
|
172
173
|
children: [
|
|
173
|
-
/* @__PURE__ */ e(
|
|
174
|
+
/* @__PURE__ */ e(ee, { size: 16 }),
|
|
174
175
|
"あとで買う"
|
|
175
176
|
]
|
|
176
177
|
}
|
|
@@ -178,18 +179,18 @@ function de({
|
|
|
178
179
|
] }),
|
|
179
180
|
/* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-end gap-2", children: [
|
|
180
181
|
b !== void 0 && /* @__PURE__ */ e(
|
|
181
|
-
|
|
182
|
+
U,
|
|
182
183
|
{
|
|
183
184
|
value: b,
|
|
184
|
-
size:
|
|
185
|
-
onChange:
|
|
185
|
+
size: A,
|
|
186
|
+
onChange: W
|
|
186
187
|
}
|
|
187
188
|
),
|
|
188
|
-
|
|
189
|
-
/* @__PURE__ */ e("span", { className: "typo-body-sm text-[var(--Text-Low-Emphasis)]", children:
|
|
189
|
+
O !== void 0 && /* @__PURE__ */ s("div", { className: "flex items-baseline gap-1", children: [
|
|
190
|
+
/* @__PURE__ */ e("span", { className: "typo-body-sm text-[var(--Text-Low-Emphasis)]", children: Q }),
|
|
190
191
|
/* @__PURE__ */ s("span", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: [
|
|
191
192
|
"¥",
|
|
192
|
-
|
|
193
|
+
O.toLocaleString()
|
|
193
194
|
] })
|
|
194
195
|
] })
|
|
195
196
|
] })
|
|
@@ -232,11 +233,11 @@ function de({
|
|
|
232
233
|
/* @__PURE__ */ e("span", { className: "text-[var(--Text-Medium-Emphasis)]", children: k })
|
|
233
234
|
] }, l)) })
|
|
234
235
|
] }),
|
|
235
|
-
$ ? /* @__PURE__ */ e("div", { className: "shrink-0 self-start", children: $ }) :
|
|
236
|
+
$ ? /* @__PURE__ */ e("div", { className: "shrink-0 self-start", children: $ }) : V && !c && /* @__PURE__ */ e(
|
|
236
237
|
"button",
|
|
237
238
|
{
|
|
238
239
|
type: "button",
|
|
239
|
-
className:
|
|
240
|
+
className: `flex size-9 shrink-0 items-center justify-center self-start rounded-full border border-[var(--Border-Control,var(--Border-Medium-Emphasis))] bg-[var(--Surface-Neutral-Secondary)] transition-colors hover:border-[var(--Border-High-Emphasis)] hover:bg-[var(--Surface-Neutral-Tertiary)] focus-visible:outline-none ${F}`,
|
|
240
241
|
"aria-label": "ブックマーク",
|
|
241
242
|
children: /* @__PURE__ */ e(
|
|
242
243
|
"svg",
|
|
@@ -253,15 +254,15 @@ function de({
|
|
|
253
254
|
}
|
|
254
255
|
)
|
|
255
256
|
] }),
|
|
256
|
-
|
|
257
|
-
|
|
257
|
+
P ? /* @__PURE__ */ e("div", { className: "px-4 py-3", children: P }) : (j || S || L) && /* @__PURE__ */ s("div", { className: "flex justify-end gap-3.5 px-4 py-3", children: [
|
|
258
|
+
S && /* @__PURE__ */ e(m, { variant: "tertiary", size: "sm", onClick: G, children: "商品詳細を見る" }),
|
|
258
259
|
L && /* @__PURE__ */ e(m, { variant: "secondary", size: "sm", children: "レビューを書く" }),
|
|
259
|
-
j && /* @__PURE__ */ e(m, { size: "sm", onClick:
|
|
260
|
+
j && /* @__PURE__ */ e(m, { size: "sm", onClick: _, children: "カートに追加" })
|
|
260
261
|
] })
|
|
261
262
|
]
|
|
262
263
|
}
|
|
263
264
|
);
|
|
264
265
|
}
|
|
265
266
|
export {
|
|
266
|
-
|
|
267
|
+
oe as ProductListItem
|
|
267
268
|
};
|