@cryptlex/web-components 1.3.5 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/components/data-table/data-table.es.js +102 -88
- package/dist/components/data-table/data-table.es.js.map +1 -1
- package/dist/components/data-table/table-actions.es.js.map +1 -1
- package/dist/components/data-table/table-content.es.js +19 -18
- package/dist/components/data-table/table-content.es.js.map +1 -1
- package/dist/components/data-table/table-filter.es.js +264 -0
- package/dist/components/data-table/table-filter.es.js.map +1 -0
- package/dist/components/data-table/table-utils/constants.es.js +20 -6
- package/dist/components/data-table/table-utils/constants.es.js.map +1 -1
- package/dist/components/data-table/table-utils/link-display.es.js +4 -4
- package/dist/components/data-table/table-utils/link-display.es.js.map +1 -1
- package/dist/components/key-value-card/key-value-card.es.js +4 -2
- package/dist/components/key-value-card/key-value-card.es.js.map +1 -1
- package/dist/components/sidebar/app-layout.es.js +43 -39
- package/dist/components/sidebar/app-layout.es.js.map +1 -1
- package/dist/components/sidebar/breadcrumb.es.js +58 -0
- package/dist/components/sidebar/breadcrumb.es.js.map +1 -0
- package/dist/components/sidebar/nav-main.es.js +51 -39
- package/dist/components/sidebar/nav-main.es.js.map +1 -1
- package/dist/components/static-data-table/data-table.es.js +5 -5
- package/dist/components/static-data-table/data-table.es.js.map +1 -1
- package/dist/components/ui/avatar.es.js +1 -1
- package/dist/components/ui/avatar.es.js.map +1 -1
- package/dist/components/ui/badge.es.js +1 -1
- package/dist/components/ui/badge.es.js.map +1 -1
- package/dist/components/ui/button.es.js +8 -8
- package/dist/components/ui/button.es.js.map +1 -1
- package/dist/components/ui/calendar.es.js +3 -3
- package/dist/components/ui/chart.es.js +24 -24
- package/dist/components/ui/chart.es.js.map +1 -1
- package/dist/components/ui/checkbox.es.js +1 -1
- package/dist/components/ui/checkbox.es.js.map +1 -1
- package/dist/components/ui/command.es.js +28 -28
- package/dist/components/ui/command.es.js.map +1 -1
- package/dist/components/ui/copy-button.es.js +38 -34
- package/dist/components/ui/copy-button.es.js.map +1 -1
- package/dist/components/ui/dialog.es.js +8 -8
- package/dist/components/ui/dialog.es.js.map +1 -1
- package/dist/components/ui/dropdown-menu.es.js +38 -38
- package/dist/components/ui/dropdown-menu.es.js.map +1 -1
- package/dist/components/ui/form.es.js +4 -4
- package/dist/components/ui/input-otp.es.js +2 -2
- package/dist/components/ui/input-otp.es.js.map +1 -1
- package/dist/components/ui/input.es.js +7 -7
- package/dist/components/ui/input.es.js.map +1 -1
- package/dist/components/ui/mutli-select.es.js +13 -13
- package/dist/components/ui/mutli-select.es.js.map +1 -1
- package/dist/components/ui/navigation-menu.es.js +3 -3
- package/dist/components/ui/navigation-menu.es.js.map +1 -1
- package/dist/components/ui/pagination.es.js +20 -20
- package/dist/components/ui/password-input.es.js +10 -10
- package/dist/components/ui/password-input.es.js.map +1 -1
- package/dist/components/ui/popover.es.js +1 -1
- package/dist/components/ui/popover.es.js.map +1 -1
- package/dist/components/ui/radio-group.es.js +7 -7
- package/dist/components/ui/radio-group.es.js.map +1 -1
- package/dist/components/ui/select.es.js +17 -17
- package/dist/components/ui/select.es.js.map +1 -1
- package/dist/components/ui/sheet.es.js +8 -8
- package/dist/components/ui/sheet.es.js.map +1 -1
- package/dist/components/ui/sidebar.es.js +76 -76
- package/dist/components/ui/sidebar.es.js.map +1 -1
- package/dist/components/ui/table-page-layout.es.js +8 -8
- package/dist/components/ui/table-page-layout.es.js.map +1 -1
- package/dist/components/ui/table.es.js +1 -1
- package/dist/components/ui/table.es.js.map +1 -1
- package/dist/components/ui/tabs.es.js +11 -11
- package/dist/components/ui/tabs.es.js.map +1 -1
- package/dist/index.es.d.ts +12 -7
- package/dist/index.es.js +59 -58
- package/lib/index.css +15 -87
- package/lib/tailwind.preset.css +220 -0
- package/lib/tokens.css +54 -54
- package/package.json +7 -7
- package/tailwind.preset.ts +0 -191
|
@@ -10,7 +10,7 @@ import { Sheet as D, SheetContent as G, SheetHeader as O, SheetTitle as H, Sheet
|
|
|
10
10
|
import { Skeleton as M } from "./skeleton.es.js";
|
|
11
11
|
import { TooltipProvider as L, Tooltip as j, TooltipTrigger as $, TooltipContent as V } from "./tooltip.es.js";
|
|
12
12
|
import { useIsMobile as W } from "../../hooks/use-mobile.es.js";
|
|
13
|
-
import { cn as
|
|
13
|
+
import { cn as d } from "../../utils/index.es.js";
|
|
14
14
|
const q = "sidebar:state", F = 60 * 60 * 24 * 7, U = "16rem", X = "18rem", Y = "3rem", J = "b", R = i.createContext(null);
|
|
15
15
|
function y() {
|
|
16
16
|
const a = i.useContext(R);
|
|
@@ -23,16 +23,16 @@ const Q = i.forwardRef(
|
|
|
23
23
|
defaultOpen: a = !0,
|
|
24
24
|
open: e,
|
|
25
25
|
onOpenChange: t,
|
|
26
|
-
className:
|
|
26
|
+
className: o,
|
|
27
27
|
style: n,
|
|
28
28
|
children: s,
|
|
29
29
|
...c
|
|
30
30
|
}, f) => {
|
|
31
|
-
const u = W(), [p, b] = i.useState(!1), [v,
|
|
31
|
+
const u = W(), [p, b] = i.useState(!1), [v, C] = i.useState(a), m = e ?? v, x = i.useCallback(
|
|
32
32
|
(l) => {
|
|
33
33
|
if (t)
|
|
34
34
|
return t == null ? void 0 : t(typeof l == "function" ? l(m) : l);
|
|
35
|
-
|
|
35
|
+
C(l), document.cookie = `${q}=${m}; path=/; max-age=${F}`;
|
|
36
36
|
},
|
|
37
37
|
[t, m]
|
|
38
38
|
), w = i.useCallback(() => u ? b((l) => !l) : x((l) => !l), [u, x, b]);
|
|
@@ -42,7 +42,7 @@ const Q = i.forwardRef(
|
|
|
42
42
|
};
|
|
43
43
|
return window.addEventListener("keydown", l), () => window.removeEventListener("keydown", l);
|
|
44
44
|
}, [w]);
|
|
45
|
-
const N = m ? "expanded" : "collapsed",
|
|
45
|
+
const N = m ? "expanded" : "collapsed", _ = i.useMemo(
|
|
46
46
|
() => ({
|
|
47
47
|
state: N,
|
|
48
48
|
open: m,
|
|
@@ -54,7 +54,7 @@ const Q = i.forwardRef(
|
|
|
54
54
|
}),
|
|
55
55
|
[N, m, x, u, p, b, w]
|
|
56
56
|
);
|
|
57
|
-
return /* @__PURE__ */ r(R.Provider, { value:
|
|
57
|
+
return /* @__PURE__ */ r(R.Provider, { value: _, children: /* @__PURE__ */ r(L, { delayDuration: 0, children: /* @__PURE__ */ r(
|
|
58
58
|
"div",
|
|
59
59
|
{
|
|
60
60
|
style: {
|
|
@@ -62,9 +62,9 @@ const Q = i.forwardRef(
|
|
|
62
62
|
"--sidebar-width-icon": Y,
|
|
63
63
|
...n
|
|
64
64
|
},
|
|
65
|
-
className:
|
|
66
|
-
"group/sidebar-wrapper flex min-h-svh w-full has-
|
|
67
|
-
|
|
65
|
+
className: d(
|
|
66
|
+
"group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",
|
|
67
|
+
o
|
|
68
68
|
),
|
|
69
69
|
ref: f,
|
|
70
70
|
...c,
|
|
@@ -79,7 +79,7 @@ const Z = i.forwardRef(
|
|
|
79
79
|
side: a = "left",
|
|
80
80
|
variant: e = "sidebar",
|
|
81
81
|
collapsible: t = "offcanvas",
|
|
82
|
-
className:
|
|
82
|
+
className: o,
|
|
83
83
|
children: n,
|
|
84
84
|
...s
|
|
85
85
|
}, c) => {
|
|
@@ -87,9 +87,9 @@ const Z = i.forwardRef(
|
|
|
87
87
|
return t === "none" ? /* @__PURE__ */ r(
|
|
88
88
|
"div",
|
|
89
89
|
{
|
|
90
|
-
className:
|
|
91
|
-
"flex h-full w-
|
|
92
|
-
|
|
90
|
+
className: d(
|
|
91
|
+
"flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",
|
|
92
|
+
o
|
|
93
93
|
),
|
|
94
94
|
ref: c,
|
|
95
95
|
...s,
|
|
@@ -100,7 +100,7 @@ const Z = i.forwardRef(
|
|
|
100
100
|
{
|
|
101
101
|
"data-sidebar": "sidebar",
|
|
102
102
|
"data-mobile": "true",
|
|
103
|
-
className: "w-
|
|
103
|
+
className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
|
|
104
104
|
style: {
|
|
105
105
|
"--sidebar-width": X
|
|
106
106
|
},
|
|
@@ -126,30 +126,30 @@ const Z = i.forwardRef(
|
|
|
126
126
|
/* @__PURE__ */ r(
|
|
127
127
|
"div",
|
|
128
128
|
{
|
|
129
|
-
className:
|
|
130
|
-
"duration-200 relative h-svh w-
|
|
129
|
+
className: d(
|
|
130
|
+
"duration-200 relative h-svh w-(--sidebar-width) bg-transparent transition-[width] ease-linear",
|
|
131
131
|
"group-data-[collapsible=offcanvas]:w-0",
|
|
132
132
|
"group-data-[side=right]:rotate-180",
|
|
133
|
-
e === "floating" || e === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)
|
|
133
|
+
e === "floating" || e === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
|
|
134
134
|
)
|
|
135
135
|
}
|
|
136
136
|
),
|
|
137
137
|
/* @__PURE__ */ r(
|
|
138
138
|
"div",
|
|
139
139
|
{
|
|
140
|
-
className:
|
|
141
|
-
"duration-200 fixed inset-y-0 z-10 hidden h-svh w-
|
|
140
|
+
className: d(
|
|
141
|
+
"duration-200 fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] ease-linear md:flex",
|
|
142
142
|
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)]",
|
|
143
143
|
// Adjust the padding for floating and inset variants.
|
|
144
|
-
e === "floating" || e === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)
|
|
145
|
-
|
|
144
|
+
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",
|
|
145
|
+
o
|
|
146
146
|
),
|
|
147
147
|
...s,
|
|
148
148
|
children: /* @__PURE__ */ r(
|
|
149
149
|
"div",
|
|
150
150
|
{
|
|
151
151
|
"data-sidebar": "sidebar",
|
|
152
|
-
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",
|
|
152
|
+
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-sm",
|
|
153
153
|
children: n
|
|
154
154
|
}
|
|
155
155
|
)
|
|
@@ -161,16 +161,16 @@ const Z = i.forwardRef(
|
|
|
161
161
|
}
|
|
162
162
|
);
|
|
163
163
|
Z.displayName = "Sidebar";
|
|
164
|
-
const P = i.forwardRef(({ className: a, onClick: e, ...t },
|
|
164
|
+
const P = i.forwardRef(({ className: a, onClick: e, ...t }, o) => {
|
|
165
165
|
const { toggleSidebar: n, open: s, isMobile: c } = y();
|
|
166
166
|
return /* @__PURE__ */ g(
|
|
167
167
|
E,
|
|
168
168
|
{
|
|
169
|
-
ref:
|
|
169
|
+
ref: o,
|
|
170
170
|
"data-sidebar": "trigger",
|
|
171
171
|
variant: "ghost",
|
|
172
172
|
size: "icon",
|
|
173
|
-
className:
|
|
173
|
+
className: d("h-7 w-7", a),
|
|
174
174
|
onClick: (f) => {
|
|
175
175
|
e == null || e(f), n();
|
|
176
176
|
},
|
|
@@ -185,7 +185,7 @@ const P = i.forwardRef(({ className: a, onClick: e, ...t }, d) => {
|
|
|
185
185
|
P.displayName = "SidebarTrigger";
|
|
186
186
|
const ee = i.forwardRef(
|
|
187
187
|
({ className: a, ...e }, t) => {
|
|
188
|
-
const { toggleSidebar:
|
|
188
|
+
const { toggleSidebar: o } = y();
|
|
189
189
|
return /* @__PURE__ */ r(
|
|
190
190
|
"button",
|
|
191
191
|
{
|
|
@@ -193,13 +193,13 @@ const ee = i.forwardRef(
|
|
|
193
193
|
"data-sidebar": "rail",
|
|
194
194
|
"aria-label": "Toggle Sidebar",
|
|
195
195
|
tabIndex: -1,
|
|
196
|
-
onClick:
|
|
196
|
+
onClick: o,
|
|
197
197
|
title: "Toggle Sidebar",
|
|
198
|
-
className:
|
|
198
|
+
className: d(
|
|
199
199
|
"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",
|
|
200
|
-
"
|
|
200
|
+
"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
|
|
201
201
|
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
202
|
-
"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:
|
|
202
|
+
"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar",
|
|
203
203
|
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
204
204
|
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
205
205
|
a
|
|
@@ -215,9 +215,9 @@ const ae = i.forwardRef(
|
|
|
215
215
|
"main",
|
|
216
216
|
{
|
|
217
217
|
ref: t,
|
|
218
|
-
className:
|
|
218
|
+
className: d(
|
|
219
219
|
"relative flex min-h-svh flex-1 flex-col bg-background",
|
|
220
|
-
"peer-data-[variant=inset]:min-h-[calc(100svh-
|
|
220
|
+
"peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))] md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",
|
|
221
221
|
a
|
|
222
222
|
),
|
|
223
223
|
...e
|
|
@@ -230,7 +230,7 @@ const te = i.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ r(
|
|
|
230
230
|
{
|
|
231
231
|
ref: t,
|
|
232
232
|
"data-sidebar": "input",
|
|
233
|
-
className:
|
|
233
|
+
className: d(
|
|
234
234
|
"h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",
|
|
235
235
|
a
|
|
236
236
|
),
|
|
@@ -244,7 +244,7 @@ const re = i.forwardRef(
|
|
|
244
244
|
{
|
|
245
245
|
ref: t,
|
|
246
246
|
"data-sidebar": "header",
|
|
247
|
-
className:
|
|
247
|
+
className: d("flex flex-col gap-2 p-2", a),
|
|
248
248
|
...e
|
|
249
249
|
}
|
|
250
250
|
)
|
|
@@ -256,29 +256,29 @@ const ie = i.forwardRef(
|
|
|
256
256
|
{
|
|
257
257
|
ref: t,
|
|
258
258
|
"data-sidebar": "footer",
|
|
259
|
-
className:
|
|
259
|
+
className: d("flex flex-col gap-2 p-2", a),
|
|
260
260
|
...e
|
|
261
261
|
}
|
|
262
262
|
)
|
|
263
263
|
);
|
|
264
264
|
ie.displayName = "SidebarFooter";
|
|
265
|
-
const
|
|
265
|
+
const de = i.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ r(
|
|
266
266
|
A,
|
|
267
267
|
{
|
|
268
268
|
ref: t,
|
|
269
269
|
"data-sidebar": "separator",
|
|
270
|
-
className:
|
|
270
|
+
className: d("mx-2 w-auto bg-sidebar-border", a),
|
|
271
271
|
...e
|
|
272
272
|
}
|
|
273
273
|
));
|
|
274
|
-
|
|
275
|
-
const
|
|
274
|
+
de.displayName = "SidebarSeparator";
|
|
275
|
+
const oe = i.forwardRef(
|
|
276
276
|
({ className: a, ...e }, t) => /* @__PURE__ */ r(
|
|
277
277
|
"div",
|
|
278
278
|
{
|
|
279
279
|
ref: t,
|
|
280
280
|
"data-sidebar": "content",
|
|
281
|
-
className:
|
|
281
|
+
className: d(
|
|
282
282
|
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
283
283
|
a
|
|
284
284
|
),
|
|
@@ -286,26 +286,26 @@ const de = i.forwardRef(
|
|
|
286
286
|
}
|
|
287
287
|
)
|
|
288
288
|
);
|
|
289
|
-
|
|
289
|
+
oe.displayName = "SidebarContent";
|
|
290
290
|
const ne = i.forwardRef(
|
|
291
291
|
({ className: a, ...e }, t) => /* @__PURE__ */ r(
|
|
292
292
|
"div",
|
|
293
293
|
{
|
|
294
294
|
ref: t,
|
|
295
295
|
"data-sidebar": "group",
|
|
296
|
-
className:
|
|
296
|
+
className: d("relative flex w-full min-w-0 flex-col p-2", a),
|
|
297
297
|
...e
|
|
298
298
|
}
|
|
299
299
|
)
|
|
300
300
|
);
|
|
301
301
|
ne.displayName = "SidebarGroup";
|
|
302
|
-
const se = i.forwardRef(({ className: a, asChild: e = !1, ...t },
|
|
302
|
+
const se = i.forwardRef(({ className: a, asChild: e = !1, ...t }, o) => /* @__PURE__ */ r(
|
|
303
303
|
e ? h : "div",
|
|
304
304
|
{
|
|
305
|
-
ref:
|
|
305
|
+
ref: o,
|
|
306
306
|
"data-sidebar": "group-label",
|
|
307
|
-
className:
|
|
308
|
-
"duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-caption font-medium text-sidebar-foreground/70 outline-
|
|
307
|
+
className: d(
|
|
308
|
+
"duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-caption font-medium text-sidebar-foreground/70 outline-hidden ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
309
309
|
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
310
310
|
a
|
|
311
311
|
),
|
|
@@ -313,15 +313,15 @@ const se = i.forwardRef(({ className: a, asChild: e = !1, ...t }, d) => /* @__PU
|
|
|
313
313
|
}
|
|
314
314
|
));
|
|
315
315
|
se.displayName = "SidebarGroupLabel";
|
|
316
|
-
const le = i.forwardRef(({ className: a, asChild: e = !1, ...t },
|
|
316
|
+
const le = i.forwardRef(({ className: a, asChild: e = !1, ...t }, o) => /* @__PURE__ */ r(
|
|
317
317
|
e ? h : "button",
|
|
318
318
|
{
|
|
319
|
-
ref:
|
|
319
|
+
ref: o,
|
|
320
320
|
"data-sidebar": "group-action",
|
|
321
|
-
className:
|
|
322
|
-
"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-
|
|
321
|
+
className: d(
|
|
322
|
+
"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
323
323
|
// Increases the hit area of the button on mobile.
|
|
324
|
-
"after:absolute after:-inset-2 after:
|
|
324
|
+
"after:absolute after:-inset-2 md:after:hidden",
|
|
325
325
|
"group-data-[collapsible=icon]:hidden",
|
|
326
326
|
a
|
|
327
327
|
),
|
|
@@ -335,7 +335,7 @@ const ce = i.forwardRef(
|
|
|
335
335
|
{
|
|
336
336
|
ref: t,
|
|
337
337
|
"data-sidebar": "group-content",
|
|
338
|
-
className:
|
|
338
|
+
className: d("w-full text-body", a),
|
|
339
339
|
...e
|
|
340
340
|
}
|
|
341
341
|
)
|
|
@@ -347,7 +347,7 @@ const ue = i.forwardRef(
|
|
|
347
347
|
{
|
|
348
348
|
ref: t,
|
|
349
349
|
"data-sidebar": "menu",
|
|
350
|
-
className:
|
|
350
|
+
className: d("flex w-full min-w-0 flex-col", a),
|
|
351
351
|
...e
|
|
352
352
|
}
|
|
353
353
|
)
|
|
@@ -359,14 +359,14 @@ const be = i.forwardRef(
|
|
|
359
359
|
{
|
|
360
360
|
ref: t,
|
|
361
361
|
"data-sidebar": "menu-item",
|
|
362
|
-
className:
|
|
362
|
+
className: d("group/menu-item relative", a),
|
|
363
363
|
...e
|
|
364
364
|
}
|
|
365
365
|
)
|
|
366
366
|
);
|
|
367
367
|
be.displayName = "SidebarMenuItem";
|
|
368
368
|
const fe = I(
|
|
369
|
-
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-body outline-
|
|
369
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-body 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",
|
|
370
370
|
{
|
|
371
371
|
variants: {
|
|
372
372
|
variant: {
|
|
@@ -376,7 +376,7 @@ const fe = I(
|
|
|
376
376
|
size: {
|
|
377
377
|
default: "h-8 text-body",
|
|
378
378
|
sm: "h-7 text-caption",
|
|
379
|
-
lg: "h-12 text-body group-data-[collapsible=icon]
|
|
379
|
+
lg: "h-12 text-body group-data-[collapsible=icon]:p-0!"
|
|
380
380
|
}
|
|
381
381
|
},
|
|
382
382
|
defaultVariants: {
|
|
@@ -389,7 +389,7 @@ const fe = I(
|
|
|
389
389
|
asChild: a = !1,
|
|
390
390
|
isActive: e = !1,
|
|
391
391
|
variant: t = "default",
|
|
392
|
-
size:
|
|
392
|
+
size: o = "lg",
|
|
393
393
|
tooltip: n,
|
|
394
394
|
className: s,
|
|
395
395
|
...c
|
|
@@ -399,9 +399,9 @@ const fe = I(
|
|
|
399
399
|
{
|
|
400
400
|
ref: f,
|
|
401
401
|
"data-sidebar": "menu-button",
|
|
402
|
-
"data-size":
|
|
402
|
+
"data-size": o,
|
|
403
403
|
"data-active": e,
|
|
404
|
-
className:
|
|
404
|
+
className: d(fe({ variant: t, size: o }), s),
|
|
405
405
|
...c
|
|
406
406
|
}
|
|
407
407
|
);
|
|
@@ -422,15 +422,15 @@ const fe = I(
|
|
|
422
422
|
}
|
|
423
423
|
);
|
|
424
424
|
pe.displayName = "SidebarMenuButton";
|
|
425
|
-
const me = i.forwardRef(({ className: a, asChild: e = !1, showOnHover: t = !1, ...
|
|
425
|
+
const me = i.forwardRef(({ className: a, asChild: e = !1, showOnHover: t = !1, ...o }, n) => /* @__PURE__ */ r(
|
|
426
426
|
e ? h : "button",
|
|
427
427
|
{
|
|
428
428
|
ref: n,
|
|
429
429
|
"data-sidebar": "menu-action",
|
|
430
|
-
className:
|
|
431
|
-
"absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-
|
|
430
|
+
className: d(
|
|
431
|
+
"absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden 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",
|
|
432
432
|
// Increases the hit area of the button on mobile.
|
|
433
|
-
"after:absolute after:-inset-2 after:
|
|
433
|
+
"after:absolute after:-inset-2 md:after:hidden",
|
|
434
434
|
"peer-data-[size=sm]/menu-button:top-1",
|
|
435
435
|
"peer-data-[size=default]/menu-button:top-1.5",
|
|
436
436
|
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
@@ -438,7 +438,7 @@ const me = i.forwardRef(({ className: a, asChild: e = !1, showOnHover: t = !1, .
|
|
|
438
438
|
t && "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",
|
|
439
439
|
a
|
|
440
440
|
),
|
|
441
|
-
...
|
|
441
|
+
...o
|
|
442
442
|
}
|
|
443
443
|
));
|
|
444
444
|
me.displayName = "SidebarMenuAction";
|
|
@@ -448,7 +448,7 @@ const ge = i.forwardRef(
|
|
|
448
448
|
{
|
|
449
449
|
ref: t,
|
|
450
450
|
"data-sidebar": "menu-badge",
|
|
451
|
-
className:
|
|
451
|
+
className: d(
|
|
452
452
|
"absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-caption font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none",
|
|
453
453
|
"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
|
|
454
454
|
"peer-data-[size=sm]/menu-button:top-1",
|
|
@@ -462,21 +462,21 @@ const ge = i.forwardRef(
|
|
|
462
462
|
)
|
|
463
463
|
);
|
|
464
464
|
ge.displayName = "SidebarMenuBadge";
|
|
465
|
-
const he = i.forwardRef(({ className: a, showIcon: e = !1, ...t },
|
|
465
|
+
const he = i.forwardRef(({ className: a, showIcon: e = !1, ...t }, o) => {
|
|
466
466
|
const n = i.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);
|
|
467
467
|
return /* @__PURE__ */ g(
|
|
468
468
|
"div",
|
|
469
469
|
{
|
|
470
|
-
ref:
|
|
470
|
+
ref: o,
|
|
471
471
|
"data-sidebar": "menu-skeleton",
|
|
472
|
-
className:
|
|
472
|
+
className: d("rounded-md h-8 flex gap-2 px-2 items-center", a),
|
|
473
473
|
...t,
|
|
474
474
|
children: [
|
|
475
475
|
e && /* @__PURE__ */ r(M, { className: "size-4 rounded-md", "data-sidebar": "menu-skeleton-icon" }),
|
|
476
476
|
/* @__PURE__ */ r(
|
|
477
477
|
M,
|
|
478
478
|
{
|
|
479
|
-
className: "h-4 flex-1 max-w-
|
|
479
|
+
className: "h-4 flex-1 max-w-(--skeleton-width)",
|
|
480
480
|
"data-sidebar": "menu-skeleton-text",
|
|
481
481
|
style: {
|
|
482
482
|
"--skeleton-width": n
|
|
@@ -494,7 +494,7 @@ const ve = i.forwardRef(
|
|
|
494
494
|
{
|
|
495
495
|
ref: t,
|
|
496
496
|
"data-sidebar": "menu-sub",
|
|
497
|
-
className:
|
|
497
|
+
className: d(
|
|
498
498
|
"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 px-2.5 py-0.5",
|
|
499
499
|
"group-data-[collapsible=icon]:hidden",
|
|
500
500
|
a
|
|
@@ -508,20 +508,20 @@ const xe = i.forwardRef(
|
|
|
508
508
|
({ ...a }, e) => /* @__PURE__ */ r("li", { ref: e, ...a })
|
|
509
509
|
);
|
|
510
510
|
xe.displayName = "SidebarMenuSubItem";
|
|
511
|
-
const we = i.forwardRef(({ asChild: a = !1, size: e = "md", isActive: t, className:
|
|
511
|
+
const we = i.forwardRef(({ asChild: a = !1, size: e = "md", isActive: t, className: o, ...n }, s) => /* @__PURE__ */ r(
|
|
512
512
|
a ? h : "a",
|
|
513
513
|
{
|
|
514
514
|
ref: s,
|
|
515
515
|
"data-sidebar": "menu-sub-button",
|
|
516
516
|
"data-size": e,
|
|
517
517
|
"data-active": t,
|
|
518
|
-
className:
|
|
519
|
-
"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-
|
|
518
|
+
className: d(
|
|
519
|
+
"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-hidden 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",
|
|
520
520
|
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
|
|
521
521
|
e === "sm" && "text-caption",
|
|
522
522
|
e === "md" && "text-body",
|
|
523
523
|
"group-data-[collapsible=icon]:hidden",
|
|
524
|
-
|
|
524
|
+
o
|
|
525
525
|
),
|
|
526
526
|
...n
|
|
527
527
|
}
|
|
@@ -529,7 +529,7 @@ const we = i.forwardRef(({ asChild: a = !1, size: e = "md", isActive: t, classNa
|
|
|
529
529
|
we.displayName = "SidebarMenuSubButton";
|
|
530
530
|
export {
|
|
531
531
|
Z as Sidebar,
|
|
532
|
-
|
|
532
|
+
oe as SidebarContent,
|
|
533
533
|
ie as SidebarFooter,
|
|
534
534
|
ne as SidebarGroup,
|
|
535
535
|
le as SidebarGroupAction,
|
|
@@ -549,7 +549,7 @@ export {
|
|
|
549
549
|
xe as SidebarMenuSubItem,
|
|
550
550
|
Q as SidebarProvider,
|
|
551
551
|
ee as SidebarRail,
|
|
552
|
-
|
|
552
|
+
de as SidebarSeparator,
|
|
553
553
|
P as SidebarTrigger,
|
|
554
554
|
y as useSidebar
|
|
555
555
|
};
|