@cloudflare/kumo 2.4.1 → 2.5.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 +52 -0
- package/ai/component-registry.json +34 -4
- package/ai/component-registry.md +176 -3
- package/ai/schemas.ts +1 -0
- package/dist/.build-complete +1 -1
- package/dist/ai/schemas.d.ts +2 -0
- package/dist/ai/schemas.d.ts.map +1 -1
- package/dist/ai/schemas.js +45 -43
- package/dist/ai/schemas.js.map +1 -1
- package/dist/chunks/{SankeyChart-npoyr1j06svoxsfe.js → SankeyChart-i1m7zv0lys3j0iq6.js} +74 -69
- package/dist/chunks/SankeyChart-i1m7zv0lys3j0iq6.js.map +1 -0
- package/dist/chunks/{dialog-my9fioafdstq50mi.js → dialog-3mpu1i1wssrsz8i6.js} +11 -11
- package/dist/chunks/dialog-3mpu1i1wssrsz8i6.js.map +1 -0
- package/dist/chunks/sidebar-nbdw4rgvuabxp5nj.js +1144 -0
- package/dist/chunks/sidebar-nbdw4rgvuabxp5nj.js.map +1 -0
- package/dist/chunks/{tabs-hice1yy5q2t889z8.js → tabs-ho9t1gkq22jb855l.js} +51 -28
- package/dist/chunks/tabs-ho9t1gkq22jb855l.js.map +1 -0
- package/dist/components/chart.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/flow.js +3 -2
- package/dist/components/flow.js.map +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/index.js +5 -5
- package/dist/src/components/chart/EChart.d.ts.map +1 -1
- package/dist/src/components/flow/connectors.d.ts.map +1 -1
- package/dist/src/components/sidebar/sidebar.d.ts +14 -2
- package/dist/src/components/sidebar/sidebar.d.ts.map +1 -1
- package/dist/src/components/tabs/tabs.d.ts.map +1 -1
- package/dist/styles/kumo-binding.css +27 -20
- package/dist/styles/kumo-standalone.css +1 -1
- package/package.json +2 -2
- package/dist/chunks/SankeyChart-npoyr1j06svoxsfe.js.map +0 -1
- package/dist/chunks/dialog-my9fioafdstq50mi.js.map +0 -1
- package/dist/chunks/sidebar-hzio700cg85f7f31.js +0 -1014
- package/dist/chunks/sidebar-hzio700cg85f7f31.js.map +0 -1
- package/dist/chunks/tabs-hice1yy5q2t889z8.js.map +0 -1
|
@@ -0,0 +1,1144 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as n, jsxs as H, Fragment as Le } from "react/jsx-runtime";
|
|
3
|
+
import _, { forwardRef as x, useState as P, useCallback as w, useMemo as Z, createContext as U, useRef as B, useEffect as $, useContext as z, useId as De } from "react";
|
|
4
|
+
import { CaretRightIcon as Be } from "@phosphor-icons/react";
|
|
5
|
+
import { c as o } from "./cn-ct4n7r74mh8y0f48.js";
|
|
6
|
+
import { u as ee } from "./link-provider-mn2voeohon7cj9o4.js";
|
|
7
|
+
import { a as ze, T as Oe } from "./tooltip-ken77ixya0qpidie.js";
|
|
8
|
+
import { bz as Fe, bA as Pe, bB as Ve, bC as We, bD as He } from "./vendor-base-ui-knphx7dts1vm1x37.js";
|
|
9
|
+
const st = {
|
|
10
|
+
variant: {
|
|
11
|
+
sidebar: {
|
|
12
|
+
classes: "",
|
|
13
|
+
description: "Standard sidebar with border separator"
|
|
14
|
+
},
|
|
15
|
+
floating: {
|
|
16
|
+
classes: "",
|
|
17
|
+
description: "Floating sidebar with shadow and rounded corners"
|
|
18
|
+
},
|
|
19
|
+
inset: {
|
|
20
|
+
classes: "",
|
|
21
|
+
description: "Inset sidebar within the content area"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
collapsible: {
|
|
25
|
+
icon: {
|
|
26
|
+
classes: "",
|
|
27
|
+
description: "Collapses to show icons only"
|
|
28
|
+
},
|
|
29
|
+
offcanvas: {
|
|
30
|
+
classes: "",
|
|
31
|
+
description: "Slides off screen when collapsed"
|
|
32
|
+
},
|
|
33
|
+
none: {
|
|
34
|
+
classes: "",
|
|
35
|
+
description: "Cannot be collapsed"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
side: {
|
|
39
|
+
left: {
|
|
40
|
+
classes: "",
|
|
41
|
+
description: "Left-aligned sidebar"
|
|
42
|
+
},
|
|
43
|
+
right: {
|
|
44
|
+
classes: "",
|
|
45
|
+
description: "Right-aligned sidebar"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}, J = {
|
|
49
|
+
variant: "sidebar",
|
|
50
|
+
collapsible: "icon",
|
|
51
|
+
side: "left"
|
|
52
|
+
}, ot = {
|
|
53
|
+
width: {
|
|
54
|
+
expanded: "16.25rem",
|
|
55
|
+
icon: "57px"
|
|
56
|
+
},
|
|
57
|
+
mobile: {
|
|
58
|
+
breakpoint: 768
|
|
59
|
+
}
|
|
60
|
+
}, Ke = "16.25rem", Xe = "57px", Ge = "cubic-bezier(0.77, 0, 0.175, 1)", Ue = 250, $e = 768, qe = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
61
|
+
function je(t = $e) {
|
|
62
|
+
const [a, e] = P(() => typeof window > "u" ? !1 : window.matchMedia(`(max-width: ${t - 1}px)`).matches);
|
|
63
|
+
return $(() => {
|
|
64
|
+
const i = window.matchMedia(`(max-width: ${t - 1}px)`), s = () => e(i.matches);
|
|
65
|
+
return i.addEventListener("change", s), e(i.matches), () => i.removeEventListener("change", s);
|
|
66
|
+
}, [t]), a;
|
|
67
|
+
}
|
|
68
|
+
const te = U(null);
|
|
69
|
+
function V() {
|
|
70
|
+
const t = z(te);
|
|
71
|
+
if (!t)
|
|
72
|
+
throw new Error("useSidebar must be used within a Sidebar.Provider");
|
|
73
|
+
return t;
|
|
74
|
+
}
|
|
75
|
+
const Ye = 256, Je = 200, Qe = 480;
|
|
76
|
+
function ae({
|
|
77
|
+
defaultOpen: t = !0,
|
|
78
|
+
open: a,
|
|
79
|
+
onOpenChange: e,
|
|
80
|
+
variant: i = J.variant,
|
|
81
|
+
side: s = J.side,
|
|
82
|
+
collapsible: g = J.collapsible,
|
|
83
|
+
resizable: c = !1,
|
|
84
|
+
defaultWidth: u = Ye,
|
|
85
|
+
minWidth: l = Je,
|
|
86
|
+
maxWidth: d = Qe,
|
|
87
|
+
onWidthChange: r,
|
|
88
|
+
contained: p = !1,
|
|
89
|
+
peekable: v = !1,
|
|
90
|
+
animationDuration: f = Ue,
|
|
91
|
+
mobileBreakpoint: S,
|
|
92
|
+
children: k,
|
|
93
|
+
className: A,
|
|
94
|
+
style: h
|
|
95
|
+
}) {
|
|
96
|
+
const m = je(S), [y, L] = P(!1), [R, T] = P(u), [N, M] = P(!1), [O, C] = P(!1), F = m && a !== void 0 ? a : y, K = w(
|
|
97
|
+
(E) => {
|
|
98
|
+
L(E), m && a !== void 0 && e?.(E);
|
|
99
|
+
},
|
|
100
|
+
[m, a, e]
|
|
101
|
+
), Q = w(
|
|
102
|
+
(E) => {
|
|
103
|
+
const X = Math.min(d, Math.max(l, E));
|
|
104
|
+
T(X), r?.(X);
|
|
105
|
+
},
|
|
106
|
+
[l, d, r]
|
|
107
|
+
), [q, j] = P(t), b = a ?? q, D = w(
|
|
108
|
+
(E) => {
|
|
109
|
+
const X = typeof E == "function" ? E(b) : E;
|
|
110
|
+
e?.(X), j(X);
|
|
111
|
+
},
|
|
112
|
+
[e, b]
|
|
113
|
+
), W = w(() => {
|
|
114
|
+
m ? K(!F) : (C(!1), D((E) => !E));
|
|
115
|
+
}, [m, F, K, D]), I = w(() => {
|
|
116
|
+
v && !b && !m && C(!0);
|
|
117
|
+
}, [v, b, m]), Ee = w(() => {
|
|
118
|
+
C(!1);
|
|
119
|
+
}, []), Y = O ? "peeking" : b ? "expanded" : "collapsed", Te = c ? `${R}px` : Ke, _e = Z(
|
|
120
|
+
() => ({
|
|
121
|
+
state: Y,
|
|
122
|
+
open: b,
|
|
123
|
+
setOpen: D,
|
|
124
|
+
openMobile: F,
|
|
125
|
+
setOpenMobile: K,
|
|
126
|
+
isMobile: m,
|
|
127
|
+
toggleSidebar: W,
|
|
128
|
+
variant: i,
|
|
129
|
+
side: s,
|
|
130
|
+
collapsible: g,
|
|
131
|
+
width: R,
|
|
132
|
+
resizable: c,
|
|
133
|
+
minWidth: l,
|
|
134
|
+
maxWidth: d,
|
|
135
|
+
isResizing: N,
|
|
136
|
+
setIsResizing: M,
|
|
137
|
+
setWidth: Q,
|
|
138
|
+
isPeeking: O,
|
|
139
|
+
peekable: v,
|
|
140
|
+
startPeek: I,
|
|
141
|
+
stopPeek: Ee,
|
|
142
|
+
contained: p,
|
|
143
|
+
animationDuration: f
|
|
144
|
+
}),
|
|
145
|
+
[Y, b, F, m, R, N, O]
|
|
146
|
+
);
|
|
147
|
+
return /* @__PURE__ */ n(te.Provider, { value: _e, children: /* @__PURE__ */ n(
|
|
148
|
+
"div",
|
|
149
|
+
{
|
|
150
|
+
"data-sidebar-wrapper": "",
|
|
151
|
+
"data-state": Y,
|
|
152
|
+
"data-side": s,
|
|
153
|
+
style: {
|
|
154
|
+
"--sidebar-width": Te,
|
|
155
|
+
"--sidebar-width-icon": Xe,
|
|
156
|
+
"--sidebar-animation-duration": `${f}ms`,
|
|
157
|
+
"--sidebar-easing": Ge,
|
|
158
|
+
...h
|
|
159
|
+
},
|
|
160
|
+
className: o(
|
|
161
|
+
"group/sidebar-wrapper relative isolate flex w-full [--sidebar-bg:var(--color-kumo-base)] [--sidebar-active-bg:var(--color-kumo-tint)]",
|
|
162
|
+
!p && !m && "min-h-svh",
|
|
163
|
+
"has-data-[variant=inset]:bg-kumo-recessed",
|
|
164
|
+
N && "select-none",
|
|
165
|
+
A
|
|
166
|
+
),
|
|
167
|
+
children: k
|
|
168
|
+
}
|
|
169
|
+
) });
|
|
170
|
+
}
|
|
171
|
+
ae.displayName = "Sidebar.Provider";
|
|
172
|
+
const ie = x(
|
|
173
|
+
({ className: t, contentClassName: a, children: e, ...i }, s) => {
|
|
174
|
+
const {
|
|
175
|
+
state: g,
|
|
176
|
+
open: c,
|
|
177
|
+
isMobile: u,
|
|
178
|
+
openMobile: l,
|
|
179
|
+
setOpenMobile: d,
|
|
180
|
+
side: r,
|
|
181
|
+
variant: p,
|
|
182
|
+
collapsible: v,
|
|
183
|
+
isResizing: f,
|
|
184
|
+
resizable: S,
|
|
185
|
+
width: k,
|
|
186
|
+
isPeeking: A,
|
|
187
|
+
startPeek: h,
|
|
188
|
+
stopPeek: m,
|
|
189
|
+
contained: y
|
|
190
|
+
} = V(), L = w(
|
|
191
|
+
(b) => {
|
|
192
|
+
b && (l ? b.removeAttribute("inert") : b.setAttribute("inert", ""));
|
|
193
|
+
},
|
|
194
|
+
[l]
|
|
195
|
+
), R = w(
|
|
196
|
+
(b) => {
|
|
197
|
+
L(b), typeof s == "function" ? s(b) : s && (s.current = b);
|
|
198
|
+
},
|
|
199
|
+
[s, L]
|
|
200
|
+
), T = B(null), N = B(null), M = B(!1);
|
|
201
|
+
$(() => {
|
|
202
|
+
if (!u || !l) return;
|
|
203
|
+
const b = N.current, D = (I) => {
|
|
204
|
+
I.key === "Escape" && (M.current = !0, d(!1));
|
|
205
|
+
}, W = (I) => {
|
|
206
|
+
b && !b.contains(I.relatedTarget) && (M.current = !1, d(!1));
|
|
207
|
+
};
|
|
208
|
+
return document.addEventListener("keydown", D), b?.addEventListener("focusout", W), () => {
|
|
209
|
+
document.removeEventListener("keydown", D), b?.removeEventListener("focusout", W);
|
|
210
|
+
};
|
|
211
|
+
}, [u, l, d]), $(() => {
|
|
212
|
+
u && (l ? (T.current = document.activeElement, M.current = !1, requestAnimationFrame(() => {
|
|
213
|
+
(N.current?.querySelector(
|
|
214
|
+
qe
|
|
215
|
+
) ?? N.current)?.focus();
|
|
216
|
+
})) : M.current && T.current instanceof HTMLElement && (T.current.focus(), M.current = !1, T.current = null));
|
|
217
|
+
}, [u, l]);
|
|
218
|
+
const O = w(
|
|
219
|
+
(b) => {
|
|
220
|
+
b.currentTarget.contains(b.relatedTarget) || m();
|
|
221
|
+
},
|
|
222
|
+
[m]
|
|
223
|
+
);
|
|
224
|
+
if (v === "none")
|
|
225
|
+
return /* @__PURE__ */ n(
|
|
226
|
+
"aside",
|
|
227
|
+
{
|
|
228
|
+
ref: s,
|
|
229
|
+
"data-state": "expanded",
|
|
230
|
+
"data-side": r,
|
|
231
|
+
"data-variant": p,
|
|
232
|
+
"data-sidebar": "sidebar",
|
|
233
|
+
style: {
|
|
234
|
+
width: "var(--sidebar-width)",
|
|
235
|
+
minWidth: "var(--sidebar-width)",
|
|
236
|
+
maxWidth: "var(--sidebar-width)"
|
|
237
|
+
},
|
|
238
|
+
className: o(
|
|
239
|
+
"relative flex h-full shrink-0 grow-0 flex-col overflow-hidden bg-(--sidebar-bg) text-kumo-default",
|
|
240
|
+
p === "sidebar" && (r === "left" ? "border-r border-kumo-line" : "border-l border-kumo-line"),
|
|
241
|
+
p === "floating" && "m-2 rounded-lg border border-kumo-line shadow-lg",
|
|
242
|
+
t
|
|
243
|
+
),
|
|
244
|
+
...i,
|
|
245
|
+
children: e
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
if (u)
|
|
249
|
+
return /* @__PURE__ */ H(Le, { children: [
|
|
250
|
+
/* @__PURE__ */ n(
|
|
251
|
+
"div",
|
|
252
|
+
{
|
|
253
|
+
"data-sidebar-backdrop": "",
|
|
254
|
+
className: o(
|
|
255
|
+
y ? "absolute inset-0 z-40 bg-kumo-recessed" : "fixed inset-0 z-40 bg-kumo-recessed",
|
|
256
|
+
"transition-opacity duration-(--sidebar-animation-duration) ease-(--sidebar-easing)",
|
|
257
|
+
"motion-reduce:transition-none",
|
|
258
|
+
l ? "opacity-80" : "opacity-0 pointer-events-none"
|
|
259
|
+
),
|
|
260
|
+
onClick: () => {
|
|
261
|
+
M.current = !0, d(!1);
|
|
262
|
+
},
|
|
263
|
+
"aria-hidden": "true"
|
|
264
|
+
}
|
|
265
|
+
),
|
|
266
|
+
/* @__PURE__ */ n(
|
|
267
|
+
"nav",
|
|
268
|
+
{
|
|
269
|
+
ref: (b) => {
|
|
270
|
+
R(b), N.current = b;
|
|
271
|
+
},
|
|
272
|
+
tabIndex: -1,
|
|
273
|
+
"aria-label": "Navigation",
|
|
274
|
+
"aria-hidden": !l,
|
|
275
|
+
"data-state": l ? "expanded" : "collapsed",
|
|
276
|
+
"data-side": r,
|
|
277
|
+
"data-variant": p,
|
|
278
|
+
"data-collapsible": v,
|
|
279
|
+
"data-sidebar": "sidebar",
|
|
280
|
+
"data-mobile": "true",
|
|
281
|
+
className: o(
|
|
282
|
+
y ? "group/sidebar absolute inset-y-0 z-50 flex w-(--sidebar-width) flex-col overflow-hidden" : "group/sidebar fixed inset-y-0 z-50 flex w-(--sidebar-width) flex-col overflow-hidden",
|
|
283
|
+
"border-r border-kumo-line bg-(--sidebar-bg) text-kumo-default",
|
|
284
|
+
"transition-transform duration-(--sidebar-animation-duration) ease-(--sidebar-easing)",
|
|
285
|
+
"motion-reduce:transition-none",
|
|
286
|
+
r === "left" && "left-0",
|
|
287
|
+
r === "right" && "right-0",
|
|
288
|
+
r === "left" && (l ? "translate-x-0" : "-translate-x-full"),
|
|
289
|
+
r === "right" && (l ? "translate-x-0" : "translate-x-full"),
|
|
290
|
+
t
|
|
291
|
+
),
|
|
292
|
+
...i,
|
|
293
|
+
children: e
|
|
294
|
+
}
|
|
295
|
+
)
|
|
296
|
+
] });
|
|
297
|
+
const C = v === "icon" ? "var(--sidebar-width-icon)" : "0px", F = S ? `${k}px` : "var(--sidebar-width)", K = c ? F : C, q = c || A ? F : C, j = p === "sidebar" ? r === "left" ? "border-r border-kumo-line" : "border-l border-kumo-line" : p === "floating" ? "border border-kumo-line" : "";
|
|
298
|
+
return /* @__PURE__ */ n(
|
|
299
|
+
"aside",
|
|
300
|
+
{
|
|
301
|
+
ref: s,
|
|
302
|
+
"data-state": g,
|
|
303
|
+
"data-side": r,
|
|
304
|
+
"data-variant": p,
|
|
305
|
+
"data-collapsible": v,
|
|
306
|
+
"data-sidebar": "sidebar",
|
|
307
|
+
style: { width: K },
|
|
308
|
+
className: o(
|
|
309
|
+
"group/sidebar relative h-full shrink-0 grow-0",
|
|
310
|
+
"overflow-visible",
|
|
311
|
+
// allow content container to overlay when peeking
|
|
312
|
+
"transition-[width] duration-(--sidebar-animation-duration) ease-(--sidebar-easing)",
|
|
313
|
+
"motion-reduce:transition-none",
|
|
314
|
+
f && "transition-none!",
|
|
315
|
+
p === "floating" && "m-2 rounded-lg shadow-lg",
|
|
316
|
+
t
|
|
317
|
+
),
|
|
318
|
+
...i,
|
|
319
|
+
children: /* @__PURE__ */ n(ze, { children: (() => {
|
|
320
|
+
const b = _.Children.toArray(e), D = b.filter(
|
|
321
|
+
(I) => _.isValidElement(I) && I.type?.displayName === "Sidebar.Footer"
|
|
322
|
+
), W = b.filter(
|
|
323
|
+
(I) => !_.isValidElement(I) || I.type?.displayName !== "Sidebar.Footer"
|
|
324
|
+
);
|
|
325
|
+
return /* @__PURE__ */ H(
|
|
326
|
+
"div",
|
|
327
|
+
{
|
|
328
|
+
"data-sidebar": "content-container",
|
|
329
|
+
style: { width: q },
|
|
330
|
+
className: o(
|
|
331
|
+
"flex h-full flex-col",
|
|
332
|
+
"min-w-0 overflow-hidden whitespace-nowrap",
|
|
333
|
+
"bg-(--sidebar-bg) text-kumo-default",
|
|
334
|
+
j,
|
|
335
|
+
"transition-[width] duration-(--sidebar-animation-duration) ease-(--sidebar-easing)",
|
|
336
|
+
"motion-reduce:transition-none",
|
|
337
|
+
f && "transition-none!",
|
|
338
|
+
!c && o(
|
|
339
|
+
y ? "absolute" : "fixed",
|
|
340
|
+
"inset-y-0 z-40",
|
|
341
|
+
r === "left" && "left-0",
|
|
342
|
+
r === "right" && "right-0"
|
|
343
|
+
),
|
|
344
|
+
c && "relative",
|
|
345
|
+
a
|
|
346
|
+
),
|
|
347
|
+
children: [
|
|
348
|
+
/* @__PURE__ */ n(
|
|
349
|
+
"div",
|
|
350
|
+
{
|
|
351
|
+
"data-sidebar": "peek-zone",
|
|
352
|
+
className: "flex flex-1 flex-col min-h-0",
|
|
353
|
+
onMouseEnter: h,
|
|
354
|
+
onMouseLeave: m,
|
|
355
|
+
onFocus: h,
|
|
356
|
+
onBlur: O,
|
|
357
|
+
children: W
|
|
358
|
+
}
|
|
359
|
+
),
|
|
360
|
+
D
|
|
361
|
+
]
|
|
362
|
+
}
|
|
363
|
+
);
|
|
364
|
+
})() })
|
|
365
|
+
}
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
);
|
|
369
|
+
ie.displayName = "Sidebar";
|
|
370
|
+
const ne = x(({ className: t, ...a }, e) => /* @__PURE__ */ n(
|
|
371
|
+
"div",
|
|
372
|
+
{
|
|
373
|
+
ref: e,
|
|
374
|
+
"data-sidebar": "header",
|
|
375
|
+
className: o(
|
|
376
|
+
"flex h-[58px] shrink-0 items-center gap-1 border-b border-kumo-line",
|
|
377
|
+
"px-3 overflow-hidden",
|
|
378
|
+
t
|
|
379
|
+
),
|
|
380
|
+
...a
|
|
381
|
+
}
|
|
382
|
+
));
|
|
383
|
+
ne.displayName = "Sidebar.Header";
|
|
384
|
+
const re = x(({ className: t, children: a, ...e }, i) => /* @__PURE__ */ H(
|
|
385
|
+
Fe,
|
|
386
|
+
{
|
|
387
|
+
ref: i,
|
|
388
|
+
"data-sidebar": "content",
|
|
389
|
+
className: o("relative min-w-0 flex-1 overflow-hidden", t),
|
|
390
|
+
...e,
|
|
391
|
+
children: [
|
|
392
|
+
/* @__PURE__ */ n(
|
|
393
|
+
Pe,
|
|
394
|
+
{
|
|
395
|
+
tabIndex: -1,
|
|
396
|
+
className: o(
|
|
397
|
+
"h-full px-[11px] py-3 group-not-data-[state=collapsed]/sidebar:px-3.5",
|
|
398
|
+
"transition-[padding] duration-(--sidebar-animation-duration)",
|
|
399
|
+
"group-data-[state=collapsed]/sidebar:overflow-x-hidden!",
|
|
400
|
+
// Scroll fade via CSS mask driven by Base UI overflow CSS variables
|
|
401
|
+
"[mask-image:linear-gradient(to_bottom,transparent_0,black_min(24px,var(--scroll-area-overflow-y-start,24px)),black_calc(100%-min(24px,var(--scroll-area-overflow-y-end,24px))),transparent_100%)]"
|
|
402
|
+
),
|
|
403
|
+
children: /* @__PURE__ */ n(Ve, { className: "flex min-w-0! flex-col", children: a })
|
|
404
|
+
}
|
|
405
|
+
),
|
|
406
|
+
/* @__PURE__ */ n(
|
|
407
|
+
We,
|
|
408
|
+
{
|
|
409
|
+
orientation: "vertical",
|
|
410
|
+
className: o(
|
|
411
|
+
"flex w-1.5 touch-none select-none p-px",
|
|
412
|
+
"opacity-0 transition-opacity duration-150",
|
|
413
|
+
"data-[scrolling]:opacity-100 data-[hovering]:opacity-100"
|
|
414
|
+
),
|
|
415
|
+
children: /* @__PURE__ */ n(He, { className: "flex-1 rounded-full bg-kumo-line" })
|
|
416
|
+
}
|
|
417
|
+
)
|
|
418
|
+
]
|
|
419
|
+
}
|
|
420
|
+
));
|
|
421
|
+
re.displayName = "Sidebar.Content";
|
|
422
|
+
const se = x(({ className: t, ...a }, e) => /* @__PURE__ */ n(
|
|
423
|
+
"div",
|
|
424
|
+
{
|
|
425
|
+
ref: e,
|
|
426
|
+
"data-sidebar": "footer",
|
|
427
|
+
className: o(
|
|
428
|
+
"flex h-12 shrink-0 items-center gap-4 overflow-hidden whitespace-nowrap border-t border-kumo-line",
|
|
429
|
+
"px-[11px] group-not-data-[state=collapsed]/sidebar:px-4",
|
|
430
|
+
"bg-(--sidebar-bg)",
|
|
431
|
+
"w-(--sidebar-width)",
|
|
432
|
+
"transition-[width,padding] duration-(--sidebar-animation-duration) ease-(--sidebar-easing)",
|
|
433
|
+
"motion-reduce:transition-none",
|
|
434
|
+
"sticky bottom-0",
|
|
435
|
+
"group-data-[state=collapsed]/sidebar:w-(--sidebar-width-icon) bg-clip-padding",
|
|
436
|
+
"group-data-[state=collapsed]/sidebar:border-r group-data-[state=collapsed]/sidebar:border-kumo-line",
|
|
437
|
+
t
|
|
438
|
+
),
|
|
439
|
+
...a
|
|
440
|
+
}
|
|
441
|
+
));
|
|
442
|
+
se.displayName = "Sidebar.Footer";
|
|
443
|
+
const oe = x(({ className: t, children: a, ...e }, i) => /* @__PURE__ */ n(
|
|
444
|
+
"div",
|
|
445
|
+
{
|
|
446
|
+
ref: i,
|
|
447
|
+
"data-sidebar": "group",
|
|
448
|
+
className: o("flex min-w-0 flex-col gap-y-px", t),
|
|
449
|
+
...e,
|
|
450
|
+
children: a
|
|
451
|
+
}
|
|
452
|
+
));
|
|
453
|
+
oe.displayName = "Sidebar.Group";
|
|
454
|
+
const de = x(({ className: t, children: a, ...e }, i) => /* @__PURE__ */ n(
|
|
455
|
+
"div",
|
|
456
|
+
{
|
|
457
|
+
ref: i,
|
|
458
|
+
"data-sidebar": "group-label",
|
|
459
|
+
className: o(
|
|
460
|
+
// Grid-rows for smooth collapse animation
|
|
461
|
+
"grid overflow-hidden",
|
|
462
|
+
"transition-[grid-template-rows,margin,border-color] duration-(--sidebar-animation-duration) ease-(--sidebar-easing)",
|
|
463
|
+
// Mobile: no collapse animation — sidebar is always expanded
|
|
464
|
+
"group-data-[mobile=true]/sidebar:transition-none",
|
|
465
|
+
// Collapsed: spacer with divider line between icon groups
|
|
466
|
+
"grid-rows-[0fr] my-3 border-b border-kumo-line",
|
|
467
|
+
// First group: no spacer or divider needed
|
|
468
|
+
"[[data-sidebar=group]:first-child_&]:my-0 [[data-sidebar=group]:first-child_&]:border-transparent",
|
|
469
|
+
// Expanded: reveal the label text
|
|
470
|
+
"group-not-data-[state=collapsed]/sidebar:grid-rows-[1fr] group-not-data-[state=collapsed]/sidebar:my-0 group-not-data-[state=collapsed]/sidebar:border-transparent",
|
|
471
|
+
// Mobile: always show labels (sidebar content is always expanded on mobile)
|
|
472
|
+
"group-data-[mobile=true]/sidebar:grid-rows-[1fr] group-data-[mobile=true]/sidebar:my-0 group-data-[mobile=true]/sidebar:border-transparent",
|
|
473
|
+
t
|
|
474
|
+
),
|
|
475
|
+
...e,
|
|
476
|
+
children: /* @__PURE__ */ n("div", { className: "min-h-0 min-w-0", children: /* @__PURE__ */ n(
|
|
477
|
+
"div",
|
|
478
|
+
{
|
|
479
|
+
className: o(
|
|
480
|
+
"truncate px-3 mt-6 mb-2 text-sm font-medium text-kumo-subtle",
|
|
481
|
+
// First group: less top margin
|
|
482
|
+
"[[data-sidebar=group]:first-child_&]:mt-2"
|
|
483
|
+
),
|
|
484
|
+
children: a
|
|
485
|
+
}
|
|
486
|
+
) })
|
|
487
|
+
}
|
|
488
|
+
));
|
|
489
|
+
de.displayName = "Sidebar.GroupLabel";
|
|
490
|
+
const le = U(!1), ce = U(!1), ue = x(({ className: t, ...a }, e) => /* @__PURE__ */ n(
|
|
491
|
+
"ul",
|
|
492
|
+
{
|
|
493
|
+
ref: e,
|
|
494
|
+
"data-sidebar": "menu",
|
|
495
|
+
className: o(
|
|
496
|
+
"m-0 flex min-w-0 list-none flex-col items-stretch gap-y-px p-0",
|
|
497
|
+
t
|
|
498
|
+
),
|
|
499
|
+
...a
|
|
500
|
+
}
|
|
501
|
+
));
|
|
502
|
+
ue.displayName = "Sidebar.Menu";
|
|
503
|
+
const be = x(({ className: t, children: a, ...e }, i) => /* @__PURE__ */ n(le.Provider, { value: !0, children: /* @__PURE__ */ n(
|
|
504
|
+
"li",
|
|
505
|
+
{
|
|
506
|
+
ref: i,
|
|
507
|
+
"data-sidebar": "menu-item",
|
|
508
|
+
className: o(
|
|
509
|
+
"relative group-data-[state=collapsed]/sidebar:overflow-hidden",
|
|
510
|
+
t
|
|
511
|
+
),
|
|
512
|
+
...e,
|
|
513
|
+
children: a
|
|
514
|
+
}
|
|
515
|
+
) }));
|
|
516
|
+
be.displayName = "Sidebar.MenuItem";
|
|
517
|
+
const me = x(
|
|
518
|
+
({
|
|
519
|
+
className: t,
|
|
520
|
+
icon: a,
|
|
521
|
+
active: e = !1,
|
|
522
|
+
size: i = "base",
|
|
523
|
+
href: s,
|
|
524
|
+
target: g,
|
|
525
|
+
tooltip: c,
|
|
526
|
+
children: u,
|
|
527
|
+
...l
|
|
528
|
+
}, d) => {
|
|
529
|
+
const { state: r, peekable: p } = V(), v = ee(), f = z(le), S = a ? _.isValidElement(a) ? a : /* @__PURE__ */ n(
|
|
530
|
+
a,
|
|
531
|
+
{
|
|
532
|
+
className: o(
|
|
533
|
+
"shrink-0 opacity-40",
|
|
534
|
+
i === "base" ? "size-4" : "size-3.5"
|
|
535
|
+
)
|
|
536
|
+
}
|
|
537
|
+
) : null, k = /* @__PURE__ */ H(
|
|
538
|
+
"div",
|
|
539
|
+
{
|
|
540
|
+
className: o(
|
|
541
|
+
"flex flex-1 items-center min-w-0 gap-3",
|
|
542
|
+
"translate-x-[-3px] group-not-data-[state=collapsed]/sidebar:translate-x-0",
|
|
543
|
+
"transition-transform duration-(--sidebar-animation-duration)"
|
|
544
|
+
),
|
|
545
|
+
children: [
|
|
546
|
+
S,
|
|
547
|
+
/* @__PURE__ */ n(
|
|
548
|
+
"span",
|
|
549
|
+
{
|
|
550
|
+
className: o(
|
|
551
|
+
"flex flex-1 items-center gap-2 min-w-0 text-left overflow-hidden"
|
|
552
|
+
),
|
|
553
|
+
children: _.Children.map(
|
|
554
|
+
u,
|
|
555
|
+
(y) => typeof y == "string" || typeof y == "number" ? /* @__PURE__ */ n("span", { className: "truncate", children: y }) : y
|
|
556
|
+
)
|
|
557
|
+
}
|
|
558
|
+
)
|
|
559
|
+
]
|
|
560
|
+
}
|
|
561
|
+
), A = o(
|
|
562
|
+
// Layout
|
|
563
|
+
"group/menu-button relative flex w-full min-w-0 items-center gap-2.5 rounded-lg outline-none cursor-pointer",
|
|
564
|
+
"before:absolute before:inset-x-0 before:-inset-y-px",
|
|
565
|
+
// Sizing
|
|
566
|
+
i === "base" && "min-h-8.5 px-3 py-0 text-sm font-medium",
|
|
567
|
+
i === "sm" && "min-h-7 px-2 py-0 text-sm",
|
|
568
|
+
"text-kumo-default",
|
|
569
|
+
"transition-[color,box-shadow,outline] duration-(--sidebar-animation-duration)",
|
|
570
|
+
!e && "hover:bg-(--sidebar-active-bg)",
|
|
571
|
+
// Active state
|
|
572
|
+
e && "bg-(--sidebar-active-bg)",
|
|
573
|
+
// When a child sub-button is active, don't show active styling on the parent trigger
|
|
574
|
+
"has-[[data-active]]:bg-transparent has-[[data-active]]:hover:bg-(--sidebar-active-bg)",
|
|
575
|
+
// Focus
|
|
576
|
+
"focus:outline-none focus-visible:text-kumo-strong focus-visible:bg-(--sidebar-active-bg)",
|
|
577
|
+
t
|
|
578
|
+
);
|
|
579
|
+
let h;
|
|
580
|
+
return s ? h = /* @__PURE__ */ n(
|
|
581
|
+
v,
|
|
582
|
+
{
|
|
583
|
+
ref: d,
|
|
584
|
+
className: o(A, "no-underline!"),
|
|
585
|
+
href: s,
|
|
586
|
+
to: s,
|
|
587
|
+
target: g,
|
|
588
|
+
"data-active": e || void 0,
|
|
589
|
+
"data-sidebar": "menu-button",
|
|
590
|
+
"data-kumo-component": "Sidebar",
|
|
591
|
+
"data-kumo-part": "menu-button-link",
|
|
592
|
+
"data-size": i,
|
|
593
|
+
onClick: l.onClick,
|
|
594
|
+
children: k
|
|
595
|
+
}
|
|
596
|
+
) : h = /* @__PURE__ */ n(
|
|
597
|
+
"button",
|
|
598
|
+
{
|
|
599
|
+
ref: d,
|
|
600
|
+
type: "button",
|
|
601
|
+
className: A,
|
|
602
|
+
"data-active": e || void 0,
|
|
603
|
+
"data-sidebar": "menu-button",
|
|
604
|
+
"data-kumo-component": "Sidebar",
|
|
605
|
+
"data-kumo-part": "menu-button",
|
|
606
|
+
"data-size": i,
|
|
607
|
+
...l,
|
|
608
|
+
children: k
|
|
609
|
+
}
|
|
610
|
+
), c && (h = /* @__PURE__ */ n(
|
|
611
|
+
Oe,
|
|
612
|
+
{
|
|
613
|
+
content: r === "collapsed" && !p ? c : null,
|
|
614
|
+
side: "right",
|
|
615
|
+
render: h
|
|
616
|
+
}
|
|
617
|
+
)), f ? h : /* @__PURE__ */ n(
|
|
618
|
+
"li",
|
|
619
|
+
{
|
|
620
|
+
"data-sidebar": "menu-item",
|
|
621
|
+
className: "relative group-data-[state=collapsed]/sidebar:overflow-hidden",
|
|
622
|
+
children: h
|
|
623
|
+
}
|
|
624
|
+
);
|
|
625
|
+
}
|
|
626
|
+
);
|
|
627
|
+
me.displayName = "Sidebar.MenuButton";
|
|
628
|
+
const pe = x(({ className: t, ...a }, e) => /* @__PURE__ */ n(
|
|
629
|
+
"span",
|
|
630
|
+
{
|
|
631
|
+
ref: e,
|
|
632
|
+
"data-sidebar": "menu-badge",
|
|
633
|
+
className: o(
|
|
634
|
+
"inline-flex shrink-0 items-center rounded-full border border-dashed border-kumo-line",
|
|
635
|
+
"select-none px-1.5 py-0.5 text-[11px]/none font-medium text-kumo-strong",
|
|
636
|
+
// Hidden when collapsed
|
|
637
|
+
"group-data-[state=collapsed]/sidebar:hidden",
|
|
638
|
+
t
|
|
639
|
+
),
|
|
640
|
+
...a
|
|
641
|
+
}
|
|
642
|
+
));
|
|
643
|
+
pe.displayName = "Sidebar.MenuBadge";
|
|
644
|
+
const fe = x(({ className: t, children: a, ...e }, i) => /* @__PURE__ */ H(
|
|
645
|
+
"ul",
|
|
646
|
+
{
|
|
647
|
+
ref: i,
|
|
648
|
+
"data-sidebar": "menu-sub",
|
|
649
|
+
className: o(
|
|
650
|
+
"relative m-0 flex min-w-0 list-none flex-col gap-y-px p-0 pl-7 pr-0 overflow-hidden",
|
|
651
|
+
t
|
|
652
|
+
),
|
|
653
|
+
...e,
|
|
654
|
+
children: [
|
|
655
|
+
/* @__PURE__ */ n("div", { className: "absolute left-[19px] inset-y-px w-px bg-kumo-line z-10" }),
|
|
656
|
+
a
|
|
657
|
+
]
|
|
658
|
+
}
|
|
659
|
+
));
|
|
660
|
+
fe.displayName = "Sidebar.MenuSub";
|
|
661
|
+
const ge = x(({ className: t, children: a, ...e }, i) => /* @__PURE__ */ n(ce.Provider, { value: !0, children: /* @__PURE__ */ n(
|
|
662
|
+
"li",
|
|
663
|
+
{
|
|
664
|
+
ref: i,
|
|
665
|
+
"data-sidebar": "menu-sub-item",
|
|
666
|
+
className: o("relative", t),
|
|
667
|
+
...e,
|
|
668
|
+
children: a
|
|
669
|
+
}
|
|
670
|
+
) }));
|
|
671
|
+
ge.displayName = "Sidebar.MenuSubItem";
|
|
672
|
+
const he = x(({ className: t, active: a = !1, href: e, children: i, ...s }, g) => {
|
|
673
|
+
const c = ee(), u = z(ce), l = o(
|
|
674
|
+
"group/menu-button relative flex w-full min-w-0 items-center gap-2 rounded-lg min-h-8.5 px-3 py-0 text-sm font-medium outline-none cursor-pointer",
|
|
675
|
+
"before:absolute before:inset-x-0 before:-inset-y-px",
|
|
676
|
+
"text-kumo-default transition-[color] duration-150",
|
|
677
|
+
!a && "hover:bg-(--sidebar-active-bg)",
|
|
678
|
+
a && "bg-(--sidebar-active-bg)",
|
|
679
|
+
"focus:outline-none focus-visible:text-kumo-strong focus-visible:bg-(--sidebar-active-bg)",
|
|
680
|
+
t
|
|
681
|
+
), d = /* @__PURE__ */ n("span", { className: "flex flex-1 items-center gap-2 min-w-0 text-left overflow-hidden", children: _.Children.map(
|
|
682
|
+
i,
|
|
683
|
+
(p) => typeof p == "string" || typeof p == "number" ? /* @__PURE__ */ n("span", { className: "truncate", children: p }) : p
|
|
684
|
+
) });
|
|
685
|
+
let r;
|
|
686
|
+
return e ? r = /* @__PURE__ */ n(
|
|
687
|
+
c,
|
|
688
|
+
{
|
|
689
|
+
ref: g,
|
|
690
|
+
className: o(l, "no-underline!"),
|
|
691
|
+
href: e,
|
|
692
|
+
to: e,
|
|
693
|
+
"data-active": a || void 0,
|
|
694
|
+
"data-sidebar": "menu-sub-button",
|
|
695
|
+
"data-kumo-component": "Sidebar",
|
|
696
|
+
"data-kumo-part": "menu-sub-button-link",
|
|
697
|
+
onClick: s.onClick,
|
|
698
|
+
children: d
|
|
699
|
+
}
|
|
700
|
+
) : r = /* @__PURE__ */ n(
|
|
701
|
+
"button",
|
|
702
|
+
{
|
|
703
|
+
ref: g,
|
|
704
|
+
type: "button",
|
|
705
|
+
className: l,
|
|
706
|
+
"data-active": a || void 0,
|
|
707
|
+
"data-sidebar": "menu-sub-button",
|
|
708
|
+
"data-kumo-component": "Sidebar",
|
|
709
|
+
"data-kumo-part": "menu-sub-button",
|
|
710
|
+
...s,
|
|
711
|
+
children: d
|
|
712
|
+
}
|
|
713
|
+
), u ? r : /* @__PURE__ */ n("li", { "data-sidebar": "menu-sub-item", className: "relative", children: r });
|
|
714
|
+
});
|
|
715
|
+
he.displayName = "Sidebar.MenuSubButton";
|
|
716
|
+
const ve = x(({ className: t, ...a }, e) => /* @__PURE__ */ n(
|
|
717
|
+
"div",
|
|
718
|
+
{
|
|
719
|
+
ref: e,
|
|
720
|
+
"data-sidebar": "separator",
|
|
721
|
+
className: o("my-3 px-2", t),
|
|
722
|
+
...a,
|
|
723
|
+
children: /* @__PURE__ */ n("div", { className: "border-b border-kumo-line" })
|
|
724
|
+
}
|
|
725
|
+
));
|
|
726
|
+
ve.displayName = "Sidebar.Separator";
|
|
727
|
+
function xe({ className: t }) {
|
|
728
|
+
const { open: a } = V();
|
|
729
|
+
return /* @__PURE__ */ H(
|
|
730
|
+
"svg",
|
|
731
|
+
{
|
|
732
|
+
width: "18",
|
|
733
|
+
height: "18",
|
|
734
|
+
viewBox: "0 0 24 24",
|
|
735
|
+
fill: "none",
|
|
736
|
+
"aria-hidden": "true",
|
|
737
|
+
focusable: "false",
|
|
738
|
+
stroke: "currentColor",
|
|
739
|
+
strokeWidth: "1.5",
|
|
740
|
+
strokeLinecap: "round",
|
|
741
|
+
className: o("shrink-0", t),
|
|
742
|
+
children: [
|
|
743
|
+
/* @__PURE__ */ n("path", { d: "M21.25 6.72v10.56a2.97 2.97 0 0 1-2.97 2.97H5.72a2.97 2.97 0 0 1-2.97-2.97V6.72a2.97 2.97 0 0 1 2.97-2.97h12.56a2.97 2.97 0 0 1 2.97 2.97" }),
|
|
744
|
+
/* @__PURE__ */ n(
|
|
745
|
+
"path",
|
|
746
|
+
{
|
|
747
|
+
d: "M6.25 7.25v9.5",
|
|
748
|
+
className: o(
|
|
749
|
+
"transition-transform duration-(--sidebar-animation-duration) ease-(--sidebar-easing)",
|
|
750
|
+
a ? "translate-x-px" : "translate-x-[10.5px]"
|
|
751
|
+
)
|
|
752
|
+
}
|
|
753
|
+
)
|
|
754
|
+
]
|
|
755
|
+
}
|
|
756
|
+
);
|
|
757
|
+
}
|
|
758
|
+
xe.displayName = "Sidebar.PanelIcon";
|
|
759
|
+
const we = x(({ className: t, children: a, onClick: e, ...i }, s) => {
|
|
760
|
+
const { open: g, toggleSidebar: c } = V();
|
|
761
|
+
return /* @__PURE__ */ n(
|
|
762
|
+
"button",
|
|
763
|
+
{
|
|
764
|
+
ref: s,
|
|
765
|
+
type: "button",
|
|
766
|
+
"data-sidebar": "trigger",
|
|
767
|
+
"data-kumo-component": "Sidebar",
|
|
768
|
+
"data-kumo-part": "trigger",
|
|
769
|
+
"aria-expanded": g,
|
|
770
|
+
"aria-label": g ? "Collapse sidebar" : "Expand sidebar",
|
|
771
|
+
className: o(
|
|
772
|
+
"flex shrink-0 size-8.5 justify-center items-center rounded-lg cursor-pointer",
|
|
773
|
+
"text-kumo-subtle hover:text-kumo-default hover:bg-(--sidebar-active-bg)",
|
|
774
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-kumo-brand",
|
|
775
|
+
t
|
|
776
|
+
),
|
|
777
|
+
onClick: (u) => {
|
|
778
|
+
e?.(u), c();
|
|
779
|
+
},
|
|
780
|
+
...i,
|
|
781
|
+
children: a ?? /* @__PURE__ */ n(xe, {})
|
|
782
|
+
}
|
|
783
|
+
);
|
|
784
|
+
});
|
|
785
|
+
we.displayName = "Sidebar.Trigger";
|
|
786
|
+
const Se = x(({ className: t, ...a }, e) => {
|
|
787
|
+
const { toggleSidebar: i } = V();
|
|
788
|
+
return /* @__PURE__ */ n(
|
|
789
|
+
"button",
|
|
790
|
+
{
|
|
791
|
+
ref: e,
|
|
792
|
+
type: "button",
|
|
793
|
+
"data-sidebar": "rail",
|
|
794
|
+
"data-kumo-component": "Sidebar",
|
|
795
|
+
"data-kumo-part": "rail",
|
|
796
|
+
"aria-label": "Toggle sidebar",
|
|
797
|
+
tabIndex: -1,
|
|
798
|
+
className: o(
|
|
799
|
+
"absolute inset-y-0 z-1 hidden w-4 -translate-x-1/2 cursor-pointer transition-all",
|
|
800
|
+
"after:absolute after:inset-y-0 after:left-1/2 after:w-0.5",
|
|
801
|
+
"hover:after:bg-kumo-brand/20",
|
|
802
|
+
"group-data-[side=left]/sidebar-wrapper:right-0",
|
|
803
|
+
"group-data-[side=right]/sidebar-wrapper:left-0",
|
|
804
|
+
"sm:flex",
|
|
805
|
+
t
|
|
806
|
+
),
|
|
807
|
+
onClick: i,
|
|
808
|
+
...a
|
|
809
|
+
}
|
|
810
|
+
);
|
|
811
|
+
});
|
|
812
|
+
Se.displayName = "Sidebar.Rail";
|
|
813
|
+
const ye = x(({ className: t, ...a }, e) => {
|
|
814
|
+
const {
|
|
815
|
+
side: i,
|
|
816
|
+
resizable: s,
|
|
817
|
+
setIsResizing: g,
|
|
818
|
+
setWidth: c,
|
|
819
|
+
setOpen: u,
|
|
820
|
+
open: l,
|
|
821
|
+
minWidth: d,
|
|
822
|
+
width: r,
|
|
823
|
+
maxWidth: p
|
|
824
|
+
} = V(), v = B(0), f = B(0), S = B(!1);
|
|
825
|
+
if (!s) return null;
|
|
826
|
+
const k = 10, A = (m) => {
|
|
827
|
+
m.preventDefault(), g(!0), v.current = m.clientX, S.current = !l;
|
|
828
|
+
const L = m.currentTarget.closest(
|
|
829
|
+
"[data-sidebar-wrapper]"
|
|
830
|
+
)?.querySelector("[data-sidebar='sidebar']");
|
|
831
|
+
f.current = L?.getBoundingClientRect().width ?? 0;
|
|
832
|
+
const R = () => {
|
|
833
|
+
g(!1), document.removeEventListener("pointermove", T), document.removeEventListener("pointerup", N);
|
|
834
|
+
}, T = (M) => {
|
|
835
|
+
const O = i === "left" ? M.clientX - v.current : v.current - M.clientX, C = f.current + O;
|
|
836
|
+
if (S.current) {
|
|
837
|
+
C >= d && (S.current = !1, u(!0), c(C));
|
|
838
|
+
return;
|
|
839
|
+
}
|
|
840
|
+
if (C < d) {
|
|
841
|
+
u(!1), S.current = !0;
|
|
842
|
+
return;
|
|
843
|
+
}
|
|
844
|
+
c(C);
|
|
845
|
+
}, N = () => {
|
|
846
|
+
R();
|
|
847
|
+
};
|
|
848
|
+
document.addEventListener("pointermove", T), document.addEventListener("pointerup", N);
|
|
849
|
+
}, h = (m) => {
|
|
850
|
+
const y = i === "left" ? "ArrowRight" : "ArrowLeft", L = i === "left" ? "ArrowLeft" : "ArrowRight";
|
|
851
|
+
if (m.key === y)
|
|
852
|
+
m.preventDefault(), l ? c(Math.min(r + k, p)) : (u(!0), c(d));
|
|
853
|
+
else if (m.key === L) {
|
|
854
|
+
m.preventDefault();
|
|
855
|
+
const R = r - k;
|
|
856
|
+
R < d ? u(!1) : c(R);
|
|
857
|
+
} else m.key === "Home" ? (m.preventDefault(), u(!1)) : m.key === "End" && (m.preventDefault(), u(!0), c(p));
|
|
858
|
+
};
|
|
859
|
+
return /* @__PURE__ */ n(
|
|
860
|
+
"button",
|
|
861
|
+
{
|
|
862
|
+
ref: e,
|
|
863
|
+
type: "button",
|
|
864
|
+
"aria-label": "Resize sidebar",
|
|
865
|
+
tabIndex: 0,
|
|
866
|
+
"data-sidebar": "resize-handle",
|
|
867
|
+
className: o(
|
|
868
|
+
// Hit area inside the sidebar edge; thin visual line pinned to the edge via ::after
|
|
869
|
+
"absolute inset-y-0 z-2 hidden w-3 cursor-col-resize sm:block",
|
|
870
|
+
"after:absolute after:inset-y-0 after:w-0.5",
|
|
871
|
+
"after:bg-transparent after:transition-colors",
|
|
872
|
+
"hover:after:bg-kumo-hairline active:after:bg-kumo-hairline focus-visible:after:bg-kumo-hairline",
|
|
873
|
+
"focus:outline-none",
|
|
874
|
+
i === "left" && "right-0 after:right-0",
|
|
875
|
+
i === "right" && "left-0 after:left-0",
|
|
876
|
+
t
|
|
877
|
+
),
|
|
878
|
+
onPointerDown: A,
|
|
879
|
+
onKeyDown: h,
|
|
880
|
+
...a
|
|
881
|
+
}
|
|
882
|
+
);
|
|
883
|
+
});
|
|
884
|
+
ye.displayName = "Sidebar.ResizeHandle";
|
|
885
|
+
const G = U({
|
|
886
|
+
contentId: "",
|
|
887
|
+
isOpen: !0,
|
|
888
|
+
isCollapsible: !1,
|
|
889
|
+
autoScrollOnOpen: !1,
|
|
890
|
+
toggle: () => {
|
|
891
|
+
}
|
|
892
|
+
}), ke = x(
|
|
893
|
+
({
|
|
894
|
+
defaultOpen: t = !1,
|
|
895
|
+
open: a,
|
|
896
|
+
onOpenChange: e,
|
|
897
|
+
autoScrollOnOpen: i = !1,
|
|
898
|
+
className: s,
|
|
899
|
+
children: g,
|
|
900
|
+
...c
|
|
901
|
+
}, u) => {
|
|
902
|
+
const [l, d] = P(t), r = a ?? l, p = De(), v = B(!1), f = w(() => {
|
|
903
|
+
const h = !r;
|
|
904
|
+
d(h), e?.(h), v.current = !1;
|
|
905
|
+
}, [r, e]), S = Z(
|
|
906
|
+
() => ({
|
|
907
|
+
contentId: p,
|
|
908
|
+
isOpen: r,
|
|
909
|
+
isCollapsible: !0,
|
|
910
|
+
autoScrollOnOpen: i,
|
|
911
|
+
toggle: f
|
|
912
|
+
}),
|
|
913
|
+
[p, r, i, f]
|
|
914
|
+
), k = w(
|
|
915
|
+
(h) => {
|
|
916
|
+
!r && h.target.matches(":focus-visible") && (v.current = !0, d(!0), e?.(!0));
|
|
917
|
+
},
|
|
918
|
+
[r, e]
|
|
919
|
+
), A = w(
|
|
920
|
+
(h) => {
|
|
921
|
+
v.current && !h.currentTarget.contains(h.relatedTarget) && !h.currentTarget.querySelector("[data-active]") && (v.current = !1, d(!1), e?.(!1));
|
|
922
|
+
},
|
|
923
|
+
[e]
|
|
924
|
+
);
|
|
925
|
+
return /* @__PURE__ */ n(G.Provider, { value: S, children: /* @__PURE__ */ n(
|
|
926
|
+
"div",
|
|
927
|
+
{
|
|
928
|
+
ref: u,
|
|
929
|
+
"data-open": r || void 0,
|
|
930
|
+
className: o("min-w-0", s),
|
|
931
|
+
onFocus: k,
|
|
932
|
+
onBlur: A,
|
|
933
|
+
...c,
|
|
934
|
+
children: g
|
|
935
|
+
}
|
|
936
|
+
) });
|
|
937
|
+
}
|
|
938
|
+
);
|
|
939
|
+
ke.displayName = "Sidebar.Collapsible";
|
|
940
|
+
function Ne({ render: t }) {
|
|
941
|
+
const { contentId: a, isOpen: e, toggle: i } = z(G);
|
|
942
|
+
return _.cloneElement(t, {
|
|
943
|
+
"aria-expanded": e,
|
|
944
|
+
"aria-controls": a,
|
|
945
|
+
"data-open": e || void 0,
|
|
946
|
+
onClick: (s) => {
|
|
947
|
+
const g = t.props.onClick;
|
|
948
|
+
g?.(s), i();
|
|
949
|
+
}
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
Ne.displayName = "Sidebar.CollapsibleTrigger";
|
|
953
|
+
const Me = x(({ className: t, children: a, ...e }, i) => {
|
|
954
|
+
const { contentId: s, isOpen: g } = z(
|
|
955
|
+
G
|
|
956
|
+
), { state: c, animationDuration: u } = V(), { autoScrollOnOpen: l } = z(G), d = B(null), r = g && c !== "collapsed";
|
|
957
|
+
$(() => {
|
|
958
|
+
if (!r || !l) return;
|
|
959
|
+
const f = window.setTimeout(() => {
|
|
960
|
+
const S = window.matchMedia(
|
|
961
|
+
"(prefers-reduced-motion: reduce)"
|
|
962
|
+
).matches;
|
|
963
|
+
d.current?.scrollIntoView({
|
|
964
|
+
block: "nearest",
|
|
965
|
+
behavior: S ? "auto" : "smooth"
|
|
966
|
+
});
|
|
967
|
+
}, u);
|
|
968
|
+
return () => window.clearTimeout(f);
|
|
969
|
+
}, [r, l, u]);
|
|
970
|
+
const p = w(
|
|
971
|
+
(f) => {
|
|
972
|
+
f && (r ? f.removeAttribute("inert") : f.setAttribute("inert", ""));
|
|
973
|
+
},
|
|
974
|
+
[r]
|
|
975
|
+
), v = w(
|
|
976
|
+
(f) => {
|
|
977
|
+
d.current = f, p(f), typeof i == "function" ? i(f) : i && (i.current = f);
|
|
978
|
+
},
|
|
979
|
+
[i, p]
|
|
980
|
+
);
|
|
981
|
+
return /* @__PURE__ */ n(
|
|
982
|
+
"div",
|
|
983
|
+
{
|
|
984
|
+
ref: v,
|
|
985
|
+
id: s,
|
|
986
|
+
role: "region",
|
|
987
|
+
"aria-hidden": !r,
|
|
988
|
+
className: o(
|
|
989
|
+
"grid",
|
|
990
|
+
"transition-[grid-template-rows] duration-(--sidebar-animation-duration) ease-(--sidebar-easing)",
|
|
991
|
+
"motion-reduce:transition-none",
|
|
992
|
+
r ? "grid-rows-[1fr]" : "grid-rows-[0fr]",
|
|
993
|
+
t
|
|
994
|
+
),
|
|
995
|
+
...e,
|
|
996
|
+
children: /* @__PURE__ */ n("div", { className: "overflow-hidden", children: a })
|
|
997
|
+
}
|
|
998
|
+
);
|
|
999
|
+
});
|
|
1000
|
+
Me.displayName = "Sidebar.CollapsibleContent";
|
|
1001
|
+
function Ce({ className: t }) {
|
|
1002
|
+
const { isOpen: a, isCollapsible: e } = z(G);
|
|
1003
|
+
return /* @__PURE__ */ n(
|
|
1004
|
+
Be,
|
|
1005
|
+
{
|
|
1006
|
+
size: 12,
|
|
1007
|
+
weight: "bold",
|
|
1008
|
+
className: o(
|
|
1009
|
+
"ml-auto shrink-0 opacity-40 group-hover/menu-button:opacity-100 transition-[transform,rotate,opacity] duration-200",
|
|
1010
|
+
e && a && "rotate-90",
|
|
1011
|
+
// Hidden when sidebar is collapsed
|
|
1012
|
+
"group-data-[state=collapsed]/sidebar:hidden",
|
|
1013
|
+
t
|
|
1014
|
+
)
|
|
1015
|
+
}
|
|
1016
|
+
);
|
|
1017
|
+
}
|
|
1018
|
+
Ce.displayName = "Sidebar.MenuChevron";
|
|
1019
|
+
const Ie = U(""), Ae = x(
|
|
1020
|
+
({
|
|
1021
|
+
activeKey: t,
|
|
1022
|
+
direction: a = "left",
|
|
1023
|
+
className: e,
|
|
1024
|
+
children: i,
|
|
1025
|
+
...s
|
|
1026
|
+
}, g) => {
|
|
1027
|
+
const u = _.Children.toArray(i).findIndex(
|
|
1028
|
+
(r) => _.isValidElement(r) && r.props.value === t
|
|
1029
|
+
), l = typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, d = u > 0 ? `-${u * 100}%` : "0%";
|
|
1030
|
+
return /* @__PURE__ */ n(Ie.Provider, { value: t, children: /* @__PURE__ */ n(
|
|
1031
|
+
"div",
|
|
1032
|
+
{
|
|
1033
|
+
ref: g,
|
|
1034
|
+
"data-sidebar": "sliding-views",
|
|
1035
|
+
className: o(
|
|
1036
|
+
"flex flex-1 min-h-0 max-w-(--sidebar-width) overflow-hidden",
|
|
1037
|
+
e
|
|
1038
|
+
),
|
|
1039
|
+
...s,
|
|
1040
|
+
children: /* @__PURE__ */ n(
|
|
1041
|
+
"div",
|
|
1042
|
+
{
|
|
1043
|
+
className: "flex min-h-0 w-full shrink-0",
|
|
1044
|
+
style: {
|
|
1045
|
+
transform: `translateX(${d})`,
|
|
1046
|
+
transition: l ? "none" : "transform var(--sidebar-animation-duration) var(--sidebar-easing)"
|
|
1047
|
+
},
|
|
1048
|
+
children: i
|
|
1049
|
+
}
|
|
1050
|
+
)
|
|
1051
|
+
}
|
|
1052
|
+
) });
|
|
1053
|
+
}
|
|
1054
|
+
);
|
|
1055
|
+
Ae.displayName = "Sidebar.SlidingViews";
|
|
1056
|
+
const Re = x(
|
|
1057
|
+
({ value: t, className: a, children: e, ...i }, s) => {
|
|
1058
|
+
const c = z(Ie) === t, u = w(
|
|
1059
|
+
(d) => {
|
|
1060
|
+
d && (c ? d.removeAttribute("inert") : d.setAttribute("inert", ""));
|
|
1061
|
+
},
|
|
1062
|
+
[c]
|
|
1063
|
+
), l = w(
|
|
1064
|
+
(d) => {
|
|
1065
|
+
u(d), typeof s == "function" ? s(d) : s && (s.current = d);
|
|
1066
|
+
},
|
|
1067
|
+
[s, u]
|
|
1068
|
+
);
|
|
1069
|
+
return /* @__PURE__ */ n(
|
|
1070
|
+
"div",
|
|
1071
|
+
{
|
|
1072
|
+
ref: l,
|
|
1073
|
+
"data-sidebar": "sliding-view",
|
|
1074
|
+
"data-value": t,
|
|
1075
|
+
"aria-hidden": !c,
|
|
1076
|
+
className: o(
|
|
1077
|
+
"flex w-full shrink-0 flex-col min-h-0",
|
|
1078
|
+
!c && "pointer-events-none",
|
|
1079
|
+
a
|
|
1080
|
+
),
|
|
1081
|
+
...i,
|
|
1082
|
+
children: e
|
|
1083
|
+
}
|
|
1084
|
+
);
|
|
1085
|
+
}
|
|
1086
|
+
);
|
|
1087
|
+
Re.displayName = "Sidebar.SlidingView";
|
|
1088
|
+
const dt = Object.assign(ie, {
|
|
1089
|
+
Provider: ae,
|
|
1090
|
+
Header: ne,
|
|
1091
|
+
Content: re,
|
|
1092
|
+
Footer: se,
|
|
1093
|
+
Group: oe,
|
|
1094
|
+
GroupLabel: de,
|
|
1095
|
+
Menu: ue,
|
|
1096
|
+
MenuItem: be,
|
|
1097
|
+
MenuButton: me,
|
|
1098
|
+
MenuBadge: pe,
|
|
1099
|
+
MenuSub: fe,
|
|
1100
|
+
MenuSubItem: ge,
|
|
1101
|
+
MenuSubButton: he,
|
|
1102
|
+
Separator: ve,
|
|
1103
|
+
Trigger: we,
|
|
1104
|
+
Rail: Se,
|
|
1105
|
+
ResizeHandle: ye,
|
|
1106
|
+
MenuChevron: Ce,
|
|
1107
|
+
Collapsible: ke,
|
|
1108
|
+
CollapsibleTrigger: Ne,
|
|
1109
|
+
CollapsibleContent: Me,
|
|
1110
|
+
SlidingViews: Ae,
|
|
1111
|
+
SlidingView: Re
|
|
1112
|
+
});
|
|
1113
|
+
export {
|
|
1114
|
+
ot as A,
|
|
1115
|
+
st as K,
|
|
1116
|
+
dt as S,
|
|
1117
|
+
ae as a,
|
|
1118
|
+
ie as b,
|
|
1119
|
+
ne as c,
|
|
1120
|
+
re as d,
|
|
1121
|
+
se as e,
|
|
1122
|
+
oe as f,
|
|
1123
|
+
de as g,
|
|
1124
|
+
ue as h,
|
|
1125
|
+
be as i,
|
|
1126
|
+
me as j,
|
|
1127
|
+
pe as k,
|
|
1128
|
+
fe as l,
|
|
1129
|
+
ge as m,
|
|
1130
|
+
he as n,
|
|
1131
|
+
ve as o,
|
|
1132
|
+
we as p,
|
|
1133
|
+
Se as q,
|
|
1134
|
+
ye as r,
|
|
1135
|
+
Ce as s,
|
|
1136
|
+
ke as t,
|
|
1137
|
+
Ne as u,
|
|
1138
|
+
Me as v,
|
|
1139
|
+
Ae as w,
|
|
1140
|
+
Re as x,
|
|
1141
|
+
V as y,
|
|
1142
|
+
J as z
|
|
1143
|
+
};
|
|
1144
|
+
//# sourceMappingURL=sidebar-nbdw4rgvuabxp5nj.js.map
|