import { filterUndefined } from "../utils/object.js";
import Popover from "../popover/popover.js";
import { MenuProvider } from "./context.js";
import MenuButton from "./menuButton.js";
import MenuItem from "./menuItem.js";
import MenuList from "./menuList.js";
import { useMemo } from "react";
import { jsx } from "react/jsx-runtime";

//#region src/menu/menu.tsx
/** Wraps Popover component and exposes some props to the children via context. */
function Menu(props) {
	const { closeOnSelect = true, size, variant, ...rest } = props;
	return /* @__PURE__ */ jsx(MenuProvider, {
		value: useMemo(() => filterUndefined({
			closeOnSelect,
			size,
			variant
		}), [
			closeOnSelect,
			size,
			variant
		]),
		children: /* @__PURE__ */ jsx(Popover, { ...rest })
	});
}
Menu.Button = MenuButton;
Menu.Item = MenuItem;
Menu.List = MenuList;
Menu.displayName = "Menu";

//#endregion
export { Menu as default };
globalThis.__vuiVersion__ = "4.0.0"
//# sourceMappingURL=menu.js.map