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