@cakejp/design-system 0.20.1 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +172 -0
- package/CLAUDE.md +5 -3
- package/MIGRATION.md +3 -3
- package/README.md +31 -11
- package/contracts/components.json +420 -63
- package/contracts/composition.json +38 -4
- package/contracts/rules.json +27 -5
- package/contracts/screen-patterns.json +6 -4
- package/dist/components/ec/admin-shell.js +62 -60
- package/dist/components/ec/anniversary-card.js +13 -12
- package/dist/components/ec/coupon-card.js +11 -11
- package/dist/components/ec/delivery-calendar.js +51 -45
- package/dist/components/ec/mypage-shell.js +80 -69
- package/dist/components/ec/product-card.js +93 -76
- package/dist/components/ec/product-carousel.js +65 -60
- package/dist/components/ec/product-detail-bar.js +13 -11
- package/dist/components/ec/product-detail-sidebar.js +60 -58
- package/dist/components/ec/product-list-item.js +64 -63
- package/dist/components/ec/product-option.js +30 -26
- package/dist/components/ec/rating-stars.js +27 -27
- package/dist/components/ec/review-card.js +32 -32
- package/dist/components/ec/review-form.js +37 -37
- package/dist/components/ec/shop-card.js +21 -19
- package/dist/components/foundations/accordion.js +33 -31
- package/dist/components/foundations/alert-dialog.js +4 -5
- package/dist/components/foundations/badge.js +5 -5
- package/dist/components/foundations/breadcrumb.js +27 -26
- package/dist/components/foundations/button.js +144 -25
- package/dist/components/foundations/calendar.js +28 -26
- package/dist/components/foundations/checkbox-card.js +71 -47
- package/dist/components/foundations/checkbox-group.js +30 -27
- package/dist/components/foundations/checkbox.js +69 -52
- package/dist/components/foundations/chip-variants.js +13 -0
- package/dist/components/foundations/command.js +81 -79
- package/dist/components/foundations/confirm-dialog.js +136 -0
- package/dist/components/foundations/context-menu.js +43 -38
- package/dist/components/foundations/data-table.js +87 -84
- package/dist/components/foundations/dialog.js +45 -36
- package/dist/components/foundations/dropdown-menu.js +47 -42
- package/dist/components/foundations/file-input.js +97 -67
- package/dist/components/foundations/hover-card.js +21 -21
- package/dist/components/foundations/menubar.js +75 -69
- package/dist/components/foundations/navigation-menu.js +31 -26
- package/dist/components/foundations/pagination.js +54 -50
- package/dist/components/foundations/popover.js +7 -7
- package/dist/components/foundations/progress.js +10 -6
- package/dist/components/foundations/radio-group.js +6 -3
- package/dist/components/foundations/responsive-dialog.js +73 -55
- package/dist/components/foundations/scroll-area.js +18 -14
- package/dist/components/foundations/select.js +44 -39
- package/dist/components/foundations/sheet.js +45 -37
- package/dist/components/foundations/skeleton.js +6 -6
- package/dist/components/foundations/skip-link.js +10 -8
- package/dist/components/foundations/slider.js +73 -48
- package/dist/components/foundations/sonner.js +5 -4
- package/dist/components/foundations/spinner.js +7 -5
- package/dist/components/foundations/switch.js +11 -10
- package/dist/components/foundations/tabs.js +54 -39
- package/dist/components/foundations/toggle-group.js +29 -21
- package/dist/components/foundations/toggle.js +20 -16
- package/dist/components/primitives/admin-side-nav.js +65 -62
- package/dist/components/primitives/banner-carousel.js +32 -29
- package/dist/components/primitives/bottom-tab-bar.js +16 -15
- package/dist/components/primitives/category-scroll.js +39 -29
- package/dist/components/primitives/category-shortcuts.js +9 -9
- package/dist/components/primitives/chat-composer.js +77 -74
- package/dist/components/primitives/chip.js +84 -61
- package/dist/components/primitives/combobox.js +63 -47
- package/dist/components/primitives/container.js +9 -9
- package/dist/components/primitives/content-card.js +15 -17
- package/dist/components/primitives/content-carousel.js +79 -68
- package/dist/components/primitives/date-picker.js +137 -99
- package/dist/components/primitives/footer.js +36 -37
- package/dist/components/primitives/header.js +175 -168
- package/dist/components/primitives/image-carousel.js +107 -87
- package/dist/components/primitives/image-gallery.js +32 -27
- package/dist/components/primitives/image-uploader.js +6 -6
- package/dist/components/primitives/list-item.js +59 -51
- package/dist/components/primitives/menu-drawer.js +36 -38
- package/dist/components/primitives/multi-select.js +89 -58
- package/dist/components/primitives/notification-list.js +10 -9
- package/dist/components/primitives/number-input.js +116 -105
- package/dist/components/primitives/scroll-row.js +21 -0
- package/dist/components/primitives/search-bar.js +31 -28
- package/dist/components/primitives/section-header.js +54 -53
- package/dist/components/primitives/side-nav.js +57 -56
- package/dist/components/primitives/sub-nav.js +13 -14
- package/dist/components/primitives/tag.js +4 -2
- package/dist/index.css +1 -1
- package/dist/index.js +3051 -924
- package/dist/lib/field-labelling.js +31 -21
- package/dist/lib/focus-ring.js +22 -4
- package/dist/lib/high-contrast.js +4 -0
- package/dist/lib/image-index.js +8 -0
- package/dist/lib/use-prefers-reduced-motion.js +21 -0
- package/dist/types/components/ec/admin-shell.d.ts +11 -1
- package/dist/types/components/ec/anniversary-card.d.ts +9 -1
- package/dist/types/components/ec/mypage-shell.d.ts +12 -1
- package/dist/types/components/ec/product-card.d.ts +13 -1
- package/dist/types/components/ec/product-carousel.d.ts +13 -1
- package/dist/types/components/ec/product-detail-bar.d.ts +12 -1
- package/dist/types/components/ec/product-detail-sidebar.d.ts +11 -1
- package/dist/types/components/ec/product-list-item.d.ts +9 -1
- package/dist/types/components/ec/rating-stars.d.ts +2 -0
- package/dist/types/components/ec/review-card.d.ts +1 -1
- package/dist/types/components/ec/shop-card.d.ts +8 -1
- package/dist/types/components/foundations/badge.d.ts +1 -1
- package/dist/types/components/foundations/breadcrumb.d.ts +8 -1
- package/dist/types/components/foundations/button.d.ts +38 -3
- package/dist/types/components/foundations/checkbox-card.d.ts +7 -1
- package/dist/types/components/foundations/checkbox.d.ts +1 -1
- package/dist/types/components/foundations/chip-variants.d.ts +2 -2
- package/dist/types/components/foundations/confirm-dialog.d.ts +61 -0
- package/dist/types/components/foundations/data-table.d.ts +9 -2
- package/dist/types/components/foundations/dialog.d.ts +16 -1
- package/dist/types/components/foundations/pagination.d.ts +1 -1
- package/dist/types/components/foundations/responsive-dialog.d.ts +2 -1
- package/dist/types/components/foundations/sheet.d.ts +12 -1
- package/dist/types/components/foundations/skeleton.d.ts +6 -0
- package/dist/types/components/foundations/slider.d.ts +15 -1
- package/dist/types/components/foundations/tabs.d.ts +7 -0
- package/dist/types/components/primitives/admin-side-nav.d.ts +22 -2
- package/dist/types/components/primitives/banner-carousel.d.ts +9 -1
- package/dist/types/components/primitives/bottom-tab-bar.d.ts +13 -2
- package/dist/types/components/primitives/category-scroll.d.ts +10 -1
- package/dist/types/components/primitives/category-shortcuts.d.ts +11 -2
- package/dist/types/components/primitives/chip.d.ts +22 -3
- package/dist/types/components/primitives/combobox.d.ts +7 -2
- package/dist/types/components/primitives/container.d.ts +3 -0
- package/dist/types/components/primitives/content-card.d.ts +1 -1
- package/dist/types/components/primitives/content-carousel.d.ts +12 -4
- package/dist/types/components/primitives/date-picker.d.ts +10 -3
- package/dist/types/components/primitives/footer.d.ts +1 -1
- package/dist/types/components/primitives/header.d.ts +14 -2
- package/dist/types/components/primitives/image-carousel.d.ts +23 -5
- package/dist/types/components/primitives/list-item.d.ts +10 -1
- package/dist/types/components/primitives/menu-drawer.d.ts +1 -1
- package/dist/types/components/primitives/multi-select.d.ts +7 -2
- package/dist/types/components/primitives/notification-list.d.ts +10 -1
- package/dist/types/components/primitives/number-input.d.ts +18 -5
- package/dist/types/components/primitives/scroll-row.d.ts +43 -0
- package/dist/types/components/primitives/section-header.d.ts +9 -2
- package/dist/types/components/primitives/side-nav.d.ts +13 -1
- package/dist/types/components/primitives/sub-nav.d.ts +1 -1
- package/dist/types/components/primitives/tag.d.ts +1 -1
- package/dist/types/index.d.ts +7 -1
- package/dist/types/lib/field-labelling.d.ts +23 -8
- package/dist/types/lib/focus-ring.d.ts +70 -3
- package/dist/types/lib/high-contrast.d.ts +25 -0
- package/dist/types/lib/image-index.d.ts +2 -0
- package/dist/types/lib/link-component.d.ts +26 -21
- package/dist/types/lib/use-prefers-reduced-motion.d.ts +9 -0
- package/package.json +11 -3
- package/src/components/COMPONENT_LOOKUP.md +18 -16
- package/src/preset-standalone.css +42 -0
- package/src/preset.css +20 -1
- package/src/styles/semantic.css +57 -0
- package/templates/AGENTS.md +5 -1
- package/templates/CLAUDE.md +3 -1
- package/tokens.json +49 -0
- package/dist/lib/link-component.js +0 -6
|
@@ -1,105 +1,111 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as p, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import E from "iconsax-reactjs/dist/esm/ArrowLeft2.js";
|
|
4
4
|
import z from "iconsax-reactjs/dist/esm/ArrowRight2.js";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as v } from "../../lib/utils.js";
|
|
6
6
|
import { Button as u } from "../foundations/button.js";
|
|
7
7
|
const A = ["日", "月", "火", "水", "木", "金", "土"];
|
|
8
|
-
function
|
|
8
|
+
function W({
|
|
9
9
|
year: a,
|
|
10
10
|
month: r,
|
|
11
|
-
days:
|
|
12
|
-
onMonthChange:
|
|
13
|
-
onDaySelect:
|
|
11
|
+
days: x,
|
|
12
|
+
onMonthChange: h,
|
|
13
|
+
onDaySelect: f,
|
|
14
14
|
selectedDate: c,
|
|
15
|
-
className:
|
|
16
|
-
...
|
|
15
|
+
className: y,
|
|
16
|
+
...b
|
|
17
17
|
}) {
|
|
18
|
-
const
|
|
19
|
-
let l = Array(
|
|
20
|
-
for (let e = 1; e <=
|
|
21
|
-
const
|
|
22
|
-
(
|
|
18
|
+
const D = new Date(a, r - 1, 1), N = new Date(a, r, 0), w = D.getDay(), T = N.getDate(), m = [];
|
|
19
|
+
let l = Array(w).fill(null);
|
|
20
|
+
for (let e = 1; e <= T; e++) {
|
|
21
|
+
const s = new Date(a, r - 1, e), i = x.find(
|
|
22
|
+
(n) => n.date.getFullYear() === a && n.date.getMonth() === r - 1 && n.date.getDate() === e
|
|
23
23
|
);
|
|
24
24
|
l.push(
|
|
25
|
-
i ?? { date:
|
|
26
|
-
), l.length === 7 && (
|
|
25
|
+
i ?? { date: s, availability: "available" }
|
|
26
|
+
), l.length === 7 && (m.push(l), l = []);
|
|
27
27
|
}
|
|
28
28
|
if (l.length > 0) {
|
|
29
29
|
for (; l.length < 7; ) l.push(null);
|
|
30
|
-
|
|
30
|
+
m.push(l);
|
|
31
31
|
}
|
|
32
32
|
const k = () => {
|
|
33
33
|
const e = r === 1 ? { y: a - 1, m: 12 } : { y: a, m: r - 1 };
|
|
34
|
-
|
|
35
|
-
},
|
|
34
|
+
h?.(e.y, e.m);
|
|
35
|
+
}, C = () => {
|
|
36
36
|
const e = r === 12 ? { y: a + 1, m: 1 } : { y: a, m: r + 1 };
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
return /* @__PURE__ */
|
|
37
|
+
h?.(e.y, e.m);
|
|
38
|
+
}, S = (e) => c && e.getFullYear() === c.getFullYear() && e.getMonth() === c.getMonth() && e.getDate() === c.getDate();
|
|
39
|
+
return /* @__PURE__ */ p(
|
|
40
40
|
"div",
|
|
41
41
|
{
|
|
42
42
|
"data-slot": "delivery-calendar",
|
|
43
|
-
className:
|
|
44
|
-
...
|
|
43
|
+
className: v("space-y-2", y),
|
|
44
|
+
...b,
|
|
45
45
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ p("div", { className: "flex items-center justify-between", children: [
|
|
47
47
|
/* @__PURE__ */ t(u, { variant: "ghost", size: "icon-sm", onClick: k, "aria-label": "前月", children: /* @__PURE__ */ t(E, { size: 16 }) }),
|
|
48
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ p("span", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: [
|
|
49
49
|
r,
|
|
50
50
|
"月"
|
|
51
51
|
] }),
|
|
52
|
-
/* @__PURE__ */ t(u, { variant: "ghost", size: "icon-sm", onClick:
|
|
52
|
+
/* @__PURE__ */ t(u, { variant: "ghost", size: "icon-sm", onClick: C, "aria-label": "次月", children: /* @__PURE__ */ t(z, { size: 16 }) })
|
|
53
53
|
] }),
|
|
54
|
-
/* @__PURE__ */ t("div", { className: "grid grid-cols-7 text-center", children: A.map((e,
|
|
54
|
+
/* @__PURE__ */ t("div", { className: "grid grid-cols-7 text-center", children: A.map((e, s) => /* @__PURE__ */ t(
|
|
55
55
|
"span",
|
|
56
56
|
{
|
|
57
|
-
className:
|
|
57
|
+
className: v(
|
|
58
58
|
"py-1 typo-label-sm",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
s === 0 && "text-[var(--Text-Caution)]",
|
|
60
|
+
s === 6 && "text-[var(--Primitive-Sea-600)]",
|
|
61
|
+
s > 0 && s < 6 && "text-[var(--Text-Medium-Emphasis)]"
|
|
62
62
|
),
|
|
63
63
|
children: e
|
|
64
64
|
},
|
|
65
65
|
e
|
|
66
66
|
)) }),
|
|
67
|
-
|
|
67
|
+
m.map((e, s) => /* @__PURE__ */ t("div", { className: "grid grid-cols-7 text-center", children: e.map((i, n) => {
|
|
68
68
|
if (!i)
|
|
69
|
-
return /* @__PURE__ */ t("div", { className: "py-1" }, `empty-${
|
|
70
|
-
const o = i.date.getDay(),
|
|
71
|
-
return /* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ t("div", { className: "py-1" }, `empty-${n}`);
|
|
70
|
+
const o = i.date.getDay(), d = S(i.date), g = i.availability !== "unavailable";
|
|
71
|
+
return /* @__PURE__ */ p(
|
|
72
72
|
"button",
|
|
73
73
|
{
|
|
74
74
|
type: "button",
|
|
75
|
-
disabled: !
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
disabled: !g,
|
|
76
|
+
"aria-pressed": d,
|
|
77
|
+
"data-selected": d || void 0,
|
|
78
|
+
onClick: () => g && f?.(i.date),
|
|
79
|
+
className: v(
|
|
78
80
|
"flex flex-col items-center gap-0.5 rounded-md py-1.5 typo-body-md transition-colors",
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
g && "cursor-pointer hover:bg-[var(--Surface-Secondary)]",
|
|
82
|
+
d && "relative z-10 bg-[var(--Brand-Cake-Orange)]/10 ring-1 ring-inset ring-[var(--Brand-Cake-Orange)]",
|
|
83
|
+
// forced-colors(Windows ハイコントラスト)では薄い地が Canvas に、枠(ring = box-shadow)が
|
|
84
|
+
// 消えて選んだ日が見えなかった。選んだ日だけ OS の選択色で示し、日付と ○△× も
|
|
85
|
+
// HighlightText にそろえる(子の span は自前の文字色を持つため * で指定)。通常表示は不変
|
|
86
|
+
d && "forced-colors:bg-[Highlight] forced-colors:text-[HighlightText] forced-colors:*:text-[HighlightText]",
|
|
87
|
+
!g && "cursor-default opacity-60",
|
|
82
88
|
o === 0 && "text-[var(--Text-Caution)]",
|
|
83
89
|
o === 6 && "text-[var(--Primitive-Sea-600)]",
|
|
84
90
|
o > 0 && o < 6 && "text-[var(--Text-High-Emphasis)]"
|
|
85
91
|
),
|
|
86
92
|
children: [
|
|
87
93
|
/* @__PURE__ */ t("span", { children: i.date.getDate() }),
|
|
88
|
-
/* @__PURE__ */ t(
|
|
94
|
+
/* @__PURE__ */ t(H, { availability: i.availability })
|
|
89
95
|
]
|
|
90
96
|
},
|
|
91
97
|
i.date.getDate()
|
|
92
98
|
);
|
|
93
|
-
}) },
|
|
99
|
+
}) }, s))
|
|
94
100
|
]
|
|
95
101
|
}
|
|
96
102
|
);
|
|
97
103
|
}
|
|
98
|
-
function
|
|
104
|
+
function H({
|
|
99
105
|
availability: a
|
|
100
106
|
}) {
|
|
101
107
|
return a === "available" ? /* @__PURE__ */ t("span", { className: "typo-heading-lg text-[var(--Text-Success)]", children: "○" }) : a === "few" ? /* @__PURE__ */ t("span", { className: "typo-heading-lg text-[var(--Text-Warning)]", children: "△" }) : /* @__PURE__ */ t("span", { className: "typo-heading-lg text-[var(--Text-Low-Emphasis)]", children: "×" });
|
|
102
108
|
}
|
|
103
109
|
export {
|
|
104
|
-
|
|
110
|
+
W as DeliveryCalendar
|
|
105
111
|
};
|
|
@@ -1,98 +1,109 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { BreadcrumbList as
|
|
11
|
-
import { SkipLink as
|
|
12
|
-
import { Header as
|
|
13
|
-
import { SideNav as
|
|
14
|
-
import { CakeLogo as
|
|
15
|
-
import { mypageMenuGroups as
|
|
16
|
-
import { BottomTabBar as
|
|
17
|
-
const
|
|
18
|
-
{ icon: /* @__PURE__ */
|
|
19
|
-
{ icon: /* @__PURE__ */
|
|
20
|
-
{ icon: /* @__PURE__ */
|
|
21
|
-
],
|
|
22
|
-
{ label: "ホーム", icon: /* @__PURE__ */
|
|
23
|
-
{ label: "探す", icon: /* @__PURE__ */
|
|
24
|
-
{ label: "店舗受取予約", icon: /* @__PURE__ */
|
|
1
|
+
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import z from "react";
|
|
3
|
+
import _ from "iconsax-reactjs/dist/esm/Home2.js";
|
|
4
|
+
import n from "iconsax-reactjs/dist/esm/SearchNormal1.js";
|
|
5
|
+
import w from "iconsax-reactjs/dist/esm/Shop.js";
|
|
6
|
+
import H from "iconsax-reactjs/dist/esm/Calendar.js";
|
|
7
|
+
import P from "iconsax-reactjs/dist/esm/Bookmark.js";
|
|
8
|
+
import E from "iconsax-reactjs/dist/esm/User.js";
|
|
9
|
+
import T from "iconsax-reactjs/dist/esm/ShoppingCart.js";
|
|
10
|
+
import { BreadcrumbList as j, BreadcrumbSeparator as A, BreadcrumbItem as M, BreadcrumbPage as F, BreadcrumbLink as G, Breadcrumb as c } from "../foundations/breadcrumb.js";
|
|
11
|
+
import { SkipLink as I } from "../foundations/skip-link.js";
|
|
12
|
+
import { Header as t } from "../primitives/header.js";
|
|
13
|
+
import { SideNav as R } from "../primitives/side-nav.js";
|
|
14
|
+
import { CakeLogo as U } from "./cake-logo.js";
|
|
15
|
+
import { mypageMenuGroups as $ } from "./_mypage-menu-data.js";
|
|
16
|
+
import { BottomTabBar as q } from "../primitives/bottom-tab-bar.js";
|
|
17
|
+
const C = [
|
|
18
|
+
{ icon: /* @__PURE__ */ r(n, { size: 20 }), label: "検索" },
|
|
19
|
+
{ icon: /* @__PURE__ */ r(E, { size: 20 }), label: "マイページ" },
|
|
20
|
+
{ icon: /* @__PURE__ */ r(T, { size: 20 }), label: "カート" }
|
|
21
|
+
], D = [
|
|
22
|
+
{ label: "ホーム", icon: /* @__PURE__ */ r(_, { size: 20 }), href: "/" },
|
|
23
|
+
{ label: "探す", icon: /* @__PURE__ */ r(n, { size: 20 }), href: "/search/" },
|
|
24
|
+
{ label: "店舗受取予約", icon: /* @__PURE__ */ r(w, { size: 20 }), href: "/takeout/" },
|
|
25
25
|
{
|
|
26
26
|
label: "記念日",
|
|
27
|
-
icon: /* @__PURE__ */
|
|
27
|
+
icon: /* @__PURE__ */ r(H, { size: 20 }),
|
|
28
28
|
href: "/mypage/anniversary/"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
label: "ブックマーク",
|
|
32
|
-
icon: /* @__PURE__ */
|
|
32
|
+
icon: /* @__PURE__ */ r(P, { size: 20 }),
|
|
33
33
|
href: "/mypage/bookmark/item_list/"
|
|
34
34
|
}
|
|
35
35
|
];
|
|
36
|
-
function
|
|
36
|
+
function J(e) {
|
|
37
37
|
return [
|
|
38
38
|
{ label: "ホーム", href: "/" },
|
|
39
39
|
{ label: "山田 太郎 さまのマイページ", href: "/mypage/" },
|
|
40
|
-
{ label:
|
|
40
|
+
{ label: e }
|
|
41
41
|
];
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
title:
|
|
45
|
-
activeMenu:
|
|
46
|
-
currentPath:
|
|
47
|
-
activeMatch:
|
|
48
|
-
isActiveMenuItem:
|
|
49
|
-
children:
|
|
50
|
-
breadcrumbs:
|
|
51
|
-
bottomNavItems:
|
|
52
|
-
menuGroups:
|
|
53
|
-
headerActions:
|
|
54
|
-
logo:
|
|
55
|
-
navItems:
|
|
56
|
-
onBack:
|
|
57
|
-
mainId:
|
|
58
|
-
skipLink:
|
|
43
|
+
function lr({
|
|
44
|
+
title: e,
|
|
45
|
+
activeMenu: h,
|
|
46
|
+
currentPath: p,
|
|
47
|
+
activeMatch: b,
|
|
48
|
+
isActiveMenuItem: f,
|
|
49
|
+
children: u,
|
|
50
|
+
breadcrumbs: g,
|
|
51
|
+
bottomNavItems: v = D,
|
|
52
|
+
menuGroups: x = $,
|
|
53
|
+
headerActions: N = C,
|
|
54
|
+
logo: y = /* @__PURE__ */ r(U, {}),
|
|
55
|
+
navItems: B,
|
|
56
|
+
onBack: S,
|
|
57
|
+
mainId: o = "main-content",
|
|
58
|
+
skipLink: k,
|
|
59
|
+
linkComponent: i
|
|
59
60
|
}) {
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
return /* @__PURE__ */ a(
|
|
63
|
-
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
] },
|
|
61
|
+
const s = g ?? J(e), l = /* @__PURE__ */ r(j, { children: s.map((m, d) => {
|
|
62
|
+
const L = d === s.length - 1;
|
|
63
|
+
return /* @__PURE__ */ a(z.Fragment, { children: [
|
|
64
|
+
d > 0 && /* @__PURE__ */ r(A, {}),
|
|
65
|
+
/* @__PURE__ */ r(M, { children: L ? /* @__PURE__ */ r(F, { children: m.label }) : /* @__PURE__ */ r(G, { href: m.href ?? "#", linkComponent: i, children: m.label }) })
|
|
66
|
+
] }, d);
|
|
66
67
|
}) });
|
|
67
68
|
return /* @__PURE__ */ a("div", { className: "@container min-h-screen bg-[var(--Surface-Secondary)]", children: [
|
|
68
|
-
|
|
69
|
+
k !== !1 && /* @__PURE__ */ r(I, { href: `#${o}` }),
|
|
69
70
|
/* @__PURE__ */ a("div", { className: "@md:hidden bg-[var(--Surface-Primary)]", children: [
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ r(t, { variant: "back", onBack: S }),
|
|
72
|
+
/* @__PURE__ */ r("div", { className: "px-4 pt-3", children: /* @__PURE__ */ r(c, { children: l }) }),
|
|
73
|
+
/* @__PURE__ */ r("h1", { className: "typo-heading-xl text-[var(--Text-High-Emphasis)] px-4 pt-1 pb-3", children: e })
|
|
73
74
|
] }),
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
|
|
75
|
+
/* @__PURE__ */ r("div", { className: "hidden @md:block", children: /* @__PURE__ */ r(
|
|
76
|
+
t,
|
|
77
|
+
{
|
|
78
|
+
logo: y,
|
|
79
|
+
variant: "logo",
|
|
80
|
+
actions: N,
|
|
81
|
+
navItems: B,
|
|
82
|
+
linkComponent: i
|
|
83
|
+
}
|
|
84
|
+
) }),
|
|
85
|
+
/* @__PURE__ */ r("div", { className: "hidden @md:block bg-[var(--Surface-Primary)] border-b border-[var(--Border-Low-Emphasis)]", children: /* @__PURE__ */ r("div", { className: "max-w-[1280px] mx-auto px-6 py-3", children: /* @__PURE__ */ r(c, { children: l }) }) }),
|
|
76
86
|
/* @__PURE__ */ a("div", { className: "@md:max-w-[1280px] @md:mx-auto @md:px-6 @md:mt-10 @md:mb-10 @md:grid @md:[grid-template:'side_main'_1fr_/_256px_1fr] @md:gap-6 @md:items-start", children: [
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
|
|
87
|
+
/* @__PURE__ */ r("div", { className: "hidden @md:block @md:[grid-area:side] rounded-2xl overflow-hidden shadow-sm", children: /* @__PURE__ */ r(
|
|
88
|
+
R,
|
|
79
89
|
{
|
|
80
|
-
groups:
|
|
81
|
-
activeMenu:
|
|
82
|
-
currentPath:
|
|
83
|
-
activeMatch:
|
|
84
|
-
isActive:
|
|
85
|
-
ariaLabel: "マイページメニュー"
|
|
90
|
+
groups: x,
|
|
91
|
+
activeMenu: h,
|
|
92
|
+
currentPath: p,
|
|
93
|
+
activeMatch: b,
|
|
94
|
+
isActive: f,
|
|
95
|
+
ariaLabel: "マイページメニュー",
|
|
96
|
+
linkComponent: i
|
|
86
97
|
}
|
|
87
98
|
) }),
|
|
88
|
-
/* @__PURE__ */ a("main", { id:
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
99
|
+
/* @__PURE__ */ a("main", { id: o, className: "@container @md:[grid-area:main] bg-[var(--Surface-Primary)] @md:rounded-2xl @md:shadow-sm pb-20 @md:pb-8", children: [
|
|
100
|
+
/* @__PURE__ */ r("div", { className: "hidden @md:flex items-center gap-3 px-6 py-5 border-b border-[var(--Border-Low-Emphasis)]", children: /* @__PURE__ */ r("h1", { className: "typo-heading-lg text-[var(--Text-High-Emphasis)]", children: e }) }),
|
|
101
|
+
u
|
|
91
102
|
] })
|
|
92
103
|
] }),
|
|
93
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ r(q, { items: v, className: "@md:hidden", linkComponent: i })
|
|
94
105
|
] });
|
|
95
106
|
}
|
|
96
107
|
export {
|
|
97
|
-
|
|
108
|
+
lr as MypageShell
|
|
98
109
|
};
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { cn as c } from "../../lib/utils.js";
|
|
4
|
+
import { buttonVariants as I } from "../foundations/button.js";
|
|
5
|
+
import { PriceDisplay as B } from "../primitives/price-display.js";
|
|
6
|
+
import { RatingStars as M } from "./rating-stars.js";
|
|
7
|
+
import { Tag as b } from "../primitives/tag.js";
|
|
7
8
|
function j({
|
|
8
9
|
href: a,
|
|
9
10
|
onClick: r,
|
|
10
|
-
name: t
|
|
11
|
+
name: t,
|
|
12
|
+
linkComponent: i
|
|
11
13
|
}) {
|
|
14
|
+
const o = i ?? "a";
|
|
12
15
|
return a ? /* @__PURE__ */ e(
|
|
13
|
-
|
|
16
|
+
o,
|
|
14
17
|
{
|
|
15
18
|
href: a,
|
|
16
19
|
className: "absolute inset-0 z-[var(--Z-Local-1)]",
|
|
@@ -29,7 +32,7 @@ function j({
|
|
|
29
32
|
}
|
|
30
33
|
) : null;
|
|
31
34
|
}
|
|
32
|
-
function
|
|
35
|
+
function V({ size: a = 20, filled: r = !1 }) {
|
|
33
36
|
return /* @__PURE__ */ e(
|
|
34
37
|
"svg",
|
|
35
38
|
{
|
|
@@ -52,7 +55,7 @@ function $({ size: a = 20, filled: r = !1 }) {
|
|
|
52
55
|
}
|
|
53
56
|
);
|
|
54
57
|
}
|
|
55
|
-
function
|
|
58
|
+
function Z({
|
|
56
59
|
isFavorite: a,
|
|
57
60
|
onToggle: r,
|
|
58
61
|
size: t = "md"
|
|
@@ -61,16 +64,16 @@ function M({
|
|
|
61
64
|
"button",
|
|
62
65
|
{
|
|
63
66
|
type: "button",
|
|
64
|
-
className:
|
|
65
|
-
"relative z-10 flex items-center justify-center rounded-full border border-[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)]",
|
|
67
|
+
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)]",
|
|
66
69
|
t === "sm" ? "size-[30px]" : "size-9"
|
|
67
70
|
),
|
|
68
|
-
onClick: (
|
|
69
|
-
|
|
71
|
+
onClick: (i) => {
|
|
72
|
+
i.preventDefault(), i.stopPropagation(), r();
|
|
70
73
|
},
|
|
71
74
|
"aria-label": a ? "お気に入りから削除" : "お気に入りに追加",
|
|
72
75
|
children: /* @__PURE__ */ e(
|
|
73
|
-
|
|
76
|
+
V,
|
|
74
77
|
{
|
|
75
78
|
size: t === "sm" ? 16 : 20,
|
|
76
79
|
filled: a
|
|
@@ -79,7 +82,7 @@ function M({
|
|
|
79
82
|
}
|
|
80
83
|
);
|
|
81
84
|
}
|
|
82
|
-
function
|
|
85
|
+
function S({ rank: a }) {
|
|
83
86
|
return /* @__PURE__ */ e(
|
|
84
87
|
"img",
|
|
85
88
|
{
|
|
@@ -90,89 +93,95 @@ function Z({ rank: a }) {
|
|
|
90
93
|
}
|
|
91
94
|
);
|
|
92
95
|
}
|
|
93
|
-
function
|
|
96
|
+
function q(a, r) {
|
|
94
97
|
return r == null || r <= a ? null : `${Math.round((r - a) / r * 100)}%OFF`;
|
|
95
98
|
}
|
|
96
|
-
function
|
|
99
|
+
function H({
|
|
100
|
+
name: a,
|
|
101
|
+
href: r,
|
|
102
|
+
linkComponent: t
|
|
103
|
+
}) {
|
|
104
|
+
const i = t ?? "a";
|
|
97
105
|
return r ? /* @__PURE__ */ e(
|
|
98
|
-
|
|
106
|
+
i,
|
|
99
107
|
{
|
|
100
108
|
href: r,
|
|
101
109
|
className: "relative z-10 truncate typo-body-sm text-[var(--Text-Low-Emphasis)] hover:text-[var(--Text-Medium-Emphasis)] hover:underline",
|
|
102
|
-
onClick: (
|
|
110
|
+
onClick: (o) => o.stopPropagation(),
|
|
103
111
|
children: a
|
|
104
112
|
}
|
|
105
113
|
) : /* @__PURE__ */ e("p", { className: "truncate typo-body-sm text-[var(--Text-Low-Emphasis)]", children: a });
|
|
106
114
|
}
|
|
107
|
-
function
|
|
115
|
+
function O(a) {
|
|
108
116
|
if (a !== "none")
|
|
109
117
|
return a === "fade" ? "transition-[filter] group-hover:brightness-110" : "transition-transform group-hover:scale-105";
|
|
110
118
|
}
|
|
111
|
-
function
|
|
119
|
+
function Y({
|
|
112
120
|
className: a,
|
|
113
121
|
name: r,
|
|
114
122
|
imageUrl: t,
|
|
115
|
-
imageAlt:
|
|
116
|
-
price:
|
|
117
|
-
originalPrice:
|
|
118
|
-
caption:
|
|
119
|
-
rating:
|
|
123
|
+
imageAlt: i,
|
|
124
|
+
price: o,
|
|
125
|
+
originalPrice: x,
|
|
126
|
+
caption: h,
|
|
127
|
+
rating: d,
|
|
120
128
|
reviewCount: y,
|
|
121
|
-
shopName:
|
|
122
|
-
shopHref:
|
|
129
|
+
shopName: p,
|
|
130
|
+
shopHref: z,
|
|
123
131
|
hoverEffect: P,
|
|
124
|
-
tags:
|
|
125
|
-
isFavorite:
|
|
126
|
-
onFavoriteToggle:
|
|
127
|
-
onCardClick:
|
|
128
|
-
href:
|
|
132
|
+
tags: N = [],
|
|
133
|
+
isFavorite: w = !1,
|
|
134
|
+
onFavoriteToggle: v,
|
|
135
|
+
onCardClick: g,
|
|
136
|
+
href: L,
|
|
129
137
|
ranking: n,
|
|
130
|
-
deliveryDate:
|
|
131
|
-
orientation:
|
|
132
|
-
showDiscountBadge:
|
|
133
|
-
showCartButton:
|
|
134
|
-
onCartAdd:
|
|
135
|
-
cartButtonLabel:
|
|
136
|
-
|
|
138
|
+
deliveryDate: m,
|
|
139
|
+
orientation: T = "vertical",
|
|
140
|
+
showDiscountBadge: C = !0,
|
|
141
|
+
showCartButton: R = !1,
|
|
142
|
+
onCartAdd: $,
|
|
143
|
+
cartButtonLabel: D = "カートに追加",
|
|
144
|
+
linkComponent: f,
|
|
145
|
+
...E
|
|
137
146
|
}) {
|
|
138
|
-
const
|
|
139
|
-
return
|
|
147
|
+
const k = P ?? (T === "horizontal" ? "none" : "zoom"), u = C ? q(o, x) : null;
|
|
148
|
+
return T === "horizontal" ? /* @__PURE__ */ l(
|
|
140
149
|
"div",
|
|
141
150
|
{
|
|
142
151
|
"data-slot": "product-card",
|
|
143
152
|
"data-orientation": "horizontal",
|
|
144
|
-
className:
|
|
153
|
+
className: c(
|
|
145
154
|
// min-w-0: 列トラック(1fr = minmax(auto,1fr))が nowrap の内容や
|
|
146
155
|
// 固定 min-width に押し広げられ、カードが列からはみ出すのを防ぐ(#210)
|
|
147
156
|
"group relative flex min-w-0 rounded-lg bg-[var(--Surface-Primary)]",
|
|
148
157
|
n != null && "pt-3",
|
|
149
158
|
a
|
|
150
159
|
),
|
|
151
|
-
...
|
|
160
|
+
...E,
|
|
152
161
|
children: [
|
|
153
|
-
/* @__PURE__ */ e(j, { href:
|
|
154
|
-
n != null && /* @__PURE__ */ e(
|
|
162
|
+
/* @__PURE__ */ e(j, { href: L, onClick: g, name: r, linkComponent: f }),
|
|
163
|
+
n != null && /* @__PURE__ */ e(S, { rank: n }),
|
|
155
164
|
/* @__PURE__ */ l("div", { className: "relative h-auto w-28 shrink-0 overflow-hidden rounded-lg @sm:w-36", children: [
|
|
156
|
-
/* @__PURE__ */ e("img", { src: t, alt:
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
165
|
+
/* @__PURE__ */ e("img", { src: t, alt: i ?? r, className: c("h-full w-full object-cover duration-[var(--Motion-Duration-Base)]", O(k)), loading: "lazy" }),
|
|
166
|
+
u && /* @__PURE__ */ e(b, { variant: "sale", size: "sm", className: "absolute bottom-1.5 left-1.5 z-[var(--Z-Local-2)]", children: u }),
|
|
167
|
+
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
|
+
v && /* @__PURE__ */ e("div", { className: "absolute bottom-1 right-1 z-10", children: /* @__PURE__ */ e(Z, { isFavorite: w, onToggle: v, size: "sm" }) })
|
|
160
169
|
] }),
|
|
161
170
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col justify-between py-1 pl-3 pr-1", children: [
|
|
162
171
|
/* @__PURE__ */ l("div", { className: "space-y-0.5", children: [
|
|
163
|
-
|
|
172
|
+
p && /* @__PURE__ */ e(H, { name: p, href: z, linkComponent: f }),
|
|
164
173
|
/* @__PURE__ */ e("h3", { className: "line-clamp-2 typo-body-md text-[var(--Text-High-Emphasis)]", children: r })
|
|
165
174
|
] }),
|
|
166
175
|
/* @__PURE__ */ l("div", { className: "mt-1 min-w-0 space-y-0.5", children: [
|
|
167
176
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [
|
|
168
|
-
|
|
169
|
-
|
|
177
|
+
d != null && /* @__PURE__ */ e(M, { rating: d, reviewCount: y, size: "sm" }),
|
|
178
|
+
m && /* @__PURE__ */ l("p", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: [
|
|
170
179
|
"最短 ",
|
|
171
|
-
|
|
180
|
+
m
|
|
172
181
|
] })
|
|
173
182
|
] }),
|
|
174
|
-
/* @__PURE__ */ e(
|
|
175
|
-
|
|
183
|
+
/* @__PURE__ */ e(B, { price: o, originalPrice: x, size: "sm", showTaxLabel: !1 }),
|
|
184
|
+
h && /* @__PURE__ */ e("p", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: h })
|
|
176
185
|
] })
|
|
177
186
|
] })
|
|
178
187
|
]
|
|
@@ -182,7 +191,7 @@ function J({
|
|
|
182
191
|
{
|
|
183
192
|
"data-slot": "product-card",
|
|
184
193
|
"data-orientation": "vertical",
|
|
185
|
-
className:
|
|
194
|
+
className: c(
|
|
186
195
|
// max-w: 広いグリッドセルでもカードが膨らみすぎないようカード自身が上限を持つ。
|
|
187
196
|
// 280px は本番の検索結果グリッド(PC 5列 ≈ カード215px)では未到達=影響なし。
|
|
188
197
|
// マイページ等の3列グリッド(実効幅 ~950px)で 3×280+gap が収まる上限として採用。
|
|
@@ -192,42 +201,50 @@ function J({
|
|
|
192
201
|
n != null && "pt-3",
|
|
193
202
|
a
|
|
194
203
|
),
|
|
195
|
-
...
|
|
204
|
+
...E,
|
|
196
205
|
children: [
|
|
197
|
-
/* @__PURE__ */ e(j, { href:
|
|
198
|
-
n != null && /* @__PURE__ */ e(
|
|
206
|
+
/* @__PURE__ */ e(j, { href: L, onClick: g, name: r, linkComponent: f }),
|
|
207
|
+
n != null && /* @__PURE__ */ e(S, { rank: n }),
|
|
199
208
|
/* @__PURE__ */ l("div", { className: "relative", children: [
|
|
200
209
|
/* @__PURE__ */ l("div", { className: "aspect-square overflow-hidden rounded-lg", children: [
|
|
201
|
-
/* @__PURE__ */ e("img", { src: t, alt:
|
|
210
|
+
/* @__PURE__ */ e("img", { src: t, alt: i ?? r, className: c("h-full w-full object-cover duration-[var(--Motion-Duration-Base)]", O(k)), loading: "lazy" }),
|
|
202
211
|
/* @__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: [
|
|
203
|
-
|
|
204
|
-
|
|
212
|
+
u && /* @__PURE__ */ e(b, { variant: "sale", size: "sm", children: u }),
|
|
213
|
+
N.map((s) => /* @__PURE__ */ e(
|
|
214
|
+
b,
|
|
215
|
+
{
|
|
216
|
+
variant: s.variant === void 0 || s.variant === "default" ? "image" : s.variant,
|
|
217
|
+
size: "sm",
|
|
218
|
+
children: s.label
|
|
219
|
+
},
|
|
220
|
+
s.label
|
|
221
|
+
))
|
|
205
222
|
] }) })
|
|
206
223
|
] }),
|
|
207
|
-
|
|
224
|
+
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 }) })
|
|
208
225
|
] }),
|
|
209
226
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
210
|
-
|
|
227
|
+
p && /* @__PURE__ */ e(H, { name: p, href: z, linkComponent: f }),
|
|
211
228
|
/* @__PURE__ */ e("h3", { className: "line-clamp-2 min-h-[2lh] typo-body-md text-[var(--Text-High-Emphasis)]", children: r }),
|
|
212
|
-
(
|
|
213
|
-
|
|
214
|
-
|
|
229
|
+
(d != null || m) && /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [
|
|
230
|
+
d != null && /* @__PURE__ */ e(M, { rating: d, reviewCount: y, size: "sm" }),
|
|
231
|
+
m && /* @__PURE__ */ l("p", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: [
|
|
215
232
|
"最短 ",
|
|
216
|
-
|
|
233
|
+
m
|
|
217
234
|
] })
|
|
218
235
|
] }),
|
|
219
|
-
/* @__PURE__ */ e(
|
|
220
|
-
|
|
236
|
+
/* @__PURE__ */ e(B, { price: o, originalPrice: x, size: "md", showTaxLabel: !1 }),
|
|
237
|
+
h && /* @__PURE__ */ e("p", { className: "typo-body-xs text-[var(--Text-Medium-Emphasis)]", children: h })
|
|
221
238
|
] }),
|
|
222
|
-
|
|
239
|
+
R && /* @__PURE__ */ e(
|
|
223
240
|
"button",
|
|
224
241
|
{
|
|
225
242
|
type: "button",
|
|
226
|
-
className: "relative z-10
|
|
243
|
+
className: c(I({ variant: "outline", size: "sm" }), "relative z-10 h-9 w-full gap-0.5"),
|
|
227
244
|
onClick: (s) => {
|
|
228
|
-
s.preventDefault(), s.stopPropagation(),
|
|
245
|
+
s.preventDefault(), s.stopPropagation(), $?.();
|
|
229
246
|
},
|
|
230
|
-
children:
|
|
247
|
+
children: D
|
|
231
248
|
}
|
|
232
249
|
)
|
|
233
250
|
]
|
|
@@ -235,6 +252,6 @@ function J({
|
|
|
235
252
|
);
|
|
236
253
|
}
|
|
237
254
|
export {
|
|
238
|
-
|
|
239
|
-
|
|
255
|
+
V as BookmarkRibbonIcon,
|
|
256
|
+
Y as ProductCard
|
|
240
257
|
};
|