@cryptlex/web-components 3.1.2 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/sidebar.es.js +218 -275
- package/dist/components/ui/sidebar.es.js.map +1 -1
- package/dist/index.es.d.ts +33 -30
- package/dist/index.es.js +163 -160
- package/dist/index.es.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/theme.css +5 -0
- package/lib/utilities.css +1 -0
- package/package.json +2 -2
|
@@ -1,123 +1,126 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as t, jsxs as p } from "react/jsx-runtime";
|
|
2
|
-
import { Root as
|
|
3
|
-
import {
|
|
4
|
-
import * as
|
|
5
|
-
import { Button as
|
|
6
|
-
import {
|
|
7
|
-
import { Sheet as E, SheetContent as R, SheetHeader as _, SheetTitle as A, SheetDescription as H } from "./sheet.es.js";
|
|
3
|
+
import { Root as h } from "../../node_modules/.pnpm/@radix-ui_react-slot@1.2.3_@types_react@19.1.0_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.es.js";
|
|
4
|
+
import { PanelLeft as k } from "lucide-react";
|
|
5
|
+
import * as d from "react";
|
|
6
|
+
import { Button as T } from "./button.es.js";
|
|
7
|
+
import { Sheet as I, SheetContent as D, SheetHeader as B, SheetTitle as R, SheetDescription as E } from "./sheet.es.js";
|
|
8
8
|
import { Skeleton as N } from "./skeleton.es.js";
|
|
9
|
-
import { TooltipProvider as
|
|
10
|
-
import { useIsMobile as
|
|
9
|
+
import { TooltipProvider as O, Tooltip as A, TooltipTrigger as H, TooltipContent as j } from "./tooltip.es.js";
|
|
10
|
+
import { useIsMobile as L } from "../../hooks/use-mobile.es.js";
|
|
11
11
|
import { cn as i } from "../../utils/index.es.js";
|
|
12
|
-
const
|
|
12
|
+
const G = "16rem", K = "18rem", P = "3rem", W = "b", y = d.createContext(null);
|
|
13
13
|
function w() {
|
|
14
|
-
const
|
|
15
|
-
if (!
|
|
14
|
+
const a = d.useContext(y);
|
|
15
|
+
if (!a)
|
|
16
16
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
17
|
-
return
|
|
17
|
+
return a;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
defaultOpen:
|
|
21
|
-
open:
|
|
19
|
+
function ee({
|
|
20
|
+
defaultOpen: a = !0,
|
|
21
|
+
open: e,
|
|
22
22
|
onOpenChange: r,
|
|
23
23
|
className: n,
|
|
24
24
|
style: o,
|
|
25
|
-
children:
|
|
26
|
-
...
|
|
25
|
+
children: u,
|
|
26
|
+
...m
|
|
27
27
|
}) {
|
|
28
|
-
const
|
|
29
|
-
(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
C(d);
|
|
28
|
+
const l = L(), [c, f] = d.useState(!1), [M, _] = d.useState(a), g = e ?? M, x = d.useCallback(
|
|
29
|
+
(s) => {
|
|
30
|
+
const b = typeof s == "function" ? s(g) : s;
|
|
31
|
+
r ? r(b) : _(b);
|
|
33
32
|
},
|
|
34
|
-
[r,
|
|
35
|
-
),
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
33
|
+
[r, g]
|
|
34
|
+
), v = d.useCallback(() => l ? f((s) => !s) : x((s) => !s), [l, x, f]);
|
|
35
|
+
d.useEffect(() => {
|
|
36
|
+
const s = (b) => {
|
|
37
|
+
b.key === W && (b.metaKey || b.ctrlKey) && (b.preventDefault(), v());
|
|
39
38
|
};
|
|
40
|
-
return window.addEventListener("keydown",
|
|
41
|
-
}, [
|
|
42
|
-
const S =
|
|
39
|
+
return window.addEventListener("keydown", s), () => window.removeEventListener("keydown", s);
|
|
40
|
+
}, [v]);
|
|
41
|
+
const S = g ? "expanded" : "collapsed", z = d.useMemo(
|
|
43
42
|
() => ({
|
|
44
43
|
state: S,
|
|
45
|
-
open:
|
|
46
|
-
setOpen:
|
|
47
|
-
isMobile:
|
|
48
|
-
openMobile:
|
|
49
|
-
setOpenMobile:
|
|
50
|
-
toggleSidebar:
|
|
44
|
+
open: g,
|
|
45
|
+
setOpen: x,
|
|
46
|
+
isMobile: l,
|
|
47
|
+
openMobile: c,
|
|
48
|
+
setOpenMobile: f,
|
|
49
|
+
toggleSidebar: v
|
|
51
50
|
}),
|
|
52
|
-
[S,
|
|
51
|
+
[S, g, x, l, c, f, v]
|
|
53
52
|
);
|
|
54
|
-
return /* @__PURE__ */ t(y, { value:
|
|
53
|
+
return /* @__PURE__ */ t(y.Provider, { value: z, children: /* @__PURE__ */ t(O, { delayDuration: 0, children: /* @__PURE__ */ t(
|
|
55
54
|
"div",
|
|
56
55
|
{
|
|
57
56
|
style: {
|
|
58
|
-
"--sidebar-width":
|
|
59
|
-
"--sidebar-width-icon":
|
|
57
|
+
"--sidebar-width": G,
|
|
58
|
+
"--sidebar-width-icon": P,
|
|
60
59
|
...o
|
|
61
60
|
},
|
|
62
61
|
className: i(
|
|
63
|
-
"group/sidebar-wrapper flex w-full has-data-
|
|
62
|
+
"group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",
|
|
64
63
|
n
|
|
65
64
|
),
|
|
66
|
-
...
|
|
67
|
-
children:
|
|
65
|
+
...m,
|
|
66
|
+
children: u
|
|
68
67
|
}
|
|
69
68
|
) }) });
|
|
70
69
|
}
|
|
71
|
-
function
|
|
70
|
+
function ae({
|
|
71
|
+
side: a = "left",
|
|
72
72
|
variant: e = "sidebar",
|
|
73
|
-
collapsible:
|
|
74
|
-
className:
|
|
75
|
-
children:
|
|
76
|
-
...
|
|
73
|
+
collapsible: r = "offcanvas",
|
|
74
|
+
className: n,
|
|
75
|
+
children: o,
|
|
76
|
+
...u
|
|
77
77
|
}) {
|
|
78
|
-
const { isMobile:
|
|
79
|
-
return
|
|
78
|
+
const { isMobile: m, state: l, openMobile: c, setOpenMobile: f } = w();
|
|
79
|
+
return r === "none" ? /* @__PURE__ */ t(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
82
|
className: i(
|
|
83
|
-
"flex h-full w-
|
|
84
|
-
|
|
83
|
+
"flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",
|
|
84
|
+
n
|
|
85
85
|
),
|
|
86
|
-
...
|
|
87
|
-
children:
|
|
86
|
+
...u,
|
|
87
|
+
children: o
|
|
88
88
|
}
|
|
89
|
-
) :
|
|
90
|
-
|
|
89
|
+
) : m ? /* @__PURE__ */ t(I, { open: c, onOpenChange: f, ...u, children: /* @__PURE__ */ p(
|
|
90
|
+
D,
|
|
91
91
|
{
|
|
92
92
|
"data-sidebar": "sidebar",
|
|
93
93
|
"data-mobile": "true",
|
|
94
|
-
className: "w-
|
|
94
|
+
className: "w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
|
|
95
95
|
style: {
|
|
96
|
-
"--sidebar-width":
|
|
96
|
+
"--sidebar-width": K
|
|
97
97
|
},
|
|
98
|
+
side: a,
|
|
98
99
|
children: [
|
|
99
|
-
/* @__PURE__ */ p(
|
|
100
|
-
/* @__PURE__ */ t(
|
|
101
|
-
/* @__PURE__ */ t(
|
|
100
|
+
/* @__PURE__ */ p(B, { className: "sr-only", children: [
|
|
101
|
+
/* @__PURE__ */ t(R, { children: "Sidebar" }),
|
|
102
|
+
/* @__PURE__ */ t(E, { children: "Displays the mobile sidebar." })
|
|
102
103
|
] }),
|
|
103
|
-
/* @__PURE__ */ t("div", { className: "flex h-full w-full flex-col", children:
|
|
104
|
+
/* @__PURE__ */ t("div", { className: "flex h-full w-full flex-col", children: o })
|
|
104
105
|
]
|
|
105
106
|
}
|
|
106
107
|
) }) : /* @__PURE__ */ p(
|
|
107
108
|
"div",
|
|
108
109
|
{
|
|
109
|
-
className: "group peer hidden
|
|
110
|
-
"data-state":
|
|
111
|
-
"data-collapsible":
|
|
110
|
+
className: "group peer hidden text-sidebar-foreground md:block",
|
|
111
|
+
"data-state": l,
|
|
112
|
+
"data-collapsible": l === "collapsed" ? r : "",
|
|
112
113
|
"data-variant": e,
|
|
114
|
+
"data-side": a,
|
|
113
115
|
children: [
|
|
114
116
|
/* @__PURE__ */ t(
|
|
115
117
|
"div",
|
|
116
118
|
{
|
|
117
119
|
className: i(
|
|
118
|
-
"
|
|
120
|
+
"relative w-(--sidebar-width) bg-sidebar transition-[width] duration-200 ease-linear",
|
|
119
121
|
"group-data-[collapsible=offcanvas]:w-0",
|
|
120
|
-
|
|
122
|
+
"group-data-[side=right]:rotate-180",
|
|
123
|
+
e === "floating" || e === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]" : "group-data-[collapsible=icon]:w-[--sidebar-width-icon]"
|
|
121
124
|
)
|
|
122
125
|
}
|
|
123
126
|
),
|
|
@@ -125,19 +128,19 @@ function re({
|
|
|
125
128
|
"div",
|
|
126
129
|
{
|
|
127
130
|
className: i(
|
|
128
|
-
"
|
|
129
|
-
"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]",
|
|
131
|
+
"absolute z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
|
|
132
|
+
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)]",
|
|
130
133
|
// Adjust the padding for floating and inset variants.
|
|
131
|
-
e === "floating" || e === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(
|
|
132
|
-
|
|
134
|
+
e === "floating" || e === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]" : "group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
135
|
+
n
|
|
133
136
|
),
|
|
134
|
-
...
|
|
137
|
+
...u,
|
|
135
138
|
children: /* @__PURE__ */ t(
|
|
136
139
|
"div",
|
|
137
140
|
{
|
|
138
141
|
"data-sidebar": "sidebar",
|
|
139
|
-
className: "flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border",
|
|
140
|
-
children:
|
|
142
|
+
className: "flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",
|
|
143
|
+
children: o
|
|
141
144
|
}
|
|
142
145
|
)
|
|
143
146
|
}
|
|
@@ -146,296 +149,214 @@ function re({
|
|
|
146
149
|
}
|
|
147
150
|
);
|
|
148
151
|
}
|
|
149
|
-
function
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}) {
|
|
154
|
-
const { toggleSidebar: n, open: o, isMobile: l } = w();
|
|
155
|
-
return /* @__PURE__ */ t(
|
|
156
|
-
D,
|
|
152
|
+
function te({ className: a, onClick: e, ...r }) {
|
|
153
|
+
const { toggleSidebar: n } = w();
|
|
154
|
+
return /* @__PURE__ */ p(
|
|
155
|
+
T,
|
|
157
156
|
{
|
|
158
157
|
"data-sidebar": "trigger",
|
|
159
158
|
variant: "ghost",
|
|
160
159
|
size: "icon",
|
|
161
|
-
onClick: (
|
|
162
|
-
|
|
160
|
+
onClick: (o) => {
|
|
161
|
+
e == null || e(o), n();
|
|
163
162
|
},
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
...r,
|
|
164
|
+
children: [
|
|
165
|
+
/* @__PURE__ */ t(k, {}),
|
|
166
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
167
|
+
]
|
|
166
168
|
}
|
|
167
169
|
);
|
|
168
170
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
...a
|
|
172
|
-
}) {
|
|
173
|
-
const { toggleSidebar: r } = w();
|
|
171
|
+
const q = d.forwardRef(({ className: a, ...e }, r) => {
|
|
172
|
+
const { toggleSidebar: n } = w();
|
|
174
173
|
return /* @__PURE__ */ t(
|
|
175
174
|
"button",
|
|
176
175
|
{
|
|
176
|
+
ref: r,
|
|
177
177
|
"data-sidebar": "rail",
|
|
178
178
|
"aria-label": "Toggle Sidebar",
|
|
179
179
|
tabIndex: -1,
|
|
180
|
-
onClick:
|
|
180
|
+
onClick: n,
|
|
181
181
|
title: "Toggle Sidebar",
|
|
182
182
|
className: i(
|
|
183
|
-
"absolute inset-y-0 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] hover:after:bg-sidebar-border -right-4 sm:flex",
|
|
184
|
-
"cursor-w-resize",
|
|
185
|
-
"
|
|
186
|
-
"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full
|
|
187
|
-
"[[data-collapsible=offcanvas]_&]:-right-2",
|
|
188
|
-
|
|
183
|
+
"absolute inset-y-0 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] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex",
|
|
184
|
+
"[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize",
|
|
185
|
+
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
186
|
+
"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar",
|
|
187
|
+
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
188
|
+
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
189
|
+
a
|
|
189
190
|
),
|
|
190
|
-
...
|
|
191
|
+
...e
|
|
191
192
|
}
|
|
192
193
|
);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
...a
|
|
197
|
-
}) {
|
|
194
|
+
});
|
|
195
|
+
q.displayName = "SidebarRail";
|
|
196
|
+
function re({ className: a, ...e }) {
|
|
198
197
|
return /* @__PURE__ */ t(
|
|
199
198
|
"main",
|
|
200
199
|
{
|
|
201
200
|
className: i(
|
|
202
|
-
"relative flex flex-1 flex-col bg-background",
|
|
203
|
-
"peer-data-[variant=inset]:
|
|
204
|
-
|
|
201
|
+
"relative flex w-full flex-1 flex-col bg-background",
|
|
202
|
+
"md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",
|
|
203
|
+
a
|
|
205
204
|
),
|
|
206
|
-
...
|
|
205
|
+
...e
|
|
207
206
|
}
|
|
208
207
|
);
|
|
209
208
|
}
|
|
210
|
-
function
|
|
211
|
-
className: e,
|
|
212
|
-
...a
|
|
213
|
-
}) {
|
|
209
|
+
function ie({ className: a, ...e }) {
|
|
214
210
|
return /* @__PURE__ */ t(
|
|
215
211
|
"div",
|
|
216
212
|
{
|
|
217
213
|
"data-sidebar": "header",
|
|
218
|
-
className: i("flex flex-col gap-2 p-2",
|
|
219
|
-
...
|
|
214
|
+
className: i("flex flex-col gap-2 p-2", a),
|
|
215
|
+
...e
|
|
220
216
|
}
|
|
221
217
|
);
|
|
222
218
|
}
|
|
223
|
-
function
|
|
224
|
-
className: e,
|
|
225
|
-
...a
|
|
226
|
-
}) {
|
|
219
|
+
function ne({ className: a, ...e }) {
|
|
227
220
|
return /* @__PURE__ */ t(
|
|
228
221
|
"div",
|
|
229
222
|
{
|
|
230
223
|
"data-sidebar": "footer",
|
|
231
|
-
className: i("flex flex-col gap-2 p-2",
|
|
232
|
-
...
|
|
224
|
+
className: i("flex flex-col gap-2 p-2", a),
|
|
225
|
+
...e
|
|
233
226
|
}
|
|
234
227
|
);
|
|
235
228
|
}
|
|
236
|
-
function
|
|
237
|
-
className: e,
|
|
238
|
-
...a
|
|
239
|
-
}) {
|
|
240
|
-
return /* @__PURE__ */ t(
|
|
241
|
-
B,
|
|
242
|
-
{
|
|
243
|
-
"data-sidebar": "separator",
|
|
244
|
-
className: i("mx-2 w-auto bg-sidebar-border", e),
|
|
245
|
-
...a
|
|
246
|
-
}
|
|
247
|
-
);
|
|
248
|
-
}
|
|
249
|
-
function ce({
|
|
250
|
-
className: e,
|
|
251
|
-
...a
|
|
252
|
-
}) {
|
|
229
|
+
function oe({ className: a, ...e }) {
|
|
253
230
|
return /* @__PURE__ */ t(
|
|
254
231
|
"div",
|
|
255
232
|
{
|
|
256
233
|
"data-sidebar": "content",
|
|
257
234
|
className: i(
|
|
258
235
|
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
259
|
-
|
|
236
|
+
a
|
|
260
237
|
),
|
|
261
|
-
...
|
|
238
|
+
...e
|
|
262
239
|
}
|
|
263
240
|
);
|
|
264
241
|
}
|
|
265
|
-
function
|
|
242
|
+
function se({ className: a, ...e }) {
|
|
266
243
|
return /* @__PURE__ */ t(
|
|
267
244
|
"div",
|
|
268
245
|
{
|
|
269
246
|
"data-sidebar": "group",
|
|
270
|
-
className: i("relative flex w-full min-w-0 flex-col p-2",
|
|
271
|
-
...
|
|
247
|
+
className: i("relative flex w-full min-w-0 flex-col p-2", a),
|
|
248
|
+
...e
|
|
272
249
|
}
|
|
273
250
|
);
|
|
274
251
|
}
|
|
275
|
-
function
|
|
276
|
-
className: e,
|
|
277
|
-
...a
|
|
278
|
-
}) {
|
|
252
|
+
function de({ className: a, asChild: e = !1, ...r }) {
|
|
279
253
|
return /* @__PURE__ */ t(
|
|
280
|
-
"div",
|
|
254
|
+
e ? h : "div",
|
|
281
255
|
{
|
|
282
256
|
"data-sidebar": "group-label",
|
|
283
257
|
className: i(
|
|
284
|
-
"
|
|
258
|
+
"flex h-8 shrink-0 items-center rounded-md px-2 text-xs 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",
|
|
285
259
|
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
286
|
-
|
|
260
|
+
a
|
|
287
261
|
),
|
|
288
|
-
...
|
|
262
|
+
...r
|
|
289
263
|
}
|
|
290
264
|
);
|
|
291
265
|
}
|
|
292
|
-
function
|
|
293
|
-
className: e,
|
|
294
|
-
asChild: a = !1,
|
|
295
|
-
...r
|
|
296
|
-
}) {
|
|
266
|
+
function le({ className: a, asChild: e = !1, ...r }) {
|
|
297
267
|
return /* @__PURE__ */ t(
|
|
298
|
-
|
|
268
|
+
e ? h : "button",
|
|
299
269
|
{
|
|
300
270
|
"data-sidebar": "group-action",
|
|
301
271
|
className: i(
|
|
302
|
-
"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-
|
|
272
|
+
"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
303
273
|
// Increases the hit area of the button on mobile.
|
|
304
|
-
"after:absolute after:-inset-2 md:
|
|
274
|
+
"after:absolute after:-inset-2 after:md:hidden",
|
|
305
275
|
"group-data-[collapsible=icon]:hidden",
|
|
306
|
-
|
|
276
|
+
a
|
|
307
277
|
),
|
|
308
278
|
...r
|
|
309
279
|
}
|
|
310
280
|
);
|
|
311
281
|
}
|
|
312
|
-
function
|
|
313
|
-
className: e,
|
|
314
|
-
...a
|
|
315
|
-
}) {
|
|
282
|
+
function ue({ className: a, ...e }) {
|
|
316
283
|
return /* @__PURE__ */ t(
|
|
317
284
|
"div",
|
|
318
285
|
{
|
|
319
286
|
"data-sidebar": "group-content",
|
|
320
|
-
className: i("w-full
|
|
321
|
-
...
|
|
287
|
+
className: i("w-full text-sm", a),
|
|
288
|
+
...e
|
|
322
289
|
}
|
|
323
290
|
);
|
|
324
291
|
}
|
|
325
|
-
function
|
|
292
|
+
function ce({ className: a, ...e }) {
|
|
326
293
|
return /* @__PURE__ */ t(
|
|
327
294
|
"ul",
|
|
328
295
|
{
|
|
329
296
|
"data-sidebar": "menu",
|
|
330
|
-
className: i("flex w-full min-w-0 flex-col",
|
|
331
|
-
...
|
|
297
|
+
className: i("flex w-full min-w-0 flex-col gap-1", a),
|
|
298
|
+
...e
|
|
332
299
|
}
|
|
333
300
|
);
|
|
334
301
|
}
|
|
335
|
-
function
|
|
336
|
-
className: e,
|
|
337
|
-
...a
|
|
338
|
-
}) {
|
|
302
|
+
function be({ className: a, ...e }) {
|
|
339
303
|
return /* @__PURE__ */ t(
|
|
340
304
|
"li",
|
|
341
305
|
{
|
|
342
306
|
"data-sidebar": "menu-item",
|
|
343
|
-
className: i("group/menu-item relative",
|
|
344
|
-
...
|
|
345
|
-
}
|
|
346
|
-
);
|
|
347
|
-
}
|
|
348
|
-
function he({
|
|
349
|
-
asChild: e = !1,
|
|
350
|
-
isActive: a = !1,
|
|
351
|
-
tooltip: r,
|
|
352
|
-
className: n,
|
|
353
|
-
...o
|
|
354
|
-
}) {
|
|
355
|
-
const l = e ? x : "button", { isMobile: c, state: u } = w(), b = /* @__PURE__ */ t(
|
|
356
|
-
l,
|
|
357
|
-
{
|
|
358
|
-
"data-sidebar": "menu-button",
|
|
359
|
-
"data-active": a,
|
|
360
|
-
className: i("peer/menu-button btn h-input flex w-full items-center gap-2 overflow-hidden p-2 text-left body hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none 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", n),
|
|
361
|
-
...o
|
|
307
|
+
className: i("group/menu-item relative list-none", a),
|
|
308
|
+
...e
|
|
362
309
|
}
|
|
363
310
|
);
|
|
364
|
-
return r ? (typeof r == "string" && (r = {
|
|
365
|
-
children: r
|
|
366
|
-
}), /* @__PURE__ */ p(L, { children: [
|
|
367
|
-
/* @__PURE__ */ t(G, { asChild: !0, children: b }),
|
|
368
|
-
/* @__PURE__ */ t(
|
|
369
|
-
K,
|
|
370
|
-
{
|
|
371
|
-
side: "right",
|
|
372
|
-
align: "center",
|
|
373
|
-
hidden: u !== "collapsed" || c,
|
|
374
|
-
...r
|
|
375
|
-
}
|
|
376
|
-
)
|
|
377
|
-
] })) : b;
|
|
378
311
|
}
|
|
379
|
-
function
|
|
380
|
-
className: e,
|
|
381
|
-
asChild: a = !1,
|
|
382
|
-
showOnHover: r = !1,
|
|
383
|
-
...n
|
|
384
|
-
}) {
|
|
312
|
+
function fe({ className: a, asChild: e = !1, showOnHover: r = !1, ...n }) {
|
|
385
313
|
return /* @__PURE__ */ t(
|
|
386
|
-
|
|
314
|
+
e ? h : "button",
|
|
387
315
|
{
|
|
388
316
|
"data-sidebar": "menu-action",
|
|
389
317
|
className: i(
|
|
390
|
-
"absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-
|
|
318
|
+
"absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0",
|
|
391
319
|
// Increases the hit area of the button on mobile.
|
|
392
|
-
"after:absolute after:-inset-2 md:
|
|
320
|
+
"after:absolute after:-inset-2 after:md:hidden",
|
|
393
321
|
"peer-data-[size=sm]/menu-button:top-1",
|
|
394
322
|
"peer-data-[size=default]/menu-button:top-1.5",
|
|
395
323
|
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
396
324
|
"group-data-[collapsible=icon]:hidden",
|
|
397
325
|
r && "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",
|
|
398
|
-
|
|
326
|
+
a
|
|
399
327
|
),
|
|
400
328
|
...n
|
|
401
329
|
}
|
|
402
330
|
);
|
|
403
331
|
}
|
|
404
|
-
function
|
|
405
|
-
className: e,
|
|
406
|
-
...a
|
|
407
|
-
}) {
|
|
332
|
+
function pe({ className: a, ...e }) {
|
|
408
333
|
return /* @__PURE__ */ t(
|
|
409
334
|
"div",
|
|
410
335
|
{
|
|
411
336
|
"data-sidebar": "menu-badge",
|
|
412
337
|
className: i(
|
|
413
|
-
"absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-
|
|
338
|
+
"pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground",
|
|
414
339
|
"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
|
|
415
340
|
"peer-data-[size=sm]/menu-button:top-1",
|
|
416
341
|
"peer-data-[size=default]/menu-button:top-1.5",
|
|
417
342
|
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
418
343
|
"group-data-[collapsible=icon]:hidden",
|
|
419
|
-
|
|
344
|
+
a
|
|
420
345
|
),
|
|
421
|
-
...
|
|
346
|
+
...e
|
|
422
347
|
}
|
|
423
348
|
);
|
|
424
349
|
}
|
|
425
|
-
function
|
|
426
|
-
|
|
427
|
-
showIcon: a = !1,
|
|
428
|
-
...r
|
|
429
|
-
}) {
|
|
430
|
-
const n = s.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);
|
|
350
|
+
function me({ className: a, showIcon: e = !1, ...r }) {
|
|
351
|
+
const n = d.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);
|
|
431
352
|
return /* @__PURE__ */ p(
|
|
432
353
|
"div",
|
|
433
354
|
{
|
|
434
355
|
"data-sidebar": "menu-skeleton",
|
|
435
|
-
className: i("
|
|
356
|
+
className: i("flex h-8 items-center gap-2 rounded-md px-2", a),
|
|
436
357
|
...r,
|
|
437
358
|
children: [
|
|
438
|
-
|
|
359
|
+
e && /* @__PURE__ */ t(
|
|
439
360
|
N,
|
|
440
361
|
{
|
|
441
362
|
className: "size-4 rounded-md",
|
|
@@ -445,7 +366,7 @@ function we({
|
|
|
445
366
|
/* @__PURE__ */ t(
|
|
446
367
|
N,
|
|
447
368
|
{
|
|
448
|
-
className: "h-4
|
|
369
|
+
className: "h-4 max-w-[--skeleton-width] flex-1",
|
|
449
370
|
"data-sidebar": "menu-skeleton-text",
|
|
450
371
|
style: {
|
|
451
372
|
"--skeleton-width": n
|
|
@@ -456,74 +377,96 @@ function we({
|
|
|
456
377
|
}
|
|
457
378
|
);
|
|
458
379
|
}
|
|
459
|
-
function
|
|
460
|
-
className: e,
|
|
461
|
-
...a
|
|
462
|
-
}) {
|
|
380
|
+
function ge({ className: a, ...e }) {
|
|
463
381
|
return /* @__PURE__ */ t(
|
|
464
382
|
"ul",
|
|
465
383
|
{
|
|
466
384
|
"data-sidebar": "menu-sub",
|
|
467
385
|
className: i(
|
|
468
|
-
"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1
|
|
386
|
+
"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5",
|
|
469
387
|
"group-data-[collapsible=icon]:hidden",
|
|
470
|
-
|
|
388
|
+
a
|
|
471
389
|
),
|
|
472
|
-
...
|
|
390
|
+
...e
|
|
473
391
|
}
|
|
474
392
|
);
|
|
475
393
|
}
|
|
476
|
-
function
|
|
477
|
-
return /* @__PURE__ */ t("li", { ...e });
|
|
394
|
+
function he({ className: a, ...e }) {
|
|
395
|
+
return /* @__PURE__ */ t("li", { className: i("list-none", a), ...e });
|
|
478
396
|
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
isActive:
|
|
397
|
+
const C = "flex w-full items-center gap-2 truncate p-2 text-sm btn btn-ghost h-input text-sidebar-accent data-[active=true]:bg-sidebar-primary/20 data-[active=true]:font-medium data-[active=true]:text-sidebar-primary [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0";
|
|
398
|
+
function xe({
|
|
399
|
+
asChild: a = !1,
|
|
400
|
+
isActive: e = !1,
|
|
401
|
+
tooltip: r,
|
|
483
402
|
className: n,
|
|
484
403
|
...o
|
|
485
404
|
}) {
|
|
405
|
+
const u = a ? h : "button", { isMobile: m, state: l } = w(), c = /* @__PURE__ */ t(
|
|
406
|
+
u,
|
|
407
|
+
{
|
|
408
|
+
"data-sidebar": "menu-button",
|
|
409
|
+
"data-active": e,
|
|
410
|
+
className: i(
|
|
411
|
+
"peer/menu-button group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 group-data-[collapsible=icon]:!size-icon group-data-[collapsible=icon]:!p-2 ",
|
|
412
|
+
C,
|
|
413
|
+
n
|
|
414
|
+
),
|
|
415
|
+
...o
|
|
416
|
+
}
|
|
417
|
+
);
|
|
418
|
+
return r ? /* @__PURE__ */ p(A, { children: [
|
|
419
|
+
/* @__PURE__ */ t(H, { asChild: !0, children: c }),
|
|
420
|
+
/* @__PURE__ */ t(
|
|
421
|
+
j,
|
|
422
|
+
{
|
|
423
|
+
side: "right",
|
|
424
|
+
align: "center",
|
|
425
|
+
hidden: l !== "collapsed" || m,
|
|
426
|
+
...r
|
|
427
|
+
}
|
|
428
|
+
)
|
|
429
|
+
] }) : c;
|
|
430
|
+
}
|
|
431
|
+
function ve({ asChild: a = !1, isActive: e, className: r, ...n }) {
|
|
486
432
|
return /* @__PURE__ */ t(
|
|
487
|
-
|
|
433
|
+
a ? h : "a",
|
|
488
434
|
{
|
|
489
435
|
"data-sidebar": "menu-sub-button",
|
|
490
|
-
"data-
|
|
491
|
-
"data-active": r,
|
|
436
|
+
"data-active": e,
|
|
492
437
|
className: i(
|
|
493
|
-
"
|
|
494
|
-
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
|
|
495
|
-
a === "sm" && "text-caption",
|
|
496
|
-
a === "md" && "body",
|
|
438
|
+
"-translate-x-px [&>svg]:text-sidebar-accent-foreground",
|
|
497
439
|
"group-data-[collapsible=icon]:hidden",
|
|
498
|
-
|
|
440
|
+
C,
|
|
441
|
+
r
|
|
499
442
|
),
|
|
500
|
-
...
|
|
443
|
+
...n
|
|
501
444
|
}
|
|
502
445
|
);
|
|
503
446
|
}
|
|
504
447
|
export {
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
de as
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
448
|
+
ae as Sidebar,
|
|
449
|
+
oe as SidebarContent,
|
|
450
|
+
y as SidebarContext,
|
|
451
|
+
ne as SidebarFooter,
|
|
452
|
+
se as SidebarGroup,
|
|
453
|
+
le as SidebarGroupAction,
|
|
454
|
+
ue as SidebarGroupContent,
|
|
455
|
+
de as SidebarGroupLabel,
|
|
456
|
+
ie as SidebarHeader,
|
|
457
|
+
re as SidebarInset,
|
|
458
|
+
ce as SidebarMenu,
|
|
459
|
+
fe as SidebarMenuAction,
|
|
460
|
+
pe as SidebarMenuBadge,
|
|
461
|
+
xe as SidebarMenuButton,
|
|
462
|
+
be as SidebarMenuItem,
|
|
463
|
+
me as SidebarMenuSkeleton,
|
|
464
|
+
ge as SidebarMenuSub,
|
|
465
|
+
ve as SidebarMenuSubButton,
|
|
466
|
+
he as SidebarMenuSubItem,
|
|
467
|
+
ee as SidebarProvider,
|
|
468
|
+
q as SidebarRail,
|
|
469
|
+
te as SidebarTrigger,
|
|
527
470
|
w as useSidebar
|
|
528
471
|
};
|
|
529
472
|
//# sourceMappingURL=sidebar.es.js.map
|