@clasing/ui 2.9.1 → 2.9.3
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/dist/{button-DSpGxL2e.js → button-CKrOlPSD.js} +17 -19
- package/dist/collapsible-DezttNhr.js +48 -0
- package/dist/components/alert-dialog.js +1 -1
- package/dist/components/breadcrumb.js +17 -4
- package/dist/components/button-group.js +29 -5
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/collapsible.js +4 -46
- package/dist/components/dropdown-menu.js +16 -311
- package/dist/components/field.d.ts +26 -0
- package/dist/components/field.js +66 -0
- package/dist/components/input.js +1 -1
- package/dist/components/pagination.d.ts +38 -0
- package/dist/components/pagination.js +107 -0
- package/dist/components/phone-input.js +1 -1
- package/dist/components/radio-group.d.ts +5 -0
- package/dist/components/radio-group.js +45 -0
- package/dist/components/select.js +10 -2
- package/dist/components/sheet.js +9 -164
- package/dist/components/sidebar.d.ts +83 -0
- package/dist/components/sidebar.js +820 -0
- package/dist/components/skeleton.js +2 -12
- package/dist/components/tabs.d.ts +13 -0
- package/dist/components/tabs.js +81 -0
- package/dist/components/tree.d.ts +37 -0
- package/dist/components/tree.js +312 -0
- package/dist/dropdown-menu-VOZwAyVb.js +313 -0
- package/dist/entries/field.d.ts +1 -0
- package/dist/entries/pagination.d.ts +1 -0
- package/dist/entries/radio-group.d.ts +1 -0
- package/dist/entries/sidebar.d.ts +2 -0
- package/dist/entries/tabs.d.ts +1 -0
- package/dist/entries/tree.d.ts +1 -0
- package/dist/hooks/useIsMobile.d.ts +2 -0
- package/dist/{input-D9gqZjs0.js → input-BlcRuIEB.js} +1 -1
- package/dist/sheet-CwXaadwy.js +166 -0
- package/dist/skeleton-DcjuJ5_d.js +14 -0
- package/dist/ui.css +25 -54
- package/package.json +31 -4
|
@@ -0,0 +1,820 @@
|
|
|
1
|
+
import { j as t, c as n } from "../index-C_XDkVGm.js";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { useState as _, useEffect as I } from "react";
|
|
4
|
+
import { cva as k } from "class-variance-authority";
|
|
5
|
+
import { CaretRightIcon as D, LayoutIcon as E } from "@phosphor-icons/react";
|
|
6
|
+
import { Slot as w } from "@radix-ui/react-slot";
|
|
7
|
+
import { B as z } from "../button-CKrOlPSD.js";
|
|
8
|
+
import { C as T, a as O, b as B } from "../collapsible-DezttNhr.js";
|
|
9
|
+
import { D as R } from "../divider-DnPsAXol.js";
|
|
10
|
+
import { D as A, n as L, b as K, d as H } from "../dropdown-menu-VOZwAyVb.js";
|
|
11
|
+
import { I as G } from "../input-BlcRuIEB.js";
|
|
12
|
+
import { S as W, b as $, e as q, f as P, c as V } from "../sheet-CwXaadwy.js";
|
|
13
|
+
import { S as M } from "../skeleton-DcjuJ5_d.js";
|
|
14
|
+
import { T as F, c as U, a as X, b as Y } from "../tooltip-CC_kyHTm.js";
|
|
15
|
+
const N = 768;
|
|
16
|
+
function J() {
|
|
17
|
+
const [a, e] = _(
|
|
18
|
+
() => typeof window < "u" ? window.innerWidth < N : void 0
|
|
19
|
+
);
|
|
20
|
+
return I(() => {
|
|
21
|
+
const r = window.matchMedia(`(max-width: ${N - 1}px)`), i = () => {
|
|
22
|
+
e(window.innerWidth < N);
|
|
23
|
+
};
|
|
24
|
+
return r.addEventListener("change", i), () => r.removeEventListener("change", i);
|
|
25
|
+
}, []), !!a;
|
|
26
|
+
}
|
|
27
|
+
const Q = "sidebar_state", Z = 3600 * 24 * 7, ee = "16rem", ae = "18rem", te = "4.25rem", re = "b", y = d.createContext(null);
|
|
28
|
+
function j() {
|
|
29
|
+
const a = d.useContext(y);
|
|
30
|
+
if (!a)
|
|
31
|
+
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
32
|
+
return a;
|
|
33
|
+
}
|
|
34
|
+
function Ce({
|
|
35
|
+
defaultOpen: a = !0,
|
|
36
|
+
open: e,
|
|
37
|
+
onOpenChange: r,
|
|
38
|
+
className: i,
|
|
39
|
+
style: s,
|
|
40
|
+
children: o,
|
|
41
|
+
...x
|
|
42
|
+
}) {
|
|
43
|
+
const u = J(), [m, c] = d.useState(!1), [S, C] = d.useState(a), b = e ?? S, f = d.useCallback(
|
|
44
|
+
(l) => {
|
|
45
|
+
const p = typeof l == "function" ? l(b) : l;
|
|
46
|
+
r ? r(p) : C(p), document.cookie = `${Q}=${p}; path=/; max-age=${Z}`;
|
|
47
|
+
},
|
|
48
|
+
[r, b]
|
|
49
|
+
), g = d.useCallback(() => u ? c((l) => !l) : f((l) => !l), [u, f, c]);
|
|
50
|
+
d.useEffect(() => {
|
|
51
|
+
const l = (p) => {
|
|
52
|
+
p.key === re && (p.metaKey || p.ctrlKey) && (p.preventDefault(), g());
|
|
53
|
+
};
|
|
54
|
+
return window.addEventListener("keydown", l), () => window.removeEventListener("keydown", l);
|
|
55
|
+
}, [g]);
|
|
56
|
+
const h = b ? "expanded" : "collapsed", v = d.useMemo(
|
|
57
|
+
() => ({
|
|
58
|
+
state: h,
|
|
59
|
+
open: b,
|
|
60
|
+
setOpen: f,
|
|
61
|
+
isMobile: u,
|
|
62
|
+
openMobile: m,
|
|
63
|
+
setOpenMobile: c,
|
|
64
|
+
toggleSidebar: g
|
|
65
|
+
}),
|
|
66
|
+
[h, b, f, u, m, c, g]
|
|
67
|
+
);
|
|
68
|
+
return /* @__PURE__ */ t.jsx(y.Provider, { value: v, children: /* @__PURE__ */ t.jsx(Y, { delayDuration: 0, children: /* @__PURE__ */ t.jsx(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
"data-slot": "sidebar-wrapper",
|
|
72
|
+
style: {
|
|
73
|
+
"--sidebar-width": ee,
|
|
74
|
+
"--sidebar-width-icon": te,
|
|
75
|
+
...s
|
|
76
|
+
},
|
|
77
|
+
className: n(
|
|
78
|
+
`
|
|
79
|
+
group/sidebar-wrapper flex min-h-svh w-full
|
|
80
|
+
has-data-[variant=inset]:bg-sidebar
|
|
81
|
+
`,
|
|
82
|
+
i
|
|
83
|
+
),
|
|
84
|
+
...x,
|
|
85
|
+
children: o
|
|
86
|
+
}
|
|
87
|
+
) }) });
|
|
88
|
+
}
|
|
89
|
+
function Ne({
|
|
90
|
+
side: a = "left",
|
|
91
|
+
variant: e = "sidebar",
|
|
92
|
+
collapsible: r = "icon",
|
|
93
|
+
className: i,
|
|
94
|
+
children: s,
|
|
95
|
+
...o
|
|
96
|
+
}) {
|
|
97
|
+
const { isMobile: x, state: u, openMobile: m, setOpenMobile: c } = j();
|
|
98
|
+
return r === "none" ? /* @__PURE__ */ t.jsx(
|
|
99
|
+
"div",
|
|
100
|
+
{
|
|
101
|
+
"data-slot": "sidebar",
|
|
102
|
+
className: n(
|
|
103
|
+
"flex h-full w-(--sidebar-width) flex-col bg-sidebar",
|
|
104
|
+
i
|
|
105
|
+
),
|
|
106
|
+
...o,
|
|
107
|
+
children: s
|
|
108
|
+
}
|
|
109
|
+
) : x ? /* @__PURE__ */ t.jsx(W, { open: m, onOpenChange: c, ...o, children: /* @__PURE__ */ t.jsxs(
|
|
110
|
+
$,
|
|
111
|
+
{
|
|
112
|
+
"data-sidebar": "sidebar",
|
|
113
|
+
"data-slot": "sidebar",
|
|
114
|
+
"data-mobile": "true",
|
|
115
|
+
className: `\r
|
|
116
|
+
w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground\r
|
|
117
|
+
[&>button]:hidden\r
|
|
118
|
+
`,
|
|
119
|
+
style: {
|
|
120
|
+
"--sidebar-width": ae
|
|
121
|
+
},
|
|
122
|
+
side: a,
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ t.jsxs(q, { className: "sr-only", children: [
|
|
125
|
+
/* @__PURE__ */ t.jsx(P, { children: "Sidebar" }),
|
|
126
|
+
/* @__PURE__ */ t.jsx(V, { children: "Displays the mobile sidebar." })
|
|
127
|
+
] }),
|
|
128
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex size-full flex-col", children: s })
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
) }) : /* @__PURE__ */ t.jsxs(
|
|
132
|
+
"div",
|
|
133
|
+
{
|
|
134
|
+
className: `\r
|
|
135
|
+
group peer hidden text-sidebar-foreground\r
|
|
136
|
+
md:block\r
|
|
137
|
+
`,
|
|
138
|
+
"data-state": u,
|
|
139
|
+
"data-collapsible": u === "collapsed" ? r : "",
|
|
140
|
+
"data-variant": e,
|
|
141
|
+
"data-side": a,
|
|
142
|
+
"data-slot": "sidebar",
|
|
143
|
+
children: [
|
|
144
|
+
/* @__PURE__ */ t.jsx(
|
|
145
|
+
"div",
|
|
146
|
+
{
|
|
147
|
+
"data-slot": "sidebar-gap",
|
|
148
|
+
className: n(
|
|
149
|
+
`
|
|
150
|
+
relative w-(--sidebar-width) bg-transparent transition-[width]
|
|
151
|
+
duration-200 ease-linear
|
|
152
|
+
`,
|
|
153
|
+
"group-data-[collapsible=offcanvas]:w-0",
|
|
154
|
+
"group-data-[side=right]:rotate-180",
|
|
155
|
+
e === "floating" || e === "inset" ? `
|
|
156
|
+
group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]
|
|
157
|
+
` : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
/* @__PURE__ */ t.jsx(
|
|
162
|
+
"div",
|
|
163
|
+
{
|
|
164
|
+
"data-slot": "sidebar-container",
|
|
165
|
+
className: n(
|
|
166
|
+
`
|
|
167
|
+
fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width)
|
|
168
|
+
transition-[left,right,width] duration-200 ease-linear
|
|
169
|
+
md:flex
|
|
170
|
+
`,
|
|
171
|
+
a === "left" ? `
|
|
172
|
+
left-0
|
|
173
|
+
group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]
|
|
174
|
+
` : `
|
|
175
|
+
right-0
|
|
176
|
+
group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]
|
|
177
|
+
`,
|
|
178
|
+
// Adjust the padding for floating and inset variants.
|
|
179
|
+
e === "floating" || e === "inset" ? `
|
|
180
|
+
p-2
|
|
181
|
+
group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]
|
|
182
|
+
` : `
|
|
183
|
+
group-data-[collapsible=icon]:w-(--sidebar-width-icon)
|
|
184
|
+
group-data-[side=left]:border-r
|
|
185
|
+
group-data-[side=right]:border-l
|
|
186
|
+
`,
|
|
187
|
+
i
|
|
188
|
+
),
|
|
189
|
+
...o,
|
|
190
|
+
children: /* @__PURE__ */ t.jsx(
|
|
191
|
+
"div",
|
|
192
|
+
{
|
|
193
|
+
"data-sidebar": "sidebar",
|
|
194
|
+
"data-slot": "sidebar-inner",
|
|
195
|
+
className: `\r
|
|
196
|
+
flex size-full flex-col bg-sidebar\r
|
|
197
|
+
group-data-[variant=floating]:rounded-lg\r
|
|
198
|
+
group-data-[variant=floating]:border\r
|
|
199
|
+
group-data-[variant=floating]:border-sidebar-border\r
|
|
200
|
+
group-data-[variant=floating]:shadow-sm\r
|
|
201
|
+
`,
|
|
202
|
+
children: s
|
|
203
|
+
}
|
|
204
|
+
)
|
|
205
|
+
}
|
|
206
|
+
)
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
function Me({
|
|
212
|
+
className: a,
|
|
213
|
+
onClick: e,
|
|
214
|
+
...r
|
|
215
|
+
}) {
|
|
216
|
+
const { toggleSidebar: i } = j();
|
|
217
|
+
return /* @__PURE__ */ t.jsx(
|
|
218
|
+
z,
|
|
219
|
+
{
|
|
220
|
+
"data-sidebar": "trigger",
|
|
221
|
+
"data-slot": "sidebar-trigger",
|
|
222
|
+
variant: "ghost",
|
|
223
|
+
className: n("border", a),
|
|
224
|
+
onClick: (s) => {
|
|
225
|
+
e?.(s), i();
|
|
226
|
+
},
|
|
227
|
+
...r,
|
|
228
|
+
children: /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsx(E, {}) })
|
|
229
|
+
}
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
function ye({ className: a, ...e }) {
|
|
233
|
+
const { toggleSidebar: r } = j();
|
|
234
|
+
return /* @__PURE__ */ t.jsx(
|
|
235
|
+
"button",
|
|
236
|
+
{
|
|
237
|
+
"data-sidebar": "rail",
|
|
238
|
+
"data-slot": "sidebar-rail",
|
|
239
|
+
"aria-label": "Toggle Sidebar",
|
|
240
|
+
tabIndex: -1,
|
|
241
|
+
onClick: r,
|
|
242
|
+
title: "Toggle Sidebar",
|
|
243
|
+
className: n(
|
|
244
|
+
`
|
|
245
|
+
absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all
|
|
246
|
+
ease-linear
|
|
247
|
+
group-data-[side=left]:-right-4
|
|
248
|
+
group-data-[side=right]:left-0
|
|
249
|
+
after:absolute after:inset-y-0 after:left-1/2 after:w-[2px]
|
|
250
|
+
hover:after:bg-sidebar-border
|
|
251
|
+
sm:flex
|
|
252
|
+
`,
|
|
253
|
+
`
|
|
254
|
+
in-data-[side=left]:cursor-w-resize
|
|
255
|
+
in-data-[side=right]:cursor-e-resize
|
|
256
|
+
`,
|
|
257
|
+
`
|
|
258
|
+
[[data-side=left][data-state=collapsed]_&]:cursor-e-resize
|
|
259
|
+
[[data-side=right][data-state=collapsed]_&]:cursor-w-resize
|
|
260
|
+
`,
|
|
261
|
+
`
|
|
262
|
+
group-data-[collapsible=offcanvas]:translate-x-0
|
|
263
|
+
group-data-[collapsible=offcanvas]:after:left-full
|
|
264
|
+
hover:group-data-[collapsible=offcanvas]:bg-sidebar
|
|
265
|
+
`,
|
|
266
|
+
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
267
|
+
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
268
|
+
a
|
|
269
|
+
),
|
|
270
|
+
...e
|
|
271
|
+
}
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
function _e({ className: a, ...e }) {
|
|
275
|
+
return /* @__PURE__ */ t.jsx(
|
|
276
|
+
"main",
|
|
277
|
+
{
|
|
278
|
+
"data-slot": "sidebar-inset",
|
|
279
|
+
className: n(
|
|
280
|
+
"relative flex w-full flex-1 flex-col bg-background",
|
|
281
|
+
`
|
|
282
|
+
md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0
|
|
283
|
+
md:peer-data-[variant=inset]:rounded-xl
|
|
284
|
+
md:peer-data-[variant=inset]:shadow-sm
|
|
285
|
+
md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2
|
|
286
|
+
`,
|
|
287
|
+
a
|
|
288
|
+
),
|
|
289
|
+
...e
|
|
290
|
+
}
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
function Ie({
|
|
294
|
+
className: a,
|
|
295
|
+
...e
|
|
296
|
+
}) {
|
|
297
|
+
return /* @__PURE__ */ t.jsx(
|
|
298
|
+
G,
|
|
299
|
+
{
|
|
300
|
+
"data-slot": "sidebar-input",
|
|
301
|
+
"data-sidebar": "input",
|
|
302
|
+
className: n("h-8 w-full bg-background shadow-none", a),
|
|
303
|
+
...e
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
function ke({ className: a, ...e }) {
|
|
308
|
+
return /* @__PURE__ */ t.jsx(
|
|
309
|
+
"div",
|
|
310
|
+
{
|
|
311
|
+
"data-slot": "sidebar-header",
|
|
312
|
+
"data-sidebar": "header",
|
|
313
|
+
className: n("flex flex-col gap-2 p-2", a),
|
|
314
|
+
...e
|
|
315
|
+
}
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
function De({ className: a, ...e }) {
|
|
319
|
+
return /* @__PURE__ */ t.jsx(
|
|
320
|
+
"div",
|
|
321
|
+
{
|
|
322
|
+
"data-slot": "sidebar-footer",
|
|
323
|
+
"data-sidebar": "footer",
|
|
324
|
+
className: n("flex flex-col gap-2 p-2", a),
|
|
325
|
+
...e
|
|
326
|
+
}
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
function Ee({
|
|
330
|
+
className: a,
|
|
331
|
+
...e
|
|
332
|
+
}) {
|
|
333
|
+
return /* @__PURE__ */ t.jsx(
|
|
334
|
+
R,
|
|
335
|
+
{
|
|
336
|
+
"data-slot": "sidebar-separator",
|
|
337
|
+
"data-sidebar": "separator",
|
|
338
|
+
className: n("mx-2 w-auto bg-sidebar-border", a),
|
|
339
|
+
...e
|
|
340
|
+
}
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
function ze({ className: a, ...e }) {
|
|
344
|
+
return /* @__PURE__ */ t.jsx(
|
|
345
|
+
"div",
|
|
346
|
+
{
|
|
347
|
+
"data-slot": "sidebar-content",
|
|
348
|
+
"data-sidebar": "content",
|
|
349
|
+
className: n(
|
|
350
|
+
`
|
|
351
|
+
flex min-h-0 flex-1 flex-col gap-2 overflow-auto
|
|
352
|
+
group-data-[collapsible=icon]:overflow-hidden
|
|
353
|
+
`,
|
|
354
|
+
a
|
|
355
|
+
),
|
|
356
|
+
...e
|
|
357
|
+
}
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
function Te({ className: a, ...e }) {
|
|
361
|
+
return /* @__PURE__ */ t.jsx(
|
|
362
|
+
"div",
|
|
363
|
+
{
|
|
364
|
+
"data-slot": "sidebar-group",
|
|
365
|
+
"data-sidebar": "group",
|
|
366
|
+
className: n("relative flex w-full min-w-0 flex-col p-2", a),
|
|
367
|
+
...e
|
|
368
|
+
}
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
function Oe({
|
|
372
|
+
className: a,
|
|
373
|
+
asChild: e = !1,
|
|
374
|
+
...r
|
|
375
|
+
}) {
|
|
376
|
+
const i = e ? w : "div";
|
|
377
|
+
return /* @__PURE__ */ t.jsx(
|
|
378
|
+
i,
|
|
379
|
+
{
|
|
380
|
+
"data-slot": "sidebar-group-label",
|
|
381
|
+
"data-sidebar": "group-label",
|
|
382
|
+
className: n(
|
|
383
|
+
`
|
|
384
|
+
flex h-8 shrink-0 items-center rounded-md px-2 label-sm
|
|
385
|
+
text-muted-foreground outline-hidden transition-[margin,opacity]
|
|
386
|
+
duration-200 ease-linear
|
|
387
|
+
focus-visible:ring-2
|
|
388
|
+
[&>svg]:size-4 [&>svg]:shrink-0
|
|
389
|
+
`,
|
|
390
|
+
`
|
|
391
|
+
group-data-[collapsible=icon]:-mt-8
|
|
392
|
+
group-data-[collapsible=icon]:opacity-0
|
|
393
|
+
`,
|
|
394
|
+
a
|
|
395
|
+
),
|
|
396
|
+
...r
|
|
397
|
+
}
|
|
398
|
+
);
|
|
399
|
+
}
|
|
400
|
+
function Be({
|
|
401
|
+
className: a,
|
|
402
|
+
asChild: e = !1,
|
|
403
|
+
...r
|
|
404
|
+
}) {
|
|
405
|
+
const i = e ? w : "button";
|
|
406
|
+
return /* @__PURE__ */ t.jsx(
|
|
407
|
+
i,
|
|
408
|
+
{
|
|
409
|
+
"data-slot": "sidebar-group-action",
|
|
410
|
+
"data-sidebar": "group-action",
|
|
411
|
+
className: n(
|
|
412
|
+
`
|
|
413
|
+
absolute top-3.5 right-3 flex aspect-square w-5 items-center
|
|
414
|
+
justify-center rounded-md p-0 text-sidebar-foreground outline-hidden
|
|
415
|
+
transition-transform
|
|
416
|
+
hover:bg-sidebar-accent hover:text-sidebar-accent-foreground
|
|
417
|
+
focus-visible:ring-2
|
|
418
|
+
[&>svg]:size-4 [&>svg]:shrink-0
|
|
419
|
+
`,
|
|
420
|
+
// Increases the hit area of the button on mobile.
|
|
421
|
+
`
|
|
422
|
+
after:absolute after:-inset-2
|
|
423
|
+
md:after:hidden
|
|
424
|
+
`,
|
|
425
|
+
"group-data-[collapsible=icon]:hidden",
|
|
426
|
+
a
|
|
427
|
+
),
|
|
428
|
+
...r
|
|
429
|
+
}
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
function Re({
|
|
433
|
+
className: a,
|
|
434
|
+
...e
|
|
435
|
+
}) {
|
|
436
|
+
return /* @__PURE__ */ t.jsx(
|
|
437
|
+
"div",
|
|
438
|
+
{
|
|
439
|
+
"data-slot": "sidebar-group-content",
|
|
440
|
+
"data-sidebar": "group-content",
|
|
441
|
+
className: n("w-full paragraph-sm", a),
|
|
442
|
+
...e
|
|
443
|
+
}
|
|
444
|
+
);
|
|
445
|
+
}
|
|
446
|
+
function Ae({ className: a, ...e }) {
|
|
447
|
+
return /* @__PURE__ */ t.jsx(
|
|
448
|
+
"ul",
|
|
449
|
+
{
|
|
450
|
+
"data-slot": "sidebar-menu",
|
|
451
|
+
"data-sidebar": "menu",
|
|
452
|
+
className: n("flex w-full min-w-0 flex-col gap-1", a),
|
|
453
|
+
...e
|
|
454
|
+
}
|
|
455
|
+
);
|
|
456
|
+
}
|
|
457
|
+
function ne({ className: a, ...e }) {
|
|
458
|
+
return /* @__PURE__ */ t.jsx(
|
|
459
|
+
"li",
|
|
460
|
+
{
|
|
461
|
+
"data-slot": "sidebar-menu-item",
|
|
462
|
+
"data-sidebar": "menu-item",
|
|
463
|
+
className: n("group/menu-item relative", a),
|
|
464
|
+
...e
|
|
465
|
+
}
|
|
466
|
+
);
|
|
467
|
+
}
|
|
468
|
+
const ie = k(
|
|
469
|
+
`
|
|
470
|
+
peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md
|
|
471
|
+
px-4 py-2.5 text-left paragraph-sm font-semibold outline-hidden
|
|
472
|
+
transition-[width,height,padding]
|
|
473
|
+
group-has-data-[sidebar=menu-action]/menu-item:pr-8
|
|
474
|
+
hover:bg-sidebar-accent hover:text-sidebar-accent-foreground
|
|
475
|
+
focus-visible:ring-2
|
|
476
|
+
active:bg-sidebar-accent active:text-sidebar-accent-foreground
|
|
477
|
+
disabled:pointer-events-none disabled:opacity-50
|
|
478
|
+
aria-disabled:pointer-events-none aria-disabled:opacity-50
|
|
479
|
+
data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium
|
|
480
|
+
data-[active=true]:text-sidebar-accent-foreground
|
|
481
|
+
data-[state=open]:hover:bg-sidebar-accent
|
|
482
|
+
data-[state=open]:hover:text-sidebar-accent-foreground
|
|
483
|
+
[&>span:last-child]:truncate
|
|
484
|
+
[&>svg]:size-5 [&>svg]:shrink-0
|
|
485
|
+
`,
|
|
486
|
+
{
|
|
487
|
+
variants: {
|
|
488
|
+
variant: {
|
|
489
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
490
|
+
outline: `
|
|
491
|
+
bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))]
|
|
492
|
+
hover:bg-sidebar-accent hover:text-sidebar-accent-foreground
|
|
493
|
+
hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]
|
|
494
|
+
`
|
|
495
|
+
},
|
|
496
|
+
size: {
|
|
497
|
+
default: "h-12",
|
|
498
|
+
sm: "h-7",
|
|
499
|
+
lg: `
|
|
500
|
+
h-12
|
|
501
|
+
group-data-[collapsible=icon]:p-0!
|
|
502
|
+
`
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
defaultVariants: {
|
|
506
|
+
variant: "default",
|
|
507
|
+
size: "default"
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
);
|
|
511
|
+
function se({
|
|
512
|
+
asChild: a = !1,
|
|
513
|
+
isActive: e = !1,
|
|
514
|
+
variant: r = "default",
|
|
515
|
+
size: i = "default",
|
|
516
|
+
tooltip: s,
|
|
517
|
+
dropdownItems: o,
|
|
518
|
+
className: x = "paragraph-sm",
|
|
519
|
+
...u
|
|
520
|
+
}) {
|
|
521
|
+
const m = a ? w : "button", { isMobile: c, state: S } = j(), [C, b] = d.useState(!1), f = d.useRef(null), g = () => {
|
|
522
|
+
f.current && clearTimeout(f.current), b(!0);
|
|
523
|
+
}, h = /* @__PURE__ */ t.jsx(
|
|
524
|
+
m,
|
|
525
|
+
{
|
|
526
|
+
"data-slot": "sidebar-menu-button",
|
|
527
|
+
"data-sidebar": "menu-button",
|
|
528
|
+
"data-size": i,
|
|
529
|
+
"data-active": e,
|
|
530
|
+
onMouseEnter: g,
|
|
531
|
+
className: n(ie({ variant: r, size: i }), x),
|
|
532
|
+
...u
|
|
533
|
+
}
|
|
534
|
+
);
|
|
535
|
+
return !s && (!o || S !== "collapsed") ? h : o ? /* @__PURE__ */ t.jsxs(A, { open: C, onOpenChange: b, children: [
|
|
536
|
+
/* @__PURE__ */ t.jsx(L, { asChild: !0, children: h }),
|
|
537
|
+
/* @__PURE__ */ t.jsx(K, { side: "right", align: "start", children: o.map((v) => /* @__PURE__ */ t.jsx(H, { asChild: !0, children: /* @__PURE__ */ t.jsx("a", { href: v.href, children: v.title }) }, v.href)) })
|
|
538
|
+
] }) : (typeof s == "string" && (s = {
|
|
539
|
+
children: s
|
|
540
|
+
}), /* @__PURE__ */ t.jsxs(F, { children: [
|
|
541
|
+
/* @__PURE__ */ t.jsx(U, { asChild: !0, children: h }),
|
|
542
|
+
/* @__PURE__ */ t.jsx(
|
|
543
|
+
X,
|
|
544
|
+
{
|
|
545
|
+
side: "right",
|
|
546
|
+
align: "center",
|
|
547
|
+
hidden: S !== "collapsed" || c,
|
|
548
|
+
...s
|
|
549
|
+
}
|
|
550
|
+
)
|
|
551
|
+
] }));
|
|
552
|
+
}
|
|
553
|
+
function Le({
|
|
554
|
+
className: a,
|
|
555
|
+
asChild: e = !1,
|
|
556
|
+
showOnHover: r = !1,
|
|
557
|
+
...i
|
|
558
|
+
}) {
|
|
559
|
+
const s = e ? w : "button";
|
|
560
|
+
return /* @__PURE__ */ t.jsx(
|
|
561
|
+
s,
|
|
562
|
+
{
|
|
563
|
+
"data-slot": "sidebar-menu-action",
|
|
564
|
+
"data-sidebar": "menu-action",
|
|
565
|
+
className: n(
|
|
566
|
+
`
|
|
567
|
+
absolute top-1.5 right-1 flex aspect-square w-5 items-center
|
|
568
|
+
justify-center rounded-md p-0 text-sidebar-foreground outline-hidden
|
|
569
|
+
transition-transform
|
|
570
|
+
peer-hover/menu-button:text-sidebar-accent-foreground
|
|
571
|
+
hover:bg-sidebar-accent hover:text-sidebar-accent-foreground
|
|
572
|
+
focus-visible:ring-2
|
|
573
|
+
[&>svg]:size-4 [&>svg]:shrink-0
|
|
574
|
+
`,
|
|
575
|
+
// Increases the hit area of the button on mobile.
|
|
576
|
+
`
|
|
577
|
+
after:absolute after:-inset-2
|
|
578
|
+
md:after:hidden
|
|
579
|
+
`,
|
|
580
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
581
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
582
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
583
|
+
"group-data-[collapsible=icon]:hidden",
|
|
584
|
+
r && `
|
|
585
|
+
group-focus-within/menu-item:opacity-100
|
|
586
|
+
group-hover/menu-item:opacity-100
|
|
587
|
+
peer-data-[active=true]/menu-button:text-sidebar-accent-foreground
|
|
588
|
+
data-[state=open]:opacity-100
|
|
589
|
+
md:opacity-0
|
|
590
|
+
`,
|
|
591
|
+
a
|
|
592
|
+
),
|
|
593
|
+
...i
|
|
594
|
+
}
|
|
595
|
+
);
|
|
596
|
+
}
|
|
597
|
+
function Ke({
|
|
598
|
+
className: a,
|
|
599
|
+
...e
|
|
600
|
+
}) {
|
|
601
|
+
return /* @__PURE__ */ t.jsx(
|
|
602
|
+
"div",
|
|
603
|
+
{
|
|
604
|
+
"data-slot": "sidebar-menu-badge",
|
|
605
|
+
"data-sidebar": "menu-badge",
|
|
606
|
+
className: n(
|
|
607
|
+
`
|
|
608
|
+
pointer-events-none absolute right-1 flex h-5 min-w-5 items-center
|
|
609
|
+
justify-center rounded-md px-1 text-xs font-medium
|
|
610
|
+
text-sidebar-foreground tabular-nums select-none
|
|
611
|
+
`,
|
|
612
|
+
`
|
|
613
|
+
peer-hover/menu-button:text-sidebar-accent-foreground
|
|
614
|
+
peer-data-[active=true]/menu-button:text-sidebar-accent-foreground
|
|
615
|
+
`,
|
|
616
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
617
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
618
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
619
|
+
"group-data-[collapsible=icon]:hidden",
|
|
620
|
+
a
|
|
621
|
+
),
|
|
622
|
+
...e
|
|
623
|
+
}
|
|
624
|
+
);
|
|
625
|
+
}
|
|
626
|
+
function He({
|
|
627
|
+
className: a,
|
|
628
|
+
showIcon: e = !1,
|
|
629
|
+
...r
|
|
630
|
+
}) {
|
|
631
|
+
const i = d.useMemo(() => "30%", []);
|
|
632
|
+
return /* @__PURE__ */ t.jsxs(
|
|
633
|
+
"div",
|
|
634
|
+
{
|
|
635
|
+
"data-slot": "sidebar-menu-skeleton",
|
|
636
|
+
"data-sidebar": "menu-skeleton",
|
|
637
|
+
className: n("flex h-8 items-center gap-2 rounded-md px-2", a),
|
|
638
|
+
...r,
|
|
639
|
+
children: [
|
|
640
|
+
e && /* @__PURE__ */ t.jsx(
|
|
641
|
+
M,
|
|
642
|
+
{
|
|
643
|
+
className: "size-4 rounded-md",
|
|
644
|
+
"data-sidebar": "menu-skeleton-icon"
|
|
645
|
+
}
|
|
646
|
+
),
|
|
647
|
+
/* @__PURE__ */ t.jsx(
|
|
648
|
+
M,
|
|
649
|
+
{
|
|
650
|
+
className: "h-4 max-w-(--skeleton-width) flex-1",
|
|
651
|
+
"data-sidebar": "menu-skeleton-text",
|
|
652
|
+
style: {
|
|
653
|
+
"--skeleton-width": i
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
)
|
|
657
|
+
]
|
|
658
|
+
}
|
|
659
|
+
);
|
|
660
|
+
}
|
|
661
|
+
function oe({ className: a, ...e }) {
|
|
662
|
+
return /* @__PURE__ */ t.jsx(
|
|
663
|
+
"ul",
|
|
664
|
+
{
|
|
665
|
+
"data-slot": "sidebar-menu-sub",
|
|
666
|
+
"data-sidebar": "menu-sub",
|
|
667
|
+
className: n(
|
|
668
|
+
`
|
|
669
|
+
mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l
|
|
670
|
+
border-sidebar-border px-2.5 py-0.5
|
|
671
|
+
`,
|
|
672
|
+
"group-data-[collapsible=icon]:hidden",
|
|
673
|
+
a
|
|
674
|
+
),
|
|
675
|
+
...e
|
|
676
|
+
}
|
|
677
|
+
);
|
|
678
|
+
}
|
|
679
|
+
function de({
|
|
680
|
+
className: a,
|
|
681
|
+
...e
|
|
682
|
+
}) {
|
|
683
|
+
return /* @__PURE__ */ t.jsx(
|
|
684
|
+
"li",
|
|
685
|
+
{
|
|
686
|
+
"data-slot": "sidebar-menu-sub-item",
|
|
687
|
+
"data-sidebar": "menu-sub-item",
|
|
688
|
+
className: n("group/menu-sub-item relative paragraph-lg", a),
|
|
689
|
+
...e
|
|
690
|
+
}
|
|
691
|
+
);
|
|
692
|
+
}
|
|
693
|
+
function le({
|
|
694
|
+
asChild: a = !1,
|
|
695
|
+
size: e = "sm",
|
|
696
|
+
isActive: r = !1,
|
|
697
|
+
className: i,
|
|
698
|
+
...s
|
|
699
|
+
}) {
|
|
700
|
+
const o = a ? w : "a";
|
|
701
|
+
return /* @__PURE__ */ t.jsx(
|
|
702
|
+
o,
|
|
703
|
+
{
|
|
704
|
+
"data-slot": "sidebar-menu-sub-button",
|
|
705
|
+
"data-sidebar": "menu-sub-button",
|
|
706
|
+
"data-size": e,
|
|
707
|
+
"data-active": r,
|
|
708
|
+
className: n(
|
|
709
|
+
`
|
|
710
|
+
flex h-12 min-w-0 -translate-x-px items-center gap-2 overflow-hidden
|
|
711
|
+
rounded-md px-4 py-2.5 font-semibold text-sidebar-foreground
|
|
712
|
+
outline-hidden
|
|
713
|
+
hover:bg-sidebar-accent hover:text-sidebar-accent-foreground
|
|
714
|
+
focus-visible:ring-2
|
|
715
|
+
active:bg-sidebar-accent active:text-sidebar-accent-foreground
|
|
716
|
+
disabled:pointer-events-none disabled:opacity-50
|
|
717
|
+
aria-disabled:pointer-events-none aria-disabled:opacity-50
|
|
718
|
+
[&>span:last-child]:truncate
|
|
719
|
+
[&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground
|
|
720
|
+
`,
|
|
721
|
+
`
|
|
722
|
+
data-[active=true]:bg-sidebar-accent
|
|
723
|
+
data-[active=true]:text-sidebar-accent-foreground
|
|
724
|
+
`,
|
|
725
|
+
e === "sm" && "paragraph-sm",
|
|
726
|
+
e === "md" && "paragraph-md",
|
|
727
|
+
e === "lg" && "paragraph-lg",
|
|
728
|
+
"group-data-[collapsible=icon]:hidden",
|
|
729
|
+
i
|
|
730
|
+
),
|
|
731
|
+
...s
|
|
732
|
+
}
|
|
733
|
+
);
|
|
734
|
+
}
|
|
735
|
+
function Ge({
|
|
736
|
+
defaultOpen: a = !1,
|
|
737
|
+
className: e,
|
|
738
|
+
children: r,
|
|
739
|
+
...i
|
|
740
|
+
}) {
|
|
741
|
+
return /* @__PURE__ */ t.jsx(
|
|
742
|
+
T,
|
|
743
|
+
{
|
|
744
|
+
asChild: !0,
|
|
745
|
+
defaultOpen: a,
|
|
746
|
+
className: n("group/collapsible", e),
|
|
747
|
+
...i,
|
|
748
|
+
children: /* @__PURE__ */ t.jsx(ne, { children: r })
|
|
749
|
+
}
|
|
750
|
+
);
|
|
751
|
+
}
|
|
752
|
+
function We({
|
|
753
|
+
className: a,
|
|
754
|
+
children: e,
|
|
755
|
+
dropdownItems: r,
|
|
756
|
+
...i
|
|
757
|
+
}) {
|
|
758
|
+
return /* @__PURE__ */ t.jsx(B, { asChild: !0, ...i, children: /* @__PURE__ */ t.jsxs(
|
|
759
|
+
se,
|
|
760
|
+
{
|
|
761
|
+
dropdownItems: r,
|
|
762
|
+
className: n("group-data-[collapsible=icon]:text-[0px]", a),
|
|
763
|
+
children: [
|
|
764
|
+
e,
|
|
765
|
+
/* @__PURE__ */ t.jsx(
|
|
766
|
+
D,
|
|
767
|
+
{
|
|
768
|
+
className: `\r
|
|
769
|
+
ml-auto transition-transform duration-200\r
|
|
770
|
+
group-data-[collapsible=icon]:hidden\r
|
|
771
|
+
group-data-[state=open]/collapsible:rotate-90\r
|
|
772
|
+
`
|
|
773
|
+
}
|
|
774
|
+
)
|
|
775
|
+
]
|
|
776
|
+
}
|
|
777
|
+
) });
|
|
778
|
+
}
|
|
779
|
+
function $e({
|
|
780
|
+
children: a,
|
|
781
|
+
...e
|
|
782
|
+
}) {
|
|
783
|
+
return /* @__PURE__ */ t.jsx(O, { asChild: !0, ...e, children: /* @__PURE__ */ t.jsx(oe, { children: a }) });
|
|
784
|
+
}
|
|
785
|
+
function qe({
|
|
786
|
+
children: a,
|
|
787
|
+
...e
|
|
788
|
+
}) {
|
|
789
|
+
return /* @__PURE__ */ t.jsx(de, { ...e, children: /* @__PURE__ */ t.jsx(le, { asChild: !0, children: /* @__PURE__ */ t.jsx("span", { children: a }) }) });
|
|
790
|
+
}
|
|
791
|
+
export {
|
|
792
|
+
Ne as Sidebar,
|
|
793
|
+
ze as SidebarContent,
|
|
794
|
+
De as SidebarFooter,
|
|
795
|
+
Te as SidebarGroup,
|
|
796
|
+
Be as SidebarGroupAction,
|
|
797
|
+
Re as SidebarGroupContent,
|
|
798
|
+
Oe as SidebarGroupLabel,
|
|
799
|
+
ke as SidebarHeader,
|
|
800
|
+
Ie as SidebarInput,
|
|
801
|
+
_e as SidebarInset,
|
|
802
|
+
Ae as SidebarMenu,
|
|
803
|
+
Le as SidebarMenuAction,
|
|
804
|
+
Ke as SidebarMenuBadge,
|
|
805
|
+
se as SidebarMenuButton,
|
|
806
|
+
ne as SidebarMenuItem,
|
|
807
|
+
He as SidebarMenuSkeleton,
|
|
808
|
+
oe as SidebarMenuSub,
|
|
809
|
+
le as SidebarMenuSubButton,
|
|
810
|
+
de as SidebarMenuSubItem,
|
|
811
|
+
Ce as SidebarProvider,
|
|
812
|
+
ye as SidebarRail,
|
|
813
|
+
Ee as SidebarSeparator,
|
|
814
|
+
Ge as SidebarSubMenu,
|
|
815
|
+
$e as SidebarSubMenuContent,
|
|
816
|
+
qe as SidebarSubMenuItem,
|
|
817
|
+
We as SidebarSubMenuTrigger,
|
|
818
|
+
Me as SidebarTrigger,
|
|
819
|
+
j as useSidebar
|
|
820
|
+
};
|