@nipsys/shadcn-lsd 0.2.0 → 0.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.
Files changed (41) hide show
  1. package/README.md +12 -2
  2. package/dist/assets/style.css +1 -1
  3. package/dist/components/ui/menubar/Menubar.d.ts +6 -0
  4. package/dist/components/ui/menubar/Menubar.js +17 -0
  5. package/dist/components/ui/menubar/MenubarCheckboxItem.d.ts +6 -0
  6. package/dist/components/ui/menubar/MenubarCheckboxItem.js +28 -0
  7. package/dist/components/ui/menubar/MenubarContent.d.ts +9 -0
  8. package/dist/components/ui/menubar/MenubarContent.js +27 -0
  9. package/dist/components/ui/menubar/MenubarGroup.d.ts +4 -0
  10. package/dist/components/ui/menubar/MenubarGroup.js +10 -0
  11. package/dist/components/ui/menubar/MenubarItem.d.ts +8 -0
  12. package/dist/components/ui/menubar/MenubarItem.js +34 -0
  13. package/dist/components/ui/menubar/MenubarLabel.d.ts +7 -0
  14. package/dist/components/ui/menubar/MenubarLabel.js +18 -0
  15. package/dist/components/ui/menubar/MenubarMenu.d.ts +4 -0
  16. package/dist/components/ui/menubar/MenubarMenu.js +10 -0
  17. package/dist/components/ui/menubar/MenubarPortal.d.ts +4 -0
  18. package/dist/components/ui/menubar/MenubarPortal.js +10 -0
  19. package/dist/components/ui/menubar/MenubarRadioGroup.d.ts +4 -0
  20. package/dist/components/ui/menubar/MenubarRadioGroup.js +10 -0
  21. package/dist/components/ui/menubar/MenubarRadioItem.d.ts +6 -0
  22. package/dist/components/ui/menubar/MenubarRadioItem.js +27 -0
  23. package/dist/components/ui/menubar/MenubarSeparator.d.ts +6 -0
  24. package/dist/components/ui/menubar/MenubarSeparator.js +17 -0
  25. package/dist/components/ui/menubar/MenubarSub.d.ts +4 -0
  26. package/dist/components/ui/menubar/MenubarSub.js +10 -0
  27. package/dist/components/ui/menubar/MenubarSubContent.d.ts +6 -0
  28. package/dist/components/ui/menubar/MenubarSubContent.js +17 -0
  29. package/dist/components/ui/menubar/MenubarSubTrigger.d.ts +7 -0
  30. package/dist/components/ui/menubar/MenubarSubTrigger.js +33 -0
  31. package/dist/components/ui/menubar/MenubarTrigger.d.ts +6 -0
  32. package/dist/components/ui/menubar/MenubarTrigger.js +17 -0
  33. package/dist/components/ui/menubar/__tests__/menubar-trigger.test.d.ts +1 -0
  34. package/dist/components/ui/menubar/__tests__/menubar-trigger.test.js +68 -0
  35. package/dist/components/ui/menubar/__tests__/menubar.test.d.ts +1 -0
  36. package/dist/components/ui/menubar/__tests__/menubar.test.js +66 -0
  37. package/dist/components/ui/menubar/index.d.ts +16 -0
  38. package/dist/components/ui/menubar/types.d.ts +22 -0
  39. package/dist/index-DSoDGF_j.js +916 -0
  40. package/dist/types-D94euSAG.js +69 -0
  41. package/package.json +2 -1
