@muraldevkit/ui-toolkit 4.76.1 → 4.77.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/cjs/components/button/MrlButton/MrlButton.js +16 -8
  2. package/dist/cjs/components/button/MrlButton/MrlButton.js.map +1 -1
  3. package/dist/cjs/components/filter/MrlFilterItem/MrlFilterItem.js +2 -1
  4. package/dist/cjs/components/filter/MrlFilterItem/MrlFilterItem.js.map +1 -1
  5. package/dist/cjs/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js.map +1 -1
  6. package/dist/cjs/components/menu/MrlMenuGroup/MrlMenuGroup.js +4 -1
  7. package/dist/cjs/components/menu/MrlMenuGroup/MrlMenuGroup.js.map +1 -1
  8. package/dist/cjs/components/menu/MrlMenuItem/MrlMenuItem.js +2 -1
  9. package/dist/cjs/components/menu/MrlMenuItem/MrlMenuItem.js.map +1 -1
  10. package/dist/cjs/components/menu/MrlMenuItemLink/MrlMenuItemLink.js +8 -4
  11. package/dist/cjs/components/menu/MrlMenuItemLink/MrlMenuItemLink.js.map +1 -1
  12. package/dist/cjs/components/modal/MrlModalContent/MrlModalContent.js +1 -1
  13. package/dist/cjs/components/modal/MrlModalContent/MrlModalContent.js.map +1 -1
  14. package/dist/cjs/components/modal/MrlModalFooter/MrlModalFooter.js +2 -1
  15. package/dist/cjs/components/modal/MrlModalFooter/MrlModalFooter.js.map +1 -1
  16. package/dist/cjs/components/modal/MrlModalHeader/MrlModalHeader.js +1 -1
  17. package/dist/cjs/components/modal/MrlModalHeader/MrlModalHeader.js.map +1 -1
  18. package/dist/cjs/components/panel/MrlPanel/MrlPanel.js.map +1 -1
  19. package/dist/cjs/components/panel/MrlPanelFooter/MrlPanelFooter.js +2 -1
  20. package/dist/cjs/components/panel/MrlPanelFooter/MrlPanelFooter.js.map +1 -1
  21. package/dist/cjs/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.js +2 -1
  22. package/dist/cjs/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.js.map +1 -1
  23. package/dist/cjs/version.js +1 -1
  24. package/dist/cjs/version.js.map +1 -1
  25. package/dist/components/button/MrlButton/MrlButton.d.ts +6 -0
  26. package/dist/components/filter/MrlFilterItem/MrlFilterItem.d.ts +6 -3
  27. package/dist/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.d.ts +10 -2
  28. package/dist/components/menu/MrlMenuGroup/MrlMenuGroup.d.ts +15 -1
  29. package/dist/components/menu/MrlMenuItem/MrlMenuItem.d.ts +14 -6
  30. package/dist/components/menu/MrlMenuItemLink/MrlMenuItemLink.d.ts +16 -7
  31. package/dist/components/modal/MrlModalContent/MrlModalContent.d.ts +5 -2
  32. package/dist/components/modal/MrlModalFooter/MrlModalFooter.d.ts +4 -2
  33. package/dist/components/modal/MrlModalHeader/MrlModalHeader.d.ts +4 -3
  34. package/dist/components/panel/MrlPanel/MrlPanel.d.ts +2 -1
  35. package/dist/components/panel/MrlPanelFooter/MrlPanelFooter.d.ts +6 -3
  36. package/dist/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.d.ts +4 -2
  37. package/dist/esm/components/button/MrlButton/MrlButton.js +16 -8
  38. package/dist/esm/components/button/MrlButton/MrlButton.js.map +1 -1
  39. package/dist/esm/components/filter/MrlFilterItem/MrlFilterItem.js +2 -1
  40. package/dist/esm/components/filter/MrlFilterItem/MrlFilterItem.js.map +1 -1
  41. package/dist/esm/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js.map +1 -1
  42. package/dist/esm/components/menu/MrlMenuGroup/MrlMenuGroup.js +4 -1
  43. package/dist/esm/components/menu/MrlMenuGroup/MrlMenuGroup.js.map +1 -1
  44. package/dist/esm/components/menu/MrlMenuItem/MrlMenuItem.js +2 -1
  45. package/dist/esm/components/menu/MrlMenuItem/MrlMenuItem.js.map +1 -1
  46. package/dist/esm/components/menu/MrlMenuItemLink/MrlMenuItemLink.js +8 -4
  47. package/dist/esm/components/menu/MrlMenuItemLink/MrlMenuItemLink.js.map +1 -1
  48. package/dist/esm/components/modal/MrlModalContent/MrlModalContent.js +1 -1
  49. package/dist/esm/components/modal/MrlModalContent/MrlModalContent.js.map +1 -1
  50. package/dist/esm/components/modal/MrlModalFooter/MrlModalFooter.js +2 -1
  51. package/dist/esm/components/modal/MrlModalFooter/MrlModalFooter.js.map +1 -1
  52. package/dist/esm/components/modal/MrlModalHeader/MrlModalHeader.js +1 -1
  53. package/dist/esm/components/modal/MrlModalHeader/MrlModalHeader.js.map +1 -1
  54. package/dist/esm/components/panel/MrlPanel/MrlPanel.js.map +1 -1
  55. package/dist/esm/components/panel/MrlPanelFooter/MrlPanelFooter.js +2 -1
  56. package/dist/esm/components/panel/MrlPanelFooter/MrlPanelFooter.js.map +1 -1
  57. package/dist/esm/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.js +2 -1
  58. package/dist/esm/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.js.map +1 -1
  59. package/dist/esm/version.js +1 -1
  60. package/dist/esm/version.js.map +1 -1
  61. package/dist/types/components/button/MrlButton/MrlButton.d.ts +6 -0
  62. package/dist/types/components/filter/MrlFilterItem/MrlFilterItem.d.ts +6 -3
  63. package/dist/types/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.d.ts +10 -2
  64. package/dist/types/components/menu/MrlMenuGroup/MrlMenuGroup.d.ts +15 -1
  65. package/dist/types/components/menu/MrlMenuItem/MrlMenuItem.d.ts +14 -6
  66. package/dist/types/components/menu/MrlMenuItemLink/MrlMenuItemLink.d.ts +16 -7
  67. package/dist/types/components/modal/MrlModalContent/MrlModalContent.d.ts +5 -2
  68. package/dist/types/components/modal/MrlModalFooter/MrlModalFooter.d.ts +4 -2
  69. package/dist/types/components/modal/MrlModalHeader/MrlModalHeader.d.ts +4 -3
  70. package/dist/types/components/panel/MrlPanel/MrlPanel.d.ts +2 -1
  71. package/dist/types/components/panel/MrlPanelFooter/MrlPanelFooter.d.ts +6 -3
  72. package/dist/types/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.d.ts +4 -2
  73. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MrlPanel.js","sources":["../../../../../src/components/panel/MrlPanel/MrlPanel.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport styles from './MrlPanel.module.scss';\nimport { MrlIconButton } from '../../button';\nimport { MrlSvg } from '../../svg';\nimport { close } from '@muraldevkit/ds-icons';\nimport { MrlFocusTrap } from '../../focus-trap';\nimport { MrlText, MrlTextHeading } from '../../text';\nimport { MrlDivider } from '../../divider';\nimport { MrlPanelContext } from '../MrlPanelContext';\nimport { useHasFocusableDescendant } from '../../../hooks/useHasFocusableDescendant';\nimport { useScrollbarInfo } from '../../../hooks/useScrollbarInfo';\nimport { getUniqueId } from '../../../utils';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\n/**\n * Props for the MrlPanel component.\n */\ninterface MrlPanelProps extends React.ComponentPropsWithRef<'div'> {\n\t/**\n\t * A string value used for data-qa attribute.\n\t */\n\t['data-qa']?: string;\n\n\t/**\n\t * Callback function that is called when the panel is closed.\n\t */\n\tonClose?: () => void;\n\n\t/**\n\t * The custom header element to be rendered in the panel.\n\t * When a custom header is used developers need to provide th aria-label and aria-describedby.\n\t */\n\theader?: React.ReactNode;\n\n\t/**\n\t * The custom top actions to be rendered in the panel header.\n\t * By default top actions are rendered on the right side of the title and include a MrlDivider at the end.\n\t * The close button should not be included as part of the top actions.\n\t */\n\ttopActions?: React.ReactNode;\n\n\t/**\n\t * The title of the panel.\n\t */\n\ttitle?: string;\n\n\t/**\n\t * The description of the panel.\n\t */\n\tdescription?: string;\n\n\t/**\n\t * Specifies whether to disable autofocus on the panel.\n\t */\n\tdisableAutofocus?: boolean;\n\n\t/**\n\t * Specifies whether the panel has a sticky header to adjust styles.\n\t */\n\thasStickyHeader?: boolean;\n\n\t/**\n\t * hasDataScrollAnchor is required to enable infinite scroll\n\t */\n\thasDataScrollAnchor?: boolean;\n\n\t/**\n\t * Enables interaction tracking for this panel. Provide a stable, non-PII id\n\t * (e.g. 'comments-panel'). When omitted, the panel emits no analytics.\n\t *\n\t * `open` is emitted when the panel mounts, since consumers control the panel's\n\t * presence by rendering it.\n\t */\n\teventId?: string;\n}\n\n/**\n * MrlPanel component.\n *\n * @param props The MrlPanel component properties.\n * @returns The MrlPanel component.\n */\nexport const MrlPanel = React.forwardRef<HTMLDivElement, MrlPanelProps>(\n\tfunction MrlPanel(props, ref): JSX.Element {\n\t\tconst {\n\t\t\tclassName,\n\t\t\ttitle,\n\t\t\tid,\n\t\t\tchildren,\n\t\t\thasStickyHeader,\n\t\t\theader,\n\t\t\tdescription,\n\t\t\tdisableAutofocus,\n\t\t\ttopActions,\n\t\t\thasDataScrollAnchor,\n\t\t\tonClose,\n\t\t\teventId,\n\t\t\t['data-qa']: qa = 'panel',\n\t\t\t...rest\n\t\t} = props;\n\n\t\tconst panelRef = React.useRef<HTMLDivElement>(null);\n\n\t\tconst trackInteraction = useMrlTrackInteraction('MrlPanel', eventId);\n\n\t\tReact.useEffect(() => {\n\t\t\ttrackInteraction({ action: 'open' });\n\t\t\t// the panel is open for as long as the consumer renders it\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, []);\n\n\t\t/**\n\t\t * Handles closing the panel from both the close button and the escape key.\n\t\t */\n\t\tconst handleClose = React.useCallback(() => {\n\t\t\ttrackInteraction({ action: 'close' });\n\n\t\t\tonClose?.();\n\t\t}, [onClose, trackInteraction]);\n\n\t\t// Unique ID for aria-describedby\n\t\tconst descriptionIdRef = React.useRef<string>(\n\t\t\tdescription ? getUniqueId('mrl-panel-description') : ''\n\t\t);\n\n\t\tconst {\n\t\t\tscrollableContainerRef,\n\t\t\thasVerticalScrollbar,\n\t\t\thasHorizontalScrollbar,\n\t\t\thorizontalScrollbarHeight,\n\t\t\tverticalScrollbarWidth\n\t\t} = useScrollbarInfo<HTMLDivElement>();\n\n\t\tconst hasFocusableDescendant = useHasFocusableDescendant(scrollableContainerRef);\n\n\t\tReact.useImperativeHandle<HTMLDivElement | null, HTMLDivElement | null>(ref, () => {\n\t\t\treturn panelRef.current;\n\t\t});\n\n\t\tconst handleKeyDown = React.useCallback(\n\t\t\t(e: React.KeyboardEvent<HTMLDivElement>) => {\n\t\t\t\tif (e.key === 'Escape' && typeof onClose === 'function') {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\thandleClose();\n\t\t\t\t}\n\t\t\t},\n\t\t\t[onClose, handleClose]\n\t\t);\n\n\t\tconst panelClasses = classnames(styles['MrlPanel'], 'MrlPanel', className);\n\n\t\treturn (\n\t\t\t<MrlPanelContext.Provider\n\t\t\t\tvalue={{\n\t\t\t\t\thasHorizontalScrollbar,\n\t\t\t\t\thasVerticalScrollbar,\n\t\t\t\t\thorizontalScrollbarHeight,\n\t\t\t\t\tverticalScrollbarWidth\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}\n\t\t\t\t<div\n\t\t\t\t\t{...rest}\n\t\t\t\t\tclassName={panelClasses}\n\t\t\t\t\taria-describedby={descriptionIdRef.current || props['aria-describedby']}\n\t\t\t\t\taria-label={title || props['aria-label']}\n\t\t\t\t\taria-modal=\"false\"\n\t\t\t\t\tdata-qa={qa}\n\t\t\t\t\tid={id}\n\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\tref={panelRef}\n\t\t\t\t>\n\t\t\t\t\t<MrlFocusTrap containerRef={panelRef} disableAutofocus={disableAutofocus}>\n\t\t\t\t\t\t<header className={classnames(styles['MrlPanel--header'], 'MrlPanel--header')}>\n\t\t\t\t\t\t\t{!header && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\t\t\t\t\tstyles['MrlPanel--header-content'],\n\t\t\t\t\t\t\t\t\t\t'MrlPanel--header-content',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t[styles['MrlPanel--header-content-description']]: !!description\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<MrlTextHeading\n\t\t\t\t\t\t\t\t\t\tclassName={styles['MrlPanel--title']}\n\t\t\t\t\t\t\t\t\t\tattrs={{\n\t\t\t\t\t\t\t\t\t\t\t'data-qa': `${qa}-header-title`,\n\t\t\t\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\thierarchy=\"primary\"\n\t\t\t\t\t\t\t\t\t\tkind=\"title\"\n\t\t\t\t\t\t\t\t\t\tlevel=\"2\"\n\t\t\t\t\t\t\t\t\t\tsize=\"medium\"\n\t\t\t\t\t\t\t\t\t\ttext={title}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{topActions && (\n\t\t\t\t\t\t\t\t\t\t<>\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={classnames(\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyles['MrlPanel--top-actions'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'MrlPanel--top-actions'\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{topActions}\n\t\t\t\t\t\t\t\t\t\t\t\t<MrlDivider\n\t\t\t\t\t\t\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tspacing=\"small\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tlength=\"var(--mrl-spacing-06)\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyles['MrlPanel--top-actions-divider'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'MrlPanel--top-actions-divider'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{header}\n\t\t\t\t\t\t\t<MrlIconButton\n\t\t\t\t\t\t\t\tdata-qa={`${qa}-close-button`}\n\t\t\t\t\t\t\t\twrapperClassName={classnames(styles['MrlPanel--close'], 'MrlPanel--close')}\n\t\t\t\t\t\t\t\ticon={<MrlSvg svg={close} />}\n\t\t\t\t\t\t\t\tonClick={handleClose}\n\t\t\t\t\t\t\t\ttext=\"Close\"\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\tstate=\"default\"\n\t\t\t\t\t\t\t\tposition=\"bottom\"\n\t\t\t\t\t\t\t\ttipAnchor=\"center\"\n\t\t\t\t\t\t\t\tkind=\"ghost\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</header>\n\n\t\t\t\t\t\t{/*\n\t\t\t\t\t\t * Scrollable container — includes description, sticky header and main\n\t\t\t\t\t\t * content. Per ACT rule 0ssw9k a scrollable element passes WCAG 2.1.1\n\t\t\t\t\t\t * Keyboard if it is itself focusable OR has a focusable descendant. We\n\t\t\t\t\t\t * therefore expose `tabindex=\"0\"` only when the wrapper has no focusable\n\t\t\t\t\t\t * descendants, which avoids the \"meaningless tab stop\" finding for\n\t\t\t\t\t\t * panels filled with interactive controls while still making text-only\n\t\t\t\t\t\t * panels keyboard-scrollable. The labeled `role=\"region\"` is preserved\n\t\t\t\t\t\t * whenever the panel overflows so screen-reader users get a landmark.\n\t\t\t\t\t\t * https://www.w3.org/WAI/standards-guidelines/act/rules/0ssw9k/\n\t\t\t\t\t\t */}\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={scrollableContainerRef}\n\t\t\t\t\t\t\tdata-scroll-anchor={hasDataScrollAnchor}\n\t\t\t\t\t\t\tdata-qa={`${qa}-scrollable`}\n\t\t\t\t\t\t\tclassName={classnames(styles['MrlPanel--scrollable'], 'MrlPanel--scrollable', {\n\t\t\t\t\t\t\t\t[styles['MrlPanel--scrollable-has-sticky-header']]: hasStickyHeader\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t{...(verticalScrollbarWidth > 0 && {\n\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\tpaddingRight: `calc(var(--mrl-spacing-06) - ${verticalScrollbarWidth}px)`\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t{...(hasVerticalScrollbar && {\n\t\t\t\t\t\t\t\t'aria-label': title\n\t\t\t\t\t\t\t\t\t? `${title} panel scrollable content`\n\t\t\t\t\t\t\t\t\t: 'Panel scrollable content',\n\t\t\t\t\t\t\t\trole: 'region',\n\t\t\t\t\t\t\t\t...(!hasFocusableDescendant && {\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n\t\t\t\t\t\t\t\t\ttabIndex: 0\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{description && (\n\t\t\t\t\t\t\t\t<MrlText\n\t\t\t\t\t\t\t\t\tattrs={{\n\t\t\t\t\t\t\t\t\t\tclassName: classnames(styles['MrlPanel--description'], 'MrlPanel--description'),\n\t\t\t\t\t\t\t\t\t\tid: descriptionIdRef.current\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tsize=\"xsmall\"\n\t\t\t\t\t\t\t\t\ttext={description}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</MrlFocusTrap>\n\t\t\t\t</div>\n\t\t\t</MrlPanelContext.Provider>\n\t\t);\n\t}\n);\n"],"names":["MrlPanel","React","forwardRef","props","ref","className","title","id","children","hasStickyHeader","header","description","disableAutofocus","topActions","hasDataScrollAnchor","onClose","eventId","_props$dataQa","qa","rest","_objectWithoutProperties","_excluded","panelRef","useRef","trackInteraction","useMrlTrackInteraction","useEffect","action","handleClose","useCallback","descriptionIdRef","getUniqueId","_useScrollbarInfo","useScrollbarInfo","scrollableContainerRef","hasVerticalScrollbar","hasHorizontalScrollbar","horizontalScrollbarHeight","verticalScrollbarWidth","hasFocusableDescendant","useHasFocusableDescendant","useImperativeHandle","current","handleKeyDown","e","key","preventDefault","stopPropagation","panelClasses","classnames","styles","createElement","MrlPanelContext","Provider","value","_extends","onKeyDown","role","MrlFocusTrap","containerRef","MrlTextHeading","attrs","concat","hierarchy","kind","level","size","text","Fragment","MrlDivider","orientation","spacing","length","MrlIconButton","wrapperClassName","icon","MrlSvg","svg","close","onClick","state","position","tipAnchor","style","paddingRight","_objectSpread","tabIndex","MrlText"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA;AACA;AACA;;AA4DA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,QAAQ,gBAAGC,gBAAK,CAACC,UAAU,CACvC,SAASF,QAAQA,CAACG,KAAK,EAAEC,GAAG,EAAe;AAC1C,EAAA,IACCC,SAAS,GAcNF,KAAK,CAdRE,SAAS;IACTC,KAAK,GAaFH,KAAK,CAbRG,KAAK;IACLC,EAAE,GAYCJ,KAAK,CAZRI,EAAE;IACFC,QAAQ,GAWLL,KAAK,CAXRK,QAAQ;IACRC,eAAe,GAUZN,KAAK,CAVRM,eAAe;IACfC,MAAM,GASHP,KAAK,CATRO,MAAM;IACNC,WAAW,GAQRR,KAAK,CARRQ,WAAW;IACXC,gBAAgB,GAObT,KAAK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C,wCAAwC,CAAC,GAAGzC;KACpD;GAAE,EACE6B,sBAAsB,GAAG,CAAC,IAAI;AAClC6C,IAAAA,KAAK,EAAE;MACNC,YAAY,EAAA,+BAAA,CAAAtB,MAAA,CAAkCxB,sBAAsB,EAAA,KAAA;AACrE;GACA,EACIH,oBAAoB,IAAAkD,uCAAA,CAAA;AACxB,IAAA,YAAY,EAAE/E,KAAK,GAAA,EAAA,CAAAwD,MAAA,CACbxD,KAAK,iCACR,0BAA0B;AAC7BmD,IAAAA,IAAI,EAAE;GAAQ,EACV,CAAClB,sBAAsB,IAAI;AAC9B;AACA+C,IAAAA,QAAQ,EAAE;GACV,CACD,GAEA3E,WAAW,iBACXV,gBAAA,CAAAkD,aAAA,CAACoC,eAAO,EAAA;AACP1B,IAAAA,KAAK,EAAE;MACNxD,SAAS,EAAE4C,2BAAU,CAACC,uBAAM,CAAC,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;MAC/E3C,EAAE,EAAEuB,gBAAgB,CAACY;KACpB;AACFwB,IAAAA,IAAI,EAAC,QAAQ;AACbC,IAAAA,IAAI,EAAExD;AAAY,GAClB,CACD,EACAH,QACG,CACQ,CACV,CACoB,CAAC;AAE7B,CACD;;;;"}
1
+ {"version":3,"file":"MrlPanel.js","sources":["../../../../../src/components/panel/MrlPanel/MrlPanel.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport styles from './MrlPanel.module.scss';\nimport { MrlIconButton } from '../../button';\nimport { MrlSvg } from '../../svg';\nimport { close } from '@muraldevkit/ds-icons';\nimport { MrlFocusTrap } from '../../focus-trap';\nimport { MrlText, MrlTextHeading } from '../../text';\nimport { MrlDivider } from '../../divider';\nimport { MrlPanelContext } from '../MrlPanelContext';\nimport { useHasFocusableDescendant } from '../../../hooks/useHasFocusableDescendant';\nimport { useScrollbarInfo } from '../../../hooks/useScrollbarInfo';\nimport { getUniqueId } from '../../../utils';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\n/**\n * Props for the MrlPanel component.\n */\ninterface MrlPanelProps extends React.ComponentPropsWithRef<'div'> {\n\t/**\n\t * A string value used for data-qa attribute.\n\t */\n\t['data-qa']?: string;\n\n\t/**\n\t * Callback function that is called when the panel is closed.\n\t */\n\tonClose?: () => void;\n\n\t/**\n\t * The custom header element to be rendered in the panel.\n\t * When a custom header is used developers need to provide th aria-label and aria-describedby.\n\t */\n\theader?: React.ReactNode;\n\n\t/**\n\t * The custom top actions to be rendered in the panel header.\n\t * By default top actions are rendered on the right side of the title and include a MrlDivider at the end.\n\t * The close button should not be included as part of the top actions.\n\t */\n\ttopActions?: React.ReactNode;\n\n\t/**\n\t * The title of the panel.\n\t */\n\ttitle?: string;\n\n\t/**\n\t * The description of the panel.\n\t */\n\tdescription?: string;\n\n\t/**\n\t * Specifies whether to disable autofocus on the panel.\n\t */\n\tdisableAutofocus?: boolean;\n\n\t/**\n\t * Specifies whether the panel has a sticky header to adjust styles. Set it when the first child\n\t * is an `MrlPanelStickyHeader`, so the scroll area leaves room for it.\n\t */\n\thasStickyHeader?: boolean;\n\n\t/**\n\t * hasDataScrollAnchor is required to enable infinite scroll\n\t */\n\thasDataScrollAnchor?: boolean;\n\n\t/**\n\t * Enables interaction tracking for this panel. Provide a stable, non-PII id\n\t * (e.g. 'comments-panel'). When omitted, the panel emits no analytics.\n\t *\n\t * `open` is emitted when the panel mounts, since consumers control the panel's\n\t * presence by rendering it.\n\t */\n\teventId?: string;\n}\n\n/**\n * MrlPanel component.\n *\n * @param props The MrlPanel component properties.\n * @returns The MrlPanel component.\n */\nexport const MrlPanel = React.forwardRef<HTMLDivElement, MrlPanelProps>(\n\tfunction MrlPanel(props, ref): JSX.Element {\n\t\tconst {\n\t\t\tclassName,\n\t\t\ttitle,\n\t\t\tid,\n\t\t\tchildren,\n\t\t\thasStickyHeader,\n\t\t\theader,\n\t\t\tdescription,\n\t\t\tdisableAutofocus,\n\t\t\ttopActions,\n\t\t\thasDataScrollAnchor,\n\t\t\tonClose,\n\t\t\teventId,\n\t\t\t['data-qa']: qa = 'panel',\n\t\t\t...rest\n\t\t} = props;\n\n\t\tconst panelRef = React.useRef<HTMLDivElement>(null);\n\n\t\tconst trackInteraction = useMrlTrackInteraction('MrlPanel', eventId);\n\n\t\tReact.useEffect(() => {\n\t\t\ttrackInteraction({ action: 'open' });\n\t\t\t// the panel is open for as long as the consumer renders it\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, []);\n\n\t\t/**\n\t\t * Handles closing the panel from both the close button and the escape key.\n\t\t */\n\t\tconst handleClose = React.useCallback(() => {\n\t\t\ttrackInteraction({ action: 'close' });\n\n\t\t\tonClose?.();\n\t\t}, [onClose, trackInteraction]);\n\n\t\t// Unique ID for aria-describedby\n\t\tconst descriptionIdRef = React.useRef<string>(\n\t\t\tdescription ? getUniqueId('mrl-panel-description') : ''\n\t\t);\n\n\t\tconst {\n\t\t\tscrollableContainerRef,\n\t\t\thasVerticalScrollbar,\n\t\t\thasHorizontalScrollbar,\n\t\t\thorizontalScrollbarHeight,\n\t\t\tverticalScrollbarWidth\n\t\t} = useScrollbarInfo<HTMLDivElement>();\n\n\t\tconst hasFocusableDescendant = useHasFocusableDescendant(scrollableContainerRef);\n\n\t\tReact.useImperativeHandle<HTMLDivElement | null, HTMLDivElement | null>(ref, () => {\n\t\t\treturn panelRef.current;\n\t\t});\n\n\t\tconst handleKeyDown = React.useCallback(\n\t\t\t(e: React.KeyboardEvent<HTMLDivElement>) => {\n\t\t\t\tif (e.key === 'Escape' && typeof onClose === 'function') {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\thandleClose();\n\t\t\t\t}\n\t\t\t},\n\t\t\t[onClose, handleClose]\n\t\t);\n\n\t\tconst panelClasses = classnames(styles['MrlPanel'], 'MrlPanel', className);\n\n\t\treturn (\n\t\t\t<MrlPanelContext.Provider\n\t\t\t\tvalue={{\n\t\t\t\t\thasHorizontalScrollbar,\n\t\t\t\t\thasVerticalScrollbar,\n\t\t\t\t\thorizontalScrollbarHeight,\n\t\t\t\t\tverticalScrollbarWidth\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}\n\t\t\t\t<div\n\t\t\t\t\t{...rest}\n\t\t\t\t\tclassName={panelClasses}\n\t\t\t\t\taria-describedby={descriptionIdRef.current || props['aria-describedby']}\n\t\t\t\t\taria-label={title || props['aria-label']}\n\t\t\t\t\taria-modal=\"false\"\n\t\t\t\t\tdata-qa={qa}\n\t\t\t\t\tid={id}\n\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\tref={panelRef}\n\t\t\t\t>\n\t\t\t\t\t<MrlFocusTrap containerRef={panelRef} disableAutofocus={disableAutofocus}>\n\t\t\t\t\t\t<header className={classnames(styles['MrlPanel--header'], 'MrlPanel--header')}>\n\t\t\t\t\t\t\t{!header && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\t\t\t\t\tstyles['MrlPanel--header-content'],\n\t\t\t\t\t\t\t\t\t\t'MrlPanel--header-content',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t[styles['MrlPanel--header-content-description']]: !!description\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<MrlTextHeading\n\t\t\t\t\t\t\t\t\t\tclassName={styles['MrlPanel--title']}\n\t\t\t\t\t\t\t\t\t\tattrs={{\n\t\t\t\t\t\t\t\t\t\t\t'data-qa': `${qa}-header-title`,\n\t\t\t\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\thierarchy=\"primary\"\n\t\t\t\t\t\t\t\t\t\tkind=\"title\"\n\t\t\t\t\t\t\t\t\t\tlevel=\"2\"\n\t\t\t\t\t\t\t\t\t\tsize=\"medium\"\n\t\t\t\t\t\t\t\t\t\ttext={title}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{topActions && (\n\t\t\t\t\t\t\t\t\t\t<>\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={classnames(\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyles['MrlPanel--top-actions'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'MrlPanel--top-actions'\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{topActions}\n\t\t\t\t\t\t\t\t\t\t\t\t<MrlDivider\n\t\t\t\t\t\t\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tspacing=\"small\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tlength=\"var(--mrl-spacing-06)\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyles['MrlPanel--top-actions-divider'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'MrlPanel--top-actions-divider'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{header}\n\t\t\t\t\t\t\t<MrlIconButton\n\t\t\t\t\t\t\t\tdata-qa={`${qa}-close-button`}\n\t\t\t\t\t\t\t\twrapperClassName={classnames(styles['MrlPanel--close'], 'MrlPanel--close')}\n\t\t\t\t\t\t\t\ticon={<MrlSvg svg={close} />}\n\t\t\t\t\t\t\t\tonClick={handleClose}\n\t\t\t\t\t\t\t\ttext=\"Close\"\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\tstate=\"default\"\n\t\t\t\t\t\t\t\tposition=\"bottom\"\n\t\t\t\t\t\t\t\ttipAnchor=\"center\"\n\t\t\t\t\t\t\t\tkind=\"ghost\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</header>\n\n\t\t\t\t\t\t{/*\n\t\t\t\t\t\t * Scrollable container — includes description, sticky header and main\n\t\t\t\t\t\t * content. Per ACT rule 0ssw9k a scrollable element passes WCAG 2.1.1\n\t\t\t\t\t\t * Keyboard if it is itself focusable OR has a focusable descendant. We\n\t\t\t\t\t\t * therefore expose `tabindex=\"0\"` only when the wrapper has no focusable\n\t\t\t\t\t\t * descendants, which avoids the \"meaningless tab stop\" finding for\n\t\t\t\t\t\t * panels filled with interactive controls while still making text-only\n\t\t\t\t\t\t * panels keyboard-scrollable. The labeled `role=\"region\"` is preserved\n\t\t\t\t\t\t * whenever the panel overflows so screen-reader users get a landmark.\n\t\t\t\t\t\t * https://www.w3.org/WAI/standards-guidelines/act/rules/0ssw9k/\n\t\t\t\t\t\t */}\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={scrollableContainerRef}\n\t\t\t\t\t\t\tdata-scroll-anchor={hasDataScrollAnchor}\n\t\t\t\t\t\t\tdata-qa={`${qa}-scrollable`}\n\t\t\t\t\t\t\tclassName={classnames(styles['MrlPanel--scrollable'], 'MrlPanel--scrollable', {\n\t\t\t\t\t\t\t\t[styles['MrlPanel--scrollable-has-sticky-header']]: hasStickyHeader\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t{...(verticalScrollbarWidth > 0 && {\n\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\tpaddingRight: `calc(var(--mrl-spacing-06) - ${verticalScrollbarWidth}px)`\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t{...(hasVerticalScrollbar && {\n\t\t\t\t\t\t\t\t'aria-label': title\n\t\t\t\t\t\t\t\t\t? `${title} panel scrollable content`\n\t\t\t\t\t\t\t\t\t: 'Panel scrollable content',\n\t\t\t\t\t\t\t\trole: 'region',\n\t\t\t\t\t\t\t\t...(!hasFocusableDescendant && {\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n\t\t\t\t\t\t\t\t\ttabIndex: 0\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{description && (\n\t\t\t\t\t\t\t\t<MrlText\n\t\t\t\t\t\t\t\t\tattrs={{\n\t\t\t\t\t\t\t\t\t\tclassName: classnames(styles['MrlPanel--description'], 'MrlPanel--description'),\n\t\t\t\t\t\t\t\t\t\tid: descriptionIdRef.current\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tsize=\"xsmall\"\n\t\t\t\t\t\t\t\t\ttext={description}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</MrlFocusTrap>\n\t\t\t\t</div>\n\t\t\t</MrlPanelContext.Provider>\n\t\t);\n\t}\n);\n"],"names":["MrlPanel","React","forwardRef","props","ref","className","title","id","children","hasStickyHeader","header","description","disableAutofocus","topActions","hasDataScrollAnchor","onClose","eventId","_props$dataQa","qa","rest","_objectWithoutProperties","_excluded","panelRef","useRef","trackInteraction","useMrlTrackInteraction","useEffect","action","handleClose","useCallback","descriptionIdRef","getUniqueId","_useScrollbarInfo","useScrollbarInfo","scrollableContainerRef","hasVerticalScrollbar","hasHorizontalScrollbar","horizontalScrollbarHeight","verticalScrollbarWidth","hasFocusableDescendant","useHasFocusableDescendant","useImperativeHandle","current","handleKeyDown","e","key","preventDefault","stopPropagation","panelClasses","classnames","styles","createElement","MrlPanelContext","Provider","value","_extends","onKeyDown","role","MrlFocusTrap","containerRef","MrlTextHeading","attrs","concat","hierarchy","kind","level","size","text","Fragment","MrlDivider","orientation","spacing","length","MrlIconButton","wrapperClassName","icon","MrlSvg","svg","close","onClick","state","position","tipAnchor","style","paddingRight","_objectSpread","tabIndex","MrlText"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA;AACA;AACA;;AA6DA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,QAAQ,gBAAGC,gBAAK,CAACC,UAAU,CACvC,SAASF,QAAQA,CAACG,KAAK,EAAEC,GAAG,EAAe;AAC1C,EAAA,IACCC,SAAS,GAcNF,KAAK,CAdRE,SAAS;IACTC,KAAK,GAaFH,KAAK,CAbRG,KAAK;IACLC,EAAE,GAYCJ,KAAK,CAZRI,EAAE;IACFC,QAAQ,GAWLL,KAAK,CAXRK,QAAQ;IACRC,eAAe,GAUZN,KAAK,CAVRM,eAAe;IACfC,MAAM,GASHP,KAAK,CATRO,MAAM;IACNC,WAAW,GAQRR,KAAK,CARRQ,WAAW;IACXC,gBAAgB,GAObT,KAAK,CAPRS,gBAAgB;IAChBC,UAAU,GAMPV,KAAK,CANRU,UAAU;IACVC,mBAAmB,GAKhBX,KAAK,CALRW,mBAAmB;IACnBC,OAAO,GAIJZ,KAAK,CAJRY,OAAO;IACPC,OAAO,GAGJb,KAAK,CAHRa,OAAO;IAAAC,aAAA,GAGJd,KAAK,CAFP,SAAS,CAAA;AAAGe,IAAAA,EAAE,GAAAD,aAAA,KAAA,MAAA,GAAG,OAAO,GAAAA,aAAA;AACtBE,IAAAA,IAAI,GAAAC,iDAAA,CACJjB,KAAK,EAAAkB,SAAA,CAAA;AAET,EAAA,IAAMC,QAAQ,GAAGrB,gBAAK,CAACsB,MAAM,CAAiB,IAAI,CAAC;AAEnD,EAAA,IAAMC,gBAAgB,GAAGC,sCAAsB,CAAC,UAAU,EAAET,OAAO,CAAC;EAEpEf,gBAAK,CAACyB,SAAS,CAAC,MAAM;A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B,CAAC,EAAE,uBAAuB,CAAC;MAC/E3C,EAAE,EAAEuB,gBAAgB,CAACY;KACpB;AACFwB,IAAAA,IAAI,EAAC,QAAQ;AACbC,IAAAA,IAAI,EAAExD;AAAY,GAClB,CACD,EACAH,QACG,CACQ,CACV,CACoB,CAAC;AAE7B,CACD;;;;"}
@@ -37,7 +37,8 @@ var _excluded = ["children", "hasDivider", "className"];
37
37
  */
38
38
 
39
39
  /**
40
- * MrlPanelFooter component.
40
+ * MrlPanelFooter component. Pins a short note, such as an attribution, to the bottom of an
41
+ * `MrlPanel`; render it as the panel's last child.
41
42
  *
42
43
  * @param props The MrlPanelFooter component properties.
43
44
  * @returns The MrlPanelFooter component.
@@ -1 +1 @@
1
- {"version":3,"file":"MrlPanelFooter.js","sources":["../../../../../src/components/panel/MrlPanelFooter/MrlPanelFooter.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport styles from './MrlPanelFooter.module.scss';\nimport { MrlText } from '../../text';\nimport { MrlDivider } from '../../divider';\n\n/**\n * Props for the MrlPanelFooter component.\n */\ninterface MrlPanelFooterProps extends React.ComponentPropsWithRef<'footer'> {\n\t/**\n\t * The children of the MrlPanelFooter component.\n\t */\n\tchildren?: React.ReactNode;\n\n\t/**\n\t * Specifies whether to show the divider.\n\t */\n\thasDivider?: boolean;\n}\n\n/**\n * MrlPanelFooter component.\n *\n * @param props The MrlPanelFooter component properties.\n * @returns The MrlPanelFooter component.\n */\nexport const MrlPanelFooter = React.forwardRef<HTMLElement, MrlPanelFooterProps>(\n\tfunction MrlPanelFooter({ children, hasDivider, className, ...rest }, ref): JSX.Element {\n\t\treturn (\n\t\t\t<footer\n\t\t\t\t{...rest}\n\t\t\t\tref={ref}\n\t\t\t\tclassName={classnames(styles['MrlPanelFooter'], 'MrlPanelFooter', className)}\n\t\t\t>\n\t\t\t\t{hasDivider && (\n\t\t\t\t\t<MrlDivider\n\t\t\t\t\t\tspacing=\"small\"\n\t\t\t\t\t\tclassName={classnames(styles['MrlPanelFooter--divider'], 'MrlPanelFooter--divider')}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{typeof children === 'string' && <MrlText size=\"xsmall\" text={children} />}\n\t\t\t\t{typeof children === 'object' && children}\n\t\t\t</footer>\n\t\t);\n\t}\n);\n"],"names":["MrlPanelFooter","React","forwardRef","_ref","ref","children","hasDivider","className","rest","_objectWithoutProperties","_excluded","createElement","_extends","classnames","styles","MrlDivider","spacing","MrlText","size","text"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;AACA;AACA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,cAAc,gBAAGC,gBAAK,CAACC,UAAU,CAC7C,SAASF,cAAcA,CAAAG,IAAA,EAA+CC,GAAG,EAAe;AAAA,EAAA,IAA9DC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAAEC,UAAU,GAAAH,IAAA,CAAVG,UAAU;IAAEC,SAAS,GAAAJ,IAAA,CAATI,SAAS;AAAKC,IAAAA,IAAI,GAAAC,iDAAA,CAAAN,IAAA,EAAAO,SAAA,CAAA;AACjE,EAAA,oBACCT,gBAAA,CAAAU,aAAA,CAAA,QAAA,EAAAC,iCAAA,KACKJ,IAAI,EAAA;AACRJ,IAAAA,GAAG,EAAEA,GAAI;IACTG,SAAS,EAAEM,2BAAU,CAACC,6BAAM,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,EAAEP,SAAS;AAAE,GAAA,CAAA,EAE5ED,UAAU,iBACVL,gBAAA,CAAAU,aAAA,CAACI,qBAAU,EAAA;AACVC,IAAAA,OAAO,EAAC,OAAO;IACfT,SAAS,EAAEM,2BAAU,CAACC,6BAAM,CAAC,yBAAyB,CAAC,EAAE,yBAAyB;GAClF,CACD,EACA,OAAOT,QAAQ,KAAK,QAAQ,iBAAIJ,gBAAA,CAAAU,aAAA,CAACM,eAAO,EAAA;AAACC,IAAAA,IAAI,EAAC,QAAQ;AAACC,IAAAA,IAAI,EAAEd;GAAW,CAAC,EACzE,OAAOA,QAAQ,KAAK,QAAQ,IAAIA,QAC1B,CAAC;AAEX,CACD;;;;"}
1
+ {"version":3,"file":"MrlPanelFooter.js","sources":["../../../../../src/components/panel/MrlPanelFooter/MrlPanelFooter.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport styles from './MrlPanelFooter.module.scss';\nimport { MrlText } from '../../text';\nimport { MrlDivider } from '../../divider';\n\n/**\n * Props for the MrlPanelFooter component.\n */\ninterface MrlPanelFooterProps extends React.ComponentPropsWithRef<'footer'> {\n\t/**\n\t * Footer content, pinned to the bottom of the panel; render the footer as the last child of\n\t * `MrlPanel`. A string is rendered as extra-small text; pass elements for richer content such\n\t * as links.\n\t */\n\tchildren?: React.ReactNode;\n\n\t/**\n\t * Renders a divider above the footer content.\n\t */\n\thasDivider?: boolean;\n}\n\n/**\n * MrlPanelFooter component. Pins a short note, such as an attribution, to the bottom of an\n * `MrlPanel`; render it as the panel's last child.\n *\n * @param props The MrlPanelFooter component properties.\n * @returns The MrlPanelFooter component.\n */\nexport const MrlPanelFooter = React.forwardRef<HTMLElement, MrlPanelFooterProps>(\n\tfunction MrlPanelFooter({ children, hasDivider, className, ...rest }, ref): JSX.Element {\n\t\treturn (\n\t\t\t<footer\n\t\t\t\t{...rest}\n\t\t\t\tref={ref}\n\t\t\t\tclassName={classnames(styles['MrlPanelFooter'], 'MrlPanelFooter', className)}\n\t\t\t>\n\t\t\t\t{hasDivider && (\n\t\t\t\t\t<MrlDivider\n\t\t\t\t\t\tspacing=\"small\"\n\t\t\t\t\t\tclassName={classnames(styles['MrlPanelFooter--divider'], 'MrlPanelFooter--divider')}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{typeof children === 'string' && <MrlText size=\"xsmall\" text={children} />}\n\t\t\t\t{typeof children === 'object' && children}\n\t\t\t</footer>\n\t\t);\n\t}\n);\n"],"names":["MrlPanelFooter","React","forwardRef","_ref","ref","children","hasDivider","className","rest","_objectWithoutProperties","_excluded","createElement","_extends","classnames","styles","MrlDivider","spacing","MrlText","size","text"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,cAAc,gBAAGC,gBAAK,CAACC,UAAU,CAC7C,SAASF,cAAcA,CAAAG,IAAA,EAA+CC,GAAG,EAAe;AAAA,EAAA,IAA9DC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAAEC,UAAU,GAAAH,IAAA,CAAVG,UAAU;IAAEC,SAAS,GAAAJ,IAAA,CAATI,SAAS;AAAKC,IAAAA,IAAI,GAAAC,iDAAA,CAAAN,IAAA,EAAAO,SAAA,CAAA;AACjE,EAAA,oBACCT,gBAAA,CAAAU,aAAA,CAAA,QAAA,EAAAC,iCAAA,KACKJ,IAAI,EAAA;AACRJ,IAAAA,GAAG,EAAEA,GAAI;IACTG,SAAS,EAAEM,2BAAU,CAACC,6BAAM,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,EAAEP,SAAS;AAAE,GAAA,CAAA,EAE5ED,UAAU,iBACVL,gBAAA,CAAAU,aAAA,CAACI,qBAAU,EAAA;AACVC,IAAAA,OAAO,EAAC,OAAO;IACfT,SAAS,EAAEM,2BAAU,CAACC,6BAAM,CAAC,yBAAyB,CAAC,EAAE,yBAAyB;GAClF,CACD,EACA,OAAOT,QAAQ,KAAK,QAAQ,iBAAIJ,gBAAA,CAAAU,aAAA,CAACM,eAAO,EAAA;AAACC,IAAAA,IAAI,EAAC,QAAQ;AAACC,IAAAA,IAAI,EAAEd;GAAW,CAAC,EACzE,OAAOA,QAAQ,KAAK,QAAQ,IAAIA,QAC1B,CAAC;AAEX,CACD;;;;"}
@@ -35,7 +35,8 @@ var _excluded = ["children", "className"];
35
35
  */
36
36
 
37
37
  /**
38
- * MrlPanelStickyHeader component.
38
+ * MrlPanelStickyHeader component. Keeps controls pinned to the top of an `MrlPanel` while its
39
+ * content scrolls. Render it as the panel's first child and set `hasStickyHeader` on the panel.
39
40
  *
40
41
  * @param props The MrlPanelStickyHeader component properties.
41
42
  * @returns The MrlPanel component.
@@ -1 +1 @@
1
- {"version":3,"file":"MrlPanelStickyHeader.js","sources":["../../../../../src/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport styles from './MrlPanelStickyHeader.module.scss';\n\n/**\n * Props for the MrlPanelStickyHeader component.\n */\ninterface MrlPanelStickyHeaderProps extends React.ComponentPropsWithRef<'div'> {\n\t/**\n\t * The children of the MrlPanelStickyHeader component.\n\t */\n\tchildren?: React.ReactNode;\n}\n\n/**\n * MrlPanelStickyHeader component.\n *\n * @param props The MrlPanelStickyHeader component properties.\n * @returns The MrlPanel component.\n */\nexport const MrlPanelStickyHeader = ({\n\tchildren,\n\tclassName,\n\t...rest\n}: MrlPanelStickyHeaderProps): JSX.Element => {\n\treturn (\n\t\t<div\n\t\t\t{...rest}\n\t\t\tclassName={classnames(styles['MrlPanelStickyHeader'], 'MrlPanelStickyHeader', className)}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t);\n};\n"],"names":["MrlPanelStickyHeader","_ref","children","className","rest","_objectWithoutProperties","_excluded","React","createElement","_extends","classnames","styles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,oBAAoB,GAAGC,IAAA,IAIU;AAAA,EAAA,IAH7CC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,SAAS,GAAAF,IAAA,CAATE,SAAS;AACNC,IAAAA,IAAI,GAAAC,iDAAA,CAAAJ,IAAA,EAAAK,SAAA,CAAA;AAEP,EAAA,oBACCC,gBAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,iCAAA,KACKL,IAAI,EAAA;IACRD,SAAS,EAAEO,2BAAU,CAACC,mCAAM,CAAC,sBAAsB,CAAC,EAAE,sBAAsB,EAAER,SAAS;AAAE,GAAA,CAAA,EAExFD,QACG,CAAC;AAER;;;;"}
1
+ {"version":3,"file":"MrlPanelStickyHeader.js","sources":["../../../../../src/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport styles from './MrlPanelStickyHeader.module.scss';\n\n/**\n * Props for the MrlPanelStickyHeader component.\n */\ninterface MrlPanelStickyHeaderProps extends React.ComponentPropsWithRef<'div'> {\n\t/**\n\t * Controls to keep pinned to the top of the panel while its content scrolls, such as a search\n\t * input and tabs.\n\t */\n\tchildren?: React.ReactNode;\n}\n\n/**\n * MrlPanelStickyHeader component. Keeps controls pinned to the top of an `MrlPanel` while its\n * content scrolls. Render it as the panel's first child and set `hasStickyHeader` on the panel.\n *\n * @param props The MrlPanelStickyHeader component properties.\n * @returns The MrlPanel component.\n */\nexport const MrlPanelStickyHeader = ({\n\tchildren,\n\tclassName,\n\t...rest\n}: MrlPanelStickyHeaderProps): JSX.Element => {\n\treturn (\n\t\t<div\n\t\t\t{...rest}\n\t\t\tclassName={classnames(styles['MrlPanelStickyHeader'], 'MrlPanelStickyHeader', className)}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t);\n};\n"],"names":["MrlPanelStickyHeader","_ref","children","className","rest","_objectWithoutProperties","_excluded","React","createElement","_extends","classnames","styles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,oBAAoB,GAAGC,IAAA,IAIU;AAAA,EAAA,IAH7CC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,SAAS,GAAAF,IAAA,CAATE,SAAS;AACNC,IAAAA,IAAI,GAAAC,iDAAA,CAAAJ,IAAA,EAAAK,SAAA,CAAA;AAEP,EAAA,oBACCC,gBAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,iCAAA,KACKL,IAAI,EAAA;IACRD,SAAS,EAAEO,2BAAU,CAACC,mCAAM,CAAC,sBAAsB,CAAC,EAAE,sBAAsB,EAAER,SAAS;AAAE,GAAA,CAAA,EAExFD,QACG,CAAC;AAER;;;;"}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var TOOLKIT_VERSION = "4.76.1";
3
+ var TOOLKIT_VERSION = "4.77.0";
4
4
 
5
5
  exports.TOOLKIT_VERSION = TOOLKIT_VERSION;
6
6
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const TOOLKIT_VERSION = \"4.76.1\";"],"names":["TOOLKIT_VERSION"],"mappings":";;AAAO,IAAMA,eAAe,GAAG;;;;"}
1
+ {"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const TOOLKIT_VERSION = \"4.77.0\";"],"names":["TOOLKIT_VERSION"],"mappings":";;AAAO,IAAMA,eAAe,GAAG;;;;"}
@@ -106,5 +106,11 @@ export interface MrlButtonProps extends Omit<MrlComponentProps, 'style'>, React.
106
106
  * informs the component that this is a toggle button and to add that functionality
107
107
  */
108
108
  toggleStyle?: ToggleStyle;
109
+ /**
110
+ * Controlled state that overrides the internal state management.
111
+ * When provided, this takes precedence over the `state` prop and allows
112
+ * the parent component to fully control the button's state.
113
+ */
114
+ controlledState?: MrlButtonState;
109
115
  }
110
116
  export declare const MrlButton: React.ForwardRefExoticComponent<Omit<MrlButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
@@ -2,7 +2,8 @@ import * as React from 'react';
2
2
  import { DataQa } from '../../../utils/dataQa';
3
3
  export type MrlFilterItemProps = {
4
4
  /**
5
- * The filter item's value.
5
+ * The filter item's value, reported to `MrlFilter` when the item is selected by click or by
6
+ * arrow-key focus. The item is checked while it equals the filter's selected value.
6
7
  */
7
8
  value: string;
8
9
  /**
@@ -10,7 +11,8 @@ export type MrlFilterItemProps = {
10
11
  */
11
12
  children?: React.ReactNode;
12
13
  /**
13
- * The count of items for this filter option.
14
+ * The count of items for this filter option, shown as a badge and announced as ", N items"
15
+ * after the label.
14
16
  */
15
17
  count?: number;
16
18
  /**
@@ -22,7 +24,8 @@ export type MrlFilterItemProps = {
22
24
  eventId?: string;
23
25
  } & React.ComponentPropsWithoutRef<'span'> & DataQa;
24
26
  /**
25
- * MrlFilterItem component.
27
+ * MrlFilterItem component. One option of an `MrlFilter`, rendered as a `radio` of the filter's
28
+ * radio group; must be rendered inside `MrlFilter`.
26
29
  *
27
30
  * @param props - The component props.
28
31
  * @returns The MrlFilterItem component.
@@ -2,11 +2,19 @@ import { AttrsObject } from '../../../../utils';
2
2
  import { CheckboxSelected, CheckboxStates } from '../../constants';
3
3
  import './MrlCheckboxStandalone.global.scss';
4
4
  interface MrlCheckboxStandaloneProps {
5
- /** Applies additional HTML attributes to the checkbox element */
5
+ /**
6
+ * Applies additional HTML attributes to the checkbox element. The component renders no label,
7
+ * so label it here: an `id` referenced by a `<label htmlFor>`, or `aria-labelledby` pointing
8
+ * to visible text (a console warning is logged when both are missing). Pass the `onChange`
9
+ * handler here as well.
10
+ */
6
11
  attrs?: AttrsObject;
7
12
  /** The current state of the checkbox input based on user interactions or permissions */
8
13
  state?: CheckboxStates;
9
- /** Sets what selection state the checkbox is in. */
14
+ /**
15
+ * Sets what selection state the checkbox is in. The component is controlled: update it from
16
+ * the `onChange` handler passed in `attrs`.
17
+ */
10
18
  selected?: CheckboxSelected;
11
19
  /**
12
20
  * Enables interaction tracking for this checkbox. Provide a stable, non-PII id
@@ -1,11 +1,25 @@
1
1
  import * as React from 'react';
2
2
  export interface MrlMenuGroupPropTypes {
3
+ /**
4
+ * The `MrlMenuItem`s (or `MrlMenuItemLink`s) that belong to the group. They stay part of the
5
+ * parent menu's keyboard navigation and close the menu exactly as ungrouped items do.
6
+ */
3
7
  children: React.ReactNode;
8
+ /**
9
+ * Renders a divider after the group's items. Set it to `false` on the last group so the menu
10
+ * does not end with a divider.
11
+ *
12
+ * @default true
13
+ */
4
14
  divider?: boolean;
15
+ /** Visible heading rendered above the group's items. Omit it to separate items with the divider only */
5
16
  groupLabel?: string;
6
17
  }
7
18
  /**
8
- * MrlMenuGroup
19
+ * MrlMenuGroup component
20
+ *
21
+ * Groups related menu items within an MrlMenu, with an optional label and a trailing divider.
22
+ * Must be a direct child of `MrlMenu`.
9
23
  * @param props - component properties
10
24
  * @returns JSX.Element
11
25
  */
@@ -7,18 +7,23 @@ export interface MrlMenuItemProps {
7
7
  /** Indicates whether the menu item has a popup menu using aria-haspopup attribute */
8
8
  ariaHasPopup?: AriaHasPopup;
9
9
  /**
10
- Children to be rendered within the menu component
10
+ * Label of the item. Nesting an `MrlMenu` or `MrlPopover` here turns the item into a
11
+ * submenu trigger: it gets `aria-haspopup="menu"` and a trailing chevron, opens the submenu
12
+ * on hover, `ArrowRight`, `Enter` or `Space`, and does not close its own menu when activated.
11
13
  */
12
14
  children: React.ReactNode | string;
13
15
  /** Classname for the menu item */
14
16
  className?: string;
15
- /** If the menu item is disabled */
17
+ /** Disables the item: it stays focusable (`aria-disabled`) but ignores clicks and key presses */
16
18
  disabled?: boolean;
17
19
  /** Icon for menu item */
18
20
  icon?: DSIconType;
19
21
  /** Unique ID for the menu item */
20
22
  id?: string;
21
- /** Callback to be called when the menu item is clicked */
23
+ /**
24
+ * Called on click, `Enter` or `Space`. The menu then closes, unless the item wraps a submenu
25
+ * or is a `menuitemcheckbox`/`menuitemradio` toggled with `Space`.
26
+ */
22
27
  onClick?: (e?: React.MouseEvent<HTMLButtonElement>) => void;
23
28
  /** Callback to be called when the menu item is hovered */
24
29
  onMouseOver?: (e?: React.MouseEvent) => void;
@@ -30,14 +35,16 @@ export interface MrlMenuItemProps {
30
35
  * Role for the menu item
31
36
  *
32
37
  * When using `menuitemcheckbox` or `menuitemradio`, the menu item will be treated as a selectable item,
33
- * aria-checked will be set to 'true' or 'false' based on the selected state.
38
+ * aria-checked will be set to 'true' or 'false' based on the selected state. `Space` toggles
39
+ * such an item and keeps the menu open; `Enter` or a click toggles it and closes the menu.
40
+ * The consumer owns `selected`.
34
41
  *
35
42
  * @default 'menuitem' - for regular menu items
36
43
  * @example 'menuitemcheckbox' - for checkbox menu items
37
44
  * @example 'menuitemradio' - for radio menu items
38
45
  */
39
46
  role?: MenuItemRole;
40
- /** If the menu item is selected */
47
+ /** Marks the item as selected: shows a trailing check and, for checkbox/radio roles, sets `aria-checked` */
41
48
  selected?: boolean;
42
49
  /**
43
50
  * Enables interaction tracking for this menu item. Provide a stable, non-PII id
@@ -48,7 +55,8 @@ export interface MrlMenuItemProps {
48
55
  /**
49
56
  * MrlMenuItem component
50
57
  *
51
- * Renders a menu item to be used within the MrlMenu component
58
+ * Renders one actionable row of a menu: an `li` wrapping a `button` with the given `role`.
59
+ * Must be a child of `MrlMenu` or `MrlMenuGroup`.
52
60
  * @param {MrlMenuItemProps} props - The props for the MrlMenuItem component
53
61
  * @returns {Element} - rendered MrlMenuItem component
54
62
  */
@@ -9,13 +9,18 @@ export interface MrlMenuItemLinkProps {
9
9
  children: React.ReactNode | string;
10
10
  /** Class names for the menu item */
11
11
  className?: string;
12
- /** If the menu item is disabled */
12
+ /** Disables the link: it stays focusable (`aria-disabled`) but does not navigate */
13
13
  disabled?: boolean;
14
14
  /** Href for the menu item */
15
15
  href: string;
16
16
  /** Icon for menu item */
17
17
  icon?: DSIconType;
18
- /** Target for links */
18
+ /**
19
+ * Anchor target. `_blank` marks the link as external: `rel` becomes `noopener noreferrer`
20
+ * and a trailing external-link icon is shown.
21
+ *
22
+ * @default '_self'
23
+ */
19
24
  target?: string;
20
25
  /** Unique ID for the menu item */
21
26
  id?: string;
@@ -25,7 +30,7 @@ export interface MrlMenuItemLinkProps {
25
30
  dataQa?: string;
26
31
  /** If the menu item is selected */
27
32
  selected?: boolean;
28
- /** Rel attr for the menu item */
33
+ /** Rel attribute of the anchor; replaced by `noopener noreferrer` when `target` is `_blank` */
29
34
  rel?: string;
30
35
  /**
31
36
  * Enables interaction tracking for this menu item. Provide a stable, non-PII id
@@ -34,10 +39,14 @@ export interface MrlMenuItemLinkProps {
34
39
  eventId?: string;
35
40
  }
36
41
  /**
37
- * MrlMenuItem component
42
+ * MrlMenuItemLink component
38
43
  *
39
- * Renders a menu item to be used within the MrlMenu component
40
- * @param {MrlMenuItemLinkProps} props - The props for the MrlMenuItem component
41
- * @returns {Element} - rendered MrlMenuItem component
44
+ * Renders a menu item that navigates to a URL (an anchor with `role="menuitem"`), to be used
45
+ * within the MrlMenu component. Links opened with `target="_blank"` get
46
+ * `rel="noopener noreferrer"` and a trailing external-link icon.
47
+ * Unlike `MrlMenuItem`, it does not close the menu on activation; close it from `onClick`
48
+ * when the navigation keeps the page alive (same-page `#hash` links, `target="_blank"`).
49
+ * @param {MrlMenuItemLinkProps} props - The props for the MrlMenuItemLink component
50
+ * @returns {Element} - rendered MrlMenuItemLink component
42
51
  */
43
52
  export declare function MrlMenuItemLink({ ariaDescribedBy, children, className, dataQa, disabled, href, icon, id, onClick, selected, target, eventId, ...rest }: MrlMenuItemLinkProps): JSX.Element;
@@ -1,7 +1,10 @@
1
1
  import * as React from 'react';
2
2
  interface MrlModalContentProps {
3
3
  /**
4
- * Children to be rendered within the component.
4
+ * Body of the modal, rendered between `MrlModalHeader` and `MrlModalFooter`. When it
5
+ * overflows, this is the modal's only scrolling area: it is exposed as a `region` labelled
6
+ * from the header text, and is focusable (`tabindex="0"`) only when it contains no focusable
7
+ * elements, so keyboard users can still scroll it.
5
8
  */
6
9
  children: React.ReactElement | React.ReactElement[];
7
10
  /**
@@ -10,7 +13,7 @@ interface MrlModalContentProps {
10
13
  className?: string;
11
14
  }
12
15
  /**
13
- * Modal Content component for the MrlModal
16
+ * Modal Content component for the MrlModal. Must be rendered inside `MrlModal`.
14
17
  * @param {object} props - The props object
15
18
  * @param {React.ReactElement} props.children - The children to be rendered within the component
16
19
  * @returns {React.ReactElement}} The rendered MrlModalContent component
@@ -3,7 +3,8 @@ import { MrlComponentProps } from '../../../utils';
3
3
  import './MrlModalFooter.global.scss';
4
4
  interface MrlModalFooterProps extends MrlComponentProps {
5
5
  /**
6
- * Content of the modal footer
6
+ * Actions of the modal, laid out in a row and stacked at full width on the `xs` breakpoint.
7
+ * Order them from least to most prominent, ending with the primary action.
7
8
  */
8
9
  children?: React.ReactElement | React.ReactElement[];
9
10
  /**
@@ -12,7 +13,8 @@ interface MrlModalFooterProps extends MrlComponentProps {
12
13
  className?: string;
13
14
  }
14
15
  /**
15
- * Modal Footer component for the MrlModal
16
+ * Modal Footer component for the MrlModal. Must be rendered inside `MrlModal`, after
17
+ * `MrlModalContent`.
16
18
  * @param {AttrsObject} attrs - Additional HTML attributes for the `mrl-modal` element
17
19
  * @returns {React.ReactElement} The rendered MrlModalFooter component
18
20
  */
@@ -2,7 +2,8 @@ import * as React from 'react';
2
2
  import { MrlComponentProps } from '../../../utils';
3
3
  export interface MrlModalHeaderProps extends MrlComponentProps {
4
4
  /**
5
- * Content of the modal header
5
+ * Content rendered after the heading, inside the header row. The close button is not part of
6
+ * the header; `MrlModal` renders it.
6
7
  */
7
8
  children?: React.ReactNode;
8
9
  /**
@@ -10,12 +11,12 @@ export interface MrlModalHeaderProps extends MrlComponentProps {
10
11
  */
11
12
  className?: string;
12
13
  /**
13
- * Text the h1 element of modal header
14
+ * Text of the modal header `h2` element. It also labels the modal's scrollable content region.
14
15
  */
15
16
  text: string;
16
17
  }
17
18
  /**
18
- * Modal Header component for the MrlModal.
19
+ * Modal Header component for the MrlModal. Must be rendered inside `MrlModal`.
19
20
  * @param {MrlModalHeaderProps} props - The props for the MrlModalFooter component
20
21
  * @param {AttrsObject} props.attrs - Additional HTML attributes for the `mrl-modal` element
21
22
  * @returns {React.ReactElement} The rendered MrlModalFooter component
@@ -35,7 +35,8 @@ interface MrlPanelProps extends React.ComponentPropsWithRef<'div'> {
35
35
  */
36
36
  disableAutofocus?: boolean;
37
37
  /**
38
- * Specifies whether the panel has a sticky header to adjust styles.
38
+ * Specifies whether the panel has a sticky header to adjust styles. Set it when the first child
39
+ * is an `MrlPanelStickyHeader`, so the scroll area leaves room for it.
39
40
  */
40
41
  hasStickyHeader?: boolean;
41
42
  /**
@@ -4,16 +4,19 @@ import * as React from 'react';
4
4
  */
5
5
  interface MrlPanelFooterProps extends React.ComponentPropsWithRef<'footer'> {
6
6
  /**
7
- * The children of the MrlPanelFooter component.
7
+ * Footer content, pinned to the bottom of the panel; render the footer as the last child of
8
+ * `MrlPanel`. A string is rendered as extra-small text; pass elements for richer content such
9
+ * as links.
8
10
  */
9
11
  children?: React.ReactNode;
10
12
  /**
11
- * Specifies whether to show the divider.
13
+ * Renders a divider above the footer content.
12
14
  */
13
15
  hasDivider?: boolean;
14
16
  }
15
17
  /**
16
- * MrlPanelFooter component.
18
+ * MrlPanelFooter component. Pins a short note, such as an attribution, to the bottom of an
19
+ * `MrlPanel`; render it as the panel's last child.
17
20
  *
18
21
  * @param props The MrlPanelFooter component properties.
19
22
  * @returns The MrlPanelFooter component.
@@ -4,12 +4,14 @@ import * as React from 'react';
4
4
  */
5
5
  interface MrlPanelStickyHeaderProps extends React.ComponentPropsWithRef<'div'> {
6
6
  /**
7
- * The children of the MrlPanelStickyHeader component.
7
+ * Controls to keep pinned to the top of the panel while its content scrolls, such as a search
8
+ * input and tabs.
8
9
  */
9
10
  children?: React.ReactNode;
10
11
  }
11
12
  /**
12
- * MrlPanelStickyHeader component.
13
+ * MrlPanelStickyHeader component. Keeps controls pinned to the top of an `MrlPanel` while its
14
+ * content scrolls. Render it as the panel's first child and set `hasStickyHeader` on the panel.
13
15
  *
14
16
  * @param props The MrlPanelStickyHeader component properties.
15
17
  * @returns The MrlPanel component.
@@ -9,7 +9,7 @@ import { spinnerDefaults } from '../../loader/constants.js';
9
9
  import { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics/useMrlAnalytics.js';
10
10
  import { setAttributes } from '../../../utils/setAttributes/setAttributes.js';
11
11
 
12
- var _excluded = ["attrs", "badge", "className", "disabled", "disableEvents", "icon", "iconPos", "kind", "loading", "loadingText", "onClick", "toggleAria", "toggleStyle", "text", "eventId", "size", "state", "tooltip"];
12
+ var _excluded = ["attrs", "badge", "className", "disabled", "disableEvents", "icon", "iconPos", "kind", "loading", "loadingText", "onClick", "toggleAria", "toggleStyle", "text", "eventId", "size", "state", "tooltip", "controlledState"];
13
13
  var MrlButton = /*#__PURE__*/React.forwardRef(function MrlButton(_ref, ref) {
14
14
  var attrs = _ref.attrs,
15
15
  badge = _ref.badge,
@@ -38,8 +38,16 @@ var MrlButton = /*#__PURE__*/React.forwardRef(function MrlButton(_ref, ref) {
38
38
  _ref$state = _ref.state,
39
39
  state = _ref$state === void 0 ? buttonDefaults.state : _ref$state,
40
40
  tooltip = _ref.tooltip,
41
+ controlledState = _ref.controlledState,
41
42
  remainingProps = _objectWithoutProperties(_ref, _excluded);
42
- var _React$useState = React.useState(() => _isSelected(state)),
43
+ /**
44
+ * Determine the effective button state.
45
+ * Uses controlledState if provided (controlled mode),
46
+ * otherwise falls back to the state prop (uncontrolled mode).
47
+ * This allows the component to work in both controlled and uncontrolled scenarios.
48
+ */
49
+ var effectiveButtonState = controlledState !== null && controlledState !== void 0 ? controlledState : state;
50
+ var _React$useState = React.useState(() => _isSelected(effectiveButtonState)),
43
51
  _React$useState2 = _slicedToArray(_React$useState, 2),
44
52
  isSelected = _React$useState2[0],
45
53
  setIsSelected = _React$useState2[1];
@@ -57,8 +65,8 @@ var MrlButton = /*#__PURE__*/React.forwardRef(function MrlButton(_ref, ref) {
57
65
  */
58
66
  React.useEffect(() => {
59
67
  // allows consumers to set the 'selected' or 'selected-disabled' state from a parent component.
60
- setIsSelected(_isSelected(state));
61
- }, [state]);
68
+ setIsSelected(_isSelected(effectiveButtonState));
69
+ }, [effectiveButtonState]);
62
70
 
63
71
  /**
64
72
  * Handle onClick events
@@ -67,21 +75,21 @@ var MrlButton = /*#__PURE__*/React.forwardRef(function MrlButton(_ref, ref) {
67
75
  */
68
76
  function handleOnClick(e) {
69
77
  e.stopPropagation();
70
- if (_isDisabled(state, loading) || disabled || disableEvents) {
78
+ if (_isDisabled(effectiveButtonState, loading) || disabled || disableEvents) {
71
79
  return;
72
80
  }
73
81
  trackInteraction({
74
82
  action: 'click',
75
83
  variant: kind
76
84
  });
77
- if (isToggleButton) {
85
+ if (isToggleButton && !controlledState) {
78
86
  setIsSelected(prevIsSelected => !prevIsSelected);
79
87
  }
80
88
  if (onClick && typeof onClick === 'function') {
81
89
  onClick(e);
82
90
  }
83
91
  }
84
- var classNames = classnames('mrlButton', "mrlButton--".concat(size), "mrlButton--".concat(kind), state === 'skeleton' && "mrlButton--skeleton", !icon && loading && "mrlButton--loading", isToggleButton && "toggleStyle--".concat(toggleStyle), icon && "mrlButton--icon-".concat(iconPos), className, (attrs === null || attrs === void 0 ? void 0 : attrs.class) || (attrs === null || attrs === void 0 ? void 0 : attrs.className));
92
+ var classNames = classnames('mrlButton', "mrlButton--".concat(size), "mrlButton--".concat(kind), effectiveButtonState === 'skeleton' && "mrlButton--skeleton", !icon && loading && "mrlButton--loading", isToggleButton && "toggleStyle--".concat(toggleStyle), icon && "mrlButton--icon-".concat(iconPos), className, (attrs === null || attrs === void 0 ? void 0 : attrs.class) || (attrs === null || attrs === void 0 ? void 0 : attrs.className));
85
93
  if (attrs && attrs.class) delete attrs.class;
86
94
  if (attrs && attrs.className) delete attrs.className;
87
95
  var spinnerProps = _spinnerProps(kind, size);
@@ -92,7 +100,7 @@ var MrlButton = /*#__PURE__*/React.forwardRef(function MrlButton(_ref, ref) {
92
100
  text: loadingText
93
101
  });
94
102
  var attributes = setAttributes(attrs || {}, _objectSpread2(_objectSpread2({
95
- 'aria-disabled': _isDisabled(state, loading) || disabled
103
+ 'aria-disabled': _isDisabled(effectiveButtonState, loading) || disabled
96
104
  }, isToggleButton && {
97
105
  ["aria-".concat(toggleAria)]: isSelected || false
98
106
  }), {}, {