@muraldevkit/ui-toolkit 4.77.0-dev-yOaq.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 (115) 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/file-upload/MrlFileUpload/MrlFileUpload.js +5 -2
  4. package/dist/cjs/components/file-upload/MrlFileUpload/MrlFileUpload.js.map +1 -1
  5. package/dist/cjs/components/filter/MrlFilterItem/MrlFilterItem.js +2 -1
  6. package/dist/cjs/components/filter/MrlFilterItem/MrlFilterItem.js.map +1 -1
  7. package/dist/cjs/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js.map +1 -1
  8. package/dist/cjs/components/grid/MrlCol/MrlCol.js +49 -42
  9. package/dist/cjs/components/grid/MrlCol/MrlCol.js.map +1 -1
  10. package/dist/cjs/components/grid/MrlGrid/MrlGrid.js +6 -4
  11. package/dist/cjs/components/grid/MrlGrid/MrlGrid.js.map +1 -1
  12. package/dist/cjs/components/grid/MrlRow/MrlRow.js +8 -10
  13. package/dist/cjs/components/grid/MrlRow/MrlRow.js.map +1 -1
  14. package/dist/cjs/components/grid/constants.js +8 -27
  15. package/dist/cjs/components/grid/constants.js.map +1 -1
  16. package/dist/cjs/components/menu/MrlMenu/MrlMenu.js.map +1 -1
  17. package/dist/cjs/components/menu/MrlMenuGroup/MrlMenuGroup.js +4 -1
  18. package/dist/cjs/components/menu/MrlMenuGroup/MrlMenuGroup.js.map +1 -1
  19. package/dist/cjs/components/menu/MrlMenuItem/MrlMenuItem.js +2 -1
  20. package/dist/cjs/components/menu/MrlMenuItem/MrlMenuItem.js.map +1 -1
  21. package/dist/cjs/components/menu/MrlMenuItemLink/MrlMenuItemLink.js +8 -4
  22. package/dist/cjs/components/menu/MrlMenuItemLink/MrlMenuItemLink.js.map +1 -1
  23. package/dist/cjs/components/modal/MrlModalContent/MrlModalContent.js +1 -1
  24. package/dist/cjs/components/modal/MrlModalContent/MrlModalContent.js.map +1 -1
  25. package/dist/cjs/components/modal/MrlModalFooter/MrlModalFooter.js +2 -1
  26. package/dist/cjs/components/modal/MrlModalFooter/MrlModalFooter.js.map +1 -1
  27. package/dist/cjs/components/modal/MrlModalHeader/MrlModalHeader.js +1 -1
  28. package/dist/cjs/components/modal/MrlModalHeader/MrlModalHeader.js.map +1 -1
  29. package/dist/cjs/components/panel/MrlPanel/MrlPanel.js.map +1 -1
  30. package/dist/cjs/components/panel/MrlPanelFooter/MrlPanelFooter.js +2 -1
  31. package/dist/cjs/components/panel/MrlPanelFooter/MrlPanelFooter.js.map +1 -1
  32. package/dist/cjs/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.js +2 -1
  33. package/dist/cjs/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.js.map +1 -1
  34. package/dist/cjs/version.js +1 -1
  35. package/dist/cjs/version.js.map +1 -1
  36. package/dist/components/button/MrlButton/MrlButton.d.ts +6 -0
  37. package/dist/components/filter/MrlFilterItem/MrlFilterItem.d.ts +6 -3
  38. package/dist/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.d.ts +10 -2
  39. package/dist/components/grid/MrlCol/MrlCol.d.ts +6 -4
  40. package/dist/components/grid/MrlCol/index.d.ts +1 -1
  41. package/dist/components/grid/MrlGrid/MrlGrid.d.ts +4 -5
  42. package/dist/components/grid/MrlGrid/index.d.ts +1 -1
  43. package/dist/components/grid/MrlRow/MrlRow.d.ts +7 -7
  44. package/dist/components/grid/MrlRow/index.d.ts +1 -1
  45. package/dist/components/grid/constants.d.ts +6 -20
  46. package/dist/components/menu/MrlMenu/MrlMenu.d.ts +10 -3
  47. package/dist/components/menu/MrlMenuGroup/MrlMenuGroup.d.ts +15 -1
  48. package/dist/components/menu/MrlMenuItem/MrlMenuItem.d.ts +14 -6
  49. package/dist/components/menu/MrlMenuItemLink/MrlMenuItemLink.d.ts +16 -7
  50. package/dist/components/modal/MrlModalContent/MrlModalContent.d.ts +5 -2
  51. package/dist/components/modal/MrlModalFooter/MrlModalFooter.d.ts +4 -2
  52. package/dist/components/modal/MrlModalHeader/MrlModalHeader.d.ts +4 -3
  53. package/dist/components/panel/MrlPanel/MrlPanel.d.ts +2 -1
  54. package/dist/components/panel/MrlPanelFooter/MrlPanelFooter.d.ts +6 -3
  55. package/dist/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.d.ts +4 -2
  56. package/dist/esm/components/button/MrlButton/MrlButton.js +16 -8
  57. package/dist/esm/components/button/MrlButton/MrlButton.js.map +1 -1
  58. package/dist/esm/components/file-upload/MrlFileUpload/MrlFileUpload.js +5 -2
  59. package/dist/esm/components/file-upload/MrlFileUpload/MrlFileUpload.js.map +1 -1
  60. package/dist/esm/components/filter/MrlFilterItem/MrlFilterItem.js +2 -1
  61. package/dist/esm/components/filter/MrlFilterItem/MrlFilterItem.js.map +1 -1
  62. package/dist/esm/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js.map +1 -1
  63. package/dist/esm/components/grid/MrlCol/MrlCol.js +50 -43
  64. package/dist/esm/components/grid/MrlCol/MrlCol.js.map +1 -1
  65. package/dist/esm/components/grid/MrlGrid/MrlGrid.js +6 -4
  66. package/dist/esm/components/grid/MrlGrid/MrlGrid.js.map +1 -1
  67. package/dist/esm/components/grid/MrlRow/MrlRow.js +8 -10
  68. package/dist/esm/components/grid/MrlRow/MrlRow.js.map +1 -1
  69. package/dist/esm/components/grid/constants.js +8 -26
  70. package/dist/esm/components/grid/constants.js.map +1 -1
  71. package/dist/esm/components/menu/MrlMenu/MrlMenu.js.map +1 -1
  72. package/dist/esm/components/menu/MrlMenuGroup/MrlMenuGroup.js +4 -1
  73. package/dist/esm/components/menu/MrlMenuGroup/MrlMenuGroup.js.map +1 -1
  74. package/dist/esm/components/menu/MrlMenuItem/MrlMenuItem.js +2 -1
  75. package/dist/esm/components/menu/MrlMenuItem/MrlMenuItem.js.map +1 -1
  76. package/dist/esm/components/menu/MrlMenuItemLink/MrlMenuItemLink.js +8 -4
  77. package/dist/esm/components/menu/MrlMenuItemLink/MrlMenuItemLink.js.map +1 -1
  78. package/dist/esm/components/modal/MrlModalContent/MrlModalContent.js +1 -1
  79. package/dist/esm/components/modal/MrlModalContent/MrlModalContent.js.map +1 -1
  80. package/dist/esm/components/modal/MrlModalFooter/MrlModalFooter.js +2 -1
  81. package/dist/esm/components/modal/MrlModalFooter/MrlModalFooter.js.map +1 -1
  82. package/dist/esm/components/modal/MrlModalHeader/MrlModalHeader.js +1 -1
  83. package/dist/esm/components/modal/MrlModalHeader/MrlModalHeader.js.map +1 -1
  84. package/dist/esm/components/panel/MrlPanel/MrlPanel.js.map +1 -1
  85. package/dist/esm/components/panel/MrlPanelFooter/MrlPanelFooter.js +2 -1
  86. package/dist/esm/components/panel/MrlPanelFooter/MrlPanelFooter.js.map +1 -1
  87. package/dist/esm/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.js +2 -1
  88. package/dist/esm/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.js.map +1 -1
  89. package/dist/esm/version.js +1 -1
  90. package/dist/esm/version.js.map +1 -1
  91. package/dist/styles/MrlSidebar/module.scss +2 -2
  92. package/dist/styles/grid/global.scss +2 -98
  93. package/dist/styles/grid/variables.scss +18 -2
  94. package/dist/styles.css +6 -1
  95. package/dist/types/components/button/MrlButton/MrlButton.d.ts +6 -0
  96. package/dist/types/components/filter/MrlFilterItem/MrlFilterItem.d.ts +6 -3
  97. package/dist/types/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.d.ts +10 -2
  98. package/dist/types/components/grid/MrlCol/MrlCol.d.ts +6 -4
  99. package/dist/types/components/grid/MrlCol/index.d.ts +1 -1
  100. package/dist/types/components/grid/MrlGrid/MrlGrid.d.ts +4 -5
  101. package/dist/types/components/grid/MrlGrid/index.d.ts +1 -1
  102. package/dist/types/components/grid/MrlRow/MrlRow.d.ts +7 -7
  103. package/dist/types/components/grid/MrlRow/index.d.ts +1 -1
  104. package/dist/types/components/grid/constants.d.ts +6 -20
  105. package/dist/types/components/menu/MrlMenu/MrlMenu.d.ts +10 -3
  106. package/dist/types/components/menu/MrlMenuGroup/MrlMenuGroup.d.ts +15 -1
  107. package/dist/types/components/menu/MrlMenuItem/MrlMenuItem.d.ts +14 -6
  108. package/dist/types/components/menu/MrlMenuItemLink/MrlMenuItemLink.d.ts +16 -7
  109. package/dist/types/components/modal/MrlModalContent/MrlModalContent.d.ts +5 -2
  110. package/dist/types/components/modal/MrlModalFooter/MrlModalFooter.d.ts +4 -2
  111. package/dist/types/components/modal/MrlModalHeader/MrlModalHeader.d.ts +4 -3
  112. package/dist/types/components/panel/MrlPanel/MrlPanel.d.ts +2 -1
  113. package/dist/types/components/panel/MrlPanelFooter/MrlPanelFooter.d.ts +6 -3
  114. package/dist/types/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.d.ts +4 -2
  115. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MrlMenuItemLink.js","sources":["../../../../../src/components/menu/MrlMenuItemLink/MrlMenuItemLink.tsx"],"sourcesContent":["import * as React from 'react';\nimport { linkOpen } from '@muraldevkit/ds-icons';\nimport classnames from 'classnames';\nimport { DSIconType, MrlSvg } from '../../svg/MrlSvg/MrlSvg';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\nimport styles from '../MrlMenuItem/MrlMenuItem.module.scss';\n\nexport interface MrlMenuItemLinkProps {\n\t/** ID for associated description */\n\tariaDescribedBy?: string;\n\n\t/**\n\t Children to be rendered within the menu component\n\t */\n\tchildren: React.ReactNode | string;\n\n\t/** Class names for the menu item */\n\tclassName?: string;\n\n\t/** If the menu item is disabled */\n\tdisabled?: boolean;\n\n\t/** Href for the menu item */\n\thref: string;\n\n\t/** Icon for menu item */\n\ticon?: DSIconType;\n\n\t/** Target for links */\n\ttarget?: string;\n\n\t/** Unique ID for the menu item */\n\tid?: string;\n\n\t/** Callback to be called when the menu item is clicked */\n\tonClick?: (e: React.MouseEvent<HTMLElement>) => void;\n\n\t/** Data-qa attribute for the menu item */\n\tdataQa?: string;\n\n\t/** If the menu item is selected */\n\tselected?: boolean;\n\n\t/** Rel attr for the menu item */\n\trel?: string;\n\n\t/**\n\t * Enables interaction tracking for this menu item. Provide a stable, non-PII id\n\t * (e.g. 'help-menu-docs'). When omitted, the menu item emits no analytics.\n\t */\n\teventId?: string;\n}\n\n/**\n * MrlMenuItem component\n *\n * Renders a menu item to be used within the MrlMenu component\n * @param {MrlMenuItemLinkProps} props - The props for the MrlMenuItem component\n * @returns {Element} - rendered MrlMenuItem component\n */\nexport function MrlMenuItemLink({\n\tariaDescribedBy,\n\tchildren,\n\tclassName,\n\tdataQa,\n\tdisabled,\n\thref,\n\ticon,\n\tid,\n\tonClick,\n\tselected,\n\ttarget = '_self',\n\teventId,\n\t...rest\n}: MrlMenuItemLinkProps): JSX.Element {\n\tconst trackInteraction = useMrlTrackInteraction('MrlMenuItemLink', eventId);\n\n\tconst handleClick = (e: React.MouseEvent<HTMLElement>): void => {\n\t\ttrackInteraction({ action: 'click', metadata: { target } });\n\n\t\tonClick?.(e);\n\t};\n\n\tconst handleDisabled = (e: React.MouseEvent<HTMLElement>): void => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t};\n\n\tconst menuItemClasses = classnames(styles['MrlMenuItem'], 'MrlMenuItem', className);\n\tconst menuTriggerClasses = classnames(styles['MrlMenuItem--item'], 'MrlMenuItem--item');\n\n\tconst isExternalLink = target === '_blank';\n\tconst linkRel = isExternalLink ? 'noopener noreferrer' : rest.rel;\n\n\treturn (\n\t\t<li className={menuItemClasses} data-qa={dataQa}>\n\t\t\t<a\n\t\t\t\t{...rest}\n\t\t\t\taria-describedby={ariaDescribedBy}\n\t\t\t\taria-disabled={disabled}\n\t\t\t\tdata-selected={selected}\n\t\t\t\tdata-qa={dataQa && `${dataQa}-button`}\n\t\t\t\tid={id}\n\t\t\t\trole=\"menuitem\"\n\t\t\t\tonClick={disabled ? handleDisabled : handleClick}\n\t\t\t\tclassName={menuTriggerClasses}\n\t\t\t\trel={linkRel}\n\t\t\t\thref={href}\n\t\t\t\ttarget={target}\n\t\t\t>\n\t\t\t\t{icon && (\n\t\t\t\t\t<span className={styles['MrlMenuItem--item--submenuIcon-left']}>\n\t\t\t\t\t\t<MrlSvg size=\"small\" svg={icon} />\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t{children}\n\t\t\t\t{isExternalLink && (\n\t\t\t\t\t<span className={styles['MrlMenuItem--item--icon-right']}>\n\t\t\t\t\t\t<span className={styles['MrlMenuItem--item--linkOpenIcon']}>\n\t\t\t\t\t\t\t<MrlSvg svg={linkOpen} size=\"auto\" />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t</a>\n\t\t</li>\n\t);\n}\n"],"names":["MrlMenuItemLink","_ref","ariaDescribedBy","children","className","dataQa","disabled","href","icon","id","onClick","selected","_ref$target","target","eventId","rest","_objectWithoutProperties","_excluded","trackInteraction","useMrlTrackInteraction","handleClick","e","action","metadata","handleDisabled","preventDefault","stopPropagation","menuItemClasses","classnames","styles","menuTriggerClasses","isExternalLink","linkRel","rel","React","createElement","_extends","concat","role","MrlSvg","size","svg","linkOpen"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAeA,CAAAC,IAAA,EAcO;AAAA,EAAA,IAbrCC,eAAe,GAAAD,IAAA,CAAfC,eAAe;IACfC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,MAAM,GAAAJ,IAAA,CAANI,MAAM;IACNC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IACRC,IAAI,GAAAN,IAAA,CAAJM,IAAI;IACJC,IAAI,GAAAP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","sources":["../../../../../src/components/menu/MrlMenuItemLink/MrlMenuItemLink.tsx"],"sourcesContent":["import * as React from 'react';\nimport { linkOpen } from '@muraldevkit/ds-icons';\nimport classnames from 'classnames';\nimport { DSIconType, MrlSvg } from '../../svg/MrlSvg/MrlSvg';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\nimport styles from '../MrlMenuItem/MrlMenuItem.module.scss';\n\nexport interface MrlMenuItemLinkProps {\n\t/** ID for associated description */\n\tariaDescribedBy?: string;\n\n\t/**\n\t Children to be rendered within the menu component\n\t */\n\tchildren: React.ReactNode | string;\n\n\t/** Class names for the menu item */\n\tclassName?: string;\n\n\t/** Disables the link: it stays focusable (`aria-disabled`) but does not navigate */\n\tdisabled?: boolean;\n\n\t/** Href for the menu item */\n\thref: string;\n\n\t/** Icon for menu item */\n\ticon?: DSIconType;\n\n\t/**\n\t * Anchor target. `_blank` marks the link as external: `rel` becomes `noopener noreferrer`\n\t * and a trailing external-link icon is shown.\n\t *\n\t * @default '_self'\n\t */\n\ttarget?: string;\n\n\t/** Unique ID for the menu item */\n\tid?: string;\n\n\t/** Callback to be called when the menu item is clicked */\n\tonClick?: (e: React.MouseEvent<HTMLElement>) => void;\n\n\t/** Data-qa attribute for the menu item */\n\tdataQa?: string;\n\n\t/** If the menu item is selected */\n\tselected?: boolean;\n\n\t/** Rel attribute of the anchor; replaced by `noopener noreferrer` when `target` is `_blank` */\n\trel?: string;\n\n\t/**\n\t * Enables interaction tracking for this menu item. Provide a stable, non-PII id\n\t * (e.g. 'help-menu-docs'). When omitted, the menu item emits no analytics.\n\t */\n\teventId?: string;\n}\n\n/**\n * MrlMenuItemLink component\n *\n * Renders a menu item that navigates to a URL (an anchor with `role=\"menuitem\"`), to be used\n * within the MrlMenu component. Links opened with `target=\"_blank\"` get\n * `rel=\"noopener noreferrer\"` and a trailing external-link icon.\n * Unlike `MrlMenuItem`, it does not close the menu on activation; close it from `onClick`\n * when the navigation keeps the page alive (same-page `#hash` links, `target=\"_blank\"`).\n * @param {MrlMenuItemLinkProps} props - The props for the MrlMenuItemLink component\n * @returns {Element} - rendered MrlMenuItemLink component\n */\nexport function MrlMenuItemLink({\n\tariaDescribedBy,\n\tchildren,\n\tclassName,\n\tdataQa,\n\tdisabled,\n\thref,\n\ticon,\n\tid,\n\tonClick,\n\tselected,\n\ttarget = '_self',\n\teventId,\n\t...rest\n}: MrlMenuItemLinkProps): JSX.Element {\n\tconst trackInteraction = useMrlTrackInteraction('MrlMenuItemLink', eventId);\n\n\tconst handleClick = (e: React.MouseEvent<HTMLElement>): void => {\n\t\ttrackInteraction({ action: 'click', metadata: { target } });\n\n\t\tonClick?.(e);\n\t};\n\n\tconst handleDisabled = (e: React.MouseEvent<HTMLElement>): void => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t};\n\n\tconst menuItemClasses = classnames(styles['MrlMenuItem'], 'MrlMenuItem', className);\n\tconst menuTriggerClasses = classnames(styles['MrlMenuItem--item'], 'MrlMenuItem--item');\n\n\tconst isExternalLink = target === '_blank';\n\tconst linkRel = isExternalLink ? 'noopener noreferrer' : rest.rel;\n\n\treturn (\n\t\t<li className={menuItemClasses} data-qa={dataQa}>\n\t\t\t<a\n\t\t\t\t{...rest}\n\t\t\t\taria-describedby={ariaDescribedBy}\n\t\t\t\taria-disabled={disabled}\n\t\t\t\tdata-selected={selected}\n\t\t\t\tdata-qa={dataQa && `${dataQa}-button`}\n\t\t\t\tid={id}\n\t\t\t\trole=\"menuitem\"\n\t\t\t\tonClick={disabled ? handleDisabled : handleClick}\n\t\t\t\tclassName={menuTriggerClasses}\n\t\t\t\trel={linkRel}\n\t\t\t\thref={href}\n\t\t\t\ttarget={target}\n\t\t\t>\n\t\t\t\t{icon && (\n\t\t\t\t\t<span className={styles['MrlMenuItem--item--submenuIcon-left']}>\n\t\t\t\t\t\t<MrlSvg size=\"small\" svg={icon} />\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t{children}\n\t\t\t\t{isExternalLink && (\n\t\t\t\t\t<span className={styles['MrlMenuItem--item--icon-right']}>\n\t\t\t\t\t\t<span className={styles['MrlMenuItem--item--linkOpenIcon']}>\n\t\t\t\t\t\t\t<MrlSvg svg={linkOpen} size=\"auto\" />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t</a>\n\t\t</li>\n\t);\n}\n"],"names":["MrlMenuItemLink","_ref","ariaDescribedBy","children","className","dataQa","disabled","href","icon","id","onClick","selected","_ref$target","target","eventId","rest","_objectWithoutProperties","_excluded","trackInteraction","useMrlTrackInteraction","handleClick","e","action","metadata","handleDisabled","preventDefault","stopPropagation","menuItemClasses","classnames","styles","menuTriggerClasses","isExternalLink","linkRel","rel","React","createElement","_extends","concat","role","MrlSvg","size","svg","linkOpen"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAeA,CAAAC,IAAA,EAcO;AAAA,EAAA,IAbrCC,eAAe,GAAAD,IAAA,CAAfC,eAAe;IACfC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,MAAM,GAAAJ,IAAA,CAANI,MAAM;IACNC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IACRC,IAAI,GAAAN,IAAA,CAAJM,IAAI;IACJC,IAAI,GAAAP,IAAA,CAAJO,IAAI;IACJC,EAAE,GAAAR,IAAA,CAAFQ,EAAE;IACFC,OAAO,GAAAT,IAAA,CAAPS,OAAO;IACPC,QAAQ,GAAAV,IAAA,CAARU,QAAQ;IAAAC,WAAA,GAAAX,IAAA,CACRY,MAAM;AAANA,IAAAA,MAAM,GAAAD,WAAA,KAAA,MAAA,GAAG,OAAO,GAAAA,WAAA;IAChBE,OAAO,GAAAb,IAAA,CAAPa,OAAO;AACJC,IAAAA,IAAI,GAAAC,iDAAA,CAAAf,IA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B,IAAAA,IAAI,EAAC,UAAU;AACf5B,IAAAA,OAAO,EAAEJ,QAAQ,GAAGkB,cAAc,GAAGJ,WAAY;AACjDhB,IAAAA,SAAS,EAAE0B,kBAAmB;AAC9BG,IAAAA,GAAG,EAAED,OAAQ;AACbzB,IAAAA,IAAI,EAAEA,IAAK;AACXM,IAAAA,MAAM,EAAEA;AAAO,GAAA,CAAA,EAEdL,IAAI,iBACJ0B,gBAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;IAAM/B,SAAS,EAAEyB,0BAAM,CAAC,qCAAqC;AAAE,GAAA,eAC9DK,gBAAA,CAAAC,aAAA,CAACI,aAAM,EAAA;AAACC,IAAAA,IAAI,EAAC,OAAO;AAACC,IAAAA,GAAG,EAAEjC;GAAO,CAC5B,CACN,EACAL,QAAQ,EACR4B,cAAc,iBACdG,gBAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;IAAM/B,SAAS,EAAEyB,0BAAM,CAAC,+BAA+B;GAAE,eACxDK,gBAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;IAAM/B,SAAS,EAAEyB,0BAAM,CAAC,iCAAiC;AAAE,GAAA,eAC1DK,gBAAA,CAAAC,aAAA,CAACI,aAAM,EAAA;AAACE,IAAAA,GAAG,EAAEC,gBAAS;AAACF,IAAAA,IAAI,EAAC;AAAM,GAAE,CAC/B,CACD,CAEL,CACA,CAAC;AAEP;;;;"}
@@ -34,7 +34,7 @@ var classnames__default = /*#__PURE__*/_interopDefault(classnames);
34
34
 
35
35
  var _excluded = ["children", "className"];
36
36
  /**
37
- * Modal Content component for the MrlModal
37
+ * Modal Content component for the MrlModal. Must be rendered inside `MrlModal`.
38
38
  * @param {object} props - The props object
39
39
  * @param {React.ReactElement} props.children - The children to be rendered within the component
40
40
  * @returns {React.ReactElement}} The rendered MrlModalContent component
@@ -1 +1 @@
1
- {"version":3,"file":"MrlModalContent.js","sources":["../../../../../src/components/modal/MrlModalContent/MrlModalContent.tsx"],"sourcesContent":["import * as React from 'react';\nimport classNames from 'classnames';\nimport { isElementScrollable } from '../../../utils/isElementScrollable';\n\nimport styles from './MrlModalContent.module.scss';\nimport { useMrlModalContext } from '../MrlModalContext';\nimport { hasScrollContent } from '../../../utils/hasScrollContent/hasScrollContent';\nimport { useHasFocusableDescendant } from '../../../hooks/useHasFocusableDescendant';\n\ninterface MrlModalContentProps {\n\t/**\n\t * Children to be rendered within the component.\n\t */\n\tchildren: React.ReactElement | React.ReactElement[];\n\n\t/**\n\t * Wrapper Class\n\t */\n\tclassName?: string;\n}\n\n/**\n * Modal Content component for the MrlModal\n * @param {object} props - The props object\n * @param {React.ReactElement} props.children - The children to be rendered within the component\n * @returns {React.ReactElement}} The rendered MrlModalContent component\n */\nexport const MrlModalContent = ({\n\tchildren,\n\tclassName,\n\t...rest\n}: MrlModalContentProps): JSX.Element => {\n\tconst { scrollableContent, setScrollableContent, title } = useMrlModalContext();\n\tconst contentAreaRef = React.useRef<HTMLDivElement>(null);\n\tconst hasFocusableDescendant = useHasFocusableDescendant(contentAreaRef);\n\n\tReact.useEffect(() => {\n\t\tif (!contentAreaRef.current) return;\n\n\t\t/**\n\t\t * Sets up observer to toggle tabindex value on the scrollable region within the modal. When\n\t\t * the content area is overflowed and has no focusable descendants, we want to set tabindex\n\t\t * to 0 so that keyboard-only users can scroll through the content. Per ACT rule 0ssw9k a\n\t\t * scrollable region passes WCAG 2.1.1 Keyboard either by being focusable itself or by having\n\t\t * a focusable descendant, so we omit `tabindex=\"0\"` whenever a descendant control is\n\t\t * already keyboard reachable. The labeled `role=\"region\"` is preserved whenever the modal\n\t\t * content overflows so screen-reader users get a landmark in either case.\n\t\t * https://www.w3.org/WAI/standards-guidelines/act/rules/0ssw9k/\n\t\t */\n\t\tconst contentArea = contentAreaRef.current;\n\n\t\tcontentArea.addEventListener('scroll', () => {\n\t\t\tsetScrollableContent({\n\t\t\t\t...hasScrollContent(contentArea),\n\t\t\t\tisContentScrollable: isElementScrollable(contentArea)\n\t\t\t});\n\t\t});\n\n\t\tconst observer = new ResizeObserver(() => {\n\t\t\tsetScrollableContent({\n\t\t\t\t...hasScrollContent(contentArea),\n\t\t\t\tisContentScrollable: isElementScrollable(contentArea)\n\t\t\t});\n\t\t});\n\n\t\tobserver.observe(contentArea);\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [setScrollableContent]);\n\n\tconst contentClasses = classNames('mrl-modal-content', className, styles['mrl-modal-content'], {\n\t\t'mrl-modal-content-scrollable': scrollableContent.isContentScrollable\n\t});\n\n\treturn (\n\t\t<div\n\t\t\t{...rest}\n\t\t\tref={contentAreaRef}\n\t\t\tclassName={contentClasses}\n\t\t\t{...(scrollableContent.isContentScrollable && {\n\t\t\t\t'aria-label': title ? `${title} modal scrollable content` : 'modal scrollable content',\n\t\t\t\trole: 'region',\n\t\t\t\t...(!hasFocusableDescendant && { tabIndex: 0 })\n\t\t\t})}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t);\n};\n"],"names":["MrlModalContent","_ref","children","className","rest","_objectWithoutProperties","_excluded","_useMrlModalContext","useMrlModalContext","scrollableContent","setScrollableContent","title","contentAreaRef","React","useRef","hasFocusableDescendant","useHasFocusableDescendant","useEffect","current","contentArea","addEventListener","_objectSpread","hasScrollContent","isContentScrollable","isElementScrollable","observer","ResizeObserver","observe","disconnect","contentClasses","classNames","styles","createElement","_extends","ref","concat","role","tabIndex"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,eAAe,GAAGC,IAAA,IAIU;AAAA,EAAA,IAHxCC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,SAAS,GAAAF,IAAA,CAATE,SAAS;AACNC,IAAAA,IAAI,GAAAC,iDAAA,CAAAJ,IAAA,EAAAK,SAAA,CAAA;AAEP,EAAA,IAAAC,mBAAA,GAA2DC,kCAAkB,EAAE;IAAvEC,iBAAiB,GAAAF,mBAAA,CAAjBE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BAAiB,CAACc;AACnD,GAAC,CAAC;AAEF,EAAA,oBACCV,gBAAA,CAAAmB,aAAA,CAAA,KAAA,EAAAC,iCAAA,KACK7B,IAAI,EAAA;AACR8B,IAAAA,GAAG,EAAEtB,cAAe;AACpBT,IAAAA,SAAS,EAAE0B;AAAe,GAAA,EACrBpB,iBAAiB,CAACc,mBAAmB,IAAAF,uCAAA,CAAA;AACzC,IAAA,YAAY,EAAEV,KAAK,GAAA,EAAA,CAAAwB,MAAA,CAAMxB,KAAK,iCAA8B,0BAA0B;AACtFyB,IAAAA,IAAI,EAAE;GAAQ,EACV,CAACrB,sBAAsB,IAAI;AAAEsB,IAAAA,QAAQ,EAAE;GAAG,CAC9C,CAAA,EAEAnC,QACG,CAAC;AAER;;;;"}
1
+ {"version":3,"file":"MrlModalContent.js","sources":["../../../../../src/components/modal/MrlModalContent/MrlModalContent.tsx"],"sourcesContent":["import * as React from 'react';\nimport classNames from 'classnames';\nimport { isElementScrollable } from '../../../utils/isElementScrollable';\n\nimport styles from './MrlModalContent.module.scss';\nimport { useMrlModalContext } from '../MrlModalContext';\nimport { hasScrollContent } from '../../../utils/hasScrollContent/hasScrollContent';\nimport { useHasFocusableDescendant } from '../../../hooks/useHasFocusableDescendant';\n\ninterface MrlModalContentProps {\n\t/**\n\t * Body of the modal, rendered between `MrlModalHeader` and `MrlModalFooter`. When it\n\t * overflows, this is the modal's only scrolling area: it is exposed as a `region` labelled\n\t * from the header text, and is focusable (`tabindex=\"0\"`) only when it contains no focusable\n\t * elements, so keyboard users can still scroll it.\n\t */\n\tchildren: React.ReactElement | React.ReactElement[];\n\n\t/**\n\t * Wrapper Class\n\t */\n\tclassName?: string;\n}\n\n/**\n * Modal Content component for the MrlModal. Must be rendered inside `MrlModal`.\n * @param {object} props - The props object\n * @param {React.ReactElement} props.children - The children to be rendered within the component\n * @returns {React.ReactElement}} The rendered MrlModalContent component\n */\nexport const MrlModalContent = ({\n\tchildren,\n\tclassName,\n\t...rest\n}: MrlModalContentProps): JSX.Element => {\n\tconst { scrollableContent, setScrollableContent, title } = useMrlModalContext();\n\tconst contentAreaRef = React.useRef<HTMLDivElement>(null);\n\tconst hasFocusableDescendant = useHasFocusableDescendant(contentAreaRef);\n\n\tReact.useEffect(() => {\n\t\tif (!contentAreaRef.current) return;\n\n\t\t/**\n\t\t * Sets up observer to toggle tabindex value on the scrollable region within the modal. When\n\t\t * the content area is overflowed and has no focusable descendants, we want to set tabindex\n\t\t * to 0 so that keyboard-only users can scroll through the content. Per ACT rule 0ssw9k a\n\t\t * scrollable region passes WCAG 2.1.1 Keyboard either by being focusable itself or by having\n\t\t * a focusable descendant, so we omit `tabindex=\"0\"` whenever a descendant control is\n\t\t * already keyboard reachable. The labeled `role=\"region\"` is preserved whenever the modal\n\t\t * content overflows so screen-reader users get a landmark in either case.\n\t\t * https://www.w3.org/WAI/standards-guidelines/act/rules/0ssw9k/\n\t\t */\n\t\tconst contentArea = contentAreaRef.current;\n\n\t\tcontentArea.addEventListener('scroll', () => {\n\t\t\tsetScrollableContent({\n\t\t\t\t...hasScrollContent(contentArea),\n\t\t\t\tisContentScrollable: isElementScrollable(contentArea)\n\t\t\t});\n\t\t});\n\n\t\tconst observer = new ResizeObserver(() => {\n\t\t\tsetScrollableContent({\n\t\t\t\t...hasScrollContent(contentArea),\n\t\t\t\tisContentScrollable: isElementScrollable(contentArea)\n\t\t\t});\n\t\t});\n\n\t\tobserver.observe(contentArea);\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [setScrollableContent]);\n\n\tconst contentClasses = classNames('mrl-modal-content', className, styles['mrl-modal-content'], {\n\t\t'mrl-modal-content-scrollable': scrollableContent.isContentScrollable\n\t});\n\n\treturn (\n\t\t<div\n\t\t\t{...rest}\n\t\t\tref={contentAreaRef}\n\t\t\tclassName={contentClasses}\n\t\t\t{...(scrollableContent.isContentScrollable && {\n\t\t\t\t'aria-label': title ? `${title} modal scrollable content` : 'modal scrollable content',\n\t\t\t\trole: 'region',\n\t\t\t\t...(!hasFocusableDescendant && { tabIndex: 0 })\n\t\t\t})}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t);\n};\n"],"names":["MrlModalContent","_ref","children","className","rest","_objectWithoutProperties","_excluded","_useMrlModalContext","useMrlModalContext","scrollableContent","setScrollableContent","title","contentAreaRef","React","useRef","hasFocusableDescendant","useHasFocusableDescendant","useEffect","current","contentArea","addEventListener","_objectSpread","hasScrollContent","isContentScrollable","isElementScrollable","observer","ResizeObserver","observe","disconnect","contentClasses","classNames","styles","createElement","_extends","ref","concat","role","tabIndex"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,eAAe,GAAGC,IAAA,IAIU;AAAA,EAAA,IAHxCC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,SAAS,GAAAF,IAAA,CAATE,SAAS;AACNC,IAAAA,IAAI,GAAAC,iDAAA,CAAAJ,IAAA,EAAAK,SAAA,CAAA;AAEP,EAAA,IAAAC,mBAAA,GAA2DC,kCAAkB,EAAE;IAAvEC,iBAAiB,GAAAF,mBAAA,CAAjBE,iBAAiB;IAAEC,oBAAoB,GAAAH,mBAAA,CAApBG,oBAAoB;IAAEC,KAAK,GAAAJ,mBAAA,CAALI,KAAK;AACtD,EAAA,IAAMC,cAAc,GAAGC,gBAAK,CAACC,MAAM,CAAiB,IAAI,CAAC;AACzD,EAAA,IAAMC,sBAAsB,GAAGC,+BAAyB,CAACJ,cAAc,CAAC;EAExEC,gBAAK,CAACI,SAAS,CAAC,MAAM;AACrB,IAAA,IAAI,CAACL,cAAc,CAACM,OAAO,EAAE;;AAE7B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACE,IAAA,IAAMC,WAAW,GAAGP,cAAc,CAACM,OAAO;AAE1CC,IAAAA,WAAW,CAACC,gBAAgB,CAAC,QAAQ,EAAE,MAAM;MAC5CV,oBAAoB,CAAAW,u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*#__PURE__*/_interopDefault(classnames);
33
33
 
34
34
  var _excluded = ["attrs", "children", "className"];
35
35
  /**
36
- * Modal Footer component for the MrlModal
36
+ * Modal Footer component for the MrlModal. Must be rendered inside `MrlModal`, after
37
+ * `MrlModalContent`.
37
38
  * @param {AttrsObject} attrs - Additional HTML attributes for the `mrl-modal` element
38
39
  * @returns {React.ReactElement} The rendered MrlModalFooter component
39
40
  */
@@ -1 +1 @@
1
- {"version":3,"file":"MrlModalFooter.js","sources":["../../../../../src/components/modal/MrlModalFooter/MrlModalFooter.tsx"],"sourcesContent":["import * as React from 'react';\nimport { AttrsObject, MrlComponentProps, setAttributes } from '../../../utils';\nimport classNames from 'classnames';\n\nimport styles from './MrlModalFooter.module.scss';\nimport './MrlModalFooter.global.scss';\nimport { useBreakpoint } from '../../../hooks/useBreakpoint';\nimport { useMrlModalContext } from '../MrlModalContext';\n\ninterface MrlModalFooterProps extends MrlComponentProps {\n\t/**\n\t * Content of the modal footer\n\t */\n\tchildren?: React.ReactElement | React.ReactElement[];\n\n\t/**\n\t * Wrapper Class\n\t */\n\tclassName?: string;\n}\n\n/**\n * Modal Footer component for the MrlModal\n * @param {AttrsObject} attrs - Additional HTML attributes for the `mrl-modal` element\n * @returns {React.ReactElement} The rendered MrlModalFooter component\n */\nexport const MrlModalFooter = ({\n\tattrs = {},\n\tchildren,\n\tclassName,\n\t...rest\n}: MrlModalFooterProps): JSX.Element => {\n\tconst { scrollableContent } = useMrlModalContext();\n\tconst breakpoint = useBreakpoint();\n\tconst attributes = setAttributes(attrs);\n\tconst modalFooterClasses = classNames(className, 'mrl-modal-footer', styles['mrl-modal-footer'], {\n\t\t[styles['slotted']]: breakpoint === 'xs',\n\t\t[styles['mrl-modal-scroll-shadow-bottom']]: scrollableContent.hasScrollBottom\n\t});\n\n\tdelete attributes.class;\n\tdelete attributes.className;\n\n\treturn (\n\t\t<div {...rest} {...attributes} className={modalFooterClasses}>\n\t\t\t<div className={classNames('mrl-modal-footer-wrapper', styles['mrl-modal-footer-wrapper'])}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n"],"names":["MrlModalFooter","_ref","_ref$attrs","attrs","children","className","rest","_objectWithoutProperties","_excluded","_useMrlModalContext","useMrlModalContext","scrollableContent","breakpoint","useBreakpoint","attributes","setAttributes","modalFooterClasses","classNames","styles","hasScrollBottom","class","React","createElement","_extends"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA;AACA;AACA;AACA;AACA;AACO,IAAMA,cAAc,GAAGC,IAAA,IAKU;AAAA,EAAA,IAAAC,UAAA,GAAAD,IAAA,CAJvCE,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,UAAA;IACVE,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,SAAS,GAAAJ,IAAA,CAATI,SAAS;AACNC,IAAAA,IAAI,GAAAC,iDAAA,CAAAN,IAAA,EAAAO,SAAA,CAAA;AAEP,EAAA,IAAAC,mBAAA,GAA8BC,kCAAkB,EAAE;IAA1CC,iBAAiB,GAAAF,mBAAA,CAAjBE,iBAAiB;AACzB,EAAA,IAAMC,UAAU,GAAGC,mBAAa,EAAE;AAClC,EAAA,IAAMC,UAAU,GAAGC,2BAAa,CAACZ,KAAK,CAAC;AACvC,EAAA,IAAMa,kBAAkB,GAAGC,2BAAU,CAACZ,SAAS,EAAE,kBAAkB,EAAEa,6BAAM,CAAC,kBAAkB,CAAC,EAAE;AAChG,IAAA,CAACA,6BAAM,CAAC,SAAS,CAAC,GAAGN,UAAU,KAAK,IAAI;AACxC,IAAA,CAACM,6BAAM,CAAC,gCAAgC,CAAC,GAAGP,iBAAiB,CAACQ;AAC/D,GAAC,CAAC;EAEF,OAAOL,UAAU,CAACM,KAAK;EACvB,OAAON,UAAU,CAACT,SAAS;EAE3B,oBACCgB,gBAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,iCAAA,CAAA,EAAA,EAASjB,IAAI,EAAMQ,UAAU,EAAA;AAAET,IAAAA,SAAS,EAAEW;GAAmB,CAAA,eAC5DK,gBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;IAAKjB,SAAS,EAAEY,2BAAU,CAAC,0BAA0B,EAAEC,6BAAM,CAAC,0BAA0B,CAAC;GAAE,EACzFd,QACG,CACD,CAAC;AAER;;;;"}
1
+ {"version":3,"file":"MrlModalFooter.js","sources":["../../../../../src/components/modal/MrlModalFooter/MrlModalFooter.tsx"],"sourcesContent":["import * as React from 'react';\nimport { AttrsObject, MrlComponentProps, setAttributes } from '../../../utils';\nimport classNames from 'classnames';\n\nimport styles from './MrlModalFooter.module.scss';\nimport './MrlModalFooter.global.scss';\nimport { useBreakpoint } from '../../../hooks/useBreakpoint';\nimport { useMrlModalContext } from '../MrlModalContext';\n\ninterface MrlModalFooterProps extends MrlComponentProps {\n\t/**\n\t * Actions of the modal, laid out in a row and stacked at full width on the `xs` breakpoint.\n\t * Order them from least to most prominent, ending with the primary action.\n\t */\n\tchildren?: React.ReactElement | React.ReactElement[];\n\n\t/**\n\t * Wrapper Class\n\t */\n\tclassName?: string;\n}\n\n/**\n * Modal Footer component for the MrlModal. Must be rendered inside `MrlModal`, after\n * `MrlModalContent`.\n * @param {AttrsObject} attrs - Additional HTML attributes for the `mrl-modal` element\n * @returns {React.ReactElement} The rendered MrlModalFooter component\n */\nexport const MrlModalFooter = ({\n\tattrs = {},\n\tchildren,\n\tclassName,\n\t...rest\n}: MrlModalFooterProps): JSX.Element => {\n\tconst { scrollableContent } = useMrlModalContext();\n\tconst breakpoint = useBreakpoint();\n\tconst attributes = setAttributes(attrs);\n\tconst modalFooterClasses = classNames(className, 'mrl-modal-footer', styles['mrl-modal-footer'], {\n\t\t[styles['slotted']]: breakpoint === 'xs',\n\t\t[styles['mrl-modal-scroll-shadow-bottom']]: scrollableContent.hasScrollBottom\n\t});\n\n\tdelete attributes.class;\n\tdelete attributes.className;\n\n\treturn (\n\t\t<div {...rest} {...attributes} className={modalFooterClasses}>\n\t\t\t<div className={classNames('mrl-modal-footer-wrapper', styles['mrl-modal-footer-wrapper'])}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n"],"names":["MrlModalFooter","_ref","_ref$attrs","attrs","children","className","rest","_objectWithoutProperties","_excluded","_useMrlModalContext","useMrlModalContext","scrollableContent","breakpoint","useBreakpoint","attributes","setAttributes","modalFooterClasses","classNames","styles","hasScrollBottom","class","React","createElement","_extends"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,cAAc,GAAGC,IAAA,IAKU;AAAA,EAAA,IAAAC,UAAA,GAAAD,IAAA,CAJvCE,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,UAAA;IACVE,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,SAAS,GAAAJ,IAAA,CAATI,SAAS;AACNC,IAAAA,IAAI,GAAAC,iDAAA,CAAAN,IAAA,EAAAO,SAAA,CAAA;AAEP,EAAA,IAAAC,mBAAA,GAA8BC,kCAAkB,EAAE;IAA1CC,iBAAiB,GAAAF,mBAAA,CAAjBE,iBAAiB;AACzB,EAAA,IAAMC,UAAU,GAAGC,mBAAa,EAAE;AAClC,EAAA,IAAMC,UAAU,GAAGC,2BAAa,CAACZ,KAAK,CAAC;AACvC,EAAA,IAAMa,kBAAkB,GAAGC,2BAAU,CAACZ,SAAS,EAAE,kBAAkB,EAAEa,6BAAM,CAAC,kBAAkB,CAAC,EAAE;AAChG,IAAA,CAACA,6BAAM,CAAC,SAAS,CAAC,GAAGN,UAAU,KAAK,IAAI;AACxC,IAAA,CAACM,6BAAM,CAAC,gCAAgC,CAAC,GAAGP,iBAAiB,CAACQ;AAC/D,GAAC,CAAC;EAEF,OAAOL,UAAU,CAACM,KAAK;EACvB,OAAON,UAAU,CAACT,SAAS;EAE3B,oBACCgB,gBAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,iCAAA,CAAA,EAAA,EAASjB,IAAI,EAAMQ,UAAU,EAAA;AAAET,IAAAA,SAAS,EAAEW;GAAmB,CAAA,eAC5DK,gBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;IAAKjB,SAAS,EAAEY,2BAAU,CAAC,0BAA0B,EAAEC,6BAAM,CAAC,0BAA0B,CAAC;GAAE,EACzFd,QACG,CACD,CAAC;AAER;;;;"}
@@ -33,7 +33,7 @@ var classnames__default = /*#__PURE__*/_interopDefault(classnames);
33
33
 
34
34
  var _excluded = ["attrs", "children", "className", "text"];
35
35
  /**
36
- * Modal Header component for the MrlModal.
36
+ * Modal Header component for the MrlModal. Must be rendered inside `MrlModal`.
37
37
  * @param {MrlModalHeaderProps} props - The props for the MrlModalFooter component
38
38
  * @param {AttrsObject} props.attrs - Additional HTML attributes for the `mrl-modal` element
39
39
  * @returns {React.ReactElement} The rendered MrlModalFooter component
@@ -1 +1 @@
1
- {"version":3,"file":"MrlModalHeader.js","sources":["../../../../../src/components/modal/MrlModalHeader/MrlModalHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { AttrsObject, MrlComponentProps, setAttributes } from '../../../utils';\nimport classNames from 'classnames';\nimport { MrlTextHeading } from '../../text/MrlTextHeading/MrlTextHeading';\n\nimport styles from './MrlModalHeader.module.scss';\nimport { useMrlModalContext } from '../MrlModalContext';\n\nexport interface MrlModalHeaderProps extends MrlComponentProps {\n\t/**\n\t * Content of the modal header\n\t */\n\tchildren?: React.ReactNode;\n\n\t/**\n\t * Wrapper Class\n\t */\n\tclassName?: string;\n\n\t/**\n\t * Text the h1 element of modal header\n\t */\n\ttext: string;\n}\n\n/**\n * Modal Header component for the MrlModal.\n * @param {MrlModalHeaderProps} props - The props for the MrlModalFooter component\n * @param {AttrsObject} props.attrs - Additional HTML attributes for the `mrl-modal` element\n * @returns {React.ReactElement} The rendered MrlModalFooter component\n */\nexport const MrlModalHeader = ({\n\tattrs = {},\n\tchildren,\n\tclassName,\n\ttext,\n\t...rest\n}: MrlModalHeaderProps): JSX.Element => {\n\tconst { scrollableContent, setTitle } = useMrlModalContext();\n\tconst attributes = setAttributes(attrs);\n\tconst classes = classNames(className, 'mrl-modal-header', styles['mrl-modal-header'], {\n\t\t[styles['mrl-modal-scroll-shadow-top']]: scrollableContent.hasScrollTop\n\t});\n\n\tReact.useEffect(() => {\n\t\tsetTitle(text);\n\t}, [text, setTitle]);\n\n\tdelete attrs.class;\n\tdelete attrs.className;\n\treturn (\n\t\t<div {...rest} {...attributes} className={classes}>\n\t\t\t<MrlTextHeading\n\t\t\t\tattrs={{ className: 'mrl-modal-text-heading' }}\n\t\t\t\tlevel=\"2\"\n\t\t\t\ttext={text}\n\t\t\t\tsize=\"large\"\n\t\t\t/>\n\t\t\t{children}\n\t\t\t{/* Looking for the close button? The close button is intentionally part of the overall modal container, not the header */}\n\t\t</div>\n\t);\n};\n"],"names":["MrlModalHeader","_ref","_ref$attrs","attrs","children","className","text","rest","_objectWithoutProperties","_excluded","_useMrlModalContext","useMrlModalContext","scrollableContent","setTitle","attributes","setAttributes","classes","classNames","styles","hasScrollTop","React","useEffect","class","createElement","_extends","MrlTextHeading","level","size"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,cAAc,GAAGC,IAAA,IAMU;AAAA,EAAA,IAAAC,UAAA,GAAAD,IAAA,CALvCE,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,UAAA;IACVE,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IACTC,IAAI,GAAAL,IAAA,CAAJK,IAAI;AACDC,IAAAA,IAAI,GAAAC,iDAAA,CAAAP,IAAA,EAAAQ,SAAA,CAAA;AAEP,EAAA,IAAAC,mBAAA,GAAwCC,kCAAkB,EAAE;IAApDC,iBAAiB,GAAAF,mBAAA,CAAjBE,iBAAiB;IAAEC,QAAQ,GAAAH,mBAAA,CAARG,QAAQ;AACnC,EAAA,IAAMC,UAAU,GAAGC,2BAAa,CAACZ,KAAK,CAAC;AACvC,EAAA,IAAMa,OAAO,GAAGC,2BAAU,CAACZ,SAAS,EAAE,kBAAkB,EAAEa,6BAAM,CAAC,kBAAkB,CAAC,EAAE;AACrF,IAAA,CAACA,6BAAM,CAAC,6BAA6B,CAAC,GAAGN,iBAAiB,CAACO;AAC5D,GAAC,CAAC;EAEFC,gBAAK,CAACC,SAAS,CAAC,MAAM;IACrBR,QAAQ,CAACP,IAAI,CAAC;AACf,EAAA,CAAC,EAAE,CAACA,IAAI,EAAEO,QAAQ,CAAC,CAAC;EAEpB,OAAOV,KAAK,CAACmB,KAAK;EAClB,OAAOnB,KAAK,CAACE,SAAS;EACtB,oBACCe,gBAAA,CAAAG,aAAA,CAAA,KAAA,EAAAC,iCAAA,CAAA,EAAA,EAASjB,IAAI,EAAMO,UAAU,EAAA;AAAET,IAAAA,SAAS,EAAEW;AAAQ,GAAA,CAAA,eACjDI,gBAAA,CAAAG,aAAA,CAACE,6BAAc,EAAA;AACdtB,IAAAA,KAAK,EAAE;AAAEE,MAAAA,SAAS,EAAE;KAA2B;AAC/CqB,IAAAA,KAAK,EAAC,GAAG;AACTpB,IAAAA,IAAI,EAAEA,IAAK;AACXqB,IAAAA,IAAI,EAAC;GACL,CAAC,EACDvB,QAEG,CAAC;AAER;;;;"}
1
+ {"version":3,"file":"MrlModalHeader.js","sources":["../../../../../src/components/modal/MrlModalHeader/MrlModalHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { AttrsObject, MrlComponentProps, setAttributes } from '../../../utils';\nimport classNames from 'classnames';\nimport { MrlTextHeading } from '../../text/MrlTextHeading/MrlTextHeading';\n\nimport styles from './MrlModalHeader.module.scss';\nimport { useMrlModalContext } from '../MrlModalContext';\n\nexport interface MrlModalHeaderProps extends MrlComponentProps {\n\t/**\n\t * Content rendered after the heading, inside the header row. The close button is not part of\n\t * the header; `MrlModal` renders it.\n\t */\n\tchildren?: React.ReactNode;\n\n\t/**\n\t * Wrapper Class\n\t */\n\tclassName?: string;\n\n\t/**\n\t * Text of the modal header `h2` element. It also labels the modal's scrollable content region.\n\t */\n\ttext: string;\n}\n\n/**\n * Modal Header component for the MrlModal. Must be rendered inside `MrlModal`.\n * @param {MrlModalHeaderProps} props - The props for the MrlModalFooter component\n * @param {AttrsObject} props.attrs - Additional HTML attributes for the `mrl-modal` element\n * @returns {React.ReactElement} The rendered MrlModalFooter component\n */\nexport const MrlModalHeader = ({\n\tattrs = {},\n\tchildren,\n\tclassName,\n\ttext,\n\t...rest\n}: MrlModalHeaderProps): JSX.Element => {\n\tconst { scrollableContent, setTitle } = useMrlModalContext();\n\tconst attributes = setAttributes(attrs);\n\tconst classes = classNames(className, 'mrl-modal-header', styles['mrl-modal-header'], {\n\t\t[styles['mrl-modal-scroll-shadow-top']]: scrollableContent.hasScrollTop\n\t});\n\n\tReact.useEffect(() => {\n\t\tsetTitle(text);\n\t}, [text, setTitle]);\n\n\tdelete attrs.class;\n\tdelete attrs.className;\n\treturn (\n\t\t<div {...rest} {...attributes} className={classes}>\n\t\t\t<MrlTextHeading\n\t\t\t\tattrs={{ className: 'mrl-modal-text-heading' }}\n\t\t\t\tlevel=\"2\"\n\t\t\t\ttext={text}\n\t\t\t\tsize=\"large\"\n\t\t\t/>\n\t\t\t{children}\n\t\t\t{/* Looking for the close button? The close button is intentionally part of the overall modal container, not the header */}\n\t\t</div>\n\t);\n};\n"],"names":["MrlModalHeader","_ref","_ref$attrs","attrs","children","className","text","rest","_objectWithoutProperties","_excluded","_useMrlModalContext","useMrlModalContext","scrollableContent","setTitle","attributes","setAttributes","classes","classNames","styles","hasScrollTop","React","useEffect","class","createElement","_extends","MrlTextHeading","level","size"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;AACA;A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,GAAG;AACTpB,IAAAA,IAAI,EAAEA,IAAK;AACXqB,IAAAA,IAAI,EAAC;GACL,CAAC,EACDvB,QAEG,CAAC;AAER;;;;"}
@@ -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,CA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CAAwC,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;AACrB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AAC,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.77.0-dev-yOaq.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.77.0-dev-yOaq.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,8 +1,10 @@
1
- import { GridBaseProps, GridColumns } from '../constants';
2
- export type MrlColProps = GridColumns & GridBaseProps;
1
+ import { LayoutComponent } from '../../layout/constants';
2
+ import { GridColumns } from '../constants';
3
+ type MrlCol = LayoutComponent & GridColumns;
3
4
  /**
4
- * MrlCol React component. Creates a grid column.
5
+ * MrlCol React component.
5
6
  * @param props - component props
6
7
  * @returns a MrlCol React component.
7
8
  */
8
- export declare function MrlCol({ children, className, col, lg, md, sm, xl, xs, xxl, ...rest }: MrlColProps): JSX.Element;
9
+ export declare function MrlCol(props: MrlCol): JSX.Element;
10
+ export {};
@@ -1 +1 @@
1
- export * from './MrlCol';
1
+ export { MrlCol } from './MrlCol';
@@ -1,10 +1,9 @@
1
- import { GridBaseProps } from '../constants';
1
+ import { LayoutComponent } from '../../layout/constants';
2
2
  import '../grid.variables.scss';
3
3
  import '../grid.global.scss';
4
- export type MrlGridProps = GridBaseProps;
5
4
  /**
6
- * MrlGrid React component. Primary container of a grid.
5
+ * MrlCol React component.
7
6
  * @param props - component props
8
- * @returns a MrlGrid React component.
7
+ * @returns a MrlCol React component.
9
8
  */
10
- export declare function MrlGrid({ children, className, ...rest }: MrlGridProps): JSX.Element;
9
+ export declare function MrlGrid({ children, className, ...rest }: LayoutComponent): JSX.Element;
@@ -1 +1 @@
1
- export * from './MrlGrid';
1
+ export { MrlGrid } from './MrlGrid';
@@ -1,13 +1,12 @@
1
- import { AlignOptions, GridBaseProps, GutterSizes, JustifyOptions } from '../constants';
2
- export interface MrlRowProps extends GridBaseProps {
1
+ import { LayoutComponent } from '../../layout/constants';
2
+ import { AlignOptions, GutterSizes, JustifyOptions } from '../constants';
3
+ interface MrlRow extends LayoutComponent {
3
4
  /**
4
5
  * Flex alignment of the children within the component.
5
6
  */
6
7
  align?: AlignOptions;
7
8
  /**
8
- * Gutter size for columns within the row.
9
- *
10
- * @default 1
9
+ * Gutter size for columns within the row
11
10
  */
12
11
  gutter?: GutterSizes;
13
12
  /**
@@ -16,8 +15,9 @@ export interface MrlRowProps extends GridBaseProps {
16
15
  justify?: JustifyOptions;
17
16
  }
18
17
  /**
19
- * MrlRow React component. Creates a grid row.
18
+ * MrlRow React component.
20
19
  * @param props - component props
21
20
  * @returns a MrlRow React component.
22
21
  */
23
- export declare function MrlRow({ align, children, className, gutter, justify, ...rest }: MrlRowProps): JSX.Element;
22
+ export declare function MrlRow({ align, children, className, justify, ...rest }: MrlRow): JSX.Element;
23
+ export {};
@@ -1 +1 @@
1
- export * from './MrlRow';
1
+ export { MrlRow } from './MrlRow';
@@ -1,18 +1,21 @@
1
- import { DataQa } from '../../utils/dataQa';
2
1
  /**
3
2
  * Alignment & justification options for grid containers
4
3
  */
5
4
  export type AlignOptions = 'start' | 'center' | 'end';
6
5
  export type JustifyOptions = 'start' | 'center' | 'end' | 'between' | 'around';
6
+ /**
7
+ * Available grid sizes
8
+ */
9
+ export declare const GridSizes: string[];
7
10
  /**
8
11
  * Number of columns that will be span on the grid.
9
12
  */
10
13
  export type NumCols = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
11
14
  /**
12
- * The grid classes that can be configured per breakpoint.
15
+ * The type of classes that can be configured based on the bootstrap API.
13
16
  * Current supported:
14
17
  * - columns "col-<size>-<number>"
15
- * - offsets "offset-<size>-<number>"
18
+ * - offsets "offset-<size>-<number>""
16
19
  */
17
20
  type GridClass = 'col' | 'offset';
18
21
  /**
@@ -40,25 +43,8 @@ export interface GridColumns {
40
43
  xl?: ColumnConfig;
41
44
  xxl?: ColumnConfig;
42
45
  }
43
- /**
44
- * Breakpoint keys in ascending order. Drives both class generation and the
45
- * filtering that keeps grid props from reaching the DOM.
46
- */
47
- export declare const GRID_SIZE_KEYS: readonly ["col", "xs", "sm", "md", "lg", "xl", "xxl"];
48
46
  /**
49
47
  * Available gutter sizes for customizing the grid
50
48
  */
51
49
  export type GutterSizes = 0 | 1 | 2;
52
- /**
53
- * Gutter size to modifier class. `1` is the default gutter declared on `:root`,
54
- * so it needs no class.
55
- */
56
- export declare const GUTTER_CLASS: Record<GutterSizes, string | undefined>;
57
- /**
58
- * Shared props for the grid components. `role` is intentionally omitted: these
59
- * are generic layout wrappers, and a `role="grid"` would promise interactive
60
- * grid keyboard semantics that they do not implement. Page landmarks belong to
61
- * the layout components (MrlMain, MrlPage).
62
- */
63
- export type GridBaseProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'role'> & DataQa;
64
50
  export {};
@@ -75,12 +75,18 @@ export interface MrlMenuProps {
75
75
  */
76
76
  position?: MenuPosition;
77
77
  /**
78
- * Set initial state of menu
78
+ * Opens or closes the menu from outside. Not just an initial value: whenever
79
+ * `isOpen` or `actionType` changes, the menu syncs its internal state to it.
80
+ * The menu can still close itself (item select, click outside, Escape, Tab),
81
+ * so pair this with `onClose` to reset your state. Prefer `triggerRef` when
82
+ * there is a trigger element. Ignored for submenus and `position="static"`.
79
83
  * @default { actionType: null, isOpen: false }
80
84
  */
81
85
  actionState?: ActionState;
82
86
  /**
83
- * Reference to the DOM element that triggers this menu.
87
+ * Reference to the DOM element that triggers this menu. This alone wires up
88
+ * click and keyboard open/close and the trigger's ARIA attributes; no
89
+ * `actionState` or `onClick` toggle is needed.
84
90
  */
85
91
  triggerRef?: React.RefObject<HTMLButtonElement>;
86
92
  /**
@@ -101,7 +107,8 @@ export interface MrlMenuProps {
101
107
  */
102
108
  alignment?: MenuAlignment;
103
109
  /**
104
- * Callback to be called when the menu is closed
110
+ * Called when the menu closes itself: item select, click outside, Escape, Tab,
111
+ * or scroll with `closeOnScroll`. Not called when a trigger click toggles it closed.
105
112
  * @param type - type of close event
106
113
  */
107
114
  onClose?: (type?: string) => void;
@@ -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
  */