@cloudflare/kumo 2.7.0 → 2.8.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 +19 -0
- package/ai/component-registry.json +1164 -149
- package/ai/component-registry.md +1325 -114
- package/ai/schemas.ts +136 -7
- package/dist/.build-complete +1 -1
- package/dist/ai/schemas.d.ts +259 -22
- package/dist/ai/schemas.d.ts.map +1 -1
- package/dist/ai/schemas.js +1515 -1298
- package/dist/ai/schemas.js.map +1 -1
- package/dist/chunks/Maps-imwfwgb7do9lr3i5.js +2448 -0
- package/dist/chunks/Maps-imwfwgb7do9lr3i5.js.map +1 -0
- package/dist/chunks/input-area-sg518xu4pyg4m0km.js +144 -0
- package/dist/chunks/input-area-sg518xu4pyg4m0km.js.map +1 -0
- package/dist/chunks/{sidebar-ctd980heycmxsux1.js → sidebar-7whsl7qwrw5b6ip8.js} +306 -306
- package/dist/chunks/sidebar-7whsl7qwrw5b6ip8.js.map +1 -0
- package/dist/components/chart.js +1 -1
- package/dist/components/flow.js +2306 -2350
- package/dist/components/flow.js.map +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/index.js +3 -3
- package/dist/src/components/chart/TimeseriesChart.d.ts +8 -0
- package/dist/src/components/chart/TimeseriesChart.d.ts.map +1 -1
- package/dist/src/components/chart/index.d.ts +1 -1
- package/dist/src/components/chart/index.d.ts.map +1 -1
- package/dist/src/components/chart/timeseries-markers.d.ts +107 -0
- package/dist/src/components/chart/timeseries-markers.d.ts.map +1 -0
- package/dist/src/components/chart/timeseries-thresholds.d.ts +61 -0
- package/dist/src/components/chart/timeseries-thresholds.d.ts.map +1 -0
- package/dist/src/components/chart/timeseries-tooltip.d.ts +28 -0
- package/dist/src/components/chart/timeseries-tooltip.d.ts.map +1 -0
- package/dist/src/components/flow/connectors.d.ts +18 -0
- package/dist/src/components/flow/connectors.d.ts.map +1 -1
- package/dist/src/components/flow/diagram.d.ts +48 -41
- package/dist/src/components/flow/diagram.d.ts.map +1 -1
- package/dist/src/components/flow/flow-layout.d.ts +77 -0
- package/dist/src/components/flow/flow-layout.d.ts.map +1 -0
- package/dist/src/components/flow/node.d.ts.map +1 -1
- package/dist/src/components/flow/parallel.d.ts +3 -7
- package/dist/src/components/flow/parallel.d.ts.map +1 -1
- package/dist/src/components/flow/use-children.d.ts +0 -60
- package/dist/src/components/flow/use-children.d.ts.map +1 -1
- package/dist/src/components/input/input-area.d.ts +18 -0
- package/dist/src/components/input/input-area.d.ts.map +1 -1
- package/dist/src/components/sidebar/sidebar.d.ts +2 -0
- package/dist/src/components/sidebar/sidebar.d.ts.map +1 -1
- package/dist/src/primitives/index.d.ts +1 -1
- package/dist/src/primitives/index.d.ts.map +1 -1
- package/dist/src/primitives/otp-field.d.ts +1 -1
- package/dist/src/primitives/otp-field.d.ts.map +1 -1
- package/dist/styles/kumo-standalone.css +1 -1
- package/package.json +1 -1
- package/scripts/component-registry/discovery.ts +87 -0
- package/scripts/component-registry/index.test.ts +89 -1
- package/scripts/component-registry/index.ts +27 -2
- package/scripts/component-registry/sub-components.ts +34 -21
- package/scripts/generate-primitives.ts +1 -1
- package/dist/chunks/Maps-fkiyllhs5w0qzw1y.js +0 -2155
- package/dist/chunks/Maps-fkiyllhs5w0qzw1y.js.map +0 -1
- package/dist/chunks/input-area-ixtj4e8eny58nbf9.js +0 -78
- package/dist/chunks/input-area-ixtj4e8eny58nbf9.js.map +0 -1
- package/dist/chunks/sidebar-ctd980heycmxsux1.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as n, jsxs as
|
|
3
|
-
import _, { forwardRef as x, useState as P, useCallback as w, useMemo as Z, createContext as
|
|
2
|
+
import { jsx as n, jsxs as W, Fragment as De } from "react/jsx-runtime";
|
|
3
|
+
import _, { forwardRef as x, useState as P, useCallback as w, useMemo as Z, createContext as G, useRef as D, useEffect as U, useContext as L, useId as Le } from "react";
|
|
4
4
|
import { CaretRightIcon as Be } from "@phosphor-icons/react";
|
|
5
5
|
import { u as ee } from "./link-provider-mn2voeohon7cj9o4.js";
|
|
6
|
-
import { a as
|
|
7
|
-
import { c as
|
|
6
|
+
import { a as ze, T as Oe } from "./tooltip-mooldq78tg77ekvv.js";
|
|
7
|
+
import { c as s } from "./vendor-styling-ofvnbcuht98q88oo.js";
|
|
8
8
|
import { bC as Fe, bD as Pe, bE as Ve, bF as We, bG as He } from "./vendor-base-ui-elpbzr8xeffrz4h2.js";
|
|
9
9
|
const st = {
|
|
10
10
|
variant: {
|
|
@@ -60,14 +60,14 @@ const st = {
|
|
|
60
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
61
|
function je(t = $e) {
|
|
62
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)`),
|
|
65
|
-
return i.addEventListener("change",
|
|
63
|
+
return U(() => {
|
|
64
|
+
const i = window.matchMedia(`(max-width: ${t - 1}px)`), o = () => e(i.matches);
|
|
65
|
+
return i.addEventListener("change", o), e(i.matches), () => i.removeEventListener("change", o);
|
|
66
66
|
}, [t]), a;
|
|
67
67
|
}
|
|
68
|
-
const te =
|
|
68
|
+
const te = G(null);
|
|
69
69
|
function V() {
|
|
70
|
-
const t =
|
|
70
|
+
const t = L(te);
|
|
71
71
|
if (!t)
|
|
72
72
|
throw new Error("useSidebar must be used within a Sidebar.Provider");
|
|
73
73
|
return t;
|
|
@@ -78,91 +78,91 @@ function ae({
|
|
|
78
78
|
open: a,
|
|
79
79
|
onOpenChange: e,
|
|
80
80
|
variant: i = J.variant,
|
|
81
|
-
side:
|
|
82
|
-
collapsible:
|
|
83
|
-
resizable:
|
|
81
|
+
side: o = J.side,
|
|
82
|
+
collapsible: h = J.collapsible,
|
|
83
|
+
resizable: l = !1,
|
|
84
84
|
defaultWidth: u = Ye,
|
|
85
|
-
minWidth:
|
|
85
|
+
minWidth: c = Je,
|
|
86
86
|
maxWidth: d = Qe,
|
|
87
87
|
onWidthChange: r,
|
|
88
88
|
contained: p = !1,
|
|
89
|
-
peekable:
|
|
90
|
-
animationDuration:
|
|
89
|
+
peekable: f = !1,
|
|
90
|
+
animationDuration: g = Ue,
|
|
91
91
|
mobileBreakpoint: S,
|
|
92
92
|
children: k,
|
|
93
|
-
className:
|
|
94
|
-
style:
|
|
93
|
+
className: M,
|
|
94
|
+
style: v
|
|
95
95
|
}) {
|
|
96
|
-
const
|
|
97
|
-
(
|
|
98
|
-
|
|
96
|
+
const b = je(S), [y, T] = P(!1), [C, E] = P(u), [I, R] = P(!1), [B, N] = P(!1), z = b && a !== void 0 ? a : y, H = w(
|
|
97
|
+
(A) => {
|
|
98
|
+
T(A), b && a !== void 0 && e?.(A);
|
|
99
99
|
},
|
|
100
|
-
[
|
|
100
|
+
[b, a, e]
|
|
101
101
|
), Q = w(
|
|
102
|
-
(
|
|
103
|
-
const
|
|
104
|
-
|
|
102
|
+
(A) => {
|
|
103
|
+
const K = Math.min(d, Math.max(c, A));
|
|
104
|
+
E(K), r?.(K);
|
|
105
105
|
},
|
|
106
|
-
[
|
|
107
|
-
), [q
|
|
108
|
-
(
|
|
109
|
-
const
|
|
110
|
-
e?.(
|
|
106
|
+
[c, d, r]
|
|
107
|
+
), [$, q] = P(t), m = a ?? $, O = w(
|
|
108
|
+
(A) => {
|
|
109
|
+
const K = typeof A == "function" ? A(m) : A;
|
|
110
|
+
e?.(K), q(K);
|
|
111
111
|
},
|
|
112
|
-
[e,
|
|
113
|
-
),
|
|
114
|
-
|
|
115
|
-
}, [
|
|
116
|
-
|
|
117
|
-
}, [
|
|
118
|
-
|
|
119
|
-
}, []), Y =
|
|
112
|
+
[e, m]
|
|
113
|
+
), j = w(() => {
|
|
114
|
+
b ? H(!z) : (N(!1), O((A) => !A));
|
|
115
|
+
}, [b, z, H, O]), F = w(() => {
|
|
116
|
+
f && !m && !b && N(!0);
|
|
117
|
+
}, [f, m, b]), Ee = w(() => {
|
|
118
|
+
N(!1);
|
|
119
|
+
}, []), Y = B ? "peeking" : m ? "expanded" : "collapsed", _e = l ? `${C}px` : Ke, Te = Z(
|
|
120
120
|
() => ({
|
|
121
121
|
state: Y,
|
|
122
|
-
open:
|
|
123
|
-
setOpen:
|
|
124
|
-
openMobile:
|
|
125
|
-
setOpenMobile:
|
|
126
|
-
isMobile:
|
|
127
|
-
toggleSidebar:
|
|
122
|
+
open: m,
|
|
123
|
+
setOpen: O,
|
|
124
|
+
openMobile: z,
|
|
125
|
+
setOpenMobile: H,
|
|
126
|
+
isMobile: b,
|
|
127
|
+
toggleSidebar: j,
|
|
128
128
|
variant: i,
|
|
129
|
-
side:
|
|
130
|
-
collapsible:
|
|
131
|
-
width:
|
|
132
|
-
resizable:
|
|
133
|
-
minWidth:
|
|
129
|
+
side: o,
|
|
130
|
+
collapsible: h,
|
|
131
|
+
width: C,
|
|
132
|
+
resizable: l,
|
|
133
|
+
minWidth: c,
|
|
134
134
|
maxWidth: d,
|
|
135
|
-
isResizing:
|
|
136
|
-
setIsResizing:
|
|
135
|
+
isResizing: I,
|
|
136
|
+
setIsResizing: R,
|
|
137
137
|
setWidth: Q,
|
|
138
|
-
isPeeking:
|
|
139
|
-
peekable:
|
|
140
|
-
startPeek:
|
|
138
|
+
isPeeking: B,
|
|
139
|
+
peekable: f,
|
|
140
|
+
startPeek: F,
|
|
141
141
|
stopPeek: Ee,
|
|
142
142
|
contained: p,
|
|
143
|
-
animationDuration:
|
|
143
|
+
animationDuration: g
|
|
144
144
|
}),
|
|
145
|
-
[Y,
|
|
145
|
+
[Y, m, z, b, C, I, B]
|
|
146
146
|
);
|
|
147
|
-
return /* @__PURE__ */ n(te.Provider, { value:
|
|
147
|
+
return /* @__PURE__ */ n(te.Provider, { value: Te, children: /* @__PURE__ */ n(
|
|
148
148
|
"div",
|
|
149
149
|
{
|
|
150
150
|
"data-sidebar-wrapper": "",
|
|
151
151
|
"data-state": Y,
|
|
152
|
-
"data-side":
|
|
152
|
+
"data-side": o,
|
|
153
153
|
style: {
|
|
154
|
-
"--sidebar-width":
|
|
154
|
+
"--sidebar-width": _e,
|
|
155
155
|
"--sidebar-width-icon": Xe,
|
|
156
|
-
"--sidebar-animation-duration": `${
|
|
156
|
+
"--sidebar-animation-duration": `${g}ms`,
|
|
157
157
|
"--sidebar-easing": Ge,
|
|
158
|
-
...
|
|
158
|
+
...v
|
|
159
159
|
},
|
|
160
|
-
className:
|
|
160
|
+
className: s(
|
|
161
161
|
"group/sidebar-wrapper relative isolate flex w-full [--sidebar-bg:var(--color-kumo-base)] [--sidebar-active-bg:var(--color-kumo-tint)]",
|
|
162
|
-
!p && !
|
|
162
|
+
!p && !b && "min-h-svh",
|
|
163
163
|
"has-data-[variant=inset]:bg-kumo-recessed",
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
I && "select-none",
|
|
165
|
+
M
|
|
166
166
|
),
|
|
167
167
|
children: k
|
|
168
168
|
}
|
|
@@ -170,62 +170,60 @@ function ae({
|
|
|
170
170
|
}
|
|
171
171
|
ae.displayName = "Sidebar.Provider";
|
|
172
172
|
const ie = x(
|
|
173
|
-
({ className: t, contentClassName: a, children: e, ...i },
|
|
173
|
+
({ className: t, contentClassName: a, children: e, ...i }, o) => {
|
|
174
174
|
const {
|
|
175
|
-
state:
|
|
176
|
-
open:
|
|
175
|
+
state: h,
|
|
176
|
+
open: l,
|
|
177
177
|
isMobile: u,
|
|
178
|
-
openMobile:
|
|
178
|
+
openMobile: c,
|
|
179
179
|
setOpenMobile: d,
|
|
180
180
|
side: r,
|
|
181
181
|
variant: p,
|
|
182
|
-
collapsible:
|
|
183
|
-
isResizing:
|
|
182
|
+
collapsible: f,
|
|
183
|
+
isResizing: g,
|
|
184
184
|
resizable: S,
|
|
185
185
|
width: k,
|
|
186
|
-
isPeeking:
|
|
187
|
-
startPeek:
|
|
188
|
-
stopPeek:
|
|
186
|
+
isPeeking: M,
|
|
187
|
+
startPeek: v,
|
|
188
|
+
stopPeek: b,
|
|
189
189
|
contained: y
|
|
190
|
-
} = V(),
|
|
191
|
-
(
|
|
192
|
-
|
|
190
|
+
} = V(), T = w(
|
|
191
|
+
(m) => {
|
|
192
|
+
m && (c ? m.removeAttribute("inert") : m.setAttribute("inert", ""));
|
|
193
193
|
},
|
|
194
|
-
[
|
|
195
|
-
),
|
|
196
|
-
(
|
|
197
|
-
|
|
194
|
+
[c]
|
|
195
|
+
), C = w(
|
|
196
|
+
(m) => {
|
|
197
|
+
T(m), typeof o == "function" ? o(m) : o && (o.current = m);
|
|
198
198
|
},
|
|
199
|
-
[
|
|
200
|
-
),
|
|
201
|
-
|
|
202
|
-
if (!u || !
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
}, W = (I) => {
|
|
206
|
-
b && !b.contains(I.relatedTarget) && (M.current = !1, d(!1));
|
|
199
|
+
[o, T]
|
|
200
|
+
), E = D(null), I = D(null), R = D(!1);
|
|
201
|
+
U(() => {
|
|
202
|
+
if (!u || !c) return;
|
|
203
|
+
const m = (O) => {
|
|
204
|
+
O.key === "Escape" && (R.current = !0, d(!1));
|
|
207
205
|
};
|
|
208
|
-
return document.addEventListener("keydown",
|
|
209
|
-
document.removeEventListener("keydown",
|
|
206
|
+
return document.addEventListener("keydown", m), () => {
|
|
207
|
+
document.removeEventListener("keydown", m);
|
|
210
208
|
};
|
|
211
|
-
}, [u,
|
|
212
|
-
u && (
|
|
213
|
-
(
|
|
209
|
+
}, [u, c, d]), U(() => {
|
|
210
|
+
u && (c ? (E.current = document.activeElement, R.current = !1, requestAnimationFrame(() => {
|
|
211
|
+
(I.current?.querySelector(
|
|
214
212
|
qe
|
|
215
|
-
) ??
|
|
216
|
-
})) :
|
|
217
|
-
}, [u,
|
|
218
|
-
const
|
|
219
|
-
(
|
|
220
|
-
|
|
213
|
+
) ?? I.current)?.focus();
|
|
214
|
+
})) : R.current && E.current instanceof HTMLElement && (E.current.focus(), R.current = !1, E.current = null));
|
|
215
|
+
}, [u, c]);
|
|
216
|
+
const B = w(
|
|
217
|
+
(m) => {
|
|
218
|
+
m.currentTarget.contains(m.relatedTarget) || b();
|
|
221
219
|
},
|
|
222
|
-
[
|
|
220
|
+
[b]
|
|
223
221
|
);
|
|
224
|
-
if (
|
|
222
|
+
if (f === "none")
|
|
225
223
|
return /* @__PURE__ */ n(
|
|
226
224
|
"aside",
|
|
227
225
|
{
|
|
228
|
-
ref:
|
|
226
|
+
ref: o,
|
|
229
227
|
"data-state": "expanded",
|
|
230
228
|
"data-side": r,
|
|
231
229
|
"data-variant": p,
|
|
@@ -235,7 +233,7 @@ const ie = x(
|
|
|
235
233
|
minWidth: "var(--sidebar-width)",
|
|
236
234
|
maxWidth: "var(--sidebar-width)"
|
|
237
235
|
},
|
|
238
|
-
className:
|
|
236
|
+
className: s(
|
|
239
237
|
"relative flex h-full shrink-0 grow-0 flex-col overflow-hidden bg-(--sidebar-bg) text-kumo-default",
|
|
240
238
|
p === "sidebar" && (r === "left" ? "border-r border-kumo-line" : "border-l border-kumo-line"),
|
|
241
239
|
p === "floating" && "m-2 rounded-lg border border-kumo-line shadow-lg",
|
|
@@ -246,19 +244,19 @@ const ie = x(
|
|
|
246
244
|
}
|
|
247
245
|
);
|
|
248
246
|
if (u)
|
|
249
|
-
return /* @__PURE__ */
|
|
247
|
+
return /* @__PURE__ */ W(De, { children: [
|
|
250
248
|
/* @__PURE__ */ n(
|
|
251
249
|
"div",
|
|
252
250
|
{
|
|
253
251
|
"data-sidebar-backdrop": "",
|
|
254
|
-
className:
|
|
252
|
+
className: s(
|
|
255
253
|
y ? "absolute inset-0 z-40 bg-kumo-recessed" : "fixed inset-0 z-40 bg-kumo-recessed",
|
|
256
254
|
"transition-opacity duration-(--sidebar-animation-duration) ease-(--sidebar-easing)",
|
|
257
255
|
"motion-reduce:transition-none",
|
|
258
|
-
|
|
256
|
+
c ? "opacity-80" : "opacity-0 pointer-events-none"
|
|
259
257
|
),
|
|
260
258
|
onClick: () => {
|
|
261
|
-
|
|
259
|
+
R.current = !0, d(!1);
|
|
262
260
|
},
|
|
263
261
|
"aria-hidden": "true"
|
|
264
262
|
}
|
|
@@ -266,27 +264,27 @@ const ie = x(
|
|
|
266
264
|
/* @__PURE__ */ n(
|
|
267
265
|
"nav",
|
|
268
266
|
{
|
|
269
|
-
ref: (
|
|
270
|
-
|
|
267
|
+
ref: (m) => {
|
|
268
|
+
C(m), I.current = m;
|
|
271
269
|
},
|
|
272
270
|
tabIndex: -1,
|
|
273
271
|
"aria-label": "Navigation",
|
|
274
|
-
"aria-hidden": !
|
|
275
|
-
"data-state":
|
|
272
|
+
"aria-hidden": !c,
|
|
273
|
+
"data-state": c ? "expanded" : "collapsed",
|
|
276
274
|
"data-side": r,
|
|
277
275
|
"data-variant": p,
|
|
278
|
-
"data-collapsible":
|
|
276
|
+
"data-collapsible": f,
|
|
279
277
|
"data-sidebar": "sidebar",
|
|
280
278
|
"data-mobile": "true",
|
|
281
|
-
className:
|
|
279
|
+
className: s(
|
|
282
280
|
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
281
|
"border-r border-kumo-line bg-(--sidebar-bg) text-kumo-default",
|
|
284
282
|
"transition-transform duration-(--sidebar-animation-duration) ease-(--sidebar-easing)",
|
|
285
283
|
"motion-reduce:transition-none",
|
|
286
284
|
r === "left" && "left-0",
|
|
287
285
|
r === "right" && "right-0",
|
|
288
|
-
r === "left" && (
|
|
289
|
-
r === "right" && (
|
|
286
|
+
r === "left" && (c ? "translate-x-0" : "-translate-x-full"),
|
|
287
|
+
r === "right" && (c ? "translate-x-0" : "translate-x-full"),
|
|
290
288
|
t
|
|
291
289
|
),
|
|
292
290
|
...i,
|
|
@@ -294,54 +292,54 @@ const ie = x(
|
|
|
294
292
|
}
|
|
295
293
|
)
|
|
296
294
|
] });
|
|
297
|
-
const
|
|
295
|
+
const N = f === "icon" ? "var(--sidebar-width-icon)" : "0px", z = S ? `${k}px` : "var(--sidebar-width)", H = l ? z : N, $ = l || M ? z : N, q = p === "sidebar" ? r === "left" ? "border-r border-kumo-line" : "border-l border-kumo-line" : p === "floating" ? "border border-kumo-line" : "";
|
|
298
296
|
return /* @__PURE__ */ n(
|
|
299
297
|
"aside",
|
|
300
298
|
{
|
|
301
|
-
ref:
|
|
302
|
-
"data-state":
|
|
299
|
+
ref: o,
|
|
300
|
+
"data-state": h,
|
|
303
301
|
"data-side": r,
|
|
304
302
|
"data-variant": p,
|
|
305
|
-
"data-collapsible":
|
|
303
|
+
"data-collapsible": f,
|
|
306
304
|
"data-sidebar": "sidebar",
|
|
307
|
-
style: { width:
|
|
308
|
-
className:
|
|
305
|
+
style: { width: H },
|
|
306
|
+
className: s(
|
|
309
307
|
"group/sidebar relative h-full shrink-0 grow-0",
|
|
310
308
|
"overflow-visible",
|
|
311
309
|
// allow content container to overlay when peeking
|
|
312
310
|
"transition-[width] duration-(--sidebar-animation-duration) ease-(--sidebar-easing)",
|
|
313
311
|
"motion-reduce:transition-none",
|
|
314
|
-
|
|
312
|
+
g && "transition-none!",
|
|
315
313
|
p === "floating" && "m-2 rounded-lg shadow-lg",
|
|
316
314
|
t
|
|
317
315
|
),
|
|
318
316
|
...i,
|
|
319
|
-
children: /* @__PURE__ */ n(
|
|
320
|
-
const
|
|
321
|
-
(
|
|
322
|
-
),
|
|
323
|
-
(
|
|
317
|
+
children: /* @__PURE__ */ n(ze, { children: (() => {
|
|
318
|
+
const m = _.Children.toArray(e), O = m.filter(
|
|
319
|
+
(F) => _.isValidElement(F) && F.type?.displayName === "Sidebar.Footer"
|
|
320
|
+
), j = m.filter(
|
|
321
|
+
(F) => !_.isValidElement(F) || F.type?.displayName !== "Sidebar.Footer"
|
|
324
322
|
);
|
|
325
|
-
return /* @__PURE__ */
|
|
323
|
+
return /* @__PURE__ */ W(
|
|
326
324
|
"div",
|
|
327
325
|
{
|
|
328
326
|
"data-sidebar": "content-container",
|
|
329
|
-
style: { width:
|
|
330
|
-
className:
|
|
327
|
+
style: { width: $ },
|
|
328
|
+
className: s(
|
|
331
329
|
"flex h-full flex-col",
|
|
332
330
|
"min-w-0 overflow-hidden whitespace-nowrap",
|
|
333
331
|
"bg-(--sidebar-bg) text-kumo-default",
|
|
334
|
-
|
|
332
|
+
q,
|
|
335
333
|
"transition-[width] duration-(--sidebar-animation-duration) ease-(--sidebar-easing)",
|
|
336
334
|
"motion-reduce:transition-none",
|
|
337
|
-
|
|
338
|
-
!
|
|
335
|
+
g && "transition-none!",
|
|
336
|
+
!l && s(
|
|
339
337
|
y ? "absolute" : "fixed",
|
|
340
338
|
"inset-y-0 z-40",
|
|
341
339
|
r === "left" && "left-0",
|
|
342
340
|
r === "right" && "right-0"
|
|
343
341
|
),
|
|
344
|
-
|
|
342
|
+
l && "relative",
|
|
345
343
|
a
|
|
346
344
|
),
|
|
347
345
|
children: [
|
|
@@ -350,14 +348,14 @@ const ie = x(
|
|
|
350
348
|
{
|
|
351
349
|
"data-sidebar": "peek-zone",
|
|
352
350
|
className: "flex flex-1 flex-col min-h-0",
|
|
353
|
-
onMouseEnter:
|
|
354
|
-
onMouseLeave:
|
|
355
|
-
onFocus:
|
|
356
|
-
onBlur:
|
|
357
|
-
children:
|
|
351
|
+
onMouseEnter: v,
|
|
352
|
+
onMouseLeave: b,
|
|
353
|
+
onFocus: v,
|
|
354
|
+
onBlur: B,
|
|
355
|
+
children: j
|
|
358
356
|
}
|
|
359
357
|
),
|
|
360
|
-
|
|
358
|
+
O
|
|
361
359
|
]
|
|
362
360
|
}
|
|
363
361
|
);
|
|
@@ -372,7 +370,7 @@ const ne = x(({ className: t, ...a }, e) => /* @__PURE__ */ n(
|
|
|
372
370
|
{
|
|
373
371
|
ref: e,
|
|
374
372
|
"data-sidebar": "header",
|
|
375
|
-
className:
|
|
373
|
+
className: s(
|
|
376
374
|
"flex h-[58px] shrink-0 items-center gap-1 border-b border-kumo-line",
|
|
377
375
|
"px-3 overflow-hidden",
|
|
378
376
|
t
|
|
@@ -381,19 +379,19 @@ const ne = x(({ className: t, ...a }, e) => /* @__PURE__ */ n(
|
|
|
381
379
|
}
|
|
382
380
|
));
|
|
383
381
|
ne.displayName = "Sidebar.Header";
|
|
384
|
-
const re = x(({ className: t, children: a, ...e }, i) => /* @__PURE__ */
|
|
382
|
+
const re = x(({ className: t, children: a, ...e }, i) => /* @__PURE__ */ W(
|
|
385
383
|
Fe,
|
|
386
384
|
{
|
|
387
385
|
ref: i,
|
|
388
386
|
"data-sidebar": "content",
|
|
389
|
-
className:
|
|
387
|
+
className: s("relative min-w-0 flex-1 overflow-hidden", t),
|
|
390
388
|
...e,
|
|
391
389
|
children: [
|
|
392
390
|
/* @__PURE__ */ n(
|
|
393
391
|
Pe,
|
|
394
392
|
{
|
|
395
393
|
tabIndex: -1,
|
|
396
|
-
className:
|
|
394
|
+
className: s(
|
|
397
395
|
"h-full px-[11px] py-3 group-not-data-[state=collapsed]/sidebar:px-3.5",
|
|
398
396
|
"transition-[padding] duration-(--sidebar-animation-duration)",
|
|
399
397
|
"overflow-x-hidden!",
|
|
@@ -407,7 +405,7 @@ const re = x(({ className: t, children: a, ...e }, i) => /* @__PURE__ */ H(
|
|
|
407
405
|
We,
|
|
408
406
|
{
|
|
409
407
|
orientation: "vertical",
|
|
410
|
-
className:
|
|
408
|
+
className: s(
|
|
411
409
|
"flex w-1.5 touch-none select-none p-px",
|
|
412
410
|
"opacity-0 transition-opacity duration-150",
|
|
413
411
|
"data-[scrolling]:opacity-100 data-[hovering]:opacity-100"
|
|
@@ -424,7 +422,7 @@ const se = x(({ className: t, ...a }, e) => /* @__PURE__ */ n(
|
|
|
424
422
|
{
|
|
425
423
|
ref: e,
|
|
426
424
|
"data-sidebar": "footer",
|
|
427
|
-
className:
|
|
425
|
+
className: s(
|
|
428
426
|
"flex h-12 shrink-0 items-center gap-4 overflow-hidden whitespace-nowrap border-t border-kumo-line",
|
|
429
427
|
"px-[11px] group-not-data-[state=collapsed]/sidebar:px-4",
|
|
430
428
|
"bg-(--sidebar-bg)",
|
|
@@ -445,7 +443,7 @@ const oe = x(({ className: t, children: a, ...e }, i) => /* @__PURE__ */ n(
|
|
|
445
443
|
{
|
|
446
444
|
ref: i,
|
|
447
445
|
"data-sidebar": "group",
|
|
448
|
-
className:
|
|
446
|
+
className: s("flex min-w-0 flex-col gap-y-px", t),
|
|
449
447
|
...e,
|
|
450
448
|
children: a
|
|
451
449
|
}
|
|
@@ -456,7 +454,7 @@ const de = x(({ className: t, children: a, ...e }, i) => /* @__PURE__ */ n(
|
|
|
456
454
|
{
|
|
457
455
|
ref: i,
|
|
458
456
|
"data-sidebar": "group-label",
|
|
459
|
-
className:
|
|
457
|
+
className: s(
|
|
460
458
|
// Grid-rows for smooth collapse animation
|
|
461
459
|
"grid overflow-hidden",
|
|
462
460
|
"transition-[grid-template-rows,margin,border-color] duration-(--sidebar-animation-duration) ease-(--sidebar-easing)",
|
|
@@ -476,7 +474,7 @@ const de = x(({ className: t, children: a, ...e }, i) => /* @__PURE__ */ n(
|
|
|
476
474
|
children: /* @__PURE__ */ n("div", { className: "min-h-0 min-w-0", children: /* @__PURE__ */ n(
|
|
477
475
|
"div",
|
|
478
476
|
{
|
|
479
|
-
className:
|
|
477
|
+
className: s(
|
|
480
478
|
"truncate px-3 mt-4 mb-2 text-sm font-medium text-kumo-subtle",
|
|
481
479
|
// First group: less top margin
|
|
482
480
|
"[[data-sidebar=group]:first-child_&]:mt-2"
|
|
@@ -487,12 +485,12 @@ const de = x(({ className: t, children: a, ...e }, i) => /* @__PURE__ */ n(
|
|
|
487
485
|
}
|
|
488
486
|
));
|
|
489
487
|
de.displayName = "Sidebar.GroupLabel";
|
|
490
|
-
const le =
|
|
488
|
+
const le = G(!1), ce = G(!1), ue = x(({ className: t, ...a }, e) => /* @__PURE__ */ n(
|
|
491
489
|
"ul",
|
|
492
490
|
{
|
|
493
491
|
ref: e,
|
|
494
492
|
"data-sidebar": "menu",
|
|
495
|
-
className:
|
|
493
|
+
className: s(
|
|
496
494
|
"m-0 flex min-w-0 list-none flex-col items-stretch gap-y-px p-0",
|
|
497
495
|
t
|
|
498
496
|
),
|
|
@@ -505,7 +503,7 @@ const be = x(({ className: t, children: a, ...e }, i) => /* @__PURE__ */ n(le.Pr
|
|
|
505
503
|
{
|
|
506
504
|
ref: i,
|
|
507
505
|
"data-sidebar": "menu-item",
|
|
508
|
-
className:
|
|
506
|
+
className: s(
|
|
509
507
|
"relative group-data-[state=collapsed]/sidebar:overflow-hidden",
|
|
510
508
|
t
|
|
511
509
|
),
|
|
@@ -520,24 +518,24 @@ const me = x(
|
|
|
520
518
|
icon: a,
|
|
521
519
|
active: e = !1,
|
|
522
520
|
size: i = "base",
|
|
523
|
-
href:
|
|
524
|
-
target:
|
|
525
|
-
tooltip:
|
|
521
|
+
href: o,
|
|
522
|
+
target: h,
|
|
523
|
+
tooltip: l,
|
|
526
524
|
children: u,
|
|
527
|
-
...
|
|
525
|
+
...c
|
|
528
526
|
}, d) => {
|
|
529
|
-
const { state: r, peekable: p } = V(),
|
|
527
|
+
const { state: r, peekable: p } = V(), f = ee(), g = L(le), S = a ? _.isValidElement(a) ? a : /* @__PURE__ */ n(
|
|
530
528
|
a,
|
|
531
529
|
{
|
|
532
|
-
className:
|
|
530
|
+
className: s(
|
|
533
531
|
"shrink-0 opacity-40",
|
|
534
532
|
i === "base" ? "size-4" : "size-3.5"
|
|
535
533
|
)
|
|
536
534
|
}
|
|
537
|
-
) : null, k = /* @__PURE__ */
|
|
535
|
+
) : null, k = /* @__PURE__ */ W(
|
|
538
536
|
"div",
|
|
539
537
|
{
|
|
540
|
-
className:
|
|
538
|
+
className: s(
|
|
541
539
|
"flex flex-1 items-center min-w-0 gap-3",
|
|
542
540
|
"translate-x-[-3px] group-not-data-[state=collapsed]/sidebar:translate-x-0",
|
|
543
541
|
"transition-transform duration-(--sidebar-animation-duration)"
|
|
@@ -547,7 +545,7 @@ const me = x(
|
|
|
547
545
|
/* @__PURE__ */ n(
|
|
548
546
|
"span",
|
|
549
547
|
{
|
|
550
|
-
className:
|
|
548
|
+
className: s(
|
|
551
549
|
"flex flex-1 items-center gap-2 min-w-0 text-left overflow-hidden"
|
|
552
550
|
),
|
|
553
551
|
children: _.Children.map(
|
|
@@ -558,7 +556,7 @@ const me = x(
|
|
|
558
556
|
)
|
|
559
557
|
]
|
|
560
558
|
}
|
|
561
|
-
),
|
|
559
|
+
), M = s(
|
|
562
560
|
// Layout
|
|
563
561
|
"group/menu-button relative flex w-full min-w-0 items-center gap-2.5 rounded-lg outline-none cursor-pointer",
|
|
564
562
|
"before:absolute before:inset-x-0 before:-inset-y-px",
|
|
@@ -576,50 +574,51 @@ const me = x(
|
|
|
576
574
|
"focus:outline-none focus-visible:text-kumo-strong focus-visible:bg-(--sidebar-active-bg)",
|
|
577
575
|
t
|
|
578
576
|
);
|
|
579
|
-
let
|
|
580
|
-
return
|
|
581
|
-
|
|
577
|
+
let v;
|
|
578
|
+
return o ? v = /* @__PURE__ */ n(
|
|
579
|
+
f,
|
|
582
580
|
{
|
|
583
581
|
ref: d,
|
|
584
|
-
className:
|
|
585
|
-
href:
|
|
586
|
-
to:
|
|
587
|
-
target:
|
|
582
|
+
className: s(M, "no-underline!"),
|
|
583
|
+
href: o,
|
|
584
|
+
to: o,
|
|
585
|
+
target: h,
|
|
588
586
|
"data-active": e || void 0,
|
|
589
587
|
"data-sidebar": "menu-button",
|
|
590
588
|
"data-kumo-component": "Sidebar",
|
|
591
589
|
"data-kumo-part": "menu-button-link",
|
|
592
590
|
"data-size": i,
|
|
593
|
-
onClick:
|
|
591
|
+
onClick: c.onClick,
|
|
594
592
|
children: k
|
|
595
593
|
}
|
|
596
|
-
) :
|
|
594
|
+
) : v = /* @__PURE__ */ n(
|
|
597
595
|
"button",
|
|
598
596
|
{
|
|
599
597
|
ref: d,
|
|
600
598
|
type: "button",
|
|
601
|
-
className:
|
|
599
|
+
className: M,
|
|
602
600
|
"data-active": e || void 0,
|
|
603
601
|
"data-sidebar": "menu-button",
|
|
604
602
|
"data-kumo-component": "Sidebar",
|
|
605
603
|
"data-kumo-part": "menu-button",
|
|
606
604
|
"data-size": i,
|
|
607
|
-
...
|
|
605
|
+
...c,
|
|
608
606
|
children: k
|
|
609
607
|
}
|
|
610
|
-
),
|
|
611
|
-
|
|
608
|
+
), l && (v = /* @__PURE__ */ n(
|
|
609
|
+
Oe,
|
|
612
610
|
{
|
|
613
|
-
content:
|
|
611
|
+
content: l,
|
|
612
|
+
disabled: !(r === "collapsed" && !p),
|
|
614
613
|
side: "right",
|
|
615
|
-
render:
|
|
614
|
+
render: v
|
|
616
615
|
}
|
|
617
|
-
)),
|
|
616
|
+
)), g ? v : /* @__PURE__ */ n(
|
|
618
617
|
"li",
|
|
619
618
|
{
|
|
620
619
|
"data-sidebar": "menu-item",
|
|
621
620
|
className: "relative group-data-[state=collapsed]/sidebar:overflow-hidden",
|
|
622
|
-
children:
|
|
621
|
+
children: v
|
|
623
622
|
}
|
|
624
623
|
);
|
|
625
624
|
}
|
|
@@ -630,7 +629,7 @@ const pe = x(({ className: t, ...a }, e) => /* @__PURE__ */ n(
|
|
|
630
629
|
{
|
|
631
630
|
ref: e,
|
|
632
631
|
"data-sidebar": "menu-badge",
|
|
633
|
-
className:
|
|
632
|
+
className: s(
|
|
634
633
|
"inline-flex shrink-0 items-center rounded-full border border-dashed border-kumo-line",
|
|
635
634
|
"select-none px-1.5 py-0.5 text-[11px]/none font-medium text-kumo-strong",
|
|
636
635
|
// Hidden when collapsed
|
|
@@ -641,12 +640,12 @@ const pe = x(({ className: t, ...a }, e) => /* @__PURE__ */ n(
|
|
|
641
640
|
}
|
|
642
641
|
));
|
|
643
642
|
pe.displayName = "Sidebar.MenuBadge";
|
|
644
|
-
const fe = x(({ className: t, children: a, ...e }, i) => /* @__PURE__ */
|
|
643
|
+
const fe = x(({ className: t, children: a, ...e }, i) => /* @__PURE__ */ W(
|
|
645
644
|
"ul",
|
|
646
645
|
{
|
|
647
646
|
ref: i,
|
|
648
647
|
"data-sidebar": "menu-sub",
|
|
649
|
-
className:
|
|
648
|
+
className: s(
|
|
650
649
|
"relative m-0 flex min-w-0 list-none flex-col gap-y-px p-0 pl-7 pr-0 overflow-hidden",
|
|
651
650
|
t
|
|
652
651
|
),
|
|
@@ -663,14 +662,14 @@ const ge = x(({ className: t, children: a, ...e }, i) => /* @__PURE__ */ n(ce.Pr
|
|
|
663
662
|
{
|
|
664
663
|
ref: i,
|
|
665
664
|
"data-sidebar": "menu-sub-item",
|
|
666
|
-
className:
|
|
665
|
+
className: s("relative", t),
|
|
667
666
|
...e,
|
|
668
667
|
children: a
|
|
669
668
|
}
|
|
670
669
|
) }));
|
|
671
670
|
ge.displayName = "Sidebar.MenuSubItem";
|
|
672
|
-
const he = x(({ className: t, active: a = !1, href: e,
|
|
673
|
-
const
|
|
671
|
+
const he = x(({ className: t, active: a = !1, href: e, target: i, children: o, ...h }, l) => {
|
|
672
|
+
const u = ee(), c = L(ce), d = s(
|
|
674
673
|
"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
674
|
"before:absolute before:inset-x-0 before:-inset-y-px",
|
|
676
675
|
"text-kumo-default transition-[color] duration-150",
|
|
@@ -678,39 +677,40 @@ const he = x(({ className: t, active: a = !1, href: e, children: i, ...s }, g) =
|
|
|
678
677
|
a && "bg-(--sidebar-active-bg)",
|
|
679
678
|
"focus:outline-none focus-visible:text-kumo-strong focus-visible:bg-(--sidebar-active-bg)",
|
|
680
679
|
t
|
|
681
|
-
),
|
|
682
|
-
|
|
683
|
-
(
|
|
680
|
+
), r = /* @__PURE__ */ n("span", { className: "flex flex-1 items-center gap-2 min-w-0 text-left overflow-hidden", children: _.Children.map(
|
|
681
|
+
o,
|
|
682
|
+
(f) => typeof f == "string" || typeof f == "number" ? /* @__PURE__ */ n("span", { className: "truncate", children: f }) : f
|
|
684
683
|
) });
|
|
685
|
-
let
|
|
686
|
-
return e ?
|
|
687
|
-
|
|
684
|
+
let p;
|
|
685
|
+
return e ? p = /* @__PURE__ */ n(
|
|
686
|
+
u,
|
|
688
687
|
{
|
|
689
|
-
ref:
|
|
690
|
-
className:
|
|
688
|
+
ref: l,
|
|
689
|
+
className: s(d, "no-underline!"),
|
|
691
690
|
href: e,
|
|
692
691
|
to: e,
|
|
692
|
+
target: i,
|
|
693
693
|
"data-active": a || void 0,
|
|
694
694
|
"data-sidebar": "menu-sub-button",
|
|
695
695
|
"data-kumo-component": "Sidebar",
|
|
696
696
|
"data-kumo-part": "menu-sub-button-link",
|
|
697
|
-
onClick:
|
|
698
|
-
children:
|
|
697
|
+
onClick: h.onClick,
|
|
698
|
+
children: r
|
|
699
699
|
}
|
|
700
|
-
) :
|
|
700
|
+
) : p = /* @__PURE__ */ n(
|
|
701
701
|
"button",
|
|
702
702
|
{
|
|
703
|
-
ref:
|
|
703
|
+
ref: l,
|
|
704
704
|
type: "button",
|
|
705
|
-
className:
|
|
705
|
+
className: d,
|
|
706
706
|
"data-active": a || void 0,
|
|
707
707
|
"data-sidebar": "menu-sub-button",
|
|
708
708
|
"data-kumo-component": "Sidebar",
|
|
709
709
|
"data-kumo-part": "menu-sub-button",
|
|
710
|
-
...
|
|
711
|
-
children:
|
|
710
|
+
...h,
|
|
711
|
+
children: r
|
|
712
712
|
}
|
|
713
|
-
),
|
|
713
|
+
), c ? p : /* @__PURE__ */ n("li", { "data-sidebar": "menu-sub-item", className: "relative", children: p });
|
|
714
714
|
});
|
|
715
715
|
he.displayName = "Sidebar.MenuSubButton";
|
|
716
716
|
const ve = x(({ className: t, ...a }, e) => /* @__PURE__ */ n(
|
|
@@ -718,7 +718,7 @@ const ve = x(({ className: t, ...a }, e) => /* @__PURE__ */ n(
|
|
|
718
718
|
{
|
|
719
719
|
ref: e,
|
|
720
720
|
"data-sidebar": "separator",
|
|
721
|
-
className:
|
|
721
|
+
className: s("my-3 px-2", t),
|
|
722
722
|
...a,
|
|
723
723
|
children: /* @__PURE__ */ n("div", { className: "border-b border-kumo-line" })
|
|
724
724
|
}
|
|
@@ -726,7 +726,7 @@ const ve = x(({ className: t, ...a }, e) => /* @__PURE__ */ n(
|
|
|
726
726
|
ve.displayName = "Sidebar.Separator";
|
|
727
727
|
function xe({ className: t }) {
|
|
728
728
|
const { open: a } = V();
|
|
729
|
-
return /* @__PURE__ */
|
|
729
|
+
return /* @__PURE__ */ W(
|
|
730
730
|
"svg",
|
|
731
731
|
{
|
|
732
732
|
width: "18",
|
|
@@ -738,14 +738,14 @@ function xe({ className: t }) {
|
|
|
738
738
|
stroke: "currentColor",
|
|
739
739
|
strokeWidth: "1.5",
|
|
740
740
|
strokeLinecap: "round",
|
|
741
|
-
className:
|
|
741
|
+
className: s("shrink-0", t),
|
|
742
742
|
children: [
|
|
743
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
744
|
/* @__PURE__ */ n(
|
|
745
745
|
"path",
|
|
746
746
|
{
|
|
747
747
|
d: "M6.25 7.25v9.5",
|
|
748
|
-
className:
|
|
748
|
+
className: s(
|
|
749
749
|
"transition-transform duration-(--sidebar-animation-duration) ease-(--sidebar-easing)",
|
|
750
750
|
a ? "translate-x-px" : "translate-x-[10.5px]"
|
|
751
751
|
)
|
|
@@ -756,26 +756,26 @@ function xe({ className: t }) {
|
|
|
756
756
|
);
|
|
757
757
|
}
|
|
758
758
|
xe.displayName = "Sidebar.PanelIcon";
|
|
759
|
-
const we = x(({ className: t, children: a, onClick: e, ...i },
|
|
760
|
-
const { open:
|
|
759
|
+
const we = x(({ className: t, children: a, onClick: e, ...i }, o) => {
|
|
760
|
+
const { open: h, toggleSidebar: l } = V();
|
|
761
761
|
return /* @__PURE__ */ n(
|
|
762
762
|
"button",
|
|
763
763
|
{
|
|
764
|
-
ref:
|
|
764
|
+
ref: o,
|
|
765
765
|
type: "button",
|
|
766
766
|
"data-sidebar": "trigger",
|
|
767
767
|
"data-kumo-component": "Sidebar",
|
|
768
768
|
"data-kumo-part": "trigger",
|
|
769
|
-
"aria-expanded":
|
|
770
|
-
"aria-label":
|
|
771
|
-
className:
|
|
769
|
+
"aria-expanded": h,
|
|
770
|
+
"aria-label": h ? "Collapse sidebar" : "Expand sidebar",
|
|
771
|
+
className: s(
|
|
772
772
|
"flex shrink-0 size-8.5 justify-center items-center rounded-lg cursor-pointer",
|
|
773
773
|
"text-kumo-subtle hover:text-kumo-default hover:bg-(--sidebar-active-bg)",
|
|
774
774
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-kumo-brand",
|
|
775
775
|
t
|
|
776
776
|
),
|
|
777
777
|
onClick: (u) => {
|
|
778
|
-
e?.(u),
|
|
778
|
+
e?.(u), l();
|
|
779
779
|
},
|
|
780
780
|
...i,
|
|
781
781
|
children: a ?? /* @__PURE__ */ n(xe, {})
|
|
@@ -795,7 +795,7 @@ const Se = x(({ className: t, ...a }, e) => {
|
|
|
795
795
|
"data-kumo-part": "rail",
|
|
796
796
|
"aria-label": "Toggle sidebar",
|
|
797
797
|
tabIndex: -1,
|
|
798
|
-
className:
|
|
798
|
+
className: s(
|
|
799
799
|
"absolute inset-y-0 z-1 hidden w-4 -translate-x-1/2 cursor-pointer transition-all",
|
|
800
800
|
"after:absolute after:inset-y-0 after:left-1/2 after:w-0.5",
|
|
801
801
|
"hover:after:bg-kumo-brand/20",
|
|
@@ -813,48 +813,48 @@ Se.displayName = "Sidebar.Rail";
|
|
|
813
813
|
const ye = x(({ className: t, ...a }, e) => {
|
|
814
814
|
const {
|
|
815
815
|
side: i,
|
|
816
|
-
resizable:
|
|
817
|
-
setIsResizing:
|
|
818
|
-
setWidth:
|
|
816
|
+
resizable: o,
|
|
817
|
+
setIsResizing: h,
|
|
818
|
+
setWidth: l,
|
|
819
819
|
setOpen: u,
|
|
820
|
-
open:
|
|
820
|
+
open: c,
|
|
821
821
|
minWidth: d,
|
|
822
822
|
width: r,
|
|
823
823
|
maxWidth: p
|
|
824
|
-
} = V(),
|
|
825
|
-
if (!
|
|
826
|
-
const k = 10,
|
|
827
|
-
|
|
828
|
-
const
|
|
824
|
+
} = V(), f = D(0), g = D(0), S = D(!1);
|
|
825
|
+
if (!o) return null;
|
|
826
|
+
const k = 10, M = (b) => {
|
|
827
|
+
b.preventDefault(), h(!0), f.current = b.clientX, S.current = !c;
|
|
828
|
+
const T = b.currentTarget.closest(
|
|
829
829
|
"[data-sidebar-wrapper]"
|
|
830
830
|
)?.querySelector("[data-sidebar='sidebar']");
|
|
831
|
-
|
|
832
|
-
const
|
|
833
|
-
|
|
834
|
-
},
|
|
835
|
-
const
|
|
831
|
+
g.current = T?.getBoundingClientRect().width ?? 0;
|
|
832
|
+
const C = () => {
|
|
833
|
+
h(!1), document.removeEventListener("pointermove", E), document.removeEventListener("pointerup", I);
|
|
834
|
+
}, E = (R) => {
|
|
835
|
+
const B = i === "left" ? R.clientX - f.current : f.current - R.clientX, N = g.current + B;
|
|
836
836
|
if (S.current) {
|
|
837
|
-
|
|
837
|
+
N >= d && (S.current = !1, u(!0), l(N));
|
|
838
838
|
return;
|
|
839
839
|
}
|
|
840
|
-
if (
|
|
840
|
+
if (N < d) {
|
|
841
841
|
u(!1), S.current = !0;
|
|
842
842
|
return;
|
|
843
843
|
}
|
|
844
|
-
|
|
845
|
-
},
|
|
846
|
-
|
|
844
|
+
l(N);
|
|
845
|
+
}, I = () => {
|
|
846
|
+
C();
|
|
847
847
|
};
|
|
848
|
-
document.addEventListener("pointermove",
|
|
849
|
-
},
|
|
850
|
-
const y = i === "left" ? "ArrowRight" : "ArrowLeft",
|
|
851
|
-
if (
|
|
852
|
-
|
|
853
|
-
else if (
|
|
854
|
-
|
|
855
|
-
const
|
|
856
|
-
|
|
857
|
-
} else
|
|
848
|
+
document.addEventListener("pointermove", E), document.addEventListener("pointerup", I);
|
|
849
|
+
}, v = (b) => {
|
|
850
|
+
const y = i === "left" ? "ArrowRight" : "ArrowLeft", T = i === "left" ? "ArrowLeft" : "ArrowRight";
|
|
851
|
+
if (b.key === y)
|
|
852
|
+
b.preventDefault(), c ? l(Math.min(r + k, p)) : (u(!0), l(d));
|
|
853
|
+
else if (b.key === T) {
|
|
854
|
+
b.preventDefault();
|
|
855
|
+
const C = r - k;
|
|
856
|
+
C < d ? u(!1) : l(C);
|
|
857
|
+
} else b.key === "Home" ? (b.preventDefault(), u(!1)) : b.key === "End" && (b.preventDefault(), u(!0), l(p));
|
|
858
858
|
};
|
|
859
859
|
return /* @__PURE__ */ n(
|
|
860
860
|
"button",
|
|
@@ -864,7 +864,7 @@ const ye = x(({ className: t, ...a }, e) => {
|
|
|
864
864
|
"aria-label": "Resize sidebar",
|
|
865
865
|
tabIndex: 0,
|
|
866
866
|
"data-sidebar": "resize-handle",
|
|
867
|
-
className:
|
|
867
|
+
className: s(
|
|
868
868
|
// Hit area inside the sidebar edge; thin visual line pinned to the edge via ::after
|
|
869
869
|
"absolute inset-y-0 z-2 hidden w-3 cursor-col-resize sm:block",
|
|
870
870
|
"after:absolute after:inset-y-0 after:w-0.5",
|
|
@@ -875,14 +875,14 @@ const ye = x(({ className: t, ...a }, e) => {
|
|
|
875
875
|
i === "right" && "left-0 after:left-0",
|
|
876
876
|
t
|
|
877
877
|
),
|
|
878
|
-
onPointerDown:
|
|
879
|
-
onKeyDown:
|
|
878
|
+
onPointerDown: M,
|
|
879
|
+
onKeyDown: v,
|
|
880
880
|
...a
|
|
881
881
|
}
|
|
882
882
|
);
|
|
883
883
|
});
|
|
884
884
|
ye.displayName = "Sidebar.ResizeHandle";
|
|
885
|
-
const
|
|
885
|
+
const X = G({
|
|
886
886
|
contentId: "",
|
|
887
887
|
isOpen: !0,
|
|
888
888
|
isCollapsible: !1,
|
|
@@ -895,68 +895,68 @@ const G = U({
|
|
|
895
895
|
open: a,
|
|
896
896
|
onOpenChange: e,
|
|
897
897
|
autoScrollOnOpen: i = !1,
|
|
898
|
-
className:
|
|
899
|
-
children:
|
|
900
|
-
...
|
|
898
|
+
className: o,
|
|
899
|
+
children: h,
|
|
900
|
+
...l
|
|
901
901
|
}, u) => {
|
|
902
|
-
const [
|
|
903
|
-
const
|
|
904
|
-
d(
|
|
902
|
+
const [c, d] = P(t), r = a ?? c, p = Le(), f = D(!1), g = w(() => {
|
|
903
|
+
const v = !r;
|
|
904
|
+
d(v), e?.(v), f.current = !1;
|
|
905
905
|
}, [r, e]), S = Z(
|
|
906
906
|
() => ({
|
|
907
907
|
contentId: p,
|
|
908
908
|
isOpen: r,
|
|
909
909
|
isCollapsible: !0,
|
|
910
910
|
autoScrollOnOpen: i,
|
|
911
|
-
toggle:
|
|
911
|
+
toggle: g
|
|
912
912
|
}),
|
|
913
|
-
[p, r, i,
|
|
913
|
+
[p, r, i, g]
|
|
914
914
|
), k = w(
|
|
915
|
-
(
|
|
916
|
-
!r &&
|
|
915
|
+
(v) => {
|
|
916
|
+
!r && v.target.matches(":focus-visible") && (f.current = !0, d(!0), e?.(!0));
|
|
917
917
|
},
|
|
918
918
|
[r, e]
|
|
919
|
-
),
|
|
920
|
-
(
|
|
921
|
-
|
|
919
|
+
), M = w(
|
|
920
|
+
(v) => {
|
|
921
|
+
f.current && !v.currentTarget.contains(v.relatedTarget) && !v.currentTarget.querySelector("[data-active]") && (f.current = !1, d(!1), e?.(!1));
|
|
922
922
|
},
|
|
923
923
|
[e]
|
|
924
924
|
);
|
|
925
|
-
return /* @__PURE__ */ n(
|
|
925
|
+
return /* @__PURE__ */ n(X.Provider, { value: S, children: /* @__PURE__ */ n(
|
|
926
926
|
"div",
|
|
927
927
|
{
|
|
928
928
|
ref: u,
|
|
929
929
|
"data-open": r || void 0,
|
|
930
|
-
className:
|
|
930
|
+
className: s("min-w-0", o),
|
|
931
931
|
onFocus: k,
|
|
932
|
-
onBlur:
|
|
933
|
-
...
|
|
934
|
-
children:
|
|
932
|
+
onBlur: M,
|
|
933
|
+
...l,
|
|
934
|
+
children: h
|
|
935
935
|
}
|
|
936
936
|
) });
|
|
937
937
|
}
|
|
938
938
|
);
|
|
939
939
|
ke.displayName = "Sidebar.Collapsible";
|
|
940
940
|
function Ne({ render: t }) {
|
|
941
|
-
const { contentId: a, isOpen: e, toggle: i } =
|
|
941
|
+
const { contentId: a, isOpen: e, toggle: i } = L(X);
|
|
942
942
|
return _.cloneElement(t, {
|
|
943
943
|
"aria-expanded": e,
|
|
944
944
|
"aria-controls": a,
|
|
945
945
|
"data-open": e || void 0,
|
|
946
|
-
onClick: (
|
|
947
|
-
const
|
|
948
|
-
|
|
946
|
+
onClick: (o) => {
|
|
947
|
+
const h = t.props.onClick;
|
|
948
|
+
h?.(o), i();
|
|
949
949
|
}
|
|
950
950
|
});
|
|
951
951
|
}
|
|
952
952
|
Ne.displayName = "Sidebar.CollapsibleTrigger";
|
|
953
953
|
const Me = x(({ className: t, children: a, ...e }, i) => {
|
|
954
|
-
const { contentId:
|
|
955
|
-
|
|
956
|
-
), { state:
|
|
957
|
-
|
|
958
|
-
if (!r || !
|
|
959
|
-
const
|
|
954
|
+
const { contentId: o, isOpen: h } = L(
|
|
955
|
+
X
|
|
956
|
+
), { state: l, animationDuration: u } = V(), { autoScrollOnOpen: c } = L(X), d = D(null), r = h && l !== "collapsed";
|
|
957
|
+
U(() => {
|
|
958
|
+
if (!r || !c) return;
|
|
959
|
+
const g = window.setTimeout(() => {
|
|
960
960
|
const S = window.matchMedia(
|
|
961
961
|
"(prefers-reduced-motion: reduce)"
|
|
962
962
|
).matches;
|
|
@@ -965,27 +965,27 @@ const Me = x(({ className: t, children: a, ...e }, i) => {
|
|
|
965
965
|
behavior: S ? "auto" : "smooth"
|
|
966
966
|
});
|
|
967
967
|
}, u);
|
|
968
|
-
return () => window.clearTimeout(
|
|
969
|
-
}, [r,
|
|
968
|
+
return () => window.clearTimeout(g);
|
|
969
|
+
}, [r, c, u]);
|
|
970
970
|
const p = w(
|
|
971
|
-
(
|
|
972
|
-
|
|
971
|
+
(g) => {
|
|
972
|
+
g && (r ? g.removeAttribute("inert") : g.setAttribute("inert", ""));
|
|
973
973
|
},
|
|
974
974
|
[r]
|
|
975
|
-
),
|
|
976
|
-
(
|
|
977
|
-
d.current =
|
|
975
|
+
), f = w(
|
|
976
|
+
(g) => {
|
|
977
|
+
d.current = g, p(g), typeof i == "function" ? i(g) : i && (i.current = g);
|
|
978
978
|
},
|
|
979
979
|
[i, p]
|
|
980
980
|
);
|
|
981
981
|
return /* @__PURE__ */ n(
|
|
982
982
|
"div",
|
|
983
983
|
{
|
|
984
|
-
ref:
|
|
985
|
-
id:
|
|
984
|
+
ref: f,
|
|
985
|
+
id: o,
|
|
986
986
|
role: "region",
|
|
987
987
|
"aria-hidden": !r,
|
|
988
|
-
className:
|
|
988
|
+
className: s(
|
|
989
989
|
"grid",
|
|
990
990
|
"transition-[grid-template-rows] duration-(--sidebar-animation-duration) ease-(--sidebar-easing)",
|
|
991
991
|
"motion-reduce:transition-none",
|
|
@@ -999,13 +999,13 @@ const Me = x(({ className: t, children: a, ...e }, i) => {
|
|
|
999
999
|
});
|
|
1000
1000
|
Me.displayName = "Sidebar.CollapsibleContent";
|
|
1001
1001
|
function Ce({ className: t }) {
|
|
1002
|
-
const { isOpen: a, isCollapsible: e } =
|
|
1002
|
+
const { isOpen: a, isCollapsible: e } = L(X);
|
|
1003
1003
|
return /* @__PURE__ */ n(
|
|
1004
1004
|
Be,
|
|
1005
1005
|
{
|
|
1006
1006
|
size: 12,
|
|
1007
1007
|
weight: "bold",
|
|
1008
|
-
className:
|
|
1008
|
+
className: s(
|
|
1009
1009
|
"ml-auto shrink-0 opacity-40 group-hover/menu-button:opacity-100 transition-[transform,rotate,opacity] duration-200",
|
|
1010
1010
|
e && a && "rotate-90",
|
|
1011
1011
|
// Hidden when sidebar is collapsed
|
|
@@ -1016,34 +1016,34 @@ function Ce({ className: t }) {
|
|
|
1016
1016
|
);
|
|
1017
1017
|
}
|
|
1018
1018
|
Ce.displayName = "Sidebar.MenuChevron";
|
|
1019
|
-
const Ie =
|
|
1019
|
+
const Ie = G(""), Re = x(
|
|
1020
1020
|
({
|
|
1021
1021
|
activeKey: t,
|
|
1022
1022
|
direction: a = "left",
|
|
1023
1023
|
className: e,
|
|
1024
1024
|
children: i,
|
|
1025
|
-
...
|
|
1026
|
-
},
|
|
1025
|
+
...o
|
|
1026
|
+
}, h) => {
|
|
1027
1027
|
const u = _.Children.toArray(i).findIndex(
|
|
1028
1028
|
(r) => _.isValidElement(r) && r.props.value === t
|
|
1029
|
-
),
|
|
1029
|
+
), c = typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, d = u > 0 ? `-${u * 100}%` : "0%";
|
|
1030
1030
|
return /* @__PURE__ */ n(Ie.Provider, { value: t, children: /* @__PURE__ */ n(
|
|
1031
1031
|
"div",
|
|
1032
1032
|
{
|
|
1033
|
-
ref:
|
|
1033
|
+
ref: h,
|
|
1034
1034
|
"data-sidebar": "sliding-views",
|
|
1035
|
-
className:
|
|
1035
|
+
className: s(
|
|
1036
1036
|
"flex flex-1 min-h-0 max-w-(--sidebar-width) overflow-hidden",
|
|
1037
1037
|
e
|
|
1038
1038
|
),
|
|
1039
|
-
...
|
|
1039
|
+
...o,
|
|
1040
1040
|
children: /* @__PURE__ */ n(
|
|
1041
1041
|
"div",
|
|
1042
1042
|
{
|
|
1043
1043
|
className: "flex min-h-0 w-full shrink-0",
|
|
1044
1044
|
style: {
|
|
1045
1045
|
transform: `translateX(${d})`,
|
|
1046
|
-
transition:
|
|
1046
|
+
transition: c ? "none" : "transform var(--sidebar-animation-duration) var(--sidebar-easing)"
|
|
1047
1047
|
},
|
|
1048
1048
|
children: i
|
|
1049
1049
|
}
|
|
@@ -1054,28 +1054,28 @@ const Ie = U(""), Re = x(
|
|
|
1054
1054
|
);
|
|
1055
1055
|
Re.displayName = "Sidebar.SlidingViews";
|
|
1056
1056
|
const Ae = x(
|
|
1057
|
-
({ value: t, className: a, children: e, ...i },
|
|
1058
|
-
const
|
|
1057
|
+
({ value: t, className: a, children: e, ...i }, o) => {
|
|
1058
|
+
const l = L(Ie) === t, u = w(
|
|
1059
1059
|
(d) => {
|
|
1060
|
-
d && (
|
|
1060
|
+
d && (l ? d.removeAttribute("inert") : d.setAttribute("inert", ""));
|
|
1061
1061
|
},
|
|
1062
|
-
[
|
|
1063
|
-
),
|
|
1062
|
+
[l]
|
|
1063
|
+
), c = w(
|
|
1064
1064
|
(d) => {
|
|
1065
|
-
u(d), typeof
|
|
1065
|
+
u(d), typeof o == "function" ? o(d) : o && (o.current = d);
|
|
1066
1066
|
},
|
|
1067
|
-
[
|
|
1067
|
+
[o, u]
|
|
1068
1068
|
);
|
|
1069
1069
|
return /* @__PURE__ */ n(
|
|
1070
1070
|
"div",
|
|
1071
1071
|
{
|
|
1072
|
-
ref:
|
|
1072
|
+
ref: c,
|
|
1073
1073
|
"data-sidebar": "sliding-view",
|
|
1074
1074
|
"data-value": t,
|
|
1075
|
-
"aria-hidden": !
|
|
1076
|
-
className:
|
|
1075
|
+
"aria-hidden": !l,
|
|
1076
|
+
className: s(
|
|
1077
1077
|
"flex w-full shrink-0 flex-col min-h-0",
|
|
1078
|
-
!
|
|
1078
|
+
!l && "pointer-events-none",
|
|
1079
1079
|
a
|
|
1080
1080
|
),
|
|
1081
1081
|
...i,
|
|
@@ -1141,4 +1141,4 @@ export {
|
|
|
1141
1141
|
V as y,
|
|
1142
1142
|
J as z
|
|
1143
1143
|
};
|
|
1144
|
-
//# sourceMappingURL=sidebar-
|
|
1144
|
+
//# sourceMappingURL=sidebar-7whsl7qwrw5b6ip8.js.map
|