@muraldevkit/ui-toolkit 4.77.2 → 4.78.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,9 +30,9 @@ var classnames__default = /*#__PURE__*/_interopDefault(classnames);
30
30
  var _excluded = ["children", "className"];
31
31
 
32
32
  /**
33
- * MrlCol React component.
33
+ * MrlGrid React component.
34
34
  * @param props - component props
35
- * @returns a MrlCol React component.
35
+ * @returns a MrlGrid React component.
36
36
  */
37
37
  function MrlGrid(_ref) {
38
38
  var children = _ref.children,
@@ -1 +1 @@
1
- {"version":3,"file":"MrlGrid.js","sources":["../../../../../src/components/grid/MrlGrid/MrlGrid.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { LayoutComponent } from '../../layout/constants';\nimport '../grid.variables.scss';\nimport '../grid.global.scss';\n\n/**\n * MrlCol React component.\n * @param props - component props\n * @returns a MrlCol React component.\n */\nexport function MrlGrid({ children, className = '', ...rest }: LayoutComponent): JSX.Element {\n\tconst allClasses = classnames('container', className);\n\n\treturn (\n\t\t<div {...rest} className={allClasses}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n"],"names":["MrlGrid","_ref","children","_ref$className","className","rest","_objectWithoutProperties","_excluded","allClasses","classnames","React","createElement","_extends"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;AACA;AACA;AACA;AACA;AACO,SAASA,OAAOA,CAAAC,IAAA,EAAsE;AAAA,EAAA,IAAnEC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAAC,cAAA,GAAAF,IAAA,CAAEG,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;AAAKE,IAAAA,IAAI,GAAAC,iDAAA,CAAAL,IAAA,EAAAM,SAAA,CAAA;AAC1D,EAAA,IAAMC,UAAU,GAAGC,2BAAU,CAAC,WAAW,EAAEL,SAAS,CAAC;AAErD,EAAA,oBACCM,gBAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,iCAAA,KAASP,IAAI,EAAA;AAAED,IAAAA,SAAS,EAAEI;AAAW,GAAA,CAAA,EACnCN,QACG,CAAC;AAER;;;;"}
1
+ {"version":3,"file":"MrlGrid.js","sources":["../../../../../src/components/grid/MrlGrid/MrlGrid.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { LayoutComponent } from '../../layout/constants';\nimport '../grid.variables.scss';\nimport '../grid.global.scss';\n\n/**\n * MrlGrid React component.\n * @param props - component props\n * @returns a MrlGrid React component.\n */\nexport function MrlGrid({ children, className = '', ...rest }: LayoutComponent): JSX.Element {\n\tconst allClasses = classnames('container', className);\n\n\treturn (\n\t\t<div {...rest} className={allClasses}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n"],"names":["MrlGrid","_ref","children","_ref$className","className","rest","_objectWithoutProperties","_excluded","allClasses","classnames","React","createElement","_extends"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;AACA;AACA;AACA;AACA;AACO,SAASA,OAAOA,CAAAC,IAAA,EAAsE;AAAA,EAAA,IAAnEC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAAC,cAAA,GAAAF,IAAA,CAAEG,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;AAAKE,IAAAA,IAAI,GAAAC,iDAAA,CAAAL,IAAA,EAAAM,SAAA,CAAA;AAC1D,EAAA,IAAMC,UAAU,GAAGC,2BAAU,CAAC,WAAW,EAAEL,SAAS,CAAC;AAErD,EAAA,oBACCM,gBAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,iCAAA,KAASP,IAAI,EAAA;AAAED,IAAAA,SAAS,EAAEI;AAAW,GAAA,CAAA,EACnCN,QACG,CAAC;AAER;;;;"}
@@ -494,8 +494,7 @@ function MrlMenu(_ref) {
494
494
  */
495
495
  var isAwaitingPosition = !disableTriggerPosition && !menuPositionStyles.isPositioned;
496
496
  var hideUntilPositionedStyles = isAwaitingPosition ? {
497
- opacity: 0,
498
- pointerEvents: 'none'
497
+ opacity: 0
499
498
  } : undefined;
500
499
 
501
500
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"MrlMenu.js","sources":["../../../../../src/components/menu/MrlMenu/MrlMenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport { MrlPortal, PortalProps } from '../../portal/MrlPortal';\nimport { useTriggerPosition } from '../../../hooks/useTriggerPosition';\nimport { useClickOutside } from '../../../hooks/useClickOutside';\nimport { useSubMenuElementPosition } from '../hooks/useSubMenuElementPosition';\nimport {\n\tMenuPosition,\n\tMenuAlignment,\n\tActionState,\n\tActionType,\n\tCustomMenuPosition\n} from '../constants';\nimport { PORTAL_LAYERS } from '../../../utils/layers';\nimport {\n\tfindAdjacentInteractiveElement,\n\tpreventDefault,\n\tisElementAriaDisabled\n} from '../../../utils';\nimport classnames from 'classnames';\nimport { MrlMenuContext } from '../context/MrlMenuContext';\nimport styles from './MrlMenu.module.scss';\nimport itemStyles from '../MrlMenuItem/MrlMenuItem.module.scss';\nimport { useTransition, animated } from '@react-spring/web';\nimport { isTouchDevice } from '../../../utils/isTouch';\nimport { getScrollableParent } from '../utilities/get-scrollable-parent';\nimport { useMenuScroll } from '../hooks/useMenuScroll';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\nexport interface MrlMenuProps {\n\t/** Custom position for the menu */\n\tcustomPosition?: CustomMenuPosition;\n\n\t/** Children to be rendered within the menu component*/\n\tchildren: React.ReactNode;\n\n\t/** Event to close the menu */\n\tclickOutsideEvent?: 'mousedown' | 'mouseup' | 'click';\n\n\t/**\n\t * Enables closing the menu when scrolling. Default is false.\n\t *\n\t */\n\tcloseOnScroll?: boolean;\n\n\t/**\n\t * Private closeParent prop for use with MrlMenuItem\n\t *\n\t * !!! Please do not use this prop directly, it is only used internally by MrlMenuItem !!!\n\t * @private\n\t */\n\tcloseParent?: () => void;\n\n\t/**\n\t * Disable arrows from opening the menu\n\t * - This is useful when you want to disable the default browser behavior of opening a menu on arrow down.\n\t *\n\t * Example usage: the menu is within a vertical toolbar and you want to use the arrow keys to navigate the toolbar.\n\t * By using this prop you can disable the arrow key open/close so that navigating the toolbar does not conflict\n\t * with opening/closing the menu.\n\t */\n\tdisableArrowOpen?: boolean;\n\n\t/**\n\t * Disable flipping of the menu when it goes off the screen\n\t * @default false\n\t */\n\tdisableFlipping?: boolean;\n\n\t/** Unique identifier for the menu */\n\tid?: string;\n\n\t/**\n\t * Use when the menu is embedded within another component\n\t * Removes the following styles:\n\t * - padding on the menu\n\t * - drop shadow and border\n\t * @default false\n\t */\n\tisInternal?: boolean;\n\n\t/**\n\t * Private isSubMenu prop for use with MrlMenuItem\n\t *\n\t * !!! Please do not use this prop directly, it is only used internally by MrlMenuItem !!!\n\t * @private\n\t */\n\tisSubMenu?: boolean;\n\n\t/**\n\t * spacing of menu\n\t * - compact has less padding\n\t * @default 'default'\n\t */\n\tspacing?: 'default' | 'compact';\n\n\t/**\n\t * Offset of the menu from the trigger element in pixels\n\t * @default 10px\n\t */\n\tmenuOffset?: number;\n\n\t/**\n\t * Configuration for the portal component\n\t */\n\tportalProps?: Omit<PortalProps, 'children'>;\n\n\t/**\n\t * Horizontal and vertical alignment of the menu relative to the trigger element\n\t * - position 'left', 'right', 'top', 'bottom' position relative to the trigger\n\t * - position 'static' renders the menu in place, not using the portal\n\t * - position 'ignore' will not position the menu, allowing you to use the customPosition prop to position the element\n\t * @default 'bottom'\n\t */\n\tposition?: MenuPosition;\n\n\t/**\n\t * Opens or closes the menu from outside. Not just an initial value: whenever\n\t * `isOpen` or `actionType` changes, the menu syncs its internal state to it.\n\t * The menu can still close itself (item select, click outside, Escape, Tab),\n\t * so pair this with `onClose` to reset your state. Prefer `triggerRef` when\n\t * there is a trigger element. Ignored for submenus and `position=\"static\"`.\n\t * @default { actionType: null, isOpen: false }\n\t */\n\tactionState?: ActionState;\n\n\t/**\n\t * Reference to the DOM element that triggers this menu. This alone wires up\n\t * click and keyboard open/close and the trigger's ARIA attributes; no\n\t * `actionState` or `onClick` toggle is needed.\n\t */\n\ttriggerRef?: React.RefObject<HTMLButtonElement>;\n\n\t/**\n\t * Trigger stop propagation on click\n\t *\n\t * In some instances we may want the trigger element to stop propogation to the\n\t * rest of the DOM. Use this flag to enable and disable it.\n\t * @default false\n\t */\n\ttriggerStopPropagation?: boolean;\n\n\t/**\n\t * Vertical and horizontal alignment of the menu relative to the position of the menu with the trigger\n\t * - 'left' and 'right' work with position 'top' and 'bottom'\n\t * - 'top' and 'bottom' work with position 'left' and 'right'\n\t * - 'center' works with all positions\n\t *\n\t * This does not impact submenus\n\t */\n\talignment?: MenuAlignment;\n\n\t/**\n\t * Called when the menu closes itself: item select, click outside, Escape, Tab,\n\t * or scroll with `closeOnScroll`. Not called when a trigger click toggles it closed.\n\t * @param type - type of close event\n\t */\n\tonClose?: (type?: string) => void;\n\n\t/**\n\t * Enables interaction tracking for this menu. Provide a stable, non-PII id\n\t * (e.g. 'mural-context-menu'). When omitted, the menu emits no analytics.\n\t */\n\teventId?: string;\n}\n\nconst MENU_ITEM_SELECTOR = '[role=\"menuitem\"], [role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]';\n\n/**\n * MrlMenu component\n *\n * Renders a menu component with alignment relative to a trigger element\n * @param {MrlMenuProps} props - The props for the MrlMenu component\n * @returns {Element} - rendered MrlMenu component\n */\nexport function MrlMenu({\n\tactionState = { actionType: null, isOpen: false },\n\talignment = 'center',\n\tchildren,\n\tcloseOnScroll = false,\n\tcloseParent,\n\tcustomPosition,\n\tclickOutsideEvent = 'mouseup',\n\tdisableArrowOpen,\n\tdisableFlipping = false,\n\tid,\n\tisInternal = false,\n\tisSubMenu = false,\n\tspacing = 'default',\n\tmenuOffset = 10,\n\tportalProps = { id: PORTAL_LAYERS.MENU.name },\n\tposition = 'bottom',\n\ttriggerStopPropagation = false,\n\tonClose,\n\teventId,\n\ttriggerRef,\n\t...remainingProps\n}: MrlMenuProps): JSX.Element {\n\tconst defaultOpenState = position === 'static' || false;\n\n\tconst [state, setState] = React.useState({\n\t\tactionType: null,\n\t\tisOpen: defaultOpenState\n\t} as ActionState);\n\n\tconst trackInteraction = useMrlTrackInteraction('MrlMenu', eventId);\n\t// the menu opens and closes from several paths (click, keyboard, hover, click outside),\n\t// so open/close is emitted from the resulting state rather than each individual handler.\n\tconst wasOpenRef = React.useRef(defaultOpenState);\n\n\tReact.useEffect(() => {\n\t\tif (wasOpenRef.current === state.isOpen) return;\n\n\t\twasOpenRef.current = state.isOpen;\n\n\t\ttrackInteraction({\n\t\t\taction: state.isOpen ? 'open' : 'close',\n\t\t\tmetadata: { isSubMenu, trigger: state.actionType ?? 'unknown' },\n\t\t\tvariant: position\n\t\t});\n\t}, [state.isOpen, state.actionType, isSubMenu, position, trackInteraction]);\n\n\tconst menuRef = React.useRef<HTMLDivElement>(null);\n\tconst listRef = React.useRef<HTMLUListElement>(null);\n\tconst [menuItems, setMenuItems] = React.useState<HTMLButtonElement[]>([]);\n\tconst [menuRect, setMenuRect] = React.useState<DOMRect | null>(null);\n\n\t/**\n\t * Checks if the trigger element is disabled\n\t * @returns {boolean} - true if the trigger element is disabled, false otherwise\n\t */\n\tconst isTriggerDisabled = React.useCallback((): boolean => {\n\t\treturn isElementAriaDisabled(triggerRef?.current);\n\t}, [triggerRef]);\n\n\t/**\n\t * Sets up trigger event listeners to open and close the menu\n\t * @param e - mouse event\n\t */\n\tconst toggleMenuTrigger = React.useCallback(\n\t\t(e: MouseEvent) => {\n\t\t\tif (isTriggerDisabled()) return;\n\n\t\t\tif (triggerStopPropagation) {\n\t\t\t\tpreventDefault(e);\n\t\t\t}\n\n\t\t\tsetState((prevState) => ({ actionType: 'click', isOpen: !prevState.isOpen }));\n\t\t},\n\t\t[triggerStopPropagation, isTriggerDisabled]\n\t);\n\n\t/**\n\t * Used to display the menu when hovering over a menu item that has a submenu\n\t */\n\tconst showMenuHover = React.useCallback(() => {\n\t\tsetState({ actionType: 'click', isOpen: true });\n\t}, []);\n\n\tconst showMenuTap = React.useCallback(() => {\n\t\tsetState((prevState) => ({ actionType: 'click', isOpen: !prevState.isOpen }));\n\t}, []);\n\n\tconst hideMenuHover = React.useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tconst relatedTarget = event.relatedTarget as Node;\n\n\t\t\t// If the related target is not a child of the menu, close the menu\n\t\t\t// This prevents the menu from closing when hovering over a submenu item or trigger\n\t\t\tif (\n\t\t\t\ttriggerRef &&\n\t\t\t\tmenuRef.current &&\n\t\t\t\t!menuRef.current.contains(relatedTarget) &&\n\t\t\t\ttriggerRef.current &&\n\t\t\t\t!triggerRef.current.contains(relatedTarget)\n\t\t\t) {\n\t\t\t\tsetState({ actionType: null, isOpen: false });\n\t\t\t}\n\t\t},\n\t\t[triggerRef]\n\t);\n\n\t/**\n\t * Sets up trigger event listeners to open and close the menu with a keyboard\n\t */\n\tconst toggleMenuKey = React.useCallback(\n\t\t(e: KeyboardEvent) => {\n\t\t\tconst openMenu = () => {\n\t\t\t\tif (isTriggerDisabled()) return;\n\t\t\t\tsetState({ actionType: e.key as ActionType, isOpen: true });\n\t\t\t};\n\n\t\t\tif (!state.isOpen) {\n\t\t\t\tif (isSubMenu) {\n\t\t\t\t\tswitch (e.key) {\n\t\t\t\t\t\tcase 'ArrowRight':\n\t\t\t\t\t\tcase 'Enter':\n\t\t\t\t\t\tcase ' ':\n\t\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\t\topenMenu();\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tswitch (e.key) {\n\t\t\t\t\tcase 'ArrowDown':\n\t\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\t\tif (!disableArrowOpen && !isTriggerDisabled()) {\n\t\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\t\topenMenu();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Enter':\n\t\t\t\t\tcase ' ':\n\t\t\t\t\t\tif (isTriggerDisabled()) return;\n\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\topenMenu();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[state.isOpen, isTriggerDisabled, disableArrowOpen, isSubMenu]\n\t);\n\n\tconst closeMenu = React.useCallback(\n\t\t(shouldCloseParent = true) => {\n\t\t\tif (position === 'static') return;\n\n\t\t\t/**\n\t\t\t * What is closeParent?\n\t\t\t *\n\t\t\t * It is passed from the context provider to the MenuItem (which helps render our submenus)\n\t\t\t * When we render the submenu, we pass the closeMenu function as \"closeParent\" to the submenu.\n\t\t\t * This allows us to trigger closing the parent menu when the submenu is closed. And that's\n\t\t\t * what this call is for.\n\t\t\t */\n\t\t\tif (shouldCloseParent && closeParent) closeParent();\n\n\t\t\tsetState({ actionType: null, isOpen: false });\n\t\t\tonClose?.();\n\t\t},\n\t\t[position, closeParent, onClose]\n\t);\n\n\t/**\n\t * Click outside to dismiss the menu\n\t * @param e\n\t */\n\tconst disableClickOutside = !state.isOpen || position === 'static';\n\tuseClickOutside(menuRef, triggerRef, clickOutsideEvent, closeMenu, disableClickOutside);\n\n\tconst handleMenuKeyUp = (e: React.KeyboardEvent) => {\n\t\tconst actions: ActionType[] = ['ArrowUp', 'ArrowDown', 'ArrowRight', 'Enter', 'Escape', ' '];\n\n\t\tif (actions.includes(e.key as ActionType)) {\n\t\t\tpreventDefault(e);\n\t\t}\n\t};\n\n\t/**\n\t * Focus management when someone is using a keyboard to navigate the menu\n\t * @param e - keyboard event\n\t */\n\tconst handleMenuKey = (e: React.KeyboardEvent) => {\n\t\tconst currentIndex = menuItems.findIndex((item) => document.activeElement === item);\n\t\tlet nextIndex: number;\n\n\t\tif (state.isOpen) {\n\t\t\tswitch (e.key) {\n\t\t\t\tcase 'ArrowDown':\n\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\tnextIndex = currentIndex < menuItems.length - 1 ? currentIndex + 1 : currentIndex;\n\t\t\t\t\tmenuItems[nextIndex]?.focus();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\tnextIndex = currentIndex > 0 ? currentIndex - 1 : 0;\n\t\t\t\t\tmenuItems[nextIndex]?.focus();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowRight':\n\t\t\t\tcase 'ArrowLeft':\n\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Escape':\n\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\ttriggerRef?.current?.focus();\n\t\t\t\t\tcloseMenu(false);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Tab':\n\t\t\t\t\tif (!isSubMenu && position !== 'static') {\n\t\t\t\t\t\tif (e.shiftKey) {\n\t\t\t\t\t\t\t// Handle shift + tab: move focus to the previous item\n\t\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\t\tif (triggerRef) {\n\t\t\t\t\t\t\t\tconst prevElement = findAdjacentInteractiveElement(triggerRef, 'previous');\n\t\t\t\t\t\t\t\tprevElement?.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Regular tab: close the menu or move to the next item\n\t\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\t\tif (triggerRef) {\n\t\t\t\t\t\t\t\tconst nextElement = findAdjacentInteractiveElement(triggerRef);\n\t\t\t\t\t\t\t\tnextElement?.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcloseMenu();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * useEffect hooks to handle menu state changes\n\t */\n\n\tReact.useEffect(() => {\n\t\tif (triggerRef?.current) {\n\t\t\ttriggerRef.current.setAttribute('aria-haspopup', 'menu');\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\tReact.useEffect(() => {\n\t\tif (position === 'static') {\n\t\t\tsetState({ actionType: 'click', isOpen: true });\n\t\t}\n\t}, [position]);\n\n\tReact.useEffect(() => {\n\t\ttriggerRef?.current?.setAttribute('aria-expanded', state.isOpen.toString());\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen]);\n\n\tReact.useEffect(() => {\n\t\tif (!isSubMenu && position !== 'static')\n\t\t\tsetState({ actionType: actionState.actionType, isOpen: actionState.isOpen });\n\t}, [actionState.isOpen, actionState.actionType, isSubMenu, position]);\n\n\t// setup event handlers for mouse, keyboard, and scroll interactions\n\tReact.useEffect(() => {\n\t\tconst triggerElement = triggerRef?.current;\n\t\tconst menuElement = menuRef?.current;\n\t\tconst menuItems = menuElement?.querySelectorAll(MENU_ITEM_SELECTOR);\n\n\t\tlet scrollableParent: HTMLElement | Window;\n\n\t\tif (triggerElement) {\n\t\t\ttriggerElement.addEventListener('mousedown', preventDefault);\n\t\t\tif (!isSubMenu) triggerElement.addEventListener('click', toggleMenuTrigger);\n\t\t\ttriggerElement.addEventListener('keydown', toggleMenuKey);\n\n\t\t\t// Setup event listeners for when the menu is a submenu\n\t\t\tif (isSubMenu) {\n\t\t\t\ttriggerElement.addEventListener('mouseover', showMenuHover);\n\t\t\t\ttriggerElement.addEventListener('mouseout', hideMenuHover);\n\n\t\t\t\tif (isTouchDevice()) {\n\t\t\t\t\ttriggerElement.addEventListener('touchend', showMenuTap);\n\t\t\t\t}\n\n\t\t\t\tif (menuElement) {\n\t\t\t\t\tmenuElement.addEventListener('mouseover', showMenuHover);\n\t\t\t\t\tmenuElement.addEventListener('mouseout', hideMenuHover);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (closeOnScroll) {\n\t\t\t\tscrollableParent = getScrollableParent(triggerElement);\n\t\t\t\tif (scrollableParent) {\n\t\t\t\t\tscrollableParent.addEventListener('scroll', () => closeMenu(), {\n\t\t\t\t\t\tcapture: true,\n\t\t\t\t\t\tpassive: true\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\ttriggerElement.removeEventListener('mousedown', preventDefault);\n\t\t\t\tif (!isSubMenu) triggerElement.removeEventListener('click', toggleMenuTrigger);\n\t\t\t\ttriggerElement.removeEventListener('keydown', toggleMenuKey);\n\n\t\t\t\tif (menuItems) {\n\t\t\t\t\tmenuItems.forEach((item: Element) => {\n\t\t\t\t\t\tif (!item.getAttribute('aria-haspopup')) {\n\t\t\t\t\t\t\titem.removeEventListener('mousedown', () => closeMenu());\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (isSubMenu) {\n\t\t\t\t\ttriggerElement.removeEventListener('mouseover', showMenuHover);\n\t\t\t\t\ttriggerElement.removeEventListener('mouseout', hideMenuHover);\n\n\t\t\t\t\tif (isTouchDevice()) {\n\t\t\t\t\t\ttriggerElement.removeEventListener('touchstart', showMenuHover);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (menuElement) {\n\t\t\t\t\t\tmenuElement.removeEventListener('mouseover', showMenuHover);\n\t\t\t\t\t\tmenuElement.removeEventListener('mouseout', hideMenuHover);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (closeOnScroll && scrollableParent) {\n\t\t\t\t\tscrollableParent.removeEventListener('scroll', () => closeMenu());\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}, [\n\t\tcloseOnScroll,\n\t\tisSubMenu,\n\t\ttriggerRef,\n\t\ttoggleMenuTrigger,\n\t\ttoggleMenuKey,\n\t\tshowMenuHover,\n\t\thideMenuHover,\n\t\tcloseMenu,\n\t\tshowMenuTap\n\t]);\n\n\t// This use effect handles a few things when we open the menu:\n\t// - making sure that the menu component is aware of it's menu items\n\t// - adding a class to the trigger element when the submenu is open for styling\n\t// - storing the menu rect in state for positioning calculations\n\tReact.useEffect(() => {\n\t\tif (state.isOpen) {\n\t\t\tconst foundMenuItems = Array.from(\n\t\t\t\tmenuRef.current?.querySelectorAll(MENU_ITEM_SELECTOR) || []\n\t\t\t) as HTMLButtonElement[];\n\n\t\t\tsetMenuItems(foundMenuItems);\n\t\t}\n\n\t\tif (state.isOpen && isSubMenu) {\n\t\t\ttriggerRef?.current?.classList.add(itemStyles['MrlMenuItem--item--submenuOpen']);\n\t\t} else if (!state.isOpen && isSubMenu) {\n\t\t\ttriggerRef?.current?.classList.remove(itemStyles['MrlMenuItem--item--submenuOpen']);\n\t\t}\n\n\t\t// For consistent submenu calculations, we are storing the menu rect in state\n\t\t// Anytime we need to use the menu rect, we want to make sure the values are based\n\t\t// on the original state of the menu for proper transformations\n\t\tif (!menuRect && menuRef.current) {\n\t\t\tconst newRect = menuRef.current?.getBoundingClientRect();\n\t\t\tsetMenuRect(newRect || null);\n\t\t}\n\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen, menuRect, isSubMenu]);\n\n\t/**\n\t * Focus management for when the menu is opening or closing\n\t */\n\tReact.useEffect(() => {\n\t\tif (menuItems.length > 0) {\n\t\t\tlet menuItemToFocus;\n\n\t\t\tswitch (state.actionType) {\n\t\t\t\tcase 'Enter':\n\t\t\t\tcase 'ArrowDown':\n\t\t\t\tcase ' ':\n\t\t\t\t\tmenuItemToFocus = menuItems[0];\n\t\t\t\t\tmenuItemToFocus?.focus();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\tmenuItemToFocus = menuItems[menuItems.length - 1];\n\t\t\t\t\tmenuItemToFocus?.focus();\n\n\t\t\t\t\t// Scroll to the bottom of the menu when the last item is focused\n\t\t\t\t\t// setTimeout is required to ensure the element has been rendered\n\t\t\t\t\t// and the scrollHeight is accurate prior to scrolling\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tif (listRef.current) {\n\t\t\t\t\t\t\tlistRef.current.scrollTo(0, listRef.current.scrollHeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 20);\n\t\t\t}\n\n\t\t\tif (isSubMenu && state.actionType === 'ArrowRight') {\n\t\t\t\tmenuItemToFocus = menuItems[0];\n\t\t\t\tmenuItemToFocus?.focus();\n\t\t\t}\n\t\t}\n\t}, [isSubMenu, menuItems, state.actionType]);\n\n\t/**\n\t * Menu scroll behavior\n\t *\n\t * When the menu cannot fit in the preferred or flipped position,\n\t * this hook constrains the menu height and enables internal scrolling.\n\t * Called before useTriggerPosition so that isScrolling can disable flipping,\n\t * preventing the positioning hook from fighting the scroll constraint.\n\t */\n\tconst disableMenuScroll =\n\t\tisSubMenu || !state.isOpen || position === 'static' || position === 'ignore';\n\n\t/**\n\t * Sets overflow (scrolling) on menu when there is no space to display\n\t * the menu in the preferred or flipped position.\n\t */\n\tconst menuScroll = useMenuScroll(\n\t\ttriggerRef,\n\t\tlistRef,\n\t\tposition,\n\t\tmenuOffset,\n\t\tstate.isOpen,\n\t\tdisableMenuScroll\n\t);\n\n\t/**\n\t * Primary menu positioning, alignment, and transition styling\n\t *\n\t * This hook is only enabled if isSubMenu is FALSE\n\t */\n\tconst disableTriggerPosition = isSubMenu || !state.isOpen || position === 'static';\n\tconst menuPositionStyles = useTriggerPosition(\n\t\ttriggerRef,\n\t\tmenuRef,\n\t\t{\n\t\t\talign: alignment,\n\t\t\tcustomPosition: customPosition,\n\t\t\tposition: position\n\t\t},\n\t\tstate.isOpen,\n\t\tmenuOffset,\n\t\tdisableTriggerPosition,\n\t\tdisableFlipping || menuScroll.isScrolling\n\t);\n\n\t/**\n\t * The first position is calculated after the menu renders, so it would paint for a frame\n\t * at its initial (or previous) position. Keep it hidden until it has been positioned.\n\t * Uses opacity instead of visibility so menu items can still receive focus.\n\t */\n\tconst isAwaitingPosition = !disableTriggerPosition && !menuPositionStyles.isPositioned;\n\tconst hideUntilPositionedStyles = isAwaitingPosition\n\t\t? { opacity: 0, pointerEvents: 'none' as const }\n\t\t: undefined;\n\n\t/**\n\t * Submenu positioning and alignment\n\t *\n\t * This hook is only enabled if isSubMenu is TRUE\n\t */\n\tconst subMenuPosition = useSubMenuElementPosition(\n\t\ttriggerRef,\n\t\tmenuRef,\n\t\tisSubMenu,\n\t\tstate.isOpen,\n\t\tmenuRect,\n\t\t// disable the subelement positioning if it's not a submenu\n\t\t!isSubMenu\n\t);\n\n\tconst inlineStyles = {\n\t\tmenu: {\n\t\t\tleft: menuPositionStyles.left,\n\t\t\tposition: 'fixed' as const,\n\t\t\ttop: menuPositionStyles.top\n\t\t},\n\t\tsubmenu: {\n\t\t\tleft: subMenuPosition.left,\n\t\t\ttop: subMenuPosition.top\n\t\t}\n\t};\n\n\t/**\n\t * React Spring transitions for the menu\n\t */\n\tconst transitionConfig = {\n\t\tconfig: { duration: state.isOpen ? 300 : 150 },\n\t\tenter: { opacity: 1, transform: 'translateY(0)' },\n\t\tfrom: { opacity: 0, transform: 'translateY(4px)' },\n\t\tleave: { opacity: 0, transform: 'translateY(4px)' }\n\t};\n\n\tconst transitionStatic = {\n\t\tconfig: { duration: 0 },\n\t\tenter: { opacity: 1, transform: 'translateY(0)' }\n\t};\n\n\tconst transitions = useTransition(\n\t\tstate.isOpen,\n\t\tposition === 'static' ? transitionStatic : transitionConfig\n\t);\n\n\tconst menuClasses = classnames(styles['MrlMenu'], 'MrlMenu', {\n\t\t[styles['MrlMenu--submenu']]: isSubMenu,\n\t\t[styles.open]: state.isOpen,\n\t\t[styles['MrlMenu--compact']]: spacing === 'compact',\n\t\t[styles['MrlMenu--static']]: position === 'static',\n\t\t[styles['MrlMenu--internal']]: isInternal,\n\t\t[styles['MrlMenu--scrolling']]: menuScroll.isScrolling,\n\t\t[styles['MrlMenu--ignore']]: position === 'ignore'\n\t});\n\n\tconst positionStyles = isSubMenu\n\t\t? inlineStyles.submenu\n\t\t: position !== 'static'\n\t\t\t? inlineStyles.menu\n\t\t\t: {};\n\n\tconst menuScrollStyles =\n\t\t(menuScroll.maxHeight !== undefined && { maxHeight: menuScroll.maxHeight }) || undefined;\n\n\tconst renderMenu = () => {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{transitions(\n\t\t\t\t\t(style, item) =>\n\t\t\t\t\t\titem && (\n\t\t\t\t\t\t\t<animated.div\n\t\t\t\t\t\t\t\tclassName={menuClasses}\n\t\t\t\t\t\t\t\tid={id}\n\t\t\t\t\t\t\t\tstyle={{ ...positionStyles, ...style, ...hideUntilPositionedStyles }}\n\t\t\t\t\t\t\t\tonKeyUp={handleMenuKeyUp}\n\t\t\t\t\t\t\t\tonKeyDown={handleMenuKey}\n\t\t\t\t\t\t\t\tref={menuRef}\n\t\t\t\t\t\t\t\trole=\"none\"\n\t\t\t\t\t\t\t\t{...remainingProps}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ul ref={listRef} role=\"menu\" style={menuScrollStyles}>\n\t\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</animated.div>\n\t\t\t\t\t\t)\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t};\n\n\t// For managing and restoring focus to the original menu trigger\n\t// Ensures the triggerRef in context is always the parent triggerRef\n\tconst parentContext = React.useContext(MrlMenuContext);\n\tconst contextTriggerRef = isSubMenu ? parentContext?.triggerRef : triggerRef;\n\n\treturn (\n\t\t<MrlMenuContext.Provider\n\t\t\tvalue={{\n\t\t\t\tcloseMenu,\n\t\t\t\tcloseParent: !isSubMenu ? closeMenu : undefined,\n\t\t\t\ttriggerRef: contextTriggerRef\n\t\t\t}}\n\t\t>\n\t\t\t{isSubMenu || position === 'static' ? (\n\t\t\t\trenderMenu()\n\t\t\t) : (\n\t\t\t\t<MrlPortal layer={portalProps.layer || PORTAL_LAYERS.MENU} {...portalProps}>\n\t\t\t\t\t{renderMenu()}\n\t\t\t\t</MrlPortal>\n\t\t\t)}\n\t\t</MrlMenuContext.Provider>\n\t);\n\t/* eslint-enable */\n}\n\nMrlMenu.componentType = 'Menu';\n"],"names":["MENU_ITEM_SELECTOR","MrlMenu","_ref","_ref$actionState","actionState","actionType","isOpen","_ref$alignment","alignment","children","_ref$closeOnScroll","closeOnScroll","closeParent","customPosition","_ref$clickOutsideEven","clickOutsideEvent","disableArrowOpen","_ref$disableFlipping","disableFlipping","id","_ref$isInternal","isInternal","_ref$isSubMenu","isSubMenu","_ref$spacing","spacing","_ref$menuOffset","menuOffset","_ref$portalProps","portalProps","PORTAL_LAYERS","MENU","name","_ref$position","position","_ref$triggerStopPropa","triggerStopPropagation","onClose","eventId","triggerRef","remainingProps","_objectWithoutProperties","_excluded","defaultOpenState","_React$useState","React","useState","_React$useState2","_slicedToArray","state","setState","trackInteraction","useMrlTrackInteraction","wasOpenRef","useRef","useEffect","_state$actionType","current","action","metadata","trigger","variant","menuRef","listRef","_React$useState3","_React$useState4","menuItems","setMenuItems","_React$useState5","_React$useState6","menuRect","setMenuRect","isTriggerDisabled","useCallback","isElementAriaDisabled","toggleMenuTrigger","e","preventDefault","prevState","showMenuHover","showMenuTap","hideMenuHover","event","relatedTarget","contains","toggleMenuKey","openMenu","key","closeMenu","shouldCloseParent","arguments","length","undefined","disableClickOutside","useClickOutside","handleMenuKeyUp","actions","includes","handleMenuKey","_menuItems$nextIndex","_menuItems$nextIndex2","_triggerRef$current","currentIndex","findIndex","item","document","activeElement","nextIndex","focus","shiftKey","prevElement","findAdjacentInteractiveElement","nextElement","setAttribute","_triggerRef$current2","toString","triggerElement","menuElement","querySelectorAll","scrollableParent","addEventListener","isTouchDevice","getScrollableParent","capture","passive","removeEventListener","forEach","getAttribute","_menuRef$current","foundMenuItems","Array","from","_triggerRef$current3","classList","add","itemStyles","_triggerRef$current4","remove","_menuRef$current2","newRect","getBoundingClientRect","_menuItemToFocus","_menuItemToFocus2","menuItemToFocus","setTimeout","scrollTo","scrollHeight","_menuItemToFocus3","disableMenuScroll","menuScroll","useMenuScroll","disableTriggerPosition","menuPositionStyles","useTriggerPosition","align","isScrolling","isAwaitingPosition","isPositioned","hideUntilPositionedStyles","opacity","pointerEvents","subMenuPosition","useSubMenuElementPosition","inlineStyles","menu","left","top","submenu","transitionConfig","config","duration","enter","transform","leave","transitionStatic","transitions","useTransition","menuClasses","classnames","styles","open","positionStyles","menuScrollStyles","maxHeight","renderMenu","createElement","Fragment","style","animated","div","_extends","className","_objectSpread","onKeyUp","onKeyDown","ref","role","parentContext","useContext","MrlMenuContext","contextTriggerRef","Provider","value","MrlPortal","layer","componentType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqKA,IAAMA,kBAAkB,GAAG,sEAAsE;;AAEjG;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,OAAOA,CAAAC,IAAA,EAsBO;AAAA,EAAA,IAAAC,gBAAA,GAAAD,IAAA,CArB7BE,WAAW;IAAXA,WAAW,GAAAD,gBAAA,KAAA,MAAA,GAAG;AAAEE,MAAAA,UAAU,EAAE,IAAI;AAAEC,MAAAA,MAAM,EAAE;AAAM,KAAC,GAAAH,gBAAA;IAAAI,cAAA,GAAAL,IAAA,CACjDM,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,QAAQ,GAAAA,cAAA;IACpBE,QAAQ,GAAAP,IAAA,CAARO,QAAQ;IAAAC,kBAAA,GAAAR,IAAA,CACRS,aAAa;AAAbA,IAAAA,aAAa,GAAAD,kBAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,kBAAA;IACrBE,WAAW,GAAAV,IAAA,CAAXU,WAAW;IACXC,cAAc,GAAAX,IAAA,CAAdW,cAAc;IAAAC,qBAAA,GAAAZ,IAAA,CACda,iBAAiB;AAAjBA,IAAAA,iBAAiB,GAAAD,qBAAA,KAAA,MAAA,GAAG,SAAS,GAAAA,qBAAA;IAC7BE,gBAAgB,GAAAd,IAAA,CAAhBc,gBAAgB;IAAAC,oBAAA,GAAAf,IAAA,CAChBgB,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAA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E9J,UAAU,GAAGA,UAAU;AAE5E,EAAA,oBACCM,gBAAA,CAAA4I,aAAA,CAACc,6BAAc,CAACE,QAAQ,EAAA;AACvBC,IAAAA,KAAK,EAAE;MACNlH,SAAS;AACT5E,MAAAA,WAAW,EAAE,CAACW,SAAS,GAAGiE,SAAS,GAAGI,SAAS;AAC/CrD,MAAAA,UAAU,EAAEiK;AACb;AAAE,GAAA,EAEDjL,SAAS,IAAIW,QAAQ,KAAK,QAAQ,GAClCsJ,UAAU,EAAE,gBAEZ3I,gBAAA,CAAA4I,aAAA,CAACkB,mBAAS,EAAAb,iCAAA,CAAA;AAACc,IAAAA,KAAK,EAAE/K,WAAW,CAAC+K,KAAK,IAAI9K,mBAAa,CAACC;AAAK,GAAA,EAAKF,WAAW,CAAA,EACxE2J,UAAU,EACD,CAEY,CAAC;AAE3B;AACD;AAEAvL,OAAO,CAAC4M,aAAa,GAAG,MAAM;;;;"}
1
+ {"version":3,"file":"MrlMenu.js","sources":["../../../../../src/components/menu/MrlMenu/MrlMenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport { MrlPortal, PortalProps } from '../../portal/MrlPortal';\nimport { useTriggerPosition } from '../../../hooks/useTriggerPosition';\nimport { useClickOutside } from '../../../hooks/useClickOutside';\nimport { useSubMenuElementPosition } from '../hooks/useSubMenuElementPosition';\nimport {\n\tMenuPosition,\n\tMenuAlignment,\n\tActionState,\n\tActionType,\n\tCustomMenuPosition\n} from '../constants';\nimport { PORTAL_LAYERS } from '../../../utils/layers';\nimport {\n\tfindAdjacentInteractiveElement,\n\tpreventDefault,\n\tisElementAriaDisabled\n} from '../../../utils';\nimport classnames from 'classnames';\nimport { MrlMenuContext } from '../context/MrlMenuContext';\nimport styles from './MrlMenu.module.scss';\nimport itemStyles from '../MrlMenuItem/MrlMenuItem.module.scss';\nimport { useTransition, animated } from '@react-spring/web';\nimport { isTouchDevice } from '../../../utils/isTouch';\nimport { getScrollableParent } from '../utilities/get-scrollable-parent';\nimport { useMenuScroll } from '../hooks/useMenuScroll';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\nexport interface MrlMenuProps {\n\t/** Custom position for the menu */\n\tcustomPosition?: CustomMenuPosition;\n\n\t/** Children to be rendered within the menu component*/\n\tchildren: React.ReactNode;\n\n\t/** Event to close the menu */\n\tclickOutsideEvent?: 'mousedown' | 'mouseup' | 'click';\n\n\t/**\n\t * Enables closing the menu when scrolling. Default is false.\n\t *\n\t */\n\tcloseOnScroll?: boolean;\n\n\t/**\n\t * Private closeParent prop for use with MrlMenuItem\n\t *\n\t * !!! Please do not use this prop directly, it is only used internally by MrlMenuItem !!!\n\t * @private\n\t */\n\tcloseParent?: () => void;\n\n\t/**\n\t * Disable arrows from opening the menu\n\t * - This is useful when you want to disable the default browser behavior of opening a menu on arrow down.\n\t *\n\t * Example usage: the menu is within a vertical toolbar and you want to use the arrow keys to navigate the toolbar.\n\t * By using this prop you can disable the arrow key open/close so that navigating the toolbar does not conflict\n\t * with opening/closing the menu.\n\t */\n\tdisableArrowOpen?: boolean;\n\n\t/**\n\t * Disable flipping of the menu when it goes off the screen\n\t * @default false\n\t */\n\tdisableFlipping?: boolean;\n\n\t/** Unique identifier for the menu */\n\tid?: string;\n\n\t/**\n\t * Use when the menu is embedded within another component\n\t * Removes the following styles:\n\t * - padding on the menu\n\t * - drop shadow and border\n\t * @default false\n\t */\n\tisInternal?: boolean;\n\n\t/**\n\t * Private isSubMenu prop for use with MrlMenuItem\n\t *\n\t * !!! Please do not use this prop directly, it is only used internally by MrlMenuItem !!!\n\t * @private\n\t */\n\tisSubMenu?: boolean;\n\n\t/**\n\t * spacing of menu\n\t * - compact has less padding\n\t * @default 'default'\n\t */\n\tspacing?: 'default' | 'compact';\n\n\t/**\n\t * Offset of the menu from the trigger element in pixels\n\t * @default 10px\n\t */\n\tmenuOffset?: number;\n\n\t/**\n\t * Configuration for the portal component\n\t */\n\tportalProps?: Omit<PortalProps, 'children'>;\n\n\t/**\n\t * Horizontal and vertical alignment of the menu relative to the trigger element\n\t * - position 'left', 'right', 'top', 'bottom' position relative to the trigger\n\t * - position 'static' renders the menu in place, not using the portal\n\t * - position 'ignore' will not position the menu, allowing you to use the customPosition prop to position the element\n\t * @default 'bottom'\n\t */\n\tposition?: MenuPosition;\n\n\t/**\n\t * Opens or closes the menu from outside. Not just an initial value: whenever\n\t * `isOpen` or `actionType` changes, the menu syncs its internal state to it.\n\t * The menu can still close itself (item select, click outside, Escape, Tab),\n\t * so pair this with `onClose` to reset your state. Prefer `triggerRef` when\n\t * there is a trigger element. Ignored for submenus and `position=\"static\"`.\n\t * @default { actionType: null, isOpen: false }\n\t */\n\tactionState?: ActionState;\n\n\t/**\n\t * Reference to the DOM element that triggers this menu. This alone wires up\n\t * click and keyboard open/close and the trigger's ARIA attributes; no\n\t * `actionState` or `onClick` toggle is needed.\n\t */\n\ttriggerRef?: React.RefObject<HTMLButtonElement>;\n\n\t/**\n\t * Trigger stop propagation on click\n\t *\n\t * In some instances we may want the trigger element to stop propogation to the\n\t * rest of the DOM. Use this flag to enable and disable it.\n\t * @default false\n\t */\n\ttriggerStopPropagation?: boolean;\n\n\t/**\n\t * Vertical and horizontal alignment of the menu relative to the position of the menu with the trigger\n\t * - 'left' and 'right' work with position 'top' and 'bottom'\n\t * - 'top' and 'bottom' work with position 'left' and 'right'\n\t * - 'center' works with all positions\n\t *\n\t * This does not impact submenus\n\t */\n\talignment?: MenuAlignment;\n\n\t/**\n\t * Called when the menu closes itself: item select, click outside, Escape, Tab,\n\t * or scroll with `closeOnScroll`. Not called when a trigger click toggles it closed.\n\t * @param type - type of close event\n\t */\n\tonClose?: (type?: string) => void;\n\n\t/**\n\t * Enables interaction tracking for this menu. Provide a stable, non-PII id\n\t * (e.g. 'mural-context-menu'). When omitted, the menu emits no analytics.\n\t */\n\teventId?: string;\n}\n\nconst MENU_ITEM_SELECTOR = '[role=\"menuitem\"], [role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]';\n\n/**\n * MrlMenu component\n *\n * Renders a menu component with alignment relative to a trigger element\n * @param {MrlMenuProps} props - The props for the MrlMenu component\n * @returns {Element} - rendered MrlMenu component\n */\nexport function MrlMenu({\n\tactionState = { actionType: null, isOpen: false },\n\talignment = 'center',\n\tchildren,\n\tcloseOnScroll = false,\n\tcloseParent,\n\tcustomPosition,\n\tclickOutsideEvent = 'mouseup',\n\tdisableArrowOpen,\n\tdisableFlipping = false,\n\tid,\n\tisInternal = false,\n\tisSubMenu = false,\n\tspacing = 'default',\n\tmenuOffset = 10,\n\tportalProps = { id: PORTAL_LAYERS.MENU.name },\n\tposition = 'bottom',\n\ttriggerStopPropagation = false,\n\tonClose,\n\teventId,\n\ttriggerRef,\n\t...remainingProps\n}: MrlMenuProps): JSX.Element {\n\tconst defaultOpenState = position === 'static' || false;\n\n\tconst [state, setState] = React.useState({\n\t\tactionType: null,\n\t\tisOpen: defaultOpenState\n\t} as ActionState);\n\n\tconst trackInteraction = useMrlTrackInteraction('MrlMenu', eventId);\n\t// the menu opens and closes from several paths (click, keyboard, hover, click outside),\n\t// so open/close is emitted from the resulting state rather than each individual handler.\n\tconst wasOpenRef = React.useRef(defaultOpenState);\n\n\tReact.useEffect(() => {\n\t\tif (wasOpenRef.current === state.isOpen) return;\n\n\t\twasOpenRef.current = state.isOpen;\n\n\t\ttrackInteraction({\n\t\t\taction: state.isOpen ? 'open' : 'close',\n\t\t\tmetadata: { isSubMenu, trigger: state.actionType ?? 'unknown' },\n\t\t\tvariant: position\n\t\t});\n\t}, [state.isOpen, state.actionType, isSubMenu, position, trackInteraction]);\n\n\tconst menuRef = React.useRef<HTMLDivElement>(null);\n\tconst listRef = React.useRef<HTMLUListElement>(null);\n\tconst [menuItems, setMenuItems] = React.useState<HTMLButtonElement[]>([]);\n\tconst [menuRect, setMenuRect] = React.useState<DOMRect | null>(null);\n\n\t/**\n\t * Checks if the trigger element is disabled\n\t * @returns {boolean} - true if the trigger element is disabled, false otherwise\n\t */\n\tconst isTriggerDisabled = React.useCallback((): boolean => {\n\t\treturn isElementAriaDisabled(triggerRef?.current);\n\t}, [triggerRef]);\n\n\t/**\n\t * Sets up trigger event listeners to open and close the menu\n\t * @param e - mouse event\n\t */\n\tconst toggleMenuTrigger = React.useCallback(\n\t\t(e: MouseEvent) => {\n\t\t\tif (isTriggerDisabled()) return;\n\n\t\t\tif (triggerStopPropagation) {\n\t\t\t\tpreventDefault(e);\n\t\t\t}\n\n\t\t\tsetState((prevState) => ({ actionType: 'click', isOpen: !prevState.isOpen }));\n\t\t},\n\t\t[triggerStopPropagation, isTriggerDisabled]\n\t);\n\n\t/**\n\t * Used to display the menu when hovering over a menu item that has a submenu\n\t */\n\tconst showMenuHover = React.useCallback(() => {\n\t\tsetState({ actionType: 'click', isOpen: true });\n\t}, []);\n\n\tconst showMenuTap = React.useCallback(() => {\n\t\tsetState((prevState) => ({ actionType: 'click', isOpen: !prevState.isOpen }));\n\t}, []);\n\n\tconst hideMenuHover = React.useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tconst relatedTarget = event.relatedTarget as Node;\n\n\t\t\t// If the related target is not a child of the menu, close the menu\n\t\t\t// This prevents the menu from closing when hovering over a submenu item or trigger\n\t\t\tif (\n\t\t\t\ttriggerRef &&\n\t\t\t\tmenuRef.current &&\n\t\t\t\t!menuRef.current.contains(relatedTarget) &&\n\t\t\t\ttriggerRef.current &&\n\t\t\t\t!triggerRef.current.contains(relatedTarget)\n\t\t\t) {\n\t\t\t\tsetState({ actionType: null, isOpen: false });\n\t\t\t}\n\t\t},\n\t\t[triggerRef]\n\t);\n\n\t/**\n\t * Sets up trigger event listeners to open and close the menu with a keyboard\n\t */\n\tconst toggleMenuKey = React.useCallback(\n\t\t(e: KeyboardEvent) => {\n\t\t\tconst openMenu = () => {\n\t\t\t\tif (isTriggerDisabled()) return;\n\t\t\t\tsetState({ actionType: e.key as ActionType, isOpen: true });\n\t\t\t};\n\n\t\t\tif (!state.isOpen) {\n\t\t\t\tif (isSubMenu) {\n\t\t\t\t\tswitch (e.key) {\n\t\t\t\t\t\tcase 'ArrowRight':\n\t\t\t\t\t\tcase 'Enter':\n\t\t\t\t\t\tcase ' ':\n\t\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\t\topenMenu();\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tswitch (e.key) {\n\t\t\t\t\tcase 'ArrowDown':\n\t\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\t\tif (!disableArrowOpen && !isTriggerDisabled()) {\n\t\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\t\topenMenu();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Enter':\n\t\t\t\t\tcase ' ':\n\t\t\t\t\t\tif (isTriggerDisabled()) return;\n\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\topenMenu();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[state.isOpen, isTriggerDisabled, disableArrowOpen, isSubMenu]\n\t);\n\n\tconst closeMenu = React.useCallback(\n\t\t(shouldCloseParent = true) => {\n\t\t\tif (position === 'static') return;\n\n\t\t\t/**\n\t\t\t * What is closeParent?\n\t\t\t *\n\t\t\t * It is passed from the context provider to the MenuItem (which helps render our submenus)\n\t\t\t * When we render the submenu, we pass the closeMenu function as \"closeParent\" to the submenu.\n\t\t\t * This allows us to trigger closing the parent menu when the submenu is closed. And that's\n\t\t\t * what this call is for.\n\t\t\t */\n\t\t\tif (shouldCloseParent && closeParent) closeParent();\n\n\t\t\tsetState({ actionType: null, isOpen: false });\n\t\t\tonClose?.();\n\t\t},\n\t\t[position, closeParent, onClose]\n\t);\n\n\t/**\n\t * Click outside to dismiss the menu\n\t * @param e\n\t */\n\tconst disableClickOutside = !state.isOpen || position === 'static';\n\tuseClickOutside(menuRef, triggerRef, clickOutsideEvent, closeMenu, disableClickOutside);\n\n\tconst handleMenuKeyUp = (e: React.KeyboardEvent) => {\n\t\tconst actions: ActionType[] = ['ArrowUp', 'ArrowDown', 'ArrowRight', 'Enter', 'Escape', ' '];\n\n\t\tif (actions.includes(e.key as ActionType)) {\n\t\t\tpreventDefault(e);\n\t\t}\n\t};\n\n\t/**\n\t * Focus management when someone is using a keyboard to navigate the menu\n\t * @param e - keyboard event\n\t */\n\tconst handleMenuKey = (e: React.KeyboardEvent) => {\n\t\tconst currentIndex = menuItems.findIndex((item) => document.activeElement === item);\n\t\tlet nextIndex: number;\n\n\t\tif (state.isOpen) {\n\t\t\tswitch (e.key) {\n\t\t\t\tcase 'ArrowDown':\n\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\tnextIndex = currentIndex < menuItems.length - 1 ? currentIndex + 1 : currentIndex;\n\t\t\t\t\tmenuItems[nextIndex]?.focus();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\tnextIndex = currentIndex > 0 ? currentIndex - 1 : 0;\n\t\t\t\t\tmenuItems[nextIndex]?.focus();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowRight':\n\t\t\t\tcase 'ArrowLeft':\n\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Escape':\n\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\ttriggerRef?.current?.focus();\n\t\t\t\t\tcloseMenu(false);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Tab':\n\t\t\t\t\tif (!isSubMenu && position !== 'static') {\n\t\t\t\t\t\tif (e.shiftKey) {\n\t\t\t\t\t\t\t// Handle shift + tab: move focus to the previous item\n\t\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\t\tif (triggerRef) {\n\t\t\t\t\t\t\t\tconst prevElement = findAdjacentInteractiveElement(triggerRef, 'previous');\n\t\t\t\t\t\t\t\tprevElement?.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Regular tab: close the menu or move to the next item\n\t\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\t\tif (triggerRef) {\n\t\t\t\t\t\t\t\tconst nextElement = findAdjacentInteractiveElement(triggerRef);\n\t\t\t\t\t\t\t\tnextElement?.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcloseMenu();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * useEffect hooks to handle menu state changes\n\t */\n\n\tReact.useEffect(() => {\n\t\tif (triggerRef?.current) {\n\t\t\ttriggerRef.current.setAttribute('aria-haspopup', 'menu');\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\tReact.useEffect(() => {\n\t\tif (position === 'static') {\n\t\t\tsetState({ actionType: 'click', isOpen: true });\n\t\t}\n\t}, [position]);\n\n\tReact.useEffect(() => {\n\t\ttriggerRef?.current?.setAttribute('aria-expanded', state.isOpen.toString());\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen]);\n\n\tReact.useEffect(() => {\n\t\tif (!isSubMenu && position !== 'static')\n\t\t\tsetState({ actionType: actionState.actionType, isOpen: actionState.isOpen });\n\t}, [actionState.isOpen, actionState.actionType, isSubMenu, position]);\n\n\t// setup event handlers for mouse, keyboard, and scroll interactions\n\tReact.useEffect(() => {\n\t\tconst triggerElement = triggerRef?.current;\n\t\tconst menuElement = menuRef?.current;\n\t\tconst menuItems = menuElement?.querySelectorAll(MENU_ITEM_SELECTOR);\n\n\t\tlet scrollableParent: HTMLElement | Window;\n\n\t\tif (triggerElement) {\n\t\t\ttriggerElement.addEventListener('mousedown', preventDefault);\n\t\t\tif (!isSubMenu) triggerElement.addEventListener('click', toggleMenuTrigger);\n\t\t\ttriggerElement.addEventListener('keydown', toggleMenuKey);\n\n\t\t\t// Setup event listeners for when the menu is a submenu\n\t\t\tif (isSubMenu) {\n\t\t\t\ttriggerElement.addEventListener('mouseover', showMenuHover);\n\t\t\t\ttriggerElement.addEventListener('mouseout', hideMenuHover);\n\n\t\t\t\tif (isTouchDevice()) {\n\t\t\t\t\ttriggerElement.addEventListener('touchend', showMenuTap);\n\t\t\t\t}\n\n\t\t\t\tif (menuElement) {\n\t\t\t\t\tmenuElement.addEventListener('mouseover', showMenuHover);\n\t\t\t\t\tmenuElement.addEventListener('mouseout', hideMenuHover);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (closeOnScroll) {\n\t\t\t\tscrollableParent = getScrollableParent(triggerElement);\n\t\t\t\tif (scrollableParent) {\n\t\t\t\t\tscrollableParent.addEventListener('scroll', () => closeMenu(), {\n\t\t\t\t\t\tcapture: true,\n\t\t\t\t\t\tpassive: true\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\ttriggerElement.removeEventListener('mousedown', preventDefault);\n\t\t\t\tif (!isSubMenu) triggerElement.removeEventListener('click', toggleMenuTrigger);\n\t\t\t\ttriggerElement.removeEventListener('keydown', toggleMenuKey);\n\n\t\t\t\tif (menuItems) {\n\t\t\t\t\tmenuItems.forEach((item: Element) => {\n\t\t\t\t\t\tif (!item.getAttribute('aria-haspopup')) {\n\t\t\t\t\t\t\titem.removeEventListener('mousedown', () => closeMenu());\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (isSubMenu) {\n\t\t\t\t\ttriggerElement.removeEventListener('mouseover', showMenuHover);\n\t\t\t\t\ttriggerElement.removeEventListener('mouseout', hideMenuHover);\n\n\t\t\t\t\tif (isTouchDevice()) {\n\t\t\t\t\t\ttriggerElement.removeEventListener('touchstart', showMenuHover);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (menuElement) {\n\t\t\t\t\t\tmenuElement.removeEventListener('mouseover', showMenuHover);\n\t\t\t\t\t\tmenuElement.removeEventListener('mouseout', hideMenuHover);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (closeOnScroll && scrollableParent) {\n\t\t\t\t\tscrollableParent.removeEventListener('scroll', () => closeMenu());\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}, [\n\t\tcloseOnScroll,\n\t\tisSubMenu,\n\t\ttriggerRef,\n\t\ttoggleMenuTrigger,\n\t\ttoggleMenuKey,\n\t\tshowMenuHover,\n\t\thideMenuHover,\n\t\tcloseMenu,\n\t\tshowMenuTap\n\t]);\n\n\t// This use effect handles a few things when we open the menu:\n\t// - making sure that the menu component is aware of it's menu items\n\t// - adding a class to the trigger element when the submenu is open for styling\n\t// - storing the menu rect in state for positioning calculations\n\tReact.useEffect(() => {\n\t\tif (state.isOpen) {\n\t\t\tconst foundMenuItems = Array.from(\n\t\t\t\tmenuRef.current?.querySelectorAll(MENU_ITEM_SELECTOR) || []\n\t\t\t) as HTMLButtonElement[];\n\n\t\t\tsetMenuItems(foundMenuItems);\n\t\t}\n\n\t\tif (state.isOpen && isSubMenu) {\n\t\t\ttriggerRef?.current?.classList.add(itemStyles['MrlMenuItem--item--submenuOpen']);\n\t\t} else if (!state.isOpen && isSubMenu) {\n\t\t\ttriggerRef?.current?.classList.remove(itemStyles['MrlMenuItem--item--submenuOpen']);\n\t\t}\n\n\t\t// For consistent submenu calculations, we are storing the menu rect in state\n\t\t// Anytime we need to use the menu rect, we want to make sure the values are based\n\t\t// on the original state of the menu for proper transformations\n\t\tif (!menuRect && menuRef.current) {\n\t\t\tconst newRect = menuRef.current?.getBoundingClientRect();\n\t\t\tsetMenuRect(newRect || null);\n\t\t}\n\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen, menuRect, isSubMenu]);\n\n\t/**\n\t * Focus management for when the menu is opening or closing\n\t */\n\tReact.useEffect(() => {\n\t\tif (menuItems.length > 0) {\n\t\t\tlet menuItemToFocus;\n\n\t\t\tswitch (state.actionType) {\n\t\t\t\tcase 'Enter':\n\t\t\t\tcase 'ArrowDown':\n\t\t\t\tcase ' ':\n\t\t\t\t\tmenuItemToFocus = menuItems[0];\n\t\t\t\t\tmenuItemToFocus?.focus();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\tmenuItemToFocus = menuItems[menuItems.length - 1];\n\t\t\t\t\tmenuItemToFocus?.focus();\n\n\t\t\t\t\t// Scroll to the bottom of the menu when the last item is focused\n\t\t\t\t\t// setTimeout is required to ensure the element has been rendered\n\t\t\t\t\t// and the scrollHeight is accurate prior to scrolling\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tif (listRef.current) {\n\t\t\t\t\t\t\tlistRef.current.scrollTo(0, listRef.current.scrollHeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 20);\n\t\t\t}\n\n\t\t\tif (isSubMenu && state.actionType === 'ArrowRight') {\n\t\t\t\tmenuItemToFocus = menuItems[0];\n\t\t\t\tmenuItemToFocus?.focus();\n\t\t\t}\n\t\t}\n\t}, [isSubMenu, menuItems, state.actionType]);\n\n\t/**\n\t * Menu scroll behavior\n\t *\n\t * When the menu cannot fit in the preferred or flipped position,\n\t * this hook constrains the menu height and enables internal scrolling.\n\t * Called before useTriggerPosition so that isScrolling can disable flipping,\n\t * preventing the positioning hook from fighting the scroll constraint.\n\t */\n\tconst disableMenuScroll =\n\t\tisSubMenu || !state.isOpen || position === 'static' || position === 'ignore';\n\n\t/**\n\t * Sets overflow (scrolling) on menu when there is no space to display\n\t * the menu in the preferred or flipped position.\n\t */\n\tconst menuScroll = useMenuScroll(\n\t\ttriggerRef,\n\t\tlistRef,\n\t\tposition,\n\t\tmenuOffset,\n\t\tstate.isOpen,\n\t\tdisableMenuScroll\n\t);\n\n\t/**\n\t * Primary menu positioning, alignment, and transition styling\n\t *\n\t * This hook is only enabled if isSubMenu is FALSE\n\t */\n\tconst disableTriggerPosition = isSubMenu || !state.isOpen || position === 'static';\n\tconst menuPositionStyles = useTriggerPosition(\n\t\ttriggerRef,\n\t\tmenuRef,\n\t\t{\n\t\t\talign: alignment,\n\t\t\tcustomPosition: customPosition,\n\t\t\tposition: position\n\t\t},\n\t\tstate.isOpen,\n\t\tmenuOffset,\n\t\tdisableTriggerPosition,\n\t\tdisableFlipping || menuScroll.isScrolling\n\t);\n\n\t/**\n\t * The first position is calculated after the menu renders, so it would paint for a frame\n\t * at its initial (or previous) position. Keep it hidden until it has been positioned.\n\t * Uses opacity instead of visibility so menu items can still receive focus.\n\t */\n\tconst isAwaitingPosition = !disableTriggerPosition && !menuPositionStyles.isPositioned;\n\tconst hideUntilPositionedStyles = isAwaitingPosition ? { opacity: 0 } : undefined;\n\n\t/**\n\t * Submenu positioning and alignment\n\t *\n\t * This hook is only enabled if isSubMenu is TRUE\n\t */\n\tconst subMenuPosition = useSubMenuElementPosition(\n\t\ttriggerRef,\n\t\tmenuRef,\n\t\tisSubMenu,\n\t\tstate.isOpen,\n\t\tmenuRect,\n\t\t// disable the subelement positioning if it's not a submenu\n\t\t!isSubMenu\n\t);\n\n\tconst inlineStyles = {\n\t\tmenu: {\n\t\t\tleft: menuPositionStyles.left,\n\t\t\tposition: 'fixed' as const,\n\t\t\ttop: menuPositionStyles.top\n\t\t},\n\t\tsubmenu: {\n\t\t\tleft: subMenuPosition.left,\n\t\t\ttop: subMenuPosition.top\n\t\t}\n\t};\n\n\t/**\n\t * React Spring transitions for the menu\n\t */\n\tconst transitionConfig = {\n\t\tconfig: { duration: state.isOpen ? 300 : 150 },\n\t\tenter: { opacity: 1, transform: 'translateY(0)' },\n\t\tfrom: { opacity: 0, transform: 'translateY(4px)' },\n\t\tleave: { opacity: 0, transform: 'translateY(4px)' }\n\t};\n\n\tconst transitionStatic = {\n\t\tconfig: { duration: 0 },\n\t\tenter: { opacity: 1, transform: 'translateY(0)' }\n\t};\n\n\tconst transitions = useTransition(\n\t\tstate.isOpen,\n\t\tposition === 'static' ? transitionStatic : transitionConfig\n\t);\n\n\tconst menuClasses = classnames(styles['MrlMenu'], 'MrlMenu', {\n\t\t[styles['MrlMenu--submenu']]: isSubMenu,\n\t\t[styles.open]: state.isOpen,\n\t\t[styles['MrlMenu--compact']]: spacing === 'compact',\n\t\t[styles['MrlMenu--static']]: position === 'static',\n\t\t[styles['MrlMenu--internal']]: isInternal,\n\t\t[styles['MrlMenu--scrolling']]: menuScroll.isScrolling,\n\t\t[styles['MrlMenu--ignore']]: position === 'ignore'\n\t});\n\n\tconst positionStyles = isSubMenu\n\t\t? inlineStyles.submenu\n\t\t: position !== 'static'\n\t\t\t? inlineStyles.menu\n\t\t\t: {};\n\n\tconst menuScrollStyles =\n\t\t(menuScroll.maxHeight !== undefined && { maxHeight: menuScroll.maxHeight }) || undefined;\n\n\tconst renderMenu = () => {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{transitions(\n\t\t\t\t\t(style, item) =>\n\t\t\t\t\t\titem && (\n\t\t\t\t\t\t\t<animated.div\n\t\t\t\t\t\t\t\tclassName={menuClasses}\n\t\t\t\t\t\t\t\tid={id}\n\t\t\t\t\t\t\t\tstyle={{ ...positionStyles, ...style, ...hideUntilPositionedStyles }}\n\t\t\t\t\t\t\t\tonKeyUp={handleMenuKeyUp}\n\t\t\t\t\t\t\t\tonKeyDown={handleMenuKey}\n\t\t\t\t\t\t\t\tref={menuRef}\n\t\t\t\t\t\t\t\trole=\"none\"\n\t\t\t\t\t\t\t\t{...remainingProps}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ul ref={listRef} role=\"menu\" style={menuScrollStyles}>\n\t\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</animated.div>\n\t\t\t\t\t\t)\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t};\n\n\t// For managing and restoring focus to the original menu trigger\n\t// Ensures the triggerRef in context is always the parent triggerRef\n\tconst parentContext = React.useContext(MrlMenuContext);\n\tconst contextTriggerRef = isSubMenu ? parentContext?.triggerRef : triggerRef;\n\n\treturn (\n\t\t<MrlMenuContext.Provider\n\t\t\tvalue={{\n\t\t\t\tcloseMenu,\n\t\t\t\tcloseParent: !isSubMenu ? closeMenu : undefined,\n\t\t\t\ttriggerRef: contextTriggerRef\n\t\t\t}}\n\t\t>\n\t\t\t{isSubMenu || position === 'static' ? (\n\t\t\t\trenderMenu()\n\t\t\t) : (\n\t\t\t\t<MrlPortal layer={portalProps.layer || PORTAL_LAYERS.MENU} {...portalProps}>\n\t\t\t\t\t{renderMenu()}\n\t\t\t\t</MrlPortal>\n\t\t\t)}\n\t\t</MrlMenuContext.Provider>\n\t);\n\t/* eslint-enable */\n}\n\nMrlMenu.componentType = 'Menu';\n"],"names":["MENU_ITEM_SELECTOR","MrlMenu","_ref","_ref$actionState","actionState","actionType","isOpen","_ref$alignment","alignment","children","_ref$closeOnScroll","closeOnScroll","closeParent","customPosition","_ref$clickOutsideEven","clickOutsideEvent","disableArrowOpen","_ref$disableFlipping","disableFlipping","id","_ref$isInternal","isInternal","_ref$isSubMenu","isSubMenu","_ref$spacing","spacing","_ref$menuOffset","menuOffset","_ref$portalProps","portalProps","PORTAL_LAYERS","MENU","name","_ref$position","position","_ref$triggerStopPropa","triggerStopPropagation","onClose","eventId","triggerRef","remainingProps","_objectWithoutProperties","_excluded","defaultOpenState","_React$useState","React","useState","_React$useState2","_slicedToArray","state","setState","trackInteraction","useMrlTrackInteraction","wasOpenRef","useRef","useEffect","_state$actionType","current","action","metadata","trigger","variant","menuRef","listRef","_React$useState3","_React$useState4","menuItems","setMenuItems","_React$useState5","_React$useState6","menuRect","setMenuRect","isTriggerDisabled","useCallback","isElementAriaDisabled","toggleMenuTrigger","e","preventDefault","prevState","showMenuHover","showMenuTap","hideMenuHover","event","relatedTarget","contains","toggleMenuKey","openMenu","key","closeMenu","shouldCloseParent","arguments","length","undefined","disableClickOutside","useClickOutside","handleMenuKeyUp","actions","includes","handleMenuKey","_menuItems$nextIndex","_menuItems$nextIndex2","_triggerRef$current","currentIndex","findIndex","item","document","activeElement","nextIndex","focus","shiftKey","prevElement","findAdjacentInteractiveElement","nextElement","setAttribute","_triggerRef$current2","toString","triggerElement","menuElement","querySelectorAll","scrollableParent","addEventListener","isTouchDevice","getScrollableParent","capture","passive","removeEventListener","forEach","getAttribute","_menuRef$current","foundMenuItems","Array","from","_triggerRef$current3","classList","add","itemStyles","_triggerRef$current4","remove","_menuRef$current2","newRect","getBoundingClientRect","_menuItemToFocus","_menuItemToFocus2","menuItemToFocus","setTimeout","scrollTo","scrollHeight","_menuItemToFocus3","disableMenuScroll","menuScroll","useMenuScroll","disableTriggerPosition","menuPositionStyles","useTriggerPosition","align","isScrolling","isAwaitingPosition","isPositioned","hideUntilPositionedStyles","opacity","subMenuPosition","useSubMenuElementPosition","inlineStyles","menu","left","top","submenu","transitionConfig","config","duration","enter","transform","leave","transitionStatic","transitions","useTransition","menuClasses","classnames","styles","open","positionStyles","menuScrollStyles","maxHeight","renderMenu","createElement","Fragment","style","animated","div","_extends","className","_objectSpread","onKeyUp","onKeyDown","ref","role","parentContext","useContext","MrlMenuContext","contextTriggerRef","Provider","value","MrlPortal","layer","componentType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqKA,IAAMA,kBAAkB,GAAG,sEAAsE;;AAEjG;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,OAAOA,CAAAC,IAAA,EAsBO;AAAA,EAAA,IAAAC,gBAAA,GAAAD,IAAA,CArB7BE,WAAW;IAAXA,WAAW,GAAAD,gBAAA,KAAA,MAAA,GAAG;AAAEE,MAAAA,UAAU,EAAE,IAAI;AAAEC,MAAAA,MAAM,EAAE;AAAM,KAAC,GAAAH,gBAAA;IAAAI,cAAA,GAAAL,IAAA,CACjDM,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,QAAQ,GAAAA,cAAA;IACpBE,QAAQ,GAAAP,IAAA,CAARO,QAAQ;IAAAC,kBAAA,GAAAR,IAAA,CACRS,aAAa;AAAbA,IAAAA,aAAa,GA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EnI,OAAQ;AAACoI,MAAAA,IAAI,EAAC,MAAM;AAACT,MAAAA,KAAK,EAAEL;AAAiB,KAAA,EACpD5K,QACE,CACS,CAEjB,CACC,CAAC;EAEL,CAAC;;AAED;AACA;AACA,EAAA,IAAM2L,aAAa,GAAGvJ,gBAAK,CAACwJ,UAAU,CAACC,6BAAc,CAAC;AACtD,EAAA,IAAMC,iBAAiB,GAAGhL,SAAS,GAAG6K,aAAa,KAAA,IAAA,IAAbA,aAAa,KAAA,MAAA,GAAA,MAAA,GAAbA,aAAa,CAAE7J,UAAU,GAAGA,UAAU;AAE5E,EAAA,oBACCM,gBAAA,CAAA2I,aAAA,CAACc,6BAAc,CAACE,QAAQ,EAAA;AACvBC,IAAAA,KAAK,EAAE;MACNjH,SAAS;AACT5E,MAAAA,WAAW,EAAE,CAACW,SAAS,GAAGiE,SAAS,GAAGI,SAAS;AAC/CrD,MAAAA,UAAU,EAAEgK;AACb;AAAE,GAAA,EAEDhL,SAAS,IAAIW,QAAQ,KAAK,QAAQ,GAClCqJ,UAAU,EAAE,gBAEZ1I,gBAAA,CAAA2I,aAAA,CAACkB,mBAAS,EAAAb,iCAAA,CAAA;AAACc,IAAAA,KAAK,EAAE9K,WAAW,CAAC8K,KAAK,IAAI7K,mBAAa,CAACC;AAAK,GAAA,EAAKF,WAAW,CAAA,EACxE0J,UAAU,EACD,CAEY,CAAC;AAE3B;AACD;AAEAtL,OAAO,CAAC2M,aAAa,GAAG,MAAM;;;;"}
@@ -343,8 +343,7 @@ function MrlPopover(_ref) {
343
343
  // Only while open: isPositioned resets on close, which would cut the leave transition short
344
344
  var isAwaitingPosition = !isSubMenu && state.isOpen && !menuPosition.isPositioned;
345
345
  var hideUntilPositionedStyles = isAwaitingPosition ? {
346
- opacity: 0,
347
- pointerEvents: 'none'
346
+ opacity: 0
348
347
  } : undefined;
349
348
  var subMenuPosition = useSubMenuElementPosition.useSubMenuElementPosition(triggerRef, menuRef, isSubMenu, state.isOpen, menuRect, !isSubMenu);
350
349
  var menuPositionState = menuPosition.flipped ? flipPosition.flipPosition(position) : position;
@@ -1 +1 @@
1
- {"version":3,"file":"MrlPopover.js","sources":["../../../../../src/components/popover/MrlPopover/MrlPopover.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { close } from '@muraldevkit/ds-icons';\nimport { MrlIconButton } from '../../button/MrlIconButton/MrlIconButton';\nimport { MrlFocusTrap } from '../../focus-trap/MrlFocusTrap/MrlFocusTrap';\nimport { MrlPortal, PortalProps } from '../../portal/MrlPortal';\nimport { MrlSvg } from '../../svg/MrlSvg/MrlSvg';\nimport { useTriggerPosition } from '../../../hooks/useTriggerPosition';\nimport { useBrowserEdgeScroll } from '../../menu/hooks/useBrowserEdgeScroll';\nimport { useClickOutside } from '../../../hooks/useClickOutside';\nimport { useSubMenuElementPosition } from '../../menu/hooks/useSubMenuElementPosition';\nimport { MenuPosition, MenuAlignment, ActionState, CustomMenuPosition } from '../../menu/constants';\nimport {\n\tpreventDefault,\n\tgetFocusableElementsInsideElement,\n\tfindAdjacentInteractiveElement,\n\tisElementAriaDisabled\n} from '../../../utils';\nimport { PORTAL_LAYERS } from '../../../utils/layers';\nimport { useTransition, animated } from '@react-spring/web';\nimport { SELECT_MENU_LIST_CLASS_NAME } from '../../form/select/MrlSelect/MrlSelect';\nimport { MULTI_SELECT_MENU_LIST_CLASS_NAME } from '../../form/select/MrlMultiSelect/MrlMultiSelect';\nimport styles from './MrlPopover.module.scss';\nimport { flipPosition } from '../../menu/utilities/flip-position';\nimport { getDataPoint } from './utilities/get-data-point';\nimport { getOffset } from './utilities/get-offset';\nimport { useMrlPopoverEventHandlers } from './hooks/use-mrl-popover-event-handlers';\nimport { MrlPopoverContext } from './context/MrlPopoverContext';\nimport { MrlPopoverScrollContainer } from './MrlPopoverScrollContainer';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\nconst POPOVER_CLICKOUTSIDE_WHITELIST = [\n\t'#mrl-select-portal',\n\t'#mrl-popover-menu-portal',\n\t`.${SELECT_MENU_LIST_CLASS_NAME}`,\n\t`.${MULTI_SELECT_MENU_LIST_CLASS_NAME}`\n];\n\ntype RenderPropFn = ({ closeMenu }: { closeMenu: () => void }) => JSX.Element;\n\nexport interface MrlPopoverProps {\n\t/**\n\t * Set initial state of menu\n\t * @default { actionType: null, isOpen: false }\n\t */\n\tactionState?: ActionState;\n\n\t/** Label for the popover */\n\tariaLabel?: string;\n\n\t/** ID of element to associate a label */\n\tariaLabelledBy?: string;\n\n\t/** Children to be rendered within the menu component*/\n\tchildren: React.ReactNode | RenderPropFn;\n\n\t/** Custom class names for the popover */\n\tclassName?: string;\n\n\t/** Custom position for the menu */\n\tcustomPosition?: CustomMenuPosition;\n\n\t/**\n\t * If the popover should disable click to open\n\t *\n\t * Example usage: if you do not want your component opened via click, set to true\n\t */\n\tdisableClickToOpen?: boolean;\n\n\t/**\n\t * If the popover should close when clicking outside of the menu\n\t *\n\t * Example usage: MrlCallout component should not close when clicking outside, so it's set to true\n\t */\n\tdisableClickOutside?: boolean;\n\n\t/**\n\t * Disable flipping of the popover when it goes off the screen\n\t * @default false\n\t */\n\tdisableFlipping?: boolean;\n\n\t/**\n\t * If the popover should disable focus trap\n\t *\n\t * The impact of enabling or disabling focus trap:\n\t * - enabled : focus will remain trapped in the popover until a user closes the popover\n\t * - disabled : focus will move to the next interactive element in the DOM when the user\n\t * tabs out of the popover. Focus will move to the trigger when the user shift+tabs out of the popover\n\t *\n\t * Additional scenarios to consider with focus trap is disabled. When hasCloseButton is set to true/false:\n\t * - true : if a user shows the close button, the popover will stay open until explicitly dismissed\n\t * - false : if a user hides the close button, the popover will close when a user tabs out of it from the beginning or end\n\t */\n\tdisableFocusTrap?: boolean;\n\n\t/** If the popover should have a close button */\n\thasCloseButton?: boolean;\n\n\t/** Unique identifier for the menu */\n\tid?: string;\n\n\t/** If the menu is a submenu */\n\tisSubMenu?: boolean;\n\n\t/**\n\t * Horizontal and vertical alignment of the menu relative to the trigger element\n\t *\n\t * This does not impact submenus\n\t * @default 'bottom'\n\t */\n\tposition?: MenuPosition;\n\n\t/**\n\t * Alignment of the popover along the axis perpendicular to its position\n\t * - For position 'top'/'bottom': 'start' = left, 'end' = right, 'center' = center horizontally\n\t * - For position 'left'/'right': 'start' = top, 'end' = bottom, 'center' = center vertically\n\t *\n\t * @default 'center'\n\t *\n\t * This does not impact submenus\n\t */\n\talignment?: MenuAlignment;\n\n\t/**\n\t * spacing of menu\n\t * - 'default' has 16px padding\n\t * - 'compact' has 12px padding\n\t */\n\tspacing?: 'default' | 'compact';\n\n\t/**\n\t * Reference to the DOM element that triggers this menu.\n\t */\n\ttriggerRef?: React.RefObject<HTMLElement>;\n\n\t/**\n\t * If the menu should be rendered with the inverse theme\n\t * @default 'primary'\n\t */\n\tkind?: 'primary' | 'inverse';\n\n\t/**\n\t * If the menu should have a pointer element\n\t * @default false\n\t */\n\tpoint?: boolean;\n\n\t/**\n\t * Configuration for the portal component\n\t */\n\tportalProps?: Omit<PortalProps, 'children'>;\n\n\t/**\n\t * Offset in pixels for the popover\n\t *\n\t * The popover automatically calculates the proper offset based on the position and alignment\n\t * this prop will override those values.\n\t */\n\toffset?: number;\n\n\t/**\n\t * Callback to be called when the menu is opened\n\t */\n\tonOpen?: () => void;\n\n\t/**\n\t * Callback to be called when the menu is closed\n\t * @param type - type of close event\n\t */\n\tonClose?: (type?: string) => void;\n\n\t/**\n\t * data-qa attribute for the popover\n\t */\n\t['data-qa']?: string;\n\n\t/**\n\t * Enables interaction tracking for this popover. Provide a stable, non-PII id\n\t * (e.g. 'sticky-note-color-picker'). When omitted, the popover emits no analytics.\n\t */\n\teventId?: string;\n}\n\n/**\n * MrlPopover\n *\n * Renders a popover component with position and alignment relative to a trigger element\n * @param {MrlPopoverProps} props - The props for the MrlPopover component\n * @returns {Element} - rendered MrlPopover component\n */\nexport function MrlPopover({\n\talignment = 'center',\n\tariaLabel,\n\tariaLabelledBy,\n\tchildren,\n\tclassName,\n\tcustomPosition,\n\tdisableClickToOpen = false,\n\tdisableClickOutside = false,\n\tdisableFlipping = false,\n\tdisableFocusTrap = false,\n\thasCloseButton = false,\n\tspacing = 'default',\n\tid,\n\tisSubMenu = false,\n\tactionState = { actionType: null, isOpen: false },\n\tposition = 'bottom',\n\tpoint = true,\n\tportalProps = { id: PORTAL_LAYERS.POPOVER.name },\n\tkind = 'primary',\n\toffset,\n\tonClose,\n\tonOpen,\n\teventId,\n\ttriggerRef,\n\t...rest\n}: MrlPopoverProps): JSX.Element {\n\tconst [state, setState] = React.useState({\n\t\tactionType: null,\n\t\tisOpen: actionState.isOpen || false\n\t} as ActionState);\n\n\tconst trackInteraction = useMrlTrackInteraction('MrlPopover', eventId);\n\t// the popover opens and closes from several paths (trigger click, keyboard, click\n\t// outside, close button), so open/close is emitted from the resulting state.\n\tconst wasOpenRef = React.useRef(actionState.isOpen || false);\n\n\tReact.useEffect(() => {\n\t\tif (wasOpenRef.current === state.isOpen) return;\n\n\t\twasOpenRef.current = state.isOpen;\n\n\t\ttrackInteraction({\n\t\t\taction: state.isOpen ? 'open' : 'close',\n\t\t\tmetadata: { isSubMenu },\n\t\t\tvariant: position\n\t\t});\n\t}, [state.isOpen, isSubMenu, position, trackInteraction]);\n\n\t// stores all of the interactive elements in the popover for focus management\n\tconst [interactiveElements, setInteractiveElements] = React.useState<HTMLElement[]>([]);\n\tconst [menuRect, setMenuRect] = React.useState<DOMRect | null>(null);\n\tconst menuRef = React.useRef<HTMLDivElement>(null);\n\t/** Snapshot of trigger `aria-expanded` before we manage it; restored on popover unmount only. */\n\tconst triggerExpandedRestoreRef = React.useRef<{\n\t\tel: HTMLElement;\n\t\tvalue: string | null;\n\t} | null>(null);\n\n\t/**\n\t * Checks if the trigger element is disabled\n\t * @returns {boolean} - true if the trigger element is disabled, false otherwise\n\t */\n\tconst isTriggerDisabled = React.useCallback((): boolean => {\n\t\treturn isElementAriaDisabled(triggerRef?.current);\n\t}, [triggerRef]);\n\n\t/**\n\t * Opening and closing the menu\n\t */\n\tconst closeMenu = React.useCallback(() => {\n\t\tsetState({ actionType: null, isOpen: false });\n\t\tonClose?.();\n\t}, [onClose]);\n\n\tconst {\n\t\thandleClose,\n\t\thandleMenuKey,\n\t\thideMenuHover,\n\t\thandleTriggerSiblingKey,\n\t\ttoggleMenuKey,\n\t\ttoggleMenuTrigger,\n\t\tshowMenuHover\n\t} = useMrlPopoverEventHandlers({\n\t\tcloseMenu,\n\t\tdisableClickToOpen,\n\t\tdisableFocusTrap,\n\t\thasCloseButton,\n\t\tinteractiveElements,\n\t\tisSubMenu,\n\t\tisTriggerDisabled,\n\t\tmenuRef,\n\t\tsetState,\n\t\tstate,\n\t\ttriggerRef\n\t});\n\n\tuseClickOutside(\n\t\tmenuRef,\n\t\ttriggerRef,\n\t\t'mouseup',\n\t\tcloseMenu,\n\t\tdisableClickOutside || !state.isOpen,\n\t\tPOPOVER_CLICKOUTSIDE_WHITELIST\n\t);\n\n\tReact.useEffect(() => {\n\t\tif (isTriggerDisabled()) return;\n\n\t\tif (!isSubMenu) {\n\t\t\tsetState({ actionType: actionState.actionType, isOpen: actionState.isOpen });\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [isSubMenu, actionState.actionType, actionState.isOpen]);\n\n\t// This use effect handles storing the rect in state for positioning calculations\n\tReact.useLayoutEffect(() => {\n\t\tif (!state.isOpen) return;\n\n\t\t// For consistent calculations, we are storing the menu rect in state\n\t\t// Anytime we need to use the menu rect, we want to make sure the values are based\n\t\t// on the original state of the menu for proper transformations\n\t\tif (!menuRect && menuRef.current) {\n\t\t\tconst newRect = menuRef.current?.getBoundingClientRect();\n\t\t\tsetMenuRect(newRect || null);\n\t\t}\n\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen, isSubMenu]);\n\n\t// This use effect handles getting and setting the interactive elements in the popover.\n\t// These elements are used for focus management when focus trap is not enabled to ensure\n\t// that our tab order matches the visual order of the page\n\tReact.useEffect(() => {\n\t\tif (state.isOpen && !isSubMenu && menuRef.current) {\n\t\t\tif (disableFocusTrap) {\n\t\t\t\t// set the interactive elements so we can track focus location\n\t\t\t\tconst elements = getFocusableElementsInsideElement(menuRef.current as HTMLElement);\n\t\t\t\tsetInteractiveElements(elements);\n\n\t\t\t\t// without focus trap enabled, we want to focus the first interactive element\n\t\t\t\telements[0].focus();\n\t\t\t}\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen, menuRef.current]);\n\n\t// This use effect handles setting all of the event handlers for different parts of the component.\n\t// - trigger event handlers\n\t// - submenu event handlers\n\t// - menu event handlers\n\t// - \"next element\" event handlers, which are event handlers attached to the next interactive element after the trigger\n\t//\n\tReact.useEffect(() => {\n\t\tconst triggerElement = triggerRef?.current;\n\t\tconst menuElement = menuRef?.current;\n\t\tconst nextElement = findAdjacentInteractiveElement(triggerRef, 'next');\n\n\t\tif (triggerElement) {\n\t\t\ttriggerElement.addEventListener('mousedown', (e) => e.stopPropagation());\n\t\t\ttriggerElement.addEventListener('click', toggleMenuTrigger);\n\t\t\ttriggerElement.addEventListener('keydown', toggleMenuKey);\n\n\t\t\tif (nextElement) nextElement.addEventListener('keydown', handleTriggerSiblingKey);\n\n\t\t\t// Setup event listeners for when the menu is a submenu\n\t\t\tif (isSubMenu) {\n\t\t\t\tconst menuElement = menuRef?.current;\n\n\t\t\t\ttriggerElement.addEventListener('mouseover', showMenuHover);\n\t\t\t\ttriggerElement.addEventListener('mouseout', hideMenuHover);\n\n\t\t\t\tif (menuElement) {\n\t\t\t\t\tmenuElement.addEventListener('mouseover', showMenuHover);\n\t\t\t\t\tmenuElement.addEventListener('mouseout', hideMenuHover);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\ttriggerElement.removeEventListener('mousedown', preventDefault);\n\t\t\t\ttriggerElement.removeEventListener('click', toggleMenuTrigger);\n\t\t\t\ttriggerElement.removeEventListener('keydown', toggleMenuKey);\n\n\t\t\t\tif (nextElement) nextElement.removeEventListener('keydown', handleTriggerSiblingKey);\n\n\t\t\t\tif (isSubMenu) {\n\t\t\t\t\ttriggerElement.removeEventListener('mouseover', showMenuHover);\n\t\t\t\t\ttriggerElement.removeEventListener('mouseout', hideMenuHover);\n\n\t\t\t\t\tif (menuElement) {\n\t\t\t\t\t\tmenuElement.removeEventListener('mouseover', showMenuHover);\n\t\t\t\t\t\tmenuElement.removeEventListener('mouseout', hideMenuHover);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [\n\t\tcloseMenu,\n\t\tisSubMenu,\n\t\ttoggleMenuKey,\n\t\ttoggleMenuTrigger,\n\t\ttriggerRef?.current,\n\t\thideMenuHover,\n\t\tshowMenuHover,\n\t\thasCloseButton,\n\t\thandleClose\n\t]);\n\n\t/**\n\t * Popover triggers are not necessarily modal dialogs; use the generic 'true' (see ARIA in HTML).\n\t * Restore the previous DOM value when the trigger changes or this popover unmounts so host-owned\n\t * ARIA (e.g. aria-haspopup=\"menu\") is not left stale after a callout dismisses.\n\t */\n\tReact.useEffect(() => {\n\t\tconst el = triggerRef?.current;\n\t\tif (!el) return;\n\n\t\tconst previousValue = el.getAttribute('aria-haspopup');\n\t\tel.setAttribute('aria-haspopup', 'true');\n\n\t\t// Restore the previous value of the aria-haspopup attribute when the callout is removed from the DOM\n\t\treturn () => {\n\t\t\tif (previousValue === null) {\n\t\t\t\tel.removeAttribute('aria-haspopup');\n\t\t\t} else {\n\t\t\t\tel.setAttribute('aria-haspopup', previousValue);\n\t\t\t}\n\t\t};\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [triggerRef?.current]);\n\n\tReact.useEffect(() => {\n\t\tconst el = triggerRef?.current;\n\t\tif (!el) return;\n\n\t\t// Store the previous value of the aria-expanded attribute when the callout is added to the DOM\n\t\tif (!triggerExpandedRestoreRef.current || triggerExpandedRestoreRef.current.el !== el) {\n\t\t\ttriggerExpandedRestoreRef.current = {\n\t\t\t\tel,\n\t\t\t\tvalue: el.hasAttribute('aria-expanded') ? el.getAttribute('aria-expanded') : null\n\t\t\t};\n\t\t}\n\n\t\t// Set the aria-expanded attribute to the current state of the popover\n\t\tel.setAttribute('aria-expanded', state.isOpen.toString());\n\n\t\tif (state.isOpen) onOpen?.();\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen, onOpen, triggerRef?.current]);\n\n\t/**\n\t * Restore the previous value of the aria-expanded attribute when the callout is removed from the DOM\n\t */\n\tReact.useEffect(() => {\n\t\treturn () => {\n\t\t\tconst snap = triggerExpandedRestoreRef.current;\n\t\t\tif (!snap) return;\n\t\t\tconst { el, value } = snap;\n\n\t\t\tif (!document?.documentElement?.contains(el)) return;\n\n\t\t\tif (value === null) {\n\t\t\t\tel.removeAttribute('aria-expanded');\n\t\t\t} else {\n\t\t\t\tel.setAttribute('aria-expanded', value);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\t/**\n\t * Setup positioning styles, submenu positioning styles, scroll styles, and transition.\n\t */\n\tconst memoizedCustomPosition = React.useMemo(() => customPosition, [customPosition]);\n\tconst customPopoverPosition = memoizedCustomPosition || { left: 0, top: 0 };\n\n\tconst menuPosition = useTriggerPosition(\n\t\ttriggerRef,\n\t\tmenuRef,\n\t\t{\n\t\t\talign: alignment,\n\t\t\tcustomPosition: customPopoverPosition,\n\t\t\tposition: position\n\t\t},\n\t\tstate.isOpen,\n\t\toffset || getOffset(position, point),\n\t\tisSubMenu,\n\t\tdisableFlipping\n\t);\n\n\t// Only while open: isPositioned resets on close, which would cut the leave transition short\n\tconst isAwaitingPosition = !isSubMenu && state.isOpen && !menuPosition.isPositioned;\n\tconst hideUntilPositionedStyles = isAwaitingPosition\n\t\t? { opacity: 0, pointerEvents: 'none' as const }\n\t\t: undefined;\n\n\tconst subMenuPosition = useSubMenuElementPosition(\n\t\ttriggerRef,\n\t\tmenuRef,\n\t\tisSubMenu,\n\t\tstate.isOpen,\n\t\tmenuRect,\n\t\t!isSubMenu\n\t);\n\n\tconst menuPositionState = menuPosition.flipped ? flipPosition(position) : position;\n\tconst scrollStyles = useBrowserEdgeScroll(menuRef, menuPositionState, alignment);\n\n\tconst inlineStyles = {\n\t\tmenu: {\n\t\t\tleft: menuPosition.left,\n\t\t\tposition: 'fixed' as const,\n\t\t\ttop: menuPosition.top\n\t\t},\n\t\tsubmenu: {\n\t\t\tleft: subMenuPosition.left,\n\t\t\ttop: subMenuPosition.top\n\t\t}\n\t};\n\n\t/**\n\t * React Spring transitions for the menu\n\t */\n\tconst transitions = useTransition(state.isOpen, {\n\t\tconfig: { duration: 150 },\n\t\tenter: { opacity: 1, transform: 'translateY(0)' },\n\t\tfrom: { opacity: 0, transform: 'translateY(4px)' },\n\t\tleave: { opacity: 0, transform: 'translateY(4px)' }\n\t});\n\n\tconst menuClasses = classnames(\n\t\tstyles['MrlPopover'],\n\t\t'MrlPopover',\n\t\tstyles['MrlPopover--scrolling'],\n\t\tclassName,\n\t\t{\n\t\t\t[styles['MrlPopover--submenu']]: isSubMenu,\n\t\t\t[styles['inverse']]: kind === 'inverse',\n\t\t\t[styles['primary']]: kind === 'primary',\n\t\t\t[styles['compact']]: spacing === 'compact',\n\t\t\t[styles['default']]: spacing === 'default'\n\t\t}\n\t);\n\n\tconst positionStyles = isSubMenu ? inlineStyles.submenu : inlineStyles.menu;\n\n\tconst renderMenu = () => {\n\t\tconst inlineScrollStyles = isSubMenu ? {} : scrollStyles ? scrollStyles.styles : {};\n\t\tconst scrollClasses = classnames(\n\t\t\tstyles['MrlPopover--content'],\n\t\t\tstyles['MrlPopover--scrolling--content']\n\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{transitions(\n\t\t\t\t\t(style, item) =>\n\t\t\t\t\t\titem && (\n\t\t\t\t\t\t\t<MrlFocusTrap disabled={disableFocusTrap} containerRef={menuRef}>\n\t\t\t\t\t\t\t\t<animated.div\n\t\t\t\t\t\t\t\t\taria-label={ariaLabel}\n\t\t\t\t\t\t\t\t\taria-labelledby={ariaLabelledBy}\n\t\t\t\t\t\t\t\t\tclassName={menuClasses}\n\t\t\t\t\t\t\t\t\tid={id}\n\t\t\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\t\t\tstyle={{ ...positionStyles, ...style, ...hideUntilPositionedStyles }}\n\t\t\t\t\t\t\t\t\tonKeyDown={handleMenuKey}\n\t\t\t\t\t\t\t\t\tref={menuRef}\n\t\t\t\t\t\t\t\t\t{...rest}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<MrlPopoverScrollContainer className={scrollClasses} style={inlineScrollStyles}>\n\t\t\t\t\t\t\t\t\t\t{typeof children === 'function' && children({ closeMenu })}\n\t\t\t\t\t\t\t\t\t\t{typeof children !== 'function' && children}\n\t\t\t\t\t\t\t\t\t\t{hasCloseButton && (\n\t\t\t\t\t\t\t\t\t\t\t<MrlIconButton\n\t\t\t\t\t\t\t\t\t\t\t\tdata-qa=\"popover-close-button\"\n\t\t\t\t\t\t\t\t\t\t\t\twrapperClassName={styles['MrlPopover--close']}\n\t\t\t\t\t\t\t\t\t\t\t\ticon={<MrlSvg svg={close} />}\n\t\t\t\t\t\t\t\t\t\t\t\tkind={kind === 'inverse' ? 'ghost-inverse' : 'ghost'}\n\t\t\t\t\t\t\t\t\t\t\t\ttext=\"Close\"\n\t\t\t\t\t\t\t\t\t\t\t\tstate=\"default\"\n\t\t\t\t\t\t\t\t\t\t\t\tposition=\"right\"\n\t\t\t\t\t\t\t\t\t\t\t\ttipAnchor=\"center\"\n\t\t\t\t\t\t\t\t\t\t\t\tonMouseUp={closeMenu}\n\t\t\t\t\t\t\t\t\t\t\t\tonKeyDown={handleClose}\n\t\t\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t{point && (\n\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\tclassName={styles['MrlPopover--point']}\n\t\t\t\t\t\t\t\t\t\t\t\tdata-point={getDataPoint(menuPositionState, alignment)}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</MrlPopoverScrollContainer>\n\t\t\t\t\t\t\t\t</animated.div>\n\t\t\t\t\t\t\t</MrlFocusTrap>\n\t\t\t\t\t\t)\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t};\n\n\t/* eslint-disable */\n\treturn (\n\t\t<MrlPopoverContext.Provider\n\t\t\tvalue={{\n\t\t\t\tcloseMenu\n\t\t\t}}\n\t\t>\n\t\t\t{isSubMenu ? (\n\t\t\t\trenderMenu()\n\t\t\t) : (\n\t\t\t\t<MrlPortal layer={portalProps.layer || PORTAL_LAYERS.POPOVER} {...portalProps}>\n\t\t\t\t\t{renderMenu()}\n\t\t\t\t</MrlPortal>\n\t\t\t)}\n\t\t</MrlPopoverContext.Provider>\n\t);\n\t/* eslint-enable */\n}\n\nMrlPopover.componentType = 'Popover';\n"],"names":["POPOVER_CLICKOUTSIDE_WHITELIST","concat","SELECT_MENU_LIST_CLASS_NAME","MULTI_SELECT_MENU_LIST_CLASS_NAME","MrlPopover","_ref","_ref$alignment","alignment","ariaLabel","ariaLabelledBy","children","className","customPosition","_ref$disableClickToOp","disableClickToOpen","_ref$disableClickOuts","disableClickOutside","_ref$disableFlipping","disableFlipping","_ref$disableFocusTrap","disableFocusTrap","_ref$hasCloseButton","hasCloseButton","_ref$spacing","spacing","id","_ref$isSubMenu","isSubMenu","_ref$actionState","actionState","actionType","isOpen","_ref$position","position","_ref$point","point","_ref$portalProps","portalProps","PORTAL_LAYERS","POPOVER","name","_ref$kind","kind","offset","onClose","onOpen","eventId","triggerRef","rest","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","state","setState","trackInteraction","useMrlTrackInteraction","wasOpenRef","useRef","useEffect","current","action","metadata","variant","_React$useState3","_React$useState4","interactiveElements","setInteractiveElements","_React$useState5","_React$useState6","menuRect","setMenuRect","menuRef","triggerExpandedRestoreRef","isTriggerDisabled","useCallback","isElementAriaDisabled","closeMenu","_useMrlPopoverEventHa","useMrlPopoverEventHandlers","handleClose","handleMenuKey","hideMenuHover","handleTriggerSiblingKey","toggleMenuKey","toggleMenuTrigger","showMenuHover","useClickOutside","useLayoutEffect","_menuRef$current","newRect","getBoundingClientRect","elements","getFocusableElementsInsideElement","focus","triggerElement","menuElement","nextElement","findAdjacentInteractiveElement","addEventListener","e","stopPropagation","removeEventListener","preventDefault","el","previousValue","getAttribute","setAttribute","removeAttribute","value","hasAttribute","toString","_document","_document$documentEle","snap","document","documentElement","contains","memoizedCustomPosition","useMemo","customPopoverPosition","left","top","menuPosition","useTriggerPosition","align","getOffset","isAwaitingPosition","isPositioned","hideUntilPositionedStyles","opacity","pointerEvents","undefined","subMenuPosition","useSubMenuElementPosition","menuPositionState","flipped","flipPosition","scrollStyles","useBrowserEdgeScroll","inlineStyles","menu","submenu","transitions","useTransition","config","duration","enter","transform","from","leave","menuClasses","classnames","styles","positionStyles","renderMenu","inlineScrollStyles","scrollClasses","createElement","Fragment","style","item","MrlFocusTrap","disabled","containerRef","animated","div","_extends","tabIndex","_objectSpread","onKeyDown","ref","MrlPopoverScrollContainer","MrlIconButton","wrapperClassName","icon","MrlSvg","svg","close","text","tipAnchor","onMouseUp","size","getDataPoint","MrlPopoverContext","Provider","MrlPortal","layer","componentType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAMA,8BAA8B,GAAG,CACtC,oBAAoB,EACpB,0BAA0B,EAAA,GAAA,CAAAC,MAAA,CACtBC,qCAA2B,CAAA,EAAA,GAAA,CAAAD,MAAA,CAC3BE,gDAAiC,CAAA,CACrC;AAoJD;AACA;AACA;AAC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AQ;AACrD4I,MAAAA,IAAI,EAAC,OAAO;AACZ9H,MAAAA,KAAK,EAAC,SAAS;AACfvB,MAAAA,QAAQ,EAAC,OAAO;AAChBsJ,MAAAA,SAAS,EAAC,QAAQ;AAClBC,MAAAA,SAAS,EAAExG,SAAU;AACrB6F,MAAAA,SAAS,EAAE1F,WAAY;AACvBsG,MAAAA,IAAI,EAAC;AAAO,KACZ,CACD,EACAtJ,KAAK,iBACLiB,gBAAA,CAAA6G,aAAA,CAAA,KAAA,EAAA;AACCtJ,MAAAA,SAAS,EAAEiJ,yBAAM,CAAC,mBAAmB,CAAE;AACvC,MAAA,YAAA,EAAY8B,yBAAY,CAAChD,iBAAiB,EAAEnI,SAAS;AAAE,KACvD,CAEwB,CACd,CACD,CAEjB,CACC,CAAC;EAEL,CAAC;;AAED;AACA,EAAA,oBACC6C,gBAAA,CAAA6G,aAAA,CAAC0B,mCAAiB,CAACC,QAAQ,EAAA;AAC1B5E,IAAAA,KAAK,EAAE;AACNhC,MAAAA;AACD;AAAE,GAAA,EAEDrD,SAAS,GACTmI,UAAU,EAAE,gBAEZ1G,gBAAA,CAAA6G,aAAA,CAAC4B,mBAAS,EAAAnB,iCAAA,CAAA;AAACoB,IAAAA,KAAK,EAAEzJ,WAAW,CAACyJ,KAAK,IAAIxJ,mBAAa,CAACC;AAAQ,GAAA,EAAKF,WAAW,CAAA,EAC3EyH,UAAU,EACD,CAEe,CAAC;AAE9B;AACD;AAEA1J,UAAU,CAAC2L,aAAa,GAAG,SAAS;;;;"}
1
+ {"version":3,"file":"MrlPopover.js","sources":["../../../../../src/components/popover/MrlPopover/MrlPopover.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { close } from '@muraldevkit/ds-icons';\nimport { MrlIconButton } from '../../button/MrlIconButton/MrlIconButton';\nimport { MrlFocusTrap } from '../../focus-trap/MrlFocusTrap/MrlFocusTrap';\nimport { MrlPortal, PortalProps } from '../../portal/MrlPortal';\nimport { MrlSvg } from '../../svg/MrlSvg/MrlSvg';\nimport { useTriggerPosition } from '../../../hooks/useTriggerPosition';\nimport { useBrowserEdgeScroll } from '../../menu/hooks/useBrowserEdgeScroll';\nimport { useClickOutside } from '../../../hooks/useClickOutside';\nimport { useSubMenuElementPosition } from '../../menu/hooks/useSubMenuElementPosition';\nimport { MenuPosition, MenuAlignment, ActionState, CustomMenuPosition } from '../../menu/constants';\nimport {\n\tpreventDefault,\n\tgetFocusableElementsInsideElement,\n\tfindAdjacentInteractiveElement,\n\tisElementAriaDisabled\n} from '../../../utils';\nimport { PORTAL_LAYERS } from '../../../utils/layers';\nimport { useTransition, animated } from '@react-spring/web';\nimport { SELECT_MENU_LIST_CLASS_NAME } from '../../form/select/MrlSelect/MrlSelect';\nimport { MULTI_SELECT_MENU_LIST_CLASS_NAME } from '../../form/select/MrlMultiSelect/MrlMultiSelect';\nimport styles from './MrlPopover.module.scss';\nimport { flipPosition } from '../../menu/utilities/flip-position';\nimport { getDataPoint } from './utilities/get-data-point';\nimport { getOffset } from './utilities/get-offset';\nimport { useMrlPopoverEventHandlers } from './hooks/use-mrl-popover-event-handlers';\nimport { MrlPopoverContext } from './context/MrlPopoverContext';\nimport { MrlPopoverScrollContainer } from './MrlPopoverScrollContainer';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\nconst POPOVER_CLICKOUTSIDE_WHITELIST = [\n\t'#mrl-select-portal',\n\t'#mrl-popover-menu-portal',\n\t`.${SELECT_MENU_LIST_CLASS_NAME}`,\n\t`.${MULTI_SELECT_MENU_LIST_CLASS_NAME}`\n];\n\ntype RenderPropFn = ({ closeMenu }: { closeMenu: () => void }) => JSX.Element;\n\nexport interface MrlPopoverProps {\n\t/**\n\t * Set initial state of menu\n\t * @default { actionType: null, isOpen: false }\n\t */\n\tactionState?: ActionState;\n\n\t/** Label for the popover */\n\tariaLabel?: string;\n\n\t/** ID of element to associate a label */\n\tariaLabelledBy?: string;\n\n\t/** Children to be rendered within the menu component*/\n\tchildren: React.ReactNode | RenderPropFn;\n\n\t/** Custom class names for the popover */\n\tclassName?: string;\n\n\t/** Custom position for the menu */\n\tcustomPosition?: CustomMenuPosition;\n\n\t/**\n\t * If the popover should disable click to open\n\t *\n\t * Example usage: if you do not want your component opened via click, set to true\n\t */\n\tdisableClickToOpen?: boolean;\n\n\t/**\n\t * If the popover should close when clicking outside of the menu\n\t *\n\t * Example usage: MrlCallout component should not close when clicking outside, so it's set to true\n\t */\n\tdisableClickOutside?: boolean;\n\n\t/**\n\t * Disable flipping of the popover when it goes off the screen\n\t * @default false\n\t */\n\tdisableFlipping?: boolean;\n\n\t/**\n\t * If the popover should disable focus trap\n\t *\n\t * The impact of enabling or disabling focus trap:\n\t * - enabled : focus will remain trapped in the popover until a user closes the popover\n\t * - disabled : focus will move to the next interactive element in the DOM when the user\n\t * tabs out of the popover. Focus will move to the trigger when the user shift+tabs out of the popover\n\t *\n\t * Additional scenarios to consider with focus trap is disabled. When hasCloseButton is set to true/false:\n\t * - true : if a user shows the close button, the popover will stay open until explicitly dismissed\n\t * - false : if a user hides the close button, the popover will close when a user tabs out of it from the beginning or end\n\t */\n\tdisableFocusTrap?: boolean;\n\n\t/** If the popover should have a close button */\n\thasCloseButton?: boolean;\n\n\t/** Unique identifier for the menu */\n\tid?: string;\n\n\t/** If the menu is a submenu */\n\tisSubMenu?: boolean;\n\n\t/**\n\t * Horizontal and vertical alignment of the menu relative to the trigger element\n\t *\n\t * This does not impact submenus\n\t * @default 'bottom'\n\t */\n\tposition?: MenuPosition;\n\n\t/**\n\t * Alignment of the popover along the axis perpendicular to its position\n\t * - For position 'top'/'bottom': 'start' = left, 'end' = right, 'center' = center horizontally\n\t * - For position 'left'/'right': 'start' = top, 'end' = bottom, 'center' = center vertically\n\t *\n\t * @default 'center'\n\t *\n\t * This does not impact submenus\n\t */\n\talignment?: MenuAlignment;\n\n\t/**\n\t * spacing of menu\n\t * - 'default' has 16px padding\n\t * - 'compact' has 12px padding\n\t */\n\tspacing?: 'default' | 'compact';\n\n\t/**\n\t * Reference to the DOM element that triggers this menu.\n\t */\n\ttriggerRef?: React.RefObject<HTMLElement>;\n\n\t/**\n\t * If the menu should be rendered with the inverse theme\n\t * @default 'primary'\n\t */\n\tkind?: 'primary' | 'inverse';\n\n\t/**\n\t * If the menu should have a pointer element\n\t * @default false\n\t */\n\tpoint?: boolean;\n\n\t/**\n\t * Configuration for the portal component\n\t */\n\tportalProps?: Omit<PortalProps, 'children'>;\n\n\t/**\n\t * Offset in pixels for the popover\n\t *\n\t * The popover automatically calculates the proper offset based on the position and alignment\n\t * this prop will override those values.\n\t */\n\toffset?: number;\n\n\t/**\n\t * Callback to be called when the menu is opened\n\t */\n\tonOpen?: () => void;\n\n\t/**\n\t * Callback to be called when the menu is closed\n\t * @param type - type of close event\n\t */\n\tonClose?: (type?: string) => void;\n\n\t/**\n\t * data-qa attribute for the popover\n\t */\n\t['data-qa']?: string;\n\n\t/**\n\t * Enables interaction tracking for this popover. Provide a stable, non-PII id\n\t * (e.g. 'sticky-note-color-picker'). When omitted, the popover emits no analytics.\n\t */\n\teventId?: string;\n}\n\n/**\n * MrlPopover\n *\n * Renders a popover component with position and alignment relative to a trigger element\n * @param {MrlPopoverProps} props - The props for the MrlPopover component\n * @returns {Element} - rendered MrlPopover component\n */\nexport function MrlPopover({\n\talignment = 'center',\n\tariaLabel,\n\tariaLabelledBy,\n\tchildren,\n\tclassName,\n\tcustomPosition,\n\tdisableClickToOpen = false,\n\tdisableClickOutside = false,\n\tdisableFlipping = false,\n\tdisableFocusTrap = false,\n\thasCloseButton = false,\n\tspacing = 'default',\n\tid,\n\tisSubMenu = false,\n\tactionState = { actionType: null, isOpen: false },\n\tposition = 'bottom',\n\tpoint = true,\n\tportalProps = { id: PORTAL_LAYERS.POPOVER.name },\n\tkind = 'primary',\n\toffset,\n\tonClose,\n\tonOpen,\n\teventId,\n\ttriggerRef,\n\t...rest\n}: MrlPopoverProps): JSX.Element {\n\tconst [state, setState] = React.useState({\n\t\tactionType: null,\n\t\tisOpen: actionState.isOpen || false\n\t} as ActionState);\n\n\tconst trackInteraction = useMrlTrackInteraction('MrlPopover', eventId);\n\t// the popover opens and closes from several paths (trigger click, keyboard, click\n\t// outside, close button), so open/close is emitted from the resulting state.\n\tconst wasOpenRef = React.useRef(actionState.isOpen || false);\n\n\tReact.useEffect(() => {\n\t\tif (wasOpenRef.current === state.isOpen) return;\n\n\t\twasOpenRef.current = state.isOpen;\n\n\t\ttrackInteraction({\n\t\t\taction: state.isOpen ? 'open' : 'close',\n\t\t\tmetadata: { isSubMenu },\n\t\t\tvariant: position\n\t\t});\n\t}, [state.isOpen, isSubMenu, position, trackInteraction]);\n\n\t// stores all of the interactive elements in the popover for focus management\n\tconst [interactiveElements, setInteractiveElements] = React.useState<HTMLElement[]>([]);\n\tconst [menuRect, setMenuRect] = React.useState<DOMRect | null>(null);\n\tconst menuRef = React.useRef<HTMLDivElement>(null);\n\t/** Snapshot of trigger `aria-expanded` before we manage it; restored on popover unmount only. */\n\tconst triggerExpandedRestoreRef = React.useRef<{\n\t\tel: HTMLElement;\n\t\tvalue: string | null;\n\t} | null>(null);\n\n\t/**\n\t * Checks if the trigger element is disabled\n\t * @returns {boolean} - true if the trigger element is disabled, false otherwise\n\t */\n\tconst isTriggerDisabled = React.useCallback((): boolean => {\n\t\treturn isElementAriaDisabled(triggerRef?.current);\n\t}, [triggerRef]);\n\n\t/**\n\t * Opening and closing the menu\n\t */\n\tconst closeMenu = React.useCallback(() => {\n\t\tsetState({ actionType: null, isOpen: false });\n\t\tonClose?.();\n\t}, [onClose]);\n\n\tconst {\n\t\thandleClose,\n\t\thandleMenuKey,\n\t\thideMenuHover,\n\t\thandleTriggerSiblingKey,\n\t\ttoggleMenuKey,\n\t\ttoggleMenuTrigger,\n\t\tshowMenuHover\n\t} = useMrlPopoverEventHandlers({\n\t\tcloseMenu,\n\t\tdisableClickToOpen,\n\t\tdisableFocusTrap,\n\t\thasCloseButton,\n\t\tinteractiveElements,\n\t\tisSubMenu,\n\t\tisTriggerDisabled,\n\t\tmenuRef,\n\t\tsetState,\n\t\tstate,\n\t\ttriggerRef\n\t});\n\n\tuseClickOutside(\n\t\tmenuRef,\n\t\ttriggerRef,\n\t\t'mouseup',\n\t\tcloseMenu,\n\t\tdisableClickOutside || !state.isOpen,\n\t\tPOPOVER_CLICKOUTSIDE_WHITELIST\n\t);\n\n\tReact.useEffect(() => {\n\t\tif (isTriggerDisabled()) return;\n\n\t\tif (!isSubMenu) {\n\t\t\tsetState({ actionType: actionState.actionType, isOpen: actionState.isOpen });\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [isSubMenu, actionState.actionType, actionState.isOpen]);\n\n\t// This use effect handles storing the rect in state for positioning calculations\n\tReact.useLayoutEffect(() => {\n\t\tif (!state.isOpen) return;\n\n\t\t// For consistent calculations, we are storing the menu rect in state\n\t\t// Anytime we need to use the menu rect, we want to make sure the values are based\n\t\t// on the original state of the menu for proper transformations\n\t\tif (!menuRect && menuRef.current) {\n\t\t\tconst newRect = menuRef.current?.getBoundingClientRect();\n\t\t\tsetMenuRect(newRect || null);\n\t\t}\n\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen, isSubMenu]);\n\n\t// This use effect handles getting and setting the interactive elements in the popover.\n\t// These elements are used for focus management when focus trap is not enabled to ensure\n\t// that our tab order matches the visual order of the page\n\tReact.useEffect(() => {\n\t\tif (state.isOpen && !isSubMenu && menuRef.current) {\n\t\t\tif (disableFocusTrap) {\n\t\t\t\t// set the interactive elements so we can track focus location\n\t\t\t\tconst elements = getFocusableElementsInsideElement(menuRef.current as HTMLElement);\n\t\t\t\tsetInteractiveElements(elements);\n\n\t\t\t\t// without focus trap enabled, we want to focus the first interactive element\n\t\t\t\telements[0].focus();\n\t\t\t}\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen, menuRef.current]);\n\n\t// This use effect handles setting all of the event handlers for different parts of the component.\n\t// - trigger event handlers\n\t// - submenu event handlers\n\t// - menu event handlers\n\t// - \"next element\" event handlers, which are event handlers attached to the next interactive element after the trigger\n\t//\n\tReact.useEffect(() => {\n\t\tconst triggerElement = triggerRef?.current;\n\t\tconst menuElement = menuRef?.current;\n\t\tconst nextElement = findAdjacentInteractiveElement(triggerRef, 'next');\n\n\t\tif (triggerElement) {\n\t\t\ttriggerElement.addEventListener('mousedown', (e) => e.stopPropagation());\n\t\t\ttriggerElement.addEventListener('click', toggleMenuTrigger);\n\t\t\ttriggerElement.addEventListener('keydown', toggleMenuKey);\n\n\t\t\tif (nextElement) nextElement.addEventListener('keydown', handleTriggerSiblingKey);\n\n\t\t\t// Setup event listeners for when the menu is a submenu\n\t\t\tif (isSubMenu) {\n\t\t\t\tconst menuElement = menuRef?.current;\n\n\t\t\t\ttriggerElement.addEventListener('mouseover', showMenuHover);\n\t\t\t\ttriggerElement.addEventListener('mouseout', hideMenuHover);\n\n\t\t\t\tif (menuElement) {\n\t\t\t\t\tmenuElement.addEventListener('mouseover', showMenuHover);\n\t\t\t\t\tmenuElement.addEventListener('mouseout', hideMenuHover);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\ttriggerElement.removeEventListener('mousedown', preventDefault);\n\t\t\t\ttriggerElement.removeEventListener('click', toggleMenuTrigger);\n\t\t\t\ttriggerElement.removeEventListener('keydown', toggleMenuKey);\n\n\t\t\t\tif (nextElement) nextElement.removeEventListener('keydown', handleTriggerSiblingKey);\n\n\t\t\t\tif (isSubMenu) {\n\t\t\t\t\ttriggerElement.removeEventListener('mouseover', showMenuHover);\n\t\t\t\t\ttriggerElement.removeEventListener('mouseout', hideMenuHover);\n\n\t\t\t\t\tif (menuElement) {\n\t\t\t\t\t\tmenuElement.removeEventListener('mouseover', showMenuHover);\n\t\t\t\t\t\tmenuElement.removeEventListener('mouseout', hideMenuHover);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [\n\t\tcloseMenu,\n\t\tisSubMenu,\n\t\ttoggleMenuKey,\n\t\ttoggleMenuTrigger,\n\t\ttriggerRef?.current,\n\t\thideMenuHover,\n\t\tshowMenuHover,\n\t\thasCloseButton,\n\t\thandleClose\n\t]);\n\n\t/**\n\t * Popover triggers are not necessarily modal dialogs; use the generic 'true' (see ARIA in HTML).\n\t * Restore the previous DOM value when the trigger changes or this popover unmounts so host-owned\n\t * ARIA (e.g. aria-haspopup=\"menu\") is not left stale after a callout dismisses.\n\t */\n\tReact.useEffect(() => {\n\t\tconst el = triggerRef?.current;\n\t\tif (!el) return;\n\n\t\tconst previousValue = el.getAttribute('aria-haspopup');\n\t\tel.setAttribute('aria-haspopup', 'true');\n\n\t\t// Restore the previous value of the aria-haspopup attribute when the callout is removed from the DOM\n\t\treturn () => {\n\t\t\tif (previousValue === null) {\n\t\t\t\tel.removeAttribute('aria-haspopup');\n\t\t\t} else {\n\t\t\t\tel.setAttribute('aria-haspopup', previousValue);\n\t\t\t}\n\t\t};\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [triggerRef?.current]);\n\n\tReact.useEffect(() => {\n\t\tconst el = triggerRef?.current;\n\t\tif (!el) return;\n\n\t\t// Store the previous value of the aria-expanded attribute when the callout is added to the DOM\n\t\tif (!triggerExpandedRestoreRef.current || triggerExpandedRestoreRef.current.el !== el) {\n\t\t\ttriggerExpandedRestoreRef.current = {\n\t\t\t\tel,\n\t\t\t\tvalue: el.hasAttribute('aria-expanded') ? el.getAttribute('aria-expanded') : null\n\t\t\t};\n\t\t}\n\n\t\t// Set the aria-expanded attribute to the current state of the popover\n\t\tel.setAttribute('aria-expanded', state.isOpen.toString());\n\n\t\tif (state.isOpen) onOpen?.();\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen, onOpen, triggerRef?.current]);\n\n\t/**\n\t * Restore the previous value of the aria-expanded attribute when the callout is removed from the DOM\n\t */\n\tReact.useEffect(() => {\n\t\treturn () => {\n\t\t\tconst snap = triggerExpandedRestoreRef.current;\n\t\t\tif (!snap) return;\n\t\t\tconst { el, value } = snap;\n\n\t\t\tif (!document?.documentElement?.contains(el)) return;\n\n\t\t\tif (value === null) {\n\t\t\t\tel.removeAttribute('aria-expanded');\n\t\t\t} else {\n\t\t\t\tel.setAttribute('aria-expanded', value);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\t/**\n\t * Setup positioning styles, submenu positioning styles, scroll styles, and transition.\n\t */\n\tconst memoizedCustomPosition = React.useMemo(() => customPosition, [customPosition]);\n\tconst customPopoverPosition = memoizedCustomPosition || { left: 0, top: 0 };\n\n\tconst menuPosition = useTriggerPosition(\n\t\ttriggerRef,\n\t\tmenuRef,\n\t\t{\n\t\t\talign: alignment,\n\t\t\tcustomPosition: customPopoverPosition,\n\t\t\tposition: position\n\t\t},\n\t\tstate.isOpen,\n\t\toffset || getOffset(position, point),\n\t\tisSubMenu,\n\t\tdisableFlipping\n\t);\n\n\t// Only while open: isPositioned resets on close, which would cut the leave transition short\n\tconst isAwaitingPosition = !isSubMenu && state.isOpen && !menuPosition.isPositioned;\n\tconst hideUntilPositionedStyles = isAwaitingPosition ? { opacity: 0 } : undefined;\n\n\tconst subMenuPosition = useSubMenuElementPosition(\n\t\ttriggerRef,\n\t\tmenuRef,\n\t\tisSubMenu,\n\t\tstate.isOpen,\n\t\tmenuRect,\n\t\t!isSubMenu\n\t);\n\n\tconst menuPositionState = menuPosition.flipped ? flipPosition(position) : position;\n\tconst scrollStyles = useBrowserEdgeScroll(menuRef, menuPositionState, alignment);\n\n\tconst inlineStyles = {\n\t\tmenu: {\n\t\t\tleft: menuPosition.left,\n\t\t\tposition: 'fixed' as const,\n\t\t\ttop: menuPosition.top\n\t\t},\n\t\tsubmenu: {\n\t\t\tleft: subMenuPosition.left,\n\t\t\ttop: subMenuPosition.top\n\t\t}\n\t};\n\n\t/**\n\t * React Spring transitions for the menu\n\t */\n\tconst transitions = useTransition(state.isOpen, {\n\t\tconfig: { duration: 150 },\n\t\tenter: { opacity: 1, transform: 'translateY(0)' },\n\t\tfrom: { opacity: 0, transform: 'translateY(4px)' },\n\t\tleave: { opacity: 0, transform: 'translateY(4px)' }\n\t});\n\n\tconst menuClasses = classnames(\n\t\tstyles['MrlPopover'],\n\t\t'MrlPopover',\n\t\tstyles['MrlPopover--scrolling'],\n\t\tclassName,\n\t\t{\n\t\t\t[styles['MrlPopover--submenu']]: isSubMenu,\n\t\t\t[styles['inverse']]: kind === 'inverse',\n\t\t\t[styles['primary']]: kind === 'primary',\n\t\t\t[styles['compact']]: spacing === 'compact',\n\t\t\t[styles['default']]: spacing === 'default'\n\t\t}\n\t);\n\n\tconst positionStyles = isSubMenu ? inlineStyles.submenu : inlineStyles.menu;\n\n\tconst renderMenu = () => {\n\t\tconst inlineScrollStyles = isSubMenu ? {} : scrollStyles ? scrollStyles.styles : {};\n\t\tconst scrollClasses = classnames(\n\t\t\tstyles['MrlPopover--content'],\n\t\t\tstyles['MrlPopover--scrolling--content']\n\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{transitions(\n\t\t\t\t\t(style, item) =>\n\t\t\t\t\t\titem && (\n\t\t\t\t\t\t\t<MrlFocusTrap disabled={disableFocusTrap} containerRef={menuRef}>\n\t\t\t\t\t\t\t\t<animated.div\n\t\t\t\t\t\t\t\t\taria-label={ariaLabel}\n\t\t\t\t\t\t\t\t\taria-labelledby={ariaLabelledBy}\n\t\t\t\t\t\t\t\t\tclassName={menuClasses}\n\t\t\t\t\t\t\t\t\tid={id}\n\t\t\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\t\t\tstyle={{ ...positionStyles, ...style, ...hideUntilPositionedStyles }}\n\t\t\t\t\t\t\t\t\tonKeyDown={handleMenuKey}\n\t\t\t\t\t\t\t\t\tref={menuRef}\n\t\t\t\t\t\t\t\t\t{...rest}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<MrlPopoverScrollContainer className={scrollClasses} style={inlineScrollStyles}>\n\t\t\t\t\t\t\t\t\t\t{typeof children === 'function' && children({ closeMenu })}\n\t\t\t\t\t\t\t\t\t\t{typeof children !== 'function' && children}\n\t\t\t\t\t\t\t\t\t\t{hasCloseButton && (\n\t\t\t\t\t\t\t\t\t\t\t<MrlIconButton\n\t\t\t\t\t\t\t\t\t\t\t\tdata-qa=\"popover-close-button\"\n\t\t\t\t\t\t\t\t\t\t\t\twrapperClassName={styles['MrlPopover--close']}\n\t\t\t\t\t\t\t\t\t\t\t\ticon={<MrlSvg svg={close} />}\n\t\t\t\t\t\t\t\t\t\t\t\tkind={kind === 'inverse' ? 'ghost-inverse' : 'ghost'}\n\t\t\t\t\t\t\t\t\t\t\t\ttext=\"Close\"\n\t\t\t\t\t\t\t\t\t\t\t\tstate=\"default\"\n\t\t\t\t\t\t\t\t\t\t\t\tposition=\"right\"\n\t\t\t\t\t\t\t\t\t\t\t\ttipAnchor=\"center\"\n\t\t\t\t\t\t\t\t\t\t\t\tonMouseUp={closeMenu}\n\t\t\t\t\t\t\t\t\t\t\t\tonKeyDown={handleClose}\n\t\t\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t{point && (\n\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\tclassName={styles['MrlPopover--point']}\n\t\t\t\t\t\t\t\t\t\t\t\tdata-point={getDataPoint(menuPositionState, alignment)}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</MrlPopoverScrollContainer>\n\t\t\t\t\t\t\t\t</animated.div>\n\t\t\t\t\t\t\t</MrlFocusTrap>\n\t\t\t\t\t\t)\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t};\n\n\t/* eslint-disable */\n\treturn (\n\t\t<MrlPopoverContext.Provider\n\t\t\tvalue={{\n\t\t\t\tcloseMenu\n\t\t\t}}\n\t\t>\n\t\t\t{isSubMenu ? (\n\t\t\t\trenderMenu()\n\t\t\t) : (\n\t\t\t\t<MrlPortal layer={portalProps.layer || PORTAL_LAYERS.POPOVER} {...portalProps}>\n\t\t\t\t\t{renderMenu()}\n\t\t\t\t</MrlPortal>\n\t\t\t)}\n\t\t</MrlPopoverContext.Provider>\n\t);\n\t/* eslint-enable */\n}\n\nMrlPopover.componentType = 'Popover';\n"],"names":["POPOVER_CLICKOUTSIDE_WHITELIST","concat","SELECT_MENU_LIST_CLASS_NAME","MULTI_SELECT_MENU_LIST_CLASS_NAME","MrlPopover","_ref","_ref$alignment","alignment","ariaLabel","ariaLabelledBy","children","className","customPosition","_ref$disableClickToOp","disableClickToOpen","_ref$disableClickOuts","disableClickOutside","_ref$disableFlipping","disableFlipping","_ref$disableFocusTrap","disableFocusTrap","_ref$hasCloseButton","hasCloseButton","_ref$spacing","spacing","id","_ref$isSubMenu","isSubMenu","_ref$actionState","actionState","actionType","isOpen","_ref$position","position","_ref$point","point","_ref$portalProps","portalProps","PORTAL_LAYERS","POPOVER","name","_ref$kind","kind","offset","onClose","onOpen","eventId","triggerRef","rest","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","state","setState","trackInteraction","useMrlTrackInteraction","wasOpenRef","useRef","useEffect","current","action","metadata","variant","_React$useState3","_React$useState4","interactiveElements","setInteractiveElements","_React$useState5","_React$useState6","menuRect","setMenuRect","menuRef","triggerExpandedRestoreRef","isTriggerDisabled","useCallback","isElementAriaDisabled","closeMenu","_useMrlPopoverEventHa","useMrlPopoverEventHandlers","handleClose","handleMenuKey","hideMenuHover","handleTriggerSiblingKey","toggleMenuKey","toggleMenuTrigger","showMenuHover","useClickOutside","useLayoutEffect","_menuRef$current","newRect","getBoundingClientRect","elements","getFocusableElementsInsideElement","focus","triggerElement","menuElement","nextElement","findAdjacentInteractiveElement","addEventListener","e","stopPropagation","removeEventListener","preventDefault","el","previousValue","getAttribute","setAttribute","removeAttribute","value","hasAttribute","toString","_document","_document$documentEle","snap","document","documentElement","contains","memoizedCustomPosition","useMemo","customPopoverPosition","left","top","menuPosition","useTriggerPosition","align","getOffset","isAwaitingPosition","isPositioned","hideUntilPositionedStyles","opacity","undefined","subMenuPosition","useSubMenuElementPosition","menuPositionState","flipped","flipPosition","scrollStyles","useBrowserEdgeScroll","inlineStyles","menu","submenu","transitions","useTransition","config","duration","enter","transform","from","leave","menuClasses","classnames","styles","positionStyles","renderMenu","inlineScrollStyles","scrollClasses","createElement","Fragment","style","item","MrlFocusTrap","disabled","containerRef","animated","div","_extends","tabIndex","_objectSpread","onKeyDown","ref","MrlPopoverScrollContainer","MrlIconButton","wrapperClassName","icon","MrlSvg","svg","close","text","tipAnchor","onMouseUp","size","getDataPoint","MrlPopoverContext","Provider","MrlPortal","layer","componentType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAMA,8BAA8B,GAAG,CACtC,oBAAoB,EACpB,0BAA0B,EAAA,GAAA,CAAAC,MAAA,CACtBC,qCAA2B,CAAA,EAAA,GAAA,CAAAD,MAAA,CAC3BE,gDAAiC,CAAA,CACrC;AAoJD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAAAC,IAAA,EA0BO;AAAA,EAAA,IAAAC,cAAA,GAAAD,IAAA,CAzBhCE,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,QAAQ,GAAAA,cAAA;IACpBE,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,cAAc,GAAAJ,IAAA,CAAdI,cAAc;IACdC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IACRC,SAAS,GAAAN,IAAA,CAATM,SAAS;IACTC,cAAc,GAAAP,IAAA,CAAdO,cAAc;IAAAC,qBAAA,GAA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SAAS;AAAE,KACvD,CAEwB,CACd,CACD,CAEjB,CACC,CAAC;EAEL,CAAC;;AAED;AACA,EAAA,oBACC6C,gBAAA,CAAA4G,aAAA,CAAC0B,mCAAiB,CAACC,QAAQ,EAAA;AAC1B3E,IAAAA,KAAK,EAAE;AACNhC,MAAAA;AACD;AAAE,GAAA,EAEDrD,SAAS,GACTkI,UAAU,EAAE,gBAEZzG,gBAAA,CAAA4G,aAAA,CAAC4B,mBAAS,EAAAnB,iCAAA,CAAA;AAACoB,IAAAA,KAAK,EAAExJ,WAAW,CAACwJ,KAAK,IAAIvJ,mBAAa,CAACC;AAAQ,GAAA,EAAKF,WAAW,CAAA,EAC3EwH,UAAU,EACD,CAEe,CAAC;AAE9B;AACD;AAEAzJ,UAAU,CAAC0L,aAAa,GAAG,SAAS;;;;"}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var TOOLKIT_VERSION = "4.77.2";
3
+ var TOOLKIT_VERSION = "4.78.0";
4
4
 
5
5
  exports.TOOLKIT_VERSION = TOOLKIT_VERSION;
6
6
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const TOOLKIT_VERSION = \"4.77.2\";"],"names":["TOOLKIT_VERSION"],"mappings":";;AAAO,IAAMA,eAAe,GAAG;;;;"}
1
+ {"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const TOOLKIT_VERSION = \"4.78.0\";"],"names":["TOOLKIT_VERSION"],"mappings":";;AAAO,IAAMA,eAAe,GAAG;;;;"}
@@ -2,8 +2,8 @@ import { LayoutComponent } from '../../layout/constants';
2
2
  import '../grid.variables.scss';
3
3
  import '../grid.global.scss';
4
4
  /**
5
- * MrlCol React component.
5
+ * MrlGrid React component.
6
6
  * @param props - component props
7
- * @returns a MrlCol React component.
7
+ * @returns a MrlGrid React component.
8
8
  */
9
9
  export declare function MrlGrid({ children, className, ...rest }: LayoutComponent): JSX.Element;
@@ -80,7 +80,7 @@ export declare const colorPictoStoryData: {
80
80
  export declare const animateStoryData: {
81
81
  args: {
82
82
  delay: number;
83
- state: "stop" | "play";
83
+ state: "play" | "stop";
84
84
  };
85
85
  argTypes: {
86
86
  delay: {
@@ -5,9 +5,9 @@ import classnames from 'classnames';
5
5
  var _excluded = ["children", "className"];
6
6
 
7
7
  /**
8
- * MrlCol React component.
8
+ * MrlGrid React component.
9
9
  * @param props - component props
10
- * @returns a MrlCol React component.
10
+ * @returns a MrlGrid React component.
11
11
  */
12
12
  function MrlGrid(_ref) {
13
13
  var children = _ref.children,
@@ -1 +1 @@
1
- {"version":3,"file":"MrlGrid.js","sources":["../../../../../src/components/grid/MrlGrid/MrlGrid.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { LayoutComponent } from '../../layout/constants';\nimport '../grid.variables.scss';\nimport '../grid.global.scss';\n\n/**\n * MrlCol React component.\n * @param props - component props\n * @returns a MrlCol React component.\n */\nexport function MrlGrid({ children, className = '', ...rest }: LayoutComponent): JSX.Element {\n\tconst allClasses = classnames('container', className);\n\n\treturn (\n\t\t<div {...rest} className={allClasses}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n"],"names":["MrlGrid","_ref","children","_ref$className","className","rest","_objectWithoutProperties","_excluded","allClasses","classnames","React","createElement","_extends"],"mappings":";;;;;;AAMA;AACA;AACA;AACA;AACA;AACO,SAASA,OAAOA,CAAAC,IAAA,EAAsE;AAAA,EAAA,IAAnEC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAAC,cAAA,GAAAF,IAAA,CAAEG,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;AAAKE,IAAAA,IAAI,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA,CAAA;AAC1D,EAAA,IAAMC,UAAU,GAAGC,UAAU,CAAC,WAAW,EAAEL,SAAS,CAAC;AAErD,EAAA,oBACCM,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,QAAA,KAASP,IAAI,EAAA;AAAED,IAAAA,SAAS,EAAEI;AAAW,GAAA,CAAA,EACnCN,QACG,CAAC;AAER;;;;"}
1
+ {"version":3,"file":"MrlGrid.js","sources":["../../../../../src/components/grid/MrlGrid/MrlGrid.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { LayoutComponent } from '../../layout/constants';\nimport '../grid.variables.scss';\nimport '../grid.global.scss';\n\n/**\n * MrlGrid React component.\n * @param props - component props\n * @returns a MrlGrid React component.\n */\nexport function MrlGrid({ children, className = '', ...rest }: LayoutComponent): JSX.Element {\n\tconst allClasses = classnames('container', className);\n\n\treturn (\n\t\t<div {...rest} className={allClasses}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n"],"names":["MrlGrid","_ref","children","_ref$className","className","rest","_objectWithoutProperties","_excluded","allClasses","classnames","React","createElement","_extends"],"mappings":";;;;;;AAMA;AACA;AACA;AACA;AACA;AACO,SAASA,OAAOA,CAAAC,IAAA,EAAsE;AAAA,EAAA,IAAnEC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAAC,cAAA,GAAAF,IAAA,CAAEG,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;AAAKE,IAAAA,IAAI,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA,CAAA;AAC1D,EAAA,IAAMC,UAAU,GAAGC,UAAU,CAAC,WAAW,EAAEL,SAAS,CAAC;AAErD,EAAA,oBACCM,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,QAAA,KAASP,IAAI,EAAA;AAAED,IAAAA,SAAS,EAAEI;AAAW,GAAA,CAAA,EACnCN,QACG,CAAC;AAER;;;;"}
@@ -469,8 +469,7 @@ function MrlMenu(_ref) {
469
469
  */
470
470
  var isAwaitingPosition = !disableTriggerPosition && !menuPositionStyles.isPositioned;
471
471
  var hideUntilPositionedStyles = isAwaitingPosition ? {
472
- opacity: 0,
473
- pointerEvents: 'none'
472
+ opacity: 0
474
473
  } : undefined;
475
474
 
476
475
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"MrlMenu.js","sources":["../../../../../src/components/menu/MrlMenu/MrlMenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport { MrlPortal, PortalProps } from '../../portal/MrlPortal';\nimport { useTriggerPosition } from '../../../hooks/useTriggerPosition';\nimport { useClickOutside } from '../../../hooks/useClickOutside';\nimport { useSubMenuElementPosition } from '../hooks/useSubMenuElementPosition';\nimport {\n\tMenuPosition,\n\tMenuAlignment,\n\tActionState,\n\tActionType,\n\tCustomMenuPosition\n} from '../constants';\nimport { PORTAL_LAYERS } from '../../../utils/layers';\nimport {\n\tfindAdjacentInteractiveElement,\n\tpreventDefault,\n\tisElementAriaDisabled\n} from '../../../utils';\nimport classnames from 'classnames';\nimport { MrlMenuContext } from '../context/MrlMenuContext';\nimport styles from './MrlMenu.module.scss';\nimport itemStyles from '../MrlMenuItem/MrlMenuItem.module.scss';\nimport { useTransition, animated } from '@react-spring/web';\nimport { isTouchDevice } from '../../../utils/isTouch';\nimport { getScrollableParent } from '../utilities/get-scrollable-parent';\nimport { useMenuScroll } from '../hooks/useMenuScroll';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\nexport interface MrlMenuProps {\n\t/** Custom position for the menu */\n\tcustomPosition?: CustomMenuPosition;\n\n\t/** Children to be rendered within the menu component*/\n\tchildren: React.ReactNode;\n\n\t/** Event to close the menu */\n\tclickOutsideEvent?: 'mousedown' | 'mouseup' | 'click';\n\n\t/**\n\t * Enables closing the menu when scrolling. Default is false.\n\t *\n\t */\n\tcloseOnScroll?: boolean;\n\n\t/**\n\t * Private closeParent prop for use with MrlMenuItem\n\t *\n\t * !!! Please do not use this prop directly, it is only used internally by MrlMenuItem !!!\n\t * @private\n\t */\n\tcloseParent?: () => void;\n\n\t/**\n\t * Disable arrows from opening the menu\n\t * - This is useful when you want to disable the default browser behavior of opening a menu on arrow down.\n\t *\n\t * Example usage: the menu is within a vertical toolbar and you want to use the arrow keys to navigate the toolbar.\n\t * By using this prop you can disable the arrow key open/close so that navigating the toolbar does not conflict\n\t * with opening/closing the menu.\n\t */\n\tdisableArrowOpen?: boolean;\n\n\t/**\n\t * Disable flipping of the menu when it goes off the screen\n\t * @default false\n\t */\n\tdisableFlipping?: boolean;\n\n\t/** Unique identifier for the menu */\n\tid?: string;\n\n\t/**\n\t * Use when the menu is embedded within another component\n\t * Removes the following styles:\n\t * - padding on the menu\n\t * - drop shadow and border\n\t * @default false\n\t */\n\tisInternal?: boolean;\n\n\t/**\n\t * Private isSubMenu prop for use with MrlMenuItem\n\t *\n\t * !!! Please do not use this prop directly, it is only used internally by MrlMenuItem !!!\n\t * @private\n\t */\n\tisSubMenu?: boolean;\n\n\t/**\n\t * spacing of menu\n\t * - compact has less padding\n\t * @default 'default'\n\t */\n\tspacing?: 'default' | 'compact';\n\n\t/**\n\t * Offset of the menu from the trigger element in pixels\n\t * @default 10px\n\t */\n\tmenuOffset?: number;\n\n\t/**\n\t * Configuration for the portal component\n\t */\n\tportalProps?: Omit<PortalProps, 'children'>;\n\n\t/**\n\t * Horizontal and vertical alignment of the menu relative to the trigger element\n\t * - position 'left', 'right', 'top', 'bottom' position relative to the trigger\n\t * - position 'static' renders the menu in place, not using the portal\n\t * - position 'ignore' will not position the menu, allowing you to use the customPosition prop to position the element\n\t * @default 'bottom'\n\t */\n\tposition?: MenuPosition;\n\n\t/**\n\t * Opens or closes the menu from outside. Not just an initial value: whenever\n\t * `isOpen` or `actionType` changes, the menu syncs its internal state to it.\n\t * The menu can still close itself (item select, click outside, Escape, Tab),\n\t * so pair this with `onClose` to reset your state. Prefer `triggerRef` when\n\t * there is a trigger element. Ignored for submenus and `position=\"static\"`.\n\t * @default { actionType: null, isOpen: false }\n\t */\n\tactionState?: ActionState;\n\n\t/**\n\t * Reference to the DOM element that triggers this menu. This alone wires up\n\t * click and keyboard open/close and the trigger's ARIA attributes; no\n\t * `actionState` or `onClick` toggle is needed.\n\t */\n\ttriggerRef?: React.RefObject<HTMLButtonElement>;\n\n\t/**\n\t * Trigger stop propagation on click\n\t *\n\t * In some instances we may want the trigger element to stop propogation to the\n\t * rest of the DOM. Use this flag to enable and disable it.\n\t * @default false\n\t */\n\ttriggerStopPropagation?: boolean;\n\n\t/**\n\t * Vertical and horizontal alignment of the menu relative to the position of the menu with the trigger\n\t * - 'left' and 'right' work with position 'top' and 'bottom'\n\t * - 'top' and 'bottom' work with position 'left' and 'right'\n\t * - 'center' works with all positions\n\t *\n\t * This does not impact submenus\n\t */\n\talignment?: MenuAlignment;\n\n\t/**\n\t * Called when the menu closes itself: item select, click outside, Escape, Tab,\n\t * or scroll with `closeOnScroll`. Not called when a trigger click toggles it closed.\n\t * @param type - type of close event\n\t */\n\tonClose?: (type?: string) => void;\n\n\t/**\n\t * Enables interaction tracking for this menu. Provide a stable, non-PII id\n\t * (e.g. 'mural-context-menu'). When omitted, the menu emits no analytics.\n\t */\n\teventId?: string;\n}\n\nconst MENU_ITEM_SELECTOR = '[role=\"menuitem\"], [role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]';\n\n/**\n * MrlMenu component\n *\n * Renders a menu component with alignment relative to a trigger element\n * @param {MrlMenuProps} props - The props for the MrlMenu component\n * @returns {Element} - rendered MrlMenu component\n */\nexport function MrlMenu({\n\tactionState = { actionType: null, isOpen: false },\n\talignment = 'center',\n\tchildren,\n\tcloseOnScroll = false,\n\tcloseParent,\n\tcustomPosition,\n\tclickOutsideEvent = 'mouseup',\n\tdisableArrowOpen,\n\tdisableFlipping = false,\n\tid,\n\tisInternal = false,\n\tisSubMenu = false,\n\tspacing = 'default',\n\tmenuOffset = 10,\n\tportalProps = { id: PORTAL_LAYERS.MENU.name },\n\tposition = 'bottom',\n\ttriggerStopPropagation = false,\n\tonClose,\n\teventId,\n\ttriggerRef,\n\t...remainingProps\n}: MrlMenuProps): JSX.Element {\n\tconst defaultOpenState = position === 'static' || false;\n\n\tconst [state, setState] = React.useState({\n\t\tactionType: null,\n\t\tisOpen: defaultOpenState\n\t} as ActionState);\n\n\tconst trackInteraction = useMrlTrackInteraction('MrlMenu', eventId);\n\t// the menu opens and closes from several paths (click, keyboard, hover, click outside),\n\t// so open/close is emitted from the resulting state rather than each individual handler.\n\tconst wasOpenRef = React.useRef(defaultOpenState);\n\n\tReact.useEffect(() => {\n\t\tif (wasOpenRef.current === state.isOpen) return;\n\n\t\twasOpenRef.current = state.isOpen;\n\n\t\ttrackInteraction({\n\t\t\taction: state.isOpen ? 'open' : 'close',\n\t\t\tmetadata: { isSubMenu, trigger: state.actionType ?? 'unknown' },\n\t\t\tvariant: position\n\t\t});\n\t}, [state.isOpen, state.actionType, isSubMenu, position, trackInteraction]);\n\n\tconst menuRef = React.useRef<HTMLDivElement>(null);\n\tconst listRef = React.useRef<HTMLUListElement>(null);\n\tconst [menuItems, setMenuItems] = React.useState<HTMLButtonElement[]>([]);\n\tconst [menuRect, setMenuRect] = React.useState<DOMRect | null>(null);\n\n\t/**\n\t * Checks if the trigger element is disabled\n\t * @returns {boolean} - true if the trigger element is disabled, false otherwise\n\t */\n\tconst isTriggerDisabled = React.useCallback((): boolean => {\n\t\treturn isElementAriaDisabled(triggerRef?.current);\n\t}, [triggerRef]);\n\n\t/**\n\t * Sets up trigger event listeners to open and close the menu\n\t * @param e - mouse event\n\t */\n\tconst toggleMenuTrigger = React.useCallback(\n\t\t(e: MouseEvent) => {\n\t\t\tif (isTriggerDisabled()) return;\n\n\t\t\tif (triggerStopPropagation) {\n\t\t\t\tpreventDefault(e);\n\t\t\t}\n\n\t\t\tsetState((prevState) => ({ actionType: 'click', isOpen: !prevState.isOpen }));\n\t\t},\n\t\t[triggerStopPropagation, isTriggerDisabled]\n\t);\n\n\t/**\n\t * Used to display the menu when hovering over a menu item that has a submenu\n\t */\n\tconst showMenuHover = React.useCallback(() => {\n\t\tsetState({ actionType: 'click', isOpen: true });\n\t}, []);\n\n\tconst showMenuTap = React.useCallback(() => {\n\t\tsetState((prevState) => ({ actionType: 'click', isOpen: !prevState.isOpen }));\n\t}, []);\n\n\tconst hideMenuHover = React.useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tconst relatedTarget = event.relatedTarget as Node;\n\n\t\t\t// If the related target is not a child of the menu, close the menu\n\t\t\t// This prevents the menu from closing when hovering over a submenu item or trigger\n\t\t\tif (\n\t\t\t\ttriggerRef &&\n\t\t\t\tmenuRef.current &&\n\t\t\t\t!menuRef.current.contains(relatedTarget) &&\n\t\t\t\ttriggerRef.current &&\n\t\t\t\t!triggerRef.current.contains(relatedTarget)\n\t\t\t) {\n\t\t\t\tsetState({ actionType: null, isOpen: false });\n\t\t\t}\n\t\t},\n\t\t[triggerRef]\n\t);\n\n\t/**\n\t * Sets up trigger event listeners to open and close the menu with a keyboard\n\t */\n\tconst toggleMenuKey = React.useCallback(\n\t\t(e: KeyboardEvent) => {\n\t\t\tconst openMenu = () => {\n\t\t\t\tif (isTriggerDisabled()) return;\n\t\t\t\tsetState({ actionType: e.key as ActionType, isOpen: true });\n\t\t\t};\n\n\t\t\tif (!state.isOpen) {\n\t\t\t\tif (isSubMenu) {\n\t\t\t\t\tswitch (e.key) {\n\t\t\t\t\t\tcase 'ArrowRight':\n\t\t\t\t\t\tcase 'Enter':\n\t\t\t\t\t\tcase ' ':\n\t\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\t\topenMenu();\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tswitch (e.key) {\n\t\t\t\t\tcase 'ArrowDown':\n\t\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\t\tif (!disableArrowOpen && !isTriggerDisabled()) {\n\t\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\t\topenMenu();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Enter':\n\t\t\t\t\tcase ' ':\n\t\t\t\t\t\tif (isTriggerDisabled()) return;\n\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\topenMenu();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[state.isOpen, isTriggerDisabled, disableArrowOpen, isSubMenu]\n\t);\n\n\tconst closeMenu = React.useCallback(\n\t\t(shouldCloseParent = true) => {\n\t\t\tif (position === 'static') return;\n\n\t\t\t/**\n\t\t\t * What is closeParent?\n\t\t\t *\n\t\t\t * It is passed from the context provider to the MenuItem (which helps render our submenus)\n\t\t\t * When we render the submenu, we pass the closeMenu function as \"closeParent\" to the submenu.\n\t\t\t * This allows us to trigger closing the parent menu when the submenu is closed. And that's\n\t\t\t * what this call is for.\n\t\t\t */\n\t\t\tif (shouldCloseParent && closeParent) closeParent();\n\n\t\t\tsetState({ actionType: null, isOpen: false });\n\t\t\tonClose?.();\n\t\t},\n\t\t[position, closeParent, onClose]\n\t);\n\n\t/**\n\t * Click outside to dismiss the menu\n\t * @param e\n\t */\n\tconst disableClickOutside = !state.isOpen || position === 'static';\n\tuseClickOutside(menuRef, triggerRef, clickOutsideEvent, closeMenu, disableClickOutside);\n\n\tconst handleMenuKeyUp = (e: React.KeyboardEvent) => {\n\t\tconst actions: ActionType[] = ['ArrowUp', 'ArrowDown', 'ArrowRight', 'Enter', 'Escape', ' '];\n\n\t\tif (actions.includes(e.key as ActionType)) {\n\t\t\tpreventDefault(e);\n\t\t}\n\t};\n\n\t/**\n\t * Focus management when someone is using a keyboard to navigate the menu\n\t * @param e - keyboard event\n\t */\n\tconst handleMenuKey = (e: React.KeyboardEvent) => {\n\t\tconst currentIndex = menuItems.findIndex((item) => document.activeElement === item);\n\t\tlet nextIndex: number;\n\n\t\tif (state.isOpen) {\n\t\t\tswitch (e.key) {\n\t\t\t\tcase 'ArrowDown':\n\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\tnextIndex = currentIndex < menuItems.length - 1 ? currentIndex + 1 : currentIndex;\n\t\t\t\t\tmenuItems[nextIndex]?.focus();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\tnextIndex = currentIndex > 0 ? currentIndex - 1 : 0;\n\t\t\t\t\tmenuItems[nextIndex]?.focus();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowRight':\n\t\t\t\tcase 'ArrowLeft':\n\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Escape':\n\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\ttriggerRef?.current?.focus();\n\t\t\t\t\tcloseMenu(false);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Tab':\n\t\t\t\t\tif (!isSubMenu && position !== 'static') {\n\t\t\t\t\t\tif (e.shiftKey) {\n\t\t\t\t\t\t\t// Handle shift + tab: move focus to the previous item\n\t\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\t\tif (triggerRef) {\n\t\t\t\t\t\t\t\tconst prevElement = findAdjacentInteractiveElement(triggerRef, 'previous');\n\t\t\t\t\t\t\t\tprevElement?.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Regular tab: close the menu or move to the next item\n\t\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\t\tif (triggerRef) {\n\t\t\t\t\t\t\t\tconst nextElement = findAdjacentInteractiveElement(triggerRef);\n\t\t\t\t\t\t\t\tnextElement?.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcloseMenu();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * useEffect hooks to handle menu state changes\n\t */\n\n\tReact.useEffect(() => {\n\t\tif (triggerRef?.current) {\n\t\t\ttriggerRef.current.setAttribute('aria-haspopup', 'menu');\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\tReact.useEffect(() => {\n\t\tif (position === 'static') {\n\t\t\tsetState({ actionType: 'click', isOpen: true });\n\t\t}\n\t}, [position]);\n\n\tReact.useEffect(() => {\n\t\ttriggerRef?.current?.setAttribute('aria-expanded', state.isOpen.toString());\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen]);\n\n\tReact.useEffect(() => {\n\t\tif (!isSubMenu && position !== 'static')\n\t\t\tsetState({ actionType: actionState.actionType, isOpen: actionState.isOpen });\n\t}, [actionState.isOpen, actionState.actionType, isSubMenu, position]);\n\n\t// setup event handlers for mouse, keyboard, and scroll interactions\n\tReact.useEffect(() => {\n\t\tconst triggerElement = triggerRef?.current;\n\t\tconst menuElement = menuRef?.current;\n\t\tconst menuItems = menuElement?.querySelectorAll(MENU_ITEM_SELECTOR);\n\n\t\tlet scrollableParent: HTMLElement | Window;\n\n\t\tif (triggerElement) {\n\t\t\ttriggerElement.addEventListener('mousedown', preventDefault);\n\t\t\tif (!isSubMenu) triggerElement.addEventListener('click', toggleMenuTrigger);\n\t\t\ttriggerElement.addEventListener('keydown', toggleMenuKey);\n\n\t\t\t// Setup event listeners for when the menu is a submenu\n\t\t\tif (isSubMenu) {\n\t\t\t\ttriggerElement.addEventListener('mouseover', showMenuHover);\n\t\t\t\ttriggerElement.addEventListener('mouseout', hideMenuHover);\n\n\t\t\t\tif (isTouchDevice()) {\n\t\t\t\t\ttriggerElement.addEventListener('touchend', showMenuTap);\n\t\t\t\t}\n\n\t\t\t\tif (menuElement) {\n\t\t\t\t\tmenuElement.addEventListener('mouseover', showMenuHover);\n\t\t\t\t\tmenuElement.addEventListener('mouseout', hideMenuHover);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (closeOnScroll) {\n\t\t\t\tscrollableParent = getScrollableParent(triggerElement);\n\t\t\t\tif (scrollableParent) {\n\t\t\t\t\tscrollableParent.addEventListener('scroll', () => closeMenu(), {\n\t\t\t\t\t\tcapture: true,\n\t\t\t\t\t\tpassive: true\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\ttriggerElement.removeEventListener('mousedown', preventDefault);\n\t\t\t\tif (!isSubMenu) triggerElement.removeEventListener('click', toggleMenuTrigger);\n\t\t\t\ttriggerElement.removeEventListener('keydown', toggleMenuKey);\n\n\t\t\t\tif (menuItems) {\n\t\t\t\t\tmenuItems.forEach((item: Element) => {\n\t\t\t\t\t\tif (!item.getAttribute('aria-haspopup')) {\n\t\t\t\t\t\t\titem.removeEventListener('mousedown', () => closeMenu());\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (isSubMenu) {\n\t\t\t\t\ttriggerElement.removeEventListener('mouseover', showMenuHover);\n\t\t\t\t\ttriggerElement.removeEventListener('mouseout', hideMenuHover);\n\n\t\t\t\t\tif (isTouchDevice()) {\n\t\t\t\t\t\ttriggerElement.removeEventListener('touchstart', showMenuHover);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (menuElement) {\n\t\t\t\t\t\tmenuElement.removeEventListener('mouseover', showMenuHover);\n\t\t\t\t\t\tmenuElement.removeEventListener('mouseout', hideMenuHover);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (closeOnScroll && scrollableParent) {\n\t\t\t\t\tscrollableParent.removeEventListener('scroll', () => closeMenu());\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}, [\n\t\tcloseOnScroll,\n\t\tisSubMenu,\n\t\ttriggerRef,\n\t\ttoggleMenuTrigger,\n\t\ttoggleMenuKey,\n\t\tshowMenuHover,\n\t\thideMenuHover,\n\t\tcloseMenu,\n\t\tshowMenuTap\n\t]);\n\n\t// This use effect handles a few things when we open the menu:\n\t// - making sure that the menu component is aware of it's menu items\n\t// - adding a class to the trigger element when the submenu is open for styling\n\t// - storing the menu rect in state for positioning calculations\n\tReact.useEffect(() => {\n\t\tif (state.isOpen) {\n\t\t\tconst foundMenuItems = Array.from(\n\t\t\t\tmenuRef.current?.querySelectorAll(MENU_ITEM_SELECTOR) || []\n\t\t\t) as HTMLButtonElement[];\n\n\t\t\tsetMenuItems(foundMenuItems);\n\t\t}\n\n\t\tif (state.isOpen && isSubMenu) {\n\t\t\ttriggerRef?.current?.classList.add(itemStyles['MrlMenuItem--item--submenuOpen']);\n\t\t} else if (!state.isOpen && isSubMenu) {\n\t\t\ttriggerRef?.current?.classList.remove(itemStyles['MrlMenuItem--item--submenuOpen']);\n\t\t}\n\n\t\t// For consistent submenu calculations, we are storing the menu rect in state\n\t\t// Anytime we need to use the menu rect, we want to make sure the values are based\n\t\t// on the original state of the menu for proper transformations\n\t\tif (!menuRect && menuRef.current) {\n\t\t\tconst newRect = menuRef.current?.getBoundingClientRect();\n\t\t\tsetMenuRect(newRect || null);\n\t\t}\n\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen, menuRect, isSubMenu]);\n\n\t/**\n\t * Focus management for when the menu is opening or closing\n\t */\n\tReact.useEffect(() => {\n\t\tif (menuItems.length > 0) {\n\t\t\tlet menuItemToFocus;\n\n\t\t\tswitch (state.actionType) {\n\t\t\t\tcase 'Enter':\n\t\t\t\tcase 'ArrowDown':\n\t\t\t\tcase ' ':\n\t\t\t\t\tmenuItemToFocus = menuItems[0];\n\t\t\t\t\tmenuItemToFocus?.focus();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\tmenuItemToFocus = menuItems[menuItems.length - 1];\n\t\t\t\t\tmenuItemToFocus?.focus();\n\n\t\t\t\t\t// Scroll to the bottom of the menu when the last item is focused\n\t\t\t\t\t// setTimeout is required to ensure the element has been rendered\n\t\t\t\t\t// and the scrollHeight is accurate prior to scrolling\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tif (listRef.current) {\n\t\t\t\t\t\t\tlistRef.current.scrollTo(0, listRef.current.scrollHeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 20);\n\t\t\t}\n\n\t\t\tif (isSubMenu && state.actionType === 'ArrowRight') {\n\t\t\t\tmenuItemToFocus = menuItems[0];\n\t\t\t\tmenuItemToFocus?.focus();\n\t\t\t}\n\t\t}\n\t}, [isSubMenu, menuItems, state.actionType]);\n\n\t/**\n\t * Menu scroll behavior\n\t *\n\t * When the menu cannot fit in the preferred or flipped position,\n\t * this hook constrains the menu height and enables internal scrolling.\n\t * Called before useTriggerPosition so that isScrolling can disable flipping,\n\t * preventing the positioning hook from fighting the scroll constraint.\n\t */\n\tconst disableMenuScroll =\n\t\tisSubMenu || !state.isOpen || position === 'static' || position === 'ignore';\n\n\t/**\n\t * Sets overflow (scrolling) on menu when there is no space to display\n\t * the menu in the preferred or flipped position.\n\t */\n\tconst menuScroll = useMenuScroll(\n\t\ttriggerRef,\n\t\tlistRef,\n\t\tposition,\n\t\tmenuOffset,\n\t\tstate.isOpen,\n\t\tdisableMenuScroll\n\t);\n\n\t/**\n\t * Primary menu positioning, alignment, and transition styling\n\t *\n\t * This hook is only enabled if isSubMenu is FALSE\n\t */\n\tconst disableTriggerPosition = isSubMenu || !state.isOpen || position === 'static';\n\tconst menuPositionStyles = useTriggerPosition(\n\t\ttriggerRef,\n\t\tmenuRef,\n\t\t{\n\t\t\talign: alignment,\n\t\t\tcustomPosition: customPosition,\n\t\t\tposition: position\n\t\t},\n\t\tstate.isOpen,\n\t\tmenuOffset,\n\t\tdisableTriggerPosition,\n\t\tdisableFlipping || menuScroll.isScrolling\n\t);\n\n\t/**\n\t * The first position is calculated after the menu renders, so it would paint for a frame\n\t * at its initial (or previous) position. Keep it hidden until it has been positioned.\n\t * Uses opacity instead of visibility so menu items can still receive focus.\n\t */\n\tconst isAwaitingPosition = !disableTriggerPosition && !menuPositionStyles.isPositioned;\n\tconst hideUntilPositionedStyles = isAwaitingPosition\n\t\t? { opacity: 0, pointerEvents: 'none' as const }\n\t\t: undefined;\n\n\t/**\n\t * Submenu positioning and alignment\n\t *\n\t * This hook is only enabled if isSubMenu is TRUE\n\t */\n\tconst subMenuPosition = useSubMenuElementPosition(\n\t\ttriggerRef,\n\t\tmenuRef,\n\t\tisSubMenu,\n\t\tstate.isOpen,\n\t\tmenuRect,\n\t\t// disable the subelement positioning if it's not a submenu\n\t\t!isSubMenu\n\t);\n\n\tconst inlineStyles = {\n\t\tmenu: {\n\t\t\tleft: menuPositionStyles.left,\n\t\t\tposition: 'fixed' as const,\n\t\t\ttop: menuPositionStyles.top\n\t\t},\n\t\tsubmenu: {\n\t\t\tleft: subMenuPosition.left,\n\t\t\ttop: subMenuPosition.top\n\t\t}\n\t};\n\n\t/**\n\t * React Spring transitions for the menu\n\t */\n\tconst transitionConfig = {\n\t\tconfig: { duration: state.isOpen ? 300 : 150 },\n\t\tenter: { opacity: 1, transform: 'translateY(0)' },\n\t\tfrom: { opacity: 0, transform: 'translateY(4px)' },\n\t\tleave: { opacity: 0, transform: 'translateY(4px)' }\n\t};\n\n\tconst transitionStatic = {\n\t\tconfig: { duration: 0 },\n\t\tenter: { opacity: 1, transform: 'translateY(0)' }\n\t};\n\n\tconst transitions = useTransition(\n\t\tstate.isOpen,\n\t\tposition === 'static' ? transitionStatic : transitionConfig\n\t);\n\n\tconst menuClasses = classnames(styles['MrlMenu'], 'MrlMenu', {\n\t\t[styles['MrlMenu--submenu']]: isSubMenu,\n\t\t[styles.open]: state.isOpen,\n\t\t[styles['MrlMenu--compact']]: spacing === 'compact',\n\t\t[styles['MrlMenu--static']]: position === 'static',\n\t\t[styles['MrlMenu--internal']]: isInternal,\n\t\t[styles['MrlMenu--scrolling']]: menuScroll.isScrolling,\n\t\t[styles['MrlMenu--ignore']]: position === 'ignore'\n\t});\n\n\tconst positionStyles = isSubMenu\n\t\t? inlineStyles.submenu\n\t\t: position !== 'static'\n\t\t\t? inlineStyles.menu\n\t\t\t: {};\n\n\tconst menuScrollStyles =\n\t\t(menuScroll.maxHeight !== undefined && { maxHeight: menuScroll.maxHeight }) || undefined;\n\n\tconst renderMenu = () => {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{transitions(\n\t\t\t\t\t(style, item) =>\n\t\t\t\t\t\titem && (\n\t\t\t\t\t\t\t<animated.div\n\t\t\t\t\t\t\t\tclassName={menuClasses}\n\t\t\t\t\t\t\t\tid={id}\n\t\t\t\t\t\t\t\tstyle={{ ...positionStyles, ...style, ...hideUntilPositionedStyles }}\n\t\t\t\t\t\t\t\tonKeyUp={handleMenuKeyUp}\n\t\t\t\t\t\t\t\tonKeyDown={handleMenuKey}\n\t\t\t\t\t\t\t\tref={menuRef}\n\t\t\t\t\t\t\t\trole=\"none\"\n\t\t\t\t\t\t\t\t{...remainingProps}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ul ref={listRef} role=\"menu\" style={menuScrollStyles}>\n\t\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</animated.div>\n\t\t\t\t\t\t)\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t};\n\n\t// For managing and restoring focus to the original menu trigger\n\t// Ensures the triggerRef in context is always the parent triggerRef\n\tconst parentContext = React.useContext(MrlMenuContext);\n\tconst contextTriggerRef = isSubMenu ? parentContext?.triggerRef : triggerRef;\n\n\treturn (\n\t\t<MrlMenuContext.Provider\n\t\t\tvalue={{\n\t\t\t\tcloseMenu,\n\t\t\t\tcloseParent: !isSubMenu ? closeMenu : undefined,\n\t\t\t\ttriggerRef: contextTriggerRef\n\t\t\t}}\n\t\t>\n\t\t\t{isSubMenu || position === 'static' ? (\n\t\t\t\trenderMenu()\n\t\t\t) : (\n\t\t\t\t<MrlPortal layer={portalProps.layer || PORTAL_LAYERS.MENU} {...portalProps}>\n\t\t\t\t\t{renderMenu()}\n\t\t\t\t</MrlPortal>\n\t\t\t)}\n\t\t</MrlMenuContext.Provider>\n\t);\n\t/* eslint-enable */\n}\n\nMrlMenu.componentType = 'Menu';\n"],"names":["MENU_ITEM_SELECTOR","MrlMenu","_ref","_ref$actionState","actionState","actionType","isOpen","_ref$alignment","alignment","children","_ref$closeOnScroll","closeOnScroll","closeParent","customPosition","_ref$clickOutsideEven","clickOutsideEvent","disableArrowOpen","_ref$disableFlipping","disableFlipping","id","_ref$isInternal","isInternal","_ref$isSubMenu","isSubMenu","_ref$spacing","spacing","_ref$menuOffset","menuOffset","_ref$portalProps","portalProps","PORTAL_LAYERS","MENU","name","_ref$position","position","_ref$triggerStopPropa","triggerStopPropagation","onClose","eventId","triggerRef","remainingProps","_objectWithoutProperties","_excluded","defaultOpenState","_React$useState","React","useState","_React$useState2","_slicedToArray","state","setState","trackInteraction","useMrlTrackInteraction","wasOpenRef","useRef","useEffect","_state$actionType","current","action","metadata","trigger","variant","menuRef","listRef","_React$useState3","_React$useState4","menuItems","setMenuItems","_React$useState5","_React$useState6","menuRect","setMenuRect","isTriggerDisabled","useCallback","isElementAriaDisabled","toggleMenuTrigger","e","preventDefault","prevState","showMenuHover","showMenuTap","hideMenuHover","event","relatedTarget","contains","toggleMenuKey","openMenu","key","closeMenu","shouldCloseParent","arguments","length","undefined","disableClickOutside","useClickOutside","handleMenuKeyUp","actions","includes","handleMenuKey","_menuItems$nextIndex","_menuItems$nextIndex2","_triggerRef$current","currentIndex","findIndex","item","document","activeElement","nextIndex","focus","shiftKey","prevElement","findAdjacentInteractiveElement","nextElement","setAttribute","_triggerRef$current2","toString","triggerElement","menuElement","querySelectorAll","scrollableParent","addEventListener","isTouchDevice","getScrollableParent","capture","passive","removeEventListener","forEach","getAttribute","_menuRef$current","foundMenuItems","Array","from","_triggerRef$current3","classList","add","itemStyles","_triggerRef$current4","remove","_menuRef$current2","newRect","getBoundingClientRect","_menuItemToFocus","_menuItemToFocus2","menuItemToFocus","setTimeout","scrollTo","scrollHeight","_menuItemToFocus3","disableMenuScroll","menuScroll","useMenuScroll","disableTriggerPosition","menuPositionStyles","useTriggerPosition","align","isScrolling","isAwaitingPosition","isPositioned","hideUntilPositionedStyles","opacity","pointerEvents","subMenuPosition","useSubMenuElementPosition","inlineStyles","menu","left","top","submenu","transitionConfig","config","duration","enter","transform","leave","transitionStatic","transitions","useTransition","menuClasses","classnames","styles","open","positionStyles","menuScrollStyles","maxHeight","renderMenu","createElement","Fragment","style","animated","div","_extends","className","_objectSpread","onKeyUp","onKeyDown","ref","role","parentContext","useContext","MrlMenuContext","contextTriggerRef","Provider","value","MrlPortal","layer","componentType"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqKA,IAAMA,kBAAkB,GAAG,sEAAsE;;AAEjG;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,OAAOA,CAAAC,IAAA,EAsBO;AAAA,EAAA,IAAAC,gBAAA,GAAAD,IAAA,CArB7BE,WAAW;IAAXA,WAAW,GAAAD,gBAAA,KAAA,MAAA,GAAG;AAAEE,MAAAA,UAAU,EAAE,IAAI;AAAEC,MAAAA,MAAM,EAAE;AAAM,KAAC,GAAAH,gBAAA;IAAAI,cAAA,GAAAL,IAAA,CACjDM,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,QAAQ,GAAAA,cAAA;IACpBE,QAAQ,GAAAP,IAAA,CAARO,QAAQ;IAAAC,kBAAA,GAAAR,IAAA,CACRS,aAAa;AAAbA,IAAAA,aAAa,GAAAD,kBAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,kBAAA;IACrBE,WAAW,GAAAV,IAAA,CAAXU,WAAW;IACXC,cAAc,GAAAX,IAAA,CAAdW,cAAc;IAAAC,qBAAA,GAAAZ,IAAA,CACda,iBAAiB;AAAjBA,IAAAA,iBAAiB,GAAAD,qBAAA,KAAA,MAAA,GAAG,SAAS,GAAAA,qBAAA;IAC7BE,gBAAgB,GAAAd,IAAA,CAAhBc,gBAAgB;IAAAC,oBAAA,GAAAf,IAAA,CAChBgB,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,oBAAA;IACvBE,EAAE,GAAAjB,IAAA,CAAFiB,EAAE;IAA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AAE,CAACW,SAAS,GAAGiE,SAAS,GAAGI,SAAS;AAC/CrD,MAAAA,UAAU,EAAEiK;AACb;AAAE,GAAA,EAEDjL,SAAS,IAAIW,QAAQ,KAAK,QAAQ,GAClCsJ,UAAU,EAAE,gBAEZ3I,KAAA,CAAA4I,aAAA,CAACkB,SAAS,EAAAb,QAAA,CAAA;AAACc,IAAAA,KAAK,EAAE/K,WAAW,CAAC+K,KAAK,IAAI9K,aAAa,CAACC;AAAK,GAAA,EAAKF,WAAW,CAAA,EACxE2J,UAAU,EACD,CAEY,CAAC;AAE3B;AACD;AAEAvL,OAAO,CAAC4M,aAAa,GAAG,MAAM;;;;"}
1
+ {"version":3,"file":"MrlMenu.js","sources":["../../../../../src/components/menu/MrlMenu/MrlMenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport { MrlPortal, PortalProps } from '../../portal/MrlPortal';\nimport { useTriggerPosition } from '../../../hooks/useTriggerPosition';\nimport { useClickOutside } from '../../../hooks/useClickOutside';\nimport { useSubMenuElementPosition } from '../hooks/useSubMenuElementPosition';\nimport {\n\tMenuPosition,\n\tMenuAlignment,\n\tActionState,\n\tActionType,\n\tCustomMenuPosition\n} from '../constants';\nimport { PORTAL_LAYERS } from '../../../utils/layers';\nimport {\n\tfindAdjacentInteractiveElement,\n\tpreventDefault,\n\tisElementAriaDisabled\n} from '../../../utils';\nimport classnames from 'classnames';\nimport { MrlMenuContext } from '../context/MrlMenuContext';\nimport styles from './MrlMenu.module.scss';\nimport itemStyles from '../MrlMenuItem/MrlMenuItem.module.scss';\nimport { useTransition, animated } from '@react-spring/web';\nimport { isTouchDevice } from '../../../utils/isTouch';\nimport { getScrollableParent } from '../utilities/get-scrollable-parent';\nimport { useMenuScroll } from '../hooks/useMenuScroll';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\nexport interface MrlMenuProps {\n\t/** Custom position for the menu */\n\tcustomPosition?: CustomMenuPosition;\n\n\t/** Children to be rendered within the menu component*/\n\tchildren: React.ReactNode;\n\n\t/** Event to close the menu */\n\tclickOutsideEvent?: 'mousedown' | 'mouseup' | 'click';\n\n\t/**\n\t * Enables closing the menu when scrolling. Default is false.\n\t *\n\t */\n\tcloseOnScroll?: boolean;\n\n\t/**\n\t * Private closeParent prop for use with MrlMenuItem\n\t *\n\t * !!! Please do not use this prop directly, it is only used internally by MrlMenuItem !!!\n\t * @private\n\t */\n\tcloseParent?: () => void;\n\n\t/**\n\t * Disable arrows from opening the menu\n\t * - This is useful when you want to disable the default browser behavior of opening a menu on arrow down.\n\t *\n\t * Example usage: the menu is within a vertical toolbar and you want to use the arrow keys to navigate the toolbar.\n\t * By using this prop you can disable the arrow key open/close so that navigating the toolbar does not conflict\n\t * with opening/closing the menu.\n\t */\n\tdisableArrowOpen?: boolean;\n\n\t/**\n\t * Disable flipping of the menu when it goes off the screen\n\t * @default false\n\t */\n\tdisableFlipping?: boolean;\n\n\t/** Unique identifier for the menu */\n\tid?: string;\n\n\t/**\n\t * Use when the menu is embedded within another component\n\t * Removes the following styles:\n\t * - padding on the menu\n\t * - drop shadow and border\n\t * @default false\n\t */\n\tisInternal?: boolean;\n\n\t/**\n\t * Private isSubMenu prop for use with MrlMenuItem\n\t *\n\t * !!! Please do not use this prop directly, it is only used internally by MrlMenuItem !!!\n\t * @private\n\t */\n\tisSubMenu?: boolean;\n\n\t/**\n\t * spacing of menu\n\t * - compact has less padding\n\t * @default 'default'\n\t */\n\tspacing?: 'default' | 'compact';\n\n\t/**\n\t * Offset of the menu from the trigger element in pixels\n\t * @default 10px\n\t */\n\tmenuOffset?: number;\n\n\t/**\n\t * Configuration for the portal component\n\t */\n\tportalProps?: Omit<PortalProps, 'children'>;\n\n\t/**\n\t * Horizontal and vertical alignment of the menu relative to the trigger element\n\t * - position 'left', 'right', 'top', 'bottom' position relative to the trigger\n\t * - position 'static' renders the menu in place, not using the portal\n\t * - position 'ignore' will not position the menu, allowing you to use the customPosition prop to position the element\n\t * @default 'bottom'\n\t */\n\tposition?: MenuPosition;\n\n\t/**\n\t * Opens or closes the menu from outside. Not just an initial value: whenever\n\t * `isOpen` or `actionType` changes, the menu syncs its internal state to it.\n\t * The menu can still close itself (item select, click outside, Escape, Tab),\n\t * so pair this with `onClose` to reset your state. Prefer `triggerRef` when\n\t * there is a trigger element. Ignored for submenus and `position=\"static\"`.\n\t * @default { actionType: null, isOpen: false }\n\t */\n\tactionState?: ActionState;\n\n\t/**\n\t * Reference to the DOM element that triggers this menu. This alone wires up\n\t * click and keyboard open/close and the trigger's ARIA attributes; no\n\t * `actionState` or `onClick` toggle is needed.\n\t */\n\ttriggerRef?: React.RefObject<HTMLButtonElement>;\n\n\t/**\n\t * Trigger stop propagation on click\n\t *\n\t * In some instances we may want the trigger element to stop propogation to the\n\t * rest of the DOM. Use this flag to enable and disable it.\n\t * @default false\n\t */\n\ttriggerStopPropagation?: boolean;\n\n\t/**\n\t * Vertical and horizontal alignment of the menu relative to the position of the menu with the trigger\n\t * - 'left' and 'right' work with position 'top' and 'bottom'\n\t * - 'top' and 'bottom' work with position 'left' and 'right'\n\t * - 'center' works with all positions\n\t *\n\t * This does not impact submenus\n\t */\n\talignment?: MenuAlignment;\n\n\t/**\n\t * Called when the menu closes itself: item select, click outside, Escape, Tab,\n\t * or scroll with `closeOnScroll`. Not called when a trigger click toggles it closed.\n\t * @param type - type of close event\n\t */\n\tonClose?: (type?: string) => void;\n\n\t/**\n\t * Enables interaction tracking for this menu. Provide a stable, non-PII id\n\t * (e.g. 'mural-context-menu'). When omitted, the menu emits no analytics.\n\t */\n\teventId?: string;\n}\n\nconst MENU_ITEM_SELECTOR = '[role=\"menuitem\"], [role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]';\n\n/**\n * MrlMenu component\n *\n * Renders a menu component with alignment relative to a trigger element\n * @param {MrlMenuProps} props - The props for the MrlMenu component\n * @returns {Element} - rendered MrlMenu component\n */\nexport function MrlMenu({\n\tactionState = { actionType: null, isOpen: false },\n\talignment = 'center',\n\tchildren,\n\tcloseOnScroll = false,\n\tcloseParent,\n\tcustomPosition,\n\tclickOutsideEvent = 'mouseup',\n\tdisableArrowOpen,\n\tdisableFlipping = false,\n\tid,\n\tisInternal = false,\n\tisSubMenu = false,\n\tspacing = 'default',\n\tmenuOffset = 10,\n\tportalProps = { id: PORTAL_LAYERS.MENU.name },\n\tposition = 'bottom',\n\ttriggerStopPropagation = false,\n\tonClose,\n\teventId,\n\ttriggerRef,\n\t...remainingProps\n}: MrlMenuProps): JSX.Element {\n\tconst defaultOpenState = position === 'static' || false;\n\n\tconst [state, setState] = React.useState({\n\t\tactionType: null,\n\t\tisOpen: defaultOpenState\n\t} as ActionState);\n\n\tconst trackInteraction = useMrlTrackInteraction('MrlMenu', eventId);\n\t// the menu opens and closes from several paths (click, keyboard, hover, click outside),\n\t// so open/close is emitted from the resulting state rather than each individual handler.\n\tconst wasOpenRef = React.useRef(defaultOpenState);\n\n\tReact.useEffect(() => {\n\t\tif (wasOpenRef.current === state.isOpen) return;\n\n\t\twasOpenRef.current = state.isOpen;\n\n\t\ttrackInteraction({\n\t\t\taction: state.isOpen ? 'open' : 'close',\n\t\t\tmetadata: { isSubMenu, trigger: state.actionType ?? 'unknown' },\n\t\t\tvariant: position\n\t\t});\n\t}, [state.isOpen, state.actionType, isSubMenu, position, trackInteraction]);\n\n\tconst menuRef = React.useRef<HTMLDivElement>(null);\n\tconst listRef = React.useRef<HTMLUListElement>(null);\n\tconst [menuItems, setMenuItems] = React.useState<HTMLButtonElement[]>([]);\n\tconst [menuRect, setMenuRect] = React.useState<DOMRect | null>(null);\n\n\t/**\n\t * Checks if the trigger element is disabled\n\t * @returns {boolean} - true if the trigger element is disabled, false otherwise\n\t */\n\tconst isTriggerDisabled = React.useCallback((): boolean => {\n\t\treturn isElementAriaDisabled(triggerRef?.current);\n\t}, [triggerRef]);\n\n\t/**\n\t * Sets up trigger event listeners to open and close the menu\n\t * @param e - mouse event\n\t */\n\tconst toggleMenuTrigger = React.useCallback(\n\t\t(e: MouseEvent) => {\n\t\t\tif (isTriggerDisabled()) return;\n\n\t\t\tif (triggerStopPropagation) {\n\t\t\t\tpreventDefault(e);\n\t\t\t}\n\n\t\t\tsetState((prevState) => ({ actionType: 'click', isOpen: !prevState.isOpen }));\n\t\t},\n\t\t[triggerStopPropagation, isTriggerDisabled]\n\t);\n\n\t/**\n\t * Used to display the menu when hovering over a menu item that has a submenu\n\t */\n\tconst showMenuHover = React.useCallback(() => {\n\t\tsetState({ actionType: 'click', isOpen: true });\n\t}, []);\n\n\tconst showMenuTap = React.useCallback(() => {\n\t\tsetState((prevState) => ({ actionType: 'click', isOpen: !prevState.isOpen }));\n\t}, []);\n\n\tconst hideMenuHover = React.useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tconst relatedTarget = event.relatedTarget as Node;\n\n\t\t\t// If the related target is not a child of the menu, close the menu\n\t\t\t// This prevents the menu from closing when hovering over a submenu item or trigger\n\t\t\tif (\n\t\t\t\ttriggerRef &&\n\t\t\t\tmenuRef.current &&\n\t\t\t\t!menuRef.current.contains(relatedTarget) &&\n\t\t\t\ttriggerRef.current &&\n\t\t\t\t!triggerRef.current.contains(relatedTarget)\n\t\t\t) {\n\t\t\t\tsetState({ actionType: null, isOpen: false });\n\t\t\t}\n\t\t},\n\t\t[triggerRef]\n\t);\n\n\t/**\n\t * Sets up trigger event listeners to open and close the menu with a keyboard\n\t */\n\tconst toggleMenuKey = React.useCallback(\n\t\t(e: KeyboardEvent) => {\n\t\t\tconst openMenu = () => {\n\t\t\t\tif (isTriggerDisabled()) return;\n\t\t\t\tsetState({ actionType: e.key as ActionType, isOpen: true });\n\t\t\t};\n\n\t\t\tif (!state.isOpen) {\n\t\t\t\tif (isSubMenu) {\n\t\t\t\t\tswitch (e.key) {\n\t\t\t\t\t\tcase 'ArrowRight':\n\t\t\t\t\t\tcase 'Enter':\n\t\t\t\t\t\tcase ' ':\n\t\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\t\topenMenu();\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tswitch (e.key) {\n\t\t\t\t\tcase 'ArrowDown':\n\t\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\t\tif (!disableArrowOpen && !isTriggerDisabled()) {\n\t\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\t\topenMenu();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Enter':\n\t\t\t\t\tcase ' ':\n\t\t\t\t\t\tif (isTriggerDisabled()) return;\n\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\topenMenu();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[state.isOpen, isTriggerDisabled, disableArrowOpen, isSubMenu]\n\t);\n\n\tconst closeMenu = React.useCallback(\n\t\t(shouldCloseParent = true) => {\n\t\t\tif (position === 'static') return;\n\n\t\t\t/**\n\t\t\t * What is closeParent?\n\t\t\t *\n\t\t\t * It is passed from the context provider to the MenuItem (which helps render our submenus)\n\t\t\t * When we render the submenu, we pass the closeMenu function as \"closeParent\" to the submenu.\n\t\t\t * This allows us to trigger closing the parent menu when the submenu is closed. And that's\n\t\t\t * what this call is for.\n\t\t\t */\n\t\t\tif (shouldCloseParent && closeParent) closeParent();\n\n\t\t\tsetState({ actionType: null, isOpen: false });\n\t\t\tonClose?.();\n\t\t},\n\t\t[position, closeParent, onClose]\n\t);\n\n\t/**\n\t * Click outside to dismiss the menu\n\t * @param e\n\t */\n\tconst disableClickOutside = !state.isOpen || position === 'static';\n\tuseClickOutside(menuRef, triggerRef, clickOutsideEvent, closeMenu, disableClickOutside);\n\n\tconst handleMenuKeyUp = (e: React.KeyboardEvent) => {\n\t\tconst actions: ActionType[] = ['ArrowUp', 'ArrowDown', 'ArrowRight', 'Enter', 'Escape', ' '];\n\n\t\tif (actions.includes(e.key as ActionType)) {\n\t\t\tpreventDefault(e);\n\t\t}\n\t};\n\n\t/**\n\t * Focus management when someone is using a keyboard to navigate the menu\n\t * @param e - keyboard event\n\t */\n\tconst handleMenuKey = (e: React.KeyboardEvent) => {\n\t\tconst currentIndex = menuItems.findIndex((item) => document.activeElement === item);\n\t\tlet nextIndex: number;\n\n\t\tif (state.isOpen) {\n\t\t\tswitch (e.key) {\n\t\t\t\tcase 'ArrowDown':\n\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\tnextIndex = currentIndex < menuItems.length - 1 ? currentIndex + 1 : currentIndex;\n\t\t\t\t\tmenuItems[nextIndex]?.focus();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\tnextIndex = currentIndex > 0 ? currentIndex - 1 : 0;\n\t\t\t\t\tmenuItems[nextIndex]?.focus();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowRight':\n\t\t\t\tcase 'ArrowLeft':\n\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Escape':\n\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\ttriggerRef?.current?.focus();\n\t\t\t\t\tcloseMenu(false);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Tab':\n\t\t\t\t\tif (!isSubMenu && position !== 'static') {\n\t\t\t\t\t\tif (e.shiftKey) {\n\t\t\t\t\t\t\t// Handle shift + tab: move focus to the previous item\n\t\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\t\tif (triggerRef) {\n\t\t\t\t\t\t\t\tconst prevElement = findAdjacentInteractiveElement(triggerRef, 'previous');\n\t\t\t\t\t\t\t\tprevElement?.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Regular tab: close the menu or move to the next item\n\t\t\t\t\t\t\tpreventDefault(e);\n\t\t\t\t\t\t\tif (triggerRef) {\n\t\t\t\t\t\t\t\tconst nextElement = findAdjacentInteractiveElement(triggerRef);\n\t\t\t\t\t\t\t\tnextElement?.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcloseMenu();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * useEffect hooks to handle menu state changes\n\t */\n\n\tReact.useEffect(() => {\n\t\tif (triggerRef?.current) {\n\t\t\ttriggerRef.current.setAttribute('aria-haspopup', 'menu');\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\tReact.useEffect(() => {\n\t\tif (position === 'static') {\n\t\t\tsetState({ actionType: 'click', isOpen: true });\n\t\t}\n\t}, [position]);\n\n\tReact.useEffect(() => {\n\t\ttriggerRef?.current?.setAttribute('aria-expanded', state.isOpen.toString());\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen]);\n\n\tReact.useEffect(() => {\n\t\tif (!isSubMenu && position !== 'static')\n\t\t\tsetState({ actionType: actionState.actionType, isOpen: actionState.isOpen });\n\t}, [actionState.isOpen, actionState.actionType, isSubMenu, position]);\n\n\t// setup event handlers for mouse, keyboard, and scroll interactions\n\tReact.useEffect(() => {\n\t\tconst triggerElement = triggerRef?.current;\n\t\tconst menuElement = menuRef?.current;\n\t\tconst menuItems = menuElement?.querySelectorAll(MENU_ITEM_SELECTOR);\n\n\t\tlet scrollableParent: HTMLElement | Window;\n\n\t\tif (triggerElement) {\n\t\t\ttriggerElement.addEventListener('mousedown', preventDefault);\n\t\t\tif (!isSubMenu) triggerElement.addEventListener('click', toggleMenuTrigger);\n\t\t\ttriggerElement.addEventListener('keydown', toggleMenuKey);\n\n\t\t\t// Setup event listeners for when the menu is a submenu\n\t\t\tif (isSubMenu) {\n\t\t\t\ttriggerElement.addEventListener('mouseover', showMenuHover);\n\t\t\t\ttriggerElement.addEventListener('mouseout', hideMenuHover);\n\n\t\t\t\tif (isTouchDevice()) {\n\t\t\t\t\ttriggerElement.addEventListener('touchend', showMenuTap);\n\t\t\t\t}\n\n\t\t\t\tif (menuElement) {\n\t\t\t\t\tmenuElement.addEventListener('mouseover', showMenuHover);\n\t\t\t\t\tmenuElement.addEventListener('mouseout', hideMenuHover);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (closeOnScroll) {\n\t\t\t\tscrollableParent = getScrollableParent(triggerElement);\n\t\t\t\tif (scrollableParent) {\n\t\t\t\t\tscrollableParent.addEventListener('scroll', () => closeMenu(), {\n\t\t\t\t\t\tcapture: true,\n\t\t\t\t\t\tpassive: true\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\ttriggerElement.removeEventListener('mousedown', preventDefault);\n\t\t\t\tif (!isSubMenu) triggerElement.removeEventListener('click', toggleMenuTrigger);\n\t\t\t\ttriggerElement.removeEventListener('keydown', toggleMenuKey);\n\n\t\t\t\tif (menuItems) {\n\t\t\t\t\tmenuItems.forEach((item: Element) => {\n\t\t\t\t\t\tif (!item.getAttribute('aria-haspopup')) {\n\t\t\t\t\t\t\titem.removeEventListener('mousedown', () => closeMenu());\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (isSubMenu) {\n\t\t\t\t\ttriggerElement.removeEventListener('mouseover', showMenuHover);\n\t\t\t\t\ttriggerElement.removeEventListener('mouseout', hideMenuHover);\n\n\t\t\t\t\tif (isTouchDevice()) {\n\t\t\t\t\t\ttriggerElement.removeEventListener('touchstart', showMenuHover);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (menuElement) {\n\t\t\t\t\t\tmenuElement.removeEventListener('mouseover', showMenuHover);\n\t\t\t\t\t\tmenuElement.removeEventListener('mouseout', hideMenuHover);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (closeOnScroll && scrollableParent) {\n\t\t\t\t\tscrollableParent.removeEventListener('scroll', () => closeMenu());\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}, [\n\t\tcloseOnScroll,\n\t\tisSubMenu,\n\t\ttriggerRef,\n\t\ttoggleMenuTrigger,\n\t\ttoggleMenuKey,\n\t\tshowMenuHover,\n\t\thideMenuHover,\n\t\tcloseMenu,\n\t\tshowMenuTap\n\t]);\n\n\t// This use effect handles a few things when we open the menu:\n\t// - making sure that the menu component is aware of it's menu items\n\t// - adding a class to the trigger element when the submenu is open for styling\n\t// - storing the menu rect in state for positioning calculations\n\tReact.useEffect(() => {\n\t\tif (state.isOpen) {\n\t\t\tconst foundMenuItems = Array.from(\n\t\t\t\tmenuRef.current?.querySelectorAll(MENU_ITEM_SELECTOR) || []\n\t\t\t) as HTMLButtonElement[];\n\n\t\t\tsetMenuItems(foundMenuItems);\n\t\t}\n\n\t\tif (state.isOpen && isSubMenu) {\n\t\t\ttriggerRef?.current?.classList.add(itemStyles['MrlMenuItem--item--submenuOpen']);\n\t\t} else if (!state.isOpen && isSubMenu) {\n\t\t\ttriggerRef?.current?.classList.remove(itemStyles['MrlMenuItem--item--submenuOpen']);\n\t\t}\n\n\t\t// For consistent submenu calculations, we are storing the menu rect in state\n\t\t// Anytime we need to use the menu rect, we want to make sure the values are based\n\t\t// on the original state of the menu for proper transformations\n\t\tif (!menuRect && menuRef.current) {\n\t\t\tconst newRect = menuRef.current?.getBoundingClientRect();\n\t\t\tsetMenuRect(newRect || null);\n\t\t}\n\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen, menuRect, isSubMenu]);\n\n\t/**\n\t * Focus management for when the menu is opening or closing\n\t */\n\tReact.useEffect(() => {\n\t\tif (menuItems.length > 0) {\n\t\t\tlet menuItemToFocus;\n\n\t\t\tswitch (state.actionType) {\n\t\t\t\tcase 'Enter':\n\t\t\t\tcase 'ArrowDown':\n\t\t\t\tcase ' ':\n\t\t\t\t\tmenuItemToFocus = menuItems[0];\n\t\t\t\t\tmenuItemToFocus?.focus();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\tmenuItemToFocus = menuItems[menuItems.length - 1];\n\t\t\t\t\tmenuItemToFocus?.focus();\n\n\t\t\t\t\t// Scroll to the bottom of the menu when the last item is focused\n\t\t\t\t\t// setTimeout is required to ensure the element has been rendered\n\t\t\t\t\t// and the scrollHeight is accurate prior to scrolling\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tif (listRef.current) {\n\t\t\t\t\t\t\tlistRef.current.scrollTo(0, listRef.current.scrollHeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 20);\n\t\t\t}\n\n\t\t\tif (isSubMenu && state.actionType === 'ArrowRight') {\n\t\t\t\tmenuItemToFocus = menuItems[0];\n\t\t\t\tmenuItemToFocus?.focus();\n\t\t\t}\n\t\t}\n\t}, [isSubMenu, menuItems, state.actionType]);\n\n\t/**\n\t * Menu scroll behavior\n\t *\n\t * When the menu cannot fit in the preferred or flipped position,\n\t * this hook constrains the menu height and enables internal scrolling.\n\t * Called before useTriggerPosition so that isScrolling can disable flipping,\n\t * preventing the positioning hook from fighting the scroll constraint.\n\t */\n\tconst disableMenuScroll =\n\t\tisSubMenu || !state.isOpen || position === 'static' || position === 'ignore';\n\n\t/**\n\t * Sets overflow (scrolling) on menu when there is no space to display\n\t * the menu in the preferred or flipped position.\n\t */\n\tconst menuScroll = useMenuScroll(\n\t\ttriggerRef,\n\t\tlistRef,\n\t\tposition,\n\t\tmenuOffset,\n\t\tstate.isOpen,\n\t\tdisableMenuScroll\n\t);\n\n\t/**\n\t * Primary menu positioning, alignment, and transition styling\n\t *\n\t * This hook is only enabled if isSubMenu is FALSE\n\t */\n\tconst disableTriggerPosition = isSubMenu || !state.isOpen || position === 'static';\n\tconst menuPositionStyles = useTriggerPosition(\n\t\ttriggerRef,\n\t\tmenuRef,\n\t\t{\n\t\t\talign: alignment,\n\t\t\tcustomPosition: customPosition,\n\t\t\tposition: position\n\t\t},\n\t\tstate.isOpen,\n\t\tmenuOffset,\n\t\tdisableTriggerPosition,\n\t\tdisableFlipping || menuScroll.isScrolling\n\t);\n\n\t/**\n\t * The first position is calculated after the menu renders, so it would paint for a frame\n\t * at its initial (or previous) position. Keep it hidden until it has been positioned.\n\t * Uses opacity instead of visibility so menu items can still receive focus.\n\t */\n\tconst isAwaitingPosition = !disableTriggerPosition && !menuPositionStyles.isPositioned;\n\tconst hideUntilPositionedStyles = isAwaitingPosition ? { opacity: 0 } : undefined;\n\n\t/**\n\t * Submenu positioning and alignment\n\t *\n\t * This hook is only enabled if isSubMenu is TRUE\n\t */\n\tconst subMenuPosition = useSubMenuElementPosition(\n\t\ttriggerRef,\n\t\tmenuRef,\n\t\tisSubMenu,\n\t\tstate.isOpen,\n\t\tmenuRect,\n\t\t// disable the subelement positioning if it's not a submenu\n\t\t!isSubMenu\n\t);\n\n\tconst inlineStyles = {\n\t\tmenu: {\n\t\t\tleft: menuPositionStyles.left,\n\t\t\tposition: 'fixed' as const,\n\t\t\ttop: menuPositionStyles.top\n\t\t},\n\t\tsubmenu: {\n\t\t\tleft: subMenuPosition.left,\n\t\t\ttop: subMenuPosition.top\n\t\t}\n\t};\n\n\t/**\n\t * React Spring transitions for the menu\n\t */\n\tconst transitionConfig = {\n\t\tconfig: { duration: state.isOpen ? 300 : 150 },\n\t\tenter: { opacity: 1, transform: 'translateY(0)' },\n\t\tfrom: { opacity: 0, transform: 'translateY(4px)' },\n\t\tleave: { opacity: 0, transform: 'translateY(4px)' }\n\t};\n\n\tconst transitionStatic = {\n\t\tconfig: { duration: 0 },\n\t\tenter: { opacity: 1, transform: 'translateY(0)' }\n\t};\n\n\tconst transitions = useTransition(\n\t\tstate.isOpen,\n\t\tposition === 'static' ? transitionStatic : transitionConfig\n\t);\n\n\tconst menuClasses = classnames(styles['MrlMenu'], 'MrlMenu', {\n\t\t[styles['MrlMenu--submenu']]: isSubMenu,\n\t\t[styles.open]: state.isOpen,\n\t\t[styles['MrlMenu--compact']]: spacing === 'compact',\n\t\t[styles['MrlMenu--static']]: position === 'static',\n\t\t[styles['MrlMenu--internal']]: isInternal,\n\t\t[styles['MrlMenu--scrolling']]: menuScroll.isScrolling,\n\t\t[styles['MrlMenu--ignore']]: position === 'ignore'\n\t});\n\n\tconst positionStyles = isSubMenu\n\t\t? inlineStyles.submenu\n\t\t: position !== 'static'\n\t\t\t? inlineStyles.menu\n\t\t\t: {};\n\n\tconst menuScrollStyles =\n\t\t(menuScroll.maxHeight !== undefined && { maxHeight: menuScroll.maxHeight }) || undefined;\n\n\tconst renderMenu = () => {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{transitions(\n\t\t\t\t\t(style, item) =>\n\t\t\t\t\t\titem && (\n\t\t\t\t\t\t\t<animated.div\n\t\t\t\t\t\t\t\tclassName={menuClasses}\n\t\t\t\t\t\t\t\tid={id}\n\t\t\t\t\t\t\t\tstyle={{ ...positionStyles, ...style, ...hideUntilPositionedStyles }}\n\t\t\t\t\t\t\t\tonKeyUp={handleMenuKeyUp}\n\t\t\t\t\t\t\t\tonKeyDown={handleMenuKey}\n\t\t\t\t\t\t\t\tref={menuRef}\n\t\t\t\t\t\t\t\trole=\"none\"\n\t\t\t\t\t\t\t\t{...remainingProps}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ul ref={listRef} role=\"menu\" style={menuScrollStyles}>\n\t\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</animated.div>\n\t\t\t\t\t\t)\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t};\n\n\t// For managing and restoring focus to the original menu trigger\n\t// Ensures the triggerRef in context is always the parent triggerRef\n\tconst parentContext = React.useContext(MrlMenuContext);\n\tconst contextTriggerRef = isSubMenu ? parentContext?.triggerRef : triggerRef;\n\n\treturn (\n\t\t<MrlMenuContext.Provider\n\t\t\tvalue={{\n\t\t\t\tcloseMenu,\n\t\t\t\tcloseParent: !isSubMenu ? closeMenu : undefined,\n\t\t\t\ttriggerRef: contextTriggerRef\n\t\t\t}}\n\t\t>\n\t\t\t{isSubMenu || position === 'static' ? (\n\t\t\t\trenderMenu()\n\t\t\t) : (\n\t\t\t\t<MrlPortal layer={portalProps.layer || PORTAL_LAYERS.MENU} {...portalProps}>\n\t\t\t\t\t{renderMenu()}\n\t\t\t\t</MrlPortal>\n\t\t\t)}\n\t\t</MrlMenuContext.Provider>\n\t);\n\t/* eslint-enable */\n}\n\nMrlMenu.componentType = 'Menu';\n"],"names":["MENU_ITEM_SELECTOR","MrlMenu","_ref","_ref$actionState","actionState","actionType","isOpen","_ref$alignment","alignment","children","_ref$closeOnScroll","closeOnScroll","closeParent","customPosition","_ref$clickOutsideEven","clickOutsideEvent","disableArrowOpen","_ref$disableFlipping","disableFlipping","id","_ref$isInternal","isInternal","_ref$isSubMenu","isSubMenu","_ref$spacing","spacing","_ref$menuOffset","menuOffset","_ref$portalProps","portalProps","PORTAL_LAYERS","MENU","name","_ref$position","position","_ref$triggerStopPropa","triggerStopPropagation","onClose","eventId","triggerRef","remainingProps","_objectWithoutProperties","_excluded","defaultOpenState","_React$useState","React","useState","_React$useState2","_slicedToArray","state","setState","trackInteraction","useMrlTrackInteraction","wasOpenRef","useRef","useEffect","_state$actionType","current","action","metadata","trigger","variant","menuRef","listRef","_React$useState3","_React$useState4","menuItems","setMenuItems","_React$useState5","_React$useState6","menuRect","setMenuRect","isTriggerDisabled","useCallback","isElementAriaDisabled","toggleMenuTrigger","e","preventDefault","prevState","showMenuHover","showMenuTap","hideMenuHover","event","relatedTarget","contains","toggleMenuKey","openMenu","key","closeMenu","shouldCloseParent","arguments","length","undefined","disableClickOutside","useClickOutside","handleMenuKeyUp","actions","includes","handleMenuKey","_menuItems$nextIndex","_menuItems$nextIndex2","_triggerRef$current","currentIndex","findIndex","item","document","activeElement","nextIndex","focus","shiftKey","prevElement","findAdjacentInteractiveElement","nextElement","setAttribute","_triggerRef$current2","toString","triggerElement","menuElement","querySelectorAll","scrollableParent","addEventListener","isTouchDevice","getScrollableParent","capture","passive","removeEventListener","forEach","getAttribute","_menuRef$current","foundMenuItems","Array","from","_triggerRef$current3","classList","add","itemStyles","_triggerRef$current4","remove","_menuRef$current2","newRect","getBoundingClientRect","_menuItemToFocus","_menuItemToFocus2","menuItemToFocus","setTimeout","scrollTo","scrollHeight","_menuItemToFocus3","disableMenuScroll","menuScroll","useMenuScroll","disableTriggerPosition","menuPositionStyles","useTriggerPosition","align","isScrolling","isAwaitingPosition","isPositioned","hideUntilPositionedStyles","opacity","subMenuPosition","useSubMenuElementPosition","inlineStyles","menu","left","top","submenu","transitionConfig","config","duration","enter","transform","leave","transitionStatic","transitions","useTransition","menuClasses","classnames","styles","open","positionStyles","menuScrollStyles","maxHeight","renderMenu","createElement","Fragment","style","animated","div","_extends","className","_objectSpread","onKeyUp","onKeyDown","ref","role","parentContext","useContext","MrlMenuContext","contextTriggerRef","Provider","value","MrlPortal","layer","componentType"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqKA,IAAMA,kBAAkB,GAAG,sEAAsE;;AAEjG;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,OAAOA,CAAAC,IAAA,EAsBO;AAAA,EAAA,IAAAC,gBAAA,GAAAD,IAAA,CArB7BE,WAAW;IAAXA,WAAW,GAAAD,gBAAA,KAAA,MAAA,GAAG;AAAEE,MAAAA,UAAU,EAAE,IAAI;AAAEC,MAAAA,MAAM,EAAE;AAAM,KAAC,GAAAH,gBAAA;IAAAI,cAAA,GAAAL,IAAA,CACjDM,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,QAAQ,GAAAA,cAAA;IACpBE,QAAQ,GAAAP,IAAA,CAARO,QAAQ;IAAAC,kBAAA,GAAAR,IAAA,CACRS,aAAa;AAAbA,IAAAA,aAAa,GAAAD,kBAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,kBAAA;IACrBE,WAAW,GAAAV,IAAA,CAAXU,WAAW;IACXC,cAAc,GAAAX,IAAA,CAAdW,cAAc;IAAAC,qBAAA,GAAAZ,IAAA,CACda,iBAAiB;AAAjBA,IAAAA,iBAAiB,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Aa,KAAA,IAAA,IAAbA,aAAa,KAAA,MAAA,GAAA,MAAA,GAAbA,aAAa,CAAE7J,UAAU,GAAGA,UAAU;AAE5E,EAAA,oBACCM,KAAA,CAAA2I,aAAA,CAACc,cAAc,CAACE,QAAQ,EAAA;AACvBC,IAAAA,KAAK,EAAE;MACNjH,SAAS;AACT5E,MAAAA,WAAW,EAAE,CAACW,SAAS,GAAGiE,SAAS,GAAGI,SAAS;AAC/CrD,MAAAA,UAAU,EAAEgK;AACb;AAAE,GAAA,EAEDhL,SAAS,IAAIW,QAAQ,KAAK,QAAQ,GAClCqJ,UAAU,EAAE,gBAEZ1I,KAAA,CAAA2I,aAAA,CAACkB,SAAS,EAAAb,QAAA,CAAA;AAACc,IAAAA,KAAK,EAAE9K,WAAW,CAAC8K,KAAK,IAAI7K,aAAa,CAACC;AAAK,GAAA,EAAKF,WAAW,CAAA,EACxE0J,UAAU,EACD,CAEY,CAAC;AAE3B;AACD;AAEAtL,OAAO,CAAC2M,aAAa,GAAG,MAAM;;;;"}
@@ -318,8 +318,7 @@ function MrlPopover(_ref) {
318
318
  // Only while open: isPositioned resets on close, which would cut the leave transition short
319
319
  var isAwaitingPosition = !isSubMenu && state.isOpen && !menuPosition.isPositioned;
320
320
  var hideUntilPositionedStyles = isAwaitingPosition ? {
321
- opacity: 0,
322
- pointerEvents: 'none'
321
+ opacity: 0
323
322
  } : undefined;
324
323
  var subMenuPosition = useSubMenuElementPosition(triggerRef, menuRef, isSubMenu, state.isOpen, menuRect, !isSubMenu);
325
324
  var menuPositionState = menuPosition.flipped ? flipPosition(position) : position;
@@ -1 +1 @@
1
- {"version":3,"file":"MrlPopover.js","sources":["../../../../../src/components/popover/MrlPopover/MrlPopover.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { close } from '@muraldevkit/ds-icons';\nimport { MrlIconButton } from '../../button/MrlIconButton/MrlIconButton';\nimport { MrlFocusTrap } from '../../focus-trap/MrlFocusTrap/MrlFocusTrap';\nimport { MrlPortal, PortalProps } from '../../portal/MrlPortal';\nimport { MrlSvg } from '../../svg/MrlSvg/MrlSvg';\nimport { useTriggerPosition } from '../../../hooks/useTriggerPosition';\nimport { useBrowserEdgeScroll } from '../../menu/hooks/useBrowserEdgeScroll';\nimport { useClickOutside } from '../../../hooks/useClickOutside';\nimport { useSubMenuElementPosition } from '../../menu/hooks/useSubMenuElementPosition';\nimport { MenuPosition, MenuAlignment, ActionState, CustomMenuPosition } from '../../menu/constants';\nimport {\n\tpreventDefault,\n\tgetFocusableElementsInsideElement,\n\tfindAdjacentInteractiveElement,\n\tisElementAriaDisabled\n} from '../../../utils';\nimport { PORTAL_LAYERS } from '../../../utils/layers';\nimport { useTransition, animated } from '@react-spring/web';\nimport { SELECT_MENU_LIST_CLASS_NAME } from '../../form/select/MrlSelect/MrlSelect';\nimport { MULTI_SELECT_MENU_LIST_CLASS_NAME } from '../../form/select/MrlMultiSelect/MrlMultiSelect';\nimport styles from './MrlPopover.module.scss';\nimport { flipPosition } from '../../menu/utilities/flip-position';\nimport { getDataPoint } from './utilities/get-data-point';\nimport { getOffset } from './utilities/get-offset';\nimport { useMrlPopoverEventHandlers } from './hooks/use-mrl-popover-event-handlers';\nimport { MrlPopoverContext } from './context/MrlPopoverContext';\nimport { MrlPopoverScrollContainer } from './MrlPopoverScrollContainer';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\nconst POPOVER_CLICKOUTSIDE_WHITELIST = [\n\t'#mrl-select-portal',\n\t'#mrl-popover-menu-portal',\n\t`.${SELECT_MENU_LIST_CLASS_NAME}`,\n\t`.${MULTI_SELECT_MENU_LIST_CLASS_NAME}`\n];\n\ntype RenderPropFn = ({ closeMenu }: { closeMenu: () => void }) => JSX.Element;\n\nexport interface MrlPopoverProps {\n\t/**\n\t * Set initial state of menu\n\t * @default { actionType: null, isOpen: false }\n\t */\n\tactionState?: ActionState;\n\n\t/** Label for the popover */\n\tariaLabel?: string;\n\n\t/** ID of element to associate a label */\n\tariaLabelledBy?: string;\n\n\t/** Children to be rendered within the menu component*/\n\tchildren: React.ReactNode | RenderPropFn;\n\n\t/** Custom class names for the popover */\n\tclassName?: string;\n\n\t/** Custom position for the menu */\n\tcustomPosition?: CustomMenuPosition;\n\n\t/**\n\t * If the popover should disable click to open\n\t *\n\t * Example usage: if you do not want your component opened via click, set to true\n\t */\n\tdisableClickToOpen?: boolean;\n\n\t/**\n\t * If the popover should close when clicking outside of the menu\n\t *\n\t * Example usage: MrlCallout component should not close when clicking outside, so it's set to true\n\t */\n\tdisableClickOutside?: boolean;\n\n\t/**\n\t * Disable flipping of the popover when it goes off the screen\n\t * @default false\n\t */\n\tdisableFlipping?: boolean;\n\n\t/**\n\t * If the popover should disable focus trap\n\t *\n\t * The impact of enabling or disabling focus trap:\n\t * - enabled : focus will remain trapped in the popover until a user closes the popover\n\t * - disabled : focus will move to the next interactive element in the DOM when the user\n\t * tabs out of the popover. Focus will move to the trigger when the user shift+tabs out of the popover\n\t *\n\t * Additional scenarios to consider with focus trap is disabled. When hasCloseButton is set to true/false:\n\t * - true : if a user shows the close button, the popover will stay open until explicitly dismissed\n\t * - false : if a user hides the close button, the popover will close when a user tabs out of it from the beginning or end\n\t */\n\tdisableFocusTrap?: boolean;\n\n\t/** If the popover should have a close button */\n\thasCloseButton?: boolean;\n\n\t/** Unique identifier for the menu */\n\tid?: string;\n\n\t/** If the menu is a submenu */\n\tisSubMenu?: boolean;\n\n\t/**\n\t * Horizontal and vertical alignment of the menu relative to the trigger element\n\t *\n\t * This does not impact submenus\n\t * @default 'bottom'\n\t */\n\tposition?: MenuPosition;\n\n\t/**\n\t * Alignment of the popover along the axis perpendicular to its position\n\t * - For position 'top'/'bottom': 'start' = left, 'end' = right, 'center' = center horizontally\n\t * - For position 'left'/'right': 'start' = top, 'end' = bottom, 'center' = center vertically\n\t *\n\t * @default 'center'\n\t *\n\t * This does not impact submenus\n\t */\n\talignment?: MenuAlignment;\n\n\t/**\n\t * spacing of menu\n\t * - 'default' has 16px padding\n\t * - 'compact' has 12px padding\n\t */\n\tspacing?: 'default' | 'compact';\n\n\t/**\n\t * Reference to the DOM element that triggers this menu.\n\t */\n\ttriggerRef?: React.RefObject<HTMLElement>;\n\n\t/**\n\t * If the menu should be rendered with the inverse theme\n\t * @default 'primary'\n\t */\n\tkind?: 'primary' | 'inverse';\n\n\t/**\n\t * If the menu should have a pointer element\n\t * @default false\n\t */\n\tpoint?: boolean;\n\n\t/**\n\t * Configuration for the portal component\n\t */\n\tportalProps?: Omit<PortalProps, 'children'>;\n\n\t/**\n\t * Offset in pixels for the popover\n\t *\n\t * The popover automatically calculates the proper offset based on the position and alignment\n\t * this prop will override those values.\n\t */\n\toffset?: number;\n\n\t/**\n\t * Callback to be called when the menu is opened\n\t */\n\tonOpen?: () => void;\n\n\t/**\n\t * Callback to be called when the menu is closed\n\t * @param type - type of close event\n\t */\n\tonClose?: (type?: string) => void;\n\n\t/**\n\t * data-qa attribute for the popover\n\t */\n\t['data-qa']?: string;\n\n\t/**\n\t * Enables interaction tracking for this popover. Provide a stable, non-PII id\n\t * (e.g. 'sticky-note-color-picker'). When omitted, the popover emits no analytics.\n\t */\n\teventId?: string;\n}\n\n/**\n * MrlPopover\n *\n * Renders a popover component with position and alignment relative to a trigger element\n * @param {MrlPopoverProps} props - The props for the MrlPopover component\n * @returns {Element} - rendered MrlPopover component\n */\nexport function MrlPopover({\n\talignment = 'center',\n\tariaLabel,\n\tariaLabelledBy,\n\tchildren,\n\tclassName,\n\tcustomPosition,\n\tdisableClickToOpen = false,\n\tdisableClickOutside = false,\n\tdisableFlipping = false,\n\tdisableFocusTrap = false,\n\thasCloseButton = false,\n\tspacing = 'default',\n\tid,\n\tisSubMenu = false,\n\tactionState = { actionType: null, isOpen: false },\n\tposition = 'bottom',\n\tpoint = true,\n\tportalProps = { id: PORTAL_LAYERS.POPOVER.name },\n\tkind = 'primary',\n\toffset,\n\tonClose,\n\tonOpen,\n\teventId,\n\ttriggerRef,\n\t...rest\n}: MrlPopoverProps): JSX.Element {\n\tconst [state, setState] = React.useState({\n\t\tactionType: null,\n\t\tisOpen: actionState.isOpen || false\n\t} as ActionState);\n\n\tconst trackInteraction = useMrlTrackInteraction('MrlPopover', eventId);\n\t// the popover opens and closes from several paths (trigger click, keyboard, click\n\t// outside, close button), so open/close is emitted from the resulting state.\n\tconst wasOpenRef = React.useRef(actionState.isOpen || false);\n\n\tReact.useEffect(() => {\n\t\tif (wasOpenRef.current === state.isOpen) return;\n\n\t\twasOpenRef.current = state.isOpen;\n\n\t\ttrackInteraction({\n\t\t\taction: state.isOpen ? 'open' : 'close',\n\t\t\tmetadata: { isSubMenu },\n\t\t\tvariant: position\n\t\t});\n\t}, [state.isOpen, isSubMenu, position, trackInteraction]);\n\n\t// stores all of the interactive elements in the popover for focus management\n\tconst [interactiveElements, setInteractiveElements] = React.useState<HTMLElement[]>([]);\n\tconst [menuRect, setMenuRect] = React.useState<DOMRect | null>(null);\n\tconst menuRef = React.useRef<HTMLDivElement>(null);\n\t/** Snapshot of trigger `aria-expanded` before we manage it; restored on popover unmount only. */\n\tconst triggerExpandedRestoreRef = React.useRef<{\n\t\tel: HTMLElement;\n\t\tvalue: string | null;\n\t} | null>(null);\n\n\t/**\n\t * Checks if the trigger element is disabled\n\t * @returns {boolean} - true if the trigger element is disabled, false otherwise\n\t */\n\tconst isTriggerDisabled = React.useCallback((): boolean => {\n\t\treturn isElementAriaDisabled(triggerRef?.current);\n\t}, [triggerRef]);\n\n\t/**\n\t * Opening and closing the menu\n\t */\n\tconst closeMenu = React.useCallback(() => {\n\t\tsetState({ actionType: null, isOpen: false });\n\t\tonClose?.();\n\t}, [onClose]);\n\n\tconst {\n\t\thandleClose,\n\t\thandleMenuKey,\n\t\thideMenuHover,\n\t\thandleTriggerSiblingKey,\n\t\ttoggleMenuKey,\n\t\ttoggleMenuTrigger,\n\t\tshowMenuHover\n\t} = useMrlPopoverEventHandlers({\n\t\tcloseMenu,\n\t\tdisableClickToOpen,\n\t\tdisableFocusTrap,\n\t\thasCloseButton,\n\t\tinteractiveElements,\n\t\tisSubMenu,\n\t\tisTriggerDisabled,\n\t\tmenuRef,\n\t\tsetState,\n\t\tstate,\n\t\ttriggerRef\n\t});\n\n\tuseClickOutside(\n\t\tmenuRef,\n\t\ttriggerRef,\n\t\t'mouseup',\n\t\tcloseMenu,\n\t\tdisableClickOutside || !state.isOpen,\n\t\tPOPOVER_CLICKOUTSIDE_WHITELIST\n\t);\n\n\tReact.useEffect(() => {\n\t\tif (isTriggerDisabled()) return;\n\n\t\tif (!isSubMenu) {\n\t\t\tsetState({ actionType: actionState.actionType, isOpen: actionState.isOpen });\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [isSubMenu, actionState.actionType, actionState.isOpen]);\n\n\t// This use effect handles storing the rect in state for positioning calculations\n\tReact.useLayoutEffect(() => {\n\t\tif (!state.isOpen) return;\n\n\t\t// For consistent calculations, we are storing the menu rect in state\n\t\t// Anytime we need to use the menu rect, we want to make sure the values are based\n\t\t// on the original state of the menu for proper transformations\n\t\tif (!menuRect && menuRef.current) {\n\t\t\tconst newRect = menuRef.current?.getBoundingClientRect();\n\t\t\tsetMenuRect(newRect || null);\n\t\t}\n\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen, isSubMenu]);\n\n\t// This use effect handles getting and setting the interactive elements in the popover.\n\t// These elements are used for focus management when focus trap is not enabled to ensure\n\t// that our tab order matches the visual order of the page\n\tReact.useEffect(() => {\n\t\tif (state.isOpen && !isSubMenu && menuRef.current) {\n\t\t\tif (disableFocusTrap) {\n\t\t\t\t// set the interactive elements so we can track focus location\n\t\t\t\tconst elements = getFocusableElementsInsideElement(menuRef.current as HTMLElement);\n\t\t\t\tsetInteractiveElements(elements);\n\n\t\t\t\t// without focus trap enabled, we want to focus the first interactive element\n\t\t\t\telements[0].focus();\n\t\t\t}\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen, menuRef.current]);\n\n\t// This use effect handles setting all of the event handlers for different parts of the component.\n\t// - trigger event handlers\n\t// - submenu event handlers\n\t// - menu event handlers\n\t// - \"next element\" event handlers, which are event handlers attached to the next interactive element after the trigger\n\t//\n\tReact.useEffect(() => {\n\t\tconst triggerElement = triggerRef?.current;\n\t\tconst menuElement = menuRef?.current;\n\t\tconst nextElement = findAdjacentInteractiveElement(triggerRef, 'next');\n\n\t\tif (triggerElement) {\n\t\t\ttriggerElement.addEventListener('mousedown', (e) => e.stopPropagation());\n\t\t\ttriggerElement.addEventListener('click', toggleMenuTrigger);\n\t\t\ttriggerElement.addEventListener('keydown', toggleMenuKey);\n\n\t\t\tif (nextElement) nextElement.addEventListener('keydown', handleTriggerSiblingKey);\n\n\t\t\t// Setup event listeners for when the menu is a submenu\n\t\t\tif (isSubMenu) {\n\t\t\t\tconst menuElement = menuRef?.current;\n\n\t\t\t\ttriggerElement.addEventListener('mouseover', showMenuHover);\n\t\t\t\ttriggerElement.addEventListener('mouseout', hideMenuHover);\n\n\t\t\t\tif (menuElement) {\n\t\t\t\t\tmenuElement.addEventListener('mouseover', showMenuHover);\n\t\t\t\t\tmenuElement.addEventListener('mouseout', hideMenuHover);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\ttriggerElement.removeEventListener('mousedown', preventDefault);\n\t\t\t\ttriggerElement.removeEventListener('click', toggleMenuTrigger);\n\t\t\t\ttriggerElement.removeEventListener('keydown', toggleMenuKey);\n\n\t\t\t\tif (nextElement) nextElement.removeEventListener('keydown', handleTriggerSiblingKey);\n\n\t\t\t\tif (isSubMenu) {\n\t\t\t\t\ttriggerElement.removeEventListener('mouseover', showMenuHover);\n\t\t\t\t\ttriggerElement.removeEventListener('mouseout', hideMenuHover);\n\n\t\t\t\t\tif (menuElement) {\n\t\t\t\t\t\tmenuElement.removeEventListener('mouseover', showMenuHover);\n\t\t\t\t\t\tmenuElement.removeEventListener('mouseout', hideMenuHover);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [\n\t\tcloseMenu,\n\t\tisSubMenu,\n\t\ttoggleMenuKey,\n\t\ttoggleMenuTrigger,\n\t\ttriggerRef?.current,\n\t\thideMenuHover,\n\t\tshowMenuHover,\n\t\thasCloseButton,\n\t\thandleClose\n\t]);\n\n\t/**\n\t * Popover triggers are not necessarily modal dialogs; use the generic 'true' (see ARIA in HTML).\n\t * Restore the previous DOM value when the trigger changes or this popover unmounts so host-owned\n\t * ARIA (e.g. aria-haspopup=\"menu\") is not left stale after a callout dismisses.\n\t */\n\tReact.useEffect(() => {\n\t\tconst el = triggerRef?.current;\n\t\tif (!el) return;\n\n\t\tconst previousValue = el.getAttribute('aria-haspopup');\n\t\tel.setAttribute('aria-haspopup', 'true');\n\n\t\t// Restore the previous value of the aria-haspopup attribute when the callout is removed from the DOM\n\t\treturn () => {\n\t\t\tif (previousValue === null) {\n\t\t\t\tel.removeAttribute('aria-haspopup');\n\t\t\t} else {\n\t\t\t\tel.setAttribute('aria-haspopup', previousValue);\n\t\t\t}\n\t\t};\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [triggerRef?.current]);\n\n\tReact.useEffect(() => {\n\t\tconst el = triggerRef?.current;\n\t\tif (!el) return;\n\n\t\t// Store the previous value of the aria-expanded attribute when the callout is added to the DOM\n\t\tif (!triggerExpandedRestoreRef.current || triggerExpandedRestoreRef.current.el !== el) {\n\t\t\ttriggerExpandedRestoreRef.current = {\n\t\t\t\tel,\n\t\t\t\tvalue: el.hasAttribute('aria-expanded') ? el.getAttribute('aria-expanded') : null\n\t\t\t};\n\t\t}\n\n\t\t// Set the aria-expanded attribute to the current state of the popover\n\t\tel.setAttribute('aria-expanded', state.isOpen.toString());\n\n\t\tif (state.isOpen) onOpen?.();\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen, onOpen, triggerRef?.current]);\n\n\t/**\n\t * Restore the previous value of the aria-expanded attribute when the callout is removed from the DOM\n\t */\n\tReact.useEffect(() => {\n\t\treturn () => {\n\t\t\tconst snap = triggerExpandedRestoreRef.current;\n\t\t\tif (!snap) return;\n\t\t\tconst { el, value } = snap;\n\n\t\t\tif (!document?.documentElement?.contains(el)) return;\n\n\t\t\tif (value === null) {\n\t\t\t\tel.removeAttribute('aria-expanded');\n\t\t\t} else {\n\t\t\t\tel.setAttribute('aria-expanded', value);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\t/**\n\t * Setup positioning styles, submenu positioning styles, scroll styles, and transition.\n\t */\n\tconst memoizedCustomPosition = React.useMemo(() => customPosition, [customPosition]);\n\tconst customPopoverPosition = memoizedCustomPosition || { left: 0, top: 0 };\n\n\tconst menuPosition = useTriggerPosition(\n\t\ttriggerRef,\n\t\tmenuRef,\n\t\t{\n\t\t\talign: alignment,\n\t\t\tcustomPosition: customPopoverPosition,\n\t\t\tposition: position\n\t\t},\n\t\tstate.isOpen,\n\t\toffset || getOffset(position, point),\n\t\tisSubMenu,\n\t\tdisableFlipping\n\t);\n\n\t// Only while open: isPositioned resets on close, which would cut the leave transition short\n\tconst isAwaitingPosition = !isSubMenu && state.isOpen && !menuPosition.isPositioned;\n\tconst hideUntilPositionedStyles = isAwaitingPosition\n\t\t? { opacity: 0, pointerEvents: 'none' as const }\n\t\t: undefined;\n\n\tconst subMenuPosition = useSubMenuElementPosition(\n\t\ttriggerRef,\n\t\tmenuRef,\n\t\tisSubMenu,\n\t\tstate.isOpen,\n\t\tmenuRect,\n\t\t!isSubMenu\n\t);\n\n\tconst menuPositionState = menuPosition.flipped ? flipPosition(position) : position;\n\tconst scrollStyles = useBrowserEdgeScroll(menuRef, menuPositionState, alignment);\n\n\tconst inlineStyles = {\n\t\tmenu: {\n\t\t\tleft: menuPosition.left,\n\t\t\tposition: 'fixed' as const,\n\t\t\ttop: menuPosition.top\n\t\t},\n\t\tsubmenu: {\n\t\t\tleft: subMenuPosition.left,\n\t\t\ttop: subMenuPosition.top\n\t\t}\n\t};\n\n\t/**\n\t * React Spring transitions for the menu\n\t */\n\tconst transitions = useTransition(state.isOpen, {\n\t\tconfig: { duration: 150 },\n\t\tenter: { opacity: 1, transform: 'translateY(0)' },\n\t\tfrom: { opacity: 0, transform: 'translateY(4px)' },\n\t\tleave: { opacity: 0, transform: 'translateY(4px)' }\n\t});\n\n\tconst menuClasses = classnames(\n\t\tstyles['MrlPopover'],\n\t\t'MrlPopover',\n\t\tstyles['MrlPopover--scrolling'],\n\t\tclassName,\n\t\t{\n\t\t\t[styles['MrlPopover--submenu']]: isSubMenu,\n\t\t\t[styles['inverse']]: kind === 'inverse',\n\t\t\t[styles['primary']]: kind === 'primary',\n\t\t\t[styles['compact']]: spacing === 'compact',\n\t\t\t[styles['default']]: spacing === 'default'\n\t\t}\n\t);\n\n\tconst positionStyles = isSubMenu ? inlineStyles.submenu : inlineStyles.menu;\n\n\tconst renderMenu = () => {\n\t\tconst inlineScrollStyles = isSubMenu ? {} : scrollStyles ? scrollStyles.styles : {};\n\t\tconst scrollClasses = classnames(\n\t\t\tstyles['MrlPopover--content'],\n\t\t\tstyles['MrlPopover--scrolling--content']\n\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{transitions(\n\t\t\t\t\t(style, item) =>\n\t\t\t\t\t\titem && (\n\t\t\t\t\t\t\t<MrlFocusTrap disabled={disableFocusTrap} containerRef={menuRef}>\n\t\t\t\t\t\t\t\t<animated.div\n\t\t\t\t\t\t\t\t\taria-label={ariaLabel}\n\t\t\t\t\t\t\t\t\taria-labelledby={ariaLabelledBy}\n\t\t\t\t\t\t\t\t\tclassName={menuClasses}\n\t\t\t\t\t\t\t\t\tid={id}\n\t\t\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\t\t\tstyle={{ ...positionStyles, ...style, ...hideUntilPositionedStyles }}\n\t\t\t\t\t\t\t\t\tonKeyDown={handleMenuKey}\n\t\t\t\t\t\t\t\t\tref={menuRef}\n\t\t\t\t\t\t\t\t\t{...rest}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<MrlPopoverScrollContainer className={scrollClasses} style={inlineScrollStyles}>\n\t\t\t\t\t\t\t\t\t\t{typeof children === 'function' && children({ closeMenu })}\n\t\t\t\t\t\t\t\t\t\t{typeof children !== 'function' && children}\n\t\t\t\t\t\t\t\t\t\t{hasCloseButton && (\n\t\t\t\t\t\t\t\t\t\t\t<MrlIconButton\n\t\t\t\t\t\t\t\t\t\t\t\tdata-qa=\"popover-close-button\"\n\t\t\t\t\t\t\t\t\t\t\t\twrapperClassName={styles['MrlPopover--close']}\n\t\t\t\t\t\t\t\t\t\t\t\ticon={<MrlSvg svg={close} />}\n\t\t\t\t\t\t\t\t\t\t\t\tkind={kind === 'inverse' ? 'ghost-inverse' : 'ghost'}\n\t\t\t\t\t\t\t\t\t\t\t\ttext=\"Close\"\n\t\t\t\t\t\t\t\t\t\t\t\tstate=\"default\"\n\t\t\t\t\t\t\t\t\t\t\t\tposition=\"right\"\n\t\t\t\t\t\t\t\t\t\t\t\ttipAnchor=\"center\"\n\t\t\t\t\t\t\t\t\t\t\t\tonMouseUp={closeMenu}\n\t\t\t\t\t\t\t\t\t\t\t\tonKeyDown={handleClose}\n\t\t\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t{point && (\n\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\tclassName={styles['MrlPopover--point']}\n\t\t\t\t\t\t\t\t\t\t\t\tdata-point={getDataPoint(menuPositionState, alignment)}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</MrlPopoverScrollContainer>\n\t\t\t\t\t\t\t\t</animated.div>\n\t\t\t\t\t\t\t</MrlFocusTrap>\n\t\t\t\t\t\t)\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t};\n\n\t/* eslint-disable */\n\treturn (\n\t\t<MrlPopoverContext.Provider\n\t\t\tvalue={{\n\t\t\t\tcloseMenu\n\t\t\t}}\n\t\t>\n\t\t\t{isSubMenu ? (\n\t\t\t\trenderMenu()\n\t\t\t) : (\n\t\t\t\t<MrlPortal layer={portalProps.layer || PORTAL_LAYERS.POPOVER} {...portalProps}>\n\t\t\t\t\t{renderMenu()}\n\t\t\t\t</MrlPortal>\n\t\t\t)}\n\t\t</MrlPopoverContext.Provider>\n\t);\n\t/* eslint-enable */\n}\n\nMrlPopover.componentType = 'Popover';\n"],"names":["POPOVER_CLICKOUTSIDE_WHITELIST","concat","SELECT_MENU_LIST_CLASS_NAME","MULTI_SELECT_MENU_LIST_CLASS_NAME","MrlPopover","_ref","_ref$alignment","alignment","ariaLabel","ariaLabelledBy","children","className","customPosition","_ref$disableClickToOp","disableClickToOpen","_ref$disableClickOuts","disableClickOutside","_ref$disableFlipping","disableFlipping","_ref$disableFocusTrap","disableFocusTrap","_ref$hasCloseButton","hasCloseButton","_ref$spacing","spacing","id","_ref$isSubMenu","isSubMenu","_ref$actionState","actionState","actionType","isOpen","_ref$position","position","_ref$point","point","_ref$portalProps","portalProps","PORTAL_LAYERS","POPOVER","name","_ref$kind","kind","offset","onClose","onOpen","eventId","triggerRef","rest","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","state","setState","trackInteraction","useMrlTrackInteraction","wasOpenRef","useRef","useEffect","current","action","metadata","variant","_React$useState3","_React$useState4","interactiveElements","setInteractiveElements","_React$useState5","_React$useState6","menuRect","setMenuRect","menuRef","triggerExpandedRestoreRef","isTriggerDisabled","useCallback","isElementAriaDisabled","closeMenu","_useMrlPopoverEventHa","useMrlPopoverEventHandlers","handleClose","handleMenuKey","hideMenuHover","handleTriggerSiblingKey","toggleMenuKey","toggleMenuTrigger","showMenuHover","useClickOutside","useLayoutEffect","_menuRef$current","newRect","getBoundingClientRect","elements","getFocusableElementsInsideElement","focus","triggerElement","menuElement","nextElement","findAdjacentInteractiveElement","addEventListener","e","stopPropagation","removeEventListener","preventDefault","el","previousValue","getAttribute","setAttribute","removeAttribute","value","hasAttribute","toString","_document","_document$documentEle","snap","document","documentElement","contains","memoizedCustomPosition","useMemo","customPopoverPosition","left","top","menuPosition","useTriggerPosition","align","getOffset","isAwaitingPosition","isPositioned","hideUntilPositionedStyles","opacity","pointerEvents","undefined","subMenuPosition","useSubMenuElementPosition","menuPositionState","flipped","flipPosition","scrollStyles","useBrowserEdgeScroll","inlineStyles","menu","submenu","transitions","useTransition","config","duration","enter","transform","from","leave","menuClasses","classnames","styles","positionStyles","renderMenu","inlineScrollStyles","scrollClasses","createElement","Fragment","style","item","MrlFocusTrap","disabled","containerRef","animated","div","_extends","tabIndex","_objectSpread","onKeyDown","ref","MrlPopoverScrollContainer","MrlIconButton","wrapperClassName","icon","MrlSvg","svg","close","text","tipAnchor","onMouseUp","size","getDataPoint","MrlPopoverContext","Provider","MrlPortal","layer","componentType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAMA,8BAA8B,GAAG,CACtC,oBAAoB,EACpB,0BAA0B,EAAA,GAAA,CAAAC,MAAA,CACtBC,2BAA2B,CAAA,EAAA,GAAA,CAAAD,MAAA,CAC3BE,iCAAiC,CAAA,CACrC;AAoJD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAAAC,IAAA,EA0BO;AAAA,EAAA,IAAAC,cAAA,GAAAD,IAAA,CAzBhCE,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,QAAQ,GAAAA,cAAA;IACpBE,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,cAAc,GAAAJ,IAAA,CAAdI,cAAc;IACdC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IACRC,SAAS,GAAAN,IAAA,CAATM,S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,EAAY8B,YAAY,CAAChD,iBAAiB,EAAEnI,SAAS;AAAE,KACvD,CAEwB,CACd,CACD,CAEjB,CACC,CAAC;EAEL,CAAC;;AAED;AACA,EAAA,oBACC6C,KAAA,CAAA6G,aAAA,CAAC0B,iBAAiB,CAACC,QAAQ,EAAA;AAC1B5E,IAAAA,KAAK,EAAE;AACNhC,MAAAA;AACD;AAAE,GAAA,EAEDrD,SAAS,GACTmI,UAAU,EAAE,gBAEZ1G,KAAA,CAAA6G,aAAA,CAAC4B,SAAS,EAAAnB,QAAA,CAAA;AAACoB,IAAAA,KAAK,EAAEzJ,WAAW,CAACyJ,KAAK,IAAIxJ,aAAa,CAACC;AAAQ,GAAA,EAAKF,WAAW,CAAA,EAC3EyH,UAAU,EACD,CAEe,CAAC;AAE9B;AACD;AAEA1J,UAAU,CAAC2L,aAAa,GAAG,SAAS;;;;"}
1
+ {"version":3,"file":"MrlPopover.js","sources":["../../../../../src/components/popover/MrlPopover/MrlPopover.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { close } from '@muraldevkit/ds-icons';\nimport { MrlIconButton } from '../../button/MrlIconButton/MrlIconButton';\nimport { MrlFocusTrap } from '../../focus-trap/MrlFocusTrap/MrlFocusTrap';\nimport { MrlPortal, PortalProps } from '../../portal/MrlPortal';\nimport { MrlSvg } from '../../svg/MrlSvg/MrlSvg';\nimport { useTriggerPosition } from '../../../hooks/useTriggerPosition';\nimport { useBrowserEdgeScroll } from '../../menu/hooks/useBrowserEdgeScroll';\nimport { useClickOutside } from '../../../hooks/useClickOutside';\nimport { useSubMenuElementPosition } from '../../menu/hooks/useSubMenuElementPosition';\nimport { MenuPosition, MenuAlignment, ActionState, CustomMenuPosition } from '../../menu/constants';\nimport {\n\tpreventDefault,\n\tgetFocusableElementsInsideElement,\n\tfindAdjacentInteractiveElement,\n\tisElementAriaDisabled\n} from '../../../utils';\nimport { PORTAL_LAYERS } from '../../../utils/layers';\nimport { useTransition, animated } from '@react-spring/web';\nimport { SELECT_MENU_LIST_CLASS_NAME } from '../../form/select/MrlSelect/MrlSelect';\nimport { MULTI_SELECT_MENU_LIST_CLASS_NAME } from '../../form/select/MrlMultiSelect/MrlMultiSelect';\nimport styles from './MrlPopover.module.scss';\nimport { flipPosition } from '../../menu/utilities/flip-position';\nimport { getDataPoint } from './utilities/get-data-point';\nimport { getOffset } from './utilities/get-offset';\nimport { useMrlPopoverEventHandlers } from './hooks/use-mrl-popover-event-handlers';\nimport { MrlPopoverContext } from './context/MrlPopoverContext';\nimport { MrlPopoverScrollContainer } from './MrlPopoverScrollContainer';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\nconst POPOVER_CLICKOUTSIDE_WHITELIST = [\n\t'#mrl-select-portal',\n\t'#mrl-popover-menu-portal',\n\t`.${SELECT_MENU_LIST_CLASS_NAME}`,\n\t`.${MULTI_SELECT_MENU_LIST_CLASS_NAME}`\n];\n\ntype RenderPropFn = ({ closeMenu }: { closeMenu: () => void }) => JSX.Element;\n\nexport interface MrlPopoverProps {\n\t/**\n\t * Set initial state of menu\n\t * @default { actionType: null, isOpen: false }\n\t */\n\tactionState?: ActionState;\n\n\t/** Label for the popover */\n\tariaLabel?: string;\n\n\t/** ID of element to associate a label */\n\tariaLabelledBy?: string;\n\n\t/** Children to be rendered within the menu component*/\n\tchildren: React.ReactNode | RenderPropFn;\n\n\t/** Custom class names for the popover */\n\tclassName?: string;\n\n\t/** Custom position for the menu */\n\tcustomPosition?: CustomMenuPosition;\n\n\t/**\n\t * If the popover should disable click to open\n\t *\n\t * Example usage: if you do not want your component opened via click, set to true\n\t */\n\tdisableClickToOpen?: boolean;\n\n\t/**\n\t * If the popover should close when clicking outside of the menu\n\t *\n\t * Example usage: MrlCallout component should not close when clicking outside, so it's set to true\n\t */\n\tdisableClickOutside?: boolean;\n\n\t/**\n\t * Disable flipping of the popover when it goes off the screen\n\t * @default false\n\t */\n\tdisableFlipping?: boolean;\n\n\t/**\n\t * If the popover should disable focus trap\n\t *\n\t * The impact of enabling or disabling focus trap:\n\t * - enabled : focus will remain trapped in the popover until a user closes the popover\n\t * - disabled : focus will move to the next interactive element in the DOM when the user\n\t * tabs out of the popover. Focus will move to the trigger when the user shift+tabs out of the popover\n\t *\n\t * Additional scenarios to consider with focus trap is disabled. When hasCloseButton is set to true/false:\n\t * - true : if a user shows the close button, the popover will stay open until explicitly dismissed\n\t * - false : if a user hides the close button, the popover will close when a user tabs out of it from the beginning or end\n\t */\n\tdisableFocusTrap?: boolean;\n\n\t/** If the popover should have a close button */\n\thasCloseButton?: boolean;\n\n\t/** Unique identifier for the menu */\n\tid?: string;\n\n\t/** If the menu is a submenu */\n\tisSubMenu?: boolean;\n\n\t/**\n\t * Horizontal and vertical alignment of the menu relative to the trigger element\n\t *\n\t * This does not impact submenus\n\t * @default 'bottom'\n\t */\n\tposition?: MenuPosition;\n\n\t/**\n\t * Alignment of the popover along the axis perpendicular to its position\n\t * - For position 'top'/'bottom': 'start' = left, 'end' = right, 'center' = center horizontally\n\t * - For position 'left'/'right': 'start' = top, 'end' = bottom, 'center' = center vertically\n\t *\n\t * @default 'center'\n\t *\n\t * This does not impact submenus\n\t */\n\talignment?: MenuAlignment;\n\n\t/**\n\t * spacing of menu\n\t * - 'default' has 16px padding\n\t * - 'compact' has 12px padding\n\t */\n\tspacing?: 'default' | 'compact';\n\n\t/**\n\t * Reference to the DOM element that triggers this menu.\n\t */\n\ttriggerRef?: React.RefObject<HTMLElement>;\n\n\t/**\n\t * If the menu should be rendered with the inverse theme\n\t * @default 'primary'\n\t */\n\tkind?: 'primary' | 'inverse';\n\n\t/**\n\t * If the menu should have a pointer element\n\t * @default false\n\t */\n\tpoint?: boolean;\n\n\t/**\n\t * Configuration for the portal component\n\t */\n\tportalProps?: Omit<PortalProps, 'children'>;\n\n\t/**\n\t * Offset in pixels for the popover\n\t *\n\t * The popover automatically calculates the proper offset based on the position and alignment\n\t * this prop will override those values.\n\t */\n\toffset?: number;\n\n\t/**\n\t * Callback to be called when the menu is opened\n\t */\n\tonOpen?: () => void;\n\n\t/**\n\t * Callback to be called when the menu is closed\n\t * @param type - type of close event\n\t */\n\tonClose?: (type?: string) => void;\n\n\t/**\n\t * data-qa attribute for the popover\n\t */\n\t['data-qa']?: string;\n\n\t/**\n\t * Enables interaction tracking for this popover. Provide a stable, non-PII id\n\t * (e.g. 'sticky-note-color-picker'). When omitted, the popover emits no analytics.\n\t */\n\teventId?: string;\n}\n\n/**\n * MrlPopover\n *\n * Renders a popover component with position and alignment relative to a trigger element\n * @param {MrlPopoverProps} props - The props for the MrlPopover component\n * @returns {Element} - rendered MrlPopover component\n */\nexport function MrlPopover({\n\talignment = 'center',\n\tariaLabel,\n\tariaLabelledBy,\n\tchildren,\n\tclassName,\n\tcustomPosition,\n\tdisableClickToOpen = false,\n\tdisableClickOutside = false,\n\tdisableFlipping = false,\n\tdisableFocusTrap = false,\n\thasCloseButton = false,\n\tspacing = 'default',\n\tid,\n\tisSubMenu = false,\n\tactionState = { actionType: null, isOpen: false },\n\tposition = 'bottom',\n\tpoint = true,\n\tportalProps = { id: PORTAL_LAYERS.POPOVER.name },\n\tkind = 'primary',\n\toffset,\n\tonClose,\n\tonOpen,\n\teventId,\n\ttriggerRef,\n\t...rest\n}: MrlPopoverProps): JSX.Element {\n\tconst [state, setState] = React.useState({\n\t\tactionType: null,\n\t\tisOpen: actionState.isOpen || false\n\t} as ActionState);\n\n\tconst trackInteraction = useMrlTrackInteraction('MrlPopover', eventId);\n\t// the popover opens and closes from several paths (trigger click, keyboard, click\n\t// outside, close button), so open/close is emitted from the resulting state.\n\tconst wasOpenRef = React.useRef(actionState.isOpen || false);\n\n\tReact.useEffect(() => {\n\t\tif (wasOpenRef.current === state.isOpen) return;\n\n\t\twasOpenRef.current = state.isOpen;\n\n\t\ttrackInteraction({\n\t\t\taction: state.isOpen ? 'open' : 'close',\n\t\t\tmetadata: { isSubMenu },\n\t\t\tvariant: position\n\t\t});\n\t}, [state.isOpen, isSubMenu, position, trackInteraction]);\n\n\t// stores all of the interactive elements in the popover for focus management\n\tconst [interactiveElements, setInteractiveElements] = React.useState<HTMLElement[]>([]);\n\tconst [menuRect, setMenuRect] = React.useState<DOMRect | null>(null);\n\tconst menuRef = React.useRef<HTMLDivElement>(null);\n\t/** Snapshot of trigger `aria-expanded` before we manage it; restored on popover unmount only. */\n\tconst triggerExpandedRestoreRef = React.useRef<{\n\t\tel: HTMLElement;\n\t\tvalue: string | null;\n\t} | null>(null);\n\n\t/**\n\t * Checks if the trigger element is disabled\n\t * @returns {boolean} - true if the trigger element is disabled, false otherwise\n\t */\n\tconst isTriggerDisabled = React.useCallback((): boolean => {\n\t\treturn isElementAriaDisabled(triggerRef?.current);\n\t}, [triggerRef]);\n\n\t/**\n\t * Opening and closing the menu\n\t */\n\tconst closeMenu = React.useCallback(() => {\n\t\tsetState({ actionType: null, isOpen: false });\n\t\tonClose?.();\n\t}, [onClose]);\n\n\tconst {\n\t\thandleClose,\n\t\thandleMenuKey,\n\t\thideMenuHover,\n\t\thandleTriggerSiblingKey,\n\t\ttoggleMenuKey,\n\t\ttoggleMenuTrigger,\n\t\tshowMenuHover\n\t} = useMrlPopoverEventHandlers({\n\t\tcloseMenu,\n\t\tdisableClickToOpen,\n\t\tdisableFocusTrap,\n\t\thasCloseButton,\n\t\tinteractiveElements,\n\t\tisSubMenu,\n\t\tisTriggerDisabled,\n\t\tmenuRef,\n\t\tsetState,\n\t\tstate,\n\t\ttriggerRef\n\t});\n\n\tuseClickOutside(\n\t\tmenuRef,\n\t\ttriggerRef,\n\t\t'mouseup',\n\t\tcloseMenu,\n\t\tdisableClickOutside || !state.isOpen,\n\t\tPOPOVER_CLICKOUTSIDE_WHITELIST\n\t);\n\n\tReact.useEffect(() => {\n\t\tif (isTriggerDisabled()) return;\n\n\t\tif (!isSubMenu) {\n\t\t\tsetState({ actionType: actionState.actionType, isOpen: actionState.isOpen });\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [isSubMenu, actionState.actionType, actionState.isOpen]);\n\n\t// This use effect handles storing the rect in state for positioning calculations\n\tReact.useLayoutEffect(() => {\n\t\tif (!state.isOpen) return;\n\n\t\t// For consistent calculations, we are storing the menu rect in state\n\t\t// Anytime we need to use the menu rect, we want to make sure the values are based\n\t\t// on the original state of the menu for proper transformations\n\t\tif (!menuRect && menuRef.current) {\n\t\t\tconst newRect = menuRef.current?.getBoundingClientRect();\n\t\t\tsetMenuRect(newRect || null);\n\t\t}\n\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen, isSubMenu]);\n\n\t// This use effect handles getting and setting the interactive elements in the popover.\n\t// These elements are used for focus management when focus trap is not enabled to ensure\n\t// that our tab order matches the visual order of the page\n\tReact.useEffect(() => {\n\t\tif (state.isOpen && !isSubMenu && menuRef.current) {\n\t\t\tif (disableFocusTrap) {\n\t\t\t\t// set the interactive elements so we can track focus location\n\t\t\t\tconst elements = getFocusableElementsInsideElement(menuRef.current as HTMLElement);\n\t\t\t\tsetInteractiveElements(elements);\n\n\t\t\t\t// without focus trap enabled, we want to focus the first interactive element\n\t\t\t\telements[0].focus();\n\t\t\t}\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen, menuRef.current]);\n\n\t// This use effect handles setting all of the event handlers for different parts of the component.\n\t// - trigger event handlers\n\t// - submenu event handlers\n\t// - menu event handlers\n\t// - \"next element\" event handlers, which are event handlers attached to the next interactive element after the trigger\n\t//\n\tReact.useEffect(() => {\n\t\tconst triggerElement = triggerRef?.current;\n\t\tconst menuElement = menuRef?.current;\n\t\tconst nextElement = findAdjacentInteractiveElement(triggerRef, 'next');\n\n\t\tif (triggerElement) {\n\t\t\ttriggerElement.addEventListener('mousedown', (e) => e.stopPropagation());\n\t\t\ttriggerElement.addEventListener('click', toggleMenuTrigger);\n\t\t\ttriggerElement.addEventListener('keydown', toggleMenuKey);\n\n\t\t\tif (nextElement) nextElement.addEventListener('keydown', handleTriggerSiblingKey);\n\n\t\t\t// Setup event listeners for when the menu is a submenu\n\t\t\tif (isSubMenu) {\n\t\t\t\tconst menuElement = menuRef?.current;\n\n\t\t\t\ttriggerElement.addEventListener('mouseover', showMenuHover);\n\t\t\t\ttriggerElement.addEventListener('mouseout', hideMenuHover);\n\n\t\t\t\tif (menuElement) {\n\t\t\t\t\tmenuElement.addEventListener('mouseover', showMenuHover);\n\t\t\t\t\tmenuElement.addEventListener('mouseout', hideMenuHover);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\ttriggerElement.removeEventListener('mousedown', preventDefault);\n\t\t\t\ttriggerElement.removeEventListener('click', toggleMenuTrigger);\n\t\t\t\ttriggerElement.removeEventListener('keydown', toggleMenuKey);\n\n\t\t\t\tif (nextElement) nextElement.removeEventListener('keydown', handleTriggerSiblingKey);\n\n\t\t\t\tif (isSubMenu) {\n\t\t\t\t\ttriggerElement.removeEventListener('mouseover', showMenuHover);\n\t\t\t\t\ttriggerElement.removeEventListener('mouseout', hideMenuHover);\n\n\t\t\t\t\tif (menuElement) {\n\t\t\t\t\t\tmenuElement.removeEventListener('mouseover', showMenuHover);\n\t\t\t\t\t\tmenuElement.removeEventListener('mouseout', hideMenuHover);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [\n\t\tcloseMenu,\n\t\tisSubMenu,\n\t\ttoggleMenuKey,\n\t\ttoggleMenuTrigger,\n\t\ttriggerRef?.current,\n\t\thideMenuHover,\n\t\tshowMenuHover,\n\t\thasCloseButton,\n\t\thandleClose\n\t]);\n\n\t/**\n\t * Popover triggers are not necessarily modal dialogs; use the generic 'true' (see ARIA in HTML).\n\t * Restore the previous DOM value when the trigger changes or this popover unmounts so host-owned\n\t * ARIA (e.g. aria-haspopup=\"menu\") is not left stale after a callout dismisses.\n\t */\n\tReact.useEffect(() => {\n\t\tconst el = triggerRef?.current;\n\t\tif (!el) return;\n\n\t\tconst previousValue = el.getAttribute('aria-haspopup');\n\t\tel.setAttribute('aria-haspopup', 'true');\n\n\t\t// Restore the previous value of the aria-haspopup attribute when the callout is removed from the DOM\n\t\treturn () => {\n\t\t\tif (previousValue === null) {\n\t\t\t\tel.removeAttribute('aria-haspopup');\n\t\t\t} else {\n\t\t\t\tel.setAttribute('aria-haspopup', previousValue);\n\t\t\t}\n\t\t};\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [triggerRef?.current]);\n\n\tReact.useEffect(() => {\n\t\tconst el = triggerRef?.current;\n\t\tif (!el) return;\n\n\t\t// Store the previous value of the aria-expanded attribute when the callout is added to the DOM\n\t\tif (!triggerExpandedRestoreRef.current || triggerExpandedRestoreRef.current.el !== el) {\n\t\t\ttriggerExpandedRestoreRef.current = {\n\t\t\t\tel,\n\t\t\t\tvalue: el.hasAttribute('aria-expanded') ? el.getAttribute('aria-expanded') : null\n\t\t\t};\n\t\t}\n\n\t\t// Set the aria-expanded attribute to the current state of the popover\n\t\tel.setAttribute('aria-expanded', state.isOpen.toString());\n\n\t\tif (state.isOpen) onOpen?.();\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [state.isOpen, onOpen, triggerRef?.current]);\n\n\t/**\n\t * Restore the previous value of the aria-expanded attribute when the callout is removed from the DOM\n\t */\n\tReact.useEffect(() => {\n\t\treturn () => {\n\t\t\tconst snap = triggerExpandedRestoreRef.current;\n\t\t\tif (!snap) return;\n\t\t\tconst { el, value } = snap;\n\n\t\t\tif (!document?.documentElement?.contains(el)) return;\n\n\t\t\tif (value === null) {\n\t\t\t\tel.removeAttribute('aria-expanded');\n\t\t\t} else {\n\t\t\t\tel.setAttribute('aria-expanded', value);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\t/**\n\t * Setup positioning styles, submenu positioning styles, scroll styles, and transition.\n\t */\n\tconst memoizedCustomPosition = React.useMemo(() => customPosition, [customPosition]);\n\tconst customPopoverPosition = memoizedCustomPosition || { left: 0, top: 0 };\n\n\tconst menuPosition = useTriggerPosition(\n\t\ttriggerRef,\n\t\tmenuRef,\n\t\t{\n\t\t\talign: alignment,\n\t\t\tcustomPosition: customPopoverPosition,\n\t\t\tposition: position\n\t\t},\n\t\tstate.isOpen,\n\t\toffset || getOffset(position, point),\n\t\tisSubMenu,\n\t\tdisableFlipping\n\t);\n\n\t// Only while open: isPositioned resets on close, which would cut the leave transition short\n\tconst isAwaitingPosition = !isSubMenu && state.isOpen && !menuPosition.isPositioned;\n\tconst hideUntilPositionedStyles = isAwaitingPosition ? { opacity: 0 } : undefined;\n\n\tconst subMenuPosition = useSubMenuElementPosition(\n\t\ttriggerRef,\n\t\tmenuRef,\n\t\tisSubMenu,\n\t\tstate.isOpen,\n\t\tmenuRect,\n\t\t!isSubMenu\n\t);\n\n\tconst menuPositionState = menuPosition.flipped ? flipPosition(position) : position;\n\tconst scrollStyles = useBrowserEdgeScroll(menuRef, menuPositionState, alignment);\n\n\tconst inlineStyles = {\n\t\tmenu: {\n\t\t\tleft: menuPosition.left,\n\t\t\tposition: 'fixed' as const,\n\t\t\ttop: menuPosition.top\n\t\t},\n\t\tsubmenu: {\n\t\t\tleft: subMenuPosition.left,\n\t\t\ttop: subMenuPosition.top\n\t\t}\n\t};\n\n\t/**\n\t * React Spring transitions for the menu\n\t */\n\tconst transitions = useTransition(state.isOpen, {\n\t\tconfig: { duration: 150 },\n\t\tenter: { opacity: 1, transform: 'translateY(0)' },\n\t\tfrom: { opacity: 0, transform: 'translateY(4px)' },\n\t\tleave: { opacity: 0, transform: 'translateY(4px)' }\n\t});\n\n\tconst menuClasses = classnames(\n\t\tstyles['MrlPopover'],\n\t\t'MrlPopover',\n\t\tstyles['MrlPopover--scrolling'],\n\t\tclassName,\n\t\t{\n\t\t\t[styles['MrlPopover--submenu']]: isSubMenu,\n\t\t\t[styles['inverse']]: kind === 'inverse',\n\t\t\t[styles['primary']]: kind === 'primary',\n\t\t\t[styles['compact']]: spacing === 'compact',\n\t\t\t[styles['default']]: spacing === 'default'\n\t\t}\n\t);\n\n\tconst positionStyles = isSubMenu ? inlineStyles.submenu : inlineStyles.menu;\n\n\tconst renderMenu = () => {\n\t\tconst inlineScrollStyles = isSubMenu ? {} : scrollStyles ? scrollStyles.styles : {};\n\t\tconst scrollClasses = classnames(\n\t\t\tstyles['MrlPopover--content'],\n\t\t\tstyles['MrlPopover--scrolling--content']\n\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{transitions(\n\t\t\t\t\t(style, item) =>\n\t\t\t\t\t\titem && (\n\t\t\t\t\t\t\t<MrlFocusTrap disabled={disableFocusTrap} containerRef={menuRef}>\n\t\t\t\t\t\t\t\t<animated.div\n\t\t\t\t\t\t\t\t\taria-label={ariaLabel}\n\t\t\t\t\t\t\t\t\taria-labelledby={ariaLabelledBy}\n\t\t\t\t\t\t\t\t\tclassName={menuClasses}\n\t\t\t\t\t\t\t\t\tid={id}\n\t\t\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\t\t\tstyle={{ ...positionStyles, ...style, ...hideUntilPositionedStyles }}\n\t\t\t\t\t\t\t\t\tonKeyDown={handleMenuKey}\n\t\t\t\t\t\t\t\t\tref={menuRef}\n\t\t\t\t\t\t\t\t\t{...rest}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<MrlPopoverScrollContainer className={scrollClasses} style={inlineScrollStyles}>\n\t\t\t\t\t\t\t\t\t\t{typeof children === 'function' && children({ closeMenu })}\n\t\t\t\t\t\t\t\t\t\t{typeof children !== 'function' && children}\n\t\t\t\t\t\t\t\t\t\t{hasCloseButton && (\n\t\t\t\t\t\t\t\t\t\t\t<MrlIconButton\n\t\t\t\t\t\t\t\t\t\t\t\tdata-qa=\"popover-close-button\"\n\t\t\t\t\t\t\t\t\t\t\t\twrapperClassName={styles['MrlPopover--close']}\n\t\t\t\t\t\t\t\t\t\t\t\ticon={<MrlSvg svg={close} />}\n\t\t\t\t\t\t\t\t\t\t\t\tkind={kind === 'inverse' ? 'ghost-inverse' : 'ghost'}\n\t\t\t\t\t\t\t\t\t\t\t\ttext=\"Close\"\n\t\t\t\t\t\t\t\t\t\t\t\tstate=\"default\"\n\t\t\t\t\t\t\t\t\t\t\t\tposition=\"right\"\n\t\t\t\t\t\t\t\t\t\t\t\ttipAnchor=\"center\"\n\t\t\t\t\t\t\t\t\t\t\t\tonMouseUp={closeMenu}\n\t\t\t\t\t\t\t\t\t\t\t\tonKeyDown={handleClose}\n\t\t\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t{point && (\n\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\tclassName={styles['MrlPopover--point']}\n\t\t\t\t\t\t\t\t\t\t\t\tdata-point={getDataPoint(menuPositionState, alignment)}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</MrlPopoverScrollContainer>\n\t\t\t\t\t\t\t\t</animated.div>\n\t\t\t\t\t\t\t</MrlFocusTrap>\n\t\t\t\t\t\t)\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t};\n\n\t/* eslint-disable */\n\treturn (\n\t\t<MrlPopoverContext.Provider\n\t\t\tvalue={{\n\t\t\t\tcloseMenu\n\t\t\t}}\n\t\t>\n\t\t\t{isSubMenu ? (\n\t\t\t\trenderMenu()\n\t\t\t) : (\n\t\t\t\t<MrlPortal layer={portalProps.layer || PORTAL_LAYERS.POPOVER} {...portalProps}>\n\t\t\t\t\t{renderMenu()}\n\t\t\t\t</MrlPortal>\n\t\t\t)}\n\t\t</MrlPopoverContext.Provider>\n\t);\n\t/* eslint-enable */\n}\n\nMrlPopover.componentType = 'Popover';\n"],"names":["POPOVER_CLICKOUTSIDE_WHITELIST","concat","SELECT_MENU_LIST_CLASS_NAME","MULTI_SELECT_MENU_LIST_CLASS_NAME","MrlPopover","_ref","_ref$alignment","alignment","ariaLabel","ariaLabelledBy","children","className","customPosition","_ref$disableClickToOp","disableClickToOpen","_ref$disableClickOuts","disableClickOutside","_ref$disableFlipping","disableFlipping","_ref$disableFocusTrap","disableFocusTrap","_ref$hasCloseButton","hasCloseButton","_ref$spacing","spacing","id","_ref$isSubMenu","isSubMenu","_ref$actionState","actionState","actionType","isOpen","_ref$position","position","_ref$point","point","_ref$portalProps","portalProps","PORTAL_LAYERS","POPOVER","name","_ref$kind","kind","offset","onClose","onOpen","eventId","triggerRef","rest","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","state","setState","trackInteraction","useMrlTrackInteraction","wasOpenRef","useRef","useEffect","current","action","metadata","variant","_React$useState3","_React$useState4","interactiveElements","setInteractiveElements","_React$useState5","_React$useState6","menuRect","setMenuRect","menuRef","triggerExpandedRestoreRef","isTriggerDisabled","useCallback","isElementAriaDisabled","closeMenu","_useMrlPopoverEventHa","useMrlPopoverEventHandlers","handleClose","handleMenuKey","hideMenuHover","handleTriggerSiblingKey","toggleMenuKey","toggleMenuTrigger","showMenuHover","useClickOutside","useLayoutEffect","_menuRef$current","newRect","getBoundingClientRect","elements","getFocusableElementsInsideElement","focus","triggerElement","menuElement","nextElement","findAdjacentInteractiveElement","addEventListener","e","stopPropagation","removeEventListener","preventDefault","el","previousValue","getAttribute","setAttribute","removeAttribute","value","hasAttribute","toString","_document","_document$documentEle","snap","document","documentElement","contains","memoizedCustomPosition","useMemo","customPopoverPosition","left","top","menuPosition","useTriggerPosition","align","getOffset","isAwaitingPosition","isPositioned","hideUntilPositionedStyles","opacity","undefined","subMenuPosition","useSubMenuElementPosition","menuPositionState","flipped","flipPosition","scrollStyles","useBrowserEdgeScroll","inlineStyles","menu","submenu","transitions","useTransition","config","duration","enter","transform","from","leave","menuClasses","classnames","styles","positionStyles","renderMenu","inlineScrollStyles","scrollClasses","createElement","Fragment","style","item","MrlFocusTrap","disabled","containerRef","animated","div","_extends","tabIndex","_objectSpread","onKeyDown","ref","MrlPopoverScrollContainer","MrlIconButton","wrapperClassName","icon","MrlSvg","svg","close","text","tipAnchor","onMouseUp","size","getDataPoint","MrlPopoverContext","Provider","MrlPortal","layer","componentType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAMA,8BAA8B,GAAG,CACtC,oBAAoB,EACpB,0BAA0B,EAAA,GAAA,CAAAC,MAAA,CACtBC,2BAA2B,CAAA,EAAA,GAAA,CAAAD,MAAA,CAC3BE,iCAAiC,CAAA,CACrC;AAoJD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAAAC,IAAA,EA0BO;AAAA,EAAA,IAAAC,cAAA,GAAAD,IAAA,CAzBhCE,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,QAAQ,GAAAA,cAAA;IACpBE,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,cAAc,GAAAJ,IAAA,CAAdI,cAAc;IACdC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IACRC,SAAS,GAAAN,IAAA,CAATM,SAAS;IACTC,cAAc,GAAAP,IAAA,CAAdO,cAAc;IAAAC,qBAAA,GAAAR,IAAA,CACdS,kBAAkB;AAAlBA,IAAAA,kBAAkB,GAAAD,qBAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,qBAAA;IAAAE,qBAAA,GAAAV,IAAA,CAC1BW,mBAAmB;AAAnBA,IAAAA,mBAAmB,GAAAD,qBAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,qBAAA;IAAAE,oBAAA,GAAAZ,IAAA,CAC3Ba,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,oBAAA;IAAAE,qBAAA,GAAAd,IAAA,CACvBe,gBAAgB;AAAhBA,IAAAA,gBAAgB,GAAAD,qBAAA,KAAA,MAA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;;"}
@@ -1,4 +1,4 @@
1
- var TOOLKIT_VERSION = "4.77.2";
1
+ var TOOLKIT_VERSION = "4.78.0";
2
2
 
3
3
  export { TOOLKIT_VERSION };
4
4
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const TOOLKIT_VERSION = \"4.77.2\";"],"names":["TOOLKIT_VERSION"],"mappings":"AAAO,IAAMA,eAAe,GAAG;;;;"}
1
+ {"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const TOOLKIT_VERSION = \"4.78.0\";"],"names":["TOOLKIT_VERSION"],"mappings":"AAAO,IAAMA,eAAe,GAAG;;;;"}
@@ -2,8 +2,8 @@ import { LayoutComponent } from '../../layout/constants';
2
2
  import '../grid.variables.scss';
3
3
  import '../grid.global.scss';
4
4
  /**
5
- * MrlCol React component.
5
+ * MrlGrid React component.
6
6
  * @param props - component props
7
- * @returns a MrlCol React component.
7
+ * @returns a MrlGrid React component.
8
8
  */
9
9
  export declare function MrlGrid({ children, className, ...rest }: LayoutComponent): JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muraldevkit/ui-toolkit",
3
- "version": "4.77.2",
3
+ "version": "4.78.0",
4
4
  "description": "Mural's UI Toolkit",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",