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