fina-react-ds 1.0.24 → 1.0.27
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/dist/components/alert-dialog.js +22 -22
- package/dist/components/alert.js +26 -26
- package/dist/components/avatar.js +19 -19
- package/dist/components/badge.js +20 -20
- package/dist/components/button.js +52 -52
- package/dist/components/calendar.js +83 -83
- package/dist/components/card.js +46 -46
- package/dist/components/checkbox.js +21 -21
- package/dist/components/date-picker.js +23 -23
- package/dist/components/dialog.js +38 -38
- package/dist/components/dropdown-menu.js +23 -23
- package/dist/components/file-uploader.js +47 -47
- package/dist/components/form-switch.js +9 -9
- package/dist/components/form.js +15 -15
- package/dist/components/hover-card.js +5 -5
- package/dist/components/input.js +15 -15
- package/dist/components/label.js +17 -17
- package/dist/components/mode-toggle.js +17 -17
- package/dist/components/pagination.js +25 -25
- package/dist/components/popover.js +8 -8
- package/dist/components/select.js +38 -38
- package/dist/components/sheet.js +78 -76
- package/dist/components/sidebar.js +198 -198
- package/dist/components/skeleton.js +7 -7
- package/dist/components/sonner.js +3 -3
- package/dist/components/switch.js +20 -20
- package/dist/components/table.js +44 -44
- package/dist/components/tabs.js +29 -29
- package/dist/components/textarea.js +12 -12
- package/dist/components/tooltip.js +14 -14
- package/dist/lib/arrays.d.ts +2 -2
- package/dist/lib/arrays.js +3 -3
- package/dist/providers/loader-provider.js +7 -7
- package/dist/themes/base.css +985 -884
- package/package.json +1 -1
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
var I = Object.defineProperty;
|
|
2
|
-
var
|
|
2
|
+
var r = (a, e) => I(a, "name", { value: e, configurable: !0 });
|
|
3
3
|
import { jsx as t, jsxs as g } from "react/jsx-runtime";
|
|
4
|
-
import * as
|
|
4
|
+
import * as c from "react";
|
|
5
5
|
import { cva as C } from "class-variance-authority";
|
|
6
6
|
import { PanelLeftIcon as E } from "lucide-react";
|
|
7
7
|
import { Slot as v } from "radix-ui";
|
|
8
8
|
import { useIsMobile as D } from "../hooks/use-mobile.js";
|
|
9
|
-
import { cn as
|
|
9
|
+
import { cn as i } from "../lib/utils.js";
|
|
10
10
|
import { Button as R } from "./button.js";
|
|
11
11
|
import { Input as T } from "./input.js";
|
|
12
12
|
import { Separator as B } from "./separator.js";
|
|
13
13
|
import { Sheet as A, SheetContent as O, SheetHeader as H, SheetTitle as K, SheetDescription as j } from "./sheet.js";
|
|
14
14
|
import { Skeleton as _ } from "./skeleton.js";
|
|
15
15
|
import { Tooltip as G, TooltipTrigger as L, TooltipContent as $, TooltipProvider as P } from "./tooltip.js";
|
|
16
|
-
const V = "sidebar_state", W = 60 * 60 * 24 * 7, q = "16rem", F = "18rem", U = "3rem", X = "b", M =
|
|
16
|
+
const V = "sidebar_state", W = 60 * 60 * 24 * 7, q = "16rem", F = "18rem", U = "3rem", X = "b", M = c.createContext(null);
|
|
17
17
|
function N() {
|
|
18
|
-
const a =
|
|
18
|
+
const a = c.useContext(M);
|
|
19
19
|
if (!a)
|
|
20
20
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
21
21
|
return a;
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
function
|
|
23
|
+
r(N, "useSidebar");
|
|
24
|
+
function ue({
|
|
25
25
|
defaultOpen: a = !0,
|
|
26
26
|
open: e,
|
|
27
|
-
onOpenChange:
|
|
28
|
-
className:
|
|
29
|
-
style:
|
|
30
|
-
children:
|
|
27
|
+
onOpenChange: n,
|
|
28
|
+
className: o,
|
|
29
|
+
style: d,
|
|
30
|
+
children: l,
|
|
31
31
|
...m
|
|
32
32
|
}) {
|
|
33
|
-
const
|
|
34
|
-
(
|
|
35
|
-
const
|
|
36
|
-
|
|
33
|
+
const u = D(), [p, b] = c.useState(!1), [x, k] = c.useState(a), h = e ?? x, w = c.useCallback(
|
|
34
|
+
(s) => {
|
|
35
|
+
const f = typeof s == "function" ? s(h) : s;
|
|
36
|
+
n ? n(f) : k(f), document.cookie = `${V}=${f}; path=/; max-age=${W}`;
|
|
37
37
|
},
|
|
38
|
-
[
|
|
39
|
-
), S =
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
38
|
+
[n, h]
|
|
39
|
+
), S = c.useCallback(() => u ? b((s) => !s) : w((s) => !s), [u, w, b]);
|
|
40
|
+
c.useEffect(() => {
|
|
41
|
+
const s = /* @__PURE__ */ r((f) => {
|
|
42
|
+
f.key === X && (f.metaKey || f.ctrlKey) && (f.preventDefault(), S());
|
|
43
43
|
}, "handleKeyDown");
|
|
44
|
-
return window.addEventListener("keydown",
|
|
44
|
+
return window.addEventListener("keydown", s), () => window.removeEventListener("keydown", s);
|
|
45
45
|
}, [S]);
|
|
46
|
-
const y = h ? "expanded" : "collapsed", z =
|
|
46
|
+
const y = h ? "expanded" : "collapsed", z = c.useMemo(
|
|
47
47
|
() => ({
|
|
48
48
|
state: y,
|
|
49
49
|
open: h,
|
|
50
50
|
setOpen: w,
|
|
51
|
-
isMobile:
|
|
51
|
+
isMobile: u,
|
|
52
52
|
openMobile: p,
|
|
53
|
-
setOpenMobile:
|
|
53
|
+
setOpenMobile: b,
|
|
54
54
|
toggleSidebar: S
|
|
55
55
|
}),
|
|
56
|
-
[y, h, w,
|
|
56
|
+
[y, h, w, u, p, b, S]
|
|
57
57
|
);
|
|
58
58
|
return /* @__PURE__ */ t(M.Provider, { value: z, children: /* @__PURE__ */ t(P, { delayDuration: 0, children: /* @__PURE__ */ t(
|
|
59
59
|
"div",
|
|
@@ -62,63 +62,63 @@ function se({
|
|
|
62
62
|
style: {
|
|
63
63
|
"--sidebar-width": q,
|
|
64
64
|
"--sidebar-width-icon": U,
|
|
65
|
-
...
|
|
65
|
+
...d
|
|
66
66
|
},
|
|
67
|
-
className:
|
|
68
|
-
"
|
|
69
|
-
|
|
67
|
+
className: i(
|
|
68
|
+
"group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",
|
|
69
|
+
o
|
|
70
70
|
),
|
|
71
71
|
...m,
|
|
72
|
-
children:
|
|
72
|
+
children: l
|
|
73
73
|
}
|
|
74
74
|
) }) });
|
|
75
75
|
}
|
|
76
|
-
|
|
77
|
-
function
|
|
76
|
+
r(ue, "SidebarProvider");
|
|
77
|
+
function ce({
|
|
78
78
|
side: a = "left",
|
|
79
79
|
variant: e = "sidebar",
|
|
80
|
-
collapsible:
|
|
81
|
-
className:
|
|
82
|
-
children:
|
|
83
|
-
...
|
|
80
|
+
collapsible: n = "offcanvas",
|
|
81
|
+
className: o,
|
|
82
|
+
children: d,
|
|
83
|
+
...l
|
|
84
84
|
}) {
|
|
85
|
-
const { isMobile: m, state:
|
|
86
|
-
return
|
|
85
|
+
const { isMobile: m, state: u, openMobile: p, setOpenMobile: b } = N();
|
|
86
|
+
return n === "none" ? /* @__PURE__ */ t(
|
|
87
87
|
"div",
|
|
88
88
|
{
|
|
89
89
|
"data-slot": "sidebar",
|
|
90
|
-
className:
|
|
91
|
-
"
|
|
92
|
-
|
|
90
|
+
className: i(
|
|
91
|
+
"bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",
|
|
92
|
+
o
|
|
93
93
|
),
|
|
94
|
-
...
|
|
95
|
-
children:
|
|
94
|
+
...l,
|
|
95
|
+
children: d
|
|
96
96
|
}
|
|
97
|
-
) : m ? /* @__PURE__ */ t(A, { open: p, onOpenChange:
|
|
97
|
+
) : m ? /* @__PURE__ */ t(A, { open: p, onOpenChange: b, ...l, children: /* @__PURE__ */ g(
|
|
98
98
|
O,
|
|
99
99
|
{
|
|
100
100
|
"data-sidebar": "sidebar",
|
|
101
101
|
"data-slot": "sidebar",
|
|
102
102
|
"data-mobile": "true",
|
|
103
|
-
className: "
|
|
103
|
+
className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
|
|
104
104
|
style: {
|
|
105
105
|
"--sidebar-width": F
|
|
106
106
|
},
|
|
107
107
|
side: a,
|
|
108
108
|
children: [
|
|
109
|
-
/* @__PURE__ */ g(H, { className: "
|
|
109
|
+
/* @__PURE__ */ g(H, { className: "sr-only", children: [
|
|
110
110
|
/* @__PURE__ */ t(K, { children: "Sidebar" }),
|
|
111
111
|
/* @__PURE__ */ t(j, { children: "Displays the mobile sidebar." })
|
|
112
112
|
] }),
|
|
113
|
-
/* @__PURE__ */ t("div", { className: "
|
|
113
|
+
/* @__PURE__ */ t("div", { className: "flex h-full w-full flex-col", children: d })
|
|
114
114
|
]
|
|
115
115
|
}
|
|
116
116
|
) }) : /* @__PURE__ */ g(
|
|
117
117
|
"div",
|
|
118
118
|
{
|
|
119
|
-
className: "
|
|
120
|
-
"data-state":
|
|
121
|
-
"data-collapsible":
|
|
119
|
+
className: "group peer text-sidebar-foreground hidden md:block",
|
|
120
|
+
"data-state": u,
|
|
121
|
+
"data-collapsible": u === "collapsed" ? n : "",
|
|
122
122
|
"data-variant": e,
|
|
123
123
|
"data-side": a,
|
|
124
124
|
"data-slot": "sidebar",
|
|
@@ -127,11 +127,11 @@ function le({
|
|
|
127
127
|
"div",
|
|
128
128
|
{
|
|
129
129
|
"data-slot": "sidebar-gap",
|
|
130
|
-
className:
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
e === "floating" || e === "inset" ? "
|
|
130
|
+
className: i(
|
|
131
|
+
"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
|
|
132
|
+
"group-data-[collapsible=offcanvas]:w-0",
|
|
133
|
+
"group-data-[side=right]:rotate-180",
|
|
134
|
+
e === "floating" || e === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
|
|
135
135
|
)
|
|
136
136
|
}
|
|
137
137
|
),
|
|
@@ -139,21 +139,21 @@ function le({
|
|
|
139
139
|
"div",
|
|
140
140
|
{
|
|
141
141
|
"data-slot": "sidebar-container",
|
|
142
|
-
className:
|
|
143
|
-
"
|
|
144
|
-
a === "left" ? "
|
|
142
|
+
className: i(
|
|
143
|
+
"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
|
|
144
|
+
a === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
145
145
|
// Adjust the padding for floating and inset variants.
|
|
146
|
-
e === "floating" || e === "inset" ? "
|
|
147
|
-
|
|
146
|
+
e === "floating" || e === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
147
|
+
o
|
|
148
148
|
),
|
|
149
|
-
...
|
|
149
|
+
...l,
|
|
150
150
|
children: /* @__PURE__ */ t(
|
|
151
151
|
"div",
|
|
152
152
|
{
|
|
153
153
|
"data-sidebar": "sidebar",
|
|
154
154
|
"data-slot": "sidebar-inner",
|
|
155
|
-
className: "
|
|
156
|
-
children:
|
|
155
|
+
className: "bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",
|
|
156
|
+
children: d
|
|
157
157
|
}
|
|
158
158
|
)
|
|
159
159
|
}
|
|
@@ -162,13 +162,13 @@ function le({
|
|
|
162
162
|
}
|
|
163
163
|
);
|
|
164
164
|
}
|
|
165
|
-
|
|
166
|
-
function
|
|
165
|
+
r(ce, "Sidebar");
|
|
166
|
+
function be({
|
|
167
167
|
className: a,
|
|
168
168
|
onClick: e,
|
|
169
|
-
...
|
|
169
|
+
...n
|
|
170
170
|
}) {
|
|
171
|
-
const { toggleSidebar:
|
|
171
|
+
const { toggleSidebar: o } = N();
|
|
172
172
|
return /* @__PURE__ */ g(
|
|
173
173
|
R,
|
|
174
174
|
{
|
|
@@ -177,21 +177,21 @@ function ue({
|
|
|
177
177
|
variant: "ghost",
|
|
178
178
|
color: "dark",
|
|
179
179
|
size: "icon",
|
|
180
|
-
className:
|
|
181
|
-
onClick: /* @__PURE__ */
|
|
182
|
-
e == null || e(
|
|
180
|
+
className: i("size-7", a),
|
|
181
|
+
onClick: /* @__PURE__ */ r((d) => {
|
|
182
|
+
e == null || e(d), o();
|
|
183
183
|
}, "onClick"),
|
|
184
|
-
...
|
|
184
|
+
...n,
|
|
185
185
|
children: [
|
|
186
186
|
/* @__PURE__ */ t(E, {}),
|
|
187
|
-
/* @__PURE__ */ t("span", { className: "
|
|
187
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
188
188
|
]
|
|
189
189
|
}
|
|
190
190
|
);
|
|
191
191
|
}
|
|
192
|
-
|
|
193
|
-
function
|
|
194
|
-
const { toggleSidebar:
|
|
192
|
+
r(be, "SidebarTrigger");
|
|
193
|
+
function fe({ className: a, ...e }) {
|
|
194
|
+
const { toggleSidebar: n } = N();
|
|
195
195
|
return /* @__PURE__ */ t(
|
|
196
196
|
"button",
|
|
197
197
|
{
|
|
@@ -199,37 +199,37 @@ function be({ className: a, ...e }) {
|
|
|
199
199
|
"data-slot": "sidebar-rail",
|
|
200
200
|
"aria-label": "Toggle Sidebar",
|
|
201
201
|
tabIndex: -1,
|
|
202
|
-
onClick:
|
|
202
|
+
onClick: n,
|
|
203
203
|
title: "Toggle Sidebar",
|
|
204
|
-
className:
|
|
205
|
-
"
|
|
206
|
-
"
|
|
207
|
-
"
|
|
208
|
-
"
|
|
209
|
-
"
|
|
210
|
-
"
|
|
204
|
+
className: i(
|
|
205
|
+
"hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex",
|
|
206
|
+
"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
|
|
207
|
+
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
208
|
+
"hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
|
|
209
|
+
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
210
|
+
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
211
211
|
a
|
|
212
212
|
),
|
|
213
213
|
...e
|
|
214
214
|
}
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
|
-
|
|
217
|
+
r(fe, "SidebarRail");
|
|
218
218
|
function pe({ className: a, ...e }) {
|
|
219
219
|
return /* @__PURE__ */ t(
|
|
220
220
|
"main",
|
|
221
221
|
{
|
|
222
222
|
"data-slot": "sidebar-inset",
|
|
223
|
-
className:
|
|
224
|
-
"
|
|
225
|
-
"
|
|
223
|
+
className: i(
|
|
224
|
+
"bg-background relative flex w-full flex-1 flex-col",
|
|
225
|
+
"md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
|
|
226
226
|
a
|
|
227
227
|
),
|
|
228
228
|
...e
|
|
229
229
|
}
|
|
230
230
|
);
|
|
231
231
|
}
|
|
232
|
-
|
|
232
|
+
r(pe, "SidebarInset");
|
|
233
233
|
function ge({
|
|
234
234
|
className: a,
|
|
235
235
|
...e
|
|
@@ -239,36 +239,36 @@ function ge({
|
|
|
239
239
|
{
|
|
240
240
|
"data-slot": "sidebar-input",
|
|
241
241
|
"data-sidebar": "input",
|
|
242
|
-
className:
|
|
242
|
+
className: i("bg-background h-8 w-full shadow-none", a),
|
|
243
243
|
...e
|
|
244
244
|
}
|
|
245
245
|
);
|
|
246
246
|
}
|
|
247
|
-
|
|
247
|
+
r(ge, "SidebarInput");
|
|
248
248
|
function me({ className: a, ...e }) {
|
|
249
249
|
return /* @__PURE__ */ t(
|
|
250
250
|
"div",
|
|
251
251
|
{
|
|
252
252
|
"data-slot": "sidebar-header",
|
|
253
253
|
"data-sidebar": "header",
|
|
254
|
-
className:
|
|
254
|
+
className: i("flex flex-col gap-2 p-2", a),
|
|
255
255
|
...e
|
|
256
256
|
}
|
|
257
257
|
);
|
|
258
258
|
}
|
|
259
|
-
|
|
259
|
+
r(me, "SidebarHeader");
|
|
260
260
|
function he({ className: a, ...e }) {
|
|
261
261
|
return /* @__PURE__ */ t(
|
|
262
262
|
"div",
|
|
263
263
|
{
|
|
264
264
|
"data-slot": "sidebar-footer",
|
|
265
265
|
"data-sidebar": "footer",
|
|
266
|
-
className:
|
|
266
|
+
className: i("flex flex-col gap-2 p-2", a),
|
|
267
267
|
...e
|
|
268
268
|
}
|
|
269
269
|
);
|
|
270
270
|
}
|
|
271
|
-
|
|
271
|
+
r(he, "SidebarFooter");
|
|
272
272
|
function ve({
|
|
273
273
|
className: a,
|
|
274
274
|
...e
|
|
@@ -278,83 +278,83 @@ function ve({
|
|
|
278
278
|
{
|
|
279
279
|
"data-slot": "sidebar-separator",
|
|
280
280
|
"data-sidebar": "separator",
|
|
281
|
-
className:
|
|
281
|
+
className: i("bg-sidebar-border mx-2 w-auto", a),
|
|
282
282
|
...e
|
|
283
283
|
}
|
|
284
284
|
);
|
|
285
285
|
}
|
|
286
|
-
|
|
286
|
+
r(ve, "SidebarSeparator");
|
|
287
287
|
function xe({ className: a, ...e }) {
|
|
288
288
|
return /* @__PURE__ */ t(
|
|
289
289
|
"div",
|
|
290
290
|
{
|
|
291
291
|
"data-slot": "sidebar-content",
|
|
292
292
|
"data-sidebar": "content",
|
|
293
|
-
className:
|
|
294
|
-
"
|
|
293
|
+
className: i(
|
|
294
|
+
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
295
295
|
a
|
|
296
296
|
),
|
|
297
297
|
...e
|
|
298
298
|
}
|
|
299
299
|
);
|
|
300
300
|
}
|
|
301
|
-
|
|
301
|
+
r(xe, "SidebarContent");
|
|
302
302
|
function we({ className: a, ...e }) {
|
|
303
303
|
return /* @__PURE__ */ t(
|
|
304
304
|
"div",
|
|
305
305
|
{
|
|
306
306
|
"data-slot": "sidebar-group",
|
|
307
307
|
"data-sidebar": "group",
|
|
308
|
-
className:
|
|
308
|
+
className: i("relative flex w-full min-w-0 flex-col p-2", a),
|
|
309
309
|
...e
|
|
310
310
|
}
|
|
311
311
|
);
|
|
312
312
|
}
|
|
313
|
-
|
|
313
|
+
r(we, "SidebarGroup");
|
|
314
314
|
function Se({
|
|
315
315
|
className: a,
|
|
316
316
|
asChild: e = !1,
|
|
317
|
-
...
|
|
317
|
+
...n
|
|
318
318
|
}) {
|
|
319
|
-
const
|
|
319
|
+
const o = e ? v.Root : "div";
|
|
320
320
|
return /* @__PURE__ */ t(
|
|
321
|
-
|
|
321
|
+
o,
|
|
322
322
|
{
|
|
323
323
|
"data-slot": "sidebar-group-label",
|
|
324
324
|
"data-sidebar": "group-label",
|
|
325
|
-
className:
|
|
326
|
-
"
|
|
327
|
-
"
|
|
325
|
+
className: i(
|
|
326
|
+
"text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
327
|
+
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
328
328
|
a
|
|
329
329
|
),
|
|
330
|
-
...
|
|
330
|
+
...n
|
|
331
331
|
}
|
|
332
332
|
);
|
|
333
333
|
}
|
|
334
|
-
|
|
334
|
+
r(Se, "SidebarGroupLabel");
|
|
335
335
|
function Ne({
|
|
336
336
|
className: a,
|
|
337
337
|
asChild: e = !1,
|
|
338
|
-
...
|
|
338
|
+
...n
|
|
339
339
|
}) {
|
|
340
|
-
const
|
|
340
|
+
const o = e ? v.Root : "button";
|
|
341
341
|
return /* @__PURE__ */ t(
|
|
342
|
-
|
|
342
|
+
o,
|
|
343
343
|
{
|
|
344
344
|
"data-slot": "sidebar-group-action",
|
|
345
345
|
"data-sidebar": "group-action",
|
|
346
|
-
className:
|
|
347
|
-
"
|
|
346
|
+
className: i(
|
|
347
|
+
"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 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
348
348
|
// Increases the hit area of the button on mobile.
|
|
349
|
-
"
|
|
350
|
-
"
|
|
349
|
+
"after:absolute after:-inset-2 md:after:hidden",
|
|
350
|
+
"group-data-[collapsible=icon]:hidden",
|
|
351
351
|
a
|
|
352
352
|
),
|
|
353
|
-
...
|
|
353
|
+
...n
|
|
354
354
|
}
|
|
355
355
|
);
|
|
356
356
|
}
|
|
357
|
-
|
|
357
|
+
r(Ne, "SidebarGroupAction");
|
|
358
358
|
function ye({
|
|
359
359
|
className: a,
|
|
360
360
|
...e
|
|
@@ -364,48 +364,48 @@ function ye({
|
|
|
364
364
|
{
|
|
365
365
|
"data-slot": "sidebar-group-content",
|
|
366
366
|
"data-sidebar": "group-content",
|
|
367
|
-
className:
|
|
367
|
+
className: i("w-full text-sm", a),
|
|
368
368
|
...e
|
|
369
369
|
}
|
|
370
370
|
);
|
|
371
371
|
}
|
|
372
|
-
|
|
372
|
+
r(ye, "SidebarGroupContent");
|
|
373
373
|
function _e({ className: a, ...e }) {
|
|
374
374
|
return /* @__PURE__ */ t(
|
|
375
375
|
"ul",
|
|
376
376
|
{
|
|
377
377
|
"data-slot": "sidebar-menu",
|
|
378
378
|
"data-sidebar": "menu",
|
|
379
|
-
className:
|
|
379
|
+
className: i("flex w-full min-w-0 flex-col gap-1", a),
|
|
380
380
|
...e
|
|
381
381
|
}
|
|
382
382
|
);
|
|
383
383
|
}
|
|
384
|
-
|
|
384
|
+
r(_e, "SidebarMenu");
|
|
385
385
|
function Me({ className: a, ...e }) {
|
|
386
386
|
return /* @__PURE__ */ t(
|
|
387
387
|
"li",
|
|
388
388
|
{
|
|
389
389
|
"data-slot": "sidebar-menu-item",
|
|
390
390
|
"data-sidebar": "menu-item",
|
|
391
|
-
className:
|
|
391
|
+
className: i("group/menu-item relative", a),
|
|
392
392
|
...e
|
|
393
393
|
}
|
|
394
394
|
);
|
|
395
395
|
}
|
|
396
|
-
|
|
396
|
+
r(Me, "SidebarMenuItem");
|
|
397
397
|
const Y = C(
|
|
398
|
-
"
|
|
398
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden 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 group-has-data-[sidebar=menu-action]/menu-item:pr-8 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! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
399
399
|
{
|
|
400
400
|
variants: {
|
|
401
401
|
variant: {
|
|
402
|
-
default: "
|
|
403
|
-
outline: "
|
|
402
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
403
|
+
outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
|
|
404
404
|
},
|
|
405
405
|
size: {
|
|
406
|
-
default: "
|
|
407
|
-
sm: "
|
|
408
|
-
lg: "
|
|
406
|
+
default: "h-8 text-sm",
|
|
407
|
+
sm: "h-7 text-xs",
|
|
408
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
409
409
|
}
|
|
410
410
|
},
|
|
411
411
|
defaultVariants: {
|
|
@@ -417,25 +417,25 @@ const Y = C(
|
|
|
417
417
|
function ke({
|
|
418
418
|
asChild: a = !1,
|
|
419
419
|
isActive: e = !1,
|
|
420
|
-
variant:
|
|
421
|
-
size:
|
|
422
|
-
tooltip:
|
|
423
|
-
className:
|
|
420
|
+
variant: n = "default",
|
|
421
|
+
size: o = "default",
|
|
422
|
+
tooltip: d,
|
|
423
|
+
className: l,
|
|
424
424
|
...m
|
|
425
425
|
}) {
|
|
426
|
-
const
|
|
427
|
-
|
|
426
|
+
const u = a ? v.Root : "button", { isMobile: p, state: b } = N(), x = /* @__PURE__ */ t(
|
|
427
|
+
u,
|
|
428
428
|
{
|
|
429
429
|
"data-slot": "sidebar-menu-button",
|
|
430
430
|
"data-sidebar": "menu-button",
|
|
431
|
-
"data-size":
|
|
431
|
+
"data-size": o,
|
|
432
432
|
"data-active": e,
|
|
433
|
-
className:
|
|
433
|
+
className: i(Y({ variant: n, size: o }), l),
|
|
434
434
|
...m
|
|
435
435
|
}
|
|
436
436
|
);
|
|
437
|
-
return
|
|
438
|
-
children:
|
|
437
|
+
return d ? (typeof d == "string" && (d = {
|
|
438
|
+
children: d
|
|
439
439
|
}), /* @__PURE__ */ g(G, { children: [
|
|
440
440
|
/* @__PURE__ */ t(L, { asChild: !0, children: x }),
|
|
441
441
|
/* @__PURE__ */ t(
|
|
@@ -443,41 +443,41 @@ function ke({
|
|
|
443
443
|
{
|
|
444
444
|
side: "right",
|
|
445
445
|
align: "center",
|
|
446
|
-
hidden:
|
|
447
|
-
...
|
|
446
|
+
hidden: b !== "collapsed" || p,
|
|
447
|
+
...d
|
|
448
448
|
}
|
|
449
449
|
)
|
|
450
450
|
] })) : x;
|
|
451
451
|
}
|
|
452
|
-
|
|
452
|
+
r(ke, "SidebarMenuButton");
|
|
453
453
|
function ze({
|
|
454
454
|
className: a,
|
|
455
455
|
asChild: e = !1,
|
|
456
|
-
showOnHover:
|
|
457
|
-
...
|
|
456
|
+
showOnHover: n = !1,
|
|
457
|
+
...o
|
|
458
458
|
}) {
|
|
459
|
-
const
|
|
459
|
+
const d = e ? v.Root : "button";
|
|
460
460
|
return /* @__PURE__ */ t(
|
|
461
|
-
|
|
461
|
+
d,
|
|
462
462
|
{
|
|
463
463
|
"data-slot": "sidebar-menu-action",
|
|
464
464
|
"data-sidebar": "menu-action",
|
|
465
|
-
className:
|
|
466
|
-
"
|
|
465
|
+
className: i(
|
|
466
|
+
"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 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
467
467
|
// Increases the hit area of the button on mobile.
|
|
468
|
-
"
|
|
469
|
-
"
|
|
470
|
-
"
|
|
471
|
-
"
|
|
472
|
-
"
|
|
473
|
-
|
|
468
|
+
"after:absolute after:-inset-2 md:after:hidden",
|
|
469
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
470
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
471
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
472
|
+
"group-data-[collapsible=icon]:hidden",
|
|
473
|
+
n && "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",
|
|
474
474
|
a
|
|
475
475
|
),
|
|
476
|
-
...
|
|
476
|
+
...o
|
|
477
477
|
}
|
|
478
478
|
);
|
|
479
479
|
}
|
|
480
|
-
|
|
480
|
+
r(ze, "SidebarMenuAction");
|
|
481
481
|
function Ie({
|
|
482
482
|
className: a,
|
|
483
483
|
...e
|
|
@@ -487,48 +487,48 @@ function Ie({
|
|
|
487
487
|
{
|
|
488
488
|
"data-slot": "sidebar-menu-badge",
|
|
489
489
|
"data-sidebar": "menu-badge",
|
|
490
|
-
className:
|
|
491
|
-
"
|
|
492
|
-
"
|
|
493
|
-
"
|
|
494
|
-
"
|
|
495
|
-
"
|
|
496
|
-
"
|
|
490
|
+
className: i(
|
|
491
|
+
"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",
|
|
492
|
+
"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
|
|
493
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
494
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
495
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
496
|
+
"group-data-[collapsible=icon]:hidden",
|
|
497
497
|
a
|
|
498
498
|
),
|
|
499
499
|
...e
|
|
500
500
|
}
|
|
501
501
|
);
|
|
502
502
|
}
|
|
503
|
-
|
|
503
|
+
r(Ie, "SidebarMenuBadge");
|
|
504
504
|
function Ce({
|
|
505
505
|
className: a,
|
|
506
506
|
showIcon: e = !1,
|
|
507
|
-
...
|
|
507
|
+
...n
|
|
508
508
|
}) {
|
|
509
|
-
const
|
|
509
|
+
const o = c.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);
|
|
510
510
|
return /* @__PURE__ */ g(
|
|
511
511
|
"div",
|
|
512
512
|
{
|
|
513
513
|
"data-slot": "sidebar-menu-skeleton",
|
|
514
514
|
"data-sidebar": "menu-skeleton",
|
|
515
|
-
className:
|
|
516
|
-
...
|
|
515
|
+
className: i("flex h-8 items-center gap-2 rounded-md px-2", a),
|
|
516
|
+
...n,
|
|
517
517
|
children: [
|
|
518
518
|
e && /* @__PURE__ */ t(
|
|
519
519
|
_,
|
|
520
520
|
{
|
|
521
|
-
className: "
|
|
521
|
+
className: "size-4 rounded-md",
|
|
522
522
|
"data-sidebar": "menu-skeleton-icon"
|
|
523
523
|
}
|
|
524
524
|
),
|
|
525
525
|
/* @__PURE__ */ t(
|
|
526
526
|
_,
|
|
527
527
|
{
|
|
528
|
-
className: "
|
|
528
|
+
className: "h-4 max-w-(--skeleton-width) flex-1",
|
|
529
529
|
"data-sidebar": "menu-skeleton-text",
|
|
530
530
|
style: {
|
|
531
|
-
"--skeleton-width":
|
|
531
|
+
"--skeleton-width": o
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
)
|
|
@@ -536,23 +536,23 @@ function Ce({
|
|
|
536
536
|
}
|
|
537
537
|
);
|
|
538
538
|
}
|
|
539
|
-
|
|
539
|
+
r(Ce, "SidebarMenuSkeleton");
|
|
540
540
|
function Ee({ className: a, ...e }) {
|
|
541
541
|
return /* @__PURE__ */ t(
|
|
542
542
|
"ul",
|
|
543
543
|
{
|
|
544
544
|
"data-slot": "sidebar-menu-sub",
|
|
545
545
|
"data-sidebar": "menu-sub",
|
|
546
|
-
className:
|
|
547
|
-
"
|
|
548
|
-
"
|
|
546
|
+
className: i(
|
|
547
|
+
"border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5",
|
|
548
|
+
"group-data-[collapsible=icon]:hidden",
|
|
549
549
|
a
|
|
550
550
|
),
|
|
551
551
|
...e
|
|
552
552
|
}
|
|
553
553
|
);
|
|
554
554
|
}
|
|
555
|
-
|
|
555
|
+
r(Ee, "SidebarMenuSub");
|
|
556
556
|
function De({
|
|
557
557
|
className: a,
|
|
558
558
|
...e
|
|
@@ -562,42 +562,42 @@ function De({
|
|
|
562
562
|
{
|
|
563
563
|
"data-slot": "sidebar-menu-sub-item",
|
|
564
564
|
"data-sidebar": "menu-sub-item",
|
|
565
|
-
className:
|
|
565
|
+
className: i("group/menu-sub-item relative", a),
|
|
566
566
|
...e
|
|
567
567
|
}
|
|
568
568
|
);
|
|
569
569
|
}
|
|
570
|
-
|
|
570
|
+
r(De, "SidebarMenuSubItem");
|
|
571
571
|
function Re({
|
|
572
572
|
asChild: a = !1,
|
|
573
573
|
size: e = "md",
|
|
574
|
-
isActive:
|
|
575
|
-
className:
|
|
576
|
-
...
|
|
574
|
+
isActive: n = !1,
|
|
575
|
+
className: o,
|
|
576
|
+
...d
|
|
577
577
|
}) {
|
|
578
|
-
const
|
|
578
|
+
const l = a ? v.Root : "a";
|
|
579
579
|
return /* @__PURE__ */ t(
|
|
580
|
-
|
|
580
|
+
l,
|
|
581
581
|
{
|
|
582
582
|
"data-slot": "sidebar-menu-sub-button",
|
|
583
583
|
"data-sidebar": "menu-sub-button",
|
|
584
584
|
"data-size": e,
|
|
585
|
-
"data-active":
|
|
586
|
-
className:
|
|
587
|
-
"
|
|
588
|
-
"
|
|
589
|
-
e === "sm" && "
|
|
590
|
-
e === "md" && "
|
|
591
|
-
"
|
|
592
|
-
|
|
585
|
+
"data-active": n,
|
|
586
|
+
className: i(
|
|
587
|
+
"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-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden 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",
|
|
588
|
+
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
|
|
589
|
+
e === "sm" && "text-xs",
|
|
590
|
+
e === "md" && "text-sm",
|
|
591
|
+
"group-data-[collapsible=icon]:hidden",
|
|
592
|
+
o
|
|
593
593
|
),
|
|
594
|
-
...
|
|
594
|
+
...d
|
|
595
595
|
}
|
|
596
596
|
);
|
|
597
597
|
}
|
|
598
|
-
|
|
598
|
+
r(Re, "SidebarMenuSubButton");
|
|
599
599
|
export {
|
|
600
|
-
|
|
600
|
+
ce as Sidebar,
|
|
601
601
|
xe as SidebarContent,
|
|
602
602
|
he as SidebarFooter,
|
|
603
603
|
we as SidebarGroup,
|
|
@@ -616,9 +616,9 @@ export {
|
|
|
616
616
|
Ee as SidebarMenuSub,
|
|
617
617
|
Re as SidebarMenuSubButton,
|
|
618
618
|
De as SidebarMenuSubItem,
|
|
619
|
-
|
|
620
|
-
|
|
619
|
+
ue as SidebarProvider,
|
|
620
|
+
fe as SidebarRail,
|
|
621
621
|
ve as SidebarSeparator,
|
|
622
|
-
|
|
622
|
+
be as SidebarTrigger,
|
|
623
623
|
N as useSidebar
|
|
624
624
|
};
|