@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.
@@ -1,123 +1,126 @@
1
+ "use client";
1
2
  import { jsx as t, jsxs as p } from "react/jsx-runtime";
2
- import { Root as x } 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";
3
- import { Menu as z, ChevronLeft as I, ChevronRight as T } from "lucide-react";
4
- import * as s from "react";
5
- import { Button as D } from "./button.es.js";
6
- import { Separator as B } from "./separator.es.js";
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 j, Tooltip as L, TooltipTrigger as G, TooltipContent as K } from "./tooltip.es.js";
10
- import { useIsMobile as O } from "../../hooks/use-mobile.es.js";
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 W = "16rem", q = "18rem", F = "3rem", U = "b", y = s.createContext(null);
12
+ const G = "16rem", K = "18rem", P = "3rem", W = "b", y = d.createContext(null);
13
13
  function w() {
14
- const e = s.use(y);
15
- if (!e)
14
+ const a = d.useContext(y);
15
+ if (!a)
16
16
  throw new Error("useSidebar must be used within a SidebarProvider.");
17
- return e;
17
+ return a;
18
18
  }
19
- function te({
20
- defaultOpen: e = !0,
21
- open: a,
19
+ function ee({
20
+ defaultOpen: a = !0,
21
+ open: e,
22
22
  onOpenChange: r,
23
23
  className: n,
24
24
  style: o,
25
- children: l,
26
- ...c
25
+ children: u,
26
+ ...m
27
27
  }) {
28
- const u = O(), [b, m] = s.useState(!1), [M, C] = s.useState(e), f = a ?? M, g = s.useCallback(
29
- (d) => {
30
- if (r)
31
- return r == null ? void 0 : r(typeof d == "function" ? d(f) : d);
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, f]
35
- ), h = s.useCallback(() => u ? m((d) => !d) : g((d) => !d), [u, g, m]);
36
- s.useEffect(() => {
37
- const d = (v) => {
38
- v.key === U && (v.metaKey || v.ctrlKey) && (v.preventDefault(), h());
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", d), () => window.removeEventListener("keydown", d);
41
- }, [h]);
42
- const S = f ? "expanded" : "collapsed", k = s.useMemo(
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: f,
46
- setOpen: g,
47
- isMobile: u,
48
- openMobile: b,
49
- setOpenMobile: m,
50
- toggleSidebar: h
44
+ open: g,
45
+ setOpen: x,
46
+ isMobile: l,
47
+ openMobile: c,
48
+ setOpenMobile: f,
49
+ toggleSidebar: v
51
50
  }),
52
- [S, f, g, u, b, m, h]
51
+ [S, g, x, l, c, f, v]
53
52
  );
54
- return /* @__PURE__ */ t(y, { value: k, children: /* @__PURE__ */ t(j, { delayDuration: 0, children: /* @__PURE__ */ t(
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": W,
59
- "--sidebar-width-icon": F,
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-[variant=inset]:bg-sidebar",
62
+ "group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",
64
63
  n
65
64
  ),
66
- ...c,
67
- children: l
65
+ ...m,
66
+ children: u
68
67
  }
69
68
  ) }) });
70
69
  }
71
- function re({
70
+ function ae({
71
+ side: a = "left",
72
72
  variant: e = "sidebar",
73
- collapsible: a = "offcanvas",
74
- className: r,
75
- children: n,
76
- ...o
73
+ collapsible: r = "offcanvas",
74
+ className: n,
75
+ children: o,
76
+ ...u
77
77
  }) {
78
- const { isMobile: l, state: c, openMobile: u, setOpenMobile: b } = w();
79
- return a === "none" ? /* @__PURE__ */ t(
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-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",
84
- r
83
+ "flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",
84
+ n
85
85
  ),
86
- ...o,
87
- children: n
86
+ ...u,
87
+ children: o
88
88
  }
89
- ) : l ? /* @__PURE__ */ t(E, { open: u, onOpenChange: b, ...o, children: /* @__PURE__ */ p(
90
- R,
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-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
94
+ className: "w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
95
95
  style: {
96
- "--sidebar-width": q
96
+ "--sidebar-width": K
97
97
  },
98
+ side: a,
98
99
  children: [
99
- /* @__PURE__ */ p(_, { children: [
100
- /* @__PURE__ */ t(A, {}),
101
- /* @__PURE__ */ t(H, {})
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: n })
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 md:block text-sidebar-foreground",
110
- "data-state": c,
111
- "data-collapsible": c === "collapsed" ? a : "",
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
- "duration-200 relative w-(--sidebar-width) bg-transparent transition-[width] ease-linear",
120
+ "relative w-(--sidebar-width) bg-sidebar transition-[width] duration-200 ease-linear",
119
121
  "group-data-[collapsible=offcanvas]:w-0",
120
- e === "floating" || e === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
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
- "duration-200 absolute z-10 hidden w-(--sidebar-width) transition-[left,right,width] ease-linear md:flex",
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)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) border-r",
132
- r
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
- ...o,
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: n
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 ie({
150
- className: e,
151
- onClick: a,
152
- ...r
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: (c) => {
162
- a == null || a(c), n();
160
+ onClick: (o) => {
161
+ e == null || e(o), n();
163
162
  },
164
- icon: () => l ? z : o ? I : T,
165
- ...r
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
- function ne({
170
- className: e,
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: r,
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
- "group-data-[state=collapsed]:cursor-e-resize",
186
- "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar",
187
- "[[data-collapsible=offcanvas]_&]:-right-2",
188
- e
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
- ...a
191
+ ...e
191
192
  }
192
193
  );
193
- }
194
- function oe({
195
- className: e,
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]: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",
204
- e
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
- ...a
205
+ ...e
207
206
  }
208
207
  );
209
208
  }
210
- function de({
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", e),
219
- ...a
214
+ className: i("flex flex-col gap-2 p-2", a),
215
+ ...e
220
216
  }
221
217
  );
222
218
  }
223
- function se({
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", e),
232
- ...a
224
+ className: i("flex flex-col gap-2 p-2", a),
225
+ ...e
233
226
  }
234
227
  );
235
228
  }
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
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
- e
236
+ a
260
237
  ),
261
- ...a
238
+ ...e
262
239
  }
