@brightlocal/ui-components 2.11.0 → 2.12.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/component-meta.json +163 -12
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.d.ts +16 -4
- package/dist/blocks/data-table.d.ts.map +1 -1
- package/dist/blocks/data-table.js +57 -53
- package/dist/blocks/input-list.cjs +2 -2
- package/dist/blocks/input-list.d.ts +7 -1
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/input-list.js +82 -81
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +18 -7
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +143 -136
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.d.ts +14 -2
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/breadcrumb.js +37 -37
- package/dist/callout.cjs +1 -1
- package/dist/callout.d.ts +3 -3
- package/dist/callout.d.ts.map +1 -1
- package/dist/callout.js +2 -1
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.d.ts +24 -3
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +121 -117
- package/dist/chip.cjs +1 -1
- package/dist/chip.d.ts +11 -0
- package/dist/chip.d.ts.map +1 -1
- package/dist/chip.js +43 -38
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts +12 -2
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +235 -230
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +5 -0
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +207 -206
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +10 -0
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +96 -96
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +7 -2
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +38 -30
- package/dist/drawer.d.ts +2 -2
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +5 -0
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +15 -7
- package/dist/index.cjs +1 -1
- package/dist/index.js +178 -178
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.d.ts +7 -1
- package/dist/input-chip.d.ts.map +1 -1
- package/dist/input-chip.js +131 -130
- package/dist/input-group.d.ts +1 -1
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts +10 -0
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +108 -106
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts +1 -1
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +36 -37
- package/dist/list.d.ts +1 -1
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +6 -1
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +25 -22
- package/dist/map.cjs +1 -1
- package/dist/map.d.ts +17 -2
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +32 -26
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +29 -3
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +26 -25
- package/dist/rating.cjs +1 -1
- package/dist/rating.d.ts +6 -0
- package/dist/rating.d.ts.map +1 -1
- package/dist/rating.js +27 -19
- package/dist/resizable.d.ts +1 -1
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts +7 -1
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +52 -51
- package/dist/separator.cjs +1 -1
- package/dist/separator.d.ts +16 -4
- package/dist/separator.d.ts.map +1 -1
- package/dist/separator.js +38 -35
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +6 -1
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +42 -41
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.d.ts +5 -0
- package/dist/skeleton.d.ts.map +1 -1
- package/dist/skeleton.js +13 -11
- package/dist/text-reveal-motion.cjs +1 -1
- package/dist/text-reveal-motion.d.ts +5 -0
- package/dist/text-reveal-motion.d.ts.map +1 -1
- package/dist/text-reveal-motion.js +111 -110
- package/dist/typography.cjs +1 -1
- package/dist/typography.d.ts +1 -2
- package/dist/typography.d.ts.map +1 -1
- package/dist/typography.js +49 -50
- package/package.json +2 -3
- package/src/blocks/data-table.tsx +26 -9
- package/src/blocks/input-list.tsx +12 -1
- package/src/blocks/sidebar.tsx +43 -21
- package/src/components/breadcrumb.tsx +43 -26
- package/src/components/callout.tsx +5 -4
- package/src/components/carousel.tsx +33 -4
- package/src/components/chip.tsx +22 -2
- package/src/components/combobox.tsx +18 -3
- package/src/components/command.tsx +7 -1
- package/src/components/date-picker.tsx +17 -3
- package/src/components/dialog.tsx +17 -4
- package/src/components/drawer.tsx +2 -2
- package/src/components/global-layout.tsx +15 -2
- package/src/components/input-chip.tsx +12 -1
- package/src/components/input-password.tsx +73 -49
- package/src/components/link.tsx +29 -17
- package/src/components/logo.tsx +10 -2
- package/src/components/map.tsx +23 -0
- package/src/components/pagination.tsx +44 -11
- package/src/components/rating.tsx +20 -2
- package/src/components/select.tsx +9 -1
- package/src/components/separator.tsx +40 -25
- package/src/components/sheet.tsx +28 -20
- package/src/components/skeleton.tsx +13 -2
- package/src/components/text-reveal-motion.tsx +7 -1
- package/src/components/typography.tsx +6 -7
package/dist/blocks/sidebar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as k } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
2
|
+
import * as n from "react";
|
|
3
3
|
import { Slot as N } from "@radix-ui/react-slot";
|
|
4
4
|
import { cva as I } from "class-variance-authority";
|
|
5
5
|
import { ChevronRight as M, Ellipsis as H, Minus as F, Plus as E, ChevronsUpDown as G, ChevronDown as O, Menu as K, PanelLeft as U } from "@brightlocal/icons";
|
|
@@ -15,55 +15,55 @@ import { Skeleton as A } from "../skeleton.js";
|
|
|
15
15
|
import { Tooltip as te, TooltipTrigger as re, TooltipContent as oe, TooltipProvider as ie } from "../tooltip.js";
|
|
16
16
|
import { useIsBelowBreakpoint as se } from "../hooks/use-breakpoint.js";
|
|
17
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.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 =
|
|
18
|
+
const he = "sidebar:state", ve = 3600 * 24 * 7, xe = "224px", we = "336px", ke = "48px", Ne = "b", T = n.createContext(null);
|
|
19
19
|
function S() {
|
|
20
|
-
const e =
|
|
20
|
+
const e = n.useContext(T);
|
|
21
21
|
if (!e)
|
|
22
22
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
23
23
|
return e;
|
|
24
24
|
}
|
|
25
|
-
const Se =
|
|
25
|
+
const Se = n.forwardRef(
|
|
26
26
|
({
|
|
27
27
|
dataHook: e,
|
|
28
28
|
trackingEl: a,
|
|
29
29
|
trackingLabel: t,
|
|
30
30
|
defaultOpen: o = !0,
|
|
31
31
|
open: i,
|
|
32
|
-
onOpenChange:
|
|
32
|
+
onOpenChange: s,
|
|
33
33
|
className: l,
|
|
34
34
|
style: c,
|
|
35
|
-
children:
|
|
36
|
-
...
|
|
37
|
-
},
|
|
38
|
-
const u = se("lg"), [b,
|
|
39
|
-
(
|
|
40
|
-
const
|
|
41
|
-
|
|
35
|
+
children: f,
|
|
36
|
+
...m
|
|
37
|
+
}, h) => {
|
|
38
|
+
const u = se("lg"), [b, v] = n.useState(!1), [p, R] = n.useState(o), w = i ?? p, y = n.useCallback(
|
|
39
|
+
(g) => {
|
|
40
|
+
const x = typeof g == "function" ? g(w) : g;
|
|
41
|
+
s ? s(x) : R(x), document.cookie = `${he}=${x}; path=/; max-age=${ve}`;
|
|
42
42
|
},
|
|
43
|
-
[
|
|
44
|
-
), C =
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
|
|
43
|
+
[s, w]
|
|
44
|
+
), C = n.useCallback(() => u ? v((g) => !g) : y((g) => !g), [u, y, v]);
|
|
45
|
+
n.useEffect(() => {
|
|
46
|
+
const g = (x) => {
|
|
47
|
+
x.key === Ne && (x.metaKey || x.ctrlKey) && (x.preventDefault(), C());
|
|
48
48
|
};
|
|
49
|
-
return window.addEventListener("keydown",
|
|
49
|
+
return window.addEventListener("keydown", g), () => window.removeEventListener("keydown", g);
|
|
50
50
|
}, [C]);
|
|
51
|
-
const D = w ? "expanded" : "collapsed", P =
|
|
51
|
+
const D = w ? "expanded" : "collapsed", P = n.useMemo(
|
|
52
52
|
() => ({
|
|
53
53
|
state: D,
|
|
54
54
|
open: w,
|
|
55
55
|
setOpen: y,
|
|
56
56
|
isMobile: u,
|
|
57
57
|
openMobile: b,
|
|
58
|
-
setOpenMobile:
|
|
58
|
+
setOpenMobile: v,
|
|
59
59
|
toggleSidebar: C
|
|
60
60
|
}),
|
|
61
|
-
[D, w, y, u, b,
|
|
61
|
+
[D, w, y, u, b, v, C]
|
|
62
62
|
);
|
|
63
63
|
return /* @__PURE__ */ r(T.Provider, { value: P, children: /* @__PURE__ */ r(ie, { delayDuration: 0, children: /* @__PURE__ */ r(
|
|
64
64
|
"div",
|
|
65
65
|
{
|
|
66
|
-
ref:
|
|
66
|
+
ref: h,
|
|
67
67
|
className: d(
|
|
68
68
|
"group/sidebar-wrapper flex min-h-svh w-full",
|
|
69
69
|
l
|
|
@@ -77,46 +77,46 @@ const Se = s.forwardRef(
|
|
|
77
77
|
"--sidebar-width-icon": ke,
|
|
78
78
|
...c
|
|
79
79
|
},
|
|
80
|
-
...
|
|
81
|
-
children:
|
|
80
|
+
...m,
|
|
81
|
+
children: f
|
|
82
82
|
}
|
|
83
83
|
) }) });
|
|
84
84
|
}
|
|
85
85
|
);
|
|
86
86
|
Se.displayName = "SidebarProvider";
|
|
87
|
-
const ye =
|
|
87
|
+
const ye = n.forwardRef(
|
|
88
88
|
({
|
|
89
89
|
dataHook: e,
|
|
90
90
|
trackingEl: a,
|
|
91
91
|
trackingLabel: t,
|
|
92
92
|
side: o = "left",
|
|
93
93
|
variant: i = "sidebar",
|
|
94
|
-
collapsible:
|
|
94
|
+
collapsible: s = "offcanvas",
|
|
95
95
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- accepted for backward compat
|
|
96
96
|
embedded: l,
|
|
97
|
-
mobileTitle: c
|
|
98
|
-
mobileDescription:
|
|
99
|
-
className:
|
|
100
|
-
children:
|
|
97
|
+
mobileTitle: c,
|
|
98
|
+
mobileDescription: f,
|
|
99
|
+
className: m,
|
|
100
|
+
children: h,
|
|
101
101
|
...u
|
|
102
102
|
}, b) => {
|
|
103
|
-
const { isMobile:
|
|
104
|
-
return
|
|
103
|
+
const { isMobile: v, state: p, openMobile: R, setOpenMobile: w } = S();
|
|
104
|
+
return s === "none" ? /* @__PURE__ */ r(
|
|
105
105
|
"div",
|
|
106
106
|
{
|
|
107
107
|
ref: b,
|
|
108
108
|
className: d(
|
|
109
109
|
"text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",
|
|
110
|
-
|
|
110
|
+
m
|
|
111
111
|
),
|
|
112
112
|
"data-hook": e,
|
|
113
113
|
"data-slot": "sidebar",
|
|
114
114
|
"data-tracking-el": a || "sidebar",
|
|
115
115
|
"data-tracking-label": t,
|
|
116
116
|
...u,
|
|
117
|
-
children:
|
|
117
|
+
children: h
|
|
118
118
|
}
|
|
119
|
-
) :
|
|
119
|
+
) : v ? /* @__PURE__ */ r(X, { open: R, onOpenChange: w, children: /* @__PURE__ */ k(
|
|
120
120
|
q,
|
|
121
121
|
{
|
|
122
122
|
className: "bg-sidebar-background text-sidebar-foreground w-(--sidebar-width) p-6",
|
|
@@ -128,9 +128,9 @@ const ye = s.forwardRef(
|
|
|
128
128
|
"--sidebar-width": `min(${we}, calc(100vw - 40px))`
|
|
129
129
|
},
|
|
130
130
|
children: [
|
|
131
|
-
/* @__PURE__ */ r(V, { className: "sr-only", children: c }),
|
|
132
|
-
/* @__PURE__ */ r(Y, { className: "sr-only", children:
|
|
133
|
-
/* @__PURE__ */ r("div", { className: "flex h-full w-full flex-col", children:
|
|
131
|
+
/* @__PURE__ */ r(V, { className: "sr-only", children: c ?? "Navigation" }),
|
|
132
|
+
/* @__PURE__ */ r(Y, { className: "sr-only", children: f ?? "Main navigation menu" }),
|
|
133
|
+
/* @__PURE__ */ r("div", { className: "flex h-full w-full flex-col", children: h })
|
|
134
134
|
]
|
|
135
135
|
}
|
|
136
136
|
) }) : /* @__PURE__ */ r(
|
|
@@ -140,11 +140,11 @@ const ye = s.forwardRef(
|
|
|
140
140
|
className: d(
|
|
141
141
|
"group text-sidebar-foreground flex h-full shrink-0 flex-col overflow-hidden transition-[width] duration-200 ease-linear",
|
|
142
142
|
p === "expanded" && "w-(--sidebar-width)",
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
s === "icon" && p === "collapsed" && "w-(--sidebar-width-icon)",
|
|
144
|
+
s === "offcanvas" && p === "collapsed" && "w-0",
|
|
145
|
+
m
|
|
146
146
|
),
|
|
147
|
-
"data-collapsible": p === "collapsed" ?
|
|
147
|
+
"data-collapsible": p === "collapsed" ? s : "",
|
|
148
148
|
"data-hook": e,
|
|
149
149
|
"data-side": o,
|
|
150
150
|
"data-slot": "sidebar",
|
|
@@ -153,47 +153,54 @@ const ye = s.forwardRef(
|
|
|
153
153
|
"data-tracking-label": t,
|
|
154
154
|
"data-variant": i,
|
|
155
155
|
...u,
|
|
156
|
-
children:
|
|
156
|
+
children: h
|
|
157
157
|
}
|
|
158
158
|
);
|
|
159
159
|
}
|
|
160
160
|
);
|
|
161
161
|
ye.displayName = "Sidebar";
|
|
162
|
-
const
|
|
163
|
-
({
|
|
164
|
-
|
|
162
|
+
const L = n.forwardRef(
|
|
163
|
+
({
|
|
164
|
+
className: e,
|
|
165
|
+
onClick: a,
|
|
166
|
+
dataHook: t = "sidebar-trigger",
|
|
167
|
+
toggleAriaLabel: o,
|
|
168
|
+
children: i,
|
|
169
|
+
...s
|
|
170
|
+
}, l) => {
|
|
171
|
+
const { toggleSidebar: c } = S(), f = o ?? "Toggle Sidebar";
|
|
165
172
|
return /* @__PURE__ */ k(
|
|
166
173
|
j,
|
|
167
174
|
{
|
|
168
|
-
ref:
|
|
175
|
+
ref: l,
|
|
169
176
|
iconOnly: !0,
|
|
170
|
-
"aria-label":
|
|
177
|
+
"aria-label": f,
|
|
171
178
|
className: d("h-7 w-7", e),
|
|
172
179
|
"data-slot": "sidebar-trigger",
|
|
173
180
|
dataHook: t,
|
|
174
181
|
size: "sm",
|
|
175
182
|
variant: "ghost",
|
|
176
|
-
onClick: (
|
|
177
|
-
a?.(
|
|
183
|
+
onClick: (m) => {
|
|
184
|
+
a?.(m), c();
|
|
178
185
|
},
|
|
179
|
-
...
|
|
186
|
+
...s,
|
|
180
187
|
children: [
|
|
181
|
-
|
|
182
|
-
/* @__PURE__ */ r("span", { className: "sr-only", children:
|
|
188
|
+
i || /* @__PURE__ */ r(U, {}),
|
|
189
|
+
/* @__PURE__ */ r("span", { className: "sr-only", children: f })
|
|
183
190
|
]
|
|
184
191
|
}
|
|
185
192
|
);
|
|
186
193
|
}
|
|
187
194
|
);
|
|
188
|
-
|
|
189
|
-
const Ce =
|
|
190
|
-
({ className: e,
|
|
191
|
-
const { toggleSidebar:
|
|
195
|
+
L.displayName = "SidebarTrigger";
|
|
196
|
+
const Ce = n.forwardRef(
|
|
197
|
+
({ className: e, toggleAriaLabel: a, ...t }, o) => {
|
|
198
|
+
const { toggleSidebar: i } = S(), s = a ?? "Toggle Sidebar";
|
|
192
199
|
return /* @__PURE__ */ r(
|
|
193
200
|
"button",
|
|
194
201
|
{
|
|
195
|
-
ref:
|
|
196
|
-
"aria-label":
|
|
202
|
+
ref: o,
|
|
203
|
+
"aria-label": s,
|
|
197
204
|
className: d(
|
|
198
205
|
"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-0.5 sm:flex",
|
|
199
206
|
"cursor-w-resize",
|
|
@@ -204,19 +211,19 @@ const Ce = s.forwardRef(
|
|
|
204
211
|
),
|
|
205
212
|
"data-slot": "sidebar-rail",
|
|
206
213
|
tabIndex: -1,
|
|
207
|
-
title:
|
|
208
|
-
onClick:
|
|
209
|
-
...
|
|
214
|
+
title: s,
|
|
215
|
+
onClick: i,
|
|
216
|
+
...t
|
|
210
217
|
}
|
|
211
218
|
);
|
|
212
219
|
}
|
|
213
220
|
);
|
|
214
221
|
Ce.displayName = "SidebarRail";
|
|
215
|
-
const Re =
|
|
216
|
-
({ className: e, dataHook: a, trackingEl: t, trackingLabel: o, ...i },
|
|
222
|
+
const Re = n.forwardRef(
|
|
223
|
+
({ className: e, dataHook: a, trackingEl: t, trackingLabel: o, ...i }, s) => /* @__PURE__ */ r(
|
|
217
224
|
"main",
|
|
218
225
|
{
|
|
219
|
-
ref:
|
|
226
|
+
ref: s,
|
|
220
227
|
className: d(
|
|
221
228
|
"bg-background relative flex min-h-svh flex-1 flex-col",
|
|
222
229
|
e
|
|
@@ -230,7 +237,7 @@ const Re = s.forwardRef(
|
|
|
230
237
|
)
|
|
231
238
|
);
|
|
232
239
|
Re.displayName = "SidebarInset";
|
|
233
|
-
const Me =
|
|
240
|
+
const Me = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ r(
|
|
234
241
|
$,
|
|
235
242
|
{
|
|
236
243
|
ref: t,
|
|
@@ -244,9 +251,9 @@ const Me = s.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ r(
|
|
|
244
251
|
}
|
|
245
252
|
));
|
|
246
253
|
Me.displayName = "SidebarInput";
|
|
247
|
-
const Ie =
|
|
254
|
+
const Ie = n.forwardRef(
|
|
248
255
|
({ className: e, dataHook: a, ...t }, o) => /* @__PURE__ */ r(
|
|
249
|
-
"
|
|
256
|
+
"header",
|
|
250
257
|
{
|
|
251
258
|
ref: o,
|
|
252
259
|
className: d(
|
|
@@ -260,9 +267,9 @@ const Ie = s.forwardRef(
|
|
|
260
267
|
)
|
|
261
268
|
);
|
|
262
269
|
Ie.displayName = "SidebarHeader";
|
|
263
|
-
const De =
|
|
270
|
+
const De = n.forwardRef(
|
|
264
271
|
({ className: e, dataHook: a, ...t }, o) => /* @__PURE__ */ r(
|
|
265
|
-
"
|
|
272
|
+
"footer",
|
|
266
273
|
{
|
|
267
274
|
ref: o,
|
|
268
275
|
className: d("flex flex-col gap-2 p-2", e),
|
|
@@ -273,7 +280,7 @@ const De = s.forwardRef(
|
|
|
273
280
|
)
|
|
274
281
|
);
|
|
275
282
|
De.displayName = "SidebarFooter";
|
|
276
|
-
const Ae =
|
|
283
|
+
const Ae = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ r(
|
|
277
284
|
W,
|
|
278
285
|
{
|
|
279
286
|
ref: t,
|
|
@@ -286,13 +293,13 @@ const Ae = s.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ r(
|
|
|
286
293
|
}
|
|
287
294
|
));
|
|
288
295
|
Ae.displayName = "SidebarSeparator";
|
|
289
|
-
const Ee =
|
|
290
|
-
({ className: e, dataHook: a, ariaLabel: t = "Sidebar", children: o, ...i },
|
|
296
|
+
const Ee = n.forwardRef(
|
|
297
|
+
({ className: e, dataHook: a, ariaLabel: t = "Sidebar", children: o, ...i }, s) => {
|
|
291
298
|
const { isMobile: l } = S();
|
|
292
299
|
return /* @__PURE__ */ r(
|
|
293
300
|
ae,
|
|
294
301
|
{
|
|
295
|
-
ref:
|
|
302
|
+
ref: s,
|
|
296
303
|
className: d(
|
|
297
304
|
"min-h-0 flex-1 group-data-[collapsible=icon]:overflow-hidden *:data-[slot=scroll-area-viewport]:p-0 [&_[data-slot=scroll-area-viewport]>div]:block!",
|
|
298
305
|
e
|
|
@@ -314,7 +321,7 @@ const Ee = s.forwardRef(
|
|
|
314
321
|
}
|
|
315
322
|
);
|
|
316
323
|
Ee.displayName = "SidebarContent";
|
|
317
|
-
const Oe =
|
|
324
|
+
const Oe = n.forwardRef(
|
|
318
325
|
({ className: e, dataHook: a, ...t }, o) => /* @__PURE__ */ r(
|
|
319
326
|
"div",
|
|
320
327
|
{
|
|
@@ -347,28 +354,28 @@ const Te = I(
|
|
|
347
354
|
variant: "default"
|
|
348
355
|
}
|
|
349
356
|
}
|
|
350
|
-
),
|
|
357
|
+
), Le = n.forwardRef(
|
|
351
358
|
({
|
|
352
359
|
className: e,
|
|
353
360
|
dataHook: a,
|
|
354
361
|
asChild: t = !1,
|
|
355
362
|
size: o = "sm",
|
|
356
363
|
variant: i = "default",
|
|
357
|
-
isOpen:
|
|
364
|
+
isOpen: s = !1,
|
|
358
365
|
onToggle: l,
|
|
359
366
|
onAction: c,
|
|
360
|
-
children:
|
|
361
|
-
...
|
|
362
|
-
},
|
|
367
|
+
children: f,
|
|
368
|
+
...m
|
|
369
|
+
}, h) => {
|
|
363
370
|
const u = t ? N : "div", b = () => {
|
|
364
371
|
i === "collapsible" && l ? l() : i === "action" && c && c();
|
|
365
|
-
},
|
|
372
|
+
}, v = (p) => {
|
|
366
373
|
(p.key === "Enter" || p.key === " ") && (p.preventDefault(), b());
|
|
367
374
|
};
|
|
368
375
|
return /* @__PURE__ */ k(
|
|
369
376
|
u,
|
|
370
377
|
{
|
|
371
|
-
ref:
|
|
378
|
+
ref: h,
|
|
372
379
|
className: d(Te({ size: o, variant: i }), e),
|
|
373
380
|
"data-hook": a,
|
|
374
381
|
"data-slot": "sidebar-group-label",
|
|
@@ -376,16 +383,16 @@ const Te = I(
|
|
|
376
383
|
role: i !== "default" ? "button" : void 0,
|
|
377
384
|
tabIndex: i !== "default" ? 0 : void 0,
|
|
378
385
|
onClick: i !== "default" ? b : void 0,
|
|
379
|
-
onKeyDown: i !== "default" ?
|
|
380
|
-
...
|
|
386
|
+
onKeyDown: i !== "default" ? v : void 0,
|
|
387
|
+
...m,
|
|
381
388
|
children: [
|
|
382
|
-
/* @__PURE__ */ r("span", { children:
|
|
389
|
+
/* @__PURE__ */ r("span", { children: f }),
|
|
383
390
|
i === "collapsible" && /* @__PURE__ */ r(
|
|
384
391
|
O,
|
|
385
392
|
{
|
|
386
393
|
className: d(
|
|
387
394
|
"shrink-0 transition-transform duration-200",
|
|
388
|
-
|
|
395
|
+
s && "rotate-180"
|
|
389
396
|
),
|
|
390
397
|
size: 16
|
|
391
398
|
}
|
|
@@ -396,8 +403,8 @@ const Te = I(
|
|
|
396
403
|
);
|
|
397
404
|
}
|
|
398
405
|
);
|
|
399
|
-
|
|
400
|
-
const
|
|
406
|
+
Le.displayName = "SidebarGroupLabel";
|
|
407
|
+
const ze = n.forwardRef(({ className: e, asChild: a = !1, ...t }, o) => /* @__PURE__ */ r(
|
|
401
408
|
a ? N : "button",
|
|
402
409
|
{
|
|
403
410
|
ref: o,
|
|
@@ -412,8 +419,8 @@ const Le = s.forwardRef(({ className: e, asChild: a = !1, ...t }, o) => /* @__PU
|
|
|
412
419
|
...t
|
|
413
420
|
}
|
|
414
421
|
));
|
|
415
|
-
|
|
416
|
-
const _e =
|
|
422
|
+
ze.displayName = "SidebarGroupAction";
|
|
423
|
+
const _e = n.forwardRef(({ className: e, dataHook: a, ...t }, o) => /* @__PURE__ */ r(
|
|
417
424
|
"div",
|
|
418
425
|
{
|
|
419
426
|
ref: o,
|
|
@@ -424,7 +431,7 @@ const _e = s.forwardRef(({ className: e, dataHook: a, ...t }, o) => /* @__PURE__
|
|
|
424
431
|
}
|
|
425
432
|
));
|
|
426
433
|
_e.displayName = "SidebarGroupContent";
|
|
427
|
-
const Be =
|
|
434
|
+
const Be = n.forwardRef(
|
|
428
435
|
({ className: e, dataHook: a, ...t }, o) => /* @__PURE__ */ r(
|
|
429
436
|
"ul",
|
|
430
437
|
{
|
|
@@ -437,7 +444,7 @@ const Be = s.forwardRef(
|
|
|
437
444
|
)
|
|
438
445
|
);
|
|
439
446
|
Be.displayName = "SidebarMenu";
|
|
440
|
-
const
|
|
447
|
+
const z = n.forwardRef(
|
|
441
448
|
({ className: e, dataHook: a, ...t }, o) => /* @__PURE__ */ r(
|
|
442
449
|
"li",
|
|
443
450
|
{
|
|
@@ -449,15 +456,15 @@ const L = s.forwardRef(
|
|
|
449
456
|
}
|
|
450
457
|
)
|
|
451
458
|
);
|
|
452
|
-
|
|
453
|
-
const Pe =
|
|
459
|
+
z.displayName = "SidebarMenuItem";
|
|
460
|
+
const Pe = n.forwardRef(
|
|
454
461
|
({
|
|
455
462
|
type: e = "caret",
|
|
456
463
|
isActive: a = !1,
|
|
457
464
|
className: t,
|
|
458
465
|
...o
|
|
459
466
|
}, i) => {
|
|
460
|
-
const
|
|
467
|
+
const s = {
|
|
461
468
|
ref: i,
|
|
462
469
|
className: d(
|
|
463
470
|
"shrink-0 transition-transform",
|
|
@@ -469,17 +476,17 @@ const Pe = s.forwardRef(
|
|
|
469
476
|
};
|
|
470
477
|
switch (e) {
|
|
471
478
|
case "horizontal":
|
|
472
|
-
return /* @__PURE__ */ r(M, { ...
|
|
479
|
+
return /* @__PURE__ */ r(M, { ...s });
|
|
473
480
|
case "vertical":
|
|
474
|
-
return /* @__PURE__ */ r(O, { ...
|
|
481
|
+
return /* @__PURE__ */ r(O, { ...s });
|
|
475
482
|
case "upDown":
|
|
476
|
-
return /* @__PURE__ */ r(G, { ...
|
|
483
|
+
return /* @__PURE__ */ r(G, { ...s });
|
|
477
484
|
case "plusMinus":
|
|
478
|
-
return a ? /* @__PURE__ */ r(F, { ...
|
|
485
|
+
return a ? /* @__PURE__ */ r(F, { ...s }) : /* @__PURE__ */ r(E, { ...s });
|
|
479
486
|
case "dots":
|
|
480
|
-
return /* @__PURE__ */ r(H, { ...
|
|
487
|
+
return /* @__PURE__ */ r(H, { ...s });
|
|
481
488
|
default:
|
|
482
|
-
return /* @__PURE__ */ r(M, { ...
|
|
489
|
+
return /* @__PURE__ */ r(M, { ...s });
|
|
483
490
|
}
|
|
484
491
|
}
|
|
485
492
|
);
|
|
@@ -513,22 +520,22 @@ const He = I(
|
|
|
513
520
|
size: "default"
|
|
514
521
|
}
|
|
515
522
|
}
|
|
516
|
-
), _ =
|
|
523
|
+
), _ = n.forwardRef(
|
|
517
524
|
({
|
|
518
525
|
asChild: e = !1,
|
|
519
526
|
isActive: a = !1,
|
|
520
527
|
variant: t = "simple",
|
|
521
528
|
size: o = "default",
|
|
522
529
|
tooltip: i,
|
|
523
|
-
className:
|
|
530
|
+
className: s,
|
|
524
531
|
dataHook: l,
|
|
525
532
|
...c
|
|
526
|
-
},
|
|
527
|
-
const
|
|
528
|
-
|
|
533
|
+
}, f) => {
|
|
534
|
+
const m = e ? N : "button", { isMobile: h, state: u } = S(), b = /* @__PURE__ */ r(
|
|
535
|
+
m,
|
|
529
536
|
{
|
|
530
|
-
ref:
|
|
531
|
-
className: d(He({ variant: t, size: o }),
|
|
537
|
+
ref: f,
|
|
538
|
+
className: d(He({ variant: t, size: o }), s),
|
|
532
539
|
"data-active": a,
|
|
533
540
|
"data-hook": l,
|
|
534
541
|
"data-size": o,
|
|
@@ -552,7 +559,7 @@ const He = I(
|
|
|
552
559
|
"bg-foreground text-background border-none",
|
|
553
560
|
i.className
|
|
554
561
|
),
|
|
555
|
-
hidden: u !== "collapsed" ||
|
|
562
|
+
hidden: u !== "collapsed" || h,
|
|
556
563
|
side: "right",
|
|
557
564
|
sideOffset: 8
|
|
558
565
|
}
|
|
@@ -561,7 +568,7 @@ const He = I(
|
|
|
561
568
|
}
|
|
562
569
|
);
|
|
563
570
|
_.displayName = "SidebarMenuButton";
|
|
564
|
-
const Fe =
|
|
571
|
+
const Fe = n.forwardRef(({ className: e, asChild: a = !1, showOnHover: t = !1, ...o }, i) => /* @__PURE__ */ r(
|
|
565
572
|
a ? N : "button",
|
|
566
573
|
{
|
|
567
574
|
ref: i,
|
|
@@ -582,7 +589,7 @@ const Fe = s.forwardRef(({ className: e, asChild: a = !1, showOnHover: t = !1, .
|
|
|
582
589
|
}
|
|
583
590
|
));
|
|
584
591
|
Fe.displayName = "SidebarMenuAction";
|
|
585
|
-
const Ge =
|
|
592
|
+
const Ge = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ r(
|
|
586
593
|
"div",
|
|
587
594
|
{
|
|
588
595
|
ref: t,
|
|
@@ -597,8 +604,8 @@ const Ge = s.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ r(
|
|
|
597
604
|
}
|
|
598
605
|
));
|
|
599
606
|
Ge.displayName = "SidebarMenuBadge";
|
|
600
|
-
const Ke =
|
|
601
|
-
const i =
|
|
607
|
+
const Ke = n.forwardRef(({ className: e, showIcon: a = !1, ...t }, o) => {
|
|
608
|
+
const i = n.useId(), s = n.useMemo(() => {
|
|
602
609
|
let l = 0;
|
|
603
610
|
for (let c = 0; c < i.length; c++)
|
|
604
611
|
l = (l << 5) - l + i.charCodeAt(c), l |= 0;
|
|
@@ -625,7 +632,7 @@ const Ke = s.forwardRef(({ className: e, showIcon: a = !1, ...t }, o) => {
|
|
|
625
632
|
className: "h-4 max-w-[--skeleton-width] flex-1",
|
|
626
633
|
"data-slot": "sidebar-menu-skeleton-text",
|
|
627
634
|
style: {
|
|
628
|
-
"--skeleton-width":
|
|
635
|
+
"--skeleton-width": s
|
|
629
636
|
}
|
|
630
637
|
}
|
|
631
638
|
)
|
|
@@ -635,20 +642,20 @@ const Ke = s.forwardRef(({ className: e, showIcon: a = !1, ...t }, o) => {
|
|
|
635
642
|
});
|
|
636
643
|
Ke.displayName = "SidebarMenuSkeleton";
|
|
637
644
|
const Ue = I(
|
|
638
|
-
"flex min-w-0 flex-col items-start gap-1
|
|
645
|
+
"flex min-w-0 flex-col items-start gap-1 py-0.5 group-data-[collapsible=icon]:hidden",
|
|
639
646
|
{
|
|
640
647
|
variants: {
|
|
641
648
|
variant: {
|
|
642
|
-
default: "",
|
|
643
|
-
border: "
|
|
644
|
-
indent: "
|
|
649
|
+
default: "px-10",
|
|
650
|
+
border: "border-l border-sidebar-border ml-10 pl-1 pr-10",
|
|
651
|
+
indent: "px-10"
|
|
645
652
|
}
|
|
646
653
|
},
|
|
647
654
|
defaultVariants: {
|
|
648
655
|
variant: "border"
|
|
649
656
|
}
|
|
650
657
|
}
|
|
651
|
-
), B =
|
|
658
|
+
), B = n.forwardRef(
|
|
652
659
|
({ className: e, variant: a = "border", dataHook: t, ...o }, i) => /* @__PURE__ */ r(
|
|
653
660
|
"ul",
|
|
654
661
|
{
|
|
@@ -661,7 +668,7 @@ const Ue = I(
|
|
|
661
668
|
)
|
|
662
669
|
);
|
|
663
670
|
B.displayName = "SidebarMenuSub";
|
|
664
|
-
const je =
|
|
671
|
+
const je = n.forwardRef(({ dataHook: e, ...a }, t) => /* @__PURE__ */ r(
|
|
665
672
|
"li",
|
|
666
673
|
{
|
|
667
674
|
ref: t,
|
|
@@ -671,14 +678,14 @@ const je = s.forwardRef(({ dataHook: e, ...a }, t) => /* @__PURE__ */ r(
|
|
|
671
678
|
}
|
|
672
679
|
));
|
|
673
680
|
je.displayName = "SidebarMenuSubItem";
|
|
674
|
-
const $e =
|
|
681
|
+
const $e = n.forwardRef(
|
|
675
682
|
({
|
|
676
683
|
asChild: e = !1,
|
|
677
684
|
size: a = "md",
|
|
678
685
|
isActive: t,
|
|
679
686
|
className: o,
|
|
680
687
|
dataHook: i,
|
|
681
|
-
...
|
|
688
|
+
...s
|
|
682
689
|
}, l) => /* @__PURE__ */ r(
|
|
683
690
|
e ? N : "a",
|
|
684
691
|
{
|
|
@@ -695,7 +702,7 @@ const $e = s.forwardRef(
|
|
|
695
702
|
"data-hook": i,
|
|
696
703
|
"data-size": a,
|
|
697
704
|
"data-slot": "sidebar-menu-sub-button",
|
|
698
|
-
...
|
|
705
|
+
...s
|
|
699
706
|
}
|
|
700
707
|
)
|
|
701
708
|
);
|
|
@@ -706,9 +713,9 @@ function We({
|
|
|
706
713
|
children: t,
|
|
707
714
|
defaultOpen: o,
|
|
708
715
|
open: i,
|
|
709
|
-
onOpenChange:
|
|
716
|
+
onOpenChange: s
|
|
710
717
|
}) {
|
|
711
|
-
return /* @__PURE__ */ r(
|
|
718
|
+
return /* @__PURE__ */ r(z, { children: /* @__PURE__ */ r(
|
|
712
719
|
Z,
|
|
713
720
|
{
|
|
714
721
|
collapsible: !0,
|
|
@@ -717,13 +724,13 @@ function We({
|
|
|
717
724
|
defaultValue: o ? "item" : void 0,
|
|
718
725
|
type: "single",
|
|
719
726
|
value: i !== void 0 ? i ? "item" : "" : void 0,
|
|
720
|
-
onValueChange:
|
|
727
|
+
onValueChange: s ? (l) => s(l === "item") : void 0,
|
|
721
728
|
children: /* @__PURE__ */ r(J, { className: "group/collapsible border-none", value: "item", children: t })
|
|
722
729
|
}
|
|
723
730
|
) });
|
|
724
731
|
}
|
|
725
732
|
We.displayName = "SidebarMenuCollapsible";
|
|
726
|
-
const Xe =
|
|
733
|
+
const Xe = n.forwardRef(({ children: e, className: a, ...t }, o) => /* @__PURE__ */ r(ee.Trigger, { asChild: !0, children: /* @__PURE__ */ k(
|
|
727
734
|
_,
|
|
728
735
|
{
|
|
729
736
|
ref: o,
|
|
@@ -744,9 +751,9 @@ const Xe = s.forwardRef(({ children: e, className: a, ...t }, o) => /* @__PURE__
|
|
|
744
751
|
}
|
|
745
752
|
) }));
|
|
746
753
|
Xe.displayName = "SidebarMenuCollapsibleTrigger";
|
|
747
|
-
const qe =
|
|
754
|
+
const qe = n.forwardRef(({ dataHook: e, children: a, ...t }, o) => /* @__PURE__ */ r(Q, { className: "p-0", children: /* @__PURE__ */ r(B, { ref: o, dataHook: e, ...t, children: a }) }));
|
|
748
755
|
qe.displayName = "SidebarMenuCollapsibleContent";
|
|
749
|
-
const Ve =
|
|
756
|
+
const Ve = n.forwardRef(
|
|
750
757
|
({
|
|
751
758
|
className: e,
|
|
752
759
|
dataHook: a = "sidebar-drawer",
|
|
@@ -754,7 +761,7 @@ const Ve = s.forwardRef(
|
|
|
754
761
|
trackingLabel: o,
|
|
755
762
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- accepted for backward compat
|
|
756
763
|
children: i,
|
|
757
|
-
...
|
|
764
|
+
...s
|
|
758
765
|
}, l) => /* @__PURE__ */ r(
|
|
759
766
|
"div",
|
|
760
767
|
{
|
|
@@ -764,8 +771,8 @@ const Ve = s.forwardRef(
|
|
|
764
771
|
"data-slot": "sidebar-drawer",
|
|
765
772
|
"data-tracking-el": t,
|
|
766
773
|
"data-tracking-label": o,
|
|
767
|
-
...
|
|
768
|
-
children: /* @__PURE__ */ r(
|
|
774
|
+
...s,
|
|
775
|
+
children: /* @__PURE__ */ r(L, { dataHook: `${a}-trigger`, children: /* @__PURE__ */ r(K, { size: 24 }) })
|
|
769
776
|
}
|
|
770
777
|
)
|
|
771
778
|
);
|
|
@@ -779,9 +786,9 @@ export {
|
|
|
779
786
|
Ve as SidebarDrawer,
|
|
780
787
|
De as SidebarFooter,
|
|
781
788
|
Oe as SidebarGroup,
|
|
782
|
-
|
|
789
|
+
ze as SidebarGroupAction,
|
|
783
790
|
_e as SidebarGroupContent,
|
|
784
|
-
|
|
791
|
+
Le as SidebarGroupLabel,
|
|
785
792
|
ce as SidebarGroupLabelSize,
|
|
786
793
|
ue as SidebarGroupLabelVariant,
|
|
787
794
|
Ie as SidebarHeader,
|
|
@@ -796,7 +803,7 @@ export {
|
|
|
796
803
|
We as SidebarMenuCollapsible,
|
|
797
804
|
qe as SidebarMenuCollapsibleContent,
|
|
798
805
|
Xe as SidebarMenuCollapsibleTrigger,
|
|
799
|
-
|
|
806
|
+
z as SidebarMenuItem,
|
|
800
807
|
Ke as SidebarMenuSkeleton,
|
|
801
808
|
B as SidebarMenuSub,
|
|
802
809
|
$e as SidebarMenuSubButton,
|
|
@@ -807,7 +814,7 @@ export {
|
|
|
807
814
|
Ce as SidebarRail,
|
|
808
815
|
Ae as SidebarSeparator,
|
|
809
816
|
ne as SidebarSide,
|
|
810
|
-
|
|
817
|
+
L as SidebarTrigger,
|
|
811
818
|
de as SidebarVariant,
|
|
812
819
|
S as useSidebar
|
|
813
820
|
};
|