@muraldevkit/ui-toolkit 4.70.1 → 4.70.3-dev-kmM6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/cjs/components/form/select/components/MrlSelectContainer.js +6 -1
  2. package/dist/cjs/components/form/select/components/MrlSelectContainer.js.map +1 -1
  3. package/dist/cjs/components/form/select/utils/useMenuEscapeContainment.js +59 -0
  4. package/dist/cjs/components/form/select/utils/useMenuEscapeContainment.js.map +1 -0
  5. package/dist/cjs/components/notification/MrlBlockNotification/MrlBlockNotification.module.scss.js +1 -1
  6. package/dist/cjs/hooks/useAutoClose/useAutoClose.js.map +1 -1
  7. package/dist/components/breadcrumb/MrlBreadcrumbSeparator/MrlBreadcrumbSeparator.d.ts +0 -1
  8. package/dist/components/divider/MrlDivider/MrlDivider.d.ts +0 -1
  9. package/dist/components/empty/default/MrlEmpty.d.ts +0 -1
  10. package/dist/components/empty/large/MrlEmptyLarge.d.ts +0 -1
  11. package/dist/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.d.ts +0 -1
  12. package/dist/components/form/legacy-select/MrlLegacySelectMenu/MrlLegacySelectMenu.d.ts +0 -1
  13. package/dist/components/form/select/MrlCreatableSelect/MrlCreatableSelect.d.ts +1 -2
  14. package/dist/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.d.ts +1 -2
  15. package/dist/components/form/select/MrlMultiSelect/MrlMultiSelect.d.ts +1 -2
  16. package/dist/components/form/select/MrlSelect/MrlSelect.d.ts +1 -2
  17. package/dist/components/form/select/components/MrlSelectClearIndicator.d.ts +0 -1
  18. package/dist/components/form/select/components/MrlSelectContainer.d.ts +3 -1
  19. package/dist/components/form/select/components/MrlSelectDropdownIndicator.d.ts +0 -1
  20. package/dist/components/form/select/components/MrlSelectMultiValue.d.ts +0 -1
  21. package/dist/components/form/select/components/MrlSelectMultiValueRemove.d.ts +0 -1
  22. package/dist/components/form/select/components/MrlSelectOption.d.ts +0 -1
  23. package/dist/components/form/select/components/MrlSelectValueContainer.d.ts +0 -1
  24. package/dist/components/form/select/utils/useMenuEscapeContainment.d.ts +21 -0
  25. package/dist/components/form/textarea/MrlTextarea/MrlTextarea.d.ts +0 -1
  26. package/dist/components/grid/MrlCol/MrlCol.d.ts +0 -1
  27. package/dist/components/grid/MrlGrid/MrlGrid.d.ts +0 -1
  28. package/dist/components/grid/MrlRow/MrlRow.d.ts +0 -1
  29. package/dist/components/layout/MrlMain/MrlMain.d.ts +0 -1
  30. package/dist/components/layout/MrlPage/MrlPage.d.ts +0 -1
  31. package/dist/components/layout/MrlPage/index.d.ts +0 -1
  32. package/dist/components/layout/MrlSidebar/demo/MrlSidebarDemo.d.ts +0 -1
  33. package/dist/components/layout/MrlTopbar/MrlTopbar.d.ts +0 -1
  34. package/dist/components/layout/constants.d.ts +0 -1
  35. package/dist/components/live-region/demo/LiveRegionDemo.d.ts +0 -1
  36. package/dist/components/loader/MrlProgressBar/MrlProgressBar.d.ts +0 -1
  37. package/dist/components/loader/MrlSpinner/MrlSpinner.d.ts +0 -1
  38. package/dist/components/loader/constants.d.ts +0 -1
  39. package/dist/components/menu/constants.d.ts +0 -1
  40. package/dist/components/menu/demo/MenuByConfig.d.ts +0 -1
  41. package/dist/components/menu/demo/MenuWithPopover.d.ts +0 -1
  42. package/dist/components/menu/demo/MenuWithSubmenu.d.ts +0 -1
  43. package/dist/components/menu/demo/MenuWithTrigger.d.ts +0 -1
  44. package/dist/components/modal/demo/ModalWithTriggerDemo.d.ts +0 -1
  45. package/dist/components/pagination/MrlPaginationText/MrlPaginationText.d.ts +0 -1
  46. package/dist/components/popover/demo/PopoverWithIconButton.d.ts +0 -1
  47. package/dist/components/popover/demo/PopoverWithSelect.d.ts +0 -1
  48. package/dist/components/popover/demo/PopoverWithTrigger.d.ts +0 -1
  49. package/dist/components/table/MrlSmartTable/storybook-utils.d.ts +9 -10
  50. package/dist/components/table/MrlTableEmptyState/MrlTableEmptyState.d.ts +0 -1
  51. package/dist/components/table/utils.d.ts +1 -1
  52. package/dist/components/toolbar/MrlToolbarItem/MrlToolbarItem.d.ts +0 -1
  53. package/dist/esm/components/form/select/components/MrlSelectContainer.js +6 -1
  54. package/dist/esm/components/form/select/components/MrlSelectContainer.js.map +1 -1
  55. package/dist/esm/components/form/select/utils/useMenuEscapeContainment.js +37 -0
  56. package/dist/esm/components/form/select/utils/useMenuEscapeContainment.js.map +1 -0
  57. package/dist/esm/components/notification/MrlBlockNotification/MrlBlockNotification.module.scss.js +1 -1
  58. package/dist/esm/hooks/useAutoClose/useAutoClose.js.map +1 -1
  59. package/dist/hooks/useBreakpoint/useBreakpointDemo.d.ts +0 -1
  60. package/dist/hooks/useClickOutside/index.d.ts +1 -1
  61. package/dist/styles/MrlBlockNotification/module.scss +7 -12
  62. package/dist/styles.css +1 -1
  63. package/dist/types/components/breadcrumb/MrlBreadcrumbSeparator/MrlBreadcrumbSeparator.d.ts +0 -1
  64. package/dist/types/components/divider/MrlDivider/MrlDivider.d.ts +0 -1
  65. package/dist/types/components/empty/default/MrlEmpty.d.ts +0 -1
  66. package/dist/types/components/empty/large/MrlEmptyLarge.d.ts +0 -1
  67. package/dist/types/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.d.ts +0 -1
  68. package/dist/types/components/form/legacy-select/MrlLegacySelectMenu/MrlLegacySelectMenu.d.ts +0 -1
  69. package/dist/types/components/form/select/MrlCreatableSelect/MrlCreatableSelect.d.ts +1 -2
  70. package/dist/types/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.d.ts +1 -2
  71. package/dist/types/components/form/select/MrlMultiSelect/MrlMultiSelect.d.ts +1 -2
  72. package/dist/types/components/form/select/MrlSelect/MrlSelect.d.ts +1 -2
  73. package/dist/types/components/form/select/components/MrlSelectClearIndicator.d.ts +0 -1
  74. package/dist/types/components/form/select/components/MrlSelectContainer.d.ts +3 -1
  75. package/dist/types/components/form/select/components/MrlSelectDropdownIndicator.d.ts +0 -1
  76. package/dist/types/components/form/select/components/MrlSelectMultiValue.d.ts +0 -1
  77. package/dist/types/components/form/select/components/MrlSelectMultiValueRemove.d.ts +0 -1
  78. package/dist/types/components/form/select/components/MrlSelectOption.d.ts +0 -1
  79. package/dist/types/components/form/select/components/MrlSelectValueContainer.d.ts +0 -1
  80. package/dist/types/components/form/select/utils/useMenuEscapeContainment.d.ts +21 -0
  81. package/dist/types/components/form/textarea/MrlTextarea/MrlTextarea.d.ts +0 -1
  82. package/dist/types/components/grid/MrlCol/MrlCol.d.ts +0 -1
  83. package/dist/types/components/grid/MrlGrid/MrlGrid.d.ts +0 -1
  84. package/dist/types/components/grid/MrlRow/MrlRow.d.ts +0 -1
  85. package/dist/types/components/layout/MrlMain/MrlMain.d.ts +0 -1
  86. package/dist/types/components/layout/MrlPage/MrlPage.d.ts +0 -1
  87. package/dist/types/components/layout/MrlPage/index.d.ts +0 -1
  88. package/dist/types/components/layout/MrlSidebar/demo/MrlSidebarDemo.d.ts +0 -1
  89. package/dist/types/components/layout/MrlTopbar/MrlTopbar.d.ts +0 -1
  90. package/dist/types/components/layout/constants.d.ts +0 -1
  91. package/dist/types/components/layout/error-page/MrlBrandColors/MrlBrandColors.d.ts +0 -1
  92. package/dist/types/components/live-region/demo/LiveRegionDemo.d.ts +0 -1
  93. package/dist/types/components/loader/MrlProgressBar/MrlProgressBar.d.ts +0 -1
  94. package/dist/types/components/loader/MrlSpinner/MrlSpinner.d.ts +0 -1
  95. package/dist/types/components/loader/constants.d.ts +0 -1
  96. package/dist/types/components/menu/constants.d.ts +0 -1
  97. package/dist/types/components/menu/demo/MenuByConfig.d.ts +0 -1
  98. package/dist/types/components/menu/demo/MenuWithPopover.d.ts +0 -1
  99. package/dist/types/components/menu/demo/MenuWithSubmenu.d.ts +0 -1
  100. package/dist/types/components/menu/demo/MenuWithTrigger.d.ts +0 -1
  101. package/dist/types/components/modal/demo/ModalWithTriggerDemo.d.ts +0 -1
  102. package/dist/types/components/pagination/MrlPaginationText/MrlPaginationText.d.ts +0 -1
  103. package/dist/types/components/popover/demo/PopoverWithIconButton.d.ts +0 -1
  104. package/dist/types/components/popover/demo/PopoverWithSelect.d.ts +0 -1
  105. package/dist/types/components/popover/demo/PopoverWithTrigger.d.ts +0 -1
  106. package/dist/types/components/table/MrlSmartTable/storybook-utils.d.ts +9 -10
  107. package/dist/types/components/table/MrlTableEmptyState/MrlTableEmptyState.d.ts +0 -1
  108. package/dist/types/components/table/utils.d.ts +1 -1
  109. package/dist/types/components/toolbar/MrlToolbarItem/MrlToolbarItem.d.ts +0 -1
  110. package/dist/types/hooks/useBreakpoint/useBreakpointDemo.d.ts +0 -1
  111. package/dist/types/hooks/useClickOutside/index.d.ts +1 -1
  112. package/dist/types/utils/findAdjacentInteractiveElement/findAdjacentInteractiveElement.d.ts +1 -1
  113. package/dist/utils/findAdjacentInteractiveElement/findAdjacentInteractiveElement.d.ts +1 -1
  114. package/package.json +7 -6
  115. package/dist/types/utils/getCamelCase/getCamelCase.test.d.ts +0 -1
  116. package/dist/types/utils/isElementAriaDisabled/isElementAriaDisabled.test.d.ts +0 -1
  117. package/dist/types/utils/isObject/isObject.test.d.ts +0 -1
  118. package/dist/types/utils/setAttributes/setAttributes.test.d.ts +0 -1
  119. package/dist/utils/getCamelCase/getCamelCase.test.d.ts +0 -1
  120. package/dist/utils/isElementAriaDisabled/isElementAriaDisabled.test.d.ts +0 -1
  121. package/dist/utils/isObject/isObject.test.d.ts +0 -1
  122. package/dist/utils/setAttributes/setAttributes.test.d.ts +0 -1
