@muraldevkit/ui-toolkit 4.84.0 → 4.84.1

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.
Files changed (31) hide show
  1. package/dist/cjs/components/avatar/MrlAvatar/MrlAvatar.js.map +1 -1
  2. package/dist/cjs/components/callout/MrlCallout/MrlCallout.js.map +1 -1
  3. package/dist/cjs/components/form/textarea/MrlTextarea/MrlTextarea.js.map +1 -1
  4. package/dist/cjs/components/grid/constants.js.map +1 -1
  5. package/dist/cjs/components/live-region/MrlLiveRegion/MrlLiveRegion.js.map +1 -1
  6. package/dist/cjs/components/popover/MrlPopover/MrlPopover.js.map +1 -1
  7. package/dist/cjs/components/portal/MrlPortal.js.map +1 -1
  8. package/dist/cjs/components/rovingTabindex/MrlRovingTabindex/MrlRovingTabindex.js.map +1 -1
  9. package/dist/cjs/version.js +1 -1
  10. package/dist/cjs/version.js.map +1 -1
  11. package/dist/esm/components/avatar/MrlAvatar/MrlAvatar.js.map +1 -1
  12. package/dist/esm/components/callout/MrlCallout/MrlCallout.js.map +1 -1
  13. package/dist/esm/components/form/textarea/MrlTextarea/MrlTextarea.js.map +1 -1
  14. package/dist/esm/components/grid/constants.js.map +1 -1
  15. package/dist/esm/components/live-region/MrlLiveRegion/MrlLiveRegion.js.map +1 -1
  16. package/dist/esm/components/popover/MrlPopover/MrlPopover.js.map +1 -1
  17. package/dist/esm/components/portal/MrlPortal.js.map +1 -1
  18. package/dist/esm/components/rovingTabindex/MrlRovingTabindex/MrlRovingTabindex.js.map +1 -1
  19. package/dist/esm/version.js +1 -1
  20. package/dist/esm/version.js.map +1 -1
  21. package/dist/types/components/avatar/MrlAvatar/MrlAvatar.d.ts +2 -2
  22. package/dist/types/components/callout/MrlCallout/MrlCallout.d.ts +1 -2
  23. package/dist/types/components/form/textarea/MrlTextarea/MrlTextarea.d.ts +1 -1
  24. package/dist/types/components/grid/constants.d.ts +2 -3
  25. package/dist/types/components/grid/index.d.ts +1 -1
  26. package/dist/types/components/live-region/MrlLiveRegion/MrlLiveRegion.d.ts +1 -2
  27. package/dist/types/components/live-region/MrlLiveRegion/index.d.ts +1 -1
  28. package/dist/types/components/popover/MrlPopover/MrlPopover.d.ts +1 -2
  29. package/dist/types/components/portal/MrlPortal.d.ts +1 -2
  30. package/dist/types/components/rovingTabindex/MrlRovingTabindex/MrlRovingTabindex.d.ts +1 -1
  31. package/package.json +1 -1
