@cakejp/design-system 0.17.1 → 0.19.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 +50 -0
- package/CLAUDE.md +15 -0
- package/contracts/components.json +144 -16
- package/contracts/composition.json +1 -1
- package/contracts/rules.json +5 -1
- package/contracts/screen-patterns.json +1 -1
- package/dist/components/ec/admin-shell.js +7 -6
- package/dist/components/ec/product-card.js +107 -102
- package/dist/components/ec/product-option.js +1 -0
- package/dist/components/ec/review-card.js +22 -20
- package/dist/components/ec/review-form.js +1 -0
- package/dist/components/foundations/accordion.js +23 -22
- package/dist/components/foundations/alert.js +1 -0
- package/dist/components/foundations/aspect-ratio.js +3 -2
- package/dist/components/foundations/avatar.js +1 -0
- package/dist/components/foundations/button.js +7 -1
- package/dist/components/foundations/calendar.js +1 -0
- package/dist/components/foundations/checkbox-group.js +1 -0
- package/dist/components/foundations/checkbox.js +1 -0
- package/dist/components/foundations/command.js +1 -0
- package/dist/components/foundations/context-menu.js +1 -0
- package/dist/components/foundations/drawer.js +1 -0
- package/dist/components/foundations/file-input.js +1 -0
- package/dist/components/foundations/form.js +26 -25
- package/dist/components/foundations/pagination.js +49 -46
- package/dist/components/foundations/popover.js +9 -8
- package/dist/components/foundations/radio-group.js +3 -2
- package/dist/components/foundations/responsive-dialog.js +1 -0
- package/dist/components/foundations/separator.js +7 -6
- package/dist/components/foundations/sheet.js +40 -33
- package/dist/components/foundations/slider.js +7 -6
- package/dist/components/foundations/social-icon.js +30 -10
- package/dist/components/foundations/sonner.js +5 -4
- package/dist/components/foundations/tabs.js +45 -25
- package/dist/components/foundations/toggle-group.js +6 -5
- package/dist/components/primitives/admin-side-nav.js +1 -0
- package/dist/components/primitives/chat-composer.js +1 -0
- package/dist/components/primitives/combobox.js +1 -0
- package/dist/components/primitives/content-card.js +111 -0
- package/dist/components/primitives/content-carousel.js +9 -8
- package/dist/components/primitives/date-picker.js +9 -8
- package/dist/components/primitives/footer.js +169 -100
- package/dist/components/primitives/form-field.js +1 -0
- package/dist/components/primitives/header.js +220 -176
- package/dist/components/primitives/image-carousel.js +8 -7
- package/dist/components/primitives/image-gallery.js +15 -14
- package/dist/components/primitives/image-input.js +9 -8
- package/dist/components/primitives/list-item.js +9 -8
- package/dist/components/primitives/menu-drawer.js +60 -56
- package/dist/components/primitives/multi-select.js +7 -6
- package/dist/components/primitives/number-input.js +1 -0
- package/dist/components/primitives/prose.js +52 -0
- package/dist/components/primitives/search-bar.js +81 -66
- package/dist/components/primitives/section-header.js +58 -55
- package/dist/components/primitives/share-buttons.js +93 -85
- package/dist/components/primitives/status-count-tabs.js +8 -7
- package/dist/components/primitives/sub-nav.js +52 -52
- package/dist/index.css +1 -1
- package/dist/index.js +1513 -559
- package/dist/lib/field-labelling.js +7 -6
- package/dist/lib/link-component.js +6 -0
- package/dist/lib/use-value-length.js +1 -0
- package/dist/types/components/ec/product-card.d.ts +12 -19
- package/dist/types/components/ec/review-card.d.ts +6 -1
- package/dist/types/components/foundations/button.d.ts +1 -1
- package/dist/types/components/foundations/chip-variants.d.ts +1 -1
- package/dist/types/components/foundations/data-table.d.ts +9 -1
- package/dist/types/components/foundations/pagination.d.ts +7 -1
- package/dist/types/components/foundations/sheet.d.ts +6 -1
- package/dist/types/components/foundations/social-icon.d.ts +1 -1
- package/dist/types/components/foundations/tabs.d.ts +2 -1
- package/dist/types/components/primitives/content-card.d.ts +67 -0
- package/dist/types/components/primitives/footer.d.ts +21 -1
- package/dist/types/components/primitives/header.d.ts +30 -2
- package/dist/types/components/primitives/menu-drawer.d.ts +7 -1
- package/dist/types/components/primitives/prose.d.ts +35 -0
- package/dist/types/components/primitives/search-bar.d.ts +14 -1
- package/dist/types/components/primitives/section-header.d.ts +2 -1
- package/dist/types/components/primitives/share-buttons.d.ts +26 -4
- package/dist/types/components/primitives/sub-nav.d.ts +16 -1
- package/dist/types/index.d.ts +4 -0
- package/dist/types/lib/link-component.d.ts +26 -0
- package/package.json +4 -3
- package/src/components/COMPONENT_LOOKUP.md +7 -5
- package/src/preset-standalone.css +1 -0
- package/src/preset.css +8 -0
- package/src/styles/semantic.css +1 -0
- package/tokens.json +8 -1
|
@@ -1,257 +1,301 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e, jsxs as s, Fragment as W } from "react/jsx-runtime";
|
|
3
|
+
import * as y from "react";
|
|
4
|
+
import M from "iconsax-reactjs/dist/esm/ArrowDown2.js";
|
|
5
|
+
import D from "iconsax-reactjs/dist/esm/ArrowLeft.js";
|
|
6
|
+
import { cn as f } from "../../lib/utils.js";
|
|
7
|
+
import { Button as k } from "../foundations/button.js";
|
|
8
|
+
import { DropdownMenu as F, DropdownMenuTrigger as G, DropdownMenuContent as Z, DropdownMenuItem as V } from "../foundations/dropdown-menu.js";
|
|
9
|
+
import { containerVariants as q } from "./container.js";
|
|
10
|
+
function E({
|
|
11
|
+
containerSize: l,
|
|
12
|
+
shellClass: c,
|
|
13
|
+
layoutClass: a,
|
|
14
|
+
containerQuery: u = !1,
|
|
15
|
+
children: p,
|
|
16
|
+
...d
|
|
17
|
+
}) {
|
|
18
|
+
return l ? /* @__PURE__ */ e("header", { "data-slot": "header", className: c, ...d, children: /* @__PURE__ */ e(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
"data-slot": "header-container",
|
|
22
|
+
"data-container-size": l,
|
|
23
|
+
className: f(
|
|
24
|
+
u && "@container",
|
|
25
|
+
q({ size: l, gutter: "none" }),
|
|
26
|
+
a
|
|
27
|
+
),
|
|
28
|
+
children: p
|
|
29
|
+
}
|
|
30
|
+
) }) : /* @__PURE__ */ e(
|
|
31
|
+
"header",
|
|
32
|
+
{
|
|
33
|
+
"data-slot": "header",
|
|
34
|
+
className: f(u && "@container", a, c),
|
|
35
|
+
...d,
|
|
36
|
+
children: p
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
function R(l) {
|
|
41
|
+
return f(
|
|
10
42
|
"px-3 py-1.5 typo-body-md rounded-md transition-colors whitespace-nowrap",
|
|
11
|
-
|
|
43
|
+
l ? "text-[var(--Text-High-Emphasis)] font-bold" : "text-[var(--Text-Medium-Emphasis)] hover:text-[var(--Text-High-Emphasis)] hover:bg-[var(--Surface-Secondary)]"
|
|
12
44
|
);
|
|
13
45
|
}
|
|
14
|
-
const
|
|
15
|
-
function
|
|
16
|
-
items:
|
|
17
|
-
overflowLabel:
|
|
46
|
+
const P = 2;
|
|
47
|
+
function J({
|
|
48
|
+
items: l,
|
|
49
|
+
overflowLabel: c = "その他"
|
|
18
50
|
}) {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
if (!
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
|
|
51
|
+
const a = y.useRef(null), u = y.useRef(null), [p, d] = y.useState(l.length);
|
|
52
|
+
y.useEffect(() => {
|
|
53
|
+
const r = a.current, m = u.current;
|
|
54
|
+
if (!r || !m) return;
|
|
55
|
+
const i = () => {
|
|
56
|
+
const N = Array.from(m.children), v = N.slice(0, l.length).map((t) => t.getBoundingClientRect().width), z = N[l.length]?.getBoundingClientRect().width ?? 0, w = r.clientWidth;
|
|
57
|
+
if (w === 0 || v.some((t) => t === 0)) {
|
|
58
|
+
d(l.length);
|
|
27
59
|
return;
|
|
28
60
|
}
|
|
29
|
-
if (
|
|
30
|
-
|
|
61
|
+
if (v.reduce((t, h) => t + h, 0) + P * (l.length - 1) <= w) {
|
|
62
|
+
d(l.length);
|
|
31
63
|
return;
|
|
32
64
|
}
|
|
33
|
-
let
|
|
34
|
-
for (let
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
|
|
65
|
+
let g = z, A = 0;
|
|
66
|
+
for (let t = 0; t < l.length; t++) {
|
|
67
|
+
const h = g + v[t] + P;
|
|
68
|
+
if (h > w) break;
|
|
69
|
+
g = h, A = t + 1;
|
|
38
70
|
}
|
|
39
|
-
|
|
71
|
+
d(A);
|
|
40
72
|
};
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
return
|
|
44
|
-
window.removeEventListener("resize",
|
|
73
|
+
i(), window.addEventListener("resize", i);
|
|
74
|
+
const b = typeof ResizeObserver < "u" ? new ResizeObserver(i) : null;
|
|
75
|
+
return b?.observe(r), b?.observe(m), () => {
|
|
76
|
+
window.removeEventListener("resize", i), b?.disconnect();
|
|
45
77
|
};
|
|
46
|
-
}, [
|
|
47
|
-
const x =
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
78
|
+
}, [l]);
|
|
79
|
+
const x = l.slice(0, p), o = l.slice(p);
|
|
80
|
+
return /* @__PURE__ */ s("div", { ref: a, className: "relative min-w-0 flex-1", children: [
|
|
81
|
+
/* @__PURE__ */ e(
|
|
50
82
|
"div",
|
|
51
83
|
{
|
|
52
|
-
ref: C,
|
|
53
84
|
"aria-hidden": "true",
|
|
54
|
-
className: "
|
|
55
|
-
children:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
u,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
85
|
+
className: "pointer-events-none absolute top-0 left-0 h-0 w-0 overflow-hidden",
|
|
86
|
+
children: /* @__PURE__ */ s(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
ref: u,
|
|
90
|
+
className: "invisible flex w-max items-center gap-0.5",
|
|
91
|
+
children: [
|
|
92
|
+
l.map((r) => /* @__PURE__ */ e("span", { className: R(r.isActive), children: r.label }, r.label)),
|
|
93
|
+
/* @__PURE__ */ s("span", { className: f(R(!1), "inline-flex items-center gap-1"), children: [
|
|
94
|
+
c,
|
|
95
|
+
/* @__PURE__ */ e(M, { size: 16 })
|
|
96
|
+
] })
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
)
|
|
62
100
|
}
|
|
63
101
|
),
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
x.map((
|
|
66
|
-
const
|
|
67
|
-
return /* @__PURE__ */
|
|
68
|
-
|
|
102
|
+
/* @__PURE__ */ s("nav", { className: "flex items-center gap-0.5", children: [
|
|
103
|
+
x.map((r) => {
|
|
104
|
+
const m = r.href ? "a" : "button", i = r.href ? { href: r.href } : { type: "button", onClick: r.onClick };
|
|
105
|
+
return /* @__PURE__ */ e(
|
|
106
|
+
m,
|
|
69
107
|
{
|
|
70
|
-
className:
|
|
71
|
-
...
|
|
72
|
-
children:
|
|
108
|
+
className: R(r.isActive),
|
|
109
|
+
...i,
|
|
110
|
+
children: r.label
|
|
73
111
|
},
|
|
74
|
-
|
|
112
|
+
r.label
|
|
75
113
|
);
|
|
76
114
|
}),
|
|
77
|
-
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
|
|
115
|
+
o.length > 0 && /* @__PURE__ */ s(F, { children: [
|
|
116
|
+
/* @__PURE__ */ s(
|
|
117
|
+
G,
|
|
80
118
|
{
|
|
81
|
-
className:
|
|
82
|
-
|
|
119
|
+
className: f(
|
|
120
|
+
R(o.some((r) => r.isActive)),
|
|
83
121
|
"inline-flex items-center gap-1"
|
|
84
122
|
),
|
|
85
123
|
children: [
|
|
86
|
-
|
|
87
|
-
/* @__PURE__ */
|
|
124
|
+
c,
|
|
125
|
+
/* @__PURE__ */ e(M, { size: 16, "aria-hidden": "true" })
|
|
88
126
|
]
|
|
89
127
|
}
|
|
90
128
|
),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
(
|
|
129
|
+
/* @__PURE__ */ e(Z, { align: "end", children: o.map(
|
|
130
|
+
(r) => r.href ? /* @__PURE__ */ e(V, { asChild: !0, children: /* @__PURE__ */ e(
|
|
93
131
|
"a",
|
|
94
132
|
{
|
|
95
|
-
href:
|
|
96
|
-
onClick:
|
|
97
|
-
"aria-current":
|
|
98
|
-
children:
|
|
133
|
+
href: r.href,
|
|
134
|
+
onClick: r.onClick,
|
|
135
|
+
"aria-current": r.isActive ? "page" : void 0,
|
|
136
|
+
children: r.label
|
|
99
137
|
}
|
|
100
|
-
) },
|
|
101
|
-
|
|
138
|
+
) }, r.label) : /* @__PURE__ */ e(
|
|
139
|
+
V,
|
|
102
140
|
{
|
|
103
|
-
onSelect: () =>
|
|
104
|
-
children:
|
|
141
|
+
onSelect: () => r.onClick?.(),
|
|
142
|
+
children: r.label
|
|
105
143
|
},
|
|
106
|
-
|
|
144
|
+
r.label
|
|
107
145
|
)
|
|
108
146
|
) })
|
|
109
147
|
] })
|
|
110
148
|
] })
|
|
111
149
|
] });
|
|
112
150
|
}
|
|
113
|
-
function
|
|
114
|
-
className:
|
|
115
|
-
variant:
|
|
116
|
-
logo:
|
|
117
|
-
title:
|
|
118
|
-
onBack:
|
|
119
|
-
backLabel:
|
|
151
|
+
function S({
|
|
152
|
+
className: l,
|
|
153
|
+
variant: c = "logo",
|
|
154
|
+
logo: a,
|
|
155
|
+
title: u,
|
|
156
|
+
onBack: p,
|
|
157
|
+
backLabel: d = "戻る",
|
|
120
158
|
actions: x,
|
|
121
|
-
navItems:
|
|
122
|
-
navBreakpoint:
|
|
123
|
-
navOverflowLabel:
|
|
124
|
-
searchSlot:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
159
|
+
navItems: o,
|
|
160
|
+
navBreakpoint: r = "md",
|
|
161
|
+
navOverflowLabel: m,
|
|
162
|
+
searchSlot: i,
|
|
163
|
+
searchBreakpoint: b,
|
|
164
|
+
rightSlot: N,
|
|
165
|
+
centerSlot: v,
|
|
166
|
+
bottomSlot: z,
|
|
167
|
+
disableSticky: w = !1,
|
|
168
|
+
containerSize: C,
|
|
169
|
+
...g
|
|
130
170
|
}) {
|
|
131
|
-
const
|
|
132
|
-
if (
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
171
|
+
const h = f(w ? "" : "sticky top-0 z-[var(--Z-Nav)]", "border-b border-[var(--Border-Low-Emphasis)] bg-[var(--Surface-Primary)]", l), _ = r === "lg" ? "@[960px]:hidden" : "@[768px]:hidden", B = r === "lg" ? "hidden @[960px]:flex" : "hidden @[768px]:flex", O = b === "lg" ? "hidden @[960px]:block" : b === "md" ? "hidden @[768px]:block" : void 0;
|
|
172
|
+
if (c === "logo") {
|
|
173
|
+
const H = typeof a == "string" ? /* @__PURE__ */ e("span", { className: "typo-heading-lg text-[var(--Text-High-Emphasis)]", children: a }) : a ?? null, j = x && x.length > 0 && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1", children: x.map((n) => {
|
|
174
|
+
const L = n.showLabel ? {
|
|
175
|
+
variant: "ghost",
|
|
176
|
+
size: "sm",
|
|
177
|
+
className: "h-10 gap-1.5 rounded-full border border-[var(--Border-Medium-Emphasis)] px-4"
|
|
178
|
+
} : { variant: "ghost", size: "icon-sm" }, T = /* @__PURE__ */ s(W, { children: [
|
|
179
|
+
n.badge ? n.badge : n.icon,
|
|
180
|
+
n.showLabel && /* @__PURE__ */ e("span", { className: "typo-label-sm", children: n.label })
|
|
181
|
+
] });
|
|
182
|
+
return n.href ? /* @__PURE__ */ e(
|
|
183
|
+
k,
|
|
136
184
|
{
|
|
137
185
|
asChild: !0,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
"
|
|
141
|
-
children: /* @__PURE__ */ r("a", { href: l.href, onClick: l.onClick, children: l.badge ? l.badge : l.icon })
|
|
186
|
+
...L,
|
|
187
|
+
"aria-label": n.showLabel ? void 0 : n.label,
|
|
188
|
+
children: /* @__PURE__ */ e("a", { href: n.href, onClick: n.onClick, children: T })
|
|
142
189
|
},
|
|
143
|
-
|
|
144
|
-
) : /* @__PURE__ */
|
|
145
|
-
|
|
190
|
+
n.label
|
|
191
|
+
) : /* @__PURE__ */ e(
|
|
192
|
+
k,
|
|
146
193
|
{
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
children: l.badge ? l.badge : l.icon
|
|
194
|
+
...L,
|
|
195
|
+
"aria-label": n.showLabel ? void 0 : n.label,
|
|
196
|
+
onClick: n.onClick,
|
|
197
|
+
children: T
|
|
152
198
|
},
|
|
153
|
-
|
|
154
|
-
)
|
|
155
|
-
) });
|
|
156
|
-
return /* @__PURE__ */
|
|
157
|
-
|
|
199
|
+
n.label
|
|
200
|
+
);
|
|
201
|
+
}) });
|
|
202
|
+
return /* @__PURE__ */ s(
|
|
203
|
+
E,
|
|
158
204
|
{
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
205
|
+
containerSize: C,
|
|
206
|
+
shellClass: h,
|
|
207
|
+
containerQuery: !0,
|
|
208
|
+
...g,
|
|
162
209
|
children: [
|
|
163
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ s("div", { className: f(
|
|
164
211
|
"flex items-center justify-between px-4 py-3",
|
|
165
|
-
(
|
|
212
|
+
(o || i) && _
|
|
166
213
|
), children: [
|
|
167
|
-
|
|
168
|
-
|
|
214
|
+
H,
|
|
215
|
+
j
|
|
169
216
|
] }),
|
|
170
|
-
(
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
|
|
174
|
-
|
|
217
|
+
(o || i) && /* @__PURE__ */ s("div", { className: f(B, "items-center justify-between gap-4 h-14 px-6"), children: [
|
|
218
|
+
/* @__PURE__ */ s("div", { className: "flex min-w-0 flex-1 items-center gap-6", children: [
|
|
219
|
+
/* @__PURE__ */ e("div", { className: "shrink-0", children: H }),
|
|
220
|
+
o && o.length > 0 && /* @__PURE__ */ e(
|
|
221
|
+
J,
|
|
175
222
|
{
|
|
176
|
-
items:
|
|
177
|
-
overflowLabel:
|
|
223
|
+
items: o,
|
|
224
|
+
overflowLabel: m
|
|
178
225
|
}
|
|
179
226
|
)
|
|
180
227
|
] }),
|
|
181
|
-
|
|
182
|
-
|
|
228
|
+
i && /* @__PURE__ */ e(
|
|
229
|
+
"div",
|
|
230
|
+
{
|
|
231
|
+
className: f(
|
|
232
|
+
"min-w-0 flex-1 max-w-[400px]",
|
|
233
|
+
O
|
|
234
|
+
),
|
|
235
|
+
children: i
|
|
236
|
+
}
|
|
237
|
+
),
|
|
238
|
+
j
|
|
183
239
|
] }),
|
|
184
|
-
|
|
240
|
+
z
|
|
185
241
|
]
|
|
186
242
|
}
|
|
187
243
|
);
|
|
188
244
|
}
|
|
189
|
-
return
|
|
190
|
-
|
|
245
|
+
return c === "logo-center" ? /* @__PURE__ */ e(
|
|
246
|
+
E,
|
|
191
247
|
{
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
n
|
|
198
|
-
),
|
|
199
|
-
...o,
|
|
200
|
-
children: typeof t == "string" ? /* @__PURE__ */ r("span", { className: "typo-heading-lg text-[var(--Text-High-Emphasis)]", children: t }) : t ?? null
|
|
248
|
+
containerSize: C,
|
|
249
|
+
shellClass: h,
|
|
250
|
+
layoutClass: "flex items-center justify-center px-4 py-3",
|
|
251
|
+
...g,
|
|
252
|
+
children: typeof a == "string" ? /* @__PURE__ */ e("span", { className: "typo-heading-lg text-[var(--Text-High-Emphasis)]", children: a }) : a ?? null
|
|
201
253
|
}
|
|
202
|
-
) :
|
|
203
|
-
|
|
254
|
+
) : c === "back-search" ? /* @__PURE__ */ e(
|
|
255
|
+
E,
|
|
204
256
|
{
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
...o,
|
|
213
|
-
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
214
|
-
/* @__PURE__ */ r(
|
|
215
|
-
z,
|
|
257
|
+
containerSize: C,
|
|
258
|
+
shellClass: h,
|
|
259
|
+
layoutClass: "px-4 py-3",
|
|
260
|
+
...g,
|
|
261
|
+
children: /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
262
|
+
/* @__PURE__ */ e(
|
|
263
|
+
k,
|
|
216
264
|
{
|
|
217
265
|
variant: "ghost",
|
|
218
|
-
size: "icon-
|
|
219
|
-
"aria-label":
|
|
220
|
-
onClick:
|
|
221
|
-
children: /* @__PURE__ */
|
|
266
|
+
size: "icon-xl",
|
|
267
|
+
"aria-label": d,
|
|
268
|
+
onClick: p,
|
|
269
|
+
children: /* @__PURE__ */ e(D, { size: 20 })
|
|
222
270
|
}
|
|
223
271
|
),
|
|
224
|
-
|
|
272
|
+
v && /* @__PURE__ */ e("div", { className: "flex-1", children: v })
|
|
225
273
|
] })
|
|
226
274
|
}
|
|
227
|
-
) : /* @__PURE__ */
|
|
228
|
-
|
|
275
|
+
) : /* @__PURE__ */ s(
|
|
276
|
+
E,
|
|
229
277
|
{
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
"grid grid-cols-[1fr_auto_1fr] items-center gap-2 px-2 py-3",
|
|
235
|
-
n
|
|
236
|
-
),
|
|
237
|
-
...o,
|
|
278
|
+
containerSize: C,
|
|
279
|
+
shellClass: h,
|
|
280
|
+
layoutClass: "grid grid-cols-[1fr_auto_1fr] items-center gap-2 px-2 py-3",
|
|
281
|
+
...g,
|
|
238
282
|
children: [
|
|
239
|
-
/* @__PURE__ */
|
|
240
|
-
|
|
283
|
+
/* @__PURE__ */ e("div", { className: "justify-self-start", children: /* @__PURE__ */ e(
|
|
284
|
+
k,
|
|
241
285
|
{
|
|
242
286
|
variant: "ghost",
|
|
243
287
|
size: "icon-sm",
|
|
244
|
-
"aria-label":
|
|
245
|
-
onClick:
|
|
246
|
-
children: /* @__PURE__ */
|
|
288
|
+
"aria-label": d,
|
|
289
|
+
onClick: p,
|
|
290
|
+
children: /* @__PURE__ */ e(D, { size: 20 })
|
|
247
291
|
}
|
|
248
292
|
) }),
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ e("h1", { className: "min-w-0 truncate text-center typo-heading-md text-[var(--Text-High-Emphasis)]", children: u }),
|
|
294
|
+
/* @__PURE__ */ e("div", { className: "justify-self-end", children: N })
|
|
251
295
|
]
|
|
252
296
|
}
|
|
253
297
|
);
|
|
254
298
|
}
|
|
255
299
|
export {
|
|
256
|
-
|
|
300
|
+
S as Header
|
|
257
301
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsxs as y, jsx as t, Fragment as T } from "react/jsx-runtime";
|
|
2
3
|
import * as l from "react";
|
|
3
4
|
import k from "iconsax-reactjs/dist/esm/ArrowLeft2.js";
|
|
@@ -8,9 +9,9 @@ function B({
|
|
|
8
9
|
aspectRatio: i = "banner",
|
|
9
10
|
showDots: N = !0,
|
|
10
11
|
showArrows: w = !0,
|
|
11
|
-
autoPlay:
|
|
12
|
+
autoPlay: u = 0,
|
|
12
13
|
peek: x = !1,
|
|
13
|
-
pcSlidesPerView:
|
|
14
|
+
pcSlidesPerView: d = 1,
|
|
14
15
|
centeredSlides: h = !1,
|
|
15
16
|
className: j,
|
|
16
17
|
...z
|
|
@@ -40,12 +41,12 @@ function B({
|
|
|
40
41
|
f && e.scrollTo({ left: f.offsetLeft, behavior: "smooth" });
|
|
41
42
|
}
|
|
42
43
|
l.useEffect(() => {
|
|
43
|
-
if (
|
|
44
|
+
if (u <= 0 || a <= 1) return;
|
|
44
45
|
const r = setInterval(() => {
|
|
45
46
|
n((s + 1) % a);
|
|
46
|
-
},
|
|
47
|
+
}, u);
|
|
47
48
|
return () => clearInterval(r);
|
|
48
|
-
}, [
|
|
49
|
+
}, [u, s, a]);
|
|
49
50
|
function I() {
|
|
50
51
|
n(s <= 0 ? a - 1 : s - 1);
|
|
51
52
|
}
|
|
@@ -75,7 +76,7 @@ function B({
|
|
|
75
76
|
h && "@[768px]:px-[22.25%] @[960px]:px-0 @[768px]:gap-4",
|
|
76
77
|
// PC 複数枚表示時のスライド間ギャップ(本番 spaceBetween:24 準拠)
|
|
77
78
|
// cascade: @[960px]:gap-6 > @[768px]:gap-4 at 960px+
|
|
78
|
-
|
|
79
|
+
d > 1 && "@[960px]:gap-6"
|
|
79
80
|
),
|
|
80
81
|
style: { scrollbarWidth: "none", msOverflowStyle: "none" },
|
|
81
82
|
children: c.map((r, e) => /* @__PURE__ */ t(
|
|
@@ -87,7 +88,7 @@ function B({
|
|
|
87
88
|
"shrink-0 snap-start",
|
|
88
89
|
// centeredSlides: タブレットで snap-center、PC で snap-start に戻す
|
|
89
90
|
h && "@[768px]:snap-center @[960px]:snap-start",
|
|
90
|
-
x ?
|
|
91
|
+
x ? d > 1 ? "w-[calc(100%-48px)] pr-3 @[960px]:w-[calc((100%-48px)/3)] @[960px]:pr-0" : "w-[calc(100%-48px)] pr-3 @[960px]:w-full @[960px]:pr-0" : d > 1 ? "w-full @[960px]:w-[calc((100%-48px)/3)]" : "w-full"
|
|
91
92
|
),
|
|
92
93
|
children: r.href ? /* @__PURE__ */ t("a", { href: r.href, className: "block", children: /* @__PURE__ */ t(
|
|
93
94
|
"img",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as n, jsx as t, Fragment as b } from "react/jsx-runtime";
|
|
2
3
|
import * as x from "react";
|
|
3
4
|
import y from "iconsax-reactjs/dist/esm/ArrowLeft2.js";
|
|
4
5
|
import g from "iconsax-reactjs/dist/esm/ArrowRight2.js";
|
|
5
|
-
import { cn as
|
|
6
|
+
import { cn as o } from "../../lib/utils.js";
|
|
6
7
|
function P({
|
|
7
8
|
images: r,
|
|
8
9
|
alts: c,
|
|
@@ -24,14 +25,14 @@ function P({
|
|
|
24
25
|
"16:9": "aspect-video",
|
|
25
26
|
auto: ""
|
|
26
27
|
}[h];
|
|
27
|
-
return v === "pc-detail" ? /* @__PURE__ */
|
|
28
|
+
return v === "pc-detail" ? /* @__PURE__ */ n(
|
|
28
29
|
"div",
|
|
29
30
|
{
|
|
30
31
|
"data-slot": "image-gallery",
|
|
31
|
-
className:
|
|
32
|
+
className: o("flex flex-row-reverse gap-6", i),
|
|
32
33
|
...d,
|
|
33
34
|
children: [
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ n("div", { className: o("relative min-w-0 grow overflow-hidden rounded-lg", u), children: [
|
|
35
36
|
/* @__PURE__ */ t(
|
|
36
37
|
"div",
|
|
37
38
|
{
|
|
@@ -48,7 +49,7 @@ function P({
|
|
|
48
49
|
))
|
|
49
50
|
}
|
|
50
51
|
),
|
|
51
|
-
r.length > 1 && /* @__PURE__ */
|
|
52
|
+
r.length > 1 && /* @__PURE__ */ n("span", { className: "absolute bottom-2 right-2 rounded-full bg-[var(--Overlay-Medium)] px-2 py-0.5 typo-label-xs text-[var(--Text-on-Inverse)]", children: [
|
|
52
53
|
a + 1,
|
|
53
54
|
" / ",
|
|
54
55
|
r.length
|
|
@@ -60,7 +61,7 @@ function P({
|
|
|
60
61
|
type: "button",
|
|
61
62
|
onClick: () => s(e),
|
|
62
63
|
onMouseOver: () => s(e),
|
|
63
|
-
className:
|
|
64
|
+
className: o(
|
|
64
65
|
"size-16 shrink-0 overflow-hidden rounded-lg border-2 transition-colors",
|
|
65
66
|
e === a ? "border-[var(--Border-Accent-Primary)]" : "border-transparent opacity-60 hover:opacity-100"
|
|
66
67
|
),
|
|
@@ -77,14 +78,14 @@ function P({
|
|
|
77
78
|
)) })
|
|
78
79
|
]
|
|
79
80
|
}
|
|
80
|
-
) : /* @__PURE__ */
|
|
81
|
+
) : /* @__PURE__ */ n(
|
|
81
82
|
"div",
|
|
82
83
|
{
|
|
83
84
|
"data-slot": "image-gallery",
|
|
84
|
-
className:
|
|
85
|
+
className: o("space-y-2", i),
|
|
85
86
|
...d,
|
|
86
87
|
children: [
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ n("div", { className: o("relative w-full overflow-hidden", u), children: [
|
|
88
89
|
/* @__PURE__ */ t(
|
|
89
90
|
"div",
|
|
90
91
|
{
|
|
@@ -101,7 +102,7 @@ function P({
|
|
|
101
102
|
))
|
|
102
103
|
}
|
|
103
104
|
),
|
|
104
|
-
r.length > 1 && /* @__PURE__ */
|
|
105
|
+
r.length > 1 && /* @__PURE__ */ n(b, { children: [
|
|
105
106
|
/* @__PURE__ */ t(
|
|
106
107
|
"button",
|
|
107
108
|
{
|
|
@@ -123,7 +124,7 @@ function P({
|
|
|
123
124
|
}
|
|
124
125
|
)
|
|
125
126
|
] }),
|
|
126
|
-
r.length > 1 && /* @__PURE__ */
|
|
127
|
+
r.length > 1 && /* @__PURE__ */ n("span", { className: "absolute bottom-2 right-2 rounded-full bg-[var(--Overlay-Medium)] px-2 py-0.5 typo-label-xs text-[var(--Text-on-Inverse)]", children: [
|
|
127
128
|
a + 1,
|
|
128
129
|
" / ",
|
|
129
130
|
r.length
|
|
@@ -139,7 +140,7 @@ function P({
|
|
|
139
140
|
children: /* @__PURE__ */ t(
|
|
140
141
|
"span",
|
|
141
142
|
{
|
|
142
|
-
className:
|
|
143
|
+
className: o(
|
|
143
144
|
"h-1.5 shrink-0 rounded-full transition-all",
|
|
144
145
|
e === a ? "w-4 bg-[var(--Brand-Cake-Orange)]" : "w-1.5 bg-[var(--Text-Low-Emphasis)]/30"
|
|
145
146
|
)
|
|
@@ -153,7 +154,7 @@ function P({
|
|
|
153
154
|
{
|
|
154
155
|
type: "button",
|
|
155
156
|
onClick: () => s(e),
|
|
156
|
-
className:
|
|
157
|
+
className: o(
|
|
157
158
|
"size-14 shrink-0 overflow-hidden rounded-md border-2 transition-colors",
|
|
158
159
|
e === a ? "border-[var(--Brand-Cake-Orange)]" : "border-transparent opacity-60 hover:opacity-100"
|
|
159
160
|
),
|