UNPKG

dgz-ui-shared

Version:

Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript, dgz-ui library

874 lines (873 loc) 31.5 kB
import { j as he, y as bn, a, g as me, h as O, b as h, f as we, n as ge, R as H, i as A, w as Dn, S as jn, M as Rn } from "./index-BL59b1Bz-C9bJE_xn.js"; import * as s from "react"; import { t as Cn, D as Nn, b as xe, n as kn, g as Pn, F as On, a as In } from "./index-Cths1nBq-BUfZy21E.js"; import { M as En, R as Tn, C as Sn, d as Fn, S as $n } from "./createLucideIcon-B950nf2d-9wLYOF5y.js"; import { o as ye, i as An, r as Ln, s as Kn, c as Gn } from "./index-ZsCkaYy6-Cw9HUeiu.js"; import { e as zn } from "./chevron-right-HWBijj-I-DsFUufdU.js"; import { m as D } from "./utils-B6fNqzRf-B1_jG1K7.js"; var ne = ["Enter", " "], Un = ["ArrowDown", "PageUp", "Home"], _e = ["ArrowUp", "PageDown", "End"], Vn = [...Un, ..._e], Bn = { ltr: [...ne, "ArrowRight"], rtl: [...ne, "ArrowLeft"] }, Xn = { ltr: ["ArrowLeft"], rtl: ["ArrowRight"] }, L = "Menu", [F, Wn, qn] = Nn(L), [j, Me] = he(L, [ qn, ye, xe ]), Q = ye(), be = xe(), [Hn, R] = j(L), [Qn, K] = j(L), De = (e) => { const { __scopeMenu: r, open: n = !1, children: t, dir: o, onOpenChange: c, modal: l = !0 } = e, d = Q(r), [m, w] = s.useState(null), p = s.useRef(!1), u = ge(c), f = kn(o); return s.useEffect(() => { const g = () => { p.current = !0, document.addEventListener("pointerdown", v, { capture: !0, once: !0 }), document.addEventListener("pointermove", v, { capture: !0, once: !0 }); }, v = () => p.current = !1; return document.addEventListener("keydown", g, { capture: !0 }), () => { document.removeEventListener("keydown", g, { capture: !0 }), document.removeEventListener("pointerdown", v, { capture: !0 }), document.removeEventListener("pointermove", v, { capture: !0 }); }; }, []), /* @__PURE__ */ a.jsx(An, { ...d, children: /* @__PURE__ */ a.jsx( Hn, { scope: r, open: n, onOpenChange: u, content: m, onContentChange: w, children: /* @__PURE__ */ a.jsx( Qn, { scope: r, onClose: s.useCallback(() => u(!1), [u]), isUsingKeyboardRef: p, dir: f, modal: l, children: t } ) } ) }); }; De.displayName = L; var Yn = "MenuAnchor", re = s.forwardRef( (e, r) => { const { __scopeMenu: n, ...t } = e, o = Q(n); return /* @__PURE__ */ a.jsx(Ln, { ...o, ...t, ref: r }); } ); re.displayName = Yn; var te = "MenuPortal", [Zn, je] = j(te, { forceMount: void 0 }), Re = (e) => { const { __scopeMenu: r, forceMount: n, children: t, container: o } = e, c = R(te, r); return /* @__PURE__ */ a.jsx(Zn, { scope: r, forceMount: n, children: /* @__PURE__ */ a.jsx(H, { present: n || c.open, children: /* @__PURE__ */ a.jsx(En, { asChild: !0, container: o, children: t }) }) }); }; Re.displayName = te; var _ = "MenuContent", [Jn, oe] = j(_), Ce = s.forwardRef( (e, r) => { const n = je(_, e.__scopeMenu), { forceMount: t = n.forceMount, ...o } = e, c = R(_, e.__scopeMenu), l = K(_, e.__scopeMenu); return /* @__PURE__ */ a.jsx(F.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ a.jsx(H, { present: t || c.open, children: /* @__PURE__ */ a.jsx(F.Slot, { scope: e.__scopeMenu, children: l.modal ? /* @__PURE__ */ a.jsx(er, { ...o, ref: r }) : /* @__PURE__ */ a.jsx(nr, { ...o, ref: r }) }) }) }); } ), er = s.forwardRef( (e, r) => { const n = R(_, e.__scopeMenu), t = s.useRef(null), o = A(r, t); return s.useEffect(() => { const c = t.current; if (c) return Tn(c); }, []), /* @__PURE__ */ a.jsx( ae, { ...e, ref: o, trapFocus: n.open, disableOutsidePointerEvents: n.open, disableOutsideScroll: !0, onFocusOutside: h( e.onFocusOutside, (c) => c.preventDefault(), { checkForDefaultPrevented: !1 } ), onDismiss: () => n.onOpenChange(!1) } ); } ), nr = s.forwardRef((e, r) => { const n = R(_, e.__scopeMenu); return /* @__PURE__ */ a.jsx( ae, { ...e, ref: r, trapFocus: !1, disableOutsidePointerEvents: !1, disableOutsideScroll: !1, onDismiss: () => n.onOpenChange(!1) } ); }), rr = jn("MenuContent.ScrollLock"), ae = s.forwardRef( (e, r) => { const { __scopeMenu: n, loop: t = !1, trapFocus: o, onOpenAutoFocus: c, onCloseAutoFocus: l, disableOutsidePointerEvents: d, onEntryFocus: m, onEscapeKeyDown: w, onPointerDownOutside: p, onFocusOutside: u, onInteractOutside: f, onDismiss: g, disableOutsideScroll: v, ...C } = e, N = R(_, n), I = K(_, n), G = Q(n), z = be(n), de = Wn(n), [vn, ie] = s.useState(null), U = s.useRef(null), hn = A(r, U, N.onContentChange), V = s.useRef(0), B = s.useRef(""), wn = s.useRef(0), J = s.useRef(null), le = s.useRef("right"), ee = s.useRef(0), gn = v ? Fn : s.Fragment, xn = v ? { as: rr, allowPinchZoom: !0 } : void 0, yn = (i) => { var x, M; const P = B.current + i, E = de().filter((b) => !b.disabled), X = document.activeElement, T = (x = E.find((b) => b.ref.current === X)) == null ? void 0 : x.textValue, _n = E.map((b) => b.textValue), Mn = mr(_n, P, T), pe = (M = E.find((b) => b.textValue === Mn)) == null ? void 0 : M.ref.current; (function b(fe) { B.current = fe, window.clearTimeout(V.current), fe !== "" && (V.current = window.setTimeout(() => b(""), 1e3)); })(P), pe && setTimeout(() => pe.focus()); }; s.useEffect(() => () => window.clearTimeout(V.current), []), Sn(); const k = s.useCallback((i) => { var x, M; return le.current === ((x = J.current) == null ? void 0 : x.side) && hr(i, (M = J.current) == null ? void 0 : M.area); }, []); return /* @__PURE__ */ a.jsx( Jn, { scope: n, searchRef: B, onItemEnter: s.useCallback( (i) => { k(i) && i.preventDefault(); }, [k] ), onItemLeave: s.useCallback( (i) => { var x; k(i) || ((x = U.current) == null || x.focus(), ie(null)); }, [k] ), onTriggerLeave: s.useCallback( (i) => { k(i) && i.preventDefault(); }, [k] ), pointerGraceTimerRef: wn, onPointerGraceIntentChange: s.useCallback((i) => { J.current = i; }, []), children: /* @__PURE__ */ a.jsx(gn, { ...xn, children: /* @__PURE__ */ a.jsx( $n, { asChild: !0, trapped: o, onMountAutoFocus: h(c, (i) => { var x; i.preventDefault(), (x = U.current) == null || x.focus({ preventScroll: !0 }); }), onUnmountAutoFocus: l, children: /* @__PURE__ */ a.jsx( Rn, { asChild: !0, disableOutsidePointerEvents: d, onEscapeKeyDown: w, onPointerDownOutside: p, onFocusOutside: u, onInteractOutside: f, onDismiss: g, children: /* @__PURE__ */ a.jsx( On, { asChild: !0, ...z, dir: I.dir, orientation: "vertical", loop: t, currentTabStopId: vn, onCurrentTabStopIdChange: ie, onEntryFocus: h(m, (i) => { I.isUsingKeyboardRef.current || i.preventDefault(); }), preventScrollOnEntryFocus: !0, children: /* @__PURE__ */ a.jsx( Kn, { role: "menu", "aria-orientation": "vertical", "data-state": Ue(N.open), "data-radix-menu-content": "", dir: I.dir, ...G, ...C, ref: hn, style: { outline: "none", ...C.style }, onKeyDown: h(C.onKeyDown, (i) => { const x = i.target.closest("[data-radix-menu-content]") === i.currentTarget, M = i.ctrlKey || i.altKey || i.metaKey, P = i.key.length === 1; x && (i.key === "Tab" && i.preventDefault(), !M && P && yn(i.key)); const E = U.current; if (i.target !== E || !Vn.includes(i.key)) return; i.preventDefault(); const X = de().filter((T) => !T.disabled).map((T) => T.ref.current); _e.includes(i.key) && X.reverse(), pr(X); }), onBlur: h(e.onBlur, (i) => { i.currentTarget.contains(i.target) || (window.clearTimeout(V.current), B.current = ""); }), onPointerMove: h( e.onPointerMove, $((i) => { const x = i.target, M = ee.current !== i.clientX; if (i.currentTarget.contains(x) && M) { const P = i.clientX > ee.current ? "right" : "left"; le.current = P, ee.current = i.clientX; } }) ) } ) } ) } ) } ) }) } ); } ); Ce.displayName = _; var tr = "MenuGroup", se = s.forwardRef( (e, r) => { const { __scopeMenu: n, ...t } = e; return /* @__PURE__ */ a.jsx(O.div, { role: "group", ...t, ref: r }); } ); se.displayName = tr; var or = "MenuLabel", Ne = s.forwardRef( (e, r) => { const { __scopeMenu: n, ...t } = e; return /* @__PURE__ */ a.jsx(O.div, { ...t, ref: r }); } ); Ne.displayName = or; var W = "MenuItem", ve = "menu.itemSelect", Y = s.forwardRef( (e, r) => { const { disabled: n = !1, onSelect: t, ...o } = e, c = s.useRef(null), l = K(W, e.__scopeMenu), d = oe(W, e.__scopeMenu), m = A(r, c), w = s.useRef(!1), p = () => { const u = c.current; if (!n && u) { const f = new CustomEvent(ve, { bubbles: !0, cancelable: !0 }); u.addEventListener(ve, (g) => t == null ? void 0 : t(g), { once: !0 }), Dn(u, f), f.defaultPrevented ? w.current = !1 : l.onClose(); } }; return /* @__PURE__ */ a.jsx( ke, { ...o, ref: m, disabled: n, onClick: h(e.onClick, p), onPointerDown: (u) => { var f; (f = e.onPointerDown) == null || f.call(e, u), w.current = !0; }, onPointerUp: h(e.onPointerUp, (u) => { var f; w.current || (f = u.currentTarget) == null || f.click(); }), onKeyDown: h(e.onKeyDown, (u) => { const f = d.searchRef.current !== ""; n || f && u.key === " " || ne.includes(u.key) && (u.currentTarget.click(), u.preventDefault()); }) } ); } ); Y.displayName = W; var ke = s.forwardRef( (e, r) => { const { __scopeMenu: n, disabled: t = !1, textValue: o, ...c } = e, l = oe(W, n), d = be(n), m = s.useRef(null), w = A(r, m), [p, u] = s.useState(!1), [f, g] = s.useState(""); return s.useEffect(() => { const v = m.current; v && g((v.textContent ?? "").trim()); }, [c.children]), /* @__PURE__ */ a.jsx( F.ItemSlot, { scope: n, disabled: t, textValue: o ?? f, children: /* @__PURE__ */ a.jsx(Pn, { asChild: !0, ...d, focusable: !t, children: /* @__PURE__ */ a.jsx( O.div, { role: "menuitem", "data-highlighted": p ? "" : void 0, "aria-disabled": t || void 0, "data-disabled": t ? "" : void 0, ...c, ref: w, onPointerMove: h( e.onPointerMove, $((v) => { t ? l.onItemLeave(v) : (l.onItemEnter(v), v.defaultPrevented || v.currentTarget.focus({ preventScroll: !0 })); }) ), onPointerLeave: h( e.onPointerLeave, $((v) => l.onItemLeave(v)) ), onFocus: h(e.onFocus, () => u(!0)), onBlur: h(e.onBlur, () => u(!1)) } ) }) } ); } ), ar = "MenuCheckboxItem", Pe = s.forwardRef( (e, r) => { const { checked: n = !1, onCheckedChange: t, ...o } = e; return /* @__PURE__ */ a.jsx(Se, { scope: e.__scopeMenu, checked: n, children: /* @__PURE__ */ a.jsx( Y, { role: "menuitemcheckbox", "aria-checked": q(n) ? "mixed" : n, ...o, ref: r, "data-state": ue(n), onSelect: h( o.onSelect, () => t == null ? void 0 : t(q(n) ? !0 : !n), { checkForDefaultPrevented: !1 } ) } ) }); } ); Pe.displayName = ar; var Oe = "MenuRadioGroup", [sr, cr] = j( Oe, { value: void 0, onValueChange: () => { } } ), Ie = s.forwardRef( (e, r) => { const { value: n, onValueChange: t, ...o } = e, c = ge(t); return /* @__PURE__ */ a.jsx(sr, { scope: e.__scopeMenu, value: n, onValueChange: c, children: /* @__PURE__ */ a.jsx(se, { ...o, ref: r }) }); } ); Ie.displayName = Oe; var Ee = "MenuRadioItem", Te = s.forwardRef( (e, r) => { const { value: n, ...t } = e, o = cr(Ee, e.__scopeMenu), c = n === o.value; return /* @__PURE__ */ a.jsx(Se, { scope: e.__scopeMenu, checked: c, children: /* @__PURE__ */ a.jsx( Y, { role: "menuitemradio", "aria-checked": c, ...t, ref: r, "data-state": ue(c), onSelect: h( t.onSelect, () => { var l; return (l = o.onValueChange) == null ? void 0 : l.call(o, n); }, { checkForDefaultPrevented: !1 } ) } ) }); } ); Te.displayName = Ee; var ce = "MenuItemIndicator", [Se, ur] = j( ce, { checked: !1 } ), Fe = s.forwardRef( (e, r) => { const { __scopeMenu: n, forceMount: t, ...o } = e, c = ur(ce, n); return /* @__PURE__ */ a.jsx( H, { present: t || q(c.checked) || c.checked === !0, children: /* @__PURE__ */ a.jsx( O.span, { ...o, ref: r, "data-state": ue(c.checked) } ) } ); } ); Fe.displayName = ce; var dr = "MenuSeparator", $e = s.forwardRef( (e, r) => { const { __scopeMenu: n, ...t } = e; return /* @__PURE__ */ a.jsx( O.div, { role: "separator", "aria-orientation": "horizontal", ...t, ref: r } ); } ); $e.displayName = dr; var ir = "MenuArrow", Ae = s.forwardRef( (e, r) => { const { __scopeMenu: n, ...t } = e, o = Q(n); return /* @__PURE__ */ a.jsx(Gn, { ...o, ...t, ref: r }); } ); Ae.displayName = ir; var lr = "MenuSub", [pt, Le] = j(lr), S = "MenuSubTrigger", Ke = s.forwardRef( (e, r) => { const n = R(S, e.__scopeMenu), t = K(S, e.__scopeMenu), o = Le(S, e.__scopeMenu), c = oe(S, e.__scopeMenu), l = s.useRef(null), { pointerGraceTimerRef: d, onPointerGraceIntentChange: m } = c, w = { __scopeMenu: e.__scopeMenu }, p = s.useCallback(() => { l.current && window.clearTimeout(l.current), l.current = null; }, []); return s.useEffect(() => p, [p]), s.useEffect(() => { const u = d.current; return () => { window.clearTimeout(u), m(null); }; }, [d, m]), /* @__PURE__ */ a.jsx(re, { asChild: !0, ...w, children: /* @__PURE__ */ a.jsx( ke, { id: o.triggerId, "aria-haspopup": "menu", "aria-expanded": n.open, "aria-controls": o.contentId, "data-state": Ue(n.open), ...e, ref: we(r, o.onTriggerChange), onClick: (u) => { var f; (f = e.onClick) == null || f.call(e, u), !(e.disabled || u.defaultPrevented) && (u.currentTarget.focus(), n.open || n.onOpenChange(!0)); }, onPointerMove: h( e.onPointerMove, $((u) => { c.onItemEnter(u), !u.defaultPrevented && !e.disabled && !n.open && !l.current && (c.onPointerGraceIntentChange(null), l.current = window.setTimeout(() => { n.onOpenChange(!0), p(); }, 100)); }) ), onPointerLeave: h( e.onPointerLeave, $((u) => { var f, g; p(); const v = (f = n.content) == null ? void 0 : f.getBoundingClientRect(); if (v) { const C = (g = n.content) == null ? void 0 : g.dataset.side, N = C === "right", I = N ? -5 : 5, G = v[N ? "left" : "right"], z = v[N ? "right" : "left"]; c.onPointerGraceIntentChange({ area: [ // Apply a bleed on clientX to ensure that our exit point is // consistently within polygon bounds { x: u.clientX + I, y: u.clientY }, { x: G, y: v.top }, { x: z, y: v.top }, { x: z, y: v.bottom }, { x: G, y: v.bottom } ], side: C }), window.clearTimeout(d.current), d.current = window.setTimeout( () => c.onPointerGraceIntentChange(null), 300 ); } else { if (c.onTriggerLeave(u), u.defaultPrevented) return; c.onPointerGraceIntentChange(null); } }) ), onKeyDown: h(e.onKeyDown, (u) => { var f; const g = c.searchRef.current !== ""; e.disabled || g && u.key === " " || Bn[t.dir].includes(u.key) && (n.onOpenChange(!0), (f = n.content) == null || f.focus(), u.preventDefault()); }) } ) }); } ); Ke.displayName = S; var Ge = "MenuSubContent", ze = s.forwardRef( (e, r) => { const n = je(_, e.__scopeMenu), { forceMount: t = n.forceMount, ...o } = e, c = R(_, e.__scopeMenu), l = K(_, e.__scopeMenu), d = Le(Ge, e.__scopeMenu), m = s.useRef(null), w = A(r, m); return /* @__PURE__ */ a.jsx(F.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ a.jsx(H, { present: t || c.open, children: /* @__PURE__ */ a.jsx(F.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ a.jsx( ae, { id: d.contentId, "aria-labelledby": d.triggerId, ...o, ref: w, align: "start", side: l.dir === "rtl" ? "left" : "right", disableOutsidePointerEvents: !1, disableOutsideScroll: !1, trapFocus: !1, onOpenAutoFocus: (p) => { var u; l.isUsingKeyboardRef.current && ((u = m.current) == null || u.focus()), p.preventDefault(); }, onCloseAutoFocus: (p) => p.preventDefault(), onFocusOutside: h(e.onFocusOutside, (p) => { p.target !== d.trigger && c.onOpenChange(!1); }), onEscapeKeyDown: h(e.onEscapeKeyDown, (p) => { l.onClose(), p.preventDefault(); }), onKeyDown: h(e.onKeyDown, (p) => { var u; const f = p.currentTarget.contains(p.target), g = Xn[l.dir].includes(p.key); f && g && (c.onOpenChange(!1), (u = d.trigger) == null || u.focus(), p.preventDefault()); }) } ) }) }) }); } ); ze.displayName = Ge; function Ue(e) { return e ? "open" : "closed"; } function q(e) { return e === "indeterminate"; } function ue(e) { return q(e) ? "indeterminate" : e ? "checked" : "unchecked"; } function pr(e) { const r = document.activeElement; for (const n of e) if (n === r || (n.focus(), document.activeElement !== r)) return; } function fr(e, r) { return e.map((n, t) => e[(r + t) % e.length]); } function mr(e, r, n) { const t = r.length > 1 && Array.from(r).every((d) => d === r[0]) ? r[0] : r, o = n ? e.indexOf(n) : -1; let c = fr(e, Math.max(o, 0)); t.length === 1 && (c = c.filter((d) => d !== n)); const l = c.find( (d) => d.toLowerCase().startsWith(t.toLowerCase()) ); return l !== n ? l : void 0; } function vr(e, r) { const { x: n, y: t } = e; let o = !1; for (let c = 0, l = r.length - 1; c < r.length; l = c++) { const d = r[c], m = r[l], w = d.x, p = d.y, u = m.x, f = m.y; p > t != f > t && n < (u - w) * (t - p) / (f - p) + w && (o = !o); } return o; } function hr(e, r) { if (!r) return !1; const n = { x: e.clientX, y: e.clientY }; return vr(n, r); } function $(e) { return (r) => r.pointerType === "mouse" ? e(r) : void 0; } var wr = De, gr = re, xr = Re, yr = Ce, _r = se, Mr = Ne, br = Y, Dr = Pe, jr = Ie, Rr = Te, Cr = Fe, Nr = $e, kr = Ae, Pr = Ke, Or = ze, Z = "DropdownMenu", [Ir, ft] = he( Z, [Me] ), y = Me(), [Er, Ve] = Ir(Z), Be = (e) => { const { __scopeDropdownMenu: r, children: n, dir: t, open: o, defaultOpen: c, onOpenChange: l, modal: d = !0 } = e, m = y(r), w = s.useRef(null), [p, u] = bn({ prop: o, defaultProp: c ?? !1, onChange: l, caller: Z }); return /* @__PURE__ */ a.jsx( Er, { scope: r, triggerId: me(), triggerRef: w, contentId: me(), open: p, onOpenChange: u, onOpenToggle: s.useCallback(() => u((f) => !f), [u]), modal: d, children: /* @__PURE__ */ a.jsx(wr, { ...m, open: p, onOpenChange: u, dir: t, modal: d, children: n }) } ); }; Be.displayName = Z; var Xe = "DropdownMenuTrigger", We = s.forwardRef( (e, r) => { const { __scopeDropdownMenu: n, disabled: t = !1, ...o } = e, c = Ve(Xe, n), l = y(n); return /* @__PURE__ */ a.jsx(gr, { asChild: !0, ...l, children: /* @__PURE__ */ a.jsx( O.button, { type: "button", id: c.triggerId, "aria-haspopup": "menu", "aria-expanded": c.open, "aria-controls": c.open ? c.contentId : void 0, "data-state": c.open ? "open" : "closed", "data-disabled": t ? "" : void 0, disabled: t, ...o, ref: we(r, c.triggerRef), onPointerDown: h(e.onPointerDown, (d) => { !t && d.button === 0 && d.ctrlKey === !1 && (c.onOpenToggle(), c.open || d.preventDefault()); }), onKeyDown: h(e.onKeyDown, (d) => { t || (["Enter", " "].includes(d.key) && c.onOpenToggle(), d.key === "ArrowDown" && c.onOpenChange(!0), ["Enter", " ", "ArrowDown"].includes(d.key) && d.preventDefault()); }) } ) }); } ); We.displayName = Xe; var Tr = "DropdownMenuPortal", qe = (e) => { const { __scopeDropdownMenu: r, ...n } = e, t = y(r); return /* @__PURE__ */ a.jsx(xr, { ...t, ...n }); }; qe.displayName = Tr; var He = "DropdownMenuContent", Qe = s.forwardRef( (e, r) => { const { __scopeDropdownMenu: n, ...t } = e, o = Ve(He, n), c = y(n), l = s.useRef(!1); return /* @__PURE__ */ a.jsx( yr, { id: o.contentId, "aria-labelledby": o.triggerId, ...c, ...t, ref: r, onCloseAutoFocus: h(e.onCloseAutoFocus, (d) => { var m; l.current || (m = o.triggerRef.current) == null || m.focus(), l.current = !1, d.preventDefault(); }), onInteractOutside: h(e.onInteractOutside, (d) => { const m = d.detail.originalEvent, w = m.button === 0 && m.ctrlKey === !0, p = m.button === 2 || w; (!o.modal || p) && (l.current = !0); }), style: { ...e.style, "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)", "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)", "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)", "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)", "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)" } } ); } ); Qe.displayName = He; var Sr = "DropdownMenuGroup", Fr = s.forwardRef( (e, r) => { const { __scopeDropdownMenu: n, ...t } = e, o = y(n); return /* @__PURE__ */ a.jsx(_r, { ...o, ...t, ref: r }); } ); Fr.displayName = Sr; var $r = "DropdownMenuLabel", Ye = s.forwardRef( (e, r) => { const { __scopeDropdownMenu: n, ...t } = e, o = y(n); return /* @__PURE__ */ a.jsx(Mr, { ...o, ...t, ref: r }); } ); Ye.displayName = $r; var Ar = "DropdownMenuItem", Ze = s.forwardRef( (e, r) => { const { __scopeDropdownMenu: n, ...t } = e, o = y(n); return /* @__PURE__ */ a.jsx(br, { ...o, ...t, ref: r }); } ); Ze.displayName = Ar; var Lr = "DropdownMenuCheckboxItem", Je = s.forwardRef((e, r) => { const { __scopeDropdownMenu: n, ...t } = e, o = y(n); return /* @__PURE__ */ a.jsx(Dr, { ...o, ...t, ref: r }); }); Je.displayName = Lr; var Kr = "DropdownMenuRadioGroup", Gr = s.forwardRef((e, r) => { const { __scopeDropdownMenu: n, ...t } = e, o = y(n); return /* @__PURE__ */ a.jsx(jr, { ...o, ...t, ref: r }); }); Gr.displayName = Kr; var zr = "DropdownMenuRadioItem", en = s.forwardRef((e, r) => { const { __scopeDropdownMenu: n, ...t } = e, o = y(n); return /* @__PURE__ */ a.jsx(Rr, { ...o, ...t, ref: r }); }); en.displayName = zr; var Ur = "DropdownMenuItemIndicator", nn = s.forwardRef((e, r) => { const { __scopeDropdownMenu: n, ...t } = e, o = y(n); return /* @__PURE__ */ a.jsx(Cr, { ...o, ...t, ref: r }); }); nn.displayName = Ur; var Vr = "DropdownMenuSeparator", rn = s.forwardRef((e, r) => { const { __scopeDropdownMenu: n, ...t } = e, o = y(n); return /* @__PURE__ */ a.jsx(Nr, { ...o, ...t, ref: r }); }); rn.displayName = Vr; var Br = "DropdownMenuArrow", Xr = s.forwardRef( (e, r) => { const { __scopeDropdownMenu: n, ...t } = e, o = y(n); return /* @__PURE__ */ a.jsx(kr, { ...o, ...t, ref: r }); } ); Xr.displayName = Br; var Wr = "DropdownMenuSubTrigger", tn = s.forwardRef((e, r) => { const { __scopeDropdownMenu: n, ...t } = e, o = y(n); return /* @__PURE__ */ a.jsx(Pr, { ...o, ...t, ref: r }); }); tn.displayName = Wr; var qr = "DropdownMenuSubContent", on = s.forwardRef((e, r) => { const { __scopeDropdownMenu: n, ...t } = e, o = y(n); return /* @__PURE__ */ a.jsx( Or, { ...o, ...t, ref: r, style: { ...e.style, "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)", "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)", "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)", "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)", "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)" } } ); }); on.displayName = qr; var Hr = Be, Qr = We, Yr = qe, an = Qe, sn = Ye, cn = Ze, un = Je, dn = en, ln = nn, pn = rn, fn = tn, mn = on; const mt = Hr, vt = Qr, Zr = s.forwardRef(({ className: e, inset: r, children: n, ...t }, o) => /* @__PURE__ */ a.jsxs( fn, { ref: o, className: D( "focus:bg-accent data-[state=open]:bg-accent flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", r && "pl-8", e ), ...t, children: [ n, /* @__PURE__ */ a.jsx(zn, { className: "ml-auto" }) ] } )); Zr.displayName = fn.displayName; const Jr = s.forwardRef(({ className: e, ...r }, n) => /* @__PURE__ */ a.jsx( mn, { ref: n, className: D( "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg", e ), ...r } )); Jr.displayName = mn.displayName; const et = s.forwardRef(({ className: e, sideOffset: r = 4, ...n }, t) => /* @__PURE__ */ a.jsx(Yr, { children: /* @__PURE__ */ a.jsx( an, { ref: t, sideOffset: r, className: D( "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md", e ), ...n } ) })); et.displayName = an.displayName; const nt = s.forwardRef(({ className: e, inset: r, ...n }, t) => /* @__PURE__ */ a.jsx( cn, { ref: t, className: D( "focus:bg-accent focus:text-accent-foreground relative flex cursor-default cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", r && "pl-8", e ), ...n } )); nt.displayName = cn.displayName; const rt = s.forwardRef(({ className: e, children: r, checked: n, ...t }, o) => /* @__PURE__ */ a.jsxs( un, { ref: o, className: D( "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50", e ), checked: n, ...t, children: [ /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(ln, { children: /* @__PURE__ */ a.jsx(Cn, { className: "h-4 w-4" }) }) }), r ] } )); rt.displayName = un.displayName; const tt = s.forwardRef(({ className: e, children: r, ...n }, t) => /* @__PURE__ */ a.jsxs( dn, { ref: t, className: D( "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50", e ), ...n, children: [ /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(ln, { children: /* @__PURE__ */ a.jsx(In, { className: "h-2 w-2 fill-current" }) }) }), r ] } )); tt.displayName = dn.displayName; const ot = s.forwardRef(({ className: e, inset: r, ...n }, t) => /* @__PURE__ */ a.jsx( sn, { ref: t, className: D( "px-2 py-1.5 text-sm font-semibold", r && "pl-8", e ), ...n } )); ot.displayName = sn.displayName; const at = s.forwardRef(({ className: e, ...r }, n) => /* @__PURE__ */ a.jsx( pn, { ref: n, className: D("bg-muted -mx-1 my-1 h-px", e), ...r } )); at.displayName = pn.displayName; export { vt as A, mt as T, rt as d, at as f, et as i, nt as u };