@payfit/unity-components
Version:
27 lines (26 loc) • 1.11 kB
JavaScript
import { useMenuContext as e } from "../Menu.context.js";
import "react";
import { uyMerge as t, uyTv as n } from "@payfit/unity-themes";
import { jsx as r } from "react/jsx-runtime";
import { Menu as i } from "react-aria-components/Menu";
//#region src/core/components/menu/parts/MenuContent.tsx
var a = n({ base: ["uy:outline-none", "uy:w-(--uy-menu-content-width) uy:min-w-(--uy-menu-content-min-width) uy:max-w-(--uy-menu-content-max-width)"] });
function o({ children: n, width: o, className: s, selectionMode: c, selectedKeys: l, renderEmptyState: u }) {
let { compact: d } = e(), f = typeof u == "function" ? u : u === void 0 ? void 0 : () => u;
return /* @__PURE__ */ r(i, {
className: t(a(), s),
selectionMode: c,
selectedKeys: l,
renderEmptyState: f,
"data-compact": d,
style: {
"--uy-menu-content-width": o ? `${o}px` : "auto",
"--uy-menu-content-min-width": o ? "0px" : "calc(var(--uy-spacing) * 24)",
"--uy-menu-content-max-width": o ? `${o}px` : "calc(var(--uy-spacing) * 48)"
},
children: n
});
}
o.displayName = "MenuContent";
//#endregion
export { o as MenuContent };