@cryptlex/web-components 3.1.2 → 3.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/dist/components/ui/sidebar.es.js +196 -253
- package/dist/components/ui/sidebar.es.js.map +1 -1
- package/dist/index.es.d.ts +33 -29
- 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/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 {
|
|
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 z } from "lucide-react";
|
|
4
5
|
import * as s from "react";
|
|
5
|
-
import { Button as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { useIsMobile as O } from "../../hooks/use-mobile.es.js";
|
|
6
|
+
import { Button as k } from "./button.es.js";
|
|
7
|
+
import { Sheet as T, SheetContent as I, SheetHeader as D, SheetTitle as R, SheetDescription as B } from "./sheet.es.js";
|
|
8
|
+
import { Skeleton as y } from "./skeleton.es.js";
|
|
9
|
+
import { TooltipProvider as E, Tooltip as O, TooltipTrigger as A, TooltipContent as H } from "./tooltip.es.js";
|
|
10
|
+
import { useIsMobile as j } from "../../hooks/use-mobile.es.js";
|
|
11
11
|
import { cn as i } from "../../utils/index.es.js";
|
|
12
|
-
const
|
|
12
|
+
const L = "16rem", G = "18rem", K = "3rem", P = "b", N = s.createContext(null);
|
|
13
13
|
function w() {
|
|
14
|
-
const
|
|
15
|
-
if (!
|
|
14
|
+
const a = s.useContext(N);
|
|
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 Z({
|
|
20
|
+
defaultOpen: a = !0,
|
|
21
|
+
open: e,
|
|
22
22
|
onOpenChange: r,
|
|
23
23
|
className: n,
|
|
24
24
|
style: o,
|
|
25
|
-
children:
|
|
26
|
-
...
|
|
25
|
+
children: c,
|
|
26
|
+
...m
|
|
27
27
|
}) {
|
|
28
|
-
const
|
|
28
|
+
const l = j(), [u, f] = s.useState(!1), [M, C] = s.useState(a), g = e ?? M, v = s.useCallback(
|
|
29
29
|
(d) => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
C(d);
|
|
30
|
+
const b = typeof d == "function" ? d(g) : d;
|
|
31
|
+
r ? r(b) : C(b);
|
|
33
32
|
},
|
|
34
|
-
[r,
|
|
35
|
-
),
|
|
33
|
+
[r, g]
|
|
34
|
+
), x = s.useCallback(() => l ? f((d) => !d) : v((d) => !d), [l, v, f]);
|
|
36
35
|
s.useEffect(() => {
|
|
37
|
-
const d = (
|
|
38
|
-
|
|
36
|
+
const d = (b) => {
|
|
37
|
+
b.key === P && (b.metaKey || b.ctrlKey) && (b.preventDefault(), x());
|
|
39
38
|
};
|
|
40
39
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
41
|
-
}, [
|
|
42
|
-
const S =
|
|
40
|
+
}, [x]);
|
|
41
|
+
const S = g ? "expanded" : "collapsed", _ = s.useMemo(
|
|
43
42
|
() => ({
|
|
44
43
|
state: S,
|
|
45
|
-
open:
|
|
46
|
-
setOpen:
|
|
47
|
-
isMobile:
|
|
48
|
-
openMobile:
|
|
49
|
-
setOpenMobile:
|
|
50
|
-
toggleSidebar:
|
|
44
|
+
open: g,
|
|
45
|
+
setOpen: v,
|
|
46
|
+
isMobile: l,
|
|
47
|
+
openMobile: u,
|
|
48
|
+
setOpenMobile: f,
|
|
49
|
+
toggleSidebar: x
|
|
51
50
|
}),
|
|
52
|
-
[S,
|
|
51
|
+
[S, g, v, l, u, f, x]
|
|
53
52
|
);
|
|
54
|
-
return /* @__PURE__ */ t(
|
|
53
|
+
return /* @__PURE__ */ t(N.Provider, { value: _, children: /* @__PURE__ */ t(E, { delayDuration: 0, children: /* @__PURE__ */ t(
|
|
55
54
|
"div",
|
|
56
55
|
{
|
|
57
56
|
style: {
|
|
58
|
-
"--sidebar-width":
|
|
59
|
-
"--sidebar-width-icon":
|
|
57
|
+
"--sidebar-width": L,
|
|
58
|
+
"--sidebar-width-icon": K,
|
|
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: c
|
|
68
67
|
}
|
|
69
68
|
) }) });
|
|
70
69
|
}
|
|
71
|
-
function
|
|
70
|
+
function ee({
|
|
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
|
+
...c
|
|
77
77
|
}) {
|
|
78
|
-
const { isMobile:
|
|
79
|
-
return
|
|
78
|
+
const { isMobile: m, state: l, openMobile: u, 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
|
+
...c,
|
|
87
|
+
children: o
|
|
88
88
|
}
|
|
89
|
-
) :
|
|
90
|
-
|
|
89
|
+
) : m ? /* @__PURE__ */ t(T, { open: u, onOpenChange: f, ...c, children: /* @__PURE__ */ p(
|
|
90
|
+
I,
|
|
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": G
|
|
97
97
|
},
|
|
98
|
+
side: a,
|
|
98
99
|
children: [
|
|
99
|
-
/* @__PURE__ */ p(
|
|
100
|
-
/* @__PURE__ */ t(
|
|
101
|
-
/* @__PURE__ */ t(
|
|
100
|
+
/* @__PURE__ */ p(D, { className: "sr-only", children: [
|
|
101
|
+
/* @__PURE__ */ t(R, { children: "Sidebar" }),
|
|
102
|
+
/* @__PURE__ */ t(B, { 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
|
+
...c,
|
|
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,306 +149,255 @@ 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 ae({ className: a, onClick: e, ...r }) {
|
|
153
|
+
const { toggleSidebar: n } = w();
|
|
154
|
+
return /* @__PURE__ */ p(
|
|
155
|
+
k,
|
|
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(z, {}),
|
|
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 W = s.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
|
+
W.displayName = "SidebarRail";
|
|
196
|
+
function te({ 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 re({ 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 ie({ 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
|
-
...
|
|
233
|
-
}
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
function le({
|
|
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
|
|
224
|
+
className: i("flex flex-col gap-2 p-2", a),
|
|
225
|
+
...e
|
|
246
226
|
}
|
|
247
227
|
);
|
|
248
228
|
}
|
|
249
|
-
function
|
|
250
|
-
className: e,
|
|
251
|
-
...a
|
|
252
|
-
}) {
|
|
229
|
+
function ne({ 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 oe({ 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 se({ 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 le({ 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 ue({ 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
|
-
...
|
|
307
|
+
className: i("group/menu-item relative", a),
|
|
308
|
+
...e
|
|
345
309
|
}
|
|
346
310
|
);
|
|
347
311
|
}
|
|
348
|
-
function
|
|
349
|
-
asChild:
|
|
350
|
-
isActive:
|
|
312
|
+
function be({
|
|
313
|
+
asChild: a = !1,
|
|
314
|
+
isActive: e = !1,
|
|
351
315
|
tooltip: r,
|
|
352
316
|
className: n,
|
|
353
317
|
...o
|
|
354
318
|
}) {
|
|
355
|
-
const
|
|
356
|
-
|
|
319
|
+
const c = a ? h : "button", { isMobile: m, state: l } = w(), u = /* @__PURE__ */ t(
|
|
320
|
+
c,
|
|
357
321
|
{
|
|
358
322
|
"data-sidebar": "menu-button",
|
|
359
|
-
"data-active":
|
|
360
|
-
className: i("peer/menu-button btn h-input flex w-full items-center gap-2 overflow-hidden p-2 text-
|
|
323
|
+
"data-active": e,
|
|
324
|
+
className: i("peer/menu-button btn h-input flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-sm hover:bg-sidebar-primary/20 hover:text-sidebar-primary group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 data-[active=true]:bg-sidebar-primary/20 data-[active=true]:font-medium data-[active=true]:text-sidebar-primary group-data-[collapsible=icon]:!size-icon group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0", n),
|
|
361
325
|
...o
|
|
362
326
|
}
|
|
363
327
|
);
|
|
364
328
|
return r ? (typeof r == "string" && (r = {
|
|
365
329
|
children: r
|
|
366
|
-
}), /* @__PURE__ */ p(
|
|
367
|
-
/* @__PURE__ */ t(
|
|
330
|
+
}), /* @__PURE__ */ p(O, { children: [
|
|
331
|
+
/* @__PURE__ */ t(A, { asChild: !0, children: u }),
|
|
368
332
|
/* @__PURE__ */ t(
|
|
369
|
-
|
|
333
|
+
H,
|
|
370
334
|
{
|
|
371
335
|
side: "right",
|
|
372
336
|
align: "center",
|
|
373
|
-
hidden:
|
|
337
|
+
hidden: l !== "collapsed" || m,
|
|
374
338
|
...r
|
|
375
339
|
}
|
|
376
340
|
)
|
|
377
|
-
] })) :
|
|
341
|
+
] })) : u;
|
|
378
342
|
}
|
|
379
|
-
function
|
|
380
|
-
className: e,
|
|
381
|
-
asChild: a = !1,
|
|
382
|
-
showOnHover: r = !1,
|
|
383
|
-
...n
|
|
384
|
-
}) {
|
|
343
|
+
function fe({ className: a, asChild: e = !1, showOnHover: r = !1, ...n }) {
|
|
385
344
|
return /* @__PURE__ */ t(
|
|
386
|
-
|
|
345
|
+
e ? h : "button",
|
|
387
346
|
{
|
|
388
347
|
"data-sidebar": "menu-action",
|
|
389
348
|
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-
|
|
349
|
+
"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
350
|
// Increases the hit area of the button on mobile.
|
|
392
|
-
"after:absolute after:-inset-2 md:
|
|
351
|
+
"after:absolute after:-inset-2 after:md:hidden",
|
|
393
352
|
"peer-data-[size=sm]/menu-button:top-1",
|
|
394
353
|
"peer-data-[size=default]/menu-button:top-1.5",
|
|
395
354
|
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
396
355
|
"group-data-[collapsible=icon]:hidden",
|
|
397
356
|
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
|
-
|
|
357
|
+
a
|
|
399
358
|
),
|
|
400
359
|
...n
|
|
401
360
|
}
|
|
402
361
|
);
|
|
403
362
|
}
|
|
404
|
-
function
|
|
405
|
-
className: e,
|
|
406
|
-
...a
|
|
407
|
-
}) {
|
|
363
|
+
function pe({ className: a, ...e }) {
|
|
408
364
|
return /* @__PURE__ */ t(
|
|
409
365
|
"div",
|
|
410
366
|
{
|
|
411
367
|
"data-sidebar": "menu-badge",
|
|
412
368
|
className: i(
|
|
413
|
-
"absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-
|
|
369
|
+
"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
370
|
"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
|
|
415
371
|
"peer-data-[size=sm]/menu-button:top-1",
|
|
416
372
|
"peer-data-[size=default]/menu-button:top-1.5",
|
|
417
373
|
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
418
374
|
"group-data-[collapsible=icon]:hidden",
|
|
419
|
-
|
|
375
|
+
a
|
|
420
376
|
),
|
|
421
|
-
...
|
|
377
|
+
...e
|
|
422
378
|
}
|
|
423
379
|
);
|
|
424
380
|
}
|
|
425
|
-
function
|
|
426
|
-
className: e,
|
|
427
|
-
showIcon: a = !1,
|
|
428
|
-
...r
|
|
429
|
-
}) {
|
|
381
|
+
function me({ className: a, showIcon: e = !1, ...r }) {
|
|
430
382
|
const n = s.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);
|
|
431
383
|
return /* @__PURE__ */ p(
|
|
432
384
|
"div",
|
|
433
385
|
{
|
|
434
386
|
"data-sidebar": "menu-skeleton",
|
|
435
|
-
className: i("
|
|
387
|
+
className: i("flex h-8 items-center gap-2 rounded-md px-2", a),
|
|
436
388
|
...r,
|
|
437
389
|
children: [
|
|
438
|
-
|
|
439
|
-
|
|
390
|
+
e && /* @__PURE__ */ t(
|
|
391
|
+
y,
|
|
440
392
|
{
|
|
441
393
|
className: "size-4 rounded-md",
|
|
442
394
|
"data-sidebar": "menu-skeleton-icon"
|
|
443
395
|
}
|
|
444
396
|
),
|
|
445
397
|
/* @__PURE__ */ t(
|
|
446
|
-
|
|
398
|
+
y,
|
|
447
399
|
{
|
|
448
|
-
className: "h-4
|
|
400
|
+
className: "h-4 max-w-[--skeleton-width] flex-1",
|
|
449
401
|
"data-sidebar": "menu-skeleton-text",
|
|
450
402
|
style: {
|
|
451
403
|
"--skeleton-width": n
|
|
@@ -456,44 +408,35 @@ function we({
|
|
|
456
408
|
}
|
|
457
409
|
);
|
|
458
410
|
}
|
|
459
|
-
function
|
|
460
|
-
className: e,
|
|
461
|
-
...a
|
|
462
|
-
}) {
|
|
411
|
+
function ge({ className: a, ...e }) {
|
|
463
412
|
return /* @__PURE__ */ t(
|
|
464
413
|
"ul",
|
|
465
414
|
{
|
|
466
415
|
"data-sidebar": "menu-sub",
|
|
467
416
|
className: i(
|
|
468
|
-
"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1
|
|
417
|
+
"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
418
|
"group-data-[collapsible=icon]:hidden",
|
|
470
|
-
|
|
419
|
+
a
|
|
471
420
|
),
|
|
472
|
-
...
|
|
421
|
+
...e
|
|
473
422
|
}
|
|
474
423
|
);
|
|
475
424
|
}
|
|
476
|
-
function
|
|
477
|
-
return /* @__PURE__ */ t("li", { ...
|
|
425
|
+
function he({ ...a }) {
|
|
426
|
+
return /* @__PURE__ */ t("li", { ...a });
|
|
478
427
|
}
|
|
479
|
-
function
|
|
480
|
-
asChild: e = !1,
|
|
481
|
-
size: a = "md",
|
|
482
|
-
isActive: r,
|
|
483
|
-
className: n,
|
|
484
|
-
...o
|
|
485
|
-
}) {
|
|
428
|
+
function ve({ asChild: a = !1, size: e = "md", isActive: r, className: n, ...o }) {
|
|
486
429
|
return /* @__PURE__ */ t(
|
|
487
|
-
|
|
430
|
+
a ? h : "a",
|
|
488
431
|
{
|
|
489
432
|
"data-sidebar": "menu-sub-button",
|
|
490
|
-
"data-size":
|
|
433
|
+
"data-size": e,
|
|
491
434
|
"data-active": r,
|
|
492
435
|
className: i(
|
|
493
|
-
"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-
|
|
436
|
+
"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring 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 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",
|
|
494
437
|
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
|
|
495
|
-
|
|
496
|
-
|
|
438
|
+
e === "sm" && "text-xs",
|
|
439
|
+
e === "md" && "text-sm",
|
|
497
440
|
"group-data-[collapsible=icon]:hidden",
|
|
498
441
|
n
|
|
499
442
|
),
|
|
@@ -502,28 +445,28 @@ function ye({
|
|
|
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
|
+
ee as Sidebar,
|
|
449
|
+
ne as SidebarContent,
|
|
450
|
+
N as SidebarContext,
|
|
451
|
+
ie as SidebarFooter,
|
|
452
|
+
oe as SidebarGroup,
|
|
453
|
+
se as SidebarGroupAction,
|
|
454
|
+
le as SidebarGroupContent,
|
|
455
|
+
de as SidebarGroupLabel,
|
|
456
|
+
re as SidebarHeader,
|
|
457
|
+
te as SidebarInset,
|
|
458
|
+
ce as SidebarMenu,
|
|
459
|
+
fe as SidebarMenuAction,
|
|
460
|
+
pe as SidebarMenuBadge,
|
|
461
|
+
be as SidebarMenuButton,
|
|
462
|
+
ue as SidebarMenuItem,
|
|
463
|
+
me as SidebarMenuSkeleton,
|
|
464
|
+
ge as SidebarMenuSub,
|
|
465
|
+
ve as SidebarMenuSubButton,
|
|
466
|
+
he as SidebarMenuSubItem,
|
|
467
|
+
Z as SidebarProvider,
|
|
468
|
+
W as SidebarRail,
|
|
469
|
+
ae as SidebarTrigger,
|
|
527
470
|
w as useSidebar
|
|
528
471
|
};
|
|
529
472
|
//# sourceMappingURL=sidebar.es.js.map
|