UNPKG

@undp/design-system-react

Version:

React based design system for UNDP

691 lines (690 loc) 25.7 kB
import { t as e } from "./utils-ca9as9Ye.js"; import { t } from "./chevron-right-De8BUaNW.js"; import { i as n, n as r } from "./dist-DxuGUd9a.js"; import { n as i, t as a } from "./dist-jqIPNHDe.js"; import { n as o } from "./dist-BKfyhBSH.js"; import { t as s } from "./dist-J8GU8wyT.js"; import { n as c, t as l } from "./dist-CwCVtfik.js"; import { t as u } from "./dist-CnnnGPaT.js"; import { t as d } from "./dist-DfB3OR9K.js"; import { t as f } from "./dist-pXPIaj85.js"; import { t as p } from "./dist-C8FJXTu6.js"; import { n as m } from "./dist-CMH_aW5P.js"; import { i as h, n as g, r as ee, t as te } from "./es2015-PKoodAxS.js"; import { t as ne } from "./dist-vWm-kLzq.js"; import { i as _, n as re, r as v, t as y } from "./dist-D8TIRAGv.js"; import { n as ie, r as b, t as ae } from "./dist-CNDtQX6n.js"; import * as x from "react"; import S from "react"; import { Fragment as C, jsx as w, jsxs as oe } from "react/jsx-runtime"; //#region node_modules/@radix-ui/react-menu/dist/index.mjs var T = Object.defineProperty, E = (e, t) => T(e, "name", { value: t, configurable: !0 }), D = ["Enter", " "], O = [ "ArrowDown", "PageUp", "Home" ], k = [ "ArrowUp", "PageDown", "End" ], se = [...O, ...k], A = { ltr: [...D, "ArrowRight"], rtl: [...D, "ArrowLeft"] }, j = { ltr: ["ArrowLeft"], rtl: ["ArrowRight"] }, M = "Menu", [N, ce, P] = s(M), [F, I] = o(M, [ P, _, b ]), L = _(), le = b(), [R, z] = F(M), [ue, B] = F(M), V = /* @__PURE__ */ E((e) => { let { __scopeMenu: t, open: n = !1, children: r, dir: i, onOpenChange: a, modal: o = !0 } = e, s = L(t), [c, l] = x.useState(null), u = x.useRef(!1), d = p(a), m = f(i); return x.useEffect(() => { let e = /* @__PURE__ */ E(() => { u.current = !0, document.addEventListener("pointerdown", t, { capture: !0, once: !0 }), document.addEventListener("pointermove", t, { capture: !0, once: !0 }); }, "handleKeyDown"), t = /* @__PURE__ */ E(() => u.current = !1, "handlePointer"); return document.addEventListener("keydown", e, { capture: !0 }), () => { document.removeEventListener("keydown", e, { capture: !0 }), document.removeEventListener("pointerdown", t, { capture: !0 }), document.removeEventListener("pointermove", t, { capture: !0 }); }; }, []), x.useEffect(() => { if (!n) return; let e = /* @__PURE__ */ E(() => d(!1), "handleBlur"); return window.addEventListener("blur", e), () => window.removeEventListener("blur", e); }, [n, d]), /* @__PURE__ */ w(v, { ...s, children: /* @__PURE__ */ w(R, { scope: t, open: n, onOpenChange: d, content: c, onContentChange: l, children: /* @__PURE__ */ w(ue, { scope: t, onClose: x.useCallback(() => d(!1), [d]), isUsingKeyboardRef: u, dir: m, modal: o, children: r }) }) }); }, "Menu"), de = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ E(function(e, t) { let { __scopeMenu: n, ...r } = e; return /* @__PURE__ */ w(y, { ...L(n), ...r, ref: t }); }, "MenuAnchor")), fe = "MenuPortal", [pe, me] = F(fe, { forceMount: void 0 }), he = /* @__PURE__ */ E((e) => { let { __scopeMenu: t, forceMount: n, children: r, container: i } = e, a = z(fe, t); return /* @__PURE__ */ w(pe, { scope: t, forceMount: n, children: /* @__PURE__ */ w(u, { present: n || a.open, children: /* @__PURE__ */ w(ne, { asChild: !0, container: i, children: r }) }) }); }, "MenuPortal"), H = "MenuContent", [ge, U] = F(H), _e = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ E(function(e, t) { let n = me(H, e.__scopeMenu), { forceMount: r = n.forceMount, ...i } = e, a = z(H, e.__scopeMenu), o = B(H, e.__scopeMenu); return /* @__PURE__ */ w(N.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ w(u, { present: r || a.open, children: /* @__PURE__ */ w(N.Slot, { scope: e.__scopeMenu, children: o.modal ? /* @__PURE__ */ w(ve, { ...i, ref: t }) : /* @__PURE__ */ w(ye, { ...i, ref: t }) }) }) }); }, "MenuContent")), ve = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ E(function(e, t) { let r = z(H, e.__scopeMenu), i = x.useRef(null), a = n(t, i); return x.useEffect(() => { let e = i.current; if (e) return te(e); }, []), /* @__PURE__ */ w(W, { ...e, ref: a, trapFocus: r.open, disableOutsidePointerEvents: r.open, disableOutsideScroll: !0, onFocusOutside: c(e.onFocusOutside, (e) => e.preventDefault(), { checkForDefaultPrevented: !1 }), onDismiss: () => r.onOpenChange(!1) }); }, "MenuRootContentModal")), ye = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ E(function(e, t) { let n = z(H, e.__scopeMenu); return /* @__PURE__ */ w(W, { ...e, ref: t, trapFocus: !1, disableOutsidePointerEvents: !1, disableOutsideScroll: !1, onDismiss: () => n.onOpenChange(!1) }); }, "MenuRootContentNonModal")), be = r("MenuContent.ScrollLock"), W = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ E(function(e, t) { let { __scopeMenu: r, loop: i = !1, trapFocus: a, onOpenAutoFocus: o, onCloseAutoFocus: s, disableOutsidePointerEvents: l, onEntryFocus: u, onEscapeKeyDown: d, onPointerDownOutside: f, onFocusOutside: p, onInteractOutside: te, onDismiss: ne, disableOutsideScroll: _, ...v } = e, y = z(H, r), b = B(H, r), ae = L(r), S = le(r), C = ce(r), [oe, T] = x.useState(null), D = x.useRef(null), O = n(t, D, y.onContentChange), A = x.useRef(0), j = x.useRef(""), M = x.useRef(0), N = x.useRef(null), P = x.useRef("right"), F = x.useRef(0), I = _ ? g : x.Fragment, R = _ ? { as: be, allowPinchZoom: !0 } : void 0, ue = /* @__PURE__ */ E((e) => { let t = j.current + e, n = C().filter((e) => !e.disabled), r = document.activeElement, i = n.find((e) => e.ref.current === r)?.textValue, a = Ve(n.map((e) => e.textValue), t, i), o = n.find((e) => e.textValue === a)?.ref.current; (/* @__PURE__ */ E((function e(t) { j.current = t, window.clearTimeout(A.current), t !== "" && (A.current = window.setTimeout(() => e(""), 1e3)); }), "updateSearch"))(t), o && setTimeout(() => o.focus()); }, "handleTypeaheadSearch"); x.useEffect(() => () => window.clearTimeout(A.current), []), ee(); let V = x.useCallback((e) => P.current === N.current?.side && Ue(e, N.current?.area), []); return /* @__PURE__ */ w(ge, { scope: r, searchRef: j, onItemEnter: x.useCallback((e) => { V(e) && e.preventDefault(); }, [V]), onItemLeave: x.useCallback((e) => { V(e) || (D.current?.focus(), T(null)); }, [V]), onTriggerLeave: x.useCallback((e) => { V(e) && e.preventDefault(); }, [V]), pointerGraceTimerRef: M, onPointerGraceIntentChange: x.useCallback((e) => { N.current = e; }, []), children: /* @__PURE__ */ w(I, { ...R, children: /* @__PURE__ */ w(h, { asChild: !0, trapped: a, onMountAutoFocus: c(o, (e) => { e.preventDefault(), D.current?.focus({ preventScroll: !0 }); }), onUnmountAutoFocus: s, children: /* @__PURE__ */ w(m, { asChild: !0, disableOutsidePointerEvents: l, onEscapeKeyDown: d, onPointerDownOutside: f, onFocusOutside: p, onInteractOutside: te, onDismiss: ne, children: /* @__PURE__ */ w(ie, { asChild: !0, ...S, dir: b.dir, orientation: "vertical", loop: i, currentTabStopId: oe, onCurrentTabStopIdChange: T, onEntryFocus: c(u, (e) => { b.isUsingKeyboardRef.current || e.preventDefault(); }), preventScrollOnEntryFocus: !0, children: /* @__PURE__ */ w(re, { role: "menu", "aria-orientation": "vertical", "data-state": J(y.open), "data-radix-menu-content": "", dir: b.dir, ...ae, ...v, ref: O, style: { outline: "none", ...v.style }, onKeyDown: c(v.onKeyDown, (e) => { let t = e.target.closest("[data-radix-menu-content]") === e.currentTarget, n = e.ctrlKey || e.altKey || e.metaKey, r = e.key.length === 1; t && (e.key === "Tab" && e.preventDefault(), !n && r && ue(e.key)); let i = D.current; if (e.target !== i || !se.includes(e.key)) return; e.preventDefault(); let a = C().filter((e) => !e.disabled).map((e) => e.ref.current); k.includes(e.key) && a.reverse(), ze(a); }), onBlur: c(e.onBlur, (e) => { e.currentTarget.contains(e.target) || (window.clearTimeout(A.current), j.current = ""); }), onPointerMove: c(e.onPointerMove, Y((e) => { let t = e.target, n = F.current !== e.clientX; if (e.currentTarget.contains(t) && n) { let t = e.clientX > F.current ? "right" : "left"; P.current = t, F.current = e.clientX; } })) }) }) }) }) }) }); }, "MenuContentImpl")), xe = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ E(function(e, t) { let { __scopeMenu: n, ...r } = e; return /* @__PURE__ */ w(a.div, { role: "group", ...r, ref: t }); }, "MenuGroup")), Se = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ E(function(e, t) { let { __scopeMenu: n, ...r } = e; return /* @__PURE__ */ w(a.div, { ...r, ref: t }); }, "MenuLabel")), G = "MenuItem", K = "menu.itemSelect", Ce = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ E(function(e, t) { let { disabled: r = !1, onSelect: a, ...o } = e, s = x.useRef(null), l = B(G, e.__scopeMenu), u = U(G, e.__scopeMenu), d = n(t, s), f = x.useRef(!1), p = /* @__PURE__ */ E(() => { let e = s.current; if (!r && e) { let t = new CustomEvent(K, { bubbles: !0, cancelable: !0 }); e.addEventListener(K, (e) => a?.(e), { once: !0 }), i(e, t), t.defaultPrevented ? f.current = !1 : l.onClose(); } }, "handleSelect"); return /* @__PURE__ */ w(we, { ...o, ref: d, disabled: r, onClick: c(e.onClick, p), onPointerDown: (t) => { e.onPointerDown?.(t), f.current = !0; }, onPointerUp: c(e.onPointerUp, (e) => { f.current || e.currentTarget?.click(); }), onKeyDown: c(e.onKeyDown, (e) => { r || e.target !== e.currentTarget || u.searchRef.current !== "" && e.key === " " || D.includes(e.key) && (e.currentTarget.click(), e.preventDefault()); }) }); }, "MenuItem")), we = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ E(function(e, t) { let { __scopeMenu: r, disabled: i = !1, textValue: o, ...s } = e, l = U(G, r), u = le(r), d = x.useRef(null), f = n(t, d), [p, m] = x.useState(!1), [h, g] = x.useState(""); return x.useEffect(() => { let e = d.current; e && g((e.textContent ?? "").trim()); }, [s.children]), /* @__PURE__ */ w(N.ItemSlot, { scope: r, disabled: i, textValue: o ?? h, children: /* @__PURE__ */ w(ae, { asChild: !0, ...u, focusable: !i, children: /* @__PURE__ */ w(a.div, { role: "menuitem", "data-highlighted": p ? "" : void 0, "aria-disabled": i || void 0, "data-disabled": i ? "" : void 0, ...s, ref: f, onPointerMove: c(e.onPointerMove, Y((e) => { i ? l.onItemLeave(e) : (l.onItemEnter(e), e.defaultPrevented || e.currentTarget.focus({ preventScroll: !0 })); })), onPointerLeave: c(e.onPointerLeave, Y((e) => l.onItemLeave(e))), onFocus: c(e.onFocus, () => m(!0)), onBlur: c(e.onBlur, () => m(!1)) }) }) }); }, "MenuItemImpl")), [Te, Ee] = F("MenuRadioGroup", { value: void 0, onValueChange: /* @__PURE__ */ E(() => {}, "onValueChange") }), [De, Oe] = F("MenuItemIndicator", { checked: !1 }), ke = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ E(function(e, t) { let { __scopeMenu: n, ...r } = e; return /* @__PURE__ */ w(a.div, { role: "separator", "aria-orientation": "horizontal", ...r, ref: t }); }, "MenuSeparator")), Ae = "MenuSub", [je, Me] = F(Ae), Ne = /* @__PURE__ */ E((e) => { let { __scopeMenu: t, children: n, open: r = !1, onOpenChange: i } = e, a = z(Ae, t), o = L(t), [s, c] = x.useState(null), [l, u] = x.useState(null), f = p(i); return x.useEffect(() => (a.open === !1 && f(!1), () => f(!1)), [a.open, f]), /* @__PURE__ */ w(v, { ...o, children: /* @__PURE__ */ w(R, { scope: t, open: r, onOpenChange: f, content: l, onContentChange: u, children: /* @__PURE__ */ w(je, { scope: t, contentId: d(), triggerId: d(), trigger: s, onTriggerChange: c, children: n }) }) }); }, "MenuSub"), q = "MenuSubTrigger", Pe = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ E(function(e, t) { let r = z(q, e.__scopeMenu), i = B(q, e.__scopeMenu), a = Me(q, e.__scopeMenu), o = U(q, e.__scopeMenu), s = x.useRef(null), { pointerGraceTimerRef: l, onPointerGraceIntentChange: u } = o, d = { __scopeMenu: e.__scopeMenu }, f = x.useCallback(() => { s.current && window.clearTimeout(s.current), s.current = null; }, []); x.useEffect(() => f, [f]), x.useEffect(() => { let e = l.current; return () => { window.clearTimeout(e), u(null); }; }, [l, u]); let p = n(t, a.onTriggerChange); return /* @__PURE__ */ w(de, { asChild: !0, ...d, children: /* @__PURE__ */ w(we, { id: a.triggerId, "aria-haspopup": "menu", "aria-expanded": r.open, "aria-controls": r.open ? a.contentId : void 0, "data-state": J(r.open), ...e, ref: p, onClick: (t) => { e.onClick?.(t), !(e.disabled || t.defaultPrevented) && (t.currentTarget.focus(), r.open || r.onOpenChange(!0)); }, onPointerMove: c(e.onPointerMove, Y((t) => { o.onItemEnter(t), !t.defaultPrevented && !e.disabled && !r.open && !s.current && (o.onPointerGraceIntentChange(null), s.current = window.setTimeout(() => { r.onOpenChange(!0), f(); }, 100)); })), onPointerLeave: c(e.onPointerLeave, Y((e) => { f(); let t = r.content?.getBoundingClientRect(); if (t) { let n = r.content?.dataset.side, i = n === "right", a = i ? -5 : 5, s = t[i ? "left" : "right"], c = t[i ? "right" : "left"]; o.onPointerGraceIntentChange({ area: [ { x: e.clientX + a, y: e.clientY }, { x: s, y: t.top }, { x: c, y: t.top }, { x: c, y: t.bottom }, { x: s, y: t.bottom } ], side: n }), window.clearTimeout(l.current), l.current = window.setTimeout(() => o.onPointerGraceIntentChange(null), 300); } else { if (o.onTriggerLeave(e), e.defaultPrevented) return; o.onPointerGraceIntentChange(null); } })), onKeyDown: c(e.onKeyDown, (t) => { e.disabled || t.target !== t.currentTarget || o.searchRef.current !== "" && t.key === " " || A[i.dir].includes(t.key) && (r.onOpenChange(!0), r.content?.focus(), t.preventDefault()); }) }) }); }, "MenuSubTrigger")), Fe = "MenuSubContent", Ie = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ E(function(e, t) { let r = me(H, e.__scopeMenu), { forceMount: i = r.forceMount, align: a = "start", ...o } = e, s = z(H, e.__scopeMenu), l = B(H, e.__scopeMenu), d = Me(Fe, e.__scopeMenu), f = x.useRef(null), p = n(t, f); return /* @__PURE__ */ w(N.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ w(u, { present: i || s.open, children: /* @__PURE__ */ w(N.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ w(W, { id: d.contentId, "aria-labelledby": d.triggerId, ...o, ref: p, align: a, side: l.dir === "rtl" ? "left" : "right", disableOutsidePointerEvents: !1, disableOutsideScroll: !1, trapFocus: !1, onOpenAutoFocus: (e) => { l.isUsingKeyboardRef.current && f.current?.focus(), e.preventDefault(); }, onCloseAutoFocus: (e) => e.preventDefault(), onFocusOutside: c(e.onFocusOutside, (e) => { e.target !== d.trigger && s.onOpenChange(!1); }), onEscapeKeyDown: c(e.onEscapeKeyDown, (e) => { l.onClose(), e.preventDefault(); }), onKeyDown: c(e.onKeyDown, (e) => { let t = e.currentTarget.contains(e.target), n = j[l.dir].includes(e.key); t && n && (s.onOpenChange(!1), d.trigger?.focus(), e.preventDefault()); }) }) }) }) }); }, "MenuSubContent")); function J(e) { return e ? "open" : "closed"; } E(J, "getOpenState"); function Le(e) { return e === "indeterminate"; } E(Le, "isIndeterminate"); function Re(e) { return Le(e) ? "indeterminate" : e ? "checked" : "unchecked"; } E(Re, "getCheckedState"); function ze(e) { let t = document.activeElement; for (let n of e) if (n === t || (n.focus(), document.activeElement !== t)) return; } E(ze, "focusFirst"); function Be(e, t) { return e.map((n, r) => e[(t + r) % e.length]); } E(Be, "wrapArray"); function Ve(e, t, n) { let r = t.length > 1 && Array.from(t).every((e) => e === t[0]) ? t[0] : t, i = n ? e.indexOf(n) : -1, a = Be(e, Math.max(i, 0)); r.length === 1 && (a = a.filter((e) => e !== n)); let o = a.find((e) => e.toLowerCase().startsWith(r.toLowerCase())); return o === n ? void 0 : o; } E(Ve, "getNextMatch"); function He(e, t) { let { x: n, y: r } = e, i = !1; for (let e = 0, a = t.length - 1; e < t.length; a = e++) { let o = t[e], s = t[a], c = o.x, l = o.y, u = s.x, d = s.y; l > r != d > r && n < (u - c) * (r - l) / (d - l) + c && (i = !i); } return i; } E(He, "isPointInPolygon"); function Ue(e, t) { return t ? He({ x: e.clientX, y: e.clientY }, t) : !1; } E(Ue, "isPointerInGraceArea"); function Y(e) { return (t) => t.pointerType === "mouse" ? e(t) : void 0; } E(Y, "whenMouse"); var We = V, Ge = de, Ke = he, qe = _e, Je = xe, Ye = Se, Xe = Ce, Ze = ke, Qe = Ne, $e = Pe, et = Ie, tt = Object.defineProperty, X = (e, t) => tt(e, "name", { value: t, configurable: !0 }), Z = "DropdownMenu", [nt, rt] = o(Z, [I]), Q = I(), [it, at] = nt(Z), ot = /* @__PURE__ */ X((e) => { let { __scopeDropdownMenu: t, children: n, dir: r, open: i, defaultOpen: a, onOpenChange: o, modal: s = !0 } = e, c = Q(t), u = x.useRef(null), [f, p] = l({ prop: i, defaultProp: a ?? !1, onChange: o, caller: Z }); return /* @__PURE__ */ w(it, { scope: t, triggerId: d(), triggerRef: u, contentId: d(), open: f, onOpenChange: p, onOpenToggle: x.useCallback(() => p((e) => !e), [p]), modal: s, children: /* @__PURE__ */ w(We, { ...c, open: f, onOpenChange: p, dir: r, modal: s, children: n }) }); }, "DropdownMenu"), st = "DropdownMenuTrigger", ct = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ X(function(e, t) { let { __scopeDropdownMenu: r, disabled: i = !1, ...o } = e, s = at(st, r), l = Q(r), u = n(t, s.triggerRef); return /* @__PURE__ */ w(Ge, { asChild: !0, ...l, children: /* @__PURE__ */ w(a.button, { type: "button", id: s.triggerId, "aria-haspopup": "menu", "aria-expanded": s.open, "aria-controls": s.open ? s.contentId : void 0, "data-state": s.open ? "open" : "closed", "data-disabled": i ? "" : void 0, disabled: i, ...o, ref: u, onPointerDown: c(e.onPointerDown, (e) => { !i && e.button === 0 && e.ctrlKey === !1 && (s.onOpenToggle(), s.open || e.preventDefault()); }), onKeyDown: c(e.onKeyDown, (e) => { i || (["Enter", " "].includes(e.key) && s.onOpenToggle(), e.key === "ArrowDown" && s.onOpenChange(!0), [ "Enter", " ", "ArrowDown" ].includes(e.key) && e.preventDefault()); }) }) }); }, "DropdownMenuTrigger")), lt = /* @__PURE__ */ X((e) => { let { __scopeDropdownMenu: t, ...n } = e; return /* @__PURE__ */ w(Ke, { ...Q(t), ...n }); }, "DropdownMenuPortal"), ut = "DropdownMenuContent", dt = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ X(function(e, t) { let { __scopeDropdownMenu: n, ...r } = e, i = at(ut, n), a = Q(n), o = x.useRef(!1); return /* @__PURE__ */ w(qe, { id: i.contentId, "aria-labelledby": i.triggerId, ...a, ...r, ref: t, onCloseAutoFocus: c(e.onCloseAutoFocus, (e) => { o.current || i.triggerRef.current?.focus(), o.current = !1, e.preventDefault(); }), onInteractOutside: c(e.onInteractOutside, (e) => { let t = e.detail.originalEvent, n = t.button === 0 && t.ctrlKey === !0, r = t.button === 2 || n; (!i.modal || r) && (o.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)" } }); }, "DropdownMenuContent")), ft = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ X(function(e, t) { let { __scopeDropdownMenu: n, ...r } = e; return /* @__PURE__ */ w(Je, { ...Q(n), ...r, ref: t }); }, "DropdownMenuGroup")), pt = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ X(function(e, t) { let { __scopeDropdownMenu: n, ...r } = e; return /* @__PURE__ */ w(Ye, { ...Q(n), ...r, ref: t }); }, "DropdownMenuLabel")), mt = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ X(function(e, t) { let { __scopeDropdownMenu: n, ...r } = e; return /* @__PURE__ */ w(Xe, { ...Q(n), ...r, ref: t }); }, "DropdownMenuItem")), ht = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ X(function(e, t) { let { __scopeDropdownMenu: n, ...r } = e; return /* @__PURE__ */ w(Ze, { ...Q(n), ...r, ref: t }); }, "DropdownMenuSeparator")), gt = /* @__PURE__ */ X((e) => { let { __scopeDropdownMenu: t, children: n, open: r, onOpenChange: i, defaultOpen: a } = e, o = Q(t), [s, c] = l({ prop: r, defaultProp: a ?? !1, onChange: i, caller: "DropdownMenuSub" }); return /* @__PURE__ */ w(Qe, { ...o, open: s, onOpenChange: c, children: n }); }, "DropdownMenuSub"), _t = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ X(function(e, t) { let { __scopeDropdownMenu: n, ...r } = e; return /* @__PURE__ */ w($e, { ...Q(n), ...r, ref: t }); }, "DropdownMenuSubTrigger")), vt = /* @__PURE__ */ x.forwardRef(/* @__PURE__ */ X(function(e, t) { let { __scopeDropdownMenu: n, ...r } = e; return /* @__PURE__ */ w(et, { ...Q(n), ...r, ref: t, 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)" } }); }, "DropdownMenuSubContent")), yt = ot, bt = ct, xt = lt, St = dt, Ct = ft, $ = pt, wt = mt, Tt = ht, Et = gt, Dt = _t, Ot = vt, kt = yt, At = S.forwardRef(({ className: t, children: n, ...r }, i) => /* @__PURE__ */ w(bt, { ...r, ref: i, className: e("text-content-primary focus:outline-hidden", t), children: n })); At.displayName = bt.displayName; var jt = Ct, Mt = xt, Nt = Et, Pt = S.forwardRef(({ className: n, inset: r, children: i, ...a }, o) => /* @__PURE__ */ oe(Dt, { ...a, ref: o, className: e("flex cursor-default select-none items-center gap-2 rounded-base px-2 py-1.5 text-base outline-hidden backdrop-blur-frosted focus:bg-surface-hover data-[state=open]:bg-surface/90 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", r && "pl-8", n), children: [i, /* @__PURE__ */ w(t, { className: "ml-auto" })] })); Pt.displayName = Dt.displayName; var Ft = S.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ w(Ot, { ...n, ref: r, className: e("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-base bg-surface/90 p-1 text-content-primary shadow-lg backdrop-blur-frosted data-[state=closed]:animate-out data-[state=open]:animate-in", t) })); Ft.displayName = Ot.displayName; var It = S.forwardRef(({ className: t, sideOffset: n = 4, inPortal: r = !0, ...i }, a) => { let o = /* @__PURE__ */ w(C, { children: /* @__PURE__ */ w(St, { ...i, ref: a, sideOffset: n, className: e("z-50 min-w-[8rem] overflow-hidden rounded-base bg-surface/90 p-1 text-content-primary shadow-md backdrop-blur-frosted", "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 data-[state=closed]:animate-out data-[state=open]:animate-in", t) }) }); return r ? /* @__PURE__ */ w(xt, { children: o }) : o; }); It.displayName = St.displayName; var Lt = S.forwardRef(({ className: t, inset: n, ...r }, i) => /* @__PURE__ */ w(wt, { ...r, ref: i, className: e("relative flex cursor-default select-none items-center gap-2 rounded-base px-2 py-1.5 text-base outline-hidden transition-colors focus:bg-surface-hover data-disabled:pointer-events-none data-disabled:opacity-25 [&>svg]:size-4 [&>svg]:shrink-0", n && "pl-8", t) })); Lt.displayName = wt.displayName; var Rt = S.forwardRef(({ className: t, inset: n, ...r }, i) => /* @__PURE__ */ w($, { ...r, ref: i, className: e("px-2 py-1.5 font-semibold text-base uppercase", n && "pl-8", t) })); Rt.displayName = $.displayName; var zt = S.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ w(Tt, { ...n, ref: r, className: e("-mx-1 my-1 h-px bg-surface-hard", t) })); zt.displayName = Tt.displayName; //#endregion export { Rt as a, Nt as c, At as d, Lt as i, Ft as l, It as n, Mt as o, jt as r, zt as s, kt as t, Pt as u }; //# sourceMappingURL=dropdown-menu-DgTrpywX.js.map