iguazio.dashboard-react-controls 3.2.24 → 3.2.25

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.
@@ -0,0 +1,76 @@
1
+ import * as React from 'react';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ interface SidebarContextValue {
4
+ state: 'expanded' | 'collapsed';
5
+ open: boolean;
6
+ setOpen: (value: boolean | ((prev: boolean) => boolean)) => void;
7
+ toggleSidebar: () => void;
8
+ pinned: boolean;
9
+ togglePin: () => void;
10
+ hoverLocked: boolean;
11
+ setHoverLocked: (locked: boolean) => void;
12
+ }
13
+ declare const useSidebar: () => SidebarContextValue;
14
+ interface SidebarProviderProps extends React.HTMLAttributes<HTMLDivElement> {
15
+ children: React.ReactNode;
16
+ defaultOpen?: boolean;
17
+ onOpenChange?: (open: boolean) => void;
18
+ open?: boolean;
19
+ }
20
+ declare const SidebarProvider: React.ForwardRefExoticComponent<SidebarProviderProps & React.RefAttributes<HTMLDivElement>>;
21
+ interface SidebarProps extends React.HTMLAttributes<HTMLElement> {
22
+ children: React.ReactNode;
23
+ side?: 'left' | 'right';
24
+ variant?: 'sidebar' | 'floating' | 'inset';
25
+ collapsible?: 'offcanvas' | 'icon' | 'none';
26
+ }
27
+ declare const Sidebar: React.ForwardRefExoticComponent<SidebarProps & React.RefAttributes<HTMLElement>>;
28
+ interface SidebarTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
29
+ icon?: 'menu' | 'chevronLeft' | 'chevronRight';
30
+ }
31
+ declare const SidebarTrigger: React.ForwardRefExoticComponent<SidebarTriggerProps & React.RefAttributes<HTMLButtonElement>>;
32
+ declare const SidebarRail: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
33
+ declare const SidebarInset: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
34
+ declare const SidebarInput: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
35
+ declare const SidebarHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
36
+ declare const SidebarFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
37
+ declare const SidebarSeparator: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-separator").SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
38
+ declare const SidebarContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
39
+ declare const SidebarGroup: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
40
+ interface SidebarGroupLabelProps extends React.HTMLAttributes<HTMLDivElement> {
41
+ asChild?: boolean;
42
+ }
43
+ declare const SidebarGroupLabel: React.ForwardRefExoticComponent<SidebarGroupLabelProps & React.RefAttributes<HTMLDivElement>>;
44
+ interface SidebarGroupActionProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
45
+ asChild?: boolean;
46
+ }
47
+ declare const SidebarGroupAction: React.ForwardRefExoticComponent<SidebarGroupActionProps & React.RefAttributes<HTMLButtonElement>>;
48
+ declare const SidebarGroupContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
49
+ declare const SidebarMenu: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLUListElement> & React.RefAttributes<HTMLUListElement>>;
50
+ declare const SidebarMenuItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLLIElement> & React.RefAttributes<HTMLLIElement>>;
51
+ declare const sidebarMenuButtonVariants: (props?: ({
52
+ variant?: "default" | "outline" | null | undefined;
53
+ size?: "sm" | "lg" | "default" | null | undefined;
54
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
55
+ interface SidebarMenuButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof sidebarMenuButtonVariants> {
56
+ asChild?: boolean;
57
+ isActive?: boolean;
58
+ tooltip?: string | Record<string, unknown>;
59
+ }
60
+ declare const SidebarMenuButton: React.ForwardRefExoticComponent<SidebarMenuButtonProps & React.RefAttributes<HTMLButtonElement>>;
61
+ interface SidebarMenuActionProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
62
+ asChild?: boolean;
63
+ showOnHover?: boolean;
64
+ }
65
+ declare const SidebarMenuAction: React.ForwardRefExoticComponent<SidebarMenuActionProps & React.RefAttributes<HTMLButtonElement>>;
66
+ declare const SidebarMenuBadge: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & React.RefAttributes<HTMLSpanElement>>;
67
+ declare const SidebarMenuSub: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLUListElement> & React.RefAttributes<HTMLUListElement>>;
68
+ declare const SidebarMenuSubItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLLIElement> & React.RefAttributes<HTMLLIElement>>;
69
+ interface SidebarMenuSubButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
70
+ asChild?: boolean;
71
+ size?: 'sm' | 'md' | 'default';
72
+ isActive?: boolean;
73
+ }
74
+ declare const SidebarMenuSubButton: React.ForwardRefExoticComponent<SidebarMenuSubButtonProps & React.RefAttributes<HTMLButtonElement>>;
75
+ export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar };
76
+ //# sourceMappingURL=sidebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../../src/lib/nextGenComponents/components/ui/sidebar.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,539 @@
1
+ import { jsx as i, jsxs as _ } from "react/jsx-runtime";
2
+ import * as r from "react";
3
+ import { Slot as N } from "@radix-ui/react-slot";
4
+ import { cva as T } from "class-variance-authority";
5
+ import { MenuIcon as k, ChevronLeftIcon as E, ChevronRightIcon as A } from "lucide-react";
6
+ import { cn as o } from "../../lib/utils.mjs";
7
+ import { Button as C } from "./button.mjs";
8
+ import { Input as B } from "./input.mjs";
9
+ import { Separator as O } from "./separator.mjs";
10
+ import { TooltipProvider as P, Tooltip as D, TooltipTrigger as L, TooltipContent as G } from "./tooltip.mjs";
11
+ import H from "../../../images/navbar-closed-icon.svg.mjs";
12
+ import K from "../../../images/navbar-opened-icon.svg.mjs";
13
+ const F = "sidebar_state", j = 3600 * 24 * 7, V = "15rem", $ = "70px", q = "b", M = r.createContext(null), y = () => {
14
+ const e = r.useContext(M);
15
+ if (!e)
16
+ throw new Error("useSidebar must be used within a SidebarProvider.");
17
+ return e;
18
+ }, J = r.forwardRef(
19
+ ({ children: e, className: a, defaultOpen: t = !0, onOpenChange: s, open: n, style: c, ...m }, w) => {
20
+ const [g, v] = r.useState(() => {
21
+ try {
22
+ return JSON.parse(localStorage.getItem("isNavbarPinned") || "false");
23
+ } catch {
24
+ return !1;
25
+ }
26
+ }), [p, d] = r.useState(!1), [S, R] = r.useState(t || g), u = n ?? S, b = r.useCallback(
27
+ (f) => {
28
+ const l = typeof f == "function" ? f(u) : f;
29
+ s ? s(l) : R(l), document.cookie = `${F}=${l}; path=/; max-age=${j}`;
30
+ },
31
+ [s, u]
32
+ ), h = r.useCallback(() => b((f) => !f), [b]), x = r.useCallback(() => {
33
+ v((f) => {
34
+ const l = !f;
35
+ return localStorage.setItem("isNavbarPinned", JSON.stringify(l)), b(l), l;
36
+ });
37
+ }, [b]);
38
+ r.useEffect(() => {
39
+ const f = (l) => {
40
+ l.key === q && (l.metaKey || l.ctrlKey) && (l.preventDefault(), h());
41
+ };
42
+ return window.addEventListener("keydown", f), () => window.removeEventListener("keydown", f);
43
+ }, [h]);
44
+ const I = u ? "expanded" : "collapsed", z = r.useMemo(
45
+ () => ({
46
+ state: I,
47
+ open: u,
48
+ setOpen: b,
49
+ toggleSidebar: h,
50
+ pinned: g,
51
+ togglePin: x,
52
+ hoverLocked: p,
53
+ setHoverLocked: d
54
+ }),
55
+ [I, u, b, h, g, x, p]
56
+ );
57
+ return /* @__PURE__ */ i(M.Provider, { value: z, children: /* @__PURE__ */ i(P, { delayDuration: 0, children: /* @__PURE__ */ i(
58
+ "div",
59
+ {
60
+ style: {
61
+ "--sidebar-width": V,
62
+ "--sidebar-width-icon": $,
63
+ ...c
64
+ },
65
+ className: o(
66
+ "group/sidebar-wrapper flex h-full w-full has-[[data-variant=inset]]:bg-sidebar",
67
+ a
68
+ ),
69
+ ref: w,
70
+ ...m,
71
+ children: e
72
+ }
73
+ ) }) });
74
+ }
75
+ );
76
+ J.displayName = "SidebarProvider";
77
+ const U = r.forwardRef(
78
+ ({
79
+ children: e,
80
+ className: a,
81
+ collapsible: t = "offcanvas",
82
+ side: s = "left",
83
+ variant: n = "sidebar",
84
+ ...c
85
+ }, m) => {
86
+ const [w, g] = r.useState(!1), { hoverLocked: v, open: p, pinned: d, state: S, togglePin: R, setOpen: u } = y(), b = r.useRef(null), h = r.useRef(null);
87
+ return r.useEffect(() => {
88
+ if (!v && !w && !d)
89
+ return h.current = setTimeout(() => u(!1), 200), () => clearTimeout(h.current);
90
+ }, [v, w, d, u]), t === "none" ? /* @__PURE__ */ i(
91
+ "nav",
92
+ {
93
+ className: o(
94
+ "flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",
95
+ a
96
+ ),
97
+ ref: m,
98
+ ...c,
99
+ children: e
100
+ }
101
+ ) : /* @__PURE__ */ i(
102
+ "nav",
103
+ {
104
+ ref: m,
105
+ className: o(
106
+ "group peer relative shrink-0 self-stretch overflow-visible text-sidebar-foreground",
107
+ "transition-[width] duration-300 ease-linear",
108
+ d && p ? "w-[--sidebar-width]" : "w-[--sidebar-width-icon]"
109
+ ),
110
+ "data-state": S,
111
+ "data-collapsible": S === "collapsed" ? t : "",
112
+ "data-variant": n,
113
+ "data-side": s,
114
+ "data-pinned": d,
115
+ onMouseEnter: () => {
116
+ clearTimeout(h.current), clearTimeout(b.current), g(!0), d || (b.current = setTimeout(() => u(!0), 100));
117
+ },
118
+ onMouseLeave: () => {
119
+ clearTimeout(b.current), g(!1), !d && !v && u(!1);
120
+ },
121
+ onTransitionEnd: (x) => {
122
+ x.target === x.currentTarget && x.propertyName === "width" && window.dispatchEvent(new CustomEvent("mainResize"));
123
+ },
124
+ children: /* @__PURE__ */ i(
125
+ "div",
126
+ {
127
+ className: o(
128
+ "absolute inset-y-0 left-0 z-20 flex flex-col transition-[width] duration-300 ease-linear md:flex",
129
+ s === "left" && d && "group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]",
130
+ s === "right" && d && "group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
131
+ n === "floating" || n === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]" : o(
132
+ "group-data-[side=left]:border-r group-data-[side=right]:border-l",
133
+ p && !d || d && S === "expanded" ? "w-[--sidebar-width]" : "w-[--sidebar-width-icon]"
134
+ ),
135
+ a
136
+ ),
137
+ ...c,
138
+ children: /* @__PURE__ */ _(
139
+ "div",
140
+ {
141
+ "data-sidebar": "sidebar",
142
+ className: "flex size-full flex-col bg-sidebar shadow-[1px_4px_16px_rgba(0,0,0,0.04)] group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",
143
+ children: [
144
+ e,
145
+ p && /* @__PURE__ */ i(
146
+ C,
147
+ {
148
+ variant: "outline",
149
+ tooltip: d ? "Unpin sidebar" : "Pin sidebar",
150
+ "data-testid": "pin-sidebar-button",
151
+ side: "right",
152
+ className: o(
153
+ "absolute top-2 left-full border bg-[#FAFAFA] border-gray-200 border-solid",
154
+ "w-fit h-fit rounded-l-none border-l-0 py-2 pr-[3px] pl-[1px]",
155
+ "transition-opacity hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
156
+ d ? "opacity-100" : "opacity-0 group-hover:opacity-100"
157
+ ),
158
+ onClick: R,
159
+ children: d ? /* @__PURE__ */ i(H, { "data-testid": "closeed-pin" }) : /* @__PURE__ */ i(K, { "data-testid": "opened-pin" })
160
+ }
161
+ )
162
+ ]
163
+ }
164
+ )
165
+ }
166
+ )
167
+ }
168
+ );
169
+ }
170
+ );
171
+ U.displayName = "Sidebar";
172
+ const W = r.forwardRef(
173
+ ({ className: e, icon: a = "menu", onClick: t, ...s }, n) => {
174
+ const { toggleSidebar: c } = y();
175
+ return /* @__PURE__ */ _(
176
+ C,
177
+ {
178
+ ref: n,
179
+ "data-sidebar": "trigger",
180
+ variant: "ghost",
181
+ size: "icon",
182
+ className: o("size-9", e),
183
+ onClick: (m) => {
184
+ t == null || t(m), c();
185
+ },
186
+ ...s,
187
+ children: [
188
+ a === "menu" && /* @__PURE__ */ i(k, { className: "size-4 shrink-0" }),
189
+ a === "chevronLeft" && /* @__PURE__ */ i(E, { className: "size-4 shrink-0" }),
190
+ a === "chevronRight" && /* @__PURE__ */ i(A, { className: "size-4 shrink-0" }),
191
+ /* @__PURE__ */ i("span", { className: "sr-only", children: "Toggle Sidebar" })
192
+ ]
193
+ }
194
+ );
195
+ }
196
+ );
197
+ W.displayName = "SidebarTrigger";
198
+ const X = r.forwardRef(({ className: e, ...a }, t) => {
199
+ const { toggleSidebar: s } = y();
200
+ return /* @__PURE__ */ i(
201
+ "button",
202
+ {
203
+ ref: t,
204
+ "data-sidebar": "rail",
205
+ "aria-label": "Toggle Sidebar",
206
+ tabIndex: -1,
207
+ onClick: s,
208
+ title: "Toggle Sidebar",
209
+ className: o(
210
+ "absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex",
211
+ "[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize",
212
+ "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
213
+ "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar",
214
+ "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
215
+ "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
216
+ e
217
+ ),
218
+ ...a
219
+ }
220
+ );
221
+ });
222
+ X.displayName = "SidebarRail";
223
+ const Y = r.forwardRef(
224
+ ({ className: e, ...a }, t) => /* @__PURE__ */ i(
225
+ "main",
226
+ {
227
+ ref: t,
228
+ className: o(
229
+ "relative flex min-h-0 flex-1 flex-col bg-background transition-[width] duration-300 ease-linear",
230
+ "peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",
231
+ e
232
+ ),
233
+ ...a
234
+ }
235
+ )
236
+ );
237
+ Y.displayName = "SidebarInset";
238
+ const Q = r.forwardRef(
239
+ ({ className: e, ...a }, t) => /* @__PURE__ */ i(
240
+ B,
241
+ {
242
+ ref: t,
243
+ "data-sidebar": "input",
244
+ className: o(
245
+ "h-9 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",
246
+ e
247
+ ),
248
+ ...a
249
+ }
250
+ )
251
+ );
252
+ Q.displayName = "SidebarInput";
253
+ const Z = r.forwardRef(
254
+ ({ className: e, ...a }, t) => /* @__PURE__ */ i(
255
+ "div",
256
+ {
257
+ ref: t,
258
+ "data-sidebar": "header",
259
+ className: o("flex gap-2 py-3.5", e),
260
+ ...a
261
+ }
262
+ )
263
+ );
264
+ Z.displayName = "SidebarHeader";
265
+ const ee = r.forwardRef(
266
+ ({ className: e, ...a }, t) => /* @__PURE__ */ i(
267
+ "div",
268
+ {
269
+ ref: t,
270
+ "data-sidebar": "footer",
271
+ className: o("flex flex-col gap-2 p-3", e),
272
+ ...a
273
+ }
274
+ )
275
+ );
276
+ ee.displayName = "SidebarFooter";
277
+ const ae = r.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ i(
278
+ O,
279
+ {
280
+ ref: t,
281
+ "data-sidebar": "separator",
282
+ className: o("mx-5 mb-2 w-auto bg-sidebar-border", e),
283
+ ...a
284
+ }
285
+ ));
286
+ ae.displayName = "SidebarSeparator";
287
+ const te = r.forwardRef(
288
+ ({ className: e, ...a }, t) => /* @__PURE__ */ i(
289
+ "div",
290
+ {
291
+ ref: t,
292
+ "data-sidebar": "content",
293
+ className: o(
294
+ "flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden",
295
+ e
296
+ ),
297
+ ...a
298
+ }
299
+ )
300
+ );
301
+ te.displayName = "SidebarContent";
302
+ const re = r.forwardRef(
303
+ ({ className: e, ...a }, t) => /* @__PURE__ */ i(
304
+ "div",
305
+ {
306
+ ref: t,
307
+ "data-sidebar": "group",
308
+ className: o("relative flex w-full min-w-0 flex-col p-3", e),
309
+ ...a
310
+ }
311
+ )
312
+ );
313
+ re.displayName = "SidebarGroup";
314
+ const ie = r.forwardRef(
315
+ ({ asChild: e = !1, className: a, ...t }, s) => /* @__PURE__ */ i(
316
+ e ? N : "div",
317
+ {
318
+ ref: s,
319
+ "data-sidebar": "group-label",
320
+ className: o(
321
+ "flex h-9 shrink-0 items-center rounded-md px-2.5 text-sm font-medium outline-none whitespace-nowrap ring-sidebar-ring focus-visible:ring-2 [&>svg]:size-5 [&>svg]:shrink-0",
322
+ "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
323
+ a
324
+ ),
325
+ ...t
326
+ }
327
+ )
328
+ );
329
+ ie.displayName = "SidebarGroupLabel";
330
+ const oe = r.forwardRef(
331
+ ({ asChild: e = !1, className: a, ...t }, s) => /* @__PURE__ */ i(
332
+ e ? N : "button",
333
+ {
334
+ ref: s,
335
+ "data-sidebar": "group-action",
336
+ className: o(
337
+ "absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-5 [&>svg]:shrink-0",
338
+ "after:absolute after:-inset-2 after:md:hidden",
339
+ "group-data-[collapsible=icon]:hidden",
340
+ a
341
+ ),
342
+ ...t
343
+ }
344
+ )
345
+ );
346
+ oe.displayName = "SidebarGroupAction";
347
+ const se = r.forwardRef(
348
+ ({ className: e, ...a }, t) => /* @__PURE__ */ i(
349
+ "div",
350
+ {
351
+ ref: t,
352
+ "data-sidebar": "group-content",
353
+ className: o("w-full text-sm", e),
354
+ ...a
355
+ }
356
+ )
357
+ );
358
+ se.displayName = "SidebarGroupContent";
359
+ const ne = r.forwardRef(
360
+ ({ className: e, ...a }, t) => /* @__PURE__ */ i(
361
+ "ul",
362
+ {
363
+ ref: t,
364
+ "data-sidebar": "menu",
365
+ className: o("flex w-full min-w-0 p-0 m-0 flex-col gap-1 items-center", e),
366
+ ...a
367
+ }
368
+ )
369
+ );
370
+ ne.displayName = "SidebarMenu";
371
+ const de = r.forwardRef(
372
+ ({ className: e, ...a }, t) => /* @__PURE__ */ i(
373
+ "li",
374
+ {
375
+ ref: t,
376
+ "data-sidebar": "menu-item",
377
+ className: o("group/menu-item flex relative w-full", e),
378
+ ...a
379
+ }
380
+ )
381
+ );
382
+ de.displayName = "SidebarMenuItem";
383
+ const le = T(
384
+ "peer/menu-button flex flex-1 w-full items-center gap-2 text-inherit overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent 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-active-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-active-accent-foreground [&_svg_path]:fill-current data-[state=open]:hover:bg-sidebar-accent whitespace-nowrap [&>svg]:size-5 [&>svg]:shrink-0",
385
+ {
386
+ variants: {
387
+ variant: {
388
+ default: "hover:bg-sidebar-accent",
389
+ 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))]"
390
+ },
391
+ size: {
392
+ default: "text-sm",
393
+ sm: "h-8 text-xs",
394
+ lg: "h-12 text-sm group-data-[collapsible=icon]:!m-0"
395
+ }
396
+ },
397
+ defaultVariants: {
398
+ variant: "default",
399
+ size: "default"
400
+ }
401
+ }
402
+ ), ce = r.forwardRef(
403
+ ({
404
+ asChild: e = !1,
405
+ className: a,
406
+ isActive: t = !1,
407
+ size: s = "default",
408
+ tooltip: n,
409
+ variant: c = "default",
410
+ ...m
411
+ }, w) => {
412
+ const g = e ? N : "button", { state: v } = y(), p = /* @__PURE__ */ i(
413
+ g,
414
+ {
415
+ ref: w,
416
+ "data-sidebar": "menu-button",
417
+ "data-size": s,
418
+ "data-active": t,
419
+ className: o(le({ variant: c, size: s }), a),
420
+ ...m
421
+ }
422
+ );
423
+ return n ? /* @__PURE__ */ _(D, { children: [
424
+ /* @__PURE__ */ i(L, { asChild: !0, children: p }),
425
+ /* @__PURE__ */ i(
426
+ G,
427
+ {
428
+ side: "right",
429
+ align: "center",
430
+ hidden: v !== "collapsed",
431
+ ...typeof n == "string" ? { children: n } : n
432
+ }
433
+ )
434
+ ] }) : p;
435
+ }
436
+ );
437
+ ce.displayName = "SidebarMenuButton";
438
+ const ue = r.forwardRef(
439
+ ({ asChild: e = !1, className: a, showOnHover: t = !1, ...s }, n) => /* @__PURE__ */ i(
440
+ e ? N : "button",
441
+ {
442
+ ref: n,
443
+ "data-sidebar": "menu-action",
444
+ className: o(
445
+ "absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0",
446
+ "after:absolute after:-inset-2 after:md:hidden",
447
+ "peer-data-[size=sm]/menu-button:top-1",
448
+ "peer-data-[size=default]/menu-button:top-1.5",
449
+ "peer-data-[size=lg]/menu-button:top-2.5",
450
+ "group-data-[collapsible=icon]:hidden",
451
+ t && "hidden group-hocus:flex",
452
+ a
453
+ ),
454
+ ...s
455
+ }
456
+ )
457
+ );
458
+ ue.displayName = "SidebarMenuAction";
459
+ const be = r.forwardRef(
460
+ ({ className: e, ...a }, t) => /* @__PURE__ */ i(
461
+ "span",
462
+ {
463
+ ref: t,
464
+ "data-sidebar": "menu-badge",
465
+ className: o(
466
+ "inline-flex h-5 items-center rounded-full bg-sidebar-accent px-2 py-0.5 text-xs font-medium text-sidebar-accent-foreground",
467
+ e
468
+ ),
469
+ ...a
470
+ }
471
+ )
472
+ );
473
+ be.displayName = "SidebarMenuBadge";
474
+ const fe = r.forwardRef(
475
+ ({ className: e, ...a }, t) => /* @__PURE__ */ i(
476
+ "ul",
477
+ {
478
+ ref: t,
479
+ "data-sidebar": "menu-sub",
480
+ className: o("flex flex-col gap-1 p-0", e),
481
+ ...a
482
+ }
483
+ )
484
+ );
485
+ fe.displayName = "SidebarMenuSub";
486
+ const pe = r.forwardRef(
487
+ ({ className: e, ...a }, t) => /* @__PURE__ */ i(
488
+ "li",
489
+ {
490
+ ref: t,
491
+ "data-sidebar": "menu-sub-item",
492
+ className: o("flex w-full", e),
493
+ ...a
494
+ }
495
+ )
496
+ );
497
+ pe.displayName = "SidebarMenuSubItem";
498
+ const me = r.forwardRef(
499
+ ({ asChild: e = !1, className: a, size: t = "default", ...s }, n) => /* @__PURE__ */ i(
500
+ e ? N : "button",
501
+ {
502
+ ref: n,
503
+ "data-sidebar": "menu-sub-button",
504
+ "data-size": t,
505
+ className: o(
506
+ "flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 whitespace-nowrap [&>svg]:size-4 [&>svg]:shrink-0",
507
+ a
508
+ ),
509
+ ...s
510
+ }
511
+ )
512
+ );
513
+ me.displayName = "SidebarMenuSubButton";
514
+ export {
515
+ U as Sidebar,
516
+ te as SidebarContent,
517
+ ee as SidebarFooter,
518
+ re as SidebarGroup,
519
+ oe as SidebarGroupAction,
520
+ se as SidebarGroupContent,
521
+ ie as SidebarGroupLabel,
522
+ Z as SidebarHeader,
523
+ Q as SidebarInput,
524
+ Y as SidebarInset,
525
+ ne as SidebarMenu,
526
+ ue as SidebarMenuAction,
527
+ be as SidebarMenuBadge,
528
+ ce as SidebarMenuButton,
529
+ de as SidebarMenuItem,
530
+ fe as SidebarMenuSub,
531
+ me as SidebarMenuSubButton,
532
+ pe as SidebarMenuSubItem,
533
+ J as SidebarProvider,
534
+ X as SidebarRail,
535
+ ae as SidebarSeparator,
536
+ W as SidebarTrigger,
537
+ y as useSidebar
538
+ };
539
+ //# sourceMappingURL=sidebar.mjs.map