@@ -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 * ARIA role of the popover container, e.g. `dialog` when it holds interactive content.\n\t * A role that is a valid `aria-haspopup` value (`dialog`, `grid`, `listbox`, `menu`, `tree`)\n\t * is also announced on the trigger.\n\t */\n\trole?: React.AriaRole;\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\nconst ARIA_HASPOPUP_ROLES = new Set(['dialog', 'grid', 'listbox', 'menu', 'tree']);\n\n/**\n * Maps the popover role to the trigger's `aria-haspopup`, falling back to the generic 'true'.\n * @param {React.AriaRole} role - The role of the popover container\n * @returns {string} The `aria-haspopup` value\n */\nconst getAriaHasPopup = (role?: React.AriaRole): string =>\n\trole && ARIA_HASPOPUP_ROLES.has(role) ? role : 'true';\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\trole,\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 * Announce the popover's role on the trigger when it is a valid `aria-haspopup` value, otherwise\n\t * fall back to the generic 'true' (see ARIA in HTML). 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', getAriaHasPopup(role));\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, role]);\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\trole={role}\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","ARIA_HASPOPUP_ROLES","Set","getAriaHasPopup","role","has","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;AA2JD,IAAMC,mBAAmB,GAAG,IAAIC,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;;AAElF;AACA;AACA;AACA;AACA;AACA,IAAMC,eAAe,GAAIC,IAAqB,IAC7CA,IAAI,IAAIH,mBAAmB,CAACI,GAAG,CAACD,IAAI,CAAC,GAAGA,IAAI,GAAG,MAAM;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,UAAUA,CAAAC,IAAA,EA2BO;AAAA,EAAA,IAAAC,cAAA,GAAAD,IAAA,CA1BhCE,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;I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,iBACLiB,KAAA,CAAA4G,aAAA,CAAA,KAAA,EAAA;AACCrJ,MAAAA,SAAS,EAAEgJ,MAAM,CAAC,mBAAmB,CAAE;AACvC,MAAA,YAAA,EAAY8B,YAAY,CAAChD,iBAAiB,EAAElI,SAAS;AAAE,KACvD,CAEwB,CACd,CACD,CAEjB,CACC,CAAC;EAEL,CAAC;;AAED;AACA,EAAA,oBACC6C,KAAA,CAAA4G,aAAA,CAAC0B,iBAAiB,CAACC,QAAQ,EAAA;AAC1B3E,IAAAA,KAAK,EAAE;AACNhC,MAAAA;AACD;AAAE,GAAA,EAEDrD,SAAS,GACTkI,UAAU,EAAE,gBAEZzG,KAAA,CAAA4G,aAAA,CAAC4B,SAAS,EAAAnB,QAAA,CAAA;AAACoB,IAAAA,KAAK,EAAExJ,WAAW,CAACwJ,KAAK,IAAIvJ,aAAa,CAACC;AAAQ,GAAA,EAAKF,WAAW,CAAA,EAC3EwH,UAAU,EACD,CAEe,CAAC;AAE9B;AACD;AAEAzJ,UAAU,CAAC0L,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\nexport type 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 * ARIA role of the popover container, e.g. `dialog` when it holds interactive content.\n\t * A role that is a valid `aria-haspopup` value (`dialog`, `grid`, `listbox`, `menu`, `tree`)\n\t * is also announced on the trigger.\n\t */\n\trole?: React.AriaRole;\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\nconst ARIA_HASPOPUP_ROLES = new Set(['dialog', 'grid', 'listbox', 'menu', 'tree']);\n\n/**\n * Maps the popover role to the trigger's `aria-haspopup`, falling back to the generic 'true'.\n * @param {React.AriaRole} role - The role of the popover container\n * @returns {string} The `aria-haspopup` value\n */\nconst getAriaHasPopup = (role?: React.AriaRole): string =>\n\trole && ARIA_HASPOPUP_ROLES.has(role) ? role : 'true';\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\trole,\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 * Announce the popover's role on the trigger when it is a valid `aria-haspopup` value, otherwise\n\t * fall back to the generic 'true' (see ARIA in HTML). 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', getAriaHasPopup(role));\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, role]);\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\trole={role}\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","ARIA_HASPOPUP_ROLES","Set","getAriaHasPopup","role","has","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;AA2JD,IAAMC,mBAAmB,GAAG,IAAIC,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;;AAElF;AACA;AACA;AACA;AACA;AACA,IAAMC,eAAe,GAAIC,IAAqB,IAC7CA,IAAI,IAAIH,mB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AACC,QAAAA,GAAG,EAAEC;AAAM,OAAE,CAAE;AAC7B1I,MAAAA,IAAI,EAAEA,IAAI,KAAK,SAAS,GAAG,eAAe,GAAG,OAAQ;AACrD2I,MAAAA,IAAI,EAAC,OAAO;AACZ7H,MAAAA,KAAK,EAAC,SAAS;AACfvB,MAAAA,QAAQ,EAAC,OAAO;AAChBqJ,MAAAA,SAAS,EAAC,QAAQ;AAClBC,MAAAA,SAAS,EAAEvG,SAAU;AACrB4F,MAAAA,SAAS,EAAEzF,WAAY;AACvBqG,MAAAA,IAAI,EAAC;AAAO,KACZ,CACD,EACArJ,KAAK,iBACLiB,KAAA,CAAA4G,aAAA,CAAA,KAAA,EAAA;AACCrJ,MAAAA,SAAS,EAAEgJ,MAAM,CAAC,mBAAmB,CAAE;AACvC,MAAA,YAAA,EAAY8B,YAAY,CAAChD,iBAAiB,EAAElI,SAAS;AAAE,KACvD,CAEwB,CACd,CACD,CAEjB,CACC,CAAC;EAEL,CAAC;;AAED;AACA,EAAA,oBACC6C,KAAA,CAAA4G,aAAA,CAAC0B,iBAAiB,CAACC,QAAQ,EAAA;AAC1B3E,IAAAA,KAAK,EAAE;AACNhC,MAAAA;AACD;AAAE,GAAA,EAEDrD,SAAS,GACTkI,UAAU,EAAE,gBAEZzG,KAAA,CAAA4G,aAAA,CAAC4B,SAAS,EAAAnB,QAAA,CAAA;AAACoB,IAAAA,KAAK,EAAExJ,WAAW,CAACwJ,KAAK,IAAIvJ,aAAa,CAACC;AAAQ,GAAA,EAAKF,WAAW,CAAA,EAC3EwH,UAAU,EACD,CAEe,CAAC;AAE9B;AACD;AAEAzJ,UAAU,CAAC0L,aAAa,GAAG,SAAS;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MrlPortal.js","sources":["../../../../src/components/portal/MrlPortal.tsx"],"sourcesContent":["import * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { PORTAL_LAYERS } from '../../utils/layers';\n\ntype PortalLayer = (typeof PORTAL_LAYERS)[keyof typeof PORTAL_LAYERS];\nexport interface PortalProps extends React.HTMLAttributes<HTMLDivElement> {\n\tchildren: React.ReactNode;\n\tclassName?: string;\n\t['data-qa']?: string;\n\tid?: string;\n\t/** Stacking layer from `PORTAL_LAYERS`. Its name is used as the container id (over `id`) and its z-index is applied to the container's first child. Without it, the container is `id` or the root portal, with the root z-index. */\n\tlayer?: PortalLayer;\n}\n\nexport const MRL_PORTAL_ID = PORTAL_LAYERS.ROOT.name;\n\n/**\n * Dynamically creates a single portal and send your children to the portal.\n * Where they will live outside of the normal document flow\n *\n * @param PortalProps Portal only takes children. Contact the platform team if you need to extend this.\n * @returns MrlPortal component\n */\nexport const MrlPortal = ({\n\tchildren,\n\tclassName,\n\tid,\n\tlayer,\n\t...remainingProps\n}: PortalProps): React.ReactElement | null => {\n\tconst [portalElement, setPortalElement] = React.useState<HTMLElement | null>(null);\n\tconst element = 'div';\n\tconst portalId = layer?.name || id || MRL_PORTAL_ID;\n\tconst portalLayer = layer || PORTAL_LAYERS.ROOT;\n\n\tReact.useLayoutEffect(() => {\n\t\tlet portal = document.getElementById(portalId);\n\t\tconst dataQa = remainingProps['data-qa'] || id || PORTAL_LAYERS.ROOT.name;\n\n\t\t// create the portal on the fly and reuse the same one each time.\n\t\tif (!portal) {\n\t\t\tportal = document.createElement(element);\n\t\t\tportal.setAttribute('id', portalId);\n\t\t\tportal.setAttribute('data-qa', dataQa);\n\t\t\tportal.setAttribute('data-testid', dataQa);\n\t\t\tif (className) portal.setAttribute('class', className);\n\t\t\tdocument.body.appendChild(portal);\n\t\t}\n\n\t\tsetPortalElement(portal);\n\t}, [portalId, remainingProps, id, className]);\n\n\t/**\n\t * Sets z-index of the first child element of the portal to the layer's z-index\n\t *\n\t * TODO: update to also accept a 'layerId' that will override the default layer\n\t * with the provided layerId\n\t */\n\tif (!portalElement) return null;\n\n\tconst childrenArray = React.Children.toArray(children);\n\tif (childrenArray.length > 0 && portalElement) {\n\t\tconst firstChildElement = portalElement.firstElementChild as HTMLElement | null;\n\t\tif (firstChildElement) {\n\t\t\tfirstChildElement.style.zIndex = `${portalLayer.zIndex}`;\n\t\t}\n\t}\n\n\t// state will be null on the very first render.\n\tif (!portalElement) return null;\n\n\treturn createPortal(children, portalElement);\n};\n"],"names":["MRL_PORTAL_ID","PORTAL_LAYERS","ROOT","name","MrlPortal","_ref","children","className","id","layer","remainingProps","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","portalElement","setPortalElement","element","portalId","portalLayer","useLayoutEffect","portal","document","getElementById","dataQa","createElement","setAttribute","body","appendChild","childrenArray","Children","toArray","length","firstChildElement","firstElementChild","style","zIndex","concat","createPortal"],"mappings":";;;;;;IAcaA,aAAa,GAAGC,aAAa,CAACC,IAAI,CAACC;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMC,SAAS,GAAGC,IAAA,IAMqB;AAAA,EAAA,IAL7CC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,EAAE,GAAAH,IAAA,CAAFG,EAAE;IACFC,KAAK,GAAAJ,IAAA,CAALI,KAAK;AACFC,IAAAA,cAAc,GAAAC,wBAAA,CAAAN,IAAA,EAAAO,SAAA,CAAA;AAEjB,EAAA,IAAAC,eAAA,GAA0CC,KAAK,CAACC,QAAQ,CAAqB,IAAI,CAAC;IAAAC,gBAAA,GAAAC,cAAA,CAAAJ,eAAA,EAAA,CAAA,CAAA;AAA3EK,IAAAA,aAAa,GAAAF,gBAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,gBAAgB,GAAAH,gBAAA,CAAA,CAAA,CAAA;EACtC,IAAMI,OAAO,GAAG,KAAK;AACrB,EAAA,IAAMC,QAAQ,GAAG,CAAAZ,KAAK,KAAA,IAAA,IAALA,KAAK,KAAA,MAAA,GAAA,MAAA,GAALA,KAAK,CAAEN,IAAI,KAAIK,EAAE,IAAIR,aAAa;AACnD,EAAA,IAAMsB,WAAW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,CAACiB,MAAM,CAAE;AACzD,IAAA;AACD,EAAA;;AAEA;AACA,EAAA,IAAI,CAACrB,aAAa,EAAE,OAAO,IAAI;AAE/B,EAAA,oBAAOuB,YAAY,CAACnC,QAAQ,EAAEY,aAAa,CAAC;AAC7C;;;;"}
1
+ {"version":3,"file":"MrlPortal.js","sources":["../../../../src/components/portal/MrlPortal.tsx"],"sourcesContent":["import * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { PORTAL_LAYERS } from '../../utils/layers';\n\nexport type PortalLayer = (typeof PORTAL_LAYERS)[keyof typeof PORTAL_LAYERS];\nexport interface PortalProps extends React.HTMLAttributes<HTMLDivElement> {\n\tchildren: React.ReactNode;\n\tclassName?: string;\n\t['data-qa']?: string;\n\tid?: string;\n\t/** Stacking layer from `PORTAL_LAYERS`. Its name is used as the container id (over `id`) and its z-index is applied to the container's first child. Without it, the container is `id` or the root portal, with the root z-index. */\n\tlayer?: PortalLayer;\n}\n\nexport const MRL_PORTAL_ID = PORTAL_LAYERS.ROOT.name;\n\n/**\n * Dynamically creates a single portal and send your children to the portal.\n * Where they will live outside of the normal document flow\n *\n * @param PortalProps Portal only takes children. Contact the platform team if you need to extend this.\n * @returns MrlPortal component\n */\nexport const MrlPortal = ({\n\tchildren,\n\tclassName,\n\tid,\n\tlayer,\n\t...remainingProps\n}: PortalProps): React.ReactElement | null => {\n\tconst [portalElement, setPortalElement] = React.useState<HTMLElement | null>(null);\n\tconst element = 'div';\n\tconst portalId = layer?.name || id || MRL_PORTAL_ID;\n\tconst portalLayer = layer || PORTAL_LAYERS.ROOT;\n\n\tReact.useLayoutEffect(() => {\n\t\tlet portal = document.getElementById(portalId);\n\t\tconst dataQa = remainingProps['data-qa'] || id || PORTAL_LAYERS.ROOT.name;\n\n\t\t// create the portal on the fly and reuse the same one each time.\n\t\tif (!portal) {\n\t\t\tportal = document.createElement(element);\n\t\t\tportal.setAttribute('id', portalId);\n\t\t\tportal.setAttribute('data-qa', dataQa);\n\t\t\tportal.setAttribute('data-testid', dataQa);\n\t\t\tif (className) portal.setAttribute('class', className);\n\t\t\tdocument.body.appendChild(portal);\n\t\t}\n\n\t\tsetPortalElement(portal);\n\t}, [portalId, remainingProps, id, className]);\n\n\t/**\n\t * Sets z-index of the first child element of the portal to the layer's z-index\n\t *\n\t * TODO: update to also accept a 'layerId' that will override the default layer\n\t * with the provided layerId\n\t */\n\tif (!portalElement) return null;\n\n\tconst childrenArray = React.Children.toArray(children);\n\tif (childrenArray.length > 0 && portalElement) {\n\t\tconst firstChildElement = portalElement.firstElementChild as HTMLElement | null;\n\t\tif (firstChildElement) {\n\t\t\tfirstChildElement.style.zIndex = `${portalLayer.zIndex}`;\n\t\t}\n\t}\n\n\t// state will be null on the very first render.\n\tif (!portalElement) return null;\n\n\treturn createPortal(children, portalElement);\n};\n"],"names":["MRL_PORTAL_ID","PORTAL_LAYERS","ROOT","name","MrlPortal","_ref","children","className","id","layer","remainingProps","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","portalElement","setPortalElement","element","portalId","portalLayer","useLayoutEffect","portal","document","getElementById","dataQa","createElement","setAttribute","body","appendChild","childrenArray","Children","toArray","length","firstChildElement","firstElementChild","style","zIndex","concat","createPortal"],"mappings":";;;;;;IAcaA,aAAa,GAAGC,aAAa,CAACC,IAAI,CAACC;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMC,SAAS,GAAGC,IAAA,IAMqB;AAAA,EAAA,IAL7CC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,EAAE,GAAAH,IAAA,CAAFG,EAAE;IACFC,KAAK,GAAAJ,IAAA,CAALI,KAAK;AACFC,IAAAA,cAAc,GAAAC,wBAAA,CAAAN,IAAA,EAAAO,SAAA,CAAA;AAEjB,EAAA,IAAAC,eAAA,GAA0CC,KAAK,CAACC,QAAQ,CAAqB,IAAI,CAAC;IAAAC,gBAAA,GAAAC,c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aAAa,EAAE,OAAO,IAAI;EAE/B,IAAMc,aAAa,GAAGlB,KAAK,CAACmB,QAAQ,CAACC,OAAO,CAAC5B,QAAQ,CAAC;AACtD,EAAA,IAAI0B,aAAa,CAACG,MAAM,GAAG,CAAC,IAAIjB,aAAa,EAAE;AAC9C,IAAA,IAAMkB,iBAAiB,GAAGlB,aAAa,CAACmB,iBAAuC;AAC/E,IAAA,IAAID,iBAAiB,EAAE;MACtBA,iBAAiB,CAACE,KAAK,CAACC,MAAM,GAAA,EAAA,CAAAC,MAAA,CAAMlB,WAAW,CAACiB,MAAM,CAAE;AACzD,IAAA;AACD,EAAA;;AAEA;AACA,EAAA,IAAI,CAACrB,aAAa,EAAE,OAAO,IAAI;AAE/B,EAAA,oBAAOuB,YAAY,CAACnC,QAAQ,EAAEY,aAAa,CAAC;AAC7C;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MrlRovingTabindex.js","sources":["../../../../../src/components/rovingTabindex/MrlRovingTabindex/MrlRovingTabindex.tsx"],"sourcesContent":["import * as React from 'react';\n\ntype RefType = HTMLElement | HTMLDivElement | null;\n\n/**\n * Gets tabbable elements in a given bit of the DOM, excluding disabled elements\n * @param {RefType} ref - the ref of the container\n * @param {string} selector - the selector to query (should already exclude disabled elements)\n * @returns {HTMLElement[]} - an array of tabbable HTML elements\n */\nexport const getTabbableElements = (ref: RefType, selector: string): HTMLElement[] => {\n\tconst elements = ref?.querySelectorAll(selector);\n\tif (!elements) return [];\n\treturn Array.prototype.slice.call(elements);\n};\n\nconst arraysEqual = (a: (Element | null)[], b: (Element | null)[]): boolean =>\n\ta.length === b.length && a.every((el, i) => el === b[i]);\n\nexport type FocusOnInitPosition = 'first' | 'last';\nexport interface RovingPropTypes {\n\t/** CSS selector of the element that starts as the tab stop, for example a checked custom radio. Falls back to `[data-roving-active]`, then to the first `[data-roving]` element. */\n\tactiveSelector?: string;\n\t/**\n\t * If true, disabled elements (with disabled attribute or aria-disabled=\"true\")\n\t * will be included in the roving tabindex. Defaults to true (disabled elements are included).\n\t */\n\tallowDisabled?: boolean;\n\tchildren: React.ReactNode;\n\t/**\n\t * delayMount is used to apply a delay to the mounting\n\t * of the RovingTabindex component. This can be helpful in\n\t * the event that a component's children have not been fully\n\t * rendered by the time the componentDidMount function is triggered\n\t */\n\tdelayMount?: number;\n\t/** Moves focus to the first or last element when the component mounts (after `delayMount`, if set). */\n\tfocusOnInit?: FocusOnInitPosition;\n\t/** Keeps every element out of the tab order until `isFocused` becomes true. For groups reached through a keyboard shortcut instead of Tab. */\n\tfocusWithShortcut?: boolean;\n\t/** Has no effect. Kept for backwards compatibility. */\n\tforceUpdate?: boolean;\n\t/** Set when another roving tabindex is nested inside this one, so its elements are left to the inner instance. */\n\thasChildRoving?: boolean;\n\t/** CSS selector. Keyboard navigation is ignored while focus is inside a matching element, for example a text input. */\n\tignoreElements?: string;\n\t/** With `focusWithShortcut`, whether the group holds focus. Turning it on focuses the active element; turning it off removes the group from the tab order. */\n\tisFocused?: boolean;\n\t/** Called when focus moves from the group to another element outside it. With `focusWithShortcut`, also called when `isFocused` turns off while focus is outside the group. */\n\tonBlur?: () => void;\n\t/** Pass it after moving focus into the group programmatically. On the next update the focused element becomes the tab stop and the callback receives `false`, so the consumer can drop it. */\n\tonRefocus?: (shouldRefocus: boolean) => void;\n\t/** Axis of the group, read once at mount. Every arrow key moves focus, but the keys across the axis are left to a focused element with `aria-haspopup=\"true\"` or role combobox, listbox or option. Defaults to horizontal. */\n\torientation?: RovingOrientation;\n\tqa?: string;\n}\n\ntype RovingOrientation = 'horizontal' | 'vertical';\ntype NavigationDirection = 'forward' | 'back';\n\n/**\n * Default value for allowDisabled prop.\n * When true, disabled elements are included in the roving tabindex navigation.\n */\nconst DEFAULT_ALLOW_DISABLED = true;\n\n/**\n * CSS selector to exclude disabled elements.\n * Excludes both native disabled attribute and ARIA-compliant disabled elements.\n */\nconst DISABLED_EXCLUSION = ':not([disabled]):not([aria-disabled=\"true\"])';\n\n/**\n * CSS selector suffix to exclude nested roving tabindex elements.\n * Prevents deeply nested elements from being included in parent roving tabindex.\n */\nconst NESTED_ROVING_EXCLUSION =\n\t':not(.helpers-roving-tabindex-container .helpers-roving-tabindex-container [data-roving])';\n\n/**\n * Builds the appropriate CSS selector based on configuration.\n * @param allowDisabled - Whether to include disabled elements in the roving tabindex\n * @param hasChildRoving - Whether nested roving tabindex containers should be excluded\n * @returns CSS selector string for querying roving elements\n */\nconst buildSelector = (allowDisabled: boolean, hasChildRoving: boolean): string => {\n\tconst disabledPart = allowDisabled ? '' : DISABLED_EXCLUSION;\n\tconst nestedPart = hasChildRoving ? NESTED_ROVING_EXCLUSION : '';\n\treturn `[data-roving]${disabledPart}${nestedPart}`;\n};\n\n/**\n * Component to create a Roving Tabindex in the DOM\n * @returns {HTMLDivElement}\n */\nclass MrlRovingTabindex extends React.Component<RovingPropTypes> {\n\telements: Array<Element | null>;\n\torientation: RovingOrientation;\n\tref!: HTMLDivElement | null;\n\tselector: string;\n\n\t/**\n\t * MrlRovingTabindex class constructor\n\t * @param props - the MrlRovingTabindex props\n\t * @returns new instance\n\t */\n\tconstructor(props: RovingPropTypes) {\n\t\tsuper(props);\n\n\t\tconst { allowDisabled = DEFAULT_ALLOW_DISABLED, hasChildRoving = false, orientation } = props;\n\n\t\tthis.elements = [];\n\t\tthis.orientation = orientation || 'horizontal';\n\t\tthis.selector = buildSelector(allowDisabled, hasChildRoving);\n\t}\n\n\t/**\n\t * Runs when the MrlRovingTabindex component mounts\n\t */\n\tcomponentDidMount(): void {\n\t\tconst { delayMount } = this.props;\n\t\tif (delayMount) {\n\t\t\tsetTimeout(() => this.mount(), delayMount);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.mount();\n\t}\n\n\t/**\n\t * Runs when the MrlRovingTabindex component unmounts\n\t */\n\tcomponentWillUnmount(): void {\n\t\t// Remove focus event listener\n\t\tif (this.ref) {\n\t\t\tthis.ref.removeEventListener('focusout', this.handleFocusOut);\n\t\t}\n\t}\n\n\t/**\n\t * Runs when the MrlRovingTabindex component updates\n\t * @param {RovingPropTypes} prevProps - the props before the component updated\n\t */\n\tcomponentDidUpdate(prevProps: RovingPropTypes): void {\n\t\tconst {\n\t\t\tallowDisabled = DEFAULT_ALLOW_DISABLED,\n\t\t\tchildren,\n\t\t\tfocusWithShortcut,\n\t\t\thasChildRoving = false,\n\t\t\tisFocused,\n\t\t\tonBlur,\n\t\t\tonRefocus\n\t\t} = this.props;\n\n\t\t/**\n\t\t * If allowDisabled or hasChildRoving prop changes, rebuild the selector\n\t\t * and re-scan for elements to reflect the new configuration.\n\t\t */\n\t\tif (prevProps.allowDisabled !== allowDisabled || prevProps.hasChildRoving !== hasChildRoving) {\n\t\t\tthis.selector = buildSelector(allowDisabled, hasChildRoving);\n\t\t\tthis.setElements();\n\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t}\n\n\t\t/**\n\t\t * If focus is programatically moved to the MrlRovingTabindex\n\t\t * component from outside of the MrlRovingTabindex, passing\n\t\t * the prop of `onRefocus` will cause the component to go\n\t\t * through and make sure that only the active element\n\t\t * has a tabindex set to 0.\n\t\t */\n\t\tif (onRefocus) {\n\t\t\tthis.handleRefocus();\n\t\t}\n\n\t\t/**\n\t\t * When children change, re-scan for elements and update tabindex values.\n\t\t * This ensures that dynamically added/removed buttons are properly managed.\n\t\t */\n\t\tif (prevProps.children !== children && !focusWithShortcut) {\n\t\t\tthis.setElements();\n\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t}\n\n\t\tif (focusWithShortcut) {\n\t\t\t/**\n\t\t\t * If the component within MrlRovingTabindex shows on the page before it should\n\t\t\t * be reached with a keyboard the prop `focusWithiShortcut` can be used to\n\t\t\t * achieve that. The conditions below handle the various states that a\n\t\t\t * component can experience under this scenario.\n\t\t\t */\n\t\t\tif (!isFocused && !prevProps.isFocused) {\n\t\t\t\t/**\n\t\t\t\t * The component was not focus before and is not ready to be focused on\n\t\t\t\t */\n\t\t\t\tthis.unsetTabbableElements();\n\t\t\t}\n\n\t\t\tif (prevProps.isFocused && !isFocused) {\n\t\t\t\t/**\n\t\t\t\t * The component was focused but is not focused anymore\n\t\t\t\t */\n\t\t\t\tthis.unsetTabbableElements();\n\t\t\t\t// Only call onBlur if focus has truly left the container\n\t\t\t\tif (this.ref && !this.ref.contains(document.activeElement)) {\n\t\t\t\t\tonBlur?.();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!prevProps.isFocused && isFocused) {\n\t\t\t\t/**\n\t\t\t\t * The component was not focused before and is ready to be focused\n\t\t\t\t */\n\t\t\t\tthis.setElements();\n\t\t\t\tthis.setElementFocus(this.getActiveElement());\n\t\t\t}\n\n\t\t\tif (prevProps.children !== children && !isFocused && !prevProps.isFocused) {\n\t\t\t\t/**\n\t\t\t\t * Children changed but component is not focused\n\t\t\t\t * Ensure all new elements have tabindex=-1 to prevent Tab key access\n\t\t\t\t */\n\t\t\t\tthis.setElements();\n\t\t\t\tthis.unsetTabbableElements();\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tprevProps.children !== children &&\n\t\t\t\tprevProps.isFocused &&\n\t\t\t\tisFocused &&\n\t\t\t\t!this.ref?.contains(document.activeElement)\n\t\t\t) {\n\t\t\t\t/**\n\t\t\t\t * While the component was focused an action was performed that\n\t\t\t\t * changed the elements of the component and focus was moved to\n\t\t\t\t * a different element on the page\n\t\t\t\t */\n\t\t\t\tthis.setElements();\n\t\t\t\tthis.setActiveElement(this.getActiveElement());\n\n\t\t\t\tif (this.getActiveElement()) {\n\t\t\t\t\t/**\n\t\t\t\t\t * The active element is still within the roving tabindex so focus\n\t\t\t\t\t * on the element that should receive focus\n\t\t\t\t\t */\n\t\t\t\t\tthis.setElementFocus(this.getActiveElement());\n\t\t\t\t} else {\n\t\t\t\t\t/**\n\t\t\t\t\t * The active element has been moved outside of the MrlRovingTabindex\n\t\t\t\t\t * component so reset the component\n\t\t\t\t\t */\n\t\t\t\t\t// Only call onBlur if focus has truly left the container\n\t\t\t\t\tif (this.ref && !this.ref.contains(document.activeElement)) {\n\t\t\t\t\t\tonBlur?.();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\thandleRef = (ref: HTMLDivElement): HTMLDivElement => {\n\t\tthis.ref = ref;\n\t\t// Set up focus listener when ref becomes available\n\t\tif (ref) {\n\t\t\tref.addEventListener('focusout', this.handleFocusOut);\n\t\t}\n\t\treturn ref;\n\t};\n\n\t/**\n\t * Handles focus out events to detect when focus leaves the roving tabindex container\n\t * @param {FocusEvent} event - the focus out event\n\t * @returns {void}\n\t */\n\thandleFocusOut = (event: FocusEvent): void => {\n\t\tconst { onBlur } = this.props;\n\t\tconst relatedTarget = (event as FocusEvent & { relatedTarget?: HTMLElement }).relatedTarget;\n\n\t\t// Check if focus is moving to an element outside the container\n\t\tif (relatedTarget && !this.ref?.contains(relatedTarget)) {\n\t\t\t// Focus has moved from inside the container to outside\n\t\t\tonBlur?.();\n\t\t}\n\t};\n\n\t/**\n\t * Sets component array of elements\n\t * @returns {void}\n\t */\n\tsetElements = (): void => {\n\t\tif (!this.ref) return;\n\t\tthis.elements = getTabbableElements(this.ref, this.selector);\n\t};\n\n\t/**\n\t * Queries for a single element matching the selector within the container.\n\t * @param selector - CSS selector to query\n\t * @returns The matching element or null\n\t */\n\tqueryElement = (selector: string): HTMLElement | null => {\n\t\treturn this.ref?.querySelector(selector) as HTMLElement | null;\n\t};\n\n\t/**\n\t * Gets the active element based on priority order:\n\t * 1. Element matching the custom `activeSelector` prop (e.g., custom radio elements)\n\t * 2. Element with `data-roving-active` attribute (programmatically set active)\n\t * 3. First element with `data-roving` attribute (default fallback)\n\t *\n\t * Disabled elements are excluded unless `allowDisabled` is true.\n\t * @returns The active HTML element, or undefined if none found\n\t */\n\tgetActiveElement = (): HTMLElement | undefined => {\n\t\tconst { activeSelector, allowDisabled = DEFAULT_ALLOW_DISABLED } = this.props;\n\t\tconst disabledFilter = allowDisabled ? '' : DISABLED_EXCLUSION;\n\n\t\t// Priority 1: Custom active selector (e.g., for radio button groups)\n\t\t// An element with the matching activeSelector prop (example usage: custom radio elements)\n\t\tif (activeSelector) {\n\t\t\tconst customActiveElement = this.queryElement(\n\t\t\t\t`${activeSelector}[data-roving]${disabledFilter}`\n\t\t\t);\n\t\t\tif (customActiveElement) return customActiveElement;\n\t\t}\n\n\t\t// Priority 2: Programmatically marked active element\n\t\t// An element with a `data-roving-active` attribute, indicating the current active element\n\t\tconst markedActiveElement = this.queryElement(\n\t\t\t`[data-roving][data-roving-active]${disabledFilter}`\n\t\t);\n\t\tif (markedActiveElement) return markedActiveElement;\n\n\t\t// Priority 3: First roving element (uses pre-built selector with disabled handling)\n\t\t// If no active element is found, the first instance of an element with `data-roving=\"true\"`\n\t\tconst firstRovingElement = this.ref?.querySelectorAll(this.selector)[0];\n\t\treturn firstRovingElement as HTMLElement | undefined;\n\t};\n\n\t/**\n\t * Sets an element to `tabindex=0` and sets all other elements to `tabindex=-1`\n\t * @param {HTMLElement | undefined} el - the element to set as active\n\t * @returns {void}\n\t */\n\tsetActiveElement = (el: HTMLElement | undefined): void => {\n\t\tif (!el) return;\n\n\t\tthis.unsetTabbableElements();\n\t\tel.setAttribute('tabindex', '0');\n\t};\n\n\t/**\n\t * Sets focus to a specific element\n\t * @param {HTMLElement | undefined} el - the element to set in focus\n\t * @returns {void}\n\t */\n\tsetElementFocus = (el: HTMLElement | undefined): void => {\n\t\tif (!el) return;\n\n\t\t/**\n\t\t * Why data-roving-active?\n\t\t *\n\t\t * We only want to set data-roving-active when 'setElementFocus' is triggered because we don't want [tabindex=0] to be mutally exclusive with\n\t\t * [data-roving-active]. An item with [data-roving-active] can exist without having [tabindex=0] and vice versa. We only want to set [data-roving-active]\n\t\t * intentionally when a user action has occured to change it. Such as a keyboard event or moving focus manually with Javascript.\n\t\t */\n\t\tconst current = this.getActiveElement();\n\t\tif (current) current.removeAttribute('data-roving-active');\n\t\tel.setAttribute('data-roving-active', 'true');\n\n\t\tthis.setActiveElement(el);\n\t\tel.focus();\n\t};\n\n\t/**\n\t * Sets focus to an element based on a direction (`forward` or `back`)\n\t * Disabled elements are already excluded from this.elements via CSS selector\n\t * @param {NavigationDirection} direction 'forward' | 'back'\n\t * @returns {void}\n\t */\n\tsetFocusByDirection = (direction: NavigationDirection): void => {\n\t\tconst itemsLen = this.elements.length;\n\n\t\tif (itemsLen > 0) {\n\t\t\tconst currentIndex = this.elements.indexOf(document.activeElement);\n\n\t\t\tconst directionSum = direction === 'back' ? -1 : 1;\n\t\t\tlet nextIndex = currentIndex + directionSum;\n\n\t\t\tif (direction === 'back') {\n\t\t\t\tnextIndex = nextIndex < 0 ? itemsLen - 1 : nextIndex;\n\t\t\t}\n\n\t\t\tif (direction === 'forward') {\n\t\t\t\tnextIndex = nextIndex >= itemsLen ? 0 : nextIndex;\n\t\t\t}\n\n\t\t\tthis.setElementFocus(this.elements[nextIndex] as HTMLElement);\n\t\t}\n\t};\n\n\t/**\n\t * Sets all tabindex for elements of this component to -1\n\t * Also ensures disabled elements (excluded from roving tabindex) have tabindex=-1\n\t * @returns {void}\n\t */\n\tunsetTabbableElements = (): void => {\n\t\tif (!this.elements) return;\n\n\t\t// Set tabindex=-1 for all roving tabindex elements\n\t\tthis.elements.forEach((el: Element | null) => {\n\t\t\tel && el.setAttribute('tabindex', '-1');\n\t\t});\n\n\t\t// Also set tabindex=-1 for disabled elements that are excluded from roving tabindex\n\t\t// This ensures disabled elements are not tabbable even though they're not in the navigation order\n\t\tif (!this.ref || this.props.allowDisabled) return;\n\n\t\tconst disabledElements = this.ref.querySelectorAll(\n\t\t\t`[data-roving][disabled], [data-roving][aria-disabled=\"true\"]`\n\t\t);\n\t\tdisabledElements.forEach((el) => {\n\t\t\tel.setAttribute('tabindex', '-1');\n\t\t});\n\t};\n\n\t/**\n\t * Will return `false` if the orientation param matches the\n\t * orientation of the component and the actively focused element has a menu or select\n\t * @param orientation : 'horizontal' | 'vertical'\n\t * @returns boolean\n\t */\n\tcanUseArrows = (orientation: RovingOrientation): boolean => {\n\t\tconst { activeElement } = document;\n\t\tconst role = activeElement?.getAttribute('role');\n\t\tconst hasMenuOrSelect =\n\t\t\tactiveElement?.getAttribute('aria-haspopup') === 'true' ||\n\t\t\trole === 'combobox' ||\n\t\t\trole === 'option' ||\n\t\t\trole === 'listbox';\n\n\t\treturn !(this.orientation === orientation && hasMenuOrSelect);\n\t};\n\n\thandleKeyUp = (e: React.KeyboardEvent): void => {\n\t\tconst { ignoreElements } = this.props;\n\t\tconst allowKeyPress = !ignoreElements ? true : !document.activeElement?.closest(ignoreElements);\n\n\t\tconst modifierPressed = e.ctrlKey || e.metaKey || e.shiftKey;\n\n\t\tif (modifierPressed) return;\n\n\t\t/**\n\t\t * If elements within MrlRovingTabindex are added after the component mounts\n\t\t * they will not automatically be a `part of this.elements`. This checks if\n\t\t * `this.elements` contains all elements that MrlRovingTabindex should be aware\n\t\t * of and will update `this.elements` if neccessary.\n\t\t */\n\t\tconst knownTabbableElements = this.elements;\n\t\tconst allTabbableElements = getTabbableElements(this.ref, this.selector);\n\n\t\tif (\n\t\t\tknownTabbableElements.length !== allTabbableElements.length ||\n\t\t\t!arraysEqual(knownTabbableElements, allTabbableElements)\n\t\t) {\n\t\t\tthis.setElements();\n\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t}\n\n\t\tconst isActiveRoving = this.getActiveElement() === document.activeElement;\n\n\t\tif (allowKeyPress && isActiveRoving) {\n\t\t\te.stopPropagation();\n\t\t\tswitch (e.key) {\n\t\t\t\tcase 'ArrowDown':\n\t\t\t\t\tif (this.canUseArrows('horizontal')) this.setFocusByDirection('forward');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\tif (this.canUseArrows('horizontal')) this.setFocusByDirection('back');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowRight':\n\t\t\t\t\tif (this.canUseArrows('vertical')) this.setFocusByDirection('forward');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowLeft':\n\t\t\t\t\tif (this.canUseArrows('vertical')) this.setFocusByDirection('back');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'End':\n\t\t\t\t\tthis.handleFocusedLast();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Home':\n\t\t\t\t\tthis.handleFocusedFirst();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\thandleFocusedFirst = (): void => this.setElementFocus(this.elements[0] as HTMLElement);\n\n\thandleFocusedLast = (): void =>\n\t\tthis.setElementFocus(this.elements[this.elements.length - 1] as HTMLElement);\n\n\thandleRefocus = (): void => {\n\t\tthis.setActiveElement(document.activeElement as HTMLElement);\n\t\tthis.props.onRefocus?.(false);\n\t};\n\n\t/**\n\t * Mounts the MrlRovingTabindex component\n\t * @returns {void}\n\t */\n\tmount(): void {\n\t\tconst { focusOnInit, focusWithShortcut, isFocused } = this.props;\n\n\t\tif (!focusWithShortcut) {\n\t\t\t// get initial set of elements for the component\n\t\t\tthis.setElements();\n\n\t\t\t// sets the first element of the component to tabindex=0 but does not move focus\n\t\t\t// this allows users to tab to the component naturally based on tab order\n\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t} else {\n\t\t\t// When focusWithShortcut is true, we need to set up elements\n\t\t\t// but only set tabindex values based on isFocused state\n\t\t\tthis.setElements();\n\n\t\t\tif (!isFocused) {\n\t\t\t\t// If not focused initially, set all elements to tabindex=-1\n\t\t\t\tthis.unsetTabbableElements();\n\t\t\t} else {\n\t\t\t\t// If focused initially, set the active element properly\n\t\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t\t}\n\t\t}\n\n\t\tif (focusOnInit && this.elements.length > 0) {\n\t\t\tif (focusOnInit === 'first') {\n\t\t\t\tthis.handleFocusedFirst();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.handleFocusedLast();\n\t\t}\n\t}\n\n\t/**\n\t * Renders the MrlRovingTabindex component\n\t * @returns {HTMLDivElement} - the rendered MrlRovingTabindex component\n\t */\n\trender(): JSX.Element {\n\t\t/* eslint-disable @typescript-eslint/no-unused-vars */\n\t\t// Destructure component-specific props to prevent them from being spread to the DOM\n\t\tconst {\n\t\t\tactiveSelector,\n\t\t\tallowDisabled,\n\t\t\tchildren,\n\t\t\tdelayMount,\n\t\t\tfocusOnInit,\n\t\t\tfocusWithShortcut,\n\t\t\tforceUpdate,\n\t\t\thasChildRoving,\n\t\t\tignoreElements,\n\t\t\tisFocused,\n\t\t\tonBlur,\n\t\t\tonRefocus,\n\t\t\torientation,\n\t\t\tqa,\n\t\t\t...rest\n\t\t} = this.props;\n\t\t/* eslint-enable @typescript-eslint/no-unused-vars */\n\n\t\tconst dataQa = `${qa || 'generic'}-roving`;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tclassName=\"helpers-roving-tabindex-container\"\n\t\t\t\tdata-qa={dataQa}\n\t\t\t\tonKeyUp={this.handleKeyUp}\n\t\t\t\tref={this.handleRef}\n\t\t\t\trole=\"presentation\"\n\t\t\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n\t\t\t\ttabIndex={-1}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport { MrlRovingTabindex };\n"],"names":["getTabbableElements","ref","selector","elements","querySelectorAll","Array","prototype","slice","call","arraysEqual","a","b","length","every","el","i","DEFAULT_ALLOW_DISABLED","DISABLED_EXCLUSION","NESTED_ROVING_EXCLUSION","buildSelector","allowDisabled","hasChildRoving","disabledPart","nestedPart","concat","MrlRovingTabindex","React","Component","constructor","props","_defineProperty","addEventListener","handleFocusOut","event","_this$ref","onBlur","relatedTarget","contains","_this$ref2","querySelector","_this$ref3","_this$props","activeSelector","_this$props$allowDisa","disabledFilter","customActiveElement","queryElement","markedActiveElement","firstRovingElement","unsetTabbableElements","setAttribute","current","getActiveElement","removeAttribute","setActiveElement","focus","direction","itemsLen","currentIndex","indexOf","document","activeElement","directionSum","nextIndex","setElementFocus","forEach","disabledElements","orientation","_document","role","getAttribute","hasMenuOrSelect","e","_document$activeEleme","ignoreElements","allowKeyPress","closest","modifierPressed","ctrlKey","metaKey","shiftKey","knownTabbableElements","allTabbableElements","setElements","isActiveRoving","stopPropagation","key","canUseArrows","setFocusByDirection","handleFocusedLast","handleFocusedFirst","_this$props$onRefocus","_this$props2","onRefocus","_props$allowDisabled","_props$hasChildRoving","componentDidMount","delayMount","setTimeout","mount","componentWillUnmount","removeEventListener","componentDidUpdate","prevProps","_this$props3","_this$props3$allowDis","children","focusWithShortcut","_this$props3$hasChild","isFocused","handleRefocus","_this$ref4","_this$props4","focusOnInit","render","_this$props5","forceUpdate","qa","rest","_objectWithoutProperties","_excluded","dataQa","createElement","_extends","className","onKeyUp","handleKeyUp","handleRef","tabIndex"],"mappings":";;;;AAIA;AACA;AACA;AACA;AACA;AACA;IACaA,mBAAmB,GAAGA,CAACC,GAAY,EAAEC,QAAgB,KAAoB;EACrF,IAAMC,QAAQ,GAAGF,GAAG,KAAA,IAAA,IAAHA,GAAG,KAAA,MAAA,GAAA,MAAA,GAAHA,GAAG,CAAEG,gBAAgB,CAACF,QAAQ,CAAC;AAChD,EAAA,IAAI,CAACC,QAAQ,EAAE,OAAO,EAAE;EACxB,OAAOE,KAAK,CAACC,SAAS,CAACC,KAAK,CAACC,IAAI,CAACL,QAAQ,CAAC;AAC5C;AAEA,IAAMM,WAAW,GAAGA,CAACC,CAAqB,EAAEC,CAAqB,KAChED,CAAC,CAACE,MAAM,KAAKD,CAAC,CAACC,MAAM,IAAIF,CAAC,CAACG,KAAK,CAAC,CAACC,EAAE,EAAEC,CAAC,KAAKD,EAAE,KAAKH,CAAC,CAACI,CAAC,CAAC,CAAC;AA2CzD;AACA;AACA;AACA;AACA,IAAMC,sBAAsB,GAAG,IAAI;;AAEnC;AACA;AACA;AACA;AACA,IAAMC,kBAAkB,GAAG,8CAA8C;;AAEzE;AACA;AACA;AACA;AACA,IAAMC,uBAAuB,GAC5B,2FAA2F;;AAE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CAAAgG,aAAA,CAAA,KAAA,EAAAC,QAAA,KACKL,IAAI,EAAA;AACRM,MAAAA,SAAS,EAAC,mCAAmC;AAC7C,MAAA,SAAA,EAASH,MAAO;MAChBI,OAAO,EAAE,IAAI,CAACC,WAAY;MAC1B7H,GAAG,EAAE,IAAI,CAAC8H,SAAU;AACpB1D,MAAAA,IAAI,EAAC;AACL;AAAA;AACA2D,MAAAA,QAAQ,EAAE;AAAG,KAAA,CAAA,EAEZtB,QACG,CAAC;AAER,EAAA;AACD;;;;"}
1
+ {"version":3,"file":"MrlRovingTabindex.js","sources":["../../../../../src/components/rovingTabindex/MrlRovingTabindex/MrlRovingTabindex.tsx"],"sourcesContent":["import * as React from 'react';\n\ntype RefType = HTMLElement | HTMLDivElement | null;\n\n/**\n * Gets tabbable elements in a given bit of the DOM, excluding disabled elements\n * @param {RefType} ref - the ref of the container\n * @param {string} selector - the selector to query (should already exclude disabled elements)\n * @returns {HTMLElement[]} - an array of tabbable HTML elements\n */\nexport const getTabbableElements = (ref: RefType, selector: string): HTMLElement[] => {\n\tconst elements = ref?.querySelectorAll(selector);\n\tif (!elements) return [];\n\treturn Array.prototype.slice.call(elements);\n};\n\nconst arraysEqual = (a: (Element | null)[], b: (Element | null)[]): boolean =>\n\ta.length === b.length && a.every((el, i) => el === b[i]);\n\nexport type FocusOnInitPosition = 'first' | 'last';\nexport interface RovingPropTypes {\n\t/** CSS selector of the element that starts as the tab stop, for example a checked custom radio. Falls back to `[data-roving-active]`, then to the first `[data-roving]` element. */\n\tactiveSelector?: string;\n\t/**\n\t * If true, disabled elements (with disabled attribute or aria-disabled=\"true\")\n\t * will be included in the roving tabindex. Defaults to true (disabled elements are included).\n\t */\n\tallowDisabled?: boolean;\n\tchildren: React.ReactNode;\n\t/**\n\t * delayMount is used to apply a delay to the mounting\n\t * of the RovingTabindex component. This can be helpful in\n\t * the event that a component's children have not been fully\n\t * rendered by the time the componentDidMount function is triggered\n\t */\n\tdelayMount?: number;\n\t/** Moves focus to the first or last element when the component mounts (after `delayMount`, if set). */\n\tfocusOnInit?: FocusOnInitPosition;\n\t/** Keeps every element out of the tab order until `isFocused` becomes true. For groups reached through a keyboard shortcut instead of Tab. */\n\tfocusWithShortcut?: boolean;\n\t/** Has no effect. Kept for backwards compatibility. */\n\tforceUpdate?: boolean;\n\t/** Set when another roving tabindex is nested inside this one, so its elements are left to the inner instance. */\n\thasChildRoving?: boolean;\n\t/** CSS selector. Keyboard navigation is ignored while focus is inside a matching element, for example a text input. */\n\tignoreElements?: string;\n\t/** With `focusWithShortcut`, whether the group holds focus. Turning it on focuses the active element; turning it off removes the group from the tab order. */\n\tisFocused?: boolean;\n\t/** Called when focus moves from the group to another element outside it. With `focusWithShortcut`, also called when `isFocused` turns off while focus is outside the group. */\n\tonBlur?: () => void;\n\t/** Pass it after moving focus into the group programmatically. On the next update the focused element becomes the tab stop and the callback receives `false`, so the consumer can drop it. */\n\tonRefocus?: (shouldRefocus: boolean) => void;\n\t/** Axis of the group, read once at mount. Every arrow key moves focus, but the keys across the axis are left to a focused element with `aria-haspopup=\"true\"` or role combobox, listbox or option. Defaults to horizontal. */\n\torientation?: RovingOrientation;\n\tqa?: string;\n}\n\nexport type RovingOrientation = 'horizontal' | 'vertical';\ntype NavigationDirection = 'forward' | 'back';\n\n/**\n * Default value for allowDisabled prop.\n * When true, disabled elements are included in the roving tabindex navigation.\n */\nconst DEFAULT_ALLOW_DISABLED = true;\n\n/**\n * CSS selector to exclude disabled elements.\n * Excludes both native disabled attribute and ARIA-compliant disabled elements.\n */\nconst DISABLED_EXCLUSION = ':not([disabled]):not([aria-disabled=\"true\"])';\n\n/**\n * CSS selector suffix to exclude nested roving tabindex elements.\n * Prevents deeply nested elements from being included in parent roving tabindex.\n */\nconst NESTED_ROVING_EXCLUSION =\n\t':not(.helpers-roving-tabindex-container .helpers-roving-tabindex-container [data-roving])';\n\n/**\n * Builds the appropriate CSS selector based on configuration.\n * @param allowDisabled - Whether to include disabled elements in the roving tabindex\n * @param hasChildRoving - Whether nested roving tabindex containers should be excluded\n * @returns CSS selector string for querying roving elements\n */\nconst buildSelector = (allowDisabled: boolean, hasChildRoving: boolean): string => {\n\tconst disabledPart = allowDisabled ? '' : DISABLED_EXCLUSION;\n\tconst nestedPart = hasChildRoving ? NESTED_ROVING_EXCLUSION : '';\n\treturn `[data-roving]${disabledPart}${nestedPart}`;\n};\n\n/**\n * Component to create a Roving Tabindex in the DOM\n * @returns {HTMLDivElement}\n */\nclass MrlRovingTabindex extends React.Component<RovingPropTypes> {\n\telements: Array<Element | null>;\n\torientation: RovingOrientation;\n\tref!: HTMLDivElement | null;\n\tselector: string;\n\n\t/**\n\t * MrlRovingTabindex class constructor\n\t * @param props - the MrlRovingTabindex props\n\t * @returns new instance\n\t */\n\tconstructor(props: RovingPropTypes) {\n\t\tsuper(props);\n\n\t\tconst { allowDisabled = DEFAULT_ALLOW_DISABLED, hasChildRoving = false, orientation } = props;\n\n\t\tthis.elements = [];\n\t\tthis.orientation = orientation || 'horizontal';\n\t\tthis.selector = buildSelector(allowDisabled, hasChildRoving);\n\t}\n\n\t/**\n\t * Runs when the MrlRovingTabindex component mounts\n\t */\n\tcomponentDidMount(): void {\n\t\tconst { delayMount } = this.props;\n\t\tif (delayMount) {\n\t\t\tsetTimeout(() => this.mount(), delayMount);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.mount();\n\t}\n\n\t/**\n\t * Runs when the MrlRovingTabindex component unmounts\n\t */\n\tcomponentWillUnmount(): void {\n\t\t// Remove focus event listener\n\t\tif (this.ref) {\n\t\t\tthis.ref.removeEventListener('focusout', this.handleFocusOut);\n\t\t}\n\t}\n\n\t/**\n\t * Runs when the MrlRovingTabindex component updates\n\t * @param {RovingPropTypes} prevProps - the props before the component updated\n\t */\n\tcomponentDidUpdate(prevProps: RovingPropTypes): void {\n\t\tconst {\n\t\t\tallowDisabled = DEFAULT_ALLOW_DISABLED,\n\t\t\tchildren,\n\t\t\tfocusWithShortcut,\n\t\t\thasChildRoving = false,\n\t\t\tisFocused,\n\t\t\tonBlur,\n\t\t\tonRefocus\n\t\t} = this.props;\n\n\t\t/**\n\t\t * If allowDisabled or hasChildRoving prop changes, rebuild the selector\n\t\t * and re-scan for elements to reflect the new configuration.\n\t\t */\n\t\tif (prevProps.allowDisabled !== allowDisabled || prevProps.hasChildRoving !== hasChildRoving) {\n\t\t\tthis.selector = buildSelector(allowDisabled, hasChildRoving);\n\t\t\tthis.setElements();\n\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t}\n\n\t\t/**\n\t\t * If focus is programatically moved to the MrlRovingTabindex\n\t\t * component from outside of the MrlRovingTabindex, passing\n\t\t * the prop of `onRefocus` will cause the component to go\n\t\t * through and make sure that only the active element\n\t\t * has a tabindex set to 0.\n\t\t */\n\t\tif (onRefocus) {\n\t\t\tthis.handleRefocus();\n\t\t}\n\n\t\t/**\n\t\t * When children change, re-scan for elements and update tabindex values.\n\t\t * This ensures that dynamically added/removed buttons are properly managed.\n\t\t */\n\t\tif (prevProps.children !== children && !focusWithShortcut) {\n\t\t\tthis.setElements();\n\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t}\n\n\t\tif (focusWithShortcut) {\n\t\t\t/**\n\t\t\t * If the component within MrlRovingTabindex shows on the page before it should\n\t\t\t * be reached with a keyboard the prop `focusWithiShortcut` can be used to\n\t\t\t * achieve that. The conditions below handle the various states that a\n\t\t\t * component can experience under this scenario.\n\t\t\t */\n\t\t\tif (!isFocused && !prevProps.isFocused) {\n\t\t\t\t/**\n\t\t\t\t * The component was not focus before and is not ready to be focused on\n\t\t\t\t */\n\t\t\t\tthis.unsetTabbableElements();\n\t\t\t}\n\n\t\t\tif (prevProps.isFocused && !isFocused) {\n\t\t\t\t/**\n\t\t\t\t * The component was focused but is not focused anymore\n\t\t\t\t */\n\t\t\t\tthis.unsetTabbableElements();\n\t\t\t\t// Only call onBlur if focus has truly left the container\n\t\t\t\tif (this.ref && !this.ref.contains(document.activeElement)) {\n\t\t\t\t\tonBlur?.();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!prevProps.isFocused && isFocused) {\n\t\t\t\t/**\n\t\t\t\t * The component was not focused before and is ready to be focused\n\t\t\t\t */\n\t\t\t\tthis.setElements();\n\t\t\t\tthis.setElementFocus(this.getActiveElement());\n\t\t\t}\n\n\t\t\tif (prevProps.children !== children && !isFocused && !prevProps.isFocused) {\n\t\t\t\t/**\n\t\t\t\t * Children changed but component is not focused\n\t\t\t\t * Ensure all new elements have tabindex=-1 to prevent Tab key access\n\t\t\t\t */\n\t\t\t\tthis.setElements();\n\t\t\t\tthis.unsetTabbableElements();\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tprevProps.children !== children &&\n\t\t\t\tprevProps.isFocused &&\n\t\t\t\tisFocused &&\n\t\t\t\t!this.ref?.contains(document.activeElement)\n\t\t\t) {\n\t\t\t\t/**\n\t\t\t\t * While the component was focused an action was performed that\n\t\t\t\t * changed the elements of the component and focus was moved to\n\t\t\t\t * a different element on the page\n\t\t\t\t */\n\t\t\t\tthis.setElements();\n\t\t\t\tthis.setActiveElement(this.getActiveElement());\n\n\t\t\t\tif (this.getActiveElement()) {\n\t\t\t\t\t/**\n\t\t\t\t\t * The active element is still within the roving tabindex so focus\n\t\t\t\t\t * on the element that should receive focus\n\t\t\t\t\t */\n\t\t\t\t\tthis.setElementFocus(this.getActiveElement());\n\t\t\t\t} else {\n\t\t\t\t\t/**\n\t\t\t\t\t * The active element has been moved outside of the MrlRovingTabindex\n\t\t\t\t\t * component so reset the component\n\t\t\t\t\t */\n\t\t\t\t\t// Only call onBlur if focus has truly left the container\n\t\t\t\t\tif (this.ref && !this.ref.contains(document.activeElement)) {\n\t\t\t\t\t\tonBlur?.();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\thandleRef = (ref: HTMLDivElement): HTMLDivElement => {\n\t\tthis.ref = ref;\n\t\t// Set up focus listener when ref becomes available\n\t\tif (ref) {\n\t\t\tref.addEventListener('focusout', this.handleFocusOut);\n\t\t}\n\t\treturn ref;\n\t};\n\n\t/**\n\t * Handles focus out events to detect when focus leaves the roving tabindex container\n\t * @param {FocusEvent} event - the focus out event\n\t * @returns {void}\n\t */\n\thandleFocusOut = (event: FocusEvent): void => {\n\t\tconst { onBlur } = this.props;\n\t\tconst relatedTarget = (event as FocusEvent & { relatedTarget?: HTMLElement }).relatedTarget;\n\n\t\t// Check if focus is moving to an element outside the container\n\t\tif (relatedTarget && !this.ref?.contains(relatedTarget)) {\n\t\t\t// Focus has moved from inside the container to outside\n\t\t\tonBlur?.();\n\t\t}\n\t};\n\n\t/**\n\t * Sets component array of elements\n\t * @returns {void}\n\t */\n\tsetElements = (): void => {\n\t\tif (!this.ref) return;\n\t\tthis.elements = getTabbableElements(this.ref, this.selector);\n\t};\n\n\t/**\n\t * Queries for a single element matching the selector within the container.\n\t * @param selector - CSS selector to query\n\t * @returns The matching element or null\n\t */\n\tqueryElement = (selector: string): HTMLElement | null => {\n\t\treturn this.ref?.querySelector(selector) as HTMLElement | null;\n\t};\n\n\t/**\n\t * Gets the active element based on priority order:\n\t * 1. Element matching the custom `activeSelector` prop (e.g., custom radio elements)\n\t * 2. Element with `data-roving-active` attribute (programmatically set active)\n\t * 3. First element with `data-roving` attribute (default fallback)\n\t *\n\t * Disabled elements are excluded unless `allowDisabled` is true.\n\t * @returns The active HTML element, or undefined if none found\n\t */\n\tgetActiveElement = (): HTMLElement | undefined => {\n\t\tconst { activeSelector, allowDisabled = DEFAULT_ALLOW_DISABLED } = this.props;\n\t\tconst disabledFilter = allowDisabled ? '' : DISABLED_EXCLUSION;\n\n\t\t// Priority 1: Custom active selector (e.g., for radio button groups)\n\t\t// An element with the matching activeSelector prop (example usage: custom radio elements)\n\t\tif (activeSelector) {\n\t\t\tconst customActiveElement = this.queryElement(\n\t\t\t\t`${activeSelector}[data-roving]${disabledFilter}`\n\t\t\t);\n\t\t\tif (customActiveElement) return customActiveElement;\n\t\t}\n\n\t\t// Priority 2: Programmatically marked active element\n\t\t// An element with a `data-roving-active` attribute, indicating the current active element\n\t\tconst markedActiveElement = this.queryElement(\n\t\t\t`[data-roving][data-roving-active]${disabledFilter}`\n\t\t);\n\t\tif (markedActiveElement) return markedActiveElement;\n\n\t\t// Priority 3: First roving element (uses pre-built selector with disabled handling)\n\t\t// If no active element is found, the first instance of an element with `data-roving=\"true\"`\n\t\tconst firstRovingElement = this.ref?.querySelectorAll(this.selector)[0];\n\t\treturn firstRovingElement as HTMLElement | undefined;\n\t};\n\n\t/**\n\t * Sets an element to `tabindex=0` and sets all other elements to `tabindex=-1`\n\t * @param {HTMLElement | undefined} el - the element to set as active\n\t * @returns {void}\n\t */\n\tsetActiveElement = (el: HTMLElement | undefined): void => {\n\t\tif (!el) return;\n\n\t\tthis.unsetTabbableElements();\n\t\tel.setAttribute('tabindex', '0');\n\t};\n\n\t/**\n\t * Sets focus to a specific element\n\t * @param {HTMLElement | undefined} el - the element to set in focus\n\t * @returns {void}\n\t */\n\tsetElementFocus = (el: HTMLElement | undefined): void => {\n\t\tif (!el) return;\n\n\t\t/**\n\t\t * Why data-roving-active?\n\t\t *\n\t\t * We only want to set data-roving-active when 'setElementFocus' is triggered because we don't want [tabindex=0] to be mutally exclusive with\n\t\t * [data-roving-active]. An item with [data-roving-active] can exist without having [tabindex=0] and vice versa. We only want to set [data-roving-active]\n\t\t * intentionally when a user action has occured to change it. Such as a keyboard event or moving focus manually with Javascript.\n\t\t */\n\t\tconst current = this.getActiveElement();\n\t\tif (current) current.removeAttribute('data-roving-active');\n\t\tel.setAttribute('data-roving-active', 'true');\n\n\t\tthis.setActiveElement(el);\n\t\tel.focus();\n\t};\n\n\t/**\n\t * Sets focus to an element based on a direction (`forward` or `back`)\n\t * Disabled elements are already excluded from this.elements via CSS selector\n\t * @param {NavigationDirection} direction 'forward' | 'back'\n\t * @returns {void}\n\t */\n\tsetFocusByDirection = (direction: NavigationDirection): void => {\n\t\tconst itemsLen = this.elements.length;\n\n\t\tif (itemsLen > 0) {\n\t\t\tconst currentIndex = this.elements.indexOf(document.activeElement);\n\n\t\t\tconst directionSum = direction === 'back' ? -1 : 1;\n\t\t\tlet nextIndex = currentIndex + directionSum;\n\n\t\t\tif (direction === 'back') {\n\t\t\t\tnextIndex = nextIndex < 0 ? itemsLen - 1 : nextIndex;\n\t\t\t}\n\n\t\t\tif (direction === 'forward') {\n\t\t\t\tnextIndex = nextIndex >= itemsLen ? 0 : nextIndex;\n\t\t\t}\n\n\t\t\tthis.setElementFocus(this.elements[nextIndex] as HTMLElement);\n\t\t}\n\t};\n\n\t/**\n\t * Sets all tabindex for elements of this component to -1\n\t * Also ensures disabled elements (excluded from roving tabindex) have tabindex=-1\n\t * @returns {void}\n\t */\n\tunsetTabbableElements = (): void => {\n\t\tif (!this.elements) return;\n\n\t\t// Set tabindex=-1 for all roving tabindex elements\n\t\tthis.elements.forEach((el: Element | null) => {\n\t\t\tel && el.setAttribute('tabindex', '-1');\n\t\t});\n\n\t\t// Also set tabindex=-1 for disabled elements that are excluded from roving tabindex\n\t\t// This ensures disabled elements are not tabbable even though they're not in the navigation order\n\t\tif (!this.ref || this.props.allowDisabled) return;\n\n\t\tconst disabledElements = this.ref.querySelectorAll(\n\t\t\t`[data-roving][disabled], [data-roving][aria-disabled=\"true\"]`\n\t\t);\n\t\tdisabledElements.forEach((el) => {\n\t\t\tel.setAttribute('tabindex', '-1');\n\t\t});\n\t};\n\n\t/**\n\t * Will return `false` if the orientation param matches the\n\t * orientation of the component and the actively focused element has a menu or select\n\t * @param orientation : 'horizontal' | 'vertical'\n\t * @returns boolean\n\t */\n\tcanUseArrows = (orientation: RovingOrientation): boolean => {\n\t\tconst { activeElement } = document;\n\t\tconst role = activeElement?.getAttribute('role');\n\t\tconst hasMenuOrSelect =\n\t\t\tactiveElement?.getAttribute('aria-haspopup') === 'true' ||\n\t\t\trole === 'combobox' ||\n\t\t\trole === 'option' ||\n\t\t\trole === 'listbox';\n\n\t\treturn !(this.orientation === orientation && hasMenuOrSelect);\n\t};\n\n\thandleKeyUp = (e: React.KeyboardEvent): void => {\n\t\tconst { ignoreElements } = this.props;\n\t\tconst allowKeyPress = !ignoreElements ? true : !document.activeElement?.closest(ignoreElements);\n\n\t\tconst modifierPressed = e.ctrlKey || e.metaKey || e.shiftKey;\n\n\t\tif (modifierPressed) return;\n\n\t\t/**\n\t\t * If elements within MrlRovingTabindex are added after the component mounts\n\t\t * they will not automatically be a `part of this.elements`. This checks if\n\t\t * `this.elements` contains all elements that MrlRovingTabindex should be aware\n\t\t * of and will update `this.elements` if neccessary.\n\t\t */\n\t\tconst knownTabbableElements = this.elements;\n\t\tconst allTabbableElements = getTabbableElements(this.ref, this.selector);\n\n\t\tif (\n\t\t\tknownTabbableElements.length !== allTabbableElements.length ||\n\t\t\t!arraysEqual(knownTabbableElements, allTabbableElements)\n\t\t) {\n\t\t\tthis.setElements();\n\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t}\n\n\t\tconst isActiveRoving = this.getActiveElement() === document.activeElement;\n\n\t\tif (allowKeyPress && isActiveRoving) {\n\t\t\te.stopPropagation();\n\t\t\tswitch (e.key) {\n\t\t\t\tcase 'ArrowDown':\n\t\t\t\t\tif (this.canUseArrows('horizontal')) this.setFocusByDirection('forward');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\tif (this.canUseArrows('horizontal')) this.setFocusByDirection('back');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowRight':\n\t\t\t\t\tif (this.canUseArrows('vertical')) this.setFocusByDirection('forward');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowLeft':\n\t\t\t\t\tif (this.canUseArrows('vertical')) this.setFocusByDirection('back');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'End':\n\t\t\t\t\tthis.handleFocusedLast();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Home':\n\t\t\t\t\tthis.handleFocusedFirst();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\thandleFocusedFirst = (): void => this.setElementFocus(this.elements[0] as HTMLElement);\n\n\thandleFocusedLast = (): void =>\n\t\tthis.setElementFocus(this.elements[this.elements.length - 1] as HTMLElement);\n\n\thandleRefocus = (): void => {\n\t\tthis.setActiveElement(document.activeElement as HTMLElement);\n\t\tthis.props.onRefocus?.(false);\n\t};\n\n\t/**\n\t * Mounts the MrlRovingTabindex component\n\t * @returns {void}\n\t */\n\tmount(): void {\n\t\tconst { focusOnInit, focusWithShortcut, isFocused } = this.props;\n\n\t\tif (!focusWithShortcut) {\n\t\t\t// get initial set of elements for the component\n\t\t\tthis.setElements();\n\n\t\t\t// sets the first element of the component to tabindex=0 but does not move focus\n\t\t\t// this allows users to tab to the component naturally based on tab order\n\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t} else {\n\t\t\t// When focusWithShortcut is true, we need to set up elements\n\t\t\t// but only set tabindex values based on isFocused state\n\t\t\tthis.setElements();\n\n\t\t\tif (!isFocused) {\n\t\t\t\t// If not focused initially, set all elements to tabindex=-1\n\t\t\t\tthis.unsetTabbableElements();\n\t\t\t} else {\n\t\t\t\t// If focused initially, set the active element properly\n\t\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t\t}\n\t\t}\n\n\t\tif (focusOnInit && this.elements.length > 0) {\n\t\t\tif (focusOnInit === 'first') {\n\t\t\t\tthis.handleFocusedFirst();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.handleFocusedLast();\n\t\t}\n\t}\n\n\t/**\n\t * Renders the MrlRovingTabindex component\n\t * @returns {HTMLDivElement} - the rendered MrlRovingTabindex component\n\t */\n\trender(): JSX.Element {\n\t\t/* eslint-disable @typescript-eslint/no-unused-vars */\n\t\t// Destructure component-specific props to prevent them from being spread to the DOM\n\t\tconst {\n\t\t\tactiveSelector,\n\t\t\tallowDisabled,\n\t\t\tchildren,\n\t\t\tdelayMount,\n\t\t\tfocusOnInit,\n\t\t\tfocusWithShortcut,\n\t\t\tforceUpdate,\n\t\t\thasChildRoving,\n\t\t\tignoreElements,\n\t\t\tisFocused,\n\t\t\tonBlur,\n\t\t\tonRefocus,\n\t\t\torientation,\n\t\t\tqa,\n\t\t\t...rest\n\t\t} = this.props;\n\t\t/* eslint-enable @typescript-eslint/no-unused-vars */\n\n\t\tconst dataQa = `${qa || 'generic'}-roving`;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tclassName=\"helpers-roving-tabindex-container\"\n\t\t\t\tdata-qa={dataQa}\n\t\t\t\tonKeyUp={this.handleKeyUp}\n\t\t\t\tref={this.handleRef}\n\t\t\t\trole=\"presentation\"\n\t\t\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n\t\t\t\ttabIndex={-1}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport { MrlRovingTabindex };\n"],"names":["getTabbableElements","ref","selector","elements","querySelectorAll","Array","prototype","slice","call","arraysEqual","a","b","length","every","el","i","DEFAULT_ALLOW_DISABLED","DISABLED_EXCLUSION","NESTED_ROVING_EXCLUSION","buildSelector","allowDisabled","hasChildRoving","disabledPart","nestedPart","concat","MrlRovingTabindex","React","Component","constructor","props","_defineProperty","addEventListener","handleFocusOut","event","_this$ref","onBlur","relatedTarget","contains","_this$ref2","querySelector","_this$ref3","_this$props","activeSelector","_this$props$allowDisa","disabledFilter","customActiveElement","queryElement","markedActiveElement","firstRovingElement","unsetTabbableElements","setAttribute","current","getActiveElement","removeAttribute","setActiveElement","focus","direction","itemsLen","currentIndex","indexOf","document","activeElement","directionSum","nextIndex","setElementFocus","forEach","disabledElements","orientation","_document","role","getAttribute","hasMenuOrSelect","e","_document$activeEleme","ignoreElements","allowKeyPress","closest","modifierPressed","ctrlKey","metaKey","shiftKey","knownTabbableElements","allTabbableElements","setElements","isActiveRoving","stopPropagation","key","canUseArrows","setFocusByDirection","handleFocusedLast","handleFocusedFirst","_this$props$onRefocus","_this$props2","onRefocus","_props$allowDisabled","_props$hasChildRoving","componentDidMount","delayMount","setTimeout","mount","componentWillUnmount","removeEventListener","componentDidUpdate","prevProps","_this$props3","_this$props3$allowDis","children","focusWithShortcut","_this$props3$hasChild","isFocused","handleRefocus","_this$ref4","_this$props4","focusOnInit","render","_this$props5","forceUpdate","qa","rest","_objectWithoutProperties","_excluded","dataQa","createElement","_extends","className","onKeyUp","handleKeyUp","handleRef","tabIndex"],"mappings":";;;;AAIA;AACA;AACA;AACA;AACA;AACA;IACaA,mBAAmB,GAAGA,CAACC,GAAY,EAAEC,QAAgB,KAAoB;EACrF,IAAMC,QAAQ,GAAGF,GAAG,KAAA,IAAA,IAAHA,GAAG,KAAA,MAAA,GAAA,MAAA,GAAHA,GAAG,CAAEG,gBAAgB,CAACF,QAAQ,CAAC;AAChD,EAAA,IAAI,CAACC,QAAQ,EAAE,OAAO,EAAE;EACxB,OAAOE,KAAK,CAACC,SAAS,CAACC,KAAK,CAACC,IAAI,CAACL,QAAQ,CAAC;AAC5C;AAEA,IAAMM,WAAW,GAAGA,CAACC,CAAqB,EAAEC,CAAqB,KAChED,CAAC,CAACE,MAAM,KAAKD,CAAC,CAACC,MAAM,IAAIF,CAAC,CAACG,KAAK,CAAC,CAACC,EAAE,EAAEC,CAAC,KAAKD,EAAE,KAAKH,CAAC,CAACI,CAAC,CAAC,CAAC;AA2CzD;AACA;AACA;AACA;AACA,IAAMC,sBAAsB,GAAG,IAAI;;AAEnC;AACA;AACA;AACA;AACA,IAAMC,kBAAkB,GAAG,8CAA8C;;AAEzE;AACA;AACA;AACA;AACA,IAAMC,uBAAuB,GAC5B,2FAA2F;;AAE5F;AACA;AACA;AACA;AACA;AACA;AACA,IAAMC,aAAa,GAAGA,CAACC,aAAsB,EAAEC,cAAuB,KAAa;AAClF,EAAA,IAAMC,YAAY,GAAGF,aAAa,GAAG,EAAE,GAAGH,kBAAkB;AAC5D,EAAA,IAAMM,UAAU,GAAGF,cAAc,GAAGH,uBAAuB,G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,MAAAA,IAAI,EAAC;AACL;AAAA;AACA2D,MAAAA,QAAQ,EAAE;AAAG,KAAA,CAAA,EAEZtB,QACG,CAAC;AAER,EAAA;AACD;;;;"}
@@ -1,4 +1,4 @@
1
- var TOOLKIT_VERSION = "4.84.0";
1
+ var TOOLKIT_VERSION = "4.84.1";
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.84.0\";"],"names":["TOOLKIT_VERSION"],"mappings":"AAAO,IAAMA,eAAe,GAAG;;;;"}
1
+ {"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const TOOLKIT_VERSION = \"4.84.1\";"],"names":["TOOLKIT_VERSION"],"mappings":"AAAO,IAAMA,eAAe,GAAG;;;;"}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- type AvatarKind = (typeof avatarValues.kind)[number];
3
- type AvatarSize = (typeof avatarValues.size)[number];
2
+ export type AvatarKind = (typeof avatarValues.kind)[number];
3
+ export type AvatarSize = (typeof avatarValues.size)[number];
4
4
  interface avatarDefaults {
5
5
  kind: AvatarKind;
6
6
  size: AvatarSize;
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { MrlPopoverProps } from '../../popover';
3
3
  export type MrlCalloutPopoverProps = Omit<MrlPopoverProps, 'children' | 'actionState' | 'isSubMenu' | 'triggerRef' | 'kind'>;
4
- interface MrlCalloutCTA {
4
+ export interface MrlCalloutCTA {
5
5
  onClick: () => void;
6
6
  dataQa?: string;
7
7
  text: string;
@@ -45,4 +45,3 @@ export interface MrlCalloutProps extends MrlCalloutPopoverProps {
45
45
  * @returns {React.ReactElement} The MrlCallout component.
46
46
  */
47
47
  export declare const MrlCallout: (props: MrlCalloutProps) => React.ReactElement;
48
- export {};
@@ -1,6 +1,6 @@
1
1
  import { AttrsObject } from '../../../../utils';
2
2
  import './MrlTextarea.global.scss';
3
- type MrlTextareaState = 'default' | 'disabled' | 'error' | 'read-only';
3
+ export type MrlTextareaState = 'default' | 'disabled' | 'error' | 'read-only';
4
4
  interface MrlTextareaProps {
5
5
  /** Applies additional HTML attributes to the textarea element */
6
6
  attrs?: AttrsObject;
@@ -28,14 +28,14 @@ export type NumCols = 0 | ColSpan;
28
28
  * offset?: number
29
29
  * }
30
30
  */
31
- type GridClassConfig = {
31
+ export type GridClassConfig = {
32
32
  col?: ColSpan;
33
33
  offset?: OffsetSpan;
34
34
  };
35
35
  /**
36
36
  * Options to configure the number of columns to span on different screen sizes.
37
37
  */
38
- type ColumnConfig = ColSpan | 'auto' | GridClassConfig | undefined;
38
+ export type ColumnConfig = ColSpan | 'auto' | GridClassConfig | undefined;
39
39
  export interface GridColumns {
40
40
  /**
41
41
  * Columns that are the same from the smallest of devices to the largest.
@@ -111,4 +111,3 @@ export type GridBaseProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'role'>
111
111
  */
112
112
  role?: SafeLayoutRole;
113
113
  };
114
- export {};
@@ -1,4 +1,4 @@
1
1
  export * from './MrlGrid';
2
2
  export * from './MrlRow';
3
3
  export * from './MrlCol';
4
- export type { AlignOptions, ColSpan, GridColumns, GutterSizes, JustifyOptions, NumCols, OffsetSpan, SafeLayoutRole } from './constants';
4
+ export type { AlignOptions, ColSpan, ColumnConfig, GridClassConfig, GridColumns, GutterSizes, JustifyOptions, NumCols, OffsetSpan, SafeLayoutRole } from './constants';
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- type AriaRelevant = 'additions' | 'all' | 'removals' | 'text' | 'additions text' | undefined;
2
+ export type AriaRelevant = 'additions' | 'all' | 'removals' | 'text' | 'additions text' | undefined;
3
3
  export interface MrlLiveRegionProps extends React.HTMLAttributes<HTMLParagraphElement> {
4
4
  /** Sets `aria-atomic`: announce the whole region on every change instead of only the changed part. */
5
5
  ariaAtomic?: boolean;
@@ -22,4 +22,3 @@ export interface MrlLiveRegionProps extends React.HTMLAttributes<HTMLParagraphEl
22
22
  * @returns The live region component.
23
23
  */
24
24
  export declare const MrlLiveRegion: ({ ariaAtomic, ariaLive, ariaRelevant, id, srContent, visible, shouldClearContent, ...props }: MrlLiveRegionProps) => React.ReactElement;
25
- export {};
@@ -1 +1 @@
1
- export { MrlLiveRegion } from './MrlLiveRegion';
1
+ export { MrlLiveRegion, type AriaRelevant } from './MrlLiveRegion';
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { PortalProps } from '../../portal/MrlPortal';
3
3
  import { MenuPosition, MenuAlignment, ActionState, CustomMenuPosition } from '../../menu/constants';
4
- type RenderPropFn = ({ closeMenu }: {
4
+ export type RenderPropFn = ({ closeMenu }: {
5
5
  closeMenu: () => void;
6
6
  }) => JSX.Element;
7
7
  export interface MrlPopoverProps {
@@ -140,4 +140,3 @@ export declare function MrlPopover({ alignment, ariaLabel, ariaLabelledBy, child
140
140
  export declare namespace MrlPopover {
141
141
  var componentType: string;
142
142
  }
143
- export {};
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { PORTAL_LAYERS } from '../../utils/layers';
3
- type PortalLayer = (typeof PORTAL_LAYERS)[keyof typeof PORTAL_LAYERS];
3
+ export type PortalLayer = (typeof PORTAL_LAYERS)[keyof typeof PORTAL_LAYERS];
4
4
  export interface PortalProps extends React.HTMLAttributes<HTMLDivElement> {
5
5
  children: React.ReactNode;
6
6
  className?: string;
@@ -18,4 +18,3 @@ export declare const MRL_PORTAL_ID: "mrl-root-portal";
18
18
  * @returns MrlPortal component
19
19
  */
20
20
  export declare const MrlPortal: ({ children, className, id, layer, ...remainingProps }: PortalProps) => React.ReactElement | null;
21
- export {};
@@ -44,7 +44,7 @@ export interface RovingPropTypes {
44
44
  orientation?: RovingOrientation;
45
45
  qa?: string;
46
46
  }
47
- type RovingOrientation = 'horizontal' | 'vertical';
47
+ export type RovingOrientation = 'horizontal' | 'vertical';
48
48
  type NavigationDirection = 'forward' | 'back';
49
49
  /**
50
50
  * Component to create a Roving Tabindex in the DOM
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muraldevkit/ui-toolkit",
3
- "version": "4.84.0",
3
+ "version": "4.84.1",
4
4
  "description": "Mural's UI Toolkit",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",