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