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