UNPKG

@hitachivantara/uikit-react-core

Version:
35 lines (34 loc) 1.27 kB
import { getContainerElement } from "../../utils/document.js"; import { HvVerticalNavigation } from "../VerticalNavigation.js"; import { useClasses } from "./NavigationPopup.styles.js"; import { useTheme } from "@hitachivantara/uikit-react-utils"; import { jsx } from "react/jsx-runtime"; import ClickAwayListener from "@mui/material/ClickAwayListener"; import Popper from "@mui/material/Popper"; //#region src/VerticalNavigation/NavigationPopup/NavigationPopupContainer.tsx var NavigationPopupContainer = ({ anchorEl, onClose, children, classes: classesProp, className, ...others }) => { const { classes, cx } = useClasses(classesProp); const { rootId } = useTheme(); const handleClickAway = () => onClose?.(); return /* @__PURE__ */ jsx(Popper, { open: true, anchorEl, placement: "right-start", container: getContainerElement(rootId), className: cx(classes.popper, classes.popup, className), ...others, children: /* @__PURE__ */ jsx(ClickAwayListener, { onClickAway: handleClickAway, children: /* @__PURE__ */ jsx("div", { className: classes.container, children: /* @__PURE__ */ jsx(HvVerticalNavigation, { open: true, useIcons: true, children }) }) }) }); }; //#endregion export { NavigationPopupContainer };