263
240
  );
264
241
  }
265
- function ue({ className: e, ...a }) {
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", e),
271
- ...a
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 be({
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
- "duration-200 flex h-8 shrink-0 items-center rounded-md px-2 caption font-medium text-sidebar-foreground/70 outline-hidden ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-1 [&>svg]:size-4 [&>svg]:shrink-0",
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
- e
260
+ a
287
261
  ),
288
- ...a
262
+ ...r
289
263
  }
290
264
  );
291
265
  }
292
- function fe({
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
- a ? x : "button",
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-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-1 [&>svg]:size-4 [&>svg]:shrink-0",
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:after:hidden",
274
+ "after:absolute after:-inset-2 after:md:hidden",
305
275
  "group-data-[collapsible=icon]:hidden",
306
- e
276
+ a
307
277
  ),
308
278
  ...r
309
279
  }
310
280
  );
311
281
  }
312
- function pe({
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 body", e),
321
- ...a
287
+ className: i("w-full text-sm", a),
288
+ ...e
322
289
  }
323
290
  );
324
291
  }
325
- function me({ className: e, ...a }) {
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", e),
331
- ...a
297
+ className: i("flex w-full min-w-0 flex-col gap-1", a),
298
+ ...e
332
299
  }
333
300
  );
334
301
  }
335
- function ge({
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", e),
344
- ...a
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 ve({
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
- a ? x : "button",
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-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-1 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0",
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:after:hidden",
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
- e
326
+ a
399
327
  ),
400
328
  ...n
401
329
  }
402
330
  );
403
331
  }
404
- function xe({
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-caption font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none",
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
- e
344
+ a
420
345
  ),
421
- ...a
346
+ ...e
422
347
  }
423
348
  );
424
349
  }
425
- function we({
426
- className: e,
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("rounded-md h-8 flex gap-2 px-2 items-center", e),
356
+ className: i("flex h-8 items-center gap-2 rounded-md px-2", a),
436
357
  ...r,
437
358
  children: [
438
- a && /* @__PURE__ */ t(
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 flex-1 max-w-(--skeleton-width)",
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 Se({
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 px-2.5 py-0.5",
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
- e
388
+ a
471
389
  ),
472
- ...a
390
+ ...e
473
391
  }
474
392
  );
475
393
  }
476
- function Ne({ ...e }) {
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
- function ye({
480
- asChild: e = !1,
481
- size: a = "md",
482
- isActive: r,
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
- e ? x : "a",
433
+ a ? h : "a",
488
434
  {
489
435
  "data-sidebar": "menu-sub-button",
490
- "data-size": a,
491
- "data-active": r,
436
+ "data-active": e,
492
437
  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-hidden ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-1 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
- "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
- n
440
+ C,
441
+ r
499
442
  ),
500
- ...o
443
+ ...n
501
444
  }
502
445
  );
503
446
  }
504
447
  export {
505
- re as Sidebar,
506
- ce as SidebarContent,
507
- se as SidebarFooter,
508
- ue as SidebarGroup,
509
- fe as SidebarGroupAction,
510
- pe as SidebarGroupContent,
511
- be as SidebarGroupLabel,
512
- de as SidebarHeader,
513
- oe as SidebarInset,
514
- me as SidebarMenu,
515
- ve as SidebarMenuAction,
516
- xe as SidebarMenuBadge,
517
- he as SidebarMenuButton,
518
- ge as SidebarMenuItem,
519
- we as SidebarMenuSkeleton,
520
- Se as SidebarMenuSub,
521
- ye as SidebarMenuSubButton,
522
- Ne as SidebarMenuSubItem,
523
- te as SidebarProvider,
524
- ne as SidebarRail,
525
- le as SidebarSeparator,
526
- ie as SidebarTrigger,
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