@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
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as E, jsx as t, Fragment as q } from "react/jsx-runtime";
|
|
3
3
|
import * as n from "react";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import B from "iconsax-reactjs/dist/esm/ArrowLeft2.js";
|
|
5
|
+
import G from "iconsax-reactjs/dist/esm/ArrowRight2.js";
|
|
6
6
|
import { cn as l } from "../../lib/utils.js";
|
|
7
|
-
import { FOCUS_RING_ONLY as
|
|
7
|
+
import { FOCUS_RING_ONLY as x } from "../../lib/focus-ring.js";
|
|
8
8
|
import { usePrefersReducedMotion as _ } from "../../lib/use-prefers-reduced-motion.js";
|
|
9
9
|
function J({
|
|
10
|
-
images:
|
|
11
|
-
aspectRatio:
|
|
12
|
-
showDots:
|
|
13
|
-
showArrows:
|
|
10
|
+
images: v,
|
|
11
|
+
aspectRatio: b = "banner",
|
|
12
|
+
showDots: z = !0,
|
|
13
|
+
showArrows: L = !0,
|
|
14
14
|
autoPlay: h = 0,
|
|
15
15
|
peek: c = !1,
|
|
16
16
|
pcSlidesPerView: u = 1,
|
|
17
17
|
centeredSlides: d = !1,
|
|
18
|
-
linkComponent:
|
|
19
|
-
className:
|
|
20
|
-
...
|
|
18
|
+
linkComponent: j,
|
|
19
|
+
className: A,
|
|
20
|
+
...O
|
|
21
21
|
}) {
|
|
22
|
-
const
|
|
22
|
+
const T = j ?? "a", p = n.useRef(null), [s, F] = n.useState(0), f = _(), a = v.length, y = b === "square" ? "aspect-square" : b === "video" ? "aspect-video" : b === "ogp" ? "aspect-[1.91/1]" : "aspect-[311/162.5]";
|
|
23
23
|
n.useEffect(() => {
|
|
24
24
|
const e = p.current;
|
|
25
25
|
if (!e) return;
|
|
26
26
|
let r = 0;
|
|
27
27
|
const o = () => {
|
|
28
28
|
cancelAnimationFrame(r), r = requestAnimationFrame(() => {
|
|
29
|
-
const
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
}),
|
|
29
|
+
const N = Array.from(e.querySelectorAll("[data-slide]")), R = N[0]?.offsetLeft ?? 0;
|
|
30
|
+
let w = 0, I = Number.POSITIVE_INFINITY;
|
|
31
|
+
N.forEach((k, M) => {
|
|
32
|
+
const C = Math.abs(k.offsetLeft - R - e.scrollLeft);
|
|
33
|
+
C < I && (I = C, w = M);
|
|
34
|
+
}), F(w);
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
o(), e.addEventListener("scroll", o, { passive: !0 });
|
|
@@ -51,24 +51,24 @@ function J({
|
|
|
51
51
|
});
|
|
52
52
|
},
|
|
53
53
|
[f]
|
|
54
|
-
),
|
|
54
|
+
), g = n.useCallback(() => {
|
|
55
55
|
const e = p.current, r = e ? e.scrollLeft >= e.scrollWidth - e.clientWidth - 1 : !1;
|
|
56
56
|
m(s >= a - 1 || r ? 0 : s + 1);
|
|
57
57
|
}, [s, a, m]);
|
|
58
58
|
n.useEffect(() => {
|
|
59
59
|
if (f || h <= 0 || a <= 1) return;
|
|
60
|
-
const e = setInterval(
|
|
60
|
+
const e = setInterval(g, h);
|
|
61
61
|
return () => clearInterval(e);
|
|
62
|
-
}, [h, a, f,
|
|
63
|
-
function
|
|
62
|
+
}, [h, a, f, g]);
|
|
63
|
+
function S() {
|
|
64
64
|
m(s <= 0 ? a - 1 : s - 1);
|
|
65
65
|
}
|
|
66
|
-
return a === 0 ? null : /* @__PURE__ */
|
|
66
|
+
return a === 0 ? null : /* @__PURE__ */ E(
|
|
67
67
|
"div",
|
|
68
68
|
{
|
|
69
69
|
"data-slot": "image-carousel",
|
|
70
|
-
className: l("@container group/carousel relative",
|
|
71
|
-
...
|
|
70
|
+
className: l("@container group/carousel relative", A),
|
|
71
|
+
...O,
|
|
72
72
|
children: [
|
|
73
73
|
/* @__PURE__ */ t(
|
|
74
74
|
"div",
|
|
@@ -76,8 +76,8 @@ function J({
|
|
|
76
76
|
ref: p,
|
|
77
77
|
tabIndex: 0,
|
|
78
78
|
className: l(
|
|
79
|
-
"flex snap-x snap-mandatory overflow-x-auto scroll-smooth motion-reduce:scroll-auto scrollbar-
|
|
80
|
-
`focus-visible:outline-none ${
|
|
79
|
+
"flex snap-x snap-mandatory overflow-x-auto scroll-smooth motion-reduce:scroll-auto scrollbar-hide",
|
|
80
|
+
`focus-visible:outline-none ${x}`,
|
|
81
81
|
// peek: 端の余白 = Container の gutter(外に置いたときは 16px)。Container の中では
|
|
82
82
|
// gutter 分だけ外へはみ出して画面端までスクロールさせる。scroll-padding も同じ幅にして、
|
|
83
83
|
// スナップ後も端の余白が消えないようにする。PC (@[960px]:) では peek しないので外す
|
|
@@ -95,7 +95,7 @@ function J({
|
|
|
95
95
|
u > 1 && "@[960px]:gap-6"
|
|
96
96
|
),
|
|
97
97
|
style: { scrollbarWidth: "none", msOverflowStyle: "none" },
|
|
98
|
-
children:
|
|
98
|
+
children: v.map((e, r) => /* @__PURE__ */ t(
|
|
99
99
|
"div",
|
|
100
100
|
{
|
|
101
101
|
"data-slide": !0,
|
|
@@ -110,13 +110,13 @@ function J({
|
|
|
110
110
|
// スライドの間隔は scroller の gap-3
|
|
111
111
|
c ? u > 1 ? "w-[calc(100%-44px)] @[960px]:w-[calc((100%-48px)/3)]" : "w-[calc(100%-44px)] @[960px]:w-full" : u > 1 ? "w-full @[960px]:w-[calc((100%-48px)/3)]" : "w-full"
|
|
112
112
|
),
|
|
113
|
-
children: e.href ? /* @__PURE__ */ t(
|
|
113
|
+
children: e.href ? /* @__PURE__ */ t(T, { href: e.href, className: "block", children: /* @__PURE__ */ t(
|
|
114
114
|
"img",
|
|
115
115
|
{
|
|
116
116
|
src: e.src,
|
|
117
117
|
alt: e.alt,
|
|
118
118
|
loading: r === 0 ? "eager" : "lazy",
|
|
119
|
-
className: l("w-full rounded-md object-cover @[960px]:rounded-lg",
|
|
119
|
+
className: l("w-full rounded-md object-cover @[960px]:rounded-lg", y)
|
|
120
120
|
}
|
|
121
121
|
) }) : /* @__PURE__ */ t(
|
|
122
122
|
"img",
|
|
@@ -124,7 +124,7 @@ function J({
|
|
|
124
124
|
src: e.src,
|
|
125
125
|
alt: e.alt,
|
|
126
126
|
loading: r === 0 ? "eager" : "lazy",
|
|
127
|
-
className: l("w-full rounded-md object-cover @[960px]:rounded-lg",
|
|
127
|
+
className: l("w-full rounded-md object-cover @[960px]:rounded-lg", y)
|
|
128
128
|
}
|
|
129
129
|
)
|
|
130
130
|
},
|
|
@@ -132,29 +132,29 @@ function J({
|
|
|
132
132
|
))
|
|
133
133
|
}
|
|
134
134
|
),
|
|
135
|
-
|
|
135
|
+
L && a > 1 && /* @__PURE__ */ E(q, { children: [
|
|
136
136
|
/* @__PURE__ */ t(
|
|
137
137
|
"button",
|
|
138
138
|
{
|
|
139
139
|
type: "button",
|
|
140
|
-
onClick:
|
|
140
|
+
onClick: S,
|
|
141
141
|
"aria-label": "前へ",
|
|
142
|
-
className:
|
|
143
|
-
children: /* @__PURE__ */ t(
|
|
142
|
+
className: `absolute left-2 top-1/2 z-10 hidden size-10 -translate-y-1/2 items-center justify-center rounded-full border border-[var(--Border-Control,var(--Border-Medium-Emphasis))] bg-[var(--Surface-Neutral-Secondary)] shadow-md transition-opacity hover:bg-[var(--Surface-Neutral-Tertiary)] @md:flex @[960px]:opacity-0 @[960px]:group-hover/carousel:opacity-100 @[960px]:focus-visible:opacity-100 focus-visible:outline-none ${x}`,
|
|
143
|
+
children: /* @__PURE__ */ t(B, { size: 20, className: "text-[var(--Object-High-Emphasis)]" })
|
|
144
144
|
}
|
|
145
145
|
),
|
|
146
146
|
/* @__PURE__ */ t(
|
|
147
147
|
"button",
|
|
148
148
|
{
|
|
149
149
|
type: "button",
|
|
150
|
-
onClick:
|
|
150
|
+
onClick: g,
|
|
151
151
|
"aria-label": "次へ",
|
|
152
|
-
className:
|
|
153
|
-
children: /* @__PURE__ */ t(
|
|
152
|
+
className: `absolute right-2 top-1/2 z-10 hidden size-10 -translate-y-1/2 items-center justify-center rounded-full border border-[var(--Border-Control,var(--Border-Medium-Emphasis))] bg-[var(--Surface-Neutral-Secondary)] shadow-md transition-opacity hover:bg-[var(--Surface-Neutral-Tertiary)] @md:flex @[960px]:opacity-0 @[960px]:group-hover/carousel:opacity-100 @[960px]:focus-visible:opacity-100 focus-visible:outline-none ${x}`,
|
|
153
|
+
children: /* @__PURE__ */ t(G, { size: 20, className: "text-[var(--Object-High-Emphasis)]" })
|
|
154
154
|
}
|
|
155
155
|
)
|
|
156
156
|
] }),
|
|
157
|
-
|
|
157
|
+
z && a > 1 && /* @__PURE__ */ t("div", { className: "mt-2 flex flex-wrap items-center justify-center gap-1.5 @[960px]:hidden", children: v.map((e, r) => /* @__PURE__ */ t(
|
|
158
158
|
"button",
|
|
159
159
|
{
|
|
160
160
|
type: "button",
|
|
@@ -162,8 +162,9 @@ function J({
|
|
|
162
162
|
"aria-label": `スライド ${r + 1}`,
|
|
163
163
|
className: l(
|
|
164
164
|
// shrink-0 必須: 空要素なので min-content 幅が 0、既定の flex-shrink:1 だとドットが消える
|
|
165
|
-
"size-2 shrink-0 rounded-full transition-colors",
|
|
166
|
-
|
|
165
|
+
"size-2 shrink-0 rounded-full transition-colors focus-visible:outline-none",
|
|
166
|
+
x,
|
|
167
|
+
r === s ? "bg-[var(--Text-High-Emphasis)]" : "bg-[var(--Surface-Neutral-Tertiary)]"
|
|
167
168
|
)
|
|
168
169
|
},
|
|
169
170
|
r
|
|
@@ -1,80 +1,82 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { cn as
|
|
7
|
-
import {
|
|
8
|
-
|
|
2
|
+
import { jsxs as o, jsx as t, Fragment as w } from "react/jsx-runtime";
|
|
3
|
+
import * as u from "react";
|
|
4
|
+
import N from "iconsax-reactjs/dist/esm/ArrowLeft2.js";
|
|
5
|
+
import k from "iconsax-reactjs/dist/esm/ArrowRight2.js";
|
|
6
|
+
import { cn as a } from "../../lib/utils.js";
|
|
7
|
+
import { FOCUS_RING_ONLY as c } from "../../lib/focus-ring.js";
|
|
8
|
+
import { reconcileImageIndex as C } from "../../lib/image-index.js";
|
|
9
|
+
function M({
|
|
9
10
|
images: r,
|
|
10
|
-
alts:
|
|
11
|
+
alts: i,
|
|
11
12
|
aspectRatio: p = "square",
|
|
12
|
-
showThumbnails:
|
|
13
|
-
showDots:
|
|
14
|
-
layout:
|
|
15
|
-
className:
|
|
16
|
-
...
|
|
13
|
+
showThumbnails: b = !1,
|
|
14
|
+
showDots: x = !0,
|
|
15
|
+
layout: y = "default",
|
|
16
|
+
className: d,
|
|
17
|
+
...f
|
|
17
18
|
}) {
|
|
18
|
-
const [
|
|
19
|
-
if (
|
|
19
|
+
const [g, h] = u.useState(0), m = u.useRef(r);
|
|
20
|
+
if (u.useEffect(() => {
|
|
20
21
|
h(
|
|
21
|
-
(l) =>
|
|
22
|
-
),
|
|
22
|
+
(l) => C(m.current, r, l)
|
|
23
|
+
), m.current = r;
|
|
23
24
|
}, [r]), r.length === 0) return null;
|
|
24
|
-
const
|
|
25
|
+
const n = Math.min(g, r.length - 1), s = (l) => {
|
|
25
26
|
const e = (l % r.length + r.length) % r.length;
|
|
26
|
-
e !==
|
|
27
|
-
},
|
|
27
|
+
e !== n && h(e);
|
|
28
|
+
}, v = {
|
|
28
29
|
square: "aspect-square",
|
|
29
30
|
"4:3": "aspect-[4/3]",
|
|
30
31
|
"16:9": "aspect-video",
|
|
31
32
|
auto: ""
|
|
32
33
|
}[p];
|
|
33
|
-
return
|
|
34
|
+
return y === "pc-detail" ? /* @__PURE__ */ o(
|
|
34
35
|
"div",
|
|
35
36
|
{
|
|
36
37
|
"data-slot": "image-gallery",
|
|
37
|
-
className:
|
|
38
|
-
...
|
|
38
|
+
className: a("flex flex-row-reverse gap-6", d),
|
|
39
|
+
...f,
|
|
39
40
|
children: [
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ o("div", { className: a("relative min-w-0 grow overflow-hidden rounded-lg", v), children: [
|
|
41
42
|
/* @__PURE__ */ t(
|
|
42
43
|
"div",
|
|
43
44
|
{
|
|
44
45
|
className: "flex h-full transition-transform duration-[var(--Motion-Duration-Slow)] ease-out",
|
|
45
|
-
style: { transform: `translateX(-${
|
|
46
|
+
style: { transform: `translateX(-${n * 100}%)` },
|
|
46
47
|
children: r.map((l, e) => /* @__PURE__ */ t(
|
|
47
48
|
"img",
|
|
48
49
|
{
|
|
49
50
|
src: l,
|
|
50
|
-
alt:
|
|
51
|
+
alt: i?.[e] ?? `画像 ${e + 1}`,
|
|
51
52
|
className: "h-full w-full shrink-0 object-contain"
|
|
52
53
|
},
|
|
53
54
|
e
|
|
54
55
|
))
|
|
55
56
|
}
|
|
56
57
|
),
|
|
57
|
-
r.length > 1 && /* @__PURE__ */
|
|
58
|
-
|
|
58
|
+
r.length > 1 && /* @__PURE__ */ o("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: [
|
|
59
|
+
n + 1,
|
|
59
60
|
" / ",
|
|
60
61
|
r.length
|
|
61
62
|
] })
|
|
62
63
|
] }),
|
|
63
|
-
r.length > 1 && /* @__PURE__ */ t("div", { className: "flex w-16 shrink-0 flex-col gap-2 overflow-y-auto scrollbar-hide", children: r.map((l, e) => /* @__PURE__ */ t(
|
|
64
|
+
r.length > 1 && /* @__PURE__ */ t("div", { className: "-m-1 box-content flex w-16 shrink-0 flex-col gap-2 overflow-y-auto p-1 scrollbar-hide", children: r.map((l, e) => /* @__PURE__ */ t(
|
|
64
65
|
"button",
|
|
65
66
|
{
|
|
66
67
|
type: "button",
|
|
67
68
|
onClick: () => s(e),
|
|
68
69
|
onMouseOver: () => s(e),
|
|
69
|
-
className:
|
|
70
|
-
"size-16 shrink-0 overflow-hidden rounded-lg border-2 transition-colors",
|
|
71
|
-
|
|
70
|
+
className: a(
|
|
71
|
+
"size-16 shrink-0 overflow-hidden rounded-lg border-2 transition-colors focus-visible:outline-none",
|
|
72
|
+
c,
|
|
73
|
+
e === n ? "border-[var(--Border-Accent-Primary)]" : "border-transparent opacity-60 hover:opacity-100"
|
|
72
74
|
),
|
|
73
75
|
children: /* @__PURE__ */ t(
|
|
74
76
|
"img",
|
|
75
77
|
{
|
|
76
78
|
src: l,
|
|
77
|
-
alt:
|
|
79
|
+
alt: i?.[e] ?? `サムネイル ${e + 1}`,
|
|
78
80
|
className: "h-full w-full object-cover"
|
|
79
81
|
}
|
|
80
82
|
)
|
|
@@ -83,91 +85,92 @@ function z({
|
|
|
83
85
|
)) })
|
|
84
86
|
]
|
|
85
87
|
}
|
|
86
|
-
) : /* @__PURE__ */
|
|
88
|
+
) : /* @__PURE__ */ o(
|
|
87
89
|
"div",
|
|
88
90
|
{
|
|
89
91
|
"data-slot": "image-gallery",
|
|
90
|
-
className:
|
|
91
|
-
...
|
|
92
|
+
className: a("space-y-2", d),
|
|
93
|
+
...f,
|
|
92
94
|
children: [
|
|
93
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ o("div", { className: a("relative w-full overflow-hidden", v), children: [
|
|
94
96
|
/* @__PURE__ */ t(
|
|
95
97
|
"div",
|
|
96
98
|
{
|
|
97
99
|
className: "flex h-full transition-transform duration-[var(--Motion-Duration-Slow)] ease-out",
|
|
98
|
-
style: { transform: `translateX(-${
|
|
100
|
+
style: { transform: `translateX(-${n * 100}%)` },
|
|
99
101
|
children: r.map((l, e) => /* @__PURE__ */ t(
|
|
100
102
|
"img",
|
|
101
103
|
{
|
|
102
104
|
src: l,
|
|
103
|
-
alt:
|
|
105
|
+
alt: i?.[e] ?? `画像 ${e + 1}`,
|
|
104
106
|
className: "h-full w-full shrink-0 object-cover"
|
|
105
107
|
},
|
|
106
108
|
e
|
|
107
109
|
))
|
|
108
110
|
}
|
|
109
111
|
),
|
|
110
|
-
r.length > 1 && /* @__PURE__ */
|
|
112
|
+
r.length > 1 && /* @__PURE__ */ o(w, { children: [
|
|
111
113
|
/* @__PURE__ */ t(
|
|
112
114
|
"button",
|
|
113
115
|
{
|
|
114
116
|
type: "button",
|
|
115
|
-
className:
|
|
116
|
-
onClick: () => s(
|
|
117
|
+
className: `absolute left-2 top-1/2 flex size-10 -translate-y-1/2 items-center justify-center rounded-full bg-[var(--Surface-Primary)]/80 shadow-sm transition-colors hover:bg-[var(--Surface-Primary)] focus-visible:outline-none ${c}`,
|
|
118
|
+
onClick: () => s(n - 1),
|
|
117
119
|
"aria-label": "前の画像",
|
|
118
|
-
children: /* @__PURE__ */ t(
|
|
120
|
+
children: /* @__PURE__ */ t(N, { size: 20, className: "text-[var(--Text-High-Emphasis)]" })
|
|
119
121
|
}
|
|
120
122
|
),
|
|
121
123
|
/* @__PURE__ */ t(
|
|
122
124
|
"button",
|
|
123
125
|
{
|
|
124
126
|
type: "button",
|
|
125
|
-
className:
|
|
126
|
-
onClick: () => s(
|
|
127
|
+
className: `absolute right-2 top-1/2 flex size-10 -translate-y-1/2 items-center justify-center rounded-full bg-[var(--Surface-Primary)]/80 shadow-sm transition-colors hover:bg-[var(--Surface-Primary)] focus-visible:outline-none ${c}`,
|
|
128
|
+
onClick: () => s(n + 1),
|
|
127
129
|
"aria-label": "次の画像",
|
|
128
|
-
children: /* @__PURE__ */ t(
|
|
130
|
+
children: /* @__PURE__ */ t(k, { size: 20, className: "text-[var(--Text-High-Emphasis)]" })
|
|
129
131
|
}
|
|
130
132
|
)
|
|
131
133
|
] }),
|
|
132
|
-
r.length > 1 && /* @__PURE__ */
|
|
133
|
-
|
|
134
|
+
r.length > 1 && /* @__PURE__ */ o("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: [
|
|
135
|
+
n + 1,
|
|
134
136
|
" / ",
|
|
135
137
|
r.length
|
|
136
138
|
] })
|
|
137
139
|
] }),
|
|
138
|
-
|
|
140
|
+
x && r.length > 1 && /* @__PURE__ */ t("div", { className: "flex flex-wrap justify-center gap-0.5", children: r.map((l, e) => /* @__PURE__ */ t(
|
|
139
141
|
"button",
|
|
140
142
|
{
|
|
141
143
|
type: "button",
|
|
142
144
|
onClick: () => s(e),
|
|
143
|
-
className:
|
|
145
|
+
className: `flex h-6 shrink-0 items-center justify-center rounded-full px-0.5 focus-visible:outline-none ${c}`,
|
|
144
146
|
"aria-label": `画像 ${e + 1}`,
|
|
145
147
|
children: /* @__PURE__ */ t(
|
|
146
148
|
"span",
|
|
147
149
|
{
|
|
148
|
-
className:
|
|
150
|
+
className: a(
|
|
149
151
|
"h-1.5 shrink-0 rounded-full transition-all",
|
|
150
|
-
e ===
|
|
152
|
+
e === n ? "w-4 bg-[var(--Brand-Cake-Orange)]" : "w-1.5 bg-[var(--Text-Low-Emphasis)]/30"
|
|
151
153
|
)
|
|
152
154
|
}
|
|
153
155
|
)
|
|
154
156
|
},
|
|
155
157
|
e
|
|
156
158
|
)) }),
|
|
157
|
-
|
|
159
|
+
b && r.length > 1 && /* @__PURE__ */ t("div", { className: "-my-1 -ml-1 flex gap-1.5 overflow-x-auto p-1 scrollbar-hide", children: r.map((l, e) => /* @__PURE__ */ t(
|
|
158
160
|
"button",
|
|
159
161
|
{
|
|
160
162
|
type: "button",
|
|
161
163
|
onClick: () => s(e),
|
|
162
|
-
className:
|
|
163
|
-
"size-14 shrink-0 overflow-hidden rounded-md border-2 transition-colors",
|
|
164
|
-
|
|
164
|
+
className: a(
|
|
165
|
+
"size-14 shrink-0 overflow-hidden rounded-md border-2 transition-colors focus-visible:outline-none",
|
|
166
|
+
c,
|
|
167
|
+
e === n ? "border-[var(--Brand-Cake-Orange)]" : "border-transparent opacity-60 hover:opacity-100"
|
|
165
168
|
),
|
|
166
169
|
children: /* @__PURE__ */ t(
|
|
167
170
|
"img",
|
|
168
171
|
{
|
|
169
172
|
src: l,
|
|
170
|
-
alt:
|
|
173
|
+
alt: i?.[e] ?? `サムネイル ${e + 1}`,
|
|
171
174
|
className: "h-full w-full object-cover"
|
|
172
175
|
}
|
|
173
176
|
)
|
|
@@ -179,5 +182,5 @@ function z({
|
|
|
179
182
|
);
|
|
180
183
|
}
|
|
181
184
|
export {
|
|
182
|
-
|
|
185
|
+
M as ImageGallery
|
|
183
186
|
};
|
|
@@ -45,7 +45,7 @@ function ee(e) {
|
|
|
45
45
|
return e >= 1 ? Number.isInteger(e) ? `${e}MB` : `${e.toFixed(1)}MB` : `${Math.round(e * 1024)}KB`;
|
|
46
46
|
}
|
|
47
47
|
const re = J(
|
|
48
|
-
"relative w-full overflow-hidden rounded-lg bg-[var(--Surface-Tertiary)]",
|
|
48
|
+
"relative w-full overflow-hidden rounded-lg bg-[var(--Surface-Neutral-Tertiary)]",
|
|
49
49
|
{
|
|
50
50
|
variants: {
|
|
51
51
|
aspect: {
|
|
@@ -131,7 +131,7 @@ function ce({
|
|
|
131
131
|
className: h(
|
|
132
132
|
re({ aspect: F, size: L }),
|
|
133
133
|
c ? "border border-[var(--Border-Low-Emphasis)]" : (
|
|
134
|
-
// 未選択の破線枠は地(Surface-Tertiary)とのコントラストを確保するため High-Emphasis。
|
|
134
|
+
// 未選択の破線枠は地(Surface-Neutral-Tertiary)とのコントラストを確保するため High-Emphasis。
|
|
135
135
|
// Medium-Emphasis はダークモードで地と同値になり枠が消える
|
|
136
136
|
"border-2 border-dashed border-[var(--Border-High-Emphasis)]"
|
|
137
137
|
)
|
|
@@ -26,7 +26,7 @@ function z({
|
|
|
26
26
|
i.map((r, a) => /* @__PURE__ */ t(
|
|
27
27
|
"div",
|
|
28
28
|
{
|
|
29
|
-
className: "relative aspect-square rounded-xl bg-[var(--Surface-Tertiary)] border border-[var(--Border-Low-Emphasis)] overflow-hidden group",
|
|
29
|
+
className: "relative aspect-square rounded-xl bg-[var(--Surface-Neutral-Tertiary)] border border-[var(--Border-Low-Emphasis)] overflow-hidden group",
|
|
30
30
|
children: [
|
|
31
31
|
/* @__PURE__ */ e(
|
|
32
32
|
"img",
|
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { DropdownMenu as
|
|
5
|
-
import d from "
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { cn as n } from "../../lib/utils.js";
|
|
4
|
+
import { DropdownMenu as l, DropdownMenuTrigger as s, DropdownMenuContent as c, DropdownMenuItem as u } from "../foundations/dropdown-menu.js";
|
|
5
|
+
import { FOCUS_RING_ONLY as d } from "../../lib/focus-ring.js";
|
|
6
|
+
import m from "iconsax-reactjs/dist/esm/More.js";
|
|
7
|
+
function v({ items: t, menuLabel: a = "メニュー", className: i }) {
|
|
8
|
+
return /* @__PURE__ */ o(l, { children: [
|
|
9
|
+
/* @__PURE__ */ r(s, { asChild: !0, children: /* @__PURE__ */ r(
|
|
9
10
|
"button",
|
|
10
11
|
{
|
|
11
|
-
className:
|
|
12
|
+
className: n(
|
|
12
13
|
// shrink-0 必須: 長いタイトルと同じ flex row に並ぶため、既定の flex-shrink:1 だと 32px が潰れる
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
// tap-target: 見た目は 32px のまま、透明な疑似要素で当たり判定だけ 44px に広げる
|
|
15
|
+
"tap-target flex items-center justify-center size-8 shrink-0 rounded-md hover:bg-[var(--Surface-Neutral-Secondary)] transition-colors focus-visible:outline-none",
|
|
16
|
+
// 枠が無いのでリングだけ(フォーカスしていないときの見た目は変わらない)
|
|
17
|
+
d,
|
|
18
|
+
i
|
|
15
19
|
),
|
|
16
|
-
"aria-label":
|
|
20
|
+
"aria-label": a,
|
|
17
21
|
"data-slot": "kebab-menu",
|
|
18
|
-
children: /* @__PURE__ */ r(
|
|
22
|
+
children: /* @__PURE__ */ r(m, { size: 16, className: "text-[var(--Text-Low-Emphasis)]" })
|
|
19
23
|
}
|
|
20
24
|
) }),
|
|
21
|
-
/* @__PURE__ */ r(
|
|
22
|
-
|
|
25
|
+
/* @__PURE__ */ r(c, { align: "end", children: t.map((e) => /* @__PURE__ */ o(
|
|
26
|
+
u,
|
|
23
27
|
{
|
|
24
28
|
onClick: e.onClick,
|
|
25
|
-
className:
|
|
29
|
+
className: n(
|
|
26
30
|
"gap-2",
|
|
27
31
|
e.destructive && "text-[var(--Text-Caution)]"
|
|
28
32
|
),
|
|
@@ -36,5 +40,5 @@ function f({ items: a, className: t }) {
|
|
|
36
40
|
] });
|
|
37
41
|
}
|
|
38
42
|
export {
|
|
39
|
-
|
|
43
|
+
v as KebabMenu
|
|
40
44
|
};
|
|
@@ -12,13 +12,13 @@ const R = "focus-visible:ring-inset forced-colors:focus-visible:-outline-offset-
|
|
|
12
12
|
].join(" ");
|
|
13
13
|
function q({
|
|
14
14
|
title: x,
|
|
15
|
-
caption:
|
|
15
|
+
caption: l,
|
|
16
16
|
rightType: o = "arrow-right",
|
|
17
|
-
rightText:
|
|
18
|
-
badgeCount:
|
|
19
|
-
toggleChecked:
|
|
20
|
-
onToggleChange:
|
|
21
|
-
leftIcon:
|
|
17
|
+
rightText: m,
|
|
18
|
+
badgeCount: d,
|
|
19
|
+
toggleChecked: N = !1,
|
|
20
|
+
onToggleChange: y,
|
|
21
|
+
leftIcon: n,
|
|
22
22
|
leftImageUrl: a,
|
|
23
23
|
size: w = "sm",
|
|
24
24
|
selected: k = !1,
|
|
@@ -29,39 +29,39 @@ function q({
|
|
|
29
29
|
className: C,
|
|
30
30
|
...i
|
|
31
31
|
}) {
|
|
32
|
-
const L = E ?? "a", h = I.useId(), r =
|
|
32
|
+
const L = E ?? "a", h = I.useId(), r = l ? "md" : !!(n || a) ? "lg" : w, u = !!c, s = !u && typeof i.onClick == "function", _ = u || s, j = s ? (t) => {
|
|
33
33
|
i.onKeyDown?.(t), !t.defaultPrevented && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.currentTarget.click());
|
|
34
34
|
} : i.onKeyDown, O = r === "lg" ? "min-h-16 py-4" : r === "md" ? "min-h-14 py-2" : "min-h-11 py-2", z = r === "lg" ? "typo-body-lg text-[var(--Text-High-Emphasis)]" : "typo-body-md text-[var(--Text-High-Emphasis)]", v = p(
|
|
35
35
|
"relative flex w-full items-center gap-2 bg-[var(--Surface-Primary)] px-4 rounded-lg",
|
|
36
36
|
O,
|
|
37
|
-
k && "bg-[var(--Surface-Secondary)]",
|
|
38
|
-
_ && "transition-colors hover:bg-[var(--Surface-Tertiary)]",
|
|
37
|
+
k && "bg-[var(--Surface-Neutral-Secondary)]",
|
|
38
|
+
_ && "transition-colors hover:bg-[var(--Surface-Neutral-Tertiary)]",
|
|
39
39
|
s && `cursor-pointer focus-visible:outline-none ${K}`,
|
|
40
40
|
s && R,
|
|
41
|
-
|
|
41
|
+
u && M,
|
|
42
42
|
C
|
|
43
43
|
), g = /* @__PURE__ */ b(H, { children: [
|
|
44
44
|
a && /* @__PURE__ */ e("div", { className: "relative shrink-0 size-8 overflow-hidden rounded-[var(--radius-sm,4px)]", children: /* @__PURE__ */ e("img", { src: a, alt: "", className: "size-full object-cover" }) }),
|
|
45
|
-
|
|
45
|
+
n && !a && /* @__PURE__ */ e("div", { className: "shrink-0 size-5 flex items-center justify-center text-[var(--Object-High-Emphasis)]", children: n }),
|
|
46
46
|
/* @__PURE__ */ b("div", { className: "flex flex-1 min-w-0 flex-col gap-0", children: [
|
|
47
47
|
/* @__PURE__ */ e("span", { id: h, className: p("truncate", z), children: x }),
|
|
48
|
-
|
|
48
|
+
l && /* @__PURE__ */ e("span", { className: "truncate typo-body-sm text-[var(--Text-Medium-Emphasis)]", children: l })
|
|
49
49
|
] }),
|
|
50
50
|
o === "arrow-right" && /* @__PURE__ */ e(T, { size: 20, className: "shrink-0 text-[var(--Object-Low-Emphasis)]" }),
|
|
51
51
|
o === "arrow-down" && /* @__PURE__ */ e(D, { size: 20, className: "shrink-0 text-[var(--Object-Low-Emphasis)]" }),
|
|
52
|
-
o === "text" &&
|
|
53
|
-
o === "badge" &&
|
|
52
|
+
o === "text" && m && /* @__PURE__ */ e("span", { className: "shrink-0 typo-body-md text-[var(--Text-High-Emphasis)]", children: m }),
|
|
53
|
+
o === "badge" && d !== void 0 && /* @__PURE__ */ e("span", { className: "flex shrink-0 h-[13px] min-w-[13px] items-center justify-center rounded-full bg-[var(--Surface-Caution,#ec0000)] px-1 typo-label-xs text-white", children: d }),
|
|
54
54
|
o === "toggle" && /* @__PURE__ */ e(
|
|
55
55
|
F,
|
|
56
56
|
{
|
|
57
|
-
checked:
|
|
58
|
-
onCheckedChange:
|
|
57
|
+
checked: N,
|
|
58
|
+
onCheckedChange: y,
|
|
59
59
|
"aria-labelledby": h,
|
|
60
60
|
className: "shrink-0"
|
|
61
61
|
}
|
|
62
62
|
),
|
|
63
63
|
S && /* @__PURE__ */ e("span", { className: "absolute left-1 top-1/2 -translate-y-1/2 size-2 rounded-full bg-[var(--Surface-Caution,#ec0000)]", "aria-hidden": !0 }),
|
|
64
|
-
f && r !== "lg" && /* @__PURE__ */ e("div", { className: "absolute bottom-0 left-4 right-4 h-px bg-[var(--Surface-Secondary)]", "aria-hidden": !0 }),
|
|
64
|
+
f && r !== "lg" && /* @__PURE__ */ e("div", { className: "absolute bottom-0 left-4 right-4 h-px bg-[var(--Surface-Neutral-Secondary)]", "aria-hidden": !0 }),
|
|
65
65
|
f && r === "lg" && /* @__PURE__ */ e("div", { className: "absolute bottom-0 left-4 right-4 h-px bg-[var(--Border-Medium-Emphasis)]", "aria-hidden": !0 })
|
|
66
66
|
] });
|
|
67
67
|
return c ? /* @__PURE__ */ e(
|