import { jsx as _jsx } from "react/jsx-runtime";
import { useMemo } from 'react';
import { Popover } from '../popover';
import { filterUndefined } from '../utils';
import { MenuProvider } from './context';
import MenuButton from './menuButton';
import MenuItem from './menuItem';
import MenuList from './menuList';
/** Wraps Popover component and exposes some props to the children via context. */
export function Menu(props) {
    const { closeOnSelect = true, size, variant, ...rest } = props;
    const context = useMemo(() => filterUndefined({ closeOnSelect, size, variant }), [closeOnSelect, size, variant]);
    return (_jsx(MenuProvider, { value: context, children: _jsx(Popover, { ...rest }) }));
}
Menu.Button = MenuButton;
Menu.Item = MenuItem;
Menu.List = MenuList;
Menu.displayName = 'Menu';
export default Menu;
//# sourceMappingURL=menu.js.map