@cakejp/design-system 0.19.0 → 0.20.1
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 +42 -0
- package/CLAUDE.md +1 -0
- package/bin/init.js +191 -28
- package/contracts/components.json +43 -7
- package/contracts/composition.json +1 -1
- package/contracts/rules.json +1 -1
- package/contracts/screen-patterns.json +1 -1
- package/dist/components/ec/order-summary.js +16 -15
- package/dist/components/ec/product-card.js +1 -1
- package/dist/components/foundations/alert-dialog.js +7 -7
- package/dist/components/foundations/data-table.js +490 -16
- package/dist/components/foundations/dialog.js +13 -13
- package/dist/components/foundations/drawer.js +5 -5
- package/dist/components/foundations/sheet.js +7 -7
- package/dist/components/primitives/admin-header.js +1 -1
- package/dist/components/primitives/admin-side-nav.js +195 -86
- package/dist/components/primitives/bottom-tab-bar.js +20 -20
- package/dist/components/primitives/header.js +43 -37
- package/dist/components/primitives/image-uploader.js +40 -19
- package/dist/components/primitives/sticky-action-bar.js +2 -1
- package/dist/index.css +1 -1
- package/dist/index.js +817 -476
- package/dist/types/components/primitives/admin-side-nav.d.ts +3 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/lib/link-component.d.ts +9 -0
- package/package.json +2 -2
- package/src/components/COMPONENT_LOOKUP.md +2 -2
- package/src/preset-standalone.css +2 -0
- package/src/preset.css +13 -3
- package/src/styles/semantic.css +10 -0
- package/templates/AGENTS.md +4 -2
- package/templates/AGENTS.stub.md +25 -0
- package/templates/CLAUDE.md +4 -2
- package/templates/CLAUDE.stub.md +25 -0
- package/tokens.json +9 -0
|
@@ -3,7 +3,7 @@ import "react";
|
|
|
3
3
|
import { XIcon as h } from "lucide-react";
|
|
4
4
|
import { Dialog as a } from "radix-ui";
|
|
5
5
|
import { cn as r } from "../../lib/utils.js";
|
|
6
|
-
function
|
|
6
|
+
function y({ ...t }) {
|
|
7
7
|
return /* @__PURE__ */ e(a.Root, { "data-slot": "sheet", ...t });
|
|
8
8
|
}
|
|
9
9
|
function N({
|
|
@@ -60,7 +60,7 @@ function D({
|
|
|
60
60
|
l || s.preventDefault(), c?.(s);
|
|
61
61
|
},
|
|
62
62
|
className: r(
|
|
63
|
-
"fixed z-[var(--Z-Modal)] flex flex-col gap-4 border-[var(--Border-Medium-Emphasis)] bg-
|
|
63
|
+
"fixed z-[var(--Z-Modal)] flex flex-col gap-4 border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Elevated)] shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-[var(--Motion-Duration-Slow)] data-[state=open]:animate-in data-[state=open]:duration-[var(--Motion-Duration-Slower)]",
|
|
64
64
|
n === "right" && "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
|
|
65
65
|
n === "left" && "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
66
66
|
n === "top" && "inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
@@ -99,7 +99,7 @@ function C({ className: t, ...o }) {
|
|
|
99
99
|
}
|
|
100
100
|
);
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function E({
|
|
103
103
|
className: t,
|
|
104
104
|
...o
|
|
105
105
|
}) {
|
|
@@ -112,7 +112,7 @@ function M({
|
|
|
112
112
|
}
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function M({
|
|
116
116
|
className: t,
|
|
117
117
|
...o
|
|
118
118
|
}) {
|
|
@@ -126,12 +126,12 @@ function O({
|
|
|
126
126
|
);
|
|
127
127
|
}
|
|
128
128
|
export {
|
|
129
|
-
|
|
129
|
+
y as Sheet,
|
|
130
130
|
w as SheetClose,
|
|
131
131
|
D as SheetContent,
|
|
132
|
-
|
|
132
|
+
M as SheetDescription,
|
|
133
133
|
C as SheetFooter,
|
|
134
134
|
T as SheetHeader,
|
|
135
|
-
|
|
135
|
+
E as SheetTitle,
|
|
136
136
|
N as SheetTrigger
|
|
137
137
|
};
|
|
@@ -6,7 +6,7 @@ function l({ brand: r, onMenuClick: a, actions: t }) {
|
|
|
6
6
|
"header",
|
|
7
7
|
{
|
|
8
8
|
"data-slot": "admin-header",
|
|
9
|
-
className: "fixed top-0 left-0 right-0 z-[var(--Z-Nav)] flex h-14 @md:h-16 items-center justify-between bg-[var(--Surface-
|
|
9
|
+
className: "fixed top-0 left-0 right-0 z-[var(--Z-Nav)] flex h-14 @md:h-16 items-center justify-between bg-[var(--Surface-Elevated)] border-b border-[var(--Border-Low-Emphasis)] px-4 @md:px-6",
|
|
10
10
|
children: [
|
|
11
11
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 @md:gap-3", children: [
|
|
12
12
|
a && /* @__PURE__ */ e(
|
|
@@ -1,127 +1,236 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import { XIcon as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { jsxs as f, Fragment as T, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
import L from "iconsax-reactjs/dist/esm/ArrowDown2.js";
|
|
5
|
+
import { XIcon as j } from "lucide-react";
|
|
6
|
+
import { DropdownMenu as B, DropdownMenuTrigger as G, DropdownMenuContent as q, DropdownMenuItem as Z } from "../foundations/dropdown-menu.js";
|
|
7
|
+
import { FOCUS_RING as U } from "../../lib/focus-ring.js";
|
|
8
|
+
import { cn as A } from "../../lib/utils.js";
|
|
9
|
+
function F(v, M) {
|
|
10
|
+
return typeof v == "function" ? v(M) : v;
|
|
9
11
|
}
|
|
10
|
-
function
|
|
11
|
-
items:
|
|
12
|
-
activeKey:
|
|
13
|
-
drawerTitle:
|
|
14
|
-
open:
|
|
15
|
-
onOpenChange:
|
|
16
|
-
ariaLabel:
|
|
12
|
+
function Y({
|
|
13
|
+
items: v,
|
|
14
|
+
activeKey: M,
|
|
15
|
+
drawerTitle: H,
|
|
16
|
+
open: z = !1,
|
|
17
|
+
onOpenChange: C,
|
|
18
|
+
ariaLabel: S = "管理メニュー"
|
|
17
19
|
}) {
|
|
18
|
-
const [
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
const [P, w] = t.useState(null), c = t.useRef(null), y = t.useRef(/* @__PURE__ */ new Set()), k = t.useRef(null), s = t.useRef(null), b = t.useRef(null), a = t.useRef(null), g = t.useRef(/* @__PURE__ */ new Map()), R = t.useRef(/* @__PURE__ */ new Map()), d = t.useRef(null), p = t.useRef(null), E = t.useRef(null), o = t.useCallback(() => {
|
|
21
|
+
p.current !== null && (clearTimeout(p.current), p.current = null);
|
|
22
|
+
}, []), i = t.useCallback(() => {
|
|
23
|
+
d.current !== null && (clearTimeout(d.current), d.current = null);
|
|
24
|
+
}, []), I = t.useCallback(
|
|
25
|
+
(e, l) => {
|
|
26
|
+
l !== "touch" && (i(), o(), d.current = setTimeout(() => {
|
|
27
|
+
s.current !== null && s.current !== e && (s.current = null, g.current.get(e)?.focus({ preventScroll: !0 })), c.current = e, y.current.add(e), w(e), d.current = null;
|
|
28
|
+
}, 80));
|
|
29
|
+
},
|
|
30
|
+
[o, i]
|
|
31
|
+
), D = t.useCallback(
|
|
32
|
+
(e) => {
|
|
33
|
+
i(), o(), p.current = setTimeout(() => {
|
|
34
|
+
w((l) => l === e ? null : l), p.current = null;
|
|
35
|
+
}, 120);
|
|
36
|
+
},
|
|
37
|
+
[o, i]
|
|
38
|
+
), O = t.useCallback(() => {
|
|
39
|
+
i(), o(), c.current = null, y.current.clear(), k.current = null, s.current = null, b.current = null, a.current = null, w(null);
|
|
40
|
+
}, [o, i]);
|
|
41
|
+
return t.useEffect(
|
|
42
|
+
() => () => {
|
|
43
|
+
d.current !== null && clearTimeout(d.current), p.current !== null && clearTimeout(p.current), k.current = null, s.current = null, b.current = null, a.current = null, g.current.clear(), R.current.clear();
|
|
44
|
+
},
|
|
45
|
+
[]
|
|
46
|
+
), t.useEffect(() => {
|
|
47
|
+
const e = E.current;
|
|
48
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
49
|
+
const l = () => {
|
|
50
|
+
const u = e.getBoundingClientRect();
|
|
51
|
+
(getComputedStyle(e).display === "none" || u.width === 0 || u.height === 0) && O();
|
|
52
|
+
}, h = new ResizeObserver(l);
|
|
53
|
+
return h.observe(e), l(), () => h.disconnect();
|
|
54
|
+
}, [O]), /* @__PURE__ */ f(T, { children: [
|
|
55
|
+
/* @__PURE__ */ n(
|
|
21
56
|
"nav",
|
|
22
57
|
{
|
|
58
|
+
ref: E,
|
|
23
59
|
"data-slot": "admin-side-nav",
|
|
24
|
-
"aria-label":
|
|
25
|
-
className: "hidden @md:flex fixed left-0 top-16 bottom-0 z-[var(--Z-Sticky)] w-[72px] flex-col items-center bg-[var(--Surface-
|
|
26
|
-
children:
|
|
27
|
-
const
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
60
|
+
"aria-label": S,
|
|
61
|
+
className: "hidden @md:flex fixed left-0 top-16 bottom-0 z-[var(--Z-Sticky)] w-[72px] flex-col items-center bg-[var(--Surface-Elevated)] border-r border-[var(--Border-Low-Emphasis)]",
|
|
62
|
+
children: v.map((e) => {
|
|
63
|
+
const l = M === e.key, h = !!e.subMenus && e.subMenus.length > 0;
|
|
64
|
+
return /* @__PURE__ */ n("div", { className: "relative", children: (() => {
|
|
65
|
+
const u = A(
|
|
66
|
+
"flex h-16 w-16 flex-col items-center justify-center gap-1 rounded-md transition-colors",
|
|
67
|
+
l ? "text-[var(--Text-Accent-Primary)]" : "text-[var(--Text-Medium-Emphasis)] hover:text-[var(--Text-High-Emphasis)]",
|
|
68
|
+
U
|
|
69
|
+
), m = /* @__PURE__ */ f(T, { children: [
|
|
70
|
+
F(e.icon, { active: l, placement: "rail" }),
|
|
71
|
+
/* @__PURE__ */ n("span", { className: "max-w-12 text-center typo-label-xs", children: e.label })
|
|
72
|
+
] });
|
|
73
|
+
return h ? /* @__PURE__ */ f(
|
|
74
|
+
B,
|
|
75
|
+
{
|
|
76
|
+
modal: !1,
|
|
77
|
+
open: P === e.key,
|
|
78
|
+
onOpenChange: (r) => {
|
|
79
|
+
o(), r ? (a.current === e.key && (a.current = null), c.current = null, y.current.delete(e.key), w(e.key)) : w(
|
|
80
|
+
(x) => x === e.key ? null : x
|
|
81
|
+
);
|
|
82
|
+
},
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ n(G, { asChild: !0, children: /* @__PURE__ */ n(
|
|
85
|
+
"button",
|
|
45
86
|
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
87
|
+
ref: (r) => {
|
|
88
|
+
r ? g.current.set(e.key, r) : g.current.delete(e.key);
|
|
89
|
+
},
|
|
90
|
+
type: "button",
|
|
91
|
+
className: u,
|
|
92
|
+
onFocus: () => {
|
|
93
|
+
i(), k.current = e.key, c.current === e.key && (c.current = null), y.current.delete(e.key);
|
|
94
|
+
},
|
|
95
|
+
onBlur: () => {
|
|
96
|
+
k.current === e.key && (k.current = null);
|
|
97
|
+
},
|
|
98
|
+
onPointerEnter: (r) => {
|
|
99
|
+
k.current === e.key || b.current === e.key || I(e.key, r.pointerType);
|
|
100
|
+
},
|
|
101
|
+
onPointerDownCapture: () => {
|
|
102
|
+
i(), P !== e.key && (s.current = e.key);
|
|
103
|
+
},
|
|
104
|
+
onPointerLeave: () => {
|
|
105
|
+
b.current === e.key && (b.current = null), D(e.key);
|
|
106
|
+
},
|
|
107
|
+
children: m
|
|
50
108
|
}
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
109
|
+
) }),
|
|
110
|
+
/* @__PURE__ */ n(
|
|
111
|
+
q,
|
|
112
|
+
{
|
|
113
|
+
side: "right",
|
|
114
|
+
align: "start",
|
|
115
|
+
sideOffset: 0,
|
|
116
|
+
collisionPadding: 8,
|
|
117
|
+
className: "w-[240px] rounded-2xl p-2 shadow-menu",
|
|
118
|
+
onPointerEnter: o,
|
|
119
|
+
onPointerLeave: () => D(e.key),
|
|
120
|
+
onPointerMoveCapture: (r) => {
|
|
121
|
+
c.current === e.key && r.preventDefault();
|
|
122
|
+
},
|
|
123
|
+
onInteractOutside: (r) => {
|
|
124
|
+
const x = g.current.get(e.key);
|
|
125
|
+
s.current === e.key && r.target instanceof Node && !x?.contains(r.target) && (a.current = e.key);
|
|
126
|
+
},
|
|
127
|
+
onOpenAutoFocus: (r) => {
|
|
128
|
+
c.current === e.key ? r.preventDefault() : s.current === e.key && (r.preventDefault(), requestAnimationFrame(() => {
|
|
129
|
+
R.current.get(e.key)?.focus();
|
|
130
|
+
}));
|
|
131
|
+
},
|
|
132
|
+
onCloseAutoFocus: (r) => {
|
|
133
|
+
y.current.has(e.key) && (r.preventDefault(), y.current.delete(e.key), c.current === e.key && (c.current = null)), s.current === e.key && (r.preventDefault(), s.current = null, a.current !== e.key && (b.current = e.key, requestAnimationFrame(() => {
|
|
134
|
+
g.current.get(e.key)?.focus();
|
|
135
|
+
}))), a.current === e.key && (a.current = null);
|
|
136
|
+
},
|
|
137
|
+
children: e.subMenus.map((r, x) => /* @__PURE__ */ n(
|
|
138
|
+
Z,
|
|
139
|
+
{
|
|
140
|
+
asChild: !0,
|
|
141
|
+
className: "min-h-11 px-4",
|
|
142
|
+
onPointerLeave: (N) => {
|
|
143
|
+
c.current === e.key && N.preventDefault();
|
|
144
|
+
},
|
|
145
|
+
children: /* @__PURE__ */ n(
|
|
146
|
+
"a",
|
|
147
|
+
{
|
|
148
|
+
ref: x === 0 ? (N) => {
|
|
149
|
+
N ? R.current.set(
|
|
150
|
+
e.key,
|
|
151
|
+
N
|
|
152
|
+
) : R.current.delete(e.key);
|
|
153
|
+
} : void 0,
|
|
154
|
+
href: r.href,
|
|
155
|
+
children: r.label
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
},
|
|
159
|
+
r.label
|
|
160
|
+
))
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
) : e.href ? /* @__PURE__ */ n(
|
|
166
|
+
"a",
|
|
167
|
+
{
|
|
168
|
+
href: e.href,
|
|
169
|
+
className: u,
|
|
170
|
+
"aria-current": l ? "page" : void 0,
|
|
171
|
+
children: m
|
|
172
|
+
}
|
|
173
|
+
) : /* @__PURE__ */ n("button", { type: "button", className: u, children: m });
|
|
174
|
+
})() }, e.key);
|
|
66
175
|
})
|
|
67
176
|
}
|
|
68
177
|
),
|
|
69
|
-
|
|
70
|
-
/* @__PURE__ */
|
|
178
|
+
z && /* @__PURE__ */ f("div", { className: "fixed inset-0 z-[var(--Z-Overlay)] @md:hidden", children: [
|
|
179
|
+
/* @__PURE__ */ n(
|
|
71
180
|
"div",
|
|
72
181
|
{
|
|
73
182
|
className: "absolute inset-0 bg-[var(--Primitive-Black-alpha-1000)]/40",
|
|
74
|
-
onClick: () =>
|
|
183
|
+
onClick: () => C?.(!1)
|
|
75
184
|
}
|
|
76
185
|
),
|
|
77
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ f(
|
|
78
187
|
"nav",
|
|
79
188
|
{
|
|
80
|
-
"aria-label":
|
|
189
|
+
"aria-label": S,
|
|
81
190
|
className: "absolute left-0 top-0 h-full w-[280px] bg-[var(--Surface-Primary)] shadow-lg overflow-y-auto dark:bg-[var(--Primitive-Gray-900)]",
|
|
82
191
|
children: [
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ f("div", { className: "flex items-center justify-between px-4 py-3", children: [
|
|
193
|
+
/* @__PURE__ */ n("span", { className: "typo-label-md text-[var(--Text-High-Emphasis)]", children: H }),
|
|
194
|
+
/* @__PURE__ */ n(
|
|
86
195
|
"button",
|
|
87
196
|
{
|
|
88
|
-
onClick: () =>
|
|
197
|
+
onClick: () => C?.(!1),
|
|
89
198
|
className: "flex size-10 shrink-0 items-center justify-center rounded-full text-[var(--Text-Low-Emphasis)] transition-colors hover:bg-[var(--Surface-Tertiary)] hover:text-[var(--Text-High-Emphasis)] focus-visible:ring-2 focus-visible:ring-[var(--Focus-High-Emphasis)] focus-visible:outline-hidden",
|
|
90
199
|
"aria-label": "閉じる",
|
|
91
|
-
children: /* @__PURE__ */
|
|
200
|
+
children: /* @__PURE__ */ n(j, { className: "size-5" })
|
|
92
201
|
}
|
|
93
202
|
)
|
|
94
203
|
] }),
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
return /* @__PURE__ */
|
|
204
|
+
v.map((e) => {
|
|
205
|
+
const l = M === e.key, h = !!e.subMenus && e.subMenus.length > 0;
|
|
206
|
+
return /* @__PURE__ */ f("div", { children: [
|
|
98
207
|
(() => {
|
|
99
|
-
const
|
|
208
|
+
const u = A(
|
|
100
209
|
"flex w-full items-center gap-3 px-4 py-3 transition-colors",
|
|
101
|
-
|
|
102
|
-
),
|
|
103
|
-
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
|
|
210
|
+
l ? "text-[var(--Text-Accent-Primary)] bg-[var(--Surface-Accent-Primary-Light)]" : "text-[var(--Text-High-Emphasis)] hover:bg-[var(--Surface-Secondary)]"
|
|
211
|
+
), m = /* @__PURE__ */ f(T, { children: [
|
|
212
|
+
F(e.icon, { active: l, placement: "drawer" }),
|
|
213
|
+
/* @__PURE__ */ n("span", { className: "typo-label-md", children: e.label }),
|
|
214
|
+
h && /* @__PURE__ */ n(L, { size: 16, className: "ml-auto text-[var(--Text-Low-Emphasis)]" })
|
|
106
215
|
] });
|
|
107
|
-
return e.href ? /* @__PURE__ */
|
|
216
|
+
return e.href ? /* @__PURE__ */ n(
|
|
108
217
|
"a",
|
|
109
218
|
{
|
|
110
219
|
href: e.href,
|
|
111
|
-
className:
|
|
112
|
-
"aria-current":
|
|
113
|
-
children:
|
|
220
|
+
className: u,
|
|
221
|
+
"aria-current": l ? "page" : void 0,
|
|
222
|
+
children: m
|
|
114
223
|
}
|
|
115
|
-
) : /* @__PURE__ */
|
|
224
|
+
) : /* @__PURE__ */ n("button", { type: "button", className: u, children: m });
|
|
116
225
|
})(),
|
|
117
|
-
|
|
226
|
+
h && /* @__PURE__ */ n("div", { className: "bg-[var(--Surface-Secondary)] dark:bg-[var(--Primitive-Gray-900)]", children: e.subMenus.map((u) => /* @__PURE__ */ n(
|
|
118
227
|
"a",
|
|
119
228
|
{
|
|
120
|
-
href:
|
|
229
|
+
href: u.href,
|
|
121
230
|
className: "flex min-h-11 items-center px-12 py-2.5 typo-body-md text-[var(--Text-Medium-Emphasis)] hover:text-[var(--Text-High-Emphasis)]",
|
|
122
|
-
children:
|
|
231
|
+
children: u.label
|
|
123
232
|
},
|
|
124
|
-
|
|
233
|
+
u.label
|
|
125
234
|
)) })
|
|
126
235
|
] }, e.key);
|
|
127
236
|
})
|
|
@@ -132,5 +241,5 @@ function M({
|
|
|
132
241
|
] });
|
|
133
242
|
}
|
|
134
243
|
export {
|
|
135
|
-
|
|
244
|
+
Y as AdminSideNav
|
|
136
245
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as o, jsx as
|
|
1
|
+
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { cn as a } from "../../lib/utils.js";
|
|
4
4
|
import { NotificationBadge as d } from "./notification-badge.js";
|
|
@@ -6,7 +6,7 @@ function x({
|
|
|
6
6
|
className: n,
|
|
7
7
|
items: s,
|
|
8
8
|
banner: t,
|
|
9
|
-
...
|
|
9
|
+
...c
|
|
10
10
|
}) {
|
|
11
11
|
return /* @__PURE__ */ o(
|
|
12
12
|
"nav",
|
|
@@ -14,12 +14,12 @@ function x({
|
|
|
14
14
|
"data-slot": "bottom-tab-bar",
|
|
15
15
|
"aria-label": "メインナビゲーション",
|
|
16
16
|
className: a(
|
|
17
|
-
"fixed inset-x-0 bottom-0 z-[var(--Z-Floating)] border-t border-[var(--Border-Low-Emphasis)] bg-[var(--Surface-
|
|
17
|
+
"fixed inset-x-0 bottom-0 z-[var(--Z-Floating)] border-t border-[var(--Border-Low-Emphasis)] bg-[var(--Surface-Elevated)] pb-[env(safe-area-inset-bottom)] @md:hidden",
|
|
18
18
|
n
|
|
19
19
|
),
|
|
20
|
-
...
|
|
20
|
+
...c,
|
|
21
21
|
children: [
|
|
22
|
-
t && /* @__PURE__ */
|
|
22
|
+
t && /* @__PURE__ */ r(
|
|
23
23
|
"div",
|
|
24
24
|
{
|
|
25
25
|
"data-slot": "bottom-tab-bar-banner",
|
|
@@ -27,49 +27,49 @@ function x({
|
|
|
27
27
|
children: t
|
|
28
28
|
}
|
|
29
29
|
),
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
const
|
|
30
|
+
/* @__PURE__ */ r("div", { className: "flex h-[52px] items-center justify-around px-1 @sm:px-4", children: s.map((e) => {
|
|
31
|
+
const i = e.href ? "a" : "button", l = e.href ? { href: e.href } : { type: "button", onClick: e.onClick };
|
|
32
32
|
return /* @__PURE__ */ o(
|
|
33
|
-
|
|
33
|
+
i,
|
|
34
34
|
{
|
|
35
35
|
className: a(
|
|
36
36
|
"relative flex flex-1 flex-col items-center gap-0.5 pb-1 pt-0.5 transition-colors min-w-0",
|
|
37
|
-
|
|
37
|
+
e.isActive ? "text-[var(--Text-Accent-Primary)]" : "text-[var(--Text-High-Emphasis)]"
|
|
38
38
|
),
|
|
39
|
-
"aria-current":
|
|
39
|
+
"aria-current": e.isActive ? "page" : void 0,
|
|
40
40
|
...l,
|
|
41
41
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ r(
|
|
43
43
|
"span",
|
|
44
44
|
{
|
|
45
45
|
className: a(
|
|
46
46
|
"relative flex h-7 w-14 shrink-0 items-center justify-center rounded-full overflow-visible transition-colors",
|
|
47
|
-
|
|
47
|
+
e.isActive && "bg-[var(--Surface-Accent-Primary-Light)]"
|
|
48
48
|
),
|
|
49
|
-
children: /* @__PURE__ */
|
|
49
|
+
children: /* @__PURE__ */ r(
|
|
50
50
|
d,
|
|
51
51
|
{
|
|
52
|
-
count:
|
|
52
|
+
count: e.badgeCount,
|
|
53
53
|
size: "md",
|
|
54
|
-
hidden:
|
|
55
|
-
children:
|
|
54
|
+
hidden: e.badgeCount == null || e.badgeCount <= 0,
|
|
55
|
+
children: e.isActive && e.activeIcon ? e.activeIcon : e.icon
|
|
56
56
|
}
|
|
57
57
|
)
|
|
58
58
|
}
|
|
59
59
|
),
|
|
60
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ r(
|
|
61
61
|
"span",
|
|
62
62
|
{
|
|
63
63
|
className: a(
|
|
64
64
|
"truncate max-w-full px-0.5 text-center",
|
|
65
|
-
|
|
65
|
+
e.isActive ? "typo-label-xs" : "typo-body-xs"
|
|
66
66
|
),
|
|
67
|
-
children:
|
|
67
|
+
children: e.label
|
|
68
68
|
}
|
|
69
69
|
)
|
|
70
70
|
]
|
|
71
71
|
},
|
|
72
|
-
|
|
72
|
+
e.label
|
|
73
73
|
);
|
|
74
74
|
}) })
|
|
75
75
|
]
|