UNPKG

@stanfordspezi/spezi-web-design-system

Version:

Stanford Biodesign Digital Health Spezi Web Design System

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