@@ -0,0 +1,916 @@
1
+ import * as o from "react";
2
+ import { c as Ie } from "./index-VnDe3Nx7.js";
3
+ import { u as Pe } from "./index-ByaXH_ih.js";
4
+ import { c as g, P as y, d as yn, b as xn } from "./index-Cc1WoggG.js";
5
+ import { c as Tn, u as N } from "./index-DLcqcWxM.js";
6
+ import { c as we } from "./index-DFZozV_h.js";
7
+ import { u as G } from "./index-DrO-qzxY.js";
8
+ import { P as An, D as Nn } from "./index-D4uZ9LKw.js";
9
+ import { u as On, R as Dn, F as kn, h as Fn } from "./index-D1Qyh-m-.js";
10
+ import { A as Ln, R as Ee, c as ye, C as Gn, a as Kn } from "./index-Ce5p59aV.js";
11
+ import { P as q } from "./index-BiHZqHTp.js";
12
+ import { c as J, I as xe, R as Te } from "./index-CLZRNDoo.js";
13
+ import { u as se } from "./index-0ioNhtNM.js";
14
+ import { jsx as c } from "react/jsx-runtime";
15
+ import { u as Ae } from "./index-TznoxaGd.js";
16
+ var oe = ["Enter", " "], Un = ["ArrowDown", "PageUp", "Home"], Ne = ["ArrowUp", "PageDown", "End"], $n = [...Un, ...Ne], Bn = {
17
+ ltr: [...oe, "ArrowRight"],
18
+ rtl: [...oe, "ArrowLeft"]
19
+ }, Vn = {
20
+ ltr: ["ArrowLeft"],
21
+ rtl: ["ArrowRight"]
22
+ }, $ = "Menu", [K, Yn, Xn] = Ie($), [x, jn] = we($, [
23
+ Xn,
24
+ ye,
25
+ J
26
+ ]), B = ye(), Oe = J(), [De, P] = x($), [Hn, V] = x($), ke = (e) => {
27
+ const { __scopeMenu: r, open: n = !1, children: t, dir: a, onOpenChange: u, modal: l = !0 } = e, f = B(r), [d, v] = o.useState(null), i = o.useRef(!1), s = se(u), m = Pe(a);
28
+ return o.useEffect(() => {
29
+ const b = () => {
30
+ i.current = !0, document.addEventListener("pointerdown", M, { capture: !0, once: !0 }), document.addEventListener("pointermove", M, { capture: !0, once: !0 });
31
+ }, M = () => i.current = !1;
32
+ return document.addEventListener("keydown", b, { capture: !0 }), () => {
33
+ document.removeEventListener("keydown", b, { capture: !0 }), document.removeEventListener("pointerdown", M, { capture: !0 }), document.removeEventListener("pointermove", M, { capture: !0 });
34
+ };
35
+ }, []), /* @__PURE__ */ c(Ee, { ...f, children: /* @__PURE__ */ c(
36
+ De,
37
+ {
38
+ scope: r,
39
+ open: n,
40
+ onOpenChange: s,
41
+ content: d,
42
+ onContentChange: v,
43
+ children: /* @__PURE__ */ c(
44
+ Hn,
45
+ {
46
+ scope: r,
47
+ onClose: o.useCallback(() => s(!1), [s]),
48
+ isUsingKeyboardRef: i,
49
+ dir: m,
50
+ modal: l,
51
+ children: t
52
+ }
53
+ )
54
+ }
55
+ ) });
56
+ };
57
+ ke.displayName = $;
58
+ var Wn = "MenuAnchor", ie = o.forwardRef(
59
+ (e, r) => {
60
+ const { __scopeMenu: n, ...t } = e, a = B(n);
61
+ return /* @__PURE__ */ c(Ln, { ...a, ...t, ref: r });
62
+ }
63
+ );
64
+ ie.displayName = Wn;
65
+ var le = "MenuPortal", [zn, Fe] = x(le, {
66
+ forceMount: void 0
67
+ }), Le = (e) => {
68
+ const { __scopeMenu: r, forceMount: n, children: t, container: a } = e, u = P(le, r);
69
+ return /* @__PURE__ */ c(zn, { scope: r, forceMount: n, children: /* @__PURE__ */ c(q, { present: n || u.open, children: /* @__PURE__ */ c(An, { asChild: !0, container: a, children: t }) }) });
70
+ };
71
+ Le.displayName = le;
72
+ var R = "MenuContent", [Zn, de] = x(R), Ge = o.forwardRef(
73
+ (e, r) => {
74
+ const n = Fe(R, e.__scopeMenu), { forceMount: t = n.forceMount, ...a } = e, u = P(R, e.__scopeMenu), l = V(R, e.__scopeMenu);
75
+ return /* @__PURE__ */ c(K.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(q, { present: t || u.open, children: /* @__PURE__ */ c(K.Slot, { scope: e.__scopeMenu, children: l.modal ? /* @__PURE__ */ c(qn, { ...a, ref: r }) : /* @__PURE__ */ c(Jn, { ...a, ref: r }) }) }) });
76
+ }
77
+ ), qn = o.forwardRef(
78
+ (e, r) => {
79
+ const n = P(R, e.__scopeMenu), t = o.useRef(null), a = N(r, t);
80
+ return o.useEffect(() => {
81
+ const u = t.current;
82
+ if (u) return Fn(u);
83
+ }, []), /* @__PURE__ */ c(
84
+ fe,
85
+ {
86
+ ...e,
87
+ ref: a,
88
+ trapFocus: n.open,
89
+ disableOutsidePointerEvents: n.open,
90
+ disableOutsideScroll: !0,
91
+ onFocusOutside: g(
92
+ e.onFocusOutside,
93
+ (u) => u.preventDefault(),
94
+ { checkForDefaultPrevented: !1 }
95
+ ),
96
+ onDismiss: () => n.onOpenChange(!1)
97
+ }
98
+ );
99
+ }
100
+ ), Jn = o.forwardRef((e, r) => {
101
+ const n = P(R, e.__scopeMenu);
102
+ return /* @__PURE__ */ c(
103
+ fe,
104
+ {
105
+ ...e,
106
+ ref: r,
107
+ trapFocus: !1,
108
+ disableOutsidePointerEvents: !1,
109
+ disableOutsideScroll: !1,
110
+ onDismiss: () => n.onOpenChange(!1)
111
+ }
112
+ );
113
+ }), Qn = xn("MenuContent.ScrollLock"), fe = o.forwardRef(
114
+ (e, r) => {
115
+ const {
116
+ __scopeMenu: n,
117
+ loop: t = !1,
118
+ trapFocus: a,
119
+ onOpenAutoFocus: u,
120
+ onCloseAutoFocus: l,
121
+ disableOutsidePointerEvents: f,
122
+ onEntryFocus: d,
123
+ onEscapeKeyDown: v,
124
+ onPointerDownOutside: i,
125
+ onFocusOutside: s,
126
+ onInteractOutside: m,
127
+ onDismiss: b,
128
+ disableOutsideScroll: M,
129
+ ...h
130
+ } = e, S = P(R, n), w = V(R, n), I = B(n), X = Oe(n), O = Yn(n), [D, he] = o.useState(null), j = o.useRef(null), Sn = N(r, j, S.onContentChange), H = o.useRef(0), W = o.useRef(""), In = o.useRef(0), ee = o.useRef(null), Ce = o.useRef("right"), ne = o.useRef(0), Pn = M ? Dn : o.Fragment, wn = M ? { as: Qn, allowPinchZoom: !0 } : void 0, En = (p) => {
131
+ const A = W.current + p, E = O().filter((_) => !_.disabled), k = document.activeElement, re = E.find((_) => _.ref.current === k)?.textValue, te = E.map((_) => _.textValue), _e = dr(te, A, re), F = E.find((_) => _.textValue === _e)?.ref.current;
132
+ (function _(Re) {
133
+ W.current = Re, window.clearTimeout(H.current), Re !== "" && (H.current = window.setTimeout(() => _(""), 1e3));
134
+ })(A), F && setTimeout(() => F.focus());
135
+ };
136
+ o.useEffect(() => () => window.clearTimeout(H.current), []), On();
137
+ const T = o.useCallback((p) => Ce.current === ee.current?.side && pr(p, ee.current?.area), []);
138
+ return /* @__PURE__ */ c(
139
+ Zn,
140
+ {
141
+ scope: n,
142
+ searchRef: W,
143
+ onItemEnter: o.useCallback(
144
+ (p) => {
145
+ T(p) && p.preventDefault();
146
+ },
147
+ [T]
148
+ ),
149
+ onItemLeave: o.useCallback(
150
+ (p) => {
151
+ T(p) || (j.current?.focus(), he(null));
152
+ },
153
+ [T]
154
+ ),
155
+ onTriggerLeave: o.useCallback(
156
+ (p) => {
157
+ T(p) && p.preventDefault();
158
+ },
159
+ [T]
160
+ ),
161
+ pointerGraceTimerRef: In,
162
+ onPointerGraceIntentChange: o.useCallback((p) => {
163
+ ee.current = p;
164
+ }, []),
165
+ children: /* @__PURE__ */ c(Pn, { ...wn, children: /* @__PURE__ */ c(
166
+ kn,
167
+ {
168
+ asChild: !0,
169
+ trapped: a,
170
+ onMountAutoFocus: g(u, (p) => {
171
+ p.preventDefault(), j.current?.focus({ preventScroll: !0 });
172
+ }),
173
+ onUnmountAutoFocus: l,
174
+ children: /* @__PURE__ */ c(
175
+ Nn,
176
+ {
177
+ asChild: !0,
178
+ disableOutsidePointerEvents: f,
179
+ onEscapeKeyDown: v,
180
+ onPointerDownOutside: i,
181
+ onFocusOutside: s,
182
+ onInteractOutside: m,
183
+ onDismiss: b,
184
+ children: /* @__PURE__ */ c(
185
+ Te,
186
+ {
187
+ asChild: !0,
188
+ ...X,
189
+ dir: w.dir,
190
+ orientation: "vertical",
191
+ loop: t,
192
+ currentTabStopId: D,
193
+ onCurrentTabStopIdChange: he,
194
+ onEntryFocus: g(d, (p) => {
195
+ w.isUsingKeyboardRef.current || p.preventDefault();
196
+ }),
197
+ preventScrollOnEntryFocus: !0,
198
+ children: /* @__PURE__ */ c(
199
+ Gn,
200
+ {
201
+ role: "menu",
202
+ "aria-orientation": "vertical",
203
+ "data-state": nn(S.open),
204
+ "data-radix-menu-content": "",
205
+ dir: w.dir,
206
+ ...I,
207
+ ...h,
208
+ ref: Sn,
209
+ style: { outline: "none", ...h.style },
210
+ onKeyDown: g(h.onKeyDown, (p) => {
211
+ const E = p.target.closest("[data-radix-menu-content]") === p.currentTarget, k = p.ctrlKey || p.altKey || p.metaKey, re = p.key.length === 1;
212
+ E && (p.key === "Tab" && p.preventDefault(), !k && re && En(p.key));
213
+ const te = j.current;
214
+ if (p.target !== te || !$n.includes(p.key)) return;
215
+ p.preventDefault();
216
+ const F = O().filter((_) => !_.disabled).map((_) => _.ref.current);
217
+ Ne.includes(p.key) && F.reverse(), ir(F);
218
+ }),
219
+ onBlur: g(e.onBlur, (p) => {
220
+ p.currentTarget.contains(p.target) || (window.clearTimeout(H.current), W.current = "");
221
+ }),
222
+ onPointerMove: g(
223
+ e.onPointerMove,
224
+ U((p) => {
225
+ const A = p.target, E = ne.current !== p.clientX;
226
+ if (p.currentTarget.contains(A) && E) {
227
+ const k = p.clientX > ne.current ? "right" : "left";
228
+ Ce.current = k, ne.current = p.clientX;
229
+ }
230
+ })
231
+ )
232
+ }
233
+ )
234
+ }
235
+ )
236
+ }
237
+ )
238
+ }
239
+ ) })
240
+ }
241
+ );
242
+ }
243
+ );
244
+ Ge.displayName = R;
245
+ var er = "MenuGroup", pe = o.forwardRef(
246
+ (e, r) => {
247
+ const { __scopeMenu: n, ...t } = e;
248
+ return /* @__PURE__ */ c(y.div, { role: "group", ...t, ref: r });
249
+ }
250
+ );
251
+ pe.displayName = er;
252
+ var nr = "MenuLabel", Ke = o.forwardRef(
253
+ (e, r) => {
254
+ const { __scopeMenu: n, ...t } = e;
255
+ return /* @__PURE__ */ c(y.div, { ...t, ref: r });
256
+ }
257
+ );
258
+ Ke.displayName = nr;
259
+ var z = "MenuItem", Se = "menu.itemSelect", Q = o.forwardRef(
260
+ (e, r) => {
261
+ const { disabled: n = !1, onSelect: t, ...a } = e, u = o.useRef(null), l = V(z, e.__scopeMenu), f = de(z, e.__scopeMenu), d = N(r, u), v = o.useRef(!1), i = () => {
262
+ const s = u.current;
263
+ if (!n && s) {
264
+ const m = new CustomEvent(Se, { bubbles: !0, cancelable: !0 });
265
+ s.addEventListener(Se, (b) => t?.(b), { once: !0 }), yn(s, m), m.defaultPrevented ? v.current = !1 : l.onClose();
266
+ }
267
+ };
268
+ return /* @__PURE__ */ c(
269
+ Ue,
270
+ {
271
+ ...a,
272
+ ref: d,
273
+ disabled: n,
274
+ onClick: g(e.onClick, i),
275
+ onPointerDown: (s) => {
276
+ e.onPointerDown?.(s), v.current = !0;
277
+ },
278
+ onPointerUp: g(e.onPointerUp, (s) => {
279
+ v.current || s.currentTarget?.click();
280
+ }),
281
+ onKeyDown: g(e.onKeyDown, (s) => {
282
+ const m = f.searchRef.current !== "";
283
+ n || m && s.key === " " || oe.includes(s.key) && (s.currentTarget.click(), s.preventDefault());
284
+ })
285
+ }
286
+ );
287
+ }
288
+ );
289
+ Q.displayName = z;
290
+ var Ue = o.forwardRef(
291
+ (e, r) => {
292
+ const { __scopeMenu: n, disabled: t = !1, textValue: a, ...u } = e, l = de(z, n), f = Oe(n), d = o.useRef(null), v = N(r, d), [i, s] = o.useState(!1), [m, b] = o.useState("");
293
+ return o.useEffect(() => {
294
+ const M = d.current;
295
+ M && b((M.textContent ?? "").trim());
296
+ }, [u.children]), /* @__PURE__ */ c(
297
+ K.ItemSlot,
298
+ {
299
+ scope: n,
300
+ disabled: t,
301
+ textValue: a ?? m,
302
+ children: /* @__PURE__ */ c(xe, { asChild: !0, ...f, focusable: !t, children: /* @__PURE__ */ c(
303
+ y.div,
304
+ {
305
+ role: "menuitem",
306
+ "data-highlighted": i ? "" : void 0,
307
+ "aria-disabled": t || void 0,
308
+ "data-disabled": t ? "" : void 0,
309
+ ...u,
310
+ ref: v,
311
+ onPointerMove: g(
312
+ e.onPointerMove,
313
+ U((M) => {
314
+ t ? l.onItemLeave(M) : (l.onItemEnter(M), M.defaultPrevented || M.currentTarget.focus({ preventScroll: !0 }));
315
+ })
316
+ ),
317
+ onPointerLeave: g(
318
+ e.onPointerLeave,
319
+ U((M) => l.onItemLeave(M))
320
+ ),
321
+ onFocus: g(e.onFocus, () => s(!0)),
322
+ onBlur: g(e.onBlur, () => s(!1))
323
+ }
324
+ ) })
325
+ }
326
+ );
327
+ }
328
+ ), rr = "MenuCheckboxItem", $e = o.forwardRef(
329
+ (e, r) => {
330
+ const { checked: n = !1, onCheckedChange: t, ...a } = e;
331
+ return /* @__PURE__ */ c(je, { scope: e.__scopeMenu, checked: n, children: /* @__PURE__ */ c(
332
+ Q,
333
+ {
334
+ role: "menuitemcheckbox",
335
+ "aria-checked": Z(n) ? "mixed" : n,
336
+ ...a,
337
+ ref: r,
338
+ "data-state": Me(n),
339
+ onSelect: g(
340
+ a.onSelect,
341
+ () => t?.(Z(n) ? !0 : !n),
342
+ { checkForDefaultPrevented: !1 }
343
+ )
344
+ }
345
+ ) });
346
+ }
347
+ );
348
+ $e.displayName = rr;
349
+ var Be = "MenuRadioGroup", [tr, or] = x(
350
+ Be,
351
+ { value: void 0, onValueChange: () => {
352
+ } }
353
+ ), Ve = o.forwardRef(
354
+ (e, r) => {
355
+ const { value: n, onValueChange: t, ...a } = e, u = se(t);
356
+ return /* @__PURE__ */ c(tr, { scope: e.__scopeMenu, value: n, onValueChange: u, children: /* @__PURE__ */ c(pe, { ...a, ref: r }) });
357
+ }
358
+ );
359
+ Ve.displayName = Be;
360
+ var Ye = "MenuRadioItem", Xe = o.forwardRef(
361
+ (e, r) => {
362
+ const { value: n, ...t } = e, a = or(Ye, e.__scopeMenu), u = n === a.value;
363
+ return /* @__PURE__ */ c(je, { scope: e.__scopeMenu, checked: u, children: /* @__PURE__ */ c(
364
+ Q,
365
+ {
366
+ role: "menuitemradio",
367
+ "aria-checked": u,
368
+ ...t,
369
+ ref: r,
370
+ "data-state": Me(u),
371
+ onSelect: g(
372
+ t.onSelect,
373
+ () => a.onValueChange?.(n),
374
+ { checkForDefaultPrevented: !1 }
375
+ )
376
+ }
377
+ ) });
378
+ }
379
+ );
380
+ Xe.displayName = Ye;
381
+ var me = "MenuItemIndicator", [je, ar] = x(
382
+ me,
383
+ { checked: !1 }
384
+ ), He = o.forwardRef(
385
+ (e, r) => {
386
+ const { __scopeMenu: n, forceMount: t, ...a } = e, u = ar(me, n);
387
+ return /* @__PURE__ */ c(
388
+ q,
389
+ {
390
+ present: t || Z(u.checked) || u.checked === !0,
391
+ children: /* @__PURE__ */ c(
392
+ y.span,
393
+ {
394
+ ...a,
395
+ ref: r,
396
+ "data-state": Me(u.checked)
397
+ }
398
+ )
399
+ }
400
+ );
401
+ }
402
+ );
403
+ He.displayName = me;
404
+ var cr = "MenuSeparator", We = o.forwardRef(
405
+ (e, r) => {
406
+ const { __scopeMenu: n, ...t } = e;
407
+ return /* @__PURE__ */ c(
408
+ y.div,
409
+ {
410
+ role: "separator",
411
+ "aria-orientation": "horizontal",
412
+ ...t,
413
+ ref: r
414
+ }
415
+ );
416
+ }
417
+ );
418
+ We.displayName = cr;
419
+ var ur = "MenuArrow", ze = o.forwardRef(
420
+ (e, r) => {
421
+ const { __scopeMenu: n, ...t } = e, a = B(n);
422
+ return /* @__PURE__ */ c(Kn, { ...a, ...t, ref: r });
423
+ }
424
+ );
425
+ ze.displayName = ur;
426
+ var ve = "MenuSub", [sr, Ze] = x(ve), qe = (e) => {
427
+ const { __scopeMenu: r, children: n, open: t = !1, onOpenChange: a } = e, u = P(ve, r), l = B(r), [f, d] = o.useState(null), [v, i] = o.useState(null), s = se(a);
428
+ return o.useEffect(() => (u.open === !1 && s(!1), () => s(!1)), [u.open, s]), /* @__PURE__ */ c(Ee, { ...l, children: /* @__PURE__ */ c(
429
+ De,
430
+ {
431
+ scope: r,
432
+ open: t,
433
+ onOpenChange: s,
434
+ content: v,
435
+ onContentChange: i,
436
+ children: /* @__PURE__ */ c(
437
+ sr,
438
+ {
439
+ scope: r,
440
+ contentId: G(),
441
+ triggerId: G(),
442
+ trigger: f,
443
+ onTriggerChange: d,
444
+ children: n
445
+ }
446
+ )
447
+ }
448
+ ) });
449
+ };
450
+ qe.displayName = ve;
451
+ var L = "MenuSubTrigger", Je = o.forwardRef(
452
+ (e, r) => {
453
+ const n = P(L, e.__scopeMenu), t = V(L, e.__scopeMenu), a = Ze(L, e.__scopeMenu), u = de(L, e.__scopeMenu), l = o.useRef(null), { pointerGraceTimerRef: f, onPointerGraceIntentChange: d } = u, v = { __scopeMenu: e.__scopeMenu }, i = o.useCallback(() => {
454
+ l.current && window.clearTimeout(l.current), l.current = null;
455
+ }, []);
456
+ return o.useEffect(() => i, [i]), o.useEffect(() => {
457
+ const s = f.current;
458
+ return () => {
459
+ window.clearTimeout(s), d(null);
460
+ };
461
+ }, [f, d]), /* @__PURE__ */ c(ie, { asChild: !0, ...v, children: /* @__PURE__ */ c(
462
+ Ue,
463
+ {
464
+ id: a.triggerId,
465
+ "aria-haspopup": "menu",
466
+ "aria-expanded": n.open,
467
+ "aria-controls": a.contentId,
468
+ "data-state": nn(n.open),
469
+ ...e,
470
+ ref: Tn(r, a.onTriggerChange),
471
+ onClick: (s) => {
472
+ e.onClick?.(s), !(e.disabled || s.defaultPrevented) && (s.currentTarget.focus(), n.open || n.onOpenChange(!0));
473
+ },
474
+ onPointerMove: g(
475
+ e.onPointerMove,
476
+ U((s) => {
477
+ u.onItemEnter(s), !s.defaultPrevented && !e.disabled && !n.open && !l.current && (u.onPointerGraceIntentChange(null), l.current = window.setTimeout(() => {
478
+ n.onOpenChange(!0), i();
479
+ }, 100));
480
+ })
481
+ ),
482
+ onPointerLeave: g(
483
+ e.onPointerLeave,
484
+ U((s) => {
485
+ i();
486
+ const m = n.content?.getBoundingClientRect();
487
+ if (m) {
488
+ const b = n.content?.dataset.side, M = b === "right", h = M ? -5 : 5, S = m[M ? "left" : "right"], w = m[M ? "right" : "left"];
489
+ u.onPointerGraceIntentChange({
490
+ area: [
491
+ // Apply a bleed on clientX to ensure that our exit point is
492
+ // consistently within polygon bounds
493
+ { x: s.clientX + h, y: s.clientY },
494
+ { x: S, y: m.top },
495
+ { x: w, y: m.top },
496
+ { x: w, y: m.bottom },
497
+ { x: S, y: m.bottom }
498
+ ],
499
+ side: b
500
+ }), window.clearTimeout(f.current), f.current = window.setTimeout(
501
+ () => u.onPointerGraceIntentChange(null),
502
+ 300
503
+ );
504
+ } else {
505
+ if (u.onTriggerLeave(s), s.defaultPrevented) return;
506
+ u.onPointerGraceIntentChange(null);
507
+ }
508
+ })
509
+ ),
510
+ onKeyDown: g(e.onKeyDown, (s) => {
511
+ const m = u.searchRef.current !== "";
512
+ e.disabled || m && s.key === " " || Bn[t.dir].includes(s.key) && (n.onOpenChange(!0), n.content?.focus(), s.preventDefault());
513
+ })
514
+ }
515
+ ) });
516
+ }
517
+ );
518
+ Je.displayName = L;
519
+ var Qe = "MenuSubContent", en = o.forwardRef(
520
+ (e, r) => {
521
+ const n = Fe(R, e.__scopeMenu), { forceMount: t = n.forceMount, ...a } = e, u = P(R, e.__scopeMenu), l = V(R, e.__scopeMenu), f = Ze(Qe, e.__scopeMenu), d = o.useRef(null), v = N(r, d);
522
+ return /* @__PURE__ */ c(K.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(q, { present: t || u.open, children: /* @__PURE__ */ c(K.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(
523
+ fe,
524
+ {
525
+ id: f.contentId,
526
+ "aria-labelledby": f.triggerId,
527
+ ...a,
528
+ ref: v,
529
+ align: "start",
530
+ side: l.dir === "rtl" ? "left" : "right",
531
+ disableOutsidePointerEvents: !1,
532
+ disableOutsideScroll: !1,
533
+ trapFocus: !1,
534
+ onOpenAutoFocus: (i) => {
535
+ l.isUsingKeyboardRef.current && d.current?.focus(), i.preventDefault();
536
+ },
537
+ onCloseAutoFocus: (i) => i.preventDefault(),
538
+ onFocusOutside: g(e.onFocusOutside, (i) => {
539
+ i.target !== f.trigger && u.onOpenChange(!1);
540
+ }),
541
+ onEscapeKeyDown: g(e.onEscapeKeyDown, (i) => {
542
+ l.onClose(), i.preventDefault();
543
+ }),
544
+ onKeyDown: g(e.onKeyDown, (i) => {
545
+ const s = i.currentTarget.contains(i.target), m = Vn[l.dir].includes(i.key);
546
+ s && m && (u.onOpenChange(!1), f.trigger?.focus(), i.preventDefault());
547
+ })
548
+ }
549
+ ) }) }) });
550
+ }
551
+ );
552
+ en.displayName = Qe;
553
+ function nn(e) {
554
+ return e ? "open" : "closed";
555
+ }
556
+ function Z(e) {
557
+ return e === "indeterminate";
558
+ }
559
+ function Me(e) {
560
+ return Z(e) ? "indeterminate" : e ? "checked" : "unchecked";
561
+ }
562
+ function ir(e) {
563
+ const r = document.activeElement;
564
+ for (const n of e)
565
+ if (n === r || (n.focus(), document.activeElement !== r)) return;
566
+ }
567
+ function lr(e, r) {
568
+ return e.map((n, t) => e[(r + t) % e.length]);
569
+ }
570
+ function dr(e, r, n) {
571
+ const a = r.length > 1 && Array.from(r).every((v) => v === r[0]) ? r[0] : r, u = n ? e.indexOf(n) : -1;
572
+ let l = lr(e, Math.max(u, 0));
573
+ a.length === 1 && (l = l.filter((v) => v !== n));
574
+ const d = l.find(
575
+ (v) => v.toLowerCase().startsWith(a.toLowerCase())
576
+ );
577
+ return d !== n ? d : void 0;
578
+ }
579
+ function fr(e, r) {
580
+ const { x: n, y: t } = e;
581
+ let a = !1;
582
+ for (let u = 0, l = r.length - 1; u < r.length; l = u++) {
583
+ const f = r[u], d = r[l], v = f.x, i = f.y, s = d.x, m = d.y;
584
+ i > t != m > t && n < (s - v) * (t - i) / (m - i) + v && (a = !a);
585
+ }
586
+ return a;
587
+ }
588
+ function pr(e, r) {
589
+ if (!r) return !1;
590
+ const n = { x: e.clientX, y: e.clientY };
591
+ return fr(n, r);
592
+ }
593
+ function U(e) {
594
+ return (r) => r.pointerType === "mouse" ? e(r) : void 0;
595
+ }
596
+ var mr = ke, vr = ie, Mr = Le, gr = Ge, br = pe, hr = Ke, Cr = Q, _r = $e, Rr = Ve, Sr = Xe, Ir = He, Pr = We, wr = ze, Er = qe, yr = Je, xr = en, Y = "Menubar", [ae, Tr, Ar] = Ie(Y), [rn] = we(Y, [
597
+ Ar,
598
+ J
599
+ ]), C = jn(), tn = J(), [Nr, ge] = rn(Y), on = o.forwardRef(
600
+ (e, r) => {
601
+ const {
602
+ __scopeMenubar: n,
603
+ value: t,
604
+ onValueChange: a,
605
+ defaultValue: u,
606
+ loop: l = !0,
607
+ dir: f,
608
+ ...d
609
+ } = e, v = Pe(f), i = tn(n), [s, m] = Ae({
610
+ prop: t,
611
+ onChange: a,
612
+ defaultProp: u ?? "",
613
+ caller: Y
614
+ }), [b, M] = o.useState(null);
615
+ return /* @__PURE__ */ c(
616
+ Nr,
617
+ {
618
+ scope: n,
619
+ value: s,
620
+ onMenuOpen: o.useCallback(
621
+ (h) => {
622
+ m(h), M(h);
623
+ },
624
+ [m]
625
+ ),
626
+ onMenuClose: o.useCallback(() => m(""), [m]),
627
+ onMenuToggle: o.useCallback(
628
+ (h) => {
629
+ m((S) => S ? "" : h), M(h);
630
+ },
631
+ [m]
632
+ ),
633
+ dir: v,
634
+ loop: l,
635
+ children: /* @__PURE__ */ c(ae.Provider, { scope: n, children: /* @__PURE__ */ c(ae.Slot, { scope: n, children: /* @__PURE__ */ c(
636
+ Te,
637
+ {
638
+ asChild: !0,
639
+ ...i,
640
+ orientation: "horizontal",
641
+ loop: l,
642
+ dir: v,
643
+ currentTabStopId: b,
644
+ onCurrentTabStopIdChange: M,
645
+ children: /* @__PURE__ */ c(y.div, { role: "menubar", ...d, ref: r })
646
+ }
647
+ ) }) })
648
+ }
649
+ );
650
+ }
651
+ );
652
+ on.displayName = Y;
653
+ var be = "MenubarMenu", [Or, an] = rn(be), cn = (e) => {
654
+ const { __scopeMenubar: r, value: n, ...t } = e, a = G(), u = n || a || "LEGACY_REACT_AUTO_VALUE", l = ge(be, r), f = C(r), d = o.useRef(null), v = o.useRef(!1), i = l.value === u;
655
+ return o.useEffect(() => {
656
+ i || (v.current = !1);
657
+ }, [i]), /* @__PURE__ */ c(
658
+ Or,
659
+ {
660
+ scope: r,
661
+ value: u,
662
+ triggerId: G(),
663
+ triggerRef: d,
664
+ contentId: G(),
665
+ wasKeyboardTriggerOpenRef: v,
666
+ children: /* @__PURE__ */ c(
667
+ mr,
668
+ {
669
+ ...f,
670
+ open: i,
671
+ onOpenChange: (s) => {
672
+ s || l.onMenuClose();
673
+ },
674
+ modal: !1,
675
+ dir: l.dir,
676
+ ...t
677
+ }
678
+ )
679
+ }
680
+ );
681
+ };
682
+ cn.displayName = be;
683
+ var ce = "MenubarTrigger", un = o.forwardRef(
684
+ (e, r) => {
685
+ const { __scopeMenubar: n, disabled: t = !1, ...a } = e, u = tn(n), l = C(n), f = ge(ce, n), d = an(ce, n), v = o.useRef(null), i = N(r, v, d.triggerRef), [s, m] = o.useState(!1), b = f.value === d.value;
686
+ return /* @__PURE__ */ c(ae.ItemSlot, { scope: n, value: d.value, disabled: t, children: /* @__PURE__ */ c(
687
+ xe,
688
+ {
689
+ asChild: !0,
690
+ ...u,
691
+ focusable: !t,
692
+ tabStopId: d.value,
693
+ children: /* @__PURE__ */ c(vr, { asChild: !0, ...l, children: /* @__PURE__ */ c(
694
+ y.button,
695
+ {
696
+ type: "button",
697
+ role: "menuitem",
698
+ id: d.triggerId,
699
+ "aria-haspopup": "menu",
700
+ "aria-expanded": b,
701
+ "aria-controls": b ? d.contentId : void 0,
702
+ "data-highlighted": s ? "" : void 0,
703
+ "data-state": b ? "open" : "closed",
704
+ "data-disabled": t ? "" : void 0,
705
+ disabled: t,
706
+ ...a,
707
+ ref: i,
708
+ onPointerDown: g(e.onPointerDown, (M) => {
709
+ !t && M.button === 0 && M.ctrlKey === !1 && (f.onMenuOpen(d.value), b || M.preventDefault());
710
+ }),
711
+ onPointerEnter: g(e.onPointerEnter, () => {
712
+ f.value && !b && (f.onMenuOpen(d.value), v.current?.focus());
713
+ }),
714
+ onKeyDown: g(e.onKeyDown, (M) => {
715
+ t || (["Enter", " "].includes(M.key) && f.onMenuToggle(d.value), M.key === "ArrowDown" && f.onMenuOpen(d.value), ["Enter", " ", "ArrowDown"].includes(M.key) && (d.wasKeyboardTriggerOpenRef.current = !0, M.preventDefault()));
716
+ }),
717
+ onFocus: g(e.onFocus, () => m(!0)),
718
+ onBlur: g(e.onBlur, () => m(!1))
719
+ }
720
+ ) })
721
+ }
722
+ ) });
723
+ }
724
+ );
725
+ un.displayName = ce;
726
+ var Dr = "MenubarPortal", sn = (e) => {
727
+ const { __scopeMenubar: r, ...n } = e, t = C(r);
728
+ return /* @__PURE__ */ c(Mr, { ...t, ...n });
729
+ };
730
+ sn.displayName = Dr;
731
+ var ue = "MenubarContent", ln = o.forwardRef(
732
+ (e, r) => {
733
+ const { __scopeMenubar: n, align: t = "start", ...a } = e, u = C(n), l = ge(ue, n), f = an(ue, n), d = Tr(n), v = o.useRef(!1);
734
+ return /* @__PURE__ */ c(
735
+ gr,
736
+ {
737
+ id: f.contentId,
738
+ "aria-labelledby": f.triggerId,
739
+ "data-radix-menubar-content": "",
740
+ ...u,
741
+ ...a,
742
+ ref: r,
743
+ align: t,
744
+ onCloseAutoFocus: g(e.onCloseAutoFocus, (i) => {
745
+ !l.value && !v.current && f.triggerRef.current?.focus(), v.current = !1, i.preventDefault();
746
+ }),
747
+ onFocusOutside: g(e.onFocusOutside, (i) => {
748
+ const s = i.target;
749
+ d().some((b) => b.ref.current?.contains(s)) && i.preventDefault();
750
+ }),
751
+ onInteractOutside: g(e.onInteractOutside, () => {
752
+ v.current = !0;
753
+ }),
754
+ onEntryFocus: (i) => {
755
+ f.wasKeyboardTriggerOpenRef.current || i.preventDefault();
756
+ },
757
+ onKeyDown: g(
758
+ e.onKeyDown,
759
+ (i) => {
760
+ if (["ArrowRight", "ArrowLeft"].includes(i.key)) {
761
+ const s = i.target, m = s.hasAttribute("data-radix-menubar-subtrigger"), b = s.closest("[data-radix-menubar-content]") !== i.currentTarget, h = (l.dir === "rtl" ? "ArrowRight" : "ArrowLeft") === i.key;
762
+ if (!h && m || b && h) return;
763
+ let I = d().filter((D) => !D.disabled).map((D) => D.value);
764
+ h && I.reverse();
765
+ const X = I.indexOf(f.value);
766
+ I = l.loop ? Hr(I, X + 1) : I.slice(X + 1);
767
+ const [O] = I;
768
+ O && l.onMenuOpen(O);
769
+ }
770
+ },
771
+ { checkForDefaultPrevented: !1 }
772
+ ),
773
+ style: {
774
+ ...e.style,
775
+ "--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)",
776
+ "--radix-menubar-content-available-width": "var(--radix-popper-available-width)",
777
+ "--radix-menubar-content-available-height": "var(--radix-popper-available-height)",
778
+ "--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)",
779
+ "--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)"
780
+ }
781
+ }
782
+ );
783
+ }
784
+ );
785
+ ln.displayName = ue;
786
+ var kr = "MenubarGroup", dn = o.forwardRef(
787
+ (e, r) => {
788
+ const { __scopeMenubar: n, ...t } = e, a = C(n);
789
+ return /* @__PURE__ */ c(br, { ...a, ...t, ref: r });
790
+ }
791
+ );
792
+ dn.displayName = kr;
793
+ var Fr = "MenubarLabel", fn = o.forwardRef(
794
+ (e, r) => {
795
+ const { __scopeMenubar: n, ...t } = e, a = C(n);
796
+ return /* @__PURE__ */ c(hr, { ...a, ...t, ref: r });
797
+ }
798
+ );
799
+ fn.displayName = Fr;
800
+ var Lr = "MenubarItem", pn = o.forwardRef(
801
+ (e, r) => {
802
+ const { __scopeMenubar: n, ...t } = e, a = C(n);
803
+ return /* @__PURE__ */ c(Cr, { ...a, ...t, ref: r });
804
+ }
805
+ );
806
+ pn.displayName = Lr;
807
+ var Gr = "MenubarCheckboxItem", mn = o.forwardRef(
808
+ (e, r) => {
809
+ const { __scopeMenubar: n, ...t } = e, a = C(n);
810
+ return /* @__PURE__ */ c(_r, { ...a, ...t, ref: r });
811
+ }
812
+ );
813
+ mn.displayName = Gr;
814
+ var Kr = "MenubarRadioGroup", vn = o.forwardRef(
815
+ (e, r) => {
816
+ const { __scopeMenubar: n, ...t } = e, a = C(n);
817
+ return /* @__PURE__ */ c(Rr, { ...a, ...t, ref: r });
818
+ }
819
+ );
820
+ vn.displayName = Kr;
821
+ var Ur = "MenubarRadioItem", Mn = o.forwardRef(
822
+ (e, r) => {
823
+ const { __scopeMenubar: n, ...t } = e, a = C(n);
824
+ return /* @__PURE__ */ c(Sr, { ...a, ...t, ref: r });
825
+ }
826
+ );
827
+ Mn.displayName = Ur;
828
+ var $r = "MenubarItemIndicator", gn = o.forwardRef((e, r) => {
829
+ const { __scopeMenubar: n, ...t } = e, a = C(n);
830
+ return /* @__PURE__ */ c(Ir, { ...a, ...t, ref: r });
831
+ });
832
+ gn.displayName = $r;
833
+ var Br = "MenubarSeparator", bn = o.forwardRef(
834
+ (e, r) => {
835
+ const { __scopeMenubar: n, ...t } = e, a = C(n);
836
+ return /* @__PURE__ */ c(Pr, { ...a, ...t, ref: r });
837
+ }
838
+ );
839
+ bn.displayName = Br;
840
+ var Vr = "MenubarArrow", Yr = o.forwardRef(
841
+ (e, r) => {
842
+ const { __scopeMenubar: n, ...t } = e, a = C(n);
843
+ return /* @__PURE__ */ c(wr, { ...a, ...t, ref: r });
844
+ }
845
+ );
846
+ Yr.displayName = Vr;
847
+ var hn = "MenubarSub", Cn = (e) => {
848
+ const { __scopeMenubar: r, children: n, open: t, onOpenChange: a, defaultOpen: u } = e, l = C(r), [f, d] = Ae({
849
+ prop: t,
850
+ defaultProp: u ?? !1,
851
+ onChange: a,
852
+ caller: hn
853
+ });
854
+ return /* @__PURE__ */ c(Er, { ...l, open: f, onOpenChange: d, children: n });
855
+ };
856
+ Cn.displayName = hn;
857
+ var Xr = "MenubarSubTrigger", _n = o.forwardRef(
858
+ (e, r) => {
859
+ const { __scopeMenubar: n, ...t } = e, a = C(n);
860
+ return /* @__PURE__ */ c(
861
+ yr,
862
+ {
863
+ "data-radix-menubar-subtrigger": "",
864
+ ...a,
865
+ ...t,
866
+ ref: r
867
+ }
868
+ );
869
+ }
870
+ );
871
+ _n.displayName = Xr;
872
+ var jr = "MenubarSubContent", Rn = o.forwardRef(
873
+ (e, r) => {
874
+ const { __scopeMenubar: n, ...t } = e, a = C(n);
875
+ return /* @__PURE__ */ c(
876
+ xr,
877
+ {
878
+ ...a,
879
+ "data-radix-menubar-content": "",
880
+ ...t,
881
+ ref: r,
882
+ style: {
883
+ ...e.style,
884
+ "--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)",
885
+ "--radix-menubar-content-available-width": "var(--radix-popper-available-width)",
886
+ "--radix-menubar-content-available-height": "var(--radix-popper-available-height)",
887
+ "--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)",
888
+ "--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)"
889
+ }
890
+ }
891
+ );
892
+ }
893
+ );
894
+ Rn.displayName = jr;
895
+ function Hr(e, r) {
896
+ return e.map((n, t) => e[(r + t) % e.length]);
897
+ }
898
+ var st = on, it = cn, lt = un, dt = sn, ft = ln, pt = dn, mt = fn, vt = pn, Mt = mn, gt = vn, bt = Mn, ht = gn, Ct = bn, _t = Cn, Rt = _n, St = Rn;
899
+ export {
900
+ ft as C,
901
+ pt as G,
902
+ vt as I,
903
+ mt as L,
904
+ it as M,
905
+ dt as P,
906
+ gt as R,
907
+ St as S,
908
+ lt as T,
909
+ _t as a,
910
+ Ct as b,
911
+ Mt as c,
912
+ ht as d,
913
+ st as e,
914
+ Rt as f,
915
+ bt as g
916
+ };