UNPKG

@stanfordspezi/spezi-web-design-system

Version:

Stanford Biodesign Digital Health Spezi Web Design System

995 lines (994 loc) 32.6 kB
import { jsx as a, jsxs as ne } from "react/jsx-runtime"; import { c as R } from "./index-2NvaPZWc.mjs"; import bn from "./check-BND_cTIg.mjs"; import Dn from "./circle-DIaa1tjX.mjs"; import Sn from "./chevron-right-DwA2ExUr.mjs"; import * as s from "react"; import { c as M } from "./index-hURUNS5V.mjs"; import { c as oe, u as L, b as ge } from "./index-D2LZVjSn.mjs"; import { c as we } from "./index-DFZozV_h.mjs"; import { u as Ce } from "./index-DOCb3WPZ.mjs"; import * as xn from "react-dom"; import { c as Pn } from "./index-Bj70Jptv.mjs"; import { u as In } from "./index-ByaXH_ih.mjs"; import { P as yn, D as En } from "./index-DJ6gB4bU.mjs"; import { h as Nn, u as Tn, R as On, F as An } from "./index-dzIOViH8.mjs"; import { u as z } from "./index-C3vaq8Fy.mjs"; import { R as _e, a as kn, c as Re, C as Ln, A as Gn } from "./index-Ba44uSOb.mjs"; import { P as Y } from "./index-DlW0DMEl.mjs"; import { c as be, I as Fn, R as $n } from "./index-CY3wvfXq.mjs"; import { u as te } from "./index-0ioNhtNM.mjs"; var Kn = [ "a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "select", "span", "svg", "ul" ], G = Kn.reduce((e, n) => { const o = oe(`Primitive.${n}`), t = s.forwardRef((r, c) => { const { asChild: i, ...d } = r, f = i ? o : n; return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ a(f, { ...d, ref: c }); }); return t.displayName = `Primitive.${n}`, { ...e, [n]: t }; }, {}); function Un(e, n) { e && xn.flushSync(() => e.dispatchEvent(n)); } var ee = ["Enter", " "], Bn = ["ArrowDown", "PageUp", "Home"], De = ["ArrowUp", "PageDown", "End"], Vn = [...Bn, ...De], zn = { ltr: [...ee, "ArrowRight"], rtl: [...ee, "ArrowLeft"] }, jn = { ltr: ["ArrowLeft"], rtl: ["ArrowRight"] }, F = "Menu", [A, Xn, Yn] = Pn(F), [S, Se] = we(F, [ Yn, Re, be ]), $ = Re(), xe = be(), [Pe, b] = S(F), [Hn, K] = S(F), Ie = (e) => { const { __scopeMenu: n, open: o = !1, children: t, dir: r, onOpenChange: c, modal: i = !0 } = e, d = $(n), [f, m] = s.useState(null), p = s.useRef(!1), u = te(c), v = In(r); return s.useEffect(() => { const C = () => { p.current = !0, document.addEventListener("pointerdown", h, { capture: !0, once: !0 }), document.addEventListener("pointermove", h, { capture: !0, once: !0 }); }, h = () => p.current = !1; return document.addEventListener("keydown", C, { capture: !0 }), () => { document.removeEventListener("keydown", C, { capture: !0 }), document.removeEventListener("pointerdown", h, { capture: !0 }), document.removeEventListener("pointermove", h, { capture: !0 }); }; }, []), /* @__PURE__ */ a(_e, { ...d, children: /* @__PURE__ */ a( Pe, { scope: n, open: o, onOpenChange: u, content: f, onContentChange: m, children: /* @__PURE__ */ a( Hn, { scope: n, onClose: s.useCallback(() => u(!1), [u]), isUsingKeyboardRef: p, dir: v, modal: i, children: t } ) } ) }); }; Ie.displayName = F; var Wn = "MenuAnchor", re = s.forwardRef( (e, n) => { const { __scopeMenu: o, ...t } = e, r = $(o); return /* @__PURE__ */ a(kn, { ...r, ...t, ref: n }); } ); re.displayName = Wn; var ae = "MenuPortal", [Zn, ye] = S(ae, { forceMount: void 0 }), Ee = (e) => { const { __scopeMenu: n, forceMount: o, children: t, container: r } = e, c = b(ae, n); return /* @__PURE__ */ a(Zn, { scope: n, forceMount: o, children: /* @__PURE__ */ a(Y, { present: o || c.open, children: /* @__PURE__ */ a(yn, { asChild: !0, container: r, children: t }) }) }); }; Ee.displayName = ae; var _ = "MenuContent", [qn, ce] = S(_), Ne = s.forwardRef( (e, n) => { const o = ye(_, e.__scopeMenu), { forceMount: t = o.forceMount, ...r } = e, c = b(_, e.__scopeMenu), i = K(_, e.__scopeMenu); return /* @__PURE__ */ a(A.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ a(Y, { present: t || c.open, children: /* @__PURE__ */ a(A.Slot, { scope: e.__scopeMenu, children: i.modal ? /* @__PURE__ */ a(Jn, { ...r, ref: n }) : /* @__PURE__ */ a(Qn, { ...r, ref: n }) }) }) }); } ), Jn = s.forwardRef( (e, n) => { const o = b(_, e.__scopeMenu), t = s.useRef(null), r = L(n, t); return s.useEffect(() => { const c = t.current; if (c) return Nn(c); }, []), /* @__PURE__ */ a( se, { ...e, ref: r, trapFocus: o.open, disableOutsidePointerEvents: o.open, disableOutsideScroll: !0, onFocusOutside: M( e.onFocusOutside, (c) => c.preventDefault(), { checkForDefaultPrevented: !1 } ), onDismiss: () => o.onOpenChange(!1) } ); } ), Qn = s.forwardRef((e, n) => { const o = b(_, e.__scopeMenu); return /* @__PURE__ */ a( se, { ...e, ref: n, trapFocus: !1, disableOutsidePointerEvents: !1, disableOutsideScroll: !1, onDismiss: () => o.onOpenChange(!1) } ); }), eo = oe("MenuContent.ScrollLock"), se = s.forwardRef( (e, n) => { const { __scopeMenu: o, loop: t = !1, trapFocus: r, onOpenAutoFocus: c, onCloseAutoFocus: i, disableOutsidePointerEvents: d, onEntryFocus: f, onEscapeKeyDown: m, onPointerDownOutside: p, onFocusOutside: u, onInteractOutside: v, onDismiss: C, disableOutsideScroll: h, ...x } = e, E = b(_, o), P = K(_, o), vn = $(o), Mn = xe(o), pe = Xn(o), [hn, fe] = s.useState(null), U = s.useRef(null), gn = L(n, U, E.onContentChange), B = s.useRef(0), V = s.useRef(""), wn = s.useRef(0), Z = s.useRef(null), me = s.useRef("right"), q = s.useRef(0), Cn = h ? On : s.Fragment, _n = h ? { as: eo, allowPinchZoom: !0 } : void 0, Rn = (l) => { const y = V.current + l, D = pe().filter((w) => !w.disabled), N = document.activeElement, J = D.find((w) => w.ref.current === N)?.textValue, Q = D.map((w) => w.textValue), ve = fo(Q, y, J), T = D.find((w) => w.textValue === ve)?.ref.current; (function w(Me) { V.current = Me, window.clearTimeout(B.current), Me !== "" && (B.current = window.setTimeout(() => w(""), 1e3)); })(y), T && setTimeout(() => T.focus()); }; s.useEffect(() => () => window.clearTimeout(B.current), []), Tn(); const I = s.useCallback((l) => me.current === Z.current?.side && vo(l, Z.current?.area), []); return /* @__PURE__ */ a( qn, { scope: o, searchRef: V, onItemEnter: s.useCallback( (l) => { I(l) && l.preventDefault(); }, [I] ), onItemLeave: s.useCallback( (l) => { I(l) || (U.current?.focus(), fe(null)); }, [I] ), onTriggerLeave: s.useCallback( (l) => { I(l) && l.preventDefault(); }, [I] ), pointerGraceTimerRef: wn, onPointerGraceIntentChange: s.useCallback((l) => { Z.current = l; }, []), children: /* @__PURE__ */ a(Cn, { ..._n, children: /* @__PURE__ */ a( An, { asChild: !0, trapped: r, onMountAutoFocus: M(c, (l) => { l.preventDefault(), U.current?.focus({ preventScroll: !0 }); }), onUnmountAutoFocus: i, children: /* @__PURE__ */ a( En, { asChild: !0, disableOutsidePointerEvents: d, onEscapeKeyDown: m, onPointerDownOutside: p, onFocusOutside: u, onInteractOutside: v, onDismiss: C, children: /* @__PURE__ */ a( $n, { asChild: !0, ...Mn, dir: P.dir, orientation: "vertical", loop: t, currentTabStopId: hn, onCurrentTabStopIdChange: fe, onEntryFocus: M(f, (l) => { P.isUsingKeyboardRef.current || l.preventDefault(); }), preventScrollOnEntryFocus: !0, children: /* @__PURE__ */ a( Ln, { role: "menu", "aria-orientation": "vertical", "data-state": He(E.open), "data-radix-menu-content": "", dir: P.dir, ...vn, ...x, ref: gn, style: { outline: "none", ...x.style }, onKeyDown: M(x.onKeyDown, (l) => { const D = l.target.closest("[data-radix-menu-content]") === l.currentTarget, N = l.ctrlKey || l.altKey || l.metaKey, J = l.key.length === 1; D && (l.key === "Tab" && l.preventDefault(), !N && J && Rn(l.key)); const Q = U.current; if (l.target !== Q || !Vn.includes(l.key)) return; l.preventDefault(); const T = pe().filter((w) => !w.disabled).map((w) => w.ref.current); De.includes(l.key) && T.reverse(), lo(T); }), onBlur: M(e.onBlur, (l) => { l.currentTarget.contains(l.target) || (window.clearTimeout(B.current), V.current = ""); }), onPointerMove: M( e.onPointerMove, k((l) => { const y = l.target, D = q.current !== l.clientX; if (l.currentTarget.contains(y) && D) { const N = l.clientX > q.current ? "right" : "left"; me.current = N, q.current = l.clientX; } }) ) } ) } ) } ) } ) }) } ); } ); Ne.displayName = _; var no = "MenuGroup", ue = s.forwardRef( (e, n) => { const { __scopeMenu: o, ...t } = e; return /* @__PURE__ */ a(G.div, { role: "group", ...t, ref: n }); } ); ue.displayName = no; var oo = "MenuLabel", Te = s.forwardRef( (e, n) => { const { __scopeMenu: o, ...t } = e; return /* @__PURE__ */ a(G.div, { ...t, ref: n }); } ); Te.displayName = oo; var j = "MenuItem", he = "menu.itemSelect", H = s.forwardRef( (e, n) => { const { disabled: o = !1, onSelect: t, ...r } = e, c = s.useRef(null), i = K(j, e.__scopeMenu), d = ce(j, e.__scopeMenu), f = L(n, c), m = s.useRef(!1), p = () => { const u = c.current; if (!o && u) { const v = new CustomEvent(he, { bubbles: !0, cancelable: !0 }); u.addEventListener(he, (C) => t?.(C), { once: !0 }), Un(u, v), v.defaultPrevented ? m.current = !1 : i.onClose(); } }; return /* @__PURE__ */ a( Oe, { ...r, ref: f, disabled: o, onClick: M(e.onClick, p), onPointerDown: (u) => { e.onPointerDown?.(u), m.current = !0; }, onPointerUp: M(e.onPointerUp, (u) => { m.current || u.currentTarget?.click(); }), onKeyDown: M(e.onKeyDown, (u) => { const v = d.searchRef.current !== ""; o || v && u.key === " " || ee.includes(u.key) && (u.currentTarget.click(), u.preventDefault()); }) } ); } ); H.displayName = j; var Oe = s.forwardRef( (e, n) => { const { __scopeMenu: o, disabled: t = !1, textValue: r, ...c } = e, i = ce(j, o), d = xe(o), f = s.useRef(null), m = L(n, f), [p, u] = s.useState(!1), [v, C] = s.useState(""); return s.useEffect(() => { const h = f.current; h && C((h.textContent ?? "").trim()); }, [c.children]), /* @__PURE__ */ a( A.ItemSlot, { scope: o, disabled: t, textValue: r ?? v, children: /* @__PURE__ */ a(Fn, { asChild: !0, ...d, focusable: !t, children: /* @__PURE__ */ a( G.div, { role: "menuitem", "data-highlighted": p ? "" : void 0, "aria-disabled": t || void 0, "data-disabled": t ? "" : void 0, ...c, ref: m, onPointerMove: M( e.onPointerMove, k((h) => { t ? i.onItemLeave(h) : (i.onItemEnter(h), h.defaultPrevented || h.currentTarget.focus({ preventScroll: !0 })); }) ), onPointerLeave: M( e.onPointerLeave, k((h) => i.onItemLeave(h)) ), onFocus: M(e.onFocus, () => u(!0)), onBlur: M(e.onBlur, () => u(!1)) } ) }) } ); } ), to = "MenuCheckboxItem", Ae = s.forwardRef( (e, n) => { const { checked: o = !1, onCheckedChange: t, ...r } = e; return /* @__PURE__ */ a($e, { scope: e.__scopeMenu, checked: o, children: /* @__PURE__ */ a( H, { role: "menuitemcheckbox", "aria-checked": X(o) ? "mixed" : o, ...r, ref: n, "data-state": le(o), onSelect: M( r.onSelect, () => t?.(X(o) ? !0 : !o), { checkForDefaultPrevented: !1 } ) } ) }); } ); Ae.displayName = to; var ke = "MenuRadioGroup", [ro, ao] = S( ke, { value: void 0, onValueChange: () => { } } ), Le = s.forwardRef( (e, n) => { const { value: o, onValueChange: t, ...r } = e, c = te(t); return /* @__PURE__ */ a(ro, { scope: e.__scopeMenu, value: o, onValueChange: c, children: /* @__PURE__ */ a(ue, { ...r, ref: n }) }); } ); Le.displayName = ke; var Ge = "MenuRadioItem", Fe = s.forwardRef( (e, n) => { const { value: o, ...t } = e, r = ao(Ge, e.__scopeMenu), c = o === r.value; return /* @__PURE__ */ a($e, { scope: e.__scopeMenu, checked: c, children: /* @__PURE__ */ a( H, { role: "menuitemradio", "aria-checked": c, ...t, ref: n, "data-state": le(c), onSelect: M( t.onSelect, () => r.onValueChange?.(o), { checkForDefaultPrevented: !1 } ) } ) }); } ); Fe.displayName = Ge; var ie = "MenuItemIndicator", [$e, co] = S( ie, { checked: !1 } ), Ke = s.forwardRef( (e, n) => { const { __scopeMenu: o, forceMount: t, ...r } = e, c = co(ie, o); return /* @__PURE__ */ a( Y, { present: t || X(c.checked) || c.checked === !0, children: /* @__PURE__ */ a( G.span, { ...r, ref: n, "data-state": le(c.checked) } ) } ); } ); Ke.displayName = ie; var so = "MenuSeparator", Ue = s.forwardRef( (e, n) => { const { __scopeMenu: o, ...t } = e; return /* @__PURE__ */ a( G.div, { role: "separator", "aria-orientation": "horizontal", ...t, ref: n } ); } ); Ue.displayName = so; var uo = "MenuArrow", Be = s.forwardRef( (e, n) => { const { __scopeMenu: o, ...t } = e, r = $(o); return /* @__PURE__ */ a(Gn, { ...r, ...t, ref: n }); } ); Be.displayName = uo; var de = "MenuSub", [io, Ve] = S(de), ze = (e) => { const { __scopeMenu: n, children: o, open: t = !1, onOpenChange: r } = e, c = b(de, n), i = $(n), [d, f] = s.useState(null), [m, p] = s.useState(null), u = te(r); return s.useEffect(() => (c.open === !1 && u(!1), () => u(!1)), [c.open, u]), /* @__PURE__ */ a(_e, { ...i, children: /* @__PURE__ */ a( Pe, { scope: n, open: t, onOpenChange: u, content: m, onContentChange: p, children: /* @__PURE__ */ a( io, { scope: n, contentId: z(), triggerId: z(), trigger: d, onTriggerChange: f, children: o } ) } ) }); }; ze.displayName = de; var O = "MenuSubTrigger", je = s.forwardRef( (e, n) => { const o = b(O, e.__scopeMenu), t = K(O, e.__scopeMenu), r = Ve(O, e.__scopeMenu), c = ce(O, e.__scopeMenu), i = s.useRef(null), { pointerGraceTimerRef: d, onPointerGraceIntentChange: f } = c, m = { __scopeMenu: e.__scopeMenu }, p = s.useCallback(() => { i.current && window.clearTimeout(i.current), i.current = null; }, []); return s.useEffect(() => p, [p]), s.useEffect(() => { const u = d.current; return () => { window.clearTimeout(u), f(null); }; }, [d, f]), /* @__PURE__ */ a(re, { asChild: !0, ...m, children: /* @__PURE__ */ a( Oe, { id: r.triggerId, "aria-haspopup": "menu", "aria-expanded": o.open, "aria-controls": r.contentId, "data-state": He(o.open), ...e, ref: ge(n, r.onTriggerChange), onClick: (u) => { e.onClick?.(u), !(e.disabled || u.defaultPrevented) && (u.currentTarget.focus(), o.open || o.onOpenChange(!0)); }, onPointerMove: M( e.onPointerMove, k((u) => { c.onItemEnter(u), !u.defaultPrevented && !e.disabled && !o.open && !i.current && (c.onPointerGraceIntentChange(null), i.current = window.setTimeout(() => { o.onOpenChange(!0), p(); }, 100)); }) ), onPointerLeave: M( e.onPointerLeave, k((u) => { p(); const v = o.content?.getBoundingClientRect(); if (v) { const C = o.content?.dataset.side, h = C === "right", x = h ? -5 : 5, E = v[h ? "left" : "right"], P = v[h ? "right" : "left"]; c.onPointerGraceIntentChange({ area: [ // Apply a bleed on clientX to ensure that our exit point is // consistently within polygon bounds { x: u.clientX + x, y: u.clientY }, { x: E, y: v.top }, { x: P, y: v.top }, { x: P, y: v.bottom }, { x: E, 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: M(e.onKeyDown, (u) => { const v = c.searchRef.current !== ""; e.disabled || v && u.key === " " || zn[t.dir].includes(u.key) && (o.onOpenChange(!0), o.content?.focus(), u.preventDefault()); }) } ) }); } ); je.displayName = O; var Xe = "MenuSubContent", Ye = s.forwardRef( (e, n) => { const o = ye(_, e.__scopeMenu), { forceMount: t = o.forceMount, ...r } = e, c = b(_, e.__scopeMenu), i = K(_, e.__scopeMenu), d = Ve(Xe, e.__scopeMenu), f = s.useRef(null), m = L(n, f); return /* @__PURE__ */ a(A.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ a(Y, { present: t || c.open, children: /* @__PURE__ */ a(A.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ a( se, { id: d.contentId, "aria-labelledby": d.triggerId, ...r, ref: m, align: "start", side: i.dir === "rtl" ? "left" : "right", disableOutsidePointerEvents: !1, disableOutsideScroll: !1, trapFocus: !1, onOpenAutoFocus: (p) => { i.isUsingKeyboardRef.current && f.current?.focus(), p.preventDefault(); }, onCloseAutoFocus: (p) => p.preventDefault(), onFocusOutside: M(e.onFocusOutside, (p) => { p.target !== d.trigger && c.onOpenChange(!1); }), onEscapeKeyDown: M(e.onEscapeKeyDown, (p) => { i.onClose(), p.preventDefault(); }), onKeyDown: M(e.onKeyDown, (p) => { const u = p.currentTarget.contains(p.target), v = jn[i.dir].includes(p.key); u && v && (c.onOpenChange(!1), d.trigger?.focus(), p.preventDefault()); }) } ) }) }) }); } ); Ye.displayName = Xe; function He(e) { return e ? "open" : "closed"; } function X(e) { return e === "indeterminate"; } function le(e) { return X(e) ? "indeterminate" : e ? "checked" : "unchecked"; } function lo(e) { const n = document.activeElement; for (const o of e) if (o === n || (o.focus(), document.activeElement !== n)) return; } function po(e, n) { return e.map((o, t) => e[(n + t) % e.length]); } function fo(e, n, o) { const r = n.length > 1 && Array.from(n).every((m) => m === n[0]) ? n[0] : n, c = o ? e.indexOf(o) : -1; let i = po(e, Math.max(c, 0)); r.length === 1 && (i = i.filter((m) => m !== o)); const f = i.find( (m) => m.toLowerCase().startsWith(r.toLowerCase()) ); return f !== o ? f : void 0; } function mo(e, n) { const { x: o, y: t } = e; let r = !1; for (let c = 0, i = n.length - 1; c < n.length; i = c++) { const d = n[c], f = n[i], m = d.x, p = d.y, u = f.x, v = f.y; p > t != v > t && o < (u - m) * (t - p) / (v - p) + m && (r = !r); } return r; } function vo(e, n) { if (!n) return !1; const o = { x: e.clientX, y: e.clientY }; return mo(o, n); } function k(e) { return (n) => n.pointerType === "mouse" ? e(n) : void 0; } var Mo = Ie, ho = re, go = Ee, wo = Ne, Co = ue, _o = Te, Ro = H, bo = Ae, Do = Le, So = Fe, xo = Ke, Po = Ue, Io = Be, yo = ze, Eo = je, No = Ye, To = [ "a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "select", "span", "svg", "ul" ], Oo = To.reduce((e, n) => { const o = oe(`Primitive.${n}`), t = s.forwardRef((r, c) => { const { asChild: i, ...d } = r, f = i ? o : n; return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ a(f, { ...d, ref: c }); }); return t.displayName = `Primitive.${n}`, { ...e, [n]: t }; }, {}), W = "DropdownMenu", [Ao] = we( W, [Se] ), g = Se(), [ko, We] = Ao(W), Ze = (e) => { const { __scopeDropdownMenu: n, children: o, dir: t, open: r, defaultOpen: c, onOpenChange: i, modal: d = !0 } = e, f = g(n), m = s.useRef(null), [p, u] = Ce({ prop: r, defaultProp: c ?? !1, onChange: i, caller: W }); return /* @__PURE__ */ a( ko, { scope: n, triggerId: z(), triggerRef: m, contentId: z(), open: p, onOpenChange: u, onOpenToggle: s.useCallback(() => u((v) => !v), [u]), modal: d, children: /* @__PURE__ */ a(Mo, { ...f, open: p, onOpenChange: u, dir: t, modal: d, children: o }) } ); }; Ze.displayName = W; var qe = "DropdownMenuTrigger", Je = s.forwardRef( (e, n) => { const { __scopeDropdownMenu: o, disabled: t = !1, ...r } = e, c = We(qe, o), i = g(o); return /* @__PURE__ */ a(ho, { asChild: !0, ...i, children: /* @__PURE__ */ a( Oo.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, ...r, ref: ge(n, c.triggerRef), onPointerDown: M(e.onPointerDown, (d) => { !t && d.button === 0 && d.ctrlKey === !1 && (c.onOpenToggle(), c.open || d.preventDefault()); }), onKeyDown: M(e.onKeyDown, (d) => { t || (["Enter", " "].includes(d.key) && c.onOpenToggle(), d.key === "ArrowDown" && c.onOpenChange(!0), ["Enter", " ", "ArrowDown"].includes(d.key) && d.preventDefault()); }) } ) }); } ); Je.displayName = qe; var Lo = "DropdownMenuPortal", Qe = (e) => { const { __scopeDropdownMenu: n, ...o } = e, t = g(n); return /* @__PURE__ */ a(go, { ...t, ...o }); }; Qe.displayName = Lo; var en = "DropdownMenuContent", nn = s.forwardRef( (e, n) => { const { __scopeDropdownMenu: o, ...t } = e, r = We(en, o), c = g(o), i = s.useRef(!1); return /* @__PURE__ */ a( wo, { id: r.contentId, "aria-labelledby": r.triggerId, ...c, ...t, ref: n, onCloseAutoFocus: M(e.onCloseAutoFocus, (d) => { i.current || r.triggerRef.current?.focus(), i.current = !1, d.preventDefault(); }), onInteractOutside: M(e.onInteractOutside, (d) => { const f = d.detail.originalEvent, m = f.button === 0 && f.ctrlKey === !0, p = f.button === 2 || m; (!r.modal || p) && (i.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)" } } ); } ); nn.displayName = en; var Go = "DropdownMenuGroup", on = s.forwardRef( (e, n) => { const { __scopeDropdownMenu: o, ...t } = e, r = g(o); return /* @__PURE__ */ a(Co, { ...r, ...t, ref: n }); } ); on.displayName = Go; var Fo = "DropdownMenuLabel", tn = s.forwardRef( (e, n) => { const { __scopeDropdownMenu: o, ...t } = e, r = g(o); return /* @__PURE__ */ a(_o, { ...r, ...t, ref: n }); } ); tn.displayName = Fo; var $o = "DropdownMenuItem", rn = s.forwardRef( (e, n) => { const { __scopeDropdownMenu: o, ...t } = e, r = g(o); return /* @__PURE__ */ a(Ro, { ...r, ...t, ref: n }); } ); rn.displayName = $o; var Ko = "DropdownMenuCheckboxItem", an = s.forwardRef((e, n) => { const { __scopeDropdownMenu: o, ...t } = e, r = g(o); return /* @__PURE__ */ a(bo, { ...r, ...t, ref: n }); }); an.displayName = Ko; var Uo = "DropdownMenuRadioGroup", cn = s.forwardRef((e, n) => { const { __scopeDropdownMenu: o, ...t } = e, r = g(o); return /* @__PURE__ */ a(Do, { ...r, ...t, ref: n }); }); cn.displayName = Uo; var Bo = "DropdownMenuRadioItem", sn = s.forwardRef((e, n) => { const { __scopeDropdownMenu: o, ...t } = e, r = g(o); return /* @__PURE__ */ a(So, { ...r, ...t, ref: n }); }); sn.displayName = Bo; var Vo = "DropdownMenuItemIndicator", un = s.forwardRef((e, n) => { const { __scopeDropdownMenu: o, ...t } = e, r = g(o); return /* @__PURE__ */ a(xo, { ...r, ...t, ref: n }); }); un.displayName = Vo; var zo = "DropdownMenuSeparator", dn = s.forwardRef((e, n) => { const { __scopeDropdownMenu: o, ...t } = e, r = g(o); return /* @__PURE__ */ a(Po, { ...r, ...t, ref: n }); }); dn.displayName = zo; var jo = "DropdownMenuArrow", Xo = s.forwardRef( (e, n) => { const { __scopeDropdownMenu: o, ...t } = e, r = g(o); return /* @__PURE__ */ a(Io, { ...r, ...t, ref: n }); } ); Xo.displayName = jo; var Yo = (e) => { const { __scopeDropdownMenu: n, children: o, open: t, onOpenChange: r, defaultOpen: c } = e, i = g(n), [d, f] = Ce({ prop: t, defaultProp: c ?? !1, onChange: r, caller: "DropdownMenuSub" }); return /* @__PURE__ */ a(yo, { ...i, open: d, onOpenChange: f, children: o }); }, Ho = "DropdownMenuSubTrigger", ln = s.forwardRef((e, n) => { const { __scopeDropdownMenu: o, ...t } = e, r = g(o); return /* @__PURE__ */ a(Eo, { ...r, ...t, ref: n }); }); ln.displayName = Ho; var Wo = "DropdownMenuSubContent", pn = s.forwardRef((e, n) => { const { __scopeDropdownMenu: o, ...t } = e, r = g(o); return /* @__PURE__ */ a( No, { ...r, ...t, ref: n, 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)" } } ); }); pn.displayName = Wo; var Zo = Ze, qo = Je, fn = Qe, Jo = nn, Qo = on, et = tn, nt = rn, ot = an, tt = cn, rt = sn, mn = un, at = dn, ct = Yo, st = ln, ut = pn; const Pt = Zo, It = qo, yt = Qo, Et = fn, Nt = ct, Tt = tt, Ot = ({ className: e, inset: n, children: o, ...t }) => /* @__PURE__ */ ne( st, { "data-slot": "dropdown-menu-sub-trigger", className: R( "focus:bg-accent data-[state=open]:bg-accent flex cursor-default items-center gap-2 rounded-xs px-2 py-1.5 text-sm outline-hidden select-none", n && "pl-8", e ), ...t, children: [ o, /* @__PURE__ */ a(Sn, { className: "ml-auto size-4" }) ] } ), At = ({ className: e, ...n }) => /* @__PURE__ */ a( ut, { "data-slot": "dropdown-menu-sub-content", className: R( "animate-entrance-fade-slide bg-popover text-popover-foreground z-50 min-w-[8rem] overflow-hidden rounded-md border p-1", e ), ...n } ), kt = ({ className: e, container: n, sideOffset: o = 4, ...t }) => { const r = /* @__PURE__ */ a( Jo, { "data-slot": "dropdown-menu-content", sideOffset: o, className: R( "animate-entrance-fade-slide bg-popover text-popover-foreground z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md", e ), ...t } ); return n === null ? r : /* @__PURE__ */ a(fn, { container: n, children: r }); }, Lt = ({ className: e, inset: n, ...o }) => /* @__PURE__ */ a( nt, { "data-slot": "dropdown-menu-item", className: R( "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs px-2 py-1.5 text-sm outline-hidden transition select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:size-4", n && "pl-8", e ), ...o } ), Gt = ({ className: e, children: n, checked: o, ...t }) => /* @__PURE__ */ ne( ot, { "data-slot": "dropdown-menu-checkbox-item", className: R( "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden transition select-none data-disabled:pointer-events-none data-disabled:opacity-50", e ), checked: o, ...t, children: [ /* @__PURE__ */ a("span", { className: "flex-center absolute left-2 size-3.5", children: /* @__PURE__ */ a(mn, { children: /* @__PURE__ */ a(bn, { className: "size-4" }) }) }), n ] } ), Ft = ({ className: e, children: n, ...o }) => /* @__PURE__ */ ne( rt, { "data-slot": "dropdown-menu-radio-item", className: R( "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden transition select-none data-disabled:pointer-events-none data-disabled:opacity-50", e ), ...o, children: [ /* @__PURE__ */ a("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ a(mn, { children: /* @__PURE__ */ a(Dn, { className: "size-2 fill-current" }) }) }), n ] } ), $t = ({ className: e, inset: n, ...o }) => /* @__PURE__ */ a( et, { "data-slot": "dropdown-menu-label", className: R( "px-2 py-1.5 text-sm font-semibold", n && "pl-8", e ), ...o } ), Kt = ({ className: e, ...n }) => /* @__PURE__ */ a( at, { "data-slot": "dropdown-menu-separator", className: R("bg-muted -mx-1 my-1 h-px", e), ...n } ), Ut = ({ className: e, ...n }) => /* @__PURE__ */ a( "span", { "data-slot": "dropdown-menu-shortcut", className: R("ml-auto text-xs tracking-widest opacity-60", e), ...n } ); export { Pt as D, Gt as a, kt as b, yt as c, Lt as d, $t as e, Et as f, Tt as g, Ft as h, Kt as i, Ut as j, Nt as k, At as l, Ot as m, It as n };