@@ -3,6 +3,7 @@
3
3
  var _rollupPluginBabelHelpers = require('../../../../_virtual/_rollupPluginBabelHelpers.js');
4
4
  var React = require('react');
5
5
  var Select = require('react-select');
6
+ var useMenuEscapeContainment = require('../utils/useMenuEscapeContainment.js');
6
7
 
7
8
  function _interopNamespace(e) {
8
9
  if (e && e.__esModule) return e;
@@ -27,13 +28,17 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
27
28
  /**
28
29
  * MrlSelectContainer component
29
30
  *
31
+ * Adds `data-qa` support and keeps the `Escape` press that dismisses an open menu
32
+ * from also closing an outer dismissible surface (e.g. a select inside MrlModal).
33
+ *
30
34
  * @param props - the react-select container props
31
35
  * @returns a select container
32
36
  */
33
37
  function MrlSelectContainer(props) {
34
38
  var dataQa = props.selectProps['data-qa'];
39
+ var escapeContainment = useMenuEscapeContainment.useMenuEscapeContainment(props.selectProps.menuIsOpen, props.innerProps.onKeyDown);
35
40
  return /*#__PURE__*/React__namespace.createElement(Select.components.SelectContainer, _rollupPluginBabelHelpers.extends({}, props, {
36
- innerProps: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, props.innerProps), dataQa && {
41
+ innerProps: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, props.innerProps), escapeContainment), dataQa && {
37
42
  'data-qa': "".concat(dataQa, "-container")
38
43
  })
39
44
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"MrlSelectContainer.js","sources":["../../../../../../src/components/form/select/components/MrlSelectContainer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { GroupBase, components, ContainerProps } from 'react-select';\n\n/**\n * MrlSelectContainer component\n *\n * @param props - the react-select container props\n * @returns a select container\n */\nexport function MrlSelectContainer<\n\tT,\n\tIsMulti extends boolean = false,\n\tGroup extends GroupBase<T> = GroupBase<T>\n>(props: ContainerProps<T, IsMulti, Group>): JSX.Element {\n\tconst dataQa = props.selectProps['data-qa'];\n\treturn (\n\t\t<components.SelectContainer\n\t\t\t{...props}\n\t\t\tinnerProps={{\n\t\t\t\t...props.innerProps,\n\t\t\t\t...(dataQa && { 'data-qa': `${dataQa}-container` })\n\t\t\t}}\n\t\t/>\n\t);\n}\n"],"names":["MrlSelectContainer","props","dataQa","selectProps","React","createElement","components","SelectContainer","_extends","innerProps","_objectSpread","concat"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,kBAAkBA,CAIhCC,KAAwC,EAAe;AACxD,EAAA,IAAMC,MAAM,GAAGD,KAAK,CAACE,WAAW,CAAC,SAAS,CAAC;EAC3C,oBACCC,gBAAA,CAAAC,aAAA,CAACC,iBAAU,CAACC,eAAe,EAAAC,iCAAA,CAAA,EAAA,EACtBP,KAAK,EAAA;IACTQ,UAAU,EAAAC,uCAAA,CAAAA,uCAAA,CAAA,EAAA,EACNT,KAAK,CAACQ,UAAU,CAAA,EACfP,MAAM,IAAI;MAAE,SAAS,EAAA,EAAA,CAAAS,MAAA,CAAKT,MAAM,EAAA,YAAA;KAAc;AACjD,GAAA,CACF,CAAC;AAEJ;;;;"}
1
+ {"version":3,"file":"MrlSelectContainer.js","sources":["../../../../../../src/components/form/select/components/MrlSelectContainer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { GroupBase, components, ContainerProps } from 'react-select';\nimport { useMenuEscapeContainment } from '../utils/useMenuEscapeContainment';\n\n/**\n * MrlSelectContainer component\n *\n * Adds `data-qa` support and keeps the `Escape` press that dismisses an open menu\n * from also closing an outer dismissible surface (e.g. a select inside MrlModal).\n *\n * @param props - the react-select container props\n * @returns a select container\n */\nexport function MrlSelectContainer<\n\tT,\n\tIsMulti extends boolean = false,\n\tGroup extends GroupBase<T> = GroupBase<T>\n>(props: ContainerProps<T, IsMulti, Group>): JSX.Element {\n\tconst dataQa = props.selectProps['data-qa'];\n\tconst escapeContainment = useMenuEscapeContainment(\n\t\tprops.selectProps.menuIsOpen,\n\t\tprops.innerProps.onKeyDown\n\t);\n\n\treturn (\n\t\t<components.SelectContainer\n\t\t\t{...props}\n\t\t\tinnerProps={{\n\t\t\t\t...props.innerProps,\n\t\t\t\t...escapeContainment,\n\t\t\t\t...(dataQa && { 'data-qa': `${dataQa}-container` })\n\t\t\t}}\n\t\t/>\n\t);\n}\n"],"names":["MrlSelectContainer","props","dataQa","selectProps","escapeContainment","useMenuEscapeContainment","menuIsOpen","innerProps","onKeyDown","React","createElement","components","SelectContainer","_extends","_objectSpread","concat"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,kBAAkBA,CAIhCC,KAAwC,EAAe;AACxD,EAAA,IAAMC,MAAM,GAAGD,KAAK,CAACE,WAAW,CAAC,SAAS,CAAC;AAC3C,EAAA,IAAMC,iBAAiB,GAAGC,iDAAwB,CACjDJ,KAAK,CAACE,WAAW,CAACG,UAAU,EAC5BL,KAAK,CAACM,UAAU,CAACC,SAClB,CAAC;EAED,oBACCC,gBAAA,CAAAC,aAAA,CAACC,iBAAU,CAACC,eAAe,EAAAC,iCAAA,CAAA,EAAA,EACtBZ,KAAK,EAAA;AACTM,IAAAA,UAAU,EAAAO,uCAAA,CAAAA,uCAAA,CAAAA,uCAAA,CAAA,EAAA,EACNb,KAAK,CAACM,UAAU,CAAA,EAChBH,iBAAiB,CAAA,EAChBF,MAAM,IAAI;MAAE,SAAS,EAAA,EAAA,CAAAa,MAAA,CAAKb,MAAM,EAAA,YAAA;KAAc;AACjD,GAAA,CACF,CAAC;AAEJ;;;;"}
@@ -0,0 +1,59 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+
5
+ function _interopNamespace(e) {
6
+ if (e && e.__esModule) return e;
7
+ var n = Object.create(null);
8
+ if (e) {
9
+ Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default') {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
24
+
25
+ /**
26
+ * Keeps the `Escape` press that dismisses an open select menu from reaching outer
27
+ * dismissible surfaces. MrlModal, MrlPanel and MrlPopover close on `Escape` keydown
28
+ * and MrlSidebar on keyup, so without containment a single press would close the
29
+ * menu and the surface behind it at the same time.
30
+ *
31
+ * While the menu is open, the `Escape` keydown and its paired keyup stop propagating
32
+ * after react-select handles them. Once the menu is closed, `Escape` bubbles as
33
+ * usual so the outer surface can respond to the next press.
34
+ *
35
+ * @param menuIsOpen - the resolved react-select menu state
36
+ * @param onKeyDown - react-select's container keydown handler to wrap
37
+ * @returns key event handlers to spread into the select container's `innerProps`
38
+ */
39
+ function useMenuEscapeContainment(menuIsOpen, onKeyDown) {
40
+ var escapeDismissedTheMenu = React__namespace.useRef(false);
41
+ var handleKeyDown = event => {
42
+ onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
43
+ if (event.key !== 'Escape') return;
44
+ escapeDismissedTheMenu.current = menuIsOpen;
45
+ if (menuIsOpen) event.stopPropagation();
46
+ };
47
+ var handleKeyUp = event => {
48
+ if (event.key !== 'Escape') return;
49
+ if (escapeDismissedTheMenu.current) event.stopPropagation();
50
+ escapeDismissedTheMenu.current = false;
51
+ };
52
+ return {
53
+ onKeyDown: handleKeyDown,
54
+ onKeyUp: handleKeyUp
55
+ };
56
+ }
57
+
58
+ exports.useMenuEscapeContainment = useMenuEscapeContainment;
59
+ //# sourceMappingURL=useMenuEscapeContainment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMenuEscapeContainment.js","sources":["../../../../../../src/components/form/select/utils/useMenuEscapeContainment.ts"],"sourcesContent":["import * as React from 'react';\n\ninterface MenuEscapeContainmentHandlers {\n\tonKeyDown: React.KeyboardEventHandler<HTMLDivElement>;\n\tonKeyUp: React.KeyboardEventHandler<HTMLDivElement>;\n}\n\n/**\n * Keeps the `Escape` press that dismisses an open select menu from reaching outer\n * dismissible surfaces. MrlModal, MrlPanel and MrlPopover close on `Escape` keydown\n * and MrlSidebar on keyup, so without containment a single press would close the\n * menu and the surface behind it at the same time.\n *\n * While the menu is open, the `Escape` keydown and its paired keyup stop propagating\n * after react-select handles them. Once the menu is closed, `Escape` bubbles as\n * usual so the outer surface can respond to the next press.\n *\n * @param menuIsOpen - the resolved react-select menu state\n * @param onKeyDown - react-select's container keydown handler to wrap\n * @returns key event handlers to spread into the select container's `innerProps`\n */\nexport function useMenuEscapeContainment(\n\tmenuIsOpen: boolean,\n\tonKeyDown: React.KeyboardEventHandler<HTMLDivElement> | undefined\n): MenuEscapeContainmentHandlers {\n\tconst escapeDismissedTheMenu = React.useRef(false);\n\n\tconst handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = (event) => {\n\t\tonKeyDown?.(event);\n\n\t\tif (event.key !== 'Escape') return;\n\n\t\tescapeDismissedTheMenu.current = menuIsOpen;\n\t\tif (menuIsOpen) event.stopPropagation();\n\t};\n\n\tconst handleKeyUp: React.KeyboardEventHandler<HTMLDivElement> = (event) => {\n\t\tif (event.key !== 'Escape') return;\n\n\t\tif (escapeDismissedTheMenu.current) event.stopPropagation();\n\t\tescapeDismissedTheMenu.current = false;\n\t};\n\n\treturn { onKeyDown: handleKeyDown, onKeyUp: handleKeyUp };\n}\n"],"names":["useMenuEscapeContainment","menuIsOpen","onKeyDown","escapeDismissedTheMenu","React","useRef","handleKeyDown","event","key","current","stopPropagation","handleKeyUp","onKeyUp"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,wBAAwBA,CACvCC,UAAmB,EACnBC,SAAiE,EACjC;AAChC,EAAA,IAAMC,sBAAsB,GAAGC,gBAAK,CAACC,MAAM,CAAC,KAAK,CAAC;EAElD,IAAMC,aAAyD,GAAIC,KAAK,IAAK;AAC5EL,IAAAA,SAAS,aAATA,SAAS,KAAA,MAAA,GAAA,MAAA,GAATA,SAAS,CAAGK,KAAK,CAAC;AAElB,IAAA,IAAIA,KAAK,CAACC,GAAG,KAAK,QAAQ,EAAE;IAE5BL,sBAAsB,CAACM,OAAO,GAAGR,UAAU;AAC3C,IAAA,IAAIA,UAAU,EAAEM,KAAK,CAACG,eAAe,EAAE;EACxC,CAAC;EAED,IAAMC,WAAuD,GAAIJ,KAAK,IAAK;AAC1E,IAAA,IAAIA,KAAK,CAACC,GAAG,KAAK,QAAQ,EAAE;IAE5B,IAAIL,sBAAsB,CAACM,OAAO,EAAEF,KAAK,CAACG,eAAe,EAAE;IAC3DP,sBAAsB,CAACM,OAAO,GAAG,KAAK;EACvC,CAAC;EAED,OAAO;AAAEP,IAAAA,SAAS,EAAEI,aAAa;AAAEM,IAAAA,OAAO,EAAED;GAAa;AAC1D;;;;"}
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var styles = {"mrl-blockNotification":"mrl-blockNotification--xbhrd","mrl-blockNotification-icon":"mrl-blockNotification-icon--CAq04","mrl-blockNotification-close-wrapper":"mrl-blockNotification-close-wrapper--yODTH","cta":"cta--gnyoO","mrl-blockNotification--dismissible":"mrl-blockNotification--dismissible--ZlIID","mrl-blockNotification-message":"mrl-blockNotification-message--MdtXZ","mrl-blockNotification-heading":"mrl-blockNotification-heading--WGPWE"};
5
+ var styles = {"mrl-blockNotification":"mrl-blockNotification--xbhrd","mrl-blockNotification-icon":"mrl-blockNotification-icon--CAq04","mrl-blockNotification-close-wrapper":"mrl-blockNotification-close-wrapper--yODTH","cta":"cta--gnyoO","mrl-blockNotification--dismissible":"mrl-blockNotification--dismissible--ZlIID","mrl-blockNotification-heading":"mrl-blockNotification-heading--WGPWE","mrl-blockNotification-message":"mrl-blockNotification-message--MdtXZ"};
6
6
 
7
7
  exports.default = styles;
8
8
  //# sourceMappingURL=MrlBlockNotification.module.scss.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAutoClose.js","sources":["../../../../src/hooks/useAutoClose/useAutoClose.ts"],"sourcesContent":["import * as React from 'react';\n\nexport type useAutoClose = (\n\tshouldAutoClose?: boolean,\n\tcloseAfterMs?: number,\n\tonClose?: () => unknown\n) => [boolean, React.Dispatch<React.SetStateAction<boolean>>];\n\n/**\n * Hook that exposes a piece of state that allows components to close themselves after a delay\n *\n * @param shouldAutoClose - When false prevents automated close (e.g. can be used to prevent auto-dismissal of interactive elements, an accessibility anti-pattern)\n * @param closeAfterMs - Delay in milliseconds before the component closes\n * @param onClose - Callback to be called when component closes\n * @returns [closed, setClosed] - a boolean tracking closed state, and a setter for that same state\n */\nexport const useAutoClose: useAutoClose = function (\n\tshouldAutoClose = true,\n\tcloseAfterMs = 3000,\n\tonClose\n) {\n\tconst [closed, setClosed] = React.useState<boolean>(false);\n\tconst currentTimeout = React.useRef<NodeJS.Timeout | null>(null);\n\n\tReact.useEffect(() => {\n\t\t// Reset current timeout when component mounts or when notification changes\n\t\tif (currentTimeout.current) {\n\t\t\tresetTimeout();\n\t\t}\n\n\t\t// Allowing autoClose when there are interactive elements in the toast is an anti-pattern\n\t\t// and should be avoided. If autoClose is set to true and interactive elements exist, the\n\t\t// toast will not close automatically.\n\t\tif (shouldAutoClose) {\n\t\t\tsetClosed(false);\n\n\t\t\tcurrentTimeout.current = setTimeout(() => {\n\t\t\t\tsetClosed(true);\n\n\t\t\t\t// Handle onClose after the timeout is elapsed\n\t\t\t\tif (onClose) onClose();\n\t\t\t}, closeAfterMs);\n\t\t}\n\n\t\treturn () => {\n\t\t\t// Clear timeout when component unmounts\n\t\t\tresetTimeout();\n\t\t};\n\t}, [shouldAutoClose, closeAfterMs, onClose]);\n\n\t/** Resets the current timeout and `closed` to its initial value */\n\tconst resetTimeout = (): void => {\n\t\tif (currentTimeout.current !== null) {\n\t\t\tclearTimeout(currentTimeout.current);\n\t\t}\n\t\tsetClosed(false);\n\t};\n\n\treturn [closed, setClosed];\n};\n"],"names":["useAutoClose","shouldAutoClose","arguments","length","undefined","closeAfterMs","onClose","_React$useState","React","useState","_React$useState2","_slicedToArray","closed","setClosed","currentTimeout","useRef","useEffect","current","resetTimeout","setTimeout","clearTimeout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACaA,YAA0B,GAAG,SAA7BA,YAA0BA,GAIrC;AAAA,EAAA,IAHDC,eAAe,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,IAAI;AAAA,EAAA,IACtBG,YAAY,GAAAH,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,IAAI;EAAA,IACnBI,OAAO,GAAAJ,SAAA,CAAAC,MAAA,GAAA,CAAA,GAAAD,SAAA,MAAAE,SAAA;AAEP,EAAA,IAAAG,eAAA,GAA4BC,gBAAK,CAACC,QAAQ,CAAU,KAAK,CAAC;IAAAC,gBAAA,GAAAC,uCAAA,CAAAJ,eAAA,EAAA,CAAA,CAAA;AAAnDK,IAAAA,MAAM,GAAAF,gBAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,SAAS,GAAAH,gBAAA,CAAA,CAAA,CAAA;AACxB,EAAA,IAAMI,cAAc,GAAGN,gBAAK,CAACO,MAAM,CAAwB,IAAI,CAAC;EAEhEP,gBAAK,CAACQ,SAAS,CAAC,MAAM;AACrB;IACA,IAAIF,cAAc,CAACG,OAAO,EAAE;AAC3BC,MAAAA,YAAY,EAAE;AACf,IAAA;;AAEA;AACA;AACA;AACA,IAAA,IAAIjB,eAAe,EAAE;MACpBY,SAAS,CAAC,KAAK,CAAC;AAEhBC,MAAAA,cAAc,CAACG,OAAO,GAAGE,UAAU,CAAC,MAAM;QACzCN,SAAS,CAAC,IAAI,CAAC;;AAEf;AACA,QAAA,IAAIP,OAAO,EAAEA,OAAO,EAAE;MACvB,CAAC,EAAED,YAAY,CAAC;AACjB,IAAA;AAEA,IAAA,OAAO,MAAM;AACZ;AACAa,MAAAA,YAAY,EAAE;IACf,CAAC;EACF,CAAC,EAAE,CAACjB,eAAe,EAAEI,YAAY,EAAEC,OAAO,CAAC,CAAC;;AAE5C;EACA,IAAMY,YAAY,GAAGA,MAAY;AAChC,IAAA,IAAIJ,cAAc,CAACG,OAAO,KAAK,IAAI,EAAE;AACpCG,MAAAA,YAAY,CAACN,cAAc,CAACG,OAAO,CAAC;AACrC,IAAA;IACAJ,SAAS,CAAC,KAAK,CAAC;EACjB,CAAC;AAED,EAAA,OAAO,CAACD,MAAM,EAAEC,SAAS,CAAC;AAC3B;;;;"}
1
+ {"version":3,"file":"useAutoClose.js","sources":["../../../../src/hooks/useAutoClose/useAutoClose.ts"],"sourcesContent":["import * as React from 'react';\n\nexport type useAutoClose = (\n\tshouldAutoClose?: boolean,\n\tcloseAfterMs?: number,\n\tonClose?: () => unknown\n) => [boolean, React.Dispatch<React.SetStateAction<boolean>>];\n\n/**\n * Hook that exposes a piece of state that allows components to close themselves after a delay\n *\n * @param shouldAutoClose - When false prevents automated close (e.g. can be used to prevent auto-dismissal of interactive elements, an accessibility anti-pattern)\n * @param closeAfterMs - Delay in milliseconds before the component closes\n * @param onClose - Callback to be called when component closes\n * @returns [closed, setClosed] - a boolean tracking closed state, and a setter for that same state\n */\nexport const useAutoClose: useAutoClose = function (\n\tshouldAutoClose = true,\n\tcloseAfterMs = 3000,\n\tonClose\n) {\n\tconst [closed, setClosed] = React.useState<boolean>(false);\n\tconst currentTimeout = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n\n\tReact.useEffect(() => {\n\t\t// Reset current timeout when component mounts or when notification changes\n\t\tif (currentTimeout.current) {\n\t\t\tresetTimeout();\n\t\t}\n\n\t\t// Allowing autoClose when there are interactive elements in the toast is an anti-pattern\n\t\t// and should be avoided. If autoClose is set to true and interactive elements exist, the\n\t\t// toast will not close automatically.\n\t\tif (shouldAutoClose) {\n\t\t\tsetClosed(false);\n\n\t\t\tcurrentTimeout.current = setTimeout(() => {\n\t\t\t\tsetClosed(true);\n\n\t\t\t\t// Handle onClose after the timeout is elapsed\n\t\t\t\tif (onClose) onClose();\n\t\t\t}, closeAfterMs);\n\t\t}\n\n\t\treturn () => {\n\t\t\t// Clear timeout when component unmounts\n\t\t\tresetTimeout();\n\t\t};\n\t}, [shouldAutoClose, closeAfterMs, onClose]);\n\n\t/** Resets the current timeout and `closed` to its initial value */\n\tconst resetTimeout = (): void => {\n\t\tif (currentTimeout.current !== null) {\n\t\t\tclearTimeout(currentTimeout.current);\n\t\t}\n\t\tsetClosed(false);\n\t};\n\n\treturn [closed, setClosed];\n};\n"],"names":["useAutoClose","shouldAutoClose","arguments","length","undefined","closeAfterMs","onClose","_React$useState","React","useState","_React$useState2","_slicedToArray","closed","setClosed","currentTimeout","useRef","useEffect","current","resetTimeout","setTimeout","clearTimeout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACaA,YAA0B,GAAG,SAA7BA,YAA0BA,GAIrC;AAAA,EAAA,IAHDC,eAAe,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,IAAI;AAAA,EAAA,IACtBG,YAAY,GAAAH,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,IAAI;EAAA,IACnBI,OAAO,GAAAJ,SAAA,CAAAC,MAAA,GAAA,CAAA,GAAAD,SAAA,MAAAE,SAAA;AAEP,EAAA,IAAAG,eAAA,GAA4BC,gBAAK,CAACC,QAAQ,CAAU,KAAK,CAAC;IAAAC,gBAAA,GAAAC,uCAAA,CAAAJ,eAAA,EAAA,CAAA,CAAA;AAAnDK,IAAAA,MAAM,GAAAF,gBAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,SAAS,GAAAH,gBAAA,CAAA,CAAA,CAAA;AACxB,EAAA,IAAMI,cAAc,GAAGN,gBAAK,CAACO,MAAM,CAAuC,IAAI,CAAC;EAE/EP,gBAAK,CAACQ,SAAS,CAAC,MAAM;AACrB;IACA,IAAIF,cAAc,CAACG,OAAO,EAAE;AAC3BC,MAAAA,YAAY,EAAE;AACf,IAAA;;AAEA;AACA;AACA;AACA,IAAA,IAAIjB,eAAe,EAAE;MACpBY,SAAS,CAAC,KAAK,CAAC;AAEhBC,MAAAA,cAAc,CAACG,OAAO,GAAGE,UAAU,CAAC,MAAM;QACzCN,SAAS,CAAC,IAAI,CAAC;;AAEf;AACA,QAAA,IAAIP,OAAO,EAAEA,OAAO,EAAE;MACvB,CAAC,EAAED,YAAY,CAAC;AACjB,IAAA;AAEA,IAAA,OAAO,MAAM;AACZ;AACAa,MAAAA,YAAY,EAAE;IACf,CAAC;EACF,CAAC,EAAE,CAACjB,eAAe,EAAEI,YAAY,EAAEC,OAAO,CAAC,CAAC;;AAE5C;EACA,IAAMY,YAAY,GAAGA,MAAY;AAChC,IAAA,IAAIJ,cAAc,CAACG,OAAO,KAAK,IAAI,EAAE;AACpCG,MAAAA,YAAY,CAACN,cAAc,CAACG,OAAO,CAAC;AACrC,IAAA;IACAJ,SAAS,CAAC,KAAK,CAAC;EACjB,CAAC;AAED,EAAA,OAAO,CAACD,MAAM,EAAEC,SAAS,CAAC;AAC3B;;;;"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * MrlBreadcrumbSeparator component.
4
3
  * @returns The MrlBreadcrumbSeparator component.
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { AttrsObject } from '../../../utils';
3
2
  import { Kind, Orientation, Spacing, Weight } from '../constants';
4
3
  interface MrlDividerProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface MrlEmptyProps {
3
2
  graphic?: JSX.Element;
4
3
  heading: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface MrlEmptyLargeProps {
3
2
  graphic?: JSX.Element;
4
3
  heading: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { AttrsObject } from '../../../../utils';
3
2
  import { CheckboxSelected, CheckboxStates } from '../../constants';
4
3
  import './MrlCheckboxStandalone.global.scss';
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import { ReactElement } from 'react';
3
2
  import { SelectMenuPositions } from '../../constants';
4
3
  import { AttrsObject } from '../../../../utils';
5
4
  export interface MrlLegacySelectMenuProptypes extends React.HTMLAttributes<HTMLDivElement> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CreatableProps } from 'react-select/creatable';
3
2
  import { GroupBase } from 'react-select';
4
3
  import { SelectKind } from '../types';
@@ -17,7 +16,7 @@ export interface MrlCreatableSelectProps<Option, IsMulti extends boolean = false
17
16
  showClearIndicatorIcon?: boolean;
18
17
  }
19
18
  export declare const CREATABLE_SELECT_CLASS_NAME_PREFIX = "MrlCreatableSelect";
20
- export declare const CREATABLE_SELECT_MENU_LIST_CLASS_NAME: string;
19
+ export declare const CREATABLE_SELECT_MENU_LIST_CLASS_NAME = "MrlCreatableSelect__menu-list";
21
20
  /**
22
21
  * MrlCreatableSelect component that supports creating extra options with user input. Option creating could be async too.
23
22
  * @param props - the component props
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CreatableProps } from 'react-select/creatable';
3
2
  import { GroupBase } from 'react-select';
4
3
  import { DefaultOption, SelectKind } from '../types';
@@ -17,7 +16,7 @@ export interface MrlMultiCreatableSelectProps<Option, IsMulti extends boolean =
17
16
  showClearIndicatorIcon?: boolean;
18
17
  }
19
18
  export declare const MULTI_CREATABLE_SELECT_CLASS_NAME_PREFIX = "MrlMultiCreatableSelect";
20
- export declare const MULTI_CREATABLE_SELECT_MENU_LIST_CLASS_NAME: string;
19
+ export declare const MULTI_CREATABLE_SELECT_MENU_LIST_CLASS_NAME = "MrlMultiCreatableSelect__menu-list";
21
20
  /**
22
21
  * MrlMultiCreatableSelect component that supports creating extra options with user input. Option creating could be async too.
23
22
  * @param props - the component props
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { GroupBase, Props } from 'react-select';
3
2
  import { DefaultOption, SelectKind } from '../types';
4
3
  export interface MrlMultiSelectProps<T, IsMulti extends boolean = false, Group extends GroupBase<T> = GroupBase<T>> extends Omit<Props<T, IsMulti, Group>, 'isMulti' | 'hideSelectedOptions'> {
@@ -15,7 +14,7 @@ export interface MrlMultiSelectProps<T, IsMulti extends boolean = false, Group e
15
14
  ['data-qa']?: string;
16
15
  }
17
16
  export declare const MULTI_SELECT_CLASS_NAME_PREFIX = "MrlMultiSelect";
18
- export declare const MULTI_SELECT_MENU_LIST_CLASS_NAME: string;
17
+ export declare const MULTI_SELECT_MENU_LIST_CLASS_NAME = "MrlMultiSelect__menu-list";
19
18
  /**
20
19
  * MrlSelect component
21
20
  * @param props - the component props
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { GroupBase, Props } from 'react-select';
3
2
  import { SelectKind } from '../types';
4
3
  export interface MrlSelectProps<Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>> extends Props<Option, IsMulti, Group> {
@@ -15,7 +14,7 @@ export interface MrlSelectProps<Option, IsMulti extends boolean = false, Group e
15
14
  ['data-qa']?: string;
16
15
  }
17
16
  export declare const SELECT_CLASS_NAME_PREFIX = "MrlSelect";
18
- export declare const SELECT_MENU_LIST_CLASS_NAME: string;
17
+ export declare const SELECT_MENU_LIST_CLASS_NAME = "MrlSelect__menu-list";
19
18
  /**
20
19
  * MrlSelect component
21
20
  * @param props - the component props
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ClearIndicatorProps, GroupBase } from 'react-select';
3
2
  /**
4
3
  * MrlSelectClearIndicator component
@@ -1,8 +1,10 @@
1
- /// <reference types="react" />
2
1
  import { GroupBase, ContainerProps } from 'react-select';
3
2
  /**
4
3
  * MrlSelectContainer component
5
4
  *
5
+ * Adds `data-qa` support and keeps the `Escape` press that dismisses an open menu
6
+ * from also closing an outer dismissible surface (e.g. a select inside MrlModal).
7
+ *
6
8
  * @param props - the react-select container props
7
9
  * @returns a select container
8
10
  */
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { DropdownIndicatorProps, GroupBase } from 'react-select';
3
2
  /**
4
3
  * MrlSelectDropdownIndicator component
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { GroupBase, MultiValueProps } from 'react-select';
3
2
  import { DefaultOption } from '../types';
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { GroupBase, MultiValueRemoveProps } from 'react-select';
3
2
  /**
4
3
  * MrlSelectMultiValueRemove component
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { GroupBase, OptionProps } from 'react-select';
3
2
  /**
4
3
  * MrlSelectOption component
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { GroupBase, ValueContainerProps } from 'react-select';
3
2
  /**
4
3
  * MrlSelectValueContainer component
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ interface MenuEscapeContainmentHandlers {
3
+ onKeyDown: React.KeyboardEventHandler<HTMLDivElement>;
4
+ onKeyUp: React.KeyboardEventHandler<HTMLDivElement>;
5
+ }
6
+ /**
7
+ * Keeps the `Escape` press that dismisses an open select menu from reaching outer
8
+ * dismissible surfaces. MrlModal, MrlPanel and MrlPopover close on `Escape` keydown
9
+ * and MrlSidebar on keyup, so without containment a single press would close the
10
+ * menu and the surface behind it at the same time.
11
+ *
12
+ * While the menu is open, the `Escape` keydown and its paired keyup stop propagating
13
+ * after react-select handles them. Once the menu is closed, `Escape` bubbles as
14
+ * usual so the outer surface can respond to the next press.
15
+ *
16
+ * @param menuIsOpen - the resolved react-select menu state
17
+ * @param onKeyDown - react-select's container keydown handler to wrap
18
+ * @returns key event handlers to spread into the select container's `innerProps`
19
+ */
20
+ export declare function useMenuEscapeContainment(menuIsOpen: boolean, onKeyDown: React.KeyboardEventHandler<HTMLDivElement> | undefined): MenuEscapeContainmentHandlers;
21
+ export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { AttrsObject } from '../../../../utils';
3
2
  import './MrlTextarea.global.scss';
4
3
  type MrlTextareaState = 'default' | 'disabled' | 'error' | 'read-only';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LayoutComponent } from '../../layout/constants';
3
2
  import { GridColumns } from '../constants';
4
3
  type MrlCol = LayoutComponent & GridColumns;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LayoutComponent } from '../../layout/constants';
3
2
  import '../grid.variables.scss';
4
3
  import '../grid.global.scss';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LayoutComponent } from '../../layout/constants';
3
2
  import { AlignOptions, GutterSizes, JustifyOptions } from '../constants';
4
3
  interface MrlRow extends LayoutComponent {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LayoutComponent } from '../constants';
3
2
  /**
4
3
  * MrlMain React component.
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LayoutComponent } from '../constants';
3
2
  type MrlPage = LayoutComponent;
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LayoutComponent } from '../constants';
3
2
  type MrlPage = LayoutComponent;
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * MrlSidebar demo with the use of the forward ref to make open/close/toggle the sidebar
4
3
  * through buttons as children and outside of the sidebar.
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LayoutComponent, LayoutSection } from '../constants';
3
2
  type MrlTopbar = LayoutComponent & LayoutSection;
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface LayoutComponent {
3
2
  /**
4
3
  * Children to be rendered within the component.
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * Demo of a live region
4
3
  *
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ProgressBarComponent } from '../constants';
3
2
  import '../../../styles/shared/a11y-helpers/a11y.global.scss';
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SpinnerComponent } from '../constants';
3
2
  import '../../../styles/shared/a11y-helpers/a11y.global.scss';
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type CreateArrayWithLengthX<LENGTH extends number, ACC extends unknown[] = []> = ACC['length'] extends LENGTH ? ACC : CreateArrayWithLengthX<LENGTH, [...ACC, 1]>;
3
2
  type NumericRange<START_ARR extends number[], END extends number, ACC extends number = never> = START_ARR['length'] extends END ? ACC | END : NumericRange<[...START_ARR, 1], END, ACC | START_ARR['length']>;
4
3
  export type ProgressRange = NumericRange<CreateArrayWithLengthX<0>, 100>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type MenuPosition = 'bottom' | 'left' | 'right' | 'top' | 'static' | MenuIgnore;
3
2
  export type MenuAlignment = 'start' | 'end' | 'center';
4
3
  export type HorizontalAlign = 'left' | 'right' | 'center';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * Demo of a menu with a trigger for stories and testing
4
3
  *
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { MenuPosition, ActionState, MenuAlignment } from '../constants';
3
2
  interface MenuWithPopoverProps {
4
3
  position?: MenuPosition;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { MenuPosition, ActionState, MenuAlignment } from '../constants';
3
2
  interface MenuWithSubmenuProps {
4
3
  position?: MenuPosition;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CustomMenuPosition } from '../';
3
2
  import { MenuPosition, ActionState, MenuAlignment } from '../constants';
4
3
  export interface MenuWithTriggerProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import '../MrlModal/stories.scss';
3
2
  interface ModalDemoProps {
4
3
  /** Additional function to be run when the modal closes */
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface MrlPaginationTextProps {
3
2
  /** Additional class to add to the container element */
4
3
  className?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { MenuPosition, ActionState, MenuAlignment } from '../../menu/constants';
3
2
  interface PopoverWithIconButtonProps {
4
3
  hasCloseButton?: boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { MenuPosition, ActionState, MenuAlignment } from '../../menu/constants';
3
2
  interface PopoverWithSelectProps {
4
3
  hasCloseButton?: boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { MenuPosition, ActionState, MenuAlignment } from '../../menu/constants';
3
2
  interface PopoverWithTriggerProps {
4
3
  hasCloseButton?: boolean;
@@ -1,11 +1,10 @@
1
- /// <reference types="react" />
2
- import { MrlSmartCellRendererProps, MrlSmartTableColumn } from './MrlSmartTable';
3
- export declare const LicenseCell: ((props: MrlSmartCellRendererProps) => JSX.Element) | undefined;
4
- export declare const MemberSinceCell: ((props: MrlSmartCellRendererProps) => JSX.Element) | undefined;
5
- export declare const LastSeenCell: ((props: MrlSmartCellRendererProps) => JSX.Element) | undefined;
6
- export declare const CreateRoomCell: ((props: MrlSmartCellRendererProps) => JSX.Element) | undefined;
7
- export declare const SeeOpenRoomsCell: ((props: MrlSmartCellRendererProps) => JSX.Element) | undefined;
8
- export declare const PublishTemplatesCell: ((props: MrlSmartCellRendererProps) => JSX.Element) | undefined;
9
- export declare const WorkspaceAdminCell: ((props: MrlSmartCellRendererProps) => JSX.Element) | undefined;
10
- export declare const ActionsCell: ((props: MrlSmartCellRendererProps) => JSX.Element) | undefined;
1
+ import { MrlSmartTableColumn } from './MrlSmartTable';
2
+ export declare const LicenseCell: MrlSmartTableColumn["renderCell"];
3
+ export declare const MemberSinceCell: MrlSmartTableColumn["renderCell"];
4
+ export declare const LastSeenCell: MrlSmartTableColumn["renderCell"];
5
+ export declare const CreateRoomCell: MrlSmartTableColumn["renderCell"];
6
+ export declare const SeeOpenRoomsCell: MrlSmartTableColumn["renderCell"];
7
+ export declare const PublishTemplatesCell: MrlSmartTableColumn["renderCell"];
8
+ export declare const WorkspaceAdminCell: MrlSmartTableColumn["renderCell"];
9
+ export declare const ActionsCell: MrlSmartTableColumn["renderCell"];
11
10
  export declare const SAMPLE_COLUMNS_WITH_EDIT_ICON_BUTTON: MrlSmartTableColumn[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface MrlTableEmptyStateProps {
3
2
  /**
4
3
  * Text to be displayed in the empty state.
@@ -19,7 +19,7 @@ export declare const sortAlphabeticallyAsCoercedStrings: (a: unknown, b: unknown
19
19
  * @param {string[]} keys a set of properties to uniquely identify the element
20
20
  * @returns {string} the generated key
21
21
  */
22
- export declare const keyFor: (prefix: string, elementType: 'header' | 'column' | 'body' | 'row' | 'row-cell', ...keys: string[]) => string;
22
+ export declare const keyFor: (prefix: string, elementType: "header" | "column" | "body" | "row" | "row-cell", ...keys: string[]) => string;
23
23
  /**
24
24
  * Provides sort icon based on direction.
25
25
  *
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * Props for the MrlToolbarItem component.
4
3
  */
@@ -1,17 +1,22 @@
1
1
  import { extends as _extends, objectSpread2 as _objectSpread2 } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import * as React from 'react';
3
3
  import { components } from 'react-select';
4
+ import { useMenuEscapeContainment } from '../utils/useMenuEscapeContainment.js';
4
5
 
5
6
  /**
6
7
  * MrlSelectContainer component
7
8
  *
9
+ * Adds `data-qa` support and keeps the `Escape` press that dismisses an open menu
10
+ * from also closing an outer dismissible surface (e.g. a select inside MrlModal).
11
+ *
8
12
  * @param props - the react-select container props
9
13
  * @returns a select container
10
14
  */
11
15
  function MrlSelectContainer(props) {
12
16
  var dataQa = props.selectProps['data-qa'];
17
+ var escapeContainment = useMenuEscapeContainment(props.selectProps.menuIsOpen, props.innerProps.onKeyDown);
13
18
  return /*#__PURE__*/React.createElement(components.SelectContainer, _extends({}, props, {
14
- innerProps: _objectSpread2(_objectSpread2({}, props.innerProps), dataQa && {
19
+ innerProps: _objectSpread2(_objectSpread2(_objectSpread2({}, props.innerProps), escapeContainment), dataQa && {
15
20
  'data-qa': "".concat(dataQa, "-container")
16
21
  })
17
22
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"MrlSelectContainer.js","sources":["../../../../../../src/components/form/select/components/MrlSelectContainer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { GroupBase, components, ContainerProps } from 'react-select';\n\n/**\n * MrlSelectContainer component\n *\n * @param props - the react-select container props\n * @returns a select container\n */\nexport function MrlSelectContainer<\n\tT,\n\tIsMulti extends boolean = false,\n\tGroup extends GroupBase<T> = GroupBase<T>\n>(props: ContainerProps<T, IsMulti, Group>): JSX.Element {\n\tconst dataQa = props.selectProps['data-qa'];\n\treturn (\n\t\t<components.SelectContainer\n\t\t\t{...props}\n\t\t\tinnerProps={{\n\t\t\t\t...props.innerProps,\n\t\t\t\t...(dataQa && { 'data-qa': `${dataQa}-container` })\n\t\t\t}}\n\t\t/>\n\t);\n}\n"],"names":["MrlSelectContainer","props","dataQa","selectProps","React","createElement","components","SelectContainer","_extends","innerProps","_objectSpread","concat"],"mappings":";;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,kBAAkBA,CAIhCC,KAAwC,EAAe;AACxD,EAAA,IAAMC,MAAM,GAAGD,KAAK,CAACE,WAAW,CAAC,SAAS,CAAC;EAC3C,oBACCC,KAAA,CAAAC,aAAA,CAACC,UAAU,CAACC,eAAe,EAAAC,QAAA,CAAA,EAAA,EACtBP,KAAK,EAAA;IACTQ,UAAU,EAAAC,cAAA,CAAAA,cAAA,CAAA,EAAA,EACNT,KAAK,CAACQ,UAAU,CAAA,EACfP,MAAM,IAAI;MAAE,SAAS,EAAA,EAAA,CAAAS,MAAA,CAAKT,MAAM,EAAA,YAAA;KAAc;AACjD,GAAA,CACF,CAAC;AAEJ;;;;"}
1
+ {"version":3,"file":"MrlSelectContainer.js","sources":["../../../../../../src/components/form/select/components/MrlSelectContainer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { GroupBase, components, ContainerProps } from 'react-select';\nimport { useMenuEscapeContainment } from '../utils/useMenuEscapeContainment';\n\n/**\n * MrlSelectContainer component\n *\n * Adds `data-qa` support and keeps the `Escape` press that dismisses an open menu\n * from also closing an outer dismissible surface (e.g. a select inside MrlModal).\n *\n * @param props - the react-select container props\n * @returns a select container\n */\nexport function MrlSelectContainer<\n\tT,\n\tIsMulti extends boolean = false,\n\tGroup extends GroupBase<T> = GroupBase<T>\n>(props: ContainerProps<T, IsMulti, Group>): JSX.Element {\n\tconst dataQa = props.selectProps['data-qa'];\n\tconst escapeContainment = useMenuEscapeContainment(\n\t\tprops.selectProps.menuIsOpen,\n\t\tprops.innerProps.onKeyDown\n\t);\n\n\treturn (\n\t\t<components.SelectContainer\n\t\t\t{...props}\n\t\t\tinnerProps={{\n\t\t\t\t...props.innerProps,\n\t\t\t\t...escapeContainment,\n\t\t\t\t...(dataQa && { 'data-qa': `${dataQa}-container` })\n\t\t\t}}\n\t\t/>\n\t);\n}\n"],"names":["MrlSelectContainer","props","dataQa","selectProps","escapeContainment","useMenuEscapeContainment","menuIsOpen","innerProps","onKeyDown","React","createElement","components","SelectContainer","_extends","_objectSpread","concat"],"mappings":";;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,kBAAkBA,CAIhCC,KAAwC,EAAe;AACxD,EAAA,IAAMC,MAAM,GAAGD,KAAK,CAACE,WAAW,CAAC,SAAS,CAAC;AAC3C,EAAA,IAAMC,iBAAiB,GAAGC,wBAAwB,CACjDJ,KAAK,CAACE,WAAW,CAACG,UAAU,EAC5BL,KAAK,CAACM,UAAU,CAACC,SAClB,CAAC;EAED,oBACCC,KAAA,CAAAC,aAAA,CAACC,UAAU,CAACC,eAAe,EAAAC,QAAA,CAAA,EAAA,EACtBZ,KAAK,EAAA;AACTM,IAAAA,UAAU,EAAAO,cAAA,CAAAA,cAAA,CAAAA,cAAA,CAAA,EAAA,EACNb,KAAK,CAACM,UAAU,CAAA,EAChBH,iBAAiB,CAAA,EAChBF,MAAM,IAAI;MAAE,SAAS,EAAA,EAAA,CAAAa,MAAA,CAAKb,MAAM,EAAA,YAAA;KAAc;AACjD,GAAA,CACF,CAAC;AAEJ;;;;"}
@@ -0,0 +1,37 @@
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * Keeps the `Escape` press that dismisses an open select menu from reaching outer
5
+ * dismissible surfaces. MrlModal, MrlPanel and MrlPopover close on `Escape` keydown
6
+ * and MrlSidebar on keyup, so without containment a single press would close the
7
+ * menu and the surface behind it at the same time.
8
+ *
9
+ * While the menu is open, the `Escape` keydown and its paired keyup stop propagating
10
+ * after react-select handles them. Once the menu is closed, `Escape` bubbles as
11
+ * usual so the outer surface can respond to the next press.
12
+ *
13
+ * @param menuIsOpen - the resolved react-select menu state
14
+ * @param onKeyDown - react-select's container keydown handler to wrap
15
+ * @returns key event handlers to spread into the select container's `innerProps`
16
+ */
17
+ function useMenuEscapeContainment(menuIsOpen, onKeyDown) {
18
+ var escapeDismissedTheMenu = React.useRef(false);
19
+ var handleKeyDown = event => {
20
+ onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
21
+ if (event.key !== 'Escape') return;
22
+ escapeDismissedTheMenu.current = menuIsOpen;
23
+ if (menuIsOpen) event.stopPropagation();
24
+ };
25
+ var handleKeyUp = event => {
26
+ if (event.key !== 'Escape') return;
27
+ if (escapeDismissedTheMenu.current) event.stopPropagation();
28
+ escapeDismissedTheMenu.current = false;
29
+ };
30
+ return {
31
+ onKeyDown: handleKeyDown,
32
+ onKeyUp: handleKeyUp
33
+ };
34
+ }
35
+
36
+ export { useMenuEscapeContainment };
37
+ //# sourceMappingURL=useMenuEscapeContainment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMenuEscapeContainment.js","sources":["../../../../../../src/components/form/select/utils/useMenuEscapeContainment.ts"],"sourcesContent":["import * as React from 'react';\n\ninterface MenuEscapeContainmentHandlers {\n\tonKeyDown: React.KeyboardEventHandler<HTMLDivElement>;\n\tonKeyUp: React.KeyboardEventHandler<HTMLDivElement>;\n}\n\n/**\n * Keeps the `Escape` press that dismisses an open select menu from reaching outer\n * dismissible surfaces. MrlModal, MrlPanel and MrlPopover close on `Escape` keydown\n * and MrlSidebar on keyup, so without containment a single press would close the\n * menu and the surface behind it at the same time.\n *\n * While the menu is open, the `Escape` keydown and its paired keyup stop propagating\n * after react-select handles them. Once the menu is closed, `Escape` bubbles as\n * usual so the outer surface can respond to the next press.\n *\n * @param menuIsOpen - the resolved react-select menu state\n * @param onKeyDown - react-select's container keydown handler to wrap\n * @returns key event handlers to spread into the select container's `innerProps`\n */\nexport function useMenuEscapeContainment(\n\tmenuIsOpen: boolean,\n\tonKeyDown: React.KeyboardEventHandler<HTMLDivElement> | undefined\n): MenuEscapeContainmentHandlers {\n\tconst escapeDismissedTheMenu = React.useRef(false);\n\n\tconst handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = (event) => {\n\t\tonKeyDown?.(event);\n\n\t\tif (event.key !== 'Escape') return;\n\n\t\tescapeDismissedTheMenu.current = menuIsOpen;\n\t\tif (menuIsOpen) event.stopPropagation();\n\t};\n\n\tconst handleKeyUp: React.KeyboardEventHandler<HTMLDivElement> = (event) => {\n\t\tif (event.key !== 'Escape') return;\n\n\t\tif (escapeDismissedTheMenu.current) event.stopPropagation();\n\t\tescapeDismissedTheMenu.current = false;\n\t};\n\n\treturn { onKeyDown: handleKeyDown, onKeyUp: handleKeyUp };\n}\n"],"names":["useMenuEscapeContainment","menuIsOpen","onKeyDown","escapeDismissedTheMenu","React","useRef","handleKeyDown","event","key","current","stopPropagation","handleKeyUp","onKeyUp"],"mappings":";;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,wBAAwBA,CACvCC,UAAmB,EACnBC,SAAiE,EACjC;AAChC,EAAA,IAAMC,sBAAsB,GAAGC,KAAK,CAACC,MAAM,CAAC,KAAK,CAAC;EAElD,IAAMC,aAAyD,GAAIC,KAAK,IAAK;AAC5EL,IAAAA,SAAS,aAATA,SAAS,KAAA,MAAA,GAAA,MAAA,GAATA,SAAS,CAAGK,KAAK,CAAC;AAElB,IAAA,IAAIA,KAAK,CAACC,GAAG,KAAK,QAAQ,EAAE;IAE5BL,sBAAsB,CAACM,OAAO,GAAGR,UAAU;AAC3C,IAAA,IAAIA,UAAU,EAAEM,KAAK,CAACG,eAAe,EAAE;EACxC,CAAC;EAED,IAAMC,WAAuD,GAAIJ,KAAK,IAAK;AAC1E,IAAA,IAAIA,KAAK,CAACC,GAAG,KAAK,QAAQ,EAAE;IAE5B,IAAIL,sBAAsB,CAACM,OAAO,EAAEF,KAAK,CAACG,eAAe,EAAE;IAC3DP,sBAAsB,CAACM,OAAO,GAAG,KAAK;EACvC,CAAC;EAED,OAAO;AAAEP,IAAAA,SAAS,EAAEI,aAAa;AAAEM,IAAAA,OAAO,EAAED;GAAa;AAC1D;;;;"}
@@ -1,4 +1,4 @@
1
- var styles = {"mrl-blockNotification":"mrl-blockNotification--xbhrd","mrl-blockNotification-icon":"mrl-blockNotification-icon--CAq04","mrl-blockNotification-close-wrapper":"mrl-blockNotification-close-wrapper--yODTH","cta":"cta--gnyoO","mrl-blockNotification--dismissible":"mrl-blockNotification--dismissible--ZlIID","mrl-blockNotification-message":"mrl-blockNotification-message--MdtXZ","mrl-blockNotification-heading":"mrl-blockNotification-heading--WGPWE"};
1
+ var styles = {"mrl-blockNotification":"mrl-blockNotification--xbhrd","mrl-blockNotification-icon":"mrl-blockNotification-icon--CAq04","mrl-blockNotification-close-wrapper":"mrl-blockNotification-close-wrapper--yODTH","cta":"cta--gnyoO","mrl-blockNotification--dismissible":"mrl-blockNotification--dismissible--ZlIID","mrl-blockNotification-heading":"mrl-blockNotification-heading--WGPWE","mrl-blockNotification-message":"mrl-blockNotification-message--MdtXZ"};
2
2
 
3
3
  export { styles as default };
4
4
  //# sourceMappingURL=MrlBlockNotification.module.scss.js.map