fina-react-ds 1.0.40 → 1.0.42
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/components/alert-dialog.js +1 -166
- package/dist/components/alert.js +1 -73
- package/dist/components/avatar.js +1 -58
- package/dist/components/badge.js +1 -44
- package/dist/components/button.js +1 -153
- package/dist/components/calendar.js +1 -205
- package/dist/components/card.js +1 -99
- package/dist/components/checkbox.js +1 -34
- package/dist/components/data-loader.js +1 -24
- package/dist/components/date-picker.js +1 -64
- package/dist/components/dialog.js +1 -145
- package/dist/components/dropdown-menu.js +1 -248
- package/dist/components/file-uploader.js +1 -108
- package/dist/components/form-color-picker.js +1 -29
- package/dist/components/form-date.js +1 -30
- package/dist/components/form-file-uploader.js +1 -32
- package/dist/components/form-image-uploader.js +1 -40
- package/dist/components/form-input.js +1 -35
- package/dist/components/form-select.js +1 -51
- package/dist/components/form-switch.js +1 -35
- package/dist/components/form-textarea.js +1 -35
- package/dist/components/form.js +1 -110
- package/dist/components/hover-card.js +1 -43
- package/dist/components/image-uploader.js +1 -130
- package/dist/components/index.js +1 -200
- package/dist/components/input.js +1 -26
- package/dist/components/label.js +1 -32
- package/dist/components/mode-toggle.js +1 -26
- package/dist/components/pagination.js +1 -128
- package/dist/components/password-rules-checker.js +1 -44
- package/dist/components/popover.js +1 -50
- package/dist/components/select.js +1 -53
- package/dist/components/separator.js +1 -29
- package/dist/components/sheet.js +1 -160
- package/dist/components/sidebar.js +1 -624
- package/dist/components/simple-pagination.js +1 -34
- package/dist/components/simple-tooltip.js +1 -17
- package/dist/components/skeleton.js +1 -18
- package/dist/components/sonner.js +1 -24
- package/dist/components/switch.js +1 -34
- package/dist/components/table.js +1 -124
- package/dist/components/tabs.js +1 -73
- package/dist/components/textarea.js +1 -23
- package/dist/components/tooltip.js +1 -61
- package/dist/hooks/index.js +1 -4
- package/dist/hooks/use-mobile.js +1 -17
- package/dist/index.js +1 -225
- package/dist/lib/arrays.js +1 -7
- package/dist/lib/dates.js +1 -21
- package/dist/lib/http.js +1 -56
- package/dist/lib/index.js +1 -27
- package/dist/lib/strings.js +1 -6
- package/dist/lib/utils.js +2 -31
- package/dist/lib/yup.js +1 -88
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +1 -12
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +1 -21
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchFn.js +1 -36
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +1 -18
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/formatDistance.js +1 -72
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/formatLong.js +1 -33
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/formatRelative.js +1 -13
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/localize.js +1 -123
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/match.js +1 -112
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr.js +1 -21
- package/dist/providers/loader-provider.js +1 -34
- package/dist/providers/theme-provider.js +1 -45
- package/package.json +1 -9
|
@@ -1,624 +1 @@
|
|
|
1
|
-
var z = Object.defineProperty;
|
|
2
|
-
var r = (a, e) => z(a, "name", { value: e, configurable: !0 });
|
|
3
|
-
import { jsx as t, jsxs as g } from "react/jsx-runtime";
|
|
4
|
-
import * as u from "react";
|
|
5
|
-
import { cva as I } from "class-variance-authority";
|
|
6
|
-
import { PanelLeftIcon as E } from "lucide-react";
|
|
7
|
-
import { Slot as v } from "radix-ui";
|
|
8
|
-
import { useIsMobile as D } from "../hooks/use-mobile.js";
|
|
9
|
-
import { cn as i } from "../lib/utils.js";
|
|
10
|
-
import { Button as R } from "./button.js";
|
|
11
|
-
import { Input as T } from "./input.js";
|
|
12
|
-
import { Separator as B } from "./separator.js";
|
|
13
|
-
import { Sheet as A, SheetContent as O, SheetHeader as H, SheetTitle as K, SheetDescription as j } from "./sheet.js";
|
|
14
|
-
import { Skeleton as k } from "./skeleton.js";
|
|
15
|
-
import { Tooltip as G, TooltipTrigger as L, TooltipContent as $, TooltipProvider as P } from "./tooltip.js";
|
|
16
|
-
const V = "sidebar_state", W = 3600 * 24 * 7, q = "16rem", F = "18rem", U = "3rem", X = "b", _ = u.createContext(null);
|
|
17
|
-
function N() {
|
|
18
|
-
const a = u.useContext(_);
|
|
19
|
-
if (!a)
|
|
20
|
-
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
21
|
-
return a;
|
|
22
|
-
}
|
|
23
|
-
r(N, "useSidebar");
|
|
24
|
-
function ce({
|
|
25
|
-
defaultOpen: a = !0,
|
|
26
|
-
open: e,
|
|
27
|
-
onOpenChange: n,
|
|
28
|
-
className: o,
|
|
29
|
-
style: d,
|
|
30
|
-
children: l,
|
|
31
|
-
...m
|
|
32
|
-
}) {
|
|
33
|
-
const c = D(), [p, b] = u.useState(!1), [x, M] = u.useState(a), h = e ?? x, w = u.useCallback(
|
|
34
|
-
(s) => {
|
|
35
|
-
const f = typeof s == "function" ? s(h) : s;
|
|
36
|
-
n ? n(f) : M(f), document.cookie = `${V}=${f}; path=/; max-age=${W}`;
|
|
37
|
-
},
|
|
38
|
-
[n, h]
|
|
39
|
-
), S = u.useCallback(() => c ? b((s) => !s) : w((s) => !s), [c, w, b]);
|
|
40
|
-
u.useEffect(() => {
|
|
41
|
-
const s = /* @__PURE__ */ r((f) => {
|
|
42
|
-
f.key === X && (f.metaKey || f.ctrlKey) && (f.preventDefault(), S());
|
|
43
|
-
}, "handleKeyDown");
|
|
44
|
-
return window.addEventListener("keydown", s), () => window.removeEventListener("keydown", s);
|
|
45
|
-
}, [S]);
|
|
46
|
-
const y = h ? "expanded" : "collapsed", C = u.useMemo(
|
|
47
|
-
() => ({
|
|
48
|
-
state: y,
|
|
49
|
-
open: h,
|
|
50
|
-
setOpen: w,
|
|
51
|
-
isMobile: c,
|
|
52
|
-
openMobile: p,
|
|
53
|
-
setOpenMobile: b,
|
|
54
|
-
toggleSidebar: S
|
|
55
|
-
}),
|
|
56
|
-
[y, h, w, c, p, b, S]
|
|
57
|
-
);
|
|
58
|
-
return /* @__PURE__ */ t(_.Provider, { value: C, children: /* @__PURE__ */ t(P, { delayDuration: 0, children: /* @__PURE__ */ t(
|
|
59
|
-
"div",
|
|
60
|
-
{
|
|
61
|
-
"data-slot": "sidebar-wrapper",
|
|
62
|
-
style: {
|
|
63
|
-
"--sidebar-width": q,
|
|
64
|
-
"--sidebar-width-icon": U,
|
|
65
|
-
...d
|
|
66
|
-
},
|
|
67
|
-
className: i(
|
|
68
|
-
"group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",
|
|
69
|
-
o
|
|
70
|
-
),
|
|
71
|
-
...m,
|
|
72
|
-
children: l
|
|
73
|
-
}
|
|
74
|
-
) }) });
|
|
75
|
-
}
|
|
76
|
-
r(ce, "SidebarProvider");
|
|
77
|
-
function ue({
|
|
78
|
-
side: a = "left",
|
|
79
|
-
variant: e = "sidebar",
|
|
80
|
-
collapsible: n = "offcanvas",
|
|
81
|
-
className: o,
|
|
82
|
-
children: d,
|
|
83
|
-
...l
|
|
84
|
-
}) {
|
|
85
|
-
const { isMobile: m, state: c, openMobile: p, setOpenMobile: b } = N();
|
|
86
|
-
return n === "none" ? /* @__PURE__ */ t(
|
|
87
|
-
"div",
|
|
88
|
-
{
|
|
89
|
-
"data-slot": "sidebar",
|
|
90
|
-
className: i(
|
|
91
|
-
"bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",
|
|
92
|
-
o
|
|
93
|
-
),
|
|
94
|
-
...l,
|
|
95
|
-
children: d
|
|
96
|
-
}
|
|
97
|
-
) : m ? /* @__PURE__ */ t(A, { open: p, onOpenChange: b, ...l, children: /* @__PURE__ */ g(
|
|
98
|
-
O,
|
|
99
|
-
{
|
|
100
|
-
"data-sidebar": "sidebar",
|
|
101
|
-
"data-slot": "sidebar",
|
|
102
|
-
"data-mobile": "true",
|
|
103
|
-
className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
|
|
104
|
-
style: {
|
|
105
|
-
"--sidebar-width": F
|
|
106
|
-
},
|
|
107
|
-
side: a,
|
|
108
|
-
children: [
|
|
109
|
-
/* @__PURE__ */ g(H, { className: "sr-only", children: [
|
|
110
|
-
/* @__PURE__ */ t(K, { children: "Sidebar" }),
|
|
111
|
-
/* @__PURE__ */ t(j, { children: "Displays the mobile sidebar." })
|
|
112
|
-
] }),
|
|
113
|
-
/* @__PURE__ */ t("div", { className: "flex h-full w-full flex-col", children: d })
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
) }) : /* @__PURE__ */ g(
|
|
117
|
-
"div",
|
|
118
|
-
{
|
|
119
|
-
className: "group peer text-sidebar-foreground hidden md:block",
|
|
120
|
-
"data-state": c,
|
|
121
|
-
"data-collapsible": c === "collapsed" ? n : "",
|
|
122
|
-
"data-variant": e,
|
|
123
|
-
"data-side": a,
|
|
124
|
-
"data-slot": "sidebar",
|
|
125
|
-
children: [
|
|
126
|
-
/* @__PURE__ */ t(
|
|
127
|
-
"div",
|
|
128
|
-
{
|
|
129
|
-
"data-slot": "sidebar-gap",
|
|
130
|
-
className: i(
|
|
131
|
-
"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
|
|
132
|
-
"group-data-[collapsible=offcanvas]:w-0",
|
|
133
|
-
"group-data-[side=right]:rotate-180",
|
|
134
|
-
e === "floating" || e === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
|
|
135
|
-
)
|
|
136
|
-
}
|
|
137
|
-
),
|
|
138
|
-
/* @__PURE__ */ t(
|
|
139
|
-
"div",
|
|
140
|
-
{
|
|
141
|
-
"data-slot": "sidebar-container",
|
|
142
|
-
className: i(
|
|
143
|
-
"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
|
|
144
|
-
a === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
145
|
-
// Adjust the padding for floating and inset variants.
|
|
146
|
-
e === "floating" || e === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
147
|
-
o
|
|
148
|
-
),
|
|
149
|
-
...l,
|
|
150
|
-
children: /* @__PURE__ */ t(
|
|
151
|
-
"div",
|
|
152
|
-
{
|
|
153
|
-
"data-sidebar": "sidebar",
|
|
154
|
-
"data-slot": "sidebar-inner",
|
|
155
|
-
className: "bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",
|
|
156
|
-
children: d
|
|
157
|
-
}
|
|
158
|
-
)
|
|
159
|
-
}
|
|
160
|
-
)
|
|
161
|
-
]
|
|
162
|
-
}
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
r(ue, "Sidebar");
|
|
166
|
-
function be({
|
|
167
|
-
className: a,
|
|
168
|
-
onClick: e,
|
|
169
|
-
...n
|
|
170
|
-
}) {
|
|
171
|
-
const { toggleSidebar: o } = N();
|
|
172
|
-
return /* @__PURE__ */ g(
|
|
173
|
-
R,
|
|
174
|
-
{
|
|
175
|
-
"data-sidebar": "trigger",
|
|
176
|
-
"data-slot": "sidebar-trigger",
|
|
177
|
-
variant: "ghost",
|
|
178
|
-
color: "dark",
|
|
179
|
-
size: "icon",
|
|
180
|
-
className: i("size-7", a),
|
|
181
|
-
onClick: /* @__PURE__ */ r((d) => {
|
|
182
|
-
e?.(d), o();
|
|
183
|
-
}, "onClick"),
|
|
184
|
-
...n,
|
|
185
|
-
children: [
|
|
186
|
-
/* @__PURE__ */ t(E, {}),
|
|
187
|
-
/* @__PURE__ */ t("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
188
|
-
]
|
|
189
|
-
}
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
r(be, "SidebarTrigger");
|
|
193
|
-
function fe({ className: a, ...e }) {
|
|
194
|
-
const { toggleSidebar: n } = N();
|
|
195
|
-
return /* @__PURE__ */ t(
|
|
196
|
-
"button",
|
|
197
|
-
{
|
|
198
|
-
"data-sidebar": "rail",
|
|
199
|
-
"data-slot": "sidebar-rail",
|
|
200
|
-
"aria-label": "Toggle Sidebar",
|
|
201
|
-
tabIndex: -1,
|
|
202
|
-
onClick: n,
|
|
203
|
-
title: "Toggle Sidebar",
|
|
204
|
-
className: i(
|
|
205
|
-
"hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex",
|
|
206
|
-
"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
|
|
207
|
-
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
208
|
-
"hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
|
|
209
|
-
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
210
|
-
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
211
|
-
a
|
|
212
|
-
),
|
|
213
|
-
...e
|
|
214
|
-
}
|
|
215
|
-
);
|
|
216
|
-
}
|
|
217
|
-
r(fe, "SidebarRail");
|
|
218
|
-
function pe({ className: a, ...e }) {
|
|
219
|
-
return /* @__PURE__ */ t(
|
|
220
|
-
"main",
|
|
221
|
-
{
|
|
222
|
-
"data-slot": "sidebar-inset",
|
|
223
|
-
className: i(
|
|
224
|
-
"bg-background relative flex w-full flex-1 flex-col",
|
|
225
|
-
"md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
|
|
226
|
-
a
|
|
227
|
-
),
|
|
228
|
-
...e
|
|
229
|
-
}
|
|
230
|
-
);
|
|
231
|
-
}
|
|
232
|
-
r(pe, "SidebarInset");
|
|
233
|
-
function ge({
|
|
234
|
-
className: a,
|
|
235
|
-
...e
|
|
236
|
-
}) {
|
|
237
|
-
return /* @__PURE__ */ t(
|
|
238
|
-
T,
|
|
239
|
-
{
|
|
240
|
-
"data-slot": "sidebar-input",
|
|
241
|
-
"data-sidebar": "input",
|
|
242
|
-
className: i("bg-background h-8 w-full shadow-none", a),
|
|
243
|
-
...e
|
|
244
|
-
}
|
|
245
|
-
);
|
|
246
|
-
}
|
|
247
|
-
r(ge, "SidebarInput");
|
|
248
|
-
function me({ className: a, ...e }) {
|
|
249
|
-
return /* @__PURE__ */ t(
|
|
250
|
-
"div",
|
|
251
|
-
{
|
|
252
|
-
"data-slot": "sidebar-header",
|
|
253
|
-
"data-sidebar": "header",
|
|
254
|
-
className: i("flex flex-col gap-2 p-2", a),
|
|
255
|
-
...e
|
|
256
|
-
}
|
|
257
|
-
);
|
|
258
|
-
}
|
|
259
|
-
r(me, "SidebarHeader");
|
|
260
|
-
function he({ className: a, ...e }) {
|
|
261
|
-
return /* @__PURE__ */ t(
|
|
262
|
-
"div",
|
|
263
|
-
{
|
|
264
|
-
"data-slot": "sidebar-footer",
|
|
265
|
-
"data-sidebar": "footer",
|
|
266
|
-
className: i("flex flex-col gap-2 p-2", a),
|
|
267
|
-
...e
|
|
268
|
-
}
|
|
269
|
-
);
|
|
270
|
-
}
|
|
271
|
-
r(he, "SidebarFooter");
|
|
272
|
-
function ve({
|
|
273
|
-
className: a,
|
|
274
|
-
...e
|
|
275
|
-
}) {
|
|
276
|
-
return /* @__PURE__ */ t(
|
|
277
|
-
B,
|
|
278
|
-
{
|
|
279
|
-
"data-slot": "sidebar-separator",
|
|
280
|
-
"data-sidebar": "separator",
|
|
281
|
-
className: i("bg-sidebar-border mx-2 w-auto", a),
|
|
282
|
-
...e
|
|
283
|
-
}
|
|
284
|
-
);
|
|
285
|
-
}
|
|
286
|
-
r(ve, "SidebarSeparator");
|
|
287
|
-
function xe({ className: a, ...e }) {
|
|
288
|
-
return /* @__PURE__ */ t(
|
|
289
|
-
"div",
|
|
290
|
-
{
|
|
291
|
-
"data-slot": "sidebar-content",
|
|
292
|
-
"data-sidebar": "content",
|
|
293
|
-
className: i(
|
|
294
|
-
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
295
|
-
a
|
|
296
|
-
),
|
|
297
|
-
...e
|
|
298
|
-
}
|
|
299
|
-
);
|
|
300
|
-
}
|
|
301
|
-
r(xe, "SidebarContent");
|
|
302
|
-
function we({ className: a, ...e }) {
|
|
303
|
-
return /* @__PURE__ */ t(
|
|
304
|
-
"div",
|
|
305
|
-
{
|
|
306
|
-
"data-slot": "sidebar-group",
|
|
307
|
-
"data-sidebar": "group",
|
|
308
|
-
className: i("relative flex w-full min-w-0 flex-col p-2", a),
|
|
309
|
-
...e
|
|
310
|
-
}
|
|
311
|
-
);
|
|
312
|
-
}
|
|
313
|
-
r(we, "SidebarGroup");
|
|
314
|
-
function Se({
|
|
315
|
-
className: a,
|
|
316
|
-
asChild: e = !1,
|
|
317
|
-
...n
|
|
318
|
-
}) {
|
|
319
|
-
const o = e ? v.Root : "div";
|
|
320
|
-
return /* @__PURE__ */ t(
|
|
321
|
-
o,
|
|
322
|
-
{
|
|
323
|
-
"data-slot": "sidebar-group-label",
|
|
324
|
-
"data-sidebar": "group-label",
|
|
325
|
-
className: i(
|
|
326
|
-
"text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
327
|
-
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
328
|
-
a
|
|
329
|
-
),
|
|
330
|
-
...n
|
|
331
|
-
}
|
|
332
|
-
);
|
|
333
|
-
}
|
|
334
|
-
r(Se, "SidebarGroupLabel");
|
|
335
|
-
function Ne({
|
|
336
|
-
className: a,
|
|
337
|
-
asChild: e = !1,
|
|
338
|
-
...n
|
|
339
|
-
}) {
|
|
340
|
-
const o = e ? v.Root : "button";
|
|
341
|
-
return /* @__PURE__ */ t(
|
|
342
|
-
o,
|
|
343
|
-
{
|
|
344
|
-
"data-slot": "sidebar-group-action",
|
|
345
|
-
"data-sidebar": "group-action",
|
|
346
|
-
className: i(
|
|
347
|
-
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
348
|
-
// Increases the hit area of the button on mobile.
|
|
349
|
-
"after:absolute after:-inset-2 md:after:hidden",
|
|
350
|
-
"group-data-[collapsible=icon]:hidden",
|
|
351
|
-
a
|
|
352
|
-
),
|
|
353
|
-
...n
|
|
354
|
-
}
|
|
355
|
-
);
|
|
356
|
-
}
|
|
357
|
-
r(Ne, "SidebarGroupAction");
|
|
358
|
-
function ye({
|
|
359
|
-
className: a,
|
|
360
|
-
...e
|
|
361
|
-
}) {
|
|
362
|
-
return /* @__PURE__ */ t(
|
|
363
|
-
"div",
|
|
364
|
-
{
|
|
365
|
-
"data-slot": "sidebar-group-content",
|
|
366
|
-
"data-sidebar": "group-content",
|
|
367
|
-
className: i("w-full text-sm", a),
|
|
368
|
-
...e
|
|
369
|
-
}
|
|
370
|
-
);
|
|
371
|
-
}
|
|
372
|
-
r(ye, "SidebarGroupContent");
|
|
373
|
-
function ke({ className: a, ...e }) {
|
|
374
|
-
return /* @__PURE__ */ t(
|
|
375
|
-
"ul",
|
|
376
|
-
{
|
|
377
|
-
"data-slot": "sidebar-menu",
|
|
378
|
-
"data-sidebar": "menu",
|
|
379
|
-
className: i("flex w-full min-w-0 flex-col gap-1", a),
|
|
380
|
-
...e
|
|
381
|
-
}
|
|
382
|
-
);
|
|
383
|
-
}
|
|
384
|
-
r(ke, "SidebarMenu");
|
|
385
|
-
function _e({ className: a, ...e }) {
|
|
386
|
-
return /* @__PURE__ */ t(
|
|
387
|
-
"li",
|
|
388
|
-
{
|
|
389
|
-
"data-slot": "sidebar-menu-item",
|
|
390
|
-
"data-sidebar": "menu-item",
|
|
391
|
-
className: i("group/menu-item relative", a),
|
|
392
|
-
...e
|
|
393
|
-
}
|
|
394
|
-
);
|
|
395
|
-
}
|
|
396
|
-
r(_e, "SidebarMenuItem");
|
|
397
|
-
const Y = I(
|
|
398
|
-
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
399
|
-
{
|
|
400
|
-
variants: {
|
|
401
|
-
variant: {
|
|
402
|
-
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
403
|
-
outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
|
|
404
|
-
},
|
|
405
|
-
size: {
|
|
406
|
-
default: "h-8 text-sm",
|
|
407
|
-
sm: "h-7 text-xs",
|
|
408
|
-
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
409
|
-
}
|
|
410
|
-
},
|
|
411
|
-
defaultVariants: {
|
|
412
|
-
variant: "default",
|
|
413
|
-
size: "default"
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
);
|
|
417
|
-
function Me({
|
|
418
|
-
asChild: a = !1,
|
|
419
|
-
isActive: e = !1,
|
|
420
|
-
variant: n = "default",
|
|
421
|
-
size: o = "default",
|
|
422
|
-
tooltip: d,
|
|
423
|
-
className: l,
|
|
424
|
-
...m
|
|
425
|
-
}) {
|
|
426
|
-
const c = a ? v.Root : "button", { isMobile: p, state: b } = N(), x = /* @__PURE__ */ t(
|
|
427
|
-
c,
|
|
428
|
-
{
|
|
429
|
-
"data-slot": "sidebar-menu-button",
|
|
430
|
-
"data-sidebar": "menu-button",
|
|
431
|
-
"data-size": o,
|
|
432
|
-
"data-active": e,
|
|
433
|
-
className: i(Y({ variant: n, size: o }), l),
|
|
434
|
-
...m
|
|
435
|
-
}
|
|
436
|
-
);
|
|
437
|
-
return d ? (typeof d == "string" && (d = {
|
|
438
|
-
children: d
|
|
439
|
-
}), /* @__PURE__ */ g(G, { children: [
|
|
440
|
-
/* @__PURE__ */ t(L, { asChild: !0, children: x }),
|
|
441
|
-
/* @__PURE__ */ t(
|
|
442
|
-
$,
|
|
443
|
-
{
|
|
444
|
-
side: "right",
|
|
445
|
-
align: "center",
|
|
446
|
-
hidden: b !== "collapsed" || p,
|
|
447
|
-
...d
|
|
448
|
-
}
|
|
449
|
-
)
|
|
450
|
-
] })) : x;
|
|
451
|
-
}
|
|
452
|
-
r(Me, "SidebarMenuButton");
|
|
453
|
-
function Ce({
|
|
454
|
-
className: a,
|
|
455
|
-
asChild: e = !1,
|
|
456
|
-
showOnHover: n = !1,
|
|
457
|
-
...o
|
|
458
|
-
}) {
|
|
459
|
-
const d = e ? v.Root : "button";
|
|
460
|
-
return /* @__PURE__ */ t(
|
|
461
|
-
d,
|
|
462
|
-
{
|
|
463
|
-
"data-slot": "sidebar-menu-action",
|
|
464
|
-
"data-sidebar": "menu-action",
|
|
465
|
-
className: i(
|
|
466
|
-
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
467
|
-
// Increases the hit area of the button on mobile.
|
|
468
|
-
"after:absolute after:-inset-2 md:after:hidden",
|
|
469
|
-
"peer-data-[size=sm]/menu-button:top-1",
|
|
470
|
-
"peer-data-[size=default]/menu-button:top-1.5",
|
|
471
|
-
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
472
|
-
"group-data-[collapsible=icon]:hidden",
|
|
473
|
-
n && "peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",
|
|
474
|
-
a
|
|
475
|
-
),
|
|
476
|
-
...o
|
|
477
|
-
}
|
|
478
|
-
);
|
|
479
|
-
}
|
|
480
|
-
r(Ce, "SidebarMenuAction");
|
|
481
|
-
function ze({
|
|
482
|
-
className: a,
|
|
483
|
-
...e
|
|
484
|
-
}) {
|
|
485
|
-
return /* @__PURE__ */ t(
|
|
486
|
-
"div",
|
|
487
|
-
{
|
|
488
|
-
"data-slot": "sidebar-menu-badge",
|
|
489
|
-
"data-sidebar": "menu-badge",
|
|
490
|
-
className: i(
|
|
491
|
-
"text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none",
|
|
492
|
-
"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
|
|
493
|
-
"peer-data-[size=sm]/menu-button:top-1",
|
|
494
|
-
"peer-data-[size=default]/menu-button:top-1.5",
|
|
495
|
-
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
496
|
-
"group-data-[collapsible=icon]:hidden",
|
|
497
|
-
a
|
|
498
|
-
),
|
|
499
|
-
...e
|
|
500
|
-
}
|
|
501
|
-
);
|
|
502
|
-
}
|
|
503
|
-
r(ze, "SidebarMenuBadge");
|
|
504
|
-
function Ie({
|
|
505
|
-
className: a,
|
|
506
|
-
showIcon: e = !1,
|
|
507
|
-
...n
|
|
508
|
-
}) {
|
|
509
|
-
const o = u.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);
|
|
510
|
-
return /* @__PURE__ */ g(
|
|
511
|
-
"div",
|
|
512
|
-
{
|
|
513
|
-
"data-slot": "sidebar-menu-skeleton",
|
|
514
|
-
"data-sidebar": "menu-skeleton",
|
|
515
|
-
className: i("flex h-8 items-center gap-2 rounded-md px-2", a),
|
|
516
|
-
...n,
|
|
517
|
-
children: [
|
|
518
|
-
e && /* @__PURE__ */ t(
|
|
519
|
-
k,
|
|
520
|
-
{
|
|
521
|
-
className: "size-4 rounded-md",
|
|
522
|
-
"data-sidebar": "menu-skeleton-icon"
|
|
523
|
-
}
|
|
524
|
-
),
|
|
525
|
-
/* @__PURE__ */ t(
|
|
526
|
-
k,
|
|
527
|
-
{
|
|
528
|
-
className: "h-4 max-w-(--skeleton-width) flex-1",
|
|
529
|
-
"data-sidebar": "menu-skeleton-text",
|
|
530
|
-
style: {
|
|
531
|
-
"--skeleton-width": o
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
)
|
|
535
|
-
]
|
|
536
|
-
}
|
|
537
|
-
);
|
|
538
|
-
}
|
|
539
|
-
r(Ie, "SidebarMenuSkeleton");
|
|
540
|
-
function Ee({ className: a, ...e }) {
|
|
541
|
-
return /* @__PURE__ */ t(
|
|
542
|
-
"ul",
|
|
543
|
-
{
|
|
544
|
-
"data-slot": "sidebar-menu-sub",
|
|
545
|
-
"data-sidebar": "menu-sub",
|
|
546
|
-
className: i(
|
|
547
|
-
"border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5",
|
|
548
|
-
"group-data-[collapsible=icon]:hidden",
|
|
549
|
-
a
|
|
550
|
-
),
|
|
551
|
-
...e
|
|
552
|
-
}
|
|
553
|
-
);
|
|
554
|
-
}
|
|
555
|
-
r(Ee, "SidebarMenuSub");
|
|
556
|
-
function De({
|
|
557
|
-
className: a,
|
|
558
|
-
...e
|
|
559
|
-
}) {
|
|
560
|
-
return /* @__PURE__ */ t(
|
|
561
|
-
"li",
|
|
562
|
-
{
|
|
563
|
-
"data-slot": "sidebar-menu-sub-item",
|
|
564
|
-
"data-sidebar": "menu-sub-item",
|
|
565
|
-
className: i("group/menu-sub-item relative", a),
|
|
566
|
-
...e
|
|
567
|
-
}
|
|
568
|
-
);
|
|
569
|
-
}
|
|
570
|
-
r(De, "SidebarMenuSubItem");
|
|
571
|
-
function Re({
|
|
572
|
-
asChild: a = !1,
|
|
573
|
-
size: e = "md",
|
|
574
|
-
isActive: n = !1,
|
|
575
|
-
className: o,
|
|
576
|
-
...d
|
|
577
|
-
}) {
|
|
578
|
-
const l = a ? v.Root : "a";
|
|
579
|
-
return /* @__PURE__ */ t(
|
|
580
|
-
l,
|
|
581
|
-
{
|
|
582
|
-
"data-slot": "sidebar-menu-sub-button",
|
|
583
|
-
"data-sidebar": "menu-sub-button",
|
|
584
|
-
"data-size": e,
|
|
585
|
-
"data-active": n,
|
|
586
|
-
className: i(
|
|
587
|
-
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
588
|
-
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
|
|
589
|
-
e === "sm" && "text-xs",
|
|
590
|
-
e === "md" && "text-sm",
|
|
591
|
-
"group-data-[collapsible=icon]:hidden",
|
|
592
|
-
o
|
|
593
|
-
),
|
|
594
|
-
...d
|
|
595
|
-
}
|
|
596
|
-
);
|
|
597
|
-
}
|
|
598
|
-
r(Re, "SidebarMenuSubButton");
|
|
599
|
-
export {
|
|
600
|
-
ue as Sidebar,
|
|
601
|
-
xe as SidebarContent,
|
|
602
|
-
he as SidebarFooter,
|
|
603
|
-
we as SidebarGroup,
|
|
604
|
-
Ne as SidebarGroupAction,
|
|
605
|
-
ye as SidebarGroupContent,
|
|
606
|
-
Se as SidebarGroupLabel,
|
|
607
|
-
me as SidebarHeader,
|
|
608
|
-
ge as SidebarInput,
|
|
609
|
-
pe as SidebarInset,
|
|
610
|
-
ke as SidebarMenu,
|
|
611
|
-
Ce as SidebarMenuAction,
|
|
612
|
-
ze as SidebarMenuBadge,
|
|
613
|
-
Me as SidebarMenuButton,
|
|
614
|
-
_e as SidebarMenuItem,
|
|
615
|
-
Ie as SidebarMenuSkeleton,
|
|
616
|
-
Ee as SidebarMenuSub,
|
|
617
|
-
Re as SidebarMenuSubButton,
|
|
618
|
-
De as SidebarMenuSubItem,
|
|
619
|
-
ce as SidebarProvider,
|
|
620
|
-
fe as SidebarRail,
|
|
621
|
-
ve as SidebarSeparator,
|
|
622
|
-
be as SidebarTrigger,
|
|
623
|
-
N as useSidebar
|
|
624
|
-
};
|
|
1
|
+
var z=Object.defineProperty;var r=(a,e)=>z(a,"name",{value:e,configurable:!0});import{jsx as t,jsxs as g}from"react/jsx-runtime";import*as u from"react";import{cva as I}from"class-variance-authority";import{PanelLeftIcon as E}from"lucide-react";import{Slot as v}from"radix-ui";import{useIsMobile as D}from"../hooks/use-mobile.js";import{cn as i}from"../lib/utils.js";import{Button as R}from"./button.js";import{Input as T}from"./input.js";import{Separator as B}from"./separator.js";import{Sheet as A,SheetContent as O,SheetHeader as H,SheetTitle as K,SheetDescription as j}from"./sheet.js";import{Skeleton as k}from"./skeleton.js";import{Tooltip as G,TooltipTrigger as L,TooltipContent as $,TooltipProvider as P}from"./tooltip.js";const V="sidebar_state",W=3600*24*7,q="16rem",F="18rem",U="3rem",X="b",_=u.createContext(null);function N(){const a=u.useContext(_);if(!a)throw new Error("useSidebar must be used within a SidebarProvider.");return a}r(N,"useSidebar");function ce({defaultOpen:a=!0,open:e,onOpenChange:n,className:o,style:d,children:l,...m}){const c=D(),[p,b]=u.useState(!1),[x,M]=u.useState(a),h=e??x,w=u.useCallback(s=>{const f=typeof s=="function"?s(h):s;n?n(f):M(f),document.cookie=`${V}=${f}; path=/; max-age=${W}`},[n,h]),S=u.useCallback(()=>c?b(s=>!s):w(s=>!s),[c,w,b]);u.useEffect(()=>{const s=r(f=>{f.key===X&&(f.metaKey||f.ctrlKey)&&(f.preventDefault(),S())},"handleKeyDown");return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[S]);const y=h?"expanded":"collapsed",C=u.useMemo(()=>({state:y,open:h,setOpen:w,isMobile:c,openMobile:p,setOpenMobile:b,toggleSidebar:S}),[y,h,w,c,p,b,S]);return t(_.Provider,{value:C,children:t(P,{delayDuration:0,children:t("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":q,"--sidebar-width-icon":U,...d},className:i("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",o),...m,children:l})})})}r(ce,"SidebarProvider");function ue({side:a="left",variant:e="sidebar",collapsible:n="offcanvas",className:o,children:d,...l}){const{isMobile:m,state:c,openMobile:p,setOpenMobile:b}=N();return n==="none"?t("div",{"data-slot":"sidebar",className:i("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",o),...l,children:d}):m?t(A,{open:p,onOpenChange:b,...l,children:g(O,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":F},side:a,children:[g(H,{className:"sr-only",children:[t(K,{children:"Sidebar"}),t(j,{children:"Displays the mobile sidebar."})]}),t("div",{className:"flex h-full w-full flex-col",children:d})]})}):g("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":c,"data-collapsible":c==="collapsed"?n:"","data-variant":e,"data-side":a,"data-slot":"sidebar",children:[t("div",{"data-slot":"sidebar-gap",className:i("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),t("div",{"data-slot":"sidebar-container",className:i("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",a==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...l,children:t("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:d})})]})}r(ue,"Sidebar");function be({className:a,onClick:e,...n}){const{toggleSidebar:o}=N();return g(R,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",color:"dark",size:"icon",className:i("size-7",a),onClick:r(d=>{e?.(d),o()},"onClick"),...n,children:[t(E,{}),t("span",{className:"sr-only",children:"Toggle Sidebar"})]})}r(be,"SidebarTrigger");function fe({className:a,...e}){const{toggleSidebar:n}=N();return t("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:i("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",a),...e})}r(fe,"SidebarRail");function pe({className:a,...e}){return t("main",{"data-slot":"sidebar-inset",className:i("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",a),...e})}r(pe,"SidebarInset");function ge({className:a,...e}){return t(T,{"data-slot":"sidebar-input","data-sidebar":"input",className:i("bg-background h-8 w-full shadow-none",a),...e})}r(ge,"SidebarInput");function me({className:a,...e}){return t("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:i("flex flex-col gap-2 p-2",a),...e})}r(me,"SidebarHeader");function he({className:a,...e}){return t("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:i("flex flex-col gap-2 p-2",a),...e})}r(he,"SidebarFooter");function ve({className:a,...e}){return t(B,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:i("bg-sidebar-border mx-2 w-auto",a),...e})}r(ve,"SidebarSeparator");function xe({className:a,...e}){return t("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:i("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",a),...e})}r(xe,"SidebarContent");function we({className:a,...e}){return t("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:i("relative flex w-full min-w-0 flex-col p-2",a),...e})}r(we,"SidebarGroup");function Se({className:a,asChild:e=!1,...n}){const o=e?v.Root:"div";return t(o,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:i("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",a),...n})}r(Se,"SidebarGroupLabel");function Ne({className:a,asChild:e=!1,...n}){const o=e?v.Root:"button";return t(o,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:i("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",a),...n})}r(Ne,"SidebarGroupAction");function ye({className:a,...e}){return t("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:i("w-full text-sm",a),...e})}r(ye,"SidebarGroupContent");function ke({className:a,...e}){return t("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:i("flex w-full min-w-0 flex-col gap-1",a),...e})}r(ke,"SidebarMenu");function _e({className:a,...e}){return t("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:i("group/menu-item relative",a),...e})}r(_e,"SidebarMenuItem");const Y=I("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Me({asChild:a=!1,isActive:e=!1,variant:n="default",size:o="default",tooltip:d,className:l,...m}){const c=a?v.Root:"button",{isMobile:p,state:b}=N(),x=t(c,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":o,"data-active":e,className:i(Y({variant:n,size:o}),l),...m});return d?(typeof d=="string"&&(d={children:d}),g(G,{children:[t(L,{asChild:!0,children:x}),t($,{side:"right",align:"center",hidden:b!=="collapsed"||p,...d})]})):x}r(Me,"SidebarMenuButton");function Ce({className:a,asChild:e=!1,showOnHover:n=!1,...o}){const d=e?v.Root:"button";return t(d,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:i("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",a),...o})}r(Ce,"SidebarMenuAction");function ze({className:a,...e}){return t("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:i("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a),...e})}r(ze,"SidebarMenuBadge");function Ie({className:a,showIcon:e=!1,...n}){const o=u.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return g("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:i("flex h-8 items-center gap-2 rounded-md px-2",a),...n,children:[e&&t(k,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),t(k,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})}r(Ie,"SidebarMenuSkeleton");function Ee({className:a,...e}){return t("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:i("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",a),...e})}r(Ee,"SidebarMenuSub");function De({className:a,...e}){return t("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:i("group/menu-sub-item relative",a),...e})}r(De,"SidebarMenuSubItem");function Re({asChild:a=!1,size:e="md",isActive:n=!1,className:o,...d}){const l=a?v.Root:"a";return t(l,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":e,"data-active":n,className:i("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",e==="sm"&&"text-xs",e==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",o),...d})}r(Re,"SidebarMenuSubButton");export{ue as Sidebar,xe as SidebarContent,he as SidebarFooter,we as SidebarGroup,Ne as SidebarGroupAction,ye as SidebarGroupContent,Se as SidebarGroupLabel,me as SidebarHeader,ge as SidebarInput,pe as SidebarInset,ke as SidebarMenu,Ce as SidebarMenuAction,ze as SidebarMenuBadge,Me as SidebarMenuButton,_e as SidebarMenuItem,Ie as SidebarMenuSkeleton,Ee as SidebarMenuSub,Re as SidebarMenuSubButton,De as SidebarMenuSubItem,ce as SidebarProvider,fe as SidebarRail,ve as SidebarSeparator,be as SidebarTrigger,N as useSidebar};
|