UNPKG

@payfit/unity-components

Version:

23 lines (22 loc) 816 B
import e from "react"; import { jsx as t, jsxs as n } from "react/jsx-runtime"; import { MenuTrigger as r, Popover as i } from "react-aria-components/Menu"; //#region src/components/menu/Menu.tsx function a({ defaultOpen: a, children: o, triggerRef: s, placement: c, ...l }) { let [u, d] = e.Children.toArray(o); if (!u || !d) throw Error("Menu must have a trigger and a menu content"); return /* @__PURE__ */ n(r, { defaultOpen: a, ...l, children: [u, /* @__PURE__ */ t(i, { triggerRef: s, placement: c, className: "uy:flex uy:flex-col uy:justify-end uy:items-start uy:p-100 uy:rounded-100 uy:border uy:border-solid uy:border-border-neutral uy:bg-surface-neutral uy:shadow-300", "data-dd-privacy": "allow", children: d })] }); } a.displayName = "Menu"; //#endregion export { a as Menu };