@procore/core-react 12.41.0 → 12.43.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 (261) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/AnchorNavigation/AnchorNavigation.js +11 -5
  3. package/dist/AnchorNavigation/AnchorNavigation.js.map +1 -1
  4. package/dist/AnchorNavigation/AnchorNavigation.styles.d.ts +1 -0
  5. package/dist/AnchorNavigation/AnchorNavigation.styles.js +7 -3
  6. package/dist/AnchorNavigation/AnchorNavigation.styles.js.map +1 -1
  7. package/dist/AnchorNavigation/AnchorNavigation.types.d.ts +7 -1
  8. package/dist/AnchorNavigation/AnchorNavigation.types.js.map +1 -1
  9. package/dist/Avatar/Avatar.styles.js +5 -5
  10. package/dist/AvatarStack/AvatarStack.styles.d.ts +74 -74
  11. package/dist/AvatarStack/AvatarStack.styles.js +7 -7
  12. package/dist/Badge/Badge.styles.js +2 -2
  13. package/dist/BadgePill/BadgePill.styles.js +4 -4
  14. package/dist/Banner/Banner.styles.js +10 -10
  15. package/dist/Box/Box.styles.js +1 -1
  16. package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
  17. package/dist/Button/Button.styles.js +5 -5
  18. package/dist/Button/Button.types.d.ts +1 -4
  19. package/dist/Button/Button.types.js.map +1 -1
  20. package/dist/Button/index.d.ts +1 -1
  21. package/dist/Button/index.js.map +1 -1
  22. package/dist/Calendar/Calendar.styles.js +9 -9
  23. package/dist/Card/Card.styles.js +1 -1
  24. package/dist/Checkbox/Checkbox.js +1 -0
  25. package/dist/Checkbox/Checkbox.js.map +1 -1
  26. package/dist/Checkbox/Checkbox.styles.js +6 -6
  27. package/dist/ContactItem/ContactItem.js +7 -3
  28. package/dist/ContactItem/ContactItem.js.map +1 -1
  29. package/dist/ContactItem/ContactItem.styles.js +5 -5
  30. package/dist/Content/Content.styles.js +2 -2
  31. package/dist/DateInput/DateInput.js +9 -0
  32. package/dist/DateInput/DateInput.js.map +1 -1
  33. package/dist/DateInput/DateInput.styles.js +6 -6
  34. package/dist/DetailPage/DetailPage.styles.js +7 -7
  35. package/dist/Dropdown/Dropdown.styles.js +3 -3
  36. package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
  37. package/dist/Dropzone/Dropzone.js +1 -1
  38. package/dist/Dropzone/Dropzone.styles.js +9 -9
  39. package/dist/EmptyState/EmptyState.styles.js +6 -6
  40. package/dist/Field/Field.styles.js +3 -3
  41. package/dist/FileList/FileList.styles.js +3 -3
  42. package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
  43. package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
  44. package/dist/FileSelect/FileSelect.styles.js +2 -2
  45. package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
  46. package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
  47. package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
  48. package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
  49. package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
  50. package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.d.ts +1 -1
  51. package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
  52. package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
  53. package/dist/FileToken/FileToken.styles.js +6 -6
  54. package/dist/FileToken/FileTokenInner.js +1 -3
  55. package/dist/FileToken/FileTokenInner.js.map +1 -1
  56. package/dist/FilterToken/FilterToken.styles.js +5 -5
  57. package/dist/FlexList/FlexList.styles.js +1 -1
  58. package/dist/Form/Form.styles.js +13 -13
  59. package/dist/Form/StyledFormikForm.styles.d.ts +2 -2
  60. package/dist/Form/StyledFormikForm.styles.js +2 -2
  61. package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
  62. package/dist/Grid/Grid.styles.js +2 -2
  63. package/dist/GroupSelect/GroupSelect.styles.js +1 -1
  64. package/dist/Input/Input.styles.js +1 -1
  65. package/dist/Link/Link.styles.js +1 -1
  66. package/dist/ListPage/ListPage.styles.js +8 -8
  67. package/dist/Loader/Loader.styles.js +2 -2
  68. package/dist/MenuImperative/MenuImperative.d.ts +1 -1
  69. package/dist/MenuImperative/MenuImperative.js +126 -34
  70. package/dist/MenuImperative/MenuImperative.js.map +1 -1
  71. package/dist/MenuImperative/MenuImperative.styles.js +15 -15
  72. package/dist/MenuImperative/MenuImperative.styles.js.map +1 -1
  73. package/dist/MenuImperative/MenuImperative.types.d.ts +36 -0
  74. package/dist/MenuImperative/MenuImperative.types.js.map +1 -1
  75. package/dist/MenuImperative/sensors.d.ts +6 -3
  76. package/dist/MenuImperative/sensors.js +42 -34
  77. package/dist/MenuImperative/sensors.js.map +1 -1
  78. package/dist/Modal/Modal.d.ts +4 -0
  79. package/dist/Modal/Modal.js +30 -14
  80. package/dist/Modal/Modal.js.map +1 -1
  81. package/dist/Modal/Modal.styles.js +13 -13
  82. package/dist/Modal/Modal.types.d.ts +28 -5
  83. package/dist/Modal/Modal.types.js.map +1 -1
  84. package/dist/Modal/index.d.ts +1 -1
  85. package/dist/Modal/index.js.map +1 -1
  86. package/dist/MultiSelect/MultiSelect.js +7 -5
  87. package/dist/MultiSelect/MultiSelect.js.map +1 -1
  88. package/dist/MultiSelect/MultiSelect.styles.js +8 -8
  89. package/dist/NextMenu/NextMenu.styles.js +3 -3
  90. package/dist/Notation/Notation.js +1 -1
  91. package/dist/NumberInput/NumberInput.styles.js +7 -7
  92. package/dist/Overlay/OverlayArrow.styles.js +1 -1
  93. package/dist/OverlayTrigger/a11yPresets.d.ts +23 -30
  94. package/dist/OverlayTrigger/a11yPresets.js +29 -27
  95. package/dist/OverlayTrigger/a11yPresets.js.map +1 -1
  96. package/dist/PageLayout/PageLayout.styles.d.ts +1 -1
  97. package/dist/PageLayout/PageLayout.styles.js +16 -16
  98. package/dist/PageTemplate/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
  99. package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.styles.js +3 -3
  100. package/dist/PageTemplate/PagePaneTemplate/PagePaneTemplate.styles.js +2 -2
  101. package/dist/PageTemplate/PageTemplate/PageTemplate.styles.js +3 -3
  102. package/dist/Pagination/Pagination.styles.js +5 -5
  103. package/dist/Panel/Panel.styles.js +11 -11
  104. package/dist/Pill/Pill.styles.js +3 -3
  105. package/dist/PillSelect/PillSelect.styles.js +4 -4
  106. package/dist/Popover/Popover.styles.js +2 -2
  107. package/dist/Portal/Portal.styles.js +1 -1
  108. package/dist/ProgressBar/ProgressBar.styles.js +4 -4
  109. package/dist/ProgressBar/ProgressBar.styles.js.map +1 -1
  110. package/dist/RadioButton/RadioButton.styles.js +3 -3
  111. package/dist/Required/Required.styles.js +3 -3
  112. package/dist/Search/Search.styles.js +5 -5
  113. package/dist/Section/Section.styles.js +7 -7
  114. package/dist/SegmentedController/SegmentedController.styles.js +4 -4
  115. package/dist/Select/Select.js +3 -2
  116. package/dist/Select/Select.js.map +1 -1
  117. package/dist/Select/Select.styles.js +8 -8
  118. package/dist/Semantic/Semantic.styles.d.ts +74 -74
  119. package/dist/Semantic/Semantic.styles.js +9 -9
  120. package/dist/Slider/Slider.styles.js +5 -5
  121. package/dist/Spinner/Spinner.styles.js +7 -7
  122. package/dist/SplitViewCard/SplitViewCard.styles.js +8 -8
  123. package/dist/SuperSelect/SuperSelect.components.js +35 -22
  124. package/dist/SuperSelect/SuperSelect.components.js.map +1 -1
  125. package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
  126. package/dist/SuperSelect/SuperSelect.styles.d.ts +4 -2
  127. package/dist/SuperSelect/SuperSelect.styles.js +49 -42
  128. package/dist/SuperSelect/SuperSelect.styles.js.map +1 -1
  129. package/dist/SuperSelect/SuperSelect.types.d.ts +3 -4
  130. package/dist/SuperSelect/SuperSelect.types.js.map +1 -1
  131. package/dist/SuperSelect/presets/filterPreset.js +7 -2
  132. package/dist/SuperSelect/presets/filterPreset.js.map +1 -1
  133. package/dist/SuperSelect/useSuperSelect.d.ts +1 -1
  134. package/dist/SuperSelect/useSuperSelect.js +117 -90
  135. package/dist/SuperSelect/useSuperSelect.js.map +1 -1
  136. package/dist/Switch/Switch.styles.js +4 -4
  137. package/dist/Table/Table.styles.js +28 -28
  138. package/dist/TableShelf/TableShelf.styles.js +5 -5
  139. package/dist/Tabs/Tabs.js +1 -1
  140. package/dist/Tabs/Tabs.js.map +1 -1
  141. package/dist/Tabs/Tabs.styles.js +15 -15
  142. package/dist/Tearsheet/Tearsheet.js +1 -1
  143. package/dist/Tearsheet/Tearsheet.js.map +1 -1
  144. package/dist/Tearsheet/Tearsheet.styles.js +5 -5
  145. package/dist/Tearsheet/storybook/PageLayoutDemo.js +1 -0
  146. package/dist/Tearsheet/storybook/PageLayoutDemo.js.map +1 -1
  147. package/dist/TextArea/TextArea.styles.js +1 -1
  148. package/dist/TextEditorOutput/TextEditorOutput.styles.js +1 -1
  149. package/dist/Thumbnail/Thumbnail.hooks.d.ts +58 -58
  150. package/dist/Thumbnail/Thumbnail.styles.js +17 -17
  151. package/dist/ThumbnailGrid/ThumbnailGrid.styles.d.ts +1 -1
  152. package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
  153. package/dist/TieredSelect/TieredSelect.styles.d.ts +1 -1
  154. package/dist/TieredSelect/TieredSelect.styles.js +9 -9
  155. package/dist/Tile/Tile.styles.js +8 -8
  156. package/dist/Title/Title.styles.js +7 -7
  157. package/dist/Toast/Toast.styles.js +3 -3
  158. package/dist/ToggleButton/ToggleButton.styles.js +1 -1
  159. package/dist/Token/Token.js +1 -1
  160. package/dist/Token/Token.js.map +1 -1
  161. package/dist/Token/Token.styles.js +3 -3
  162. package/dist/ToolHeader/ToolHeader.styles.js +6 -6
  163. package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
  164. package/dist/ToolLandingPageTemplate/ToolLandingPageTemplate.d.ts +1 -1
  165. package/dist/Tooltip/Tooltip.styles.js +3 -3
  166. package/dist/Tree/Tree.js +1 -1
  167. package/dist/Tree/Tree.styles.js +10 -10
  168. package/dist/Typeahead/Typeahead.js +7 -3
  169. package/dist/Typeahead/Typeahead.js.map +1 -1
  170. package/dist/Typeahead/Typeahead.styles.js +3 -3
  171. package/dist/Typography/Typography.styles.js +1 -1
  172. package/dist/Typography/Typography.table.story.js +2 -2
  173. package/dist/Typography/Typography.types.d.ts +1 -0
  174. package/dist/Typography/Typography.types.js.map +1 -1
  175. package/dist/_hooks/I18n.d.ts +28 -0
  176. package/dist/_locales/en.json +15 -1
  177. package/dist/_locales/pseudo.json +15 -1
  178. package/dist/_storyHelpers_/components/Deprecation.styles.js +1 -1
  179. package/dist/_storyHelpers_/components/StoryGrid.js +3 -3
  180. package/dist/_styles/colors.js +1 -3
  181. package/dist/_styles/colors.js.map +1 -1
  182. package/dist/_typedoc/AnchorNavigation/AnchorNavigation.types.json +13 -3
  183. package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
  184. package/dist/_typedoc/AvatarStack/AvatarStack.types.json +25 -25
  185. package/dist/_typedoc/Badge/Badge.types.json +6 -6
  186. package/dist/_typedoc/Banner/Banner.types.json +15 -15
  187. package/dist/_typedoc/Box/Box.types.json +72 -72
  188. package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
  189. package/dist/_typedoc/Button/Button.types.json +17 -17
  190. package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
  191. package/dist/_typedoc/Card/Card.types.json +6 -6
  192. package/dist/_typedoc/Checkbox/Checkbox.types.json +8 -8
  193. package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
  194. package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
  195. package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
  196. package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
  197. package/dist/_typedoc/Dropdown/Dropdown.types.json +39 -39
  198. package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +31 -31
  199. package/dist/_typedoc/Dropzone/Dropzone.types.json +44 -44
  200. package/dist/_typedoc/EmptyState/EmptyState.types.json +16 -16
  201. package/dist/_typedoc/FileList/FileList.types.json +9 -9
  202. package/dist/_typedoc/FileSelect/FileSelect.types.json +27 -27
  203. package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
  204. package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
  205. package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
  206. package/dist/_typedoc/Flex/Flex.types.json +27 -27
  207. package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
  208. package/dist/_typedoc/Form/Form.types.json +832 -832
  209. package/dist/_typedoc/GhostPlaceholder/GhostPlaceholder.types.json +12 -12
  210. package/dist/_typedoc/Grid/Grid.types.json +8 -8
  211. package/dist/_typedoc/GroupSelect/GroupSelect.types.json +54 -54
  212. package/dist/_typedoc/Input/Input.types.json +2 -2
  213. package/dist/_typedoc/Link/Link.types.json +1 -1
  214. package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
  215. package/dist/_typedoc/Menu/Menu.types.json +62 -62
  216. package/dist/_typedoc/MenuImperative/MenuImperative.types.json +147 -77
  217. package/dist/_typedoc/Modal/Modal.types.json +96 -68
  218. package/dist/_typedoc/MultiSelect/MultiSelect.types.json +33 -33
  219. package/dist/_typedoc/NextTile/NextTile.types.json +32 -32
  220. package/dist/_typedoc/Notation/Notation.types.json +4 -4
  221. package/dist/_typedoc/NumberInput/NumberInput.types.json +54 -54
  222. package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +33 -33
  223. package/dist/_typedoc/PageLayout/PageLayout.types.json +28 -28
  224. package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
  225. package/dist/_typedoc/Panel/Panel.types.json +27 -27
  226. package/dist/_typedoc/Pill/Pill.types.json +2 -2
  227. package/dist/_typedoc/PillSelect/PillSelect.types.json +49 -49
  228. package/dist/_typedoc/Popover/Popover.types.json +15 -15
  229. package/dist/_typedoc/ProgressBar/ProgressBar.types.json +7 -7
  230. package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
  231. package/dist/_typedoc/Required/Required.types.json +5 -5
  232. package/dist/_typedoc/Search/Search.types.json +18 -18
  233. package/dist/_typedoc/Section/Section.types.json +15 -15
  234. package/dist/_typedoc/SegmentedController/SegmentedController.types.json +21 -21
  235. package/dist/_typedoc/Select/Select.types.json +69 -69
  236. package/dist/_typedoc/SettingsPage/SettingsPage.types.json +10 -10
  237. package/dist/_typedoc/Slider/Slider.types.json +6 -6
  238. package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
  239. package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +14 -14
  240. package/dist/_typedoc/Table/Table.types.json +102 -102
  241. package/dist/_typedoc/Tabs/Tabs.types.json +21 -21
  242. package/dist/_typedoc/Tearsheet/Tearsheet.types.json +17 -17
  243. package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
  244. package/dist/_typedoc/TextEditor/TextEditor.types.json +11 -11
  245. package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +4 -4
  246. package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
  247. package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +43 -43
  248. package/dist/_typedoc/TieredSelect/TieredSelect.types.json +29 -29
  249. package/dist/_typedoc/Tile/Tile.types.json +8 -8
  250. package/dist/_typedoc/Title/Title.types.json +3 -3
  251. package/dist/_typedoc/Toast/Toast.types.json +4 -4
  252. package/dist/_typedoc/ToggleButton/ToggleButton.types.json +4 -4
  253. package/dist/_typedoc/Token/Token.types.json +7 -7
  254. package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
  255. package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +10 -10
  256. package/dist/_typedoc/Tooltip/Tooltip.types.json +15 -15
  257. package/dist/_typedoc/Tree/Tree.types.json +90 -90
  258. package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
  259. package/dist/_typedoc/Typography/Typography.types.json +12 -11
  260. package/dist/_typedoc/_utils/types.json +3 -3
  261. package/package.json +3 -3
@@ -4,8 +4,12 @@ var _excluded = ["children", "compact", "onClose", "qa"],
4
4
  _excluded4 = ["children", "compact", "noSideSpacing"],
5
5
  _excluded5 = ["children"],
6
6
  _excluded6 = ["children"],
7
- _excluded7 = ["aria-describedby", "aria-details", "aria-labelledby", "aria-label", "children", "compact", "howToClose", "id", "onClickOverlay", "onClose", "open", "placement", "role"],
8
- _excluded8 = ["children", "headline", "onClose"];
7
+ _excluded7 = ["aria-describedby", "aria-details", "aria-labelledby", "aria-label", "aria-modal", "children", "compact", "howToClose", "id", "onClickOverlay", "onClose", "open", "placement", "role"],
8
+ _excluded8 = ["children", "headline", "howToClose", "onClose"];
9
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
10
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
12
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
9
13
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
10
14
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
15
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
@@ -58,7 +62,6 @@ var ModalClosableHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
58
62
  qa = _ref.qa,
59
63
  props = _objectWithoutProperties(_ref, _excluded);
60
64
  var _React$useContext = React.useContext(ModalBodyScrollContext),
61
- ariaLabelledBy = _React$useContext.ariaLabelledBy,
62
65
  isBodyScrolled = _React$useContext.isBodyScrolled;
63
66
  var _React$useContext2 = React.useContext(ModalCloseContext),
64
67
  howToClose = _React$useContext2.howToClose,
@@ -93,9 +96,6 @@ var ModalClosableHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
93
96
  }
94
97
  }, /*#__PURE__*/React.createElement(StyledModalHeading, {
95
98
  $compact: compact
96
- // This made all children the heading, like Title content
97
- ,
98
- id: ariaLabelledBy
99
99
  }, children), onClose && howToClose !== null && howToClose !== void 0 && howToClose.includes('x') || externalOnClose ? /*#__PURE__*/React.createElement(StyledModalCancel, null, /*#__PURE__*/React.createElement(Button, {
100
100
  "aria-label": I18n.t('core.modal.a11y.close'),
101
101
  "data-internal": "close-button",
@@ -219,6 +219,7 @@ var Modal_ = /*#__PURE__*/React.forwardRef(function (_ref7, ref) {
219
219
  ariaDetails = _ref7['aria-details'],
220
220
  ariaLabelledby = _ref7['aria-labelledby'],
221
221
  ariaLabel = _ref7['aria-label'],
222
+ ariaModal = _ref7['aria-modal'],
222
223
  children = _ref7.children,
223
224
  _ref7$compact = _ref7.compact,
224
225
  compact = _ref7$compact === void 0 ? false : _ref7$compact,
@@ -277,13 +278,13 @@ var Modal_ = /*#__PURE__*/React.forwardRef(function (_ref7, ref) {
277
278
  'aria-details': ariaDetails,
278
279
  'aria-labelledby': labelledbyId,
279
280
  'aria-label': ariaLabel,
281
+ 'aria-modal': ariaModal,
280
282
  id: id,
281
- isModal: false,
282
283
  isOpen: open,
283
284
  role: role
284
285
  }),
285
286
  dialogProps_ = _useModalDialogLike.dialogProps;
286
- var dialogProps = onClose && role === 'dialog' ? dialogProps_ : {};
287
+ var dialogProps = onClose && (role === 'dialog' || role === 'alertdialog') ? dialogProps_ : {};
287
288
  function onClickScrim(e) {
288
289
  onClickOverlay(e);
289
290
  if (onClose && howToClose !== null && howToClose !== void 0 && howToClose.includes('scrim')) {
@@ -342,21 +343,32 @@ var ModalBodyScrollObserver = function ModalBodyScrollObserver(_ref8) {
342
343
  export var ConfirmModal = /*#__PURE__*/React.forwardRef(function (_ref9, ref) {
343
344
  var children = _ref9.children,
344
345
  headline = _ref9.headline,
346
+ _ref9$howToClose = _ref9.howToClose,
347
+ howToClose = _ref9$howToClose === void 0 ? [] : _ref9$howToClose,
345
348
  onClose = _ref9.onClose,
346
349
  props = _objectWithoutProperties(_ref9, _excluded8);
347
- return /*#__PURE__*/React.createElement(Modal, _extends({}, props, {
350
+ var isDialog = props.role === 'dialog' || props.role === 'alertdialog';
351
+
352
+ // When role="dialog", pass onClose to Modal for focus management and Escape key.
353
+ // The header X button is handled via ModalCloseContext when howToClose includes 'x'.
354
+ var configuredModalProps = isDialog && onClose ? {
355
+ onClose: onClose,
356
+ howToClose: ['x'].concat(_toConsumableArray(howToClose))
357
+ } : undefined;
358
+ var headerOnClose = !isDialog && onClose ? onClose : undefined;
359
+ return /*#__PURE__*/React.createElement(Modal, _extends({}, props, configuredModalProps, {
348
360
  ref: ref
349
361
  }), /*#__PURE__*/React.createElement(ModalClosableHeader, {
350
- onClose: onClose
362
+ onClose: headerOnClose
351
363
  }, /*#__PURE__*/React.createElement(StyledModalWarningIcon, {
352
364
  size: "lg"
353
- }), headline), children);
365
+ }), /*#__PURE__*/React.createElement(ModalHeading, null, headline)), children);
354
366
  });
355
367
 
356
368
  /**
357
- * Applies proper smenatics regardless of where in the Modal.
358
- * Adds the generate ID to node when necessary so the dialog and scroll region
359
- * aria-labelledby by can find the primary heading (in the Modal.Header)
369
+ * Applies proper semantics regardless of where in the Modal.
370
+ * @a11y The primary heading that is auto linked to the dialog and scroll region with
371
+ * aria-labelledby, when inside the Modal.Header.
360
372
  */
361
373
  var ModalHeading = function ModalHeading(props) {
362
374
  var _React$useContext6 = React.useContext(ModalBodyScrollContext),
@@ -415,6 +427,10 @@ export var Modal = addSubcomponents({
415
427
  FooterNotation: FooterNotation,
416
428
  FooterSummary: FooterSummary,
417
429
  Header: Header,
430
+ /**
431
+ * @a11y The primary heading inside the `Modal.Header` that is auto linked
432
+ * to the dialog and scroll region with aria-labelledby.
433
+ */
418
434
  Heading: ModalHeading,
419
435
  Overlay: Overlay,
420
436
  Scrim: Scrim,
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","names":["Clear","useId","React","useEffect","Button","useModalDialogLike","Portal","Heading","LevelContext","Section","SectionProvider","useDeprecation","useLayoutEventListener","OverridableFocusScope","useI18nContext","useOverflowObserver","useScrollLock","Visibility","addSubcomponents","CloseWithConfirmContext","useCloseWithConfirmContext","useCloseWithConfirmState","mergeRefs","ChildRegistryProvider","useModalChildRegistryDispatch","fadeInClassName","fadeOutClassName","StyledModal","StyledModalBody","StyledModalButtons","StyledModalCancel","StyledModalContainer","StyledModalContent","StyledModalFooter","StyledModalFooterNotation","StyledModalFooterSummary","StyledModalHeader","StyledModalHeading","StyledModalScrim","StyledModalWarningIcon","useInitializeModalFocus","noop","defaultStartLevel","initialBodyLevel","ModalCloseContext","createContext","howToClose","onClose","undefined","ModalPrimaryHeadingCheckContext","inModalHeader","ModalBodyScrollContext","isBodyScrolled","setIsBodyScrolled","ariaLabelledBy","ModalClosableHeader","forwardRef","_ref","ref","children","_ref$compact","compact","externalOnClose","qa","props","_objectWithoutProperties","_excluded","_React$useContext","useContext","_React$useContext2","I18n","modalClosableHeaderRef","useRef","_useCloseWithConfirmC","closeWithConfirm","registerChildRef","child","onClickButton","e","includes","createElement","_extends","$compact","$isBodyScrolled","Provider","value","id","t","closeButton","icon","onClick","size","variant","ModalClosableFooterButtons","_ref2","_excluded2","_React$useContext3","_useCloseWithConfirmC2","modalClosableFooterButtonsRef","ModalContainer","_ref3","_ref3$compact","placement","width","_excluded3","_React$useContext4","modalContainerRef","hasOnClose","shadowStrength","$placement","$width","ModalBody","_ref4","_ref4$compact","_ref4$noSideSpacing","noSideSpacing","_excluded4","_useOverflowObserver","isOverflowingY","overflowRef","scrollRef","modalBodyRef","_React$useContext5","event","handler","currentTarget","scrollTop","scope","$isOverflowingY","$noSideSpacing","tabIndex","role","ModalFooterSummary","_ref5","_excluded5","ModalFooterNotation","_ref6","_excluded6","intent","color","italic","Modal_","_ref7","ariaDescribedby","ariaDetails","ariaLabelledby","ariaLabel","_ref7$compact","_ref7$onClickOverlay","onClickOverlay","_ref7$open","open","_ref7$placement","_excluded7","defaultLabelId","labelledbyId","_React$useState","useState","_React$useState2","_slicedToArray","visible","setVisible","_React$useState3","_React$useState4","fadeType","setFadeType","closeWithConfirmState","fadeTimer","setTimeout","clearTimeout","onTransitionEnd","handleKeyDown","key","preventDefault","stopPropagation","_useModalDialogLike","isModal","isOpen","dialogProps_","dialogProps","onClickScrim","autoFocus","contain","restoreFocus","className","onKeyDown","ModalBodyScrollObserver","_ref8","_React$useState5","_React$useState6","ConfirmModal","_ref9","headline","_excluded8","Modal","ModalHeading","_React$useContext6","_React$useContext7","ModalState","oldThing","displayName","Body","Container","Content","FooterSummary","Footer","FooterButtons","FooterNotation","Header","Overlay","Scrim","State"],"sources":["../../src/Modal/Modal.tsx"],"sourcesContent":["import { Clear } from '@procore/core-icons/dist'\nimport { useId } from '@react-aria/utils'\nimport React, { useEffect } from 'react'\nimport { Button } from '../Button'\nimport { useModalDialogLike } from '../OverlayTrigger/a11yPresets'\nimport { Portal } from '../Portal'\nimport {\n Heading,\n LevelContext,\n Section,\n SectionProvider,\n} from '../Section/Section'\nimport type { HeadingProps } from '../Semantic/Semantic.types'\nimport type { TypographyProps } from '../Typography'\nimport { useDeprecation } from '../_hooks/Deprecation'\nimport { useLayoutEventListener } from '../_hooks/EventListener'\nimport { OverridableFocusScope } from '../_hooks/FocusScopeOverride'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { useOverflowObserver } from '../_hooks/OverflowObserver'\nimport { useScrollLock } from '../_hooks/ScrollLock'\nimport type { RenderProps } from '../_hooks/Visibility'\nimport { Visibility } from '../_hooks/Visibility'\nimport { addSubcomponents } from '../_utils/addSubcomponents'\nimport {\n CloseWithConfirmContext,\n useCloseWithConfirmContext,\n useCloseWithConfirmState,\n} from '../_utils/closeWithConfirm'\nimport { mergeRefs } from '../_utils/mergeRefs'\nimport {\n ChildRegistryProvider,\n useModalChildRegistryDispatch,\n} from './ChildRegistry.context'\nimport {\n fadeInClassName,\n fadeOutClassName,\n StyledModal,\n StyledModalBody,\n StyledModalButtons,\n StyledModalCancel,\n StyledModalContainer,\n StyledModalContent,\n StyledModalFooter,\n StyledModalFooterNotation,\n StyledModalFooterSummary,\n StyledModalHeader,\n StyledModalHeading,\n StyledModalScrim,\n StyledModalWarningIcon,\n} from './Modal.styles'\nimport type {\n ConfirmModalProps,\n ModalBodyProps,\n ModalCloseableHeaderProps,\n ModalCloseContextApi,\n ModalContainerProps,\n ModalProps,\n} from './Modal.types'\nimport { useInitializeModalFocus } from './useInitializeModalFocus'\n\nfunction noop() {}\nconst defaultStartLevel = 2\nconst initialBodyLevel = 3\n\nconst ModalCloseContext = React.createContext<ModalCloseContextApi>({\n howToClose: [],\n onClose: undefined,\n})\n\nconst ModalPrimaryHeadingCheckContext = React.createContext({\n inModalHeader: false,\n})\n\ninterface ModalBodyScrollContextApi {\n isBodyScrolled: boolean\n setIsBodyScrolled: React.Dispatch<React.SetStateAction<boolean>>\n ariaLabelledBy?: string\n}\n\nconst ModalBodyScrollContext = React.createContext<ModalBodyScrollContextApi>({\n isBodyScrolled: false,\n setIsBodyScrolled: noop,\n ariaLabelledBy: undefined,\n})\n\nconst ModalClosableHeader = React.forwardRef<\n HTMLDivElement,\n ModalCloseableHeaderProps\n>(\n (\n { children, compact = false, onClose: externalOnClose, qa, ...props },\n ref\n ) => {\n const { ariaLabelledBy, isBodyScrolled } = React.useContext(\n ModalBodyScrollContext\n )\n const { howToClose, onClose } = React.useContext(ModalCloseContext)\n const I18n = useI18nContext()\n const modalClosableHeaderRef = React.useRef(null)\n\n const { closeWithConfirm } = useCloseWithConfirmContext()\n const registerChildRef = useModalChildRegistryDispatch()\n\n useEffect(() => {\n registerChildRef({ child: 'header', ref: modalClosableHeaderRef })\n }, [])\n\n function onClickButton(e: React.MouseEvent<HTMLButtonElement>) {\n if (onClose && howToClose?.includes('x')) {\n closeWithConfirm(onClose)(e, 'x')\n return\n }\n closeWithConfirm(externalOnClose!)(e)\n }\n\n return (\n <StyledModalHeader\n $compact={compact}\n $isBodyScrolled={isBodyScrolled}\n {...props}\n ref={mergeRefs(ref, modalClosableHeaderRef)}\n data-id=\"modal-header\"\n >\n <ModalPrimaryHeadingCheckContext.Provider\n value={{ inModalHeader: true }}\n >\n <StyledModalHeading\n $compact={compact}\n // This made all children the heading, like Title content\n id={ariaLabelledBy}\n >\n {children}\n </StyledModalHeading>\n {(onClose && howToClose?.includes('x')) || externalOnClose ? (\n <StyledModalCancel>\n <Button\n aria-label={I18n.t('core.modal.a11y.close')}\n data-internal=\"close-button\"\n data-qa={qa?.closeButton}\n icon={<Clear />}\n onClick={onClickButton}\n size={compact ? 'sm' : 'md'}\n variant=\"tertiary\"\n />\n </StyledModalCancel>\n ) : null}\n </ModalPrimaryHeadingCheckContext.Provider>\n </StyledModalHeader>\n )\n }\n)\n\nconst ModalClosableFooterButtons = React.forwardRef<\n HTMLDivElement,\n ModalCloseableHeaderProps\n>(({ children, ...props }, ref) => {\n const { howToClose, onClose } = React.useContext(ModalCloseContext)\n const I18n = useI18nContext()\n const { closeWithConfirm } = useCloseWithConfirmContext()\n const modalClosableFooterButtonsRef = React.useRef(null)\n\n const registerChildRef = useModalChildRegistryDispatch()\n\n useEffect(() => {\n registerChildRef({\n child: 'closeableButtons',\n ref: modalClosableFooterButtonsRef,\n })\n }, [])\n\n function onClickButton(e: React.MouseEvent<HTMLButtonElement>) {\n closeWithConfirm(onClose!)(e, 'footer-button')\n }\n\n return (\n <StyledModalButtons\n {...props}\n ref={mergeRefs(ref, modalClosableFooterButtonsRef)}\n >\n {howToClose?.includes('footer-button') && (\n <Button onClick={onClickButton} variant=\"tertiary\">\n {I18n.t('core.modal.cancel')}\n </Button>\n )}\n {children}\n </StyledModalButtons>\n )\n})\n\nconst ModalContainer = React.forwardRef<HTMLDivElement, ModalContainerProps>(\n ({ compact = false, placement, width, ...props }, ref) => {\n const { onClose } = React.useContext(ModalCloseContext)\n const modalContainerRef = React.useRef<HTMLDivElement>(null)\n useInitializeModalFocus({ modalContainerRef, hasOnClose: !!onClose })\n\n return (\n <StyledModalContainer\n {...props}\n shadowStrength={4}\n $compact={compact}\n $placement={placement}\n $width={width}\n ref={mergeRefs(ref, modalContainerRef)}\n />\n )\n }\n)\n\nconst ModalBody = React.forwardRef<HTMLDivElement, ModalBodyProps>(\n ({ children, compact = false, noSideSpacing = false, ...props }, ref) => {\n const { isOverflowingY, ref: overflowRef } = useOverflowObserver()\n const scrollRef = React.useRef(null)\n const modalBodyRef = React.useRef(null)\n const { ariaLabelledBy, setIsBodyScrolled } = React.useContext(\n ModalBodyScrollContext\n )\n const registerChildRef = useModalChildRegistryDispatch()\n\n useEffect(() => {\n registerChildRef({ child: 'body', ref: modalBodyRef })\n }, [])\n\n useLayoutEventListener({\n event: 'scroll',\n handler: (e: React.UIEvent<HTMLElement>) => {\n setIsBodyScrolled(e.currentTarget.scrollTop > 0)\n },\n scope: scrollRef,\n })\n\n return (\n <SectionProvider>\n <LevelContext.Provider value={initialBodyLevel}>\n <StyledModalBody\n {...props}\n $compact={compact}\n $isOverflowingY={isOverflowingY}\n $noSideSpacing={noSideSpacing}\n ref={mergeRefs(overflowRef, scrollRef, ref, modalBodyRef)}\n tabIndex={0}\n role=\"region\"\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </StyledModalBody>\n </LevelContext.Provider>\n </SectionProvider>\n )\n }\n)\n\nconst ModalFooterSummary = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ children, ...props }, ref) => {\n return (\n <StyledModalFooterSummary {...props} ref={ref}>\n {children}\n </StyledModalFooterSummary>\n )\n})\n\nconst ModalFooterNotation = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement> & TypographyProps\n>(({ children, ...props }, ref) => (\n <StyledModalFooterNotation\n aria-live=\"polite\"\n intent=\"small\"\n color=\"gray45\"\n italic\n {...props}\n ref={ref}\n >\n {children}\n </StyledModalFooterNotation>\n))\n\nconst Modal_ = React.forwardRef<HTMLDivElement, ModalProps>(\n (\n {\n ['aria-describedby']: ariaDescribedby,\n ['aria-details']: ariaDetails,\n ['aria-labelledby']: ariaLabelledby,\n ['aria-label']: ariaLabel,\n children,\n compact = false,\n howToClose,\n id,\n onClickOverlay = noop,\n onClose,\n open = false,\n placement = 'center',\n role,\n ...props\n },\n ref\n ) => {\n useScrollLock(open)\n const defaultLabelId = useId()\n const labelledbyId = ariaLabel ? id : ariaLabelledby ?? defaultLabelId\n const [visible, setVisible] = React.useState<boolean>(open)\n const [fadeType, setFadeType] = React.useState<string>('')\n const closeWithConfirmState = useCloseWithConfirmState()\n const { closeWithConfirm } = closeWithConfirmState\n\n React.useEffect(() => {\n if (open) {\n setVisible(true)\n const fadeTimer = setTimeout(() => {\n setFadeType(fadeInClassName)\n }, 0)\n return () => clearTimeout(fadeTimer)\n } else {\n setFadeType(fadeOutClassName)\n }\n }, [open])\n\n const onTransitionEnd = () => {\n if (fadeType === fadeOutClassName) {\n setVisible(false)\n }\n }\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (!onClose) return\n if (e.key === 'Escape') {\n e.preventDefault()\n e.stopPropagation()\n closeWithConfirm(onClose)(e, 'x')\n }\n }\n\n const { dialogProps: dialogProps_ } = useModalDialogLike({\n 'aria-describedby': ariaDescribedby,\n 'aria-details': ariaDetails,\n 'aria-labelledby': labelledbyId,\n 'aria-label': ariaLabel,\n id,\n isModal: false,\n isOpen: open,\n role,\n })\n\n const dialogProps = onClose && role === 'dialog' ? dialogProps_ : {}\n\n function onClickScrim(e: React.MouseEvent<HTMLDivElement>) {\n onClickOverlay(e)\n if (onClose && howToClose?.includes('scrim')) {\n closeWithConfirm(onClose)(e, 'scrim')\n }\n }\n\n return visible ? (\n <Portal>\n <ModalCloseContext.Provider value={{ onClose, howToClose }}>\n <LevelContext.Provider value={defaultStartLevel}>\n <ChildRegistryProvider>\n <OverridableFocusScope\n // TODO breaking - always\n autoFocus={!!onClose}\n contain={!!onClose}\n restoreFocus={!!onClose}\n >\n <StyledModal\n className={fadeType}\n ref={ref}\n onTransitionEnd={onTransitionEnd}\n onKeyDown={handleKeyDown}\n {...dialogProps}\n data-id=\"modal\"\n >\n <StyledModalScrim\n data-qa=\"core-modal-scrim\"\n onClick={onClickScrim}\n />\n\n <ModalContainer\n {...props}\n compact={compact}\n placement={placement}\n >\n <StyledModalContent $compact={compact}>\n <ModalBodyScrollObserver ariaLabelledBy={labelledbyId}>\n <CloseWithConfirmContext.Provider\n value={closeWithConfirmState}\n >\n {children}\n </CloseWithConfirmContext.Provider>\n </ModalBodyScrollObserver>\n </StyledModalContent>\n </ModalContainer>\n </StyledModal>\n </OverridableFocusScope>\n </ChildRegistryProvider>\n </LevelContext.Provider>\n </ModalCloseContext.Provider>\n </Portal>\n ) : null\n }\n)\n\ninterface ModalBodyScrollObserverProps {\n ariaLabelledBy?: string\n}\n\nconst ModalBodyScrollObserver = ({\n ariaLabelledBy,\n children,\n}: React.PropsWithChildren<ModalBodyScrollObserverProps>) => {\n const [isBodyScrolled, setIsBodyScrolled] = React.useState<boolean>(false)\n\n return (\n <ModalBodyScrollContext.Provider\n value={{ ariaLabelledBy, isBodyScrolled, setIsBodyScrolled }}\n >\n {children}\n </ModalBodyScrollContext.Provider>\n )\n}\n\nexport const ConfirmModal = React.forwardRef<HTMLDivElement, ConfirmModalProps>(\n ({ children, headline, onClose, ...props }, ref) => {\n return (\n <Modal {...props} ref={ref}>\n <ModalClosableHeader onClose={onClose}>\n <StyledModalWarningIcon size=\"lg\" />\n {headline}\n </ModalClosableHeader>\n {children}\n </Modal>\n )\n }\n)\n\n/**\n * Applies proper smenatics regardless of where in the Modal.\n * Adds the generate ID to node when necessary so the dialog and scroll region\n * aria-labelledby by can find the primary heading (in the Modal.Header)\n */\nconst ModalHeading = (\n props: React.PropsWithChildren<HeadingProps & { level?: number }>\n) => {\n const { ariaLabelledBy } = React.useContext(ModalBodyScrollContext)\n const { inModalHeader } = React.useContext(ModalPrimaryHeadingCheckContext)\n\n return <Heading id={inModalHeader ? ariaLabelledBy : undefined} {...props} />\n}\n\nfunction ModalState(props: RenderProps) {\n useDeprecation({ oldThing: 'Modal.State' })\n return <Visibility {...props} />\n}\n\nModal_.displayName = 'Modal'\n\nConfirmModal.displayName = 'ConfirmModal'\n\nModalBody.displayName = 'Modal.Body'\n\nModalFooterNotation.displayName = 'Modal.FooterNotation'\n\nModalFooterSummary.displayName = 'Modal.FooterSummary'\n\nconst Body = ModalBody\nconst Container = ModalContainer\nconst Content = StyledModalContent\nconst FooterSummary = ModalFooterSummary\nconst Footer = StyledModalFooter\nconst FooterButtons = ModalClosableFooterButtons\nconst FooterNotation = ModalFooterNotation\nconst Header = ModalClosableHeader\nconst Overlay = StyledModal\nconst Scrim = StyledModalScrim\nconst State = ModalState\n\n/**\n\n We use modals to present additional actions, information, or forms on pages\n where a user’s experience would benefit from remaining on the same page.\n They can include graphics, inputs, buttons, and other elements as needed to\n produce the workflow or action needed.\n\n Do not include modals on pages with complicated UI layouts.\n\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-modal--demo)\n\n @see [Design Guidelines](https://design.procore.com/modal)\n\n */\nexport const Modal = addSubcomponents(\n {\n Body,\n Container,\n Content,\n Footer,\n FooterButtons,\n FooterNotation,\n FooterSummary,\n Header,\n Heading: ModalHeading,\n Overlay,\n Scrim,\n State,\n Section,\n },\n Modal_\n)\n"],"mappings":";;;;;;;;;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AAW,GAAG,cAAc;AAEzCzF,SAAS,CAACyF,WAAW,GAAG,YAAY;AAEpCjE,mBAAmB,CAACiE,WAAW,GAAG,sBAAsB;AAExDpE,kBAAkB,CAACoE,WAAW,GAAG,qBAAqB;AAEtD,IAAMC,IAAI,GAAG1F,SAAS;AACtB,IAAM2F,SAAS,GAAGvG,cAAc;AAChC,IAAMwG,OAAO,GAAG3K,kBAAkB;AAClC,IAAM4K,aAAa,GAAGxE,kBAAkB;AACxC,IAAMyE,MAAM,GAAG5K,iBAAiB;AAChC,IAAM6K,aAAa,GAAGjH,0BAA0B;AAChD,IAAMkH,cAAc,GAAGxE,mBAAmB;AAC1C,IAAMyE,MAAM,GAAGzJ,mBAAmB;AAClC,IAAM0J,OAAO,GAAGtL,WAAW;AAC3B,IAAMuL,KAAK,GAAG5K,gBAAgB;AAC9B,IAAM6K,KAAK,GAAGb,UAAU;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMJ,KAAK,GAAGhL,gBAAgB,CACnC;EACEuL,IAAI,EAAJA,IAAI;EACJC,SAAS,EAATA,SAAS;EACTC,OAAO,EAAPA,OAAO;EACPE,MAAM,EAANA,MAAM;EACNC,aAAa,EAAbA,aAAa;EACbC,cAAc,EAAdA,cAAc;EACdH,aAAa,EAAbA,aAAa;EACbI,MAAM,EAANA,MAAM;EACNzM,OAAO,EAAE4L,YAAY;EACrBc,OAAO,EAAPA,OAAO;EACPC,KAAK,EAALA,KAAK;EACLC,KAAK,EAALA,KAAK;EACL1M,OAAO,EAAPA;AACF,CAAC,EACDoI,MACF,CAAC"}
1
+ {"version":3,"file":"Modal.js","names":["Clear","useId","React","useEffect","Button","useModalDialogLike","Portal","Heading","LevelContext","Section","SectionProvider","useDeprecation","useLayoutEventListener","OverridableFocusScope","useI18nContext","useOverflowObserver","useScrollLock","Visibility","addSubcomponents","CloseWithConfirmContext","useCloseWithConfirmContext","useCloseWithConfirmState","mergeRefs","ChildRegistryProvider","useModalChildRegistryDispatch","fadeInClassName","fadeOutClassName","StyledModal","StyledModalBody","StyledModalButtons","StyledModalCancel","StyledModalContainer","StyledModalContent","StyledModalFooter","StyledModalFooterNotation","StyledModalFooterSummary","StyledModalHeader","StyledModalHeading","StyledModalScrim","StyledModalWarningIcon","useInitializeModalFocus","noop","defaultStartLevel","initialBodyLevel","ModalCloseContext","createContext","howToClose","onClose","undefined","ModalPrimaryHeadingCheckContext","inModalHeader","ModalBodyScrollContext","isBodyScrolled","setIsBodyScrolled","ariaLabelledBy","ModalClosableHeader","forwardRef","_ref","ref","children","_ref$compact","compact","externalOnClose","qa","props","_objectWithoutProperties","_excluded","_React$useContext","useContext","_React$useContext2","I18n","modalClosableHeaderRef","useRef","_useCloseWithConfirmC","closeWithConfirm","registerChildRef","child","onClickButton","e","includes","createElement","_extends","$compact","$isBodyScrolled","Provider","value","t","closeButton","icon","onClick","size","variant","ModalClosableFooterButtons","_ref2","_excluded2","_React$useContext3","_useCloseWithConfirmC2","modalClosableFooterButtonsRef","ModalContainer","_ref3","_ref3$compact","placement","width","_excluded3","_React$useContext4","modalContainerRef","hasOnClose","shadowStrength","$placement","$width","ModalBody","_ref4","_ref4$compact","_ref4$noSideSpacing","noSideSpacing","_excluded4","_useOverflowObserver","isOverflowingY","overflowRef","scrollRef","modalBodyRef","_React$useContext5","event","handler","currentTarget","scrollTop","scope","$isOverflowingY","$noSideSpacing","tabIndex","role","ModalFooterSummary","_ref5","_excluded5","ModalFooterNotation","_ref6","_excluded6","intent","color","italic","Modal_","_ref7","ariaDescribedby","ariaDetails","ariaLabelledby","ariaLabel","ariaModal","_ref7$compact","id","_ref7$onClickOverlay","onClickOverlay","_ref7$open","open","_ref7$placement","_excluded7","defaultLabelId","labelledbyId","_React$useState","useState","_React$useState2","_slicedToArray","visible","setVisible","_React$useState3","_React$useState4","fadeType","setFadeType","closeWithConfirmState","fadeTimer","setTimeout","clearTimeout","onTransitionEnd","handleKeyDown","key","preventDefault","stopPropagation","_useModalDialogLike","isOpen","dialogProps_","dialogProps","onClickScrim","autoFocus","contain","restoreFocus","className","onKeyDown","ModalBodyScrollObserver","_ref8","_React$useState5","_React$useState6","ConfirmModal","_ref9","headline","_ref9$howToClose","_excluded8","isDialog","configuredModalProps","concat","_toConsumableArray","headerOnClose","Modal","ModalHeading","_React$useContext6","_React$useContext7","ModalState","oldThing","displayName","Body","Container","Content","FooterSummary","Footer","FooterButtons","FooterNotation","Header","Overlay","Scrim","State"],"sources":["../../src/Modal/Modal.tsx"],"sourcesContent":["import { Clear } from '@procore/core-icons/dist'\nimport { useId } from '@react-aria/utils'\nimport React, { useEffect } from 'react'\nimport { Button } from '../Button'\nimport { useModalDialogLike } from '../OverlayTrigger/a11yPresets'\nimport { Portal } from '../Portal'\nimport {\n Heading,\n LevelContext,\n Section,\n SectionProvider,\n} from '../Section/Section'\nimport type { HeadingProps } from '../Semantic/Semantic.types'\nimport type { TypographyProps } from '../Typography'\nimport { useDeprecation } from '../_hooks/Deprecation'\nimport { useLayoutEventListener } from '../_hooks/EventListener'\nimport { OverridableFocusScope } from '../_hooks/FocusScopeOverride'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { useOverflowObserver } from '../_hooks/OverflowObserver'\nimport { useScrollLock } from '../_hooks/ScrollLock'\nimport type { RenderProps } from '../_hooks/Visibility'\nimport { Visibility } from '../_hooks/Visibility'\nimport { addSubcomponents } from '../_utils/addSubcomponents'\nimport {\n CloseWithConfirmContext,\n useCloseWithConfirmContext,\n useCloseWithConfirmState,\n} from '../_utils/closeWithConfirm'\nimport { mergeRefs } from '../_utils/mergeRefs'\nimport {\n ChildRegistryProvider,\n useModalChildRegistryDispatch,\n} from './ChildRegistry.context'\nimport {\n fadeInClassName,\n fadeOutClassName,\n StyledModal,\n StyledModalBody,\n StyledModalButtons,\n StyledModalCancel,\n StyledModalContainer,\n StyledModalContent,\n StyledModalFooter,\n StyledModalFooterNotation,\n StyledModalFooterSummary,\n StyledModalHeader,\n StyledModalHeading,\n StyledModalScrim,\n StyledModalWarningIcon,\n} from './Modal.styles'\nimport type {\n ConfirmModalProps,\n ModalBodyProps,\n ModalCloseableHeaderProps,\n ModalCloseContextApi,\n ModalContainerProps,\n ModalOnClose,\n ModalOptionalCloseStartegy,\n ModalProps,\n} from './Modal.types'\nimport { useInitializeModalFocus } from './useInitializeModalFocus'\n\nfunction noop() {}\nconst defaultStartLevel = 2\nconst initialBodyLevel = 3\n\nconst ModalCloseContext = React.createContext<ModalCloseContextApi>({\n howToClose: [],\n onClose: undefined,\n})\n\nconst ModalPrimaryHeadingCheckContext = React.createContext({\n inModalHeader: false,\n})\n\ninterface ModalBodyScrollContextApi {\n isBodyScrolled: boolean\n setIsBodyScrolled: React.Dispatch<React.SetStateAction<boolean>>\n ariaLabelledBy?: string\n}\n\nconst ModalBodyScrollContext = React.createContext<ModalBodyScrollContextApi>({\n isBodyScrolled: false,\n setIsBodyScrolled: noop,\n ariaLabelledBy: undefined,\n})\n\nconst ModalClosableHeader = React.forwardRef<\n HTMLDivElement,\n ModalCloseableHeaderProps\n>(\n (\n { children, compact = false, onClose: externalOnClose, qa, ...props },\n ref\n ) => {\n const { isBodyScrolled } = React.useContext(ModalBodyScrollContext)\n const { howToClose, onClose } = React.useContext(ModalCloseContext)\n const I18n = useI18nContext()\n const modalClosableHeaderRef = React.useRef(null)\n\n const { closeWithConfirm } = useCloseWithConfirmContext()\n const registerChildRef = useModalChildRegistryDispatch()\n\n useEffect(() => {\n registerChildRef({ child: 'header', ref: modalClosableHeaderRef })\n }, [])\n\n function onClickButton(e: React.MouseEvent<HTMLButtonElement>) {\n if (onClose && howToClose?.includes('x')) {\n closeWithConfirm(onClose)(e, 'x')\n return\n }\n closeWithConfirm(externalOnClose!)(e)\n }\n\n return (\n <StyledModalHeader\n $compact={compact}\n $isBodyScrolled={isBodyScrolled}\n {...props}\n ref={mergeRefs(ref, modalClosableHeaderRef)}\n data-id=\"modal-header\"\n >\n <ModalPrimaryHeadingCheckContext.Provider\n value={{ inModalHeader: true }}\n >\n <StyledModalHeading $compact={compact}>{children}</StyledModalHeading>\n {(onClose && howToClose?.includes('x')) || externalOnClose ? (\n <StyledModalCancel>\n <Button\n aria-label={I18n.t('core.modal.a11y.close')}\n data-internal=\"close-button\"\n data-qa={qa?.closeButton}\n icon={<Clear />}\n onClick={onClickButton}\n size={compact ? 'sm' : 'md'}\n variant=\"tertiary\"\n />\n </StyledModalCancel>\n ) : null}\n </ModalPrimaryHeadingCheckContext.Provider>\n </StyledModalHeader>\n )\n }\n)\n\nconst ModalClosableFooterButtons = React.forwardRef<\n HTMLDivElement,\n ModalCloseableHeaderProps\n>(({ children, ...props }, ref) => {\n const { howToClose, onClose } = React.useContext(ModalCloseContext)\n const I18n = useI18nContext()\n const { closeWithConfirm } = useCloseWithConfirmContext()\n const modalClosableFooterButtonsRef = React.useRef(null)\n\n const registerChildRef = useModalChildRegistryDispatch()\n\n useEffect(() => {\n registerChildRef({\n child: 'closeableButtons',\n ref: modalClosableFooterButtonsRef,\n })\n }, [])\n\n function onClickButton(e: React.MouseEvent<HTMLButtonElement>) {\n closeWithConfirm(onClose!)(e, 'footer-button')\n }\n\n return (\n <StyledModalButtons\n {...props}\n ref={mergeRefs(ref, modalClosableFooterButtonsRef)}\n >\n {howToClose?.includes('footer-button') && (\n <Button onClick={onClickButton} variant=\"tertiary\">\n {I18n.t('core.modal.cancel')}\n </Button>\n )}\n {children}\n </StyledModalButtons>\n )\n})\n\nconst ModalContainer = React.forwardRef<HTMLDivElement, ModalContainerProps>(\n ({ compact = false, placement, width, ...props }, ref) => {\n const { onClose } = React.useContext(ModalCloseContext)\n const modalContainerRef = React.useRef<HTMLDivElement>(null)\n useInitializeModalFocus({ modalContainerRef, hasOnClose: !!onClose })\n\n return (\n <StyledModalContainer\n {...props}\n shadowStrength={4}\n $compact={compact}\n $placement={placement}\n $width={width}\n ref={mergeRefs(ref, modalContainerRef)}\n />\n )\n }\n)\n\nconst ModalBody = React.forwardRef<HTMLDivElement, ModalBodyProps>(\n ({ children, compact = false, noSideSpacing = false, ...props }, ref) => {\n const { isOverflowingY, ref: overflowRef } = useOverflowObserver()\n const scrollRef = React.useRef(null)\n const modalBodyRef = React.useRef(null)\n const { ariaLabelledBy, setIsBodyScrolled } = React.useContext(\n ModalBodyScrollContext\n )\n const registerChildRef = useModalChildRegistryDispatch()\n\n useEffect(() => {\n registerChildRef({ child: 'body', ref: modalBodyRef })\n }, [])\n\n useLayoutEventListener({\n event: 'scroll',\n handler: (e: React.UIEvent<HTMLElement>) => {\n setIsBodyScrolled(e.currentTarget.scrollTop > 0)\n },\n scope: scrollRef,\n })\n\n return (\n <SectionProvider>\n <LevelContext.Provider value={initialBodyLevel}>\n <StyledModalBody\n {...props}\n $compact={compact}\n $isOverflowingY={isOverflowingY}\n $noSideSpacing={noSideSpacing}\n ref={mergeRefs(overflowRef, scrollRef, ref, modalBodyRef)}\n tabIndex={0}\n role=\"region\"\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </StyledModalBody>\n </LevelContext.Provider>\n </SectionProvider>\n )\n }\n)\n\nconst ModalFooterSummary = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ children, ...props }, ref) => {\n return (\n <StyledModalFooterSummary {...props} ref={ref}>\n {children}\n </StyledModalFooterSummary>\n )\n})\n\nconst ModalFooterNotation = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement> & TypographyProps\n>(({ children, ...props }, ref) => (\n <StyledModalFooterNotation\n aria-live=\"polite\"\n intent=\"small\"\n color=\"gray45\"\n italic\n {...props}\n ref={ref}\n >\n {children}\n </StyledModalFooterNotation>\n))\n\nconst Modal_ = React.forwardRef<HTMLDivElement, ModalProps>(\n (\n {\n ['aria-describedby']: ariaDescribedby,\n ['aria-details']: ariaDetails,\n ['aria-labelledby']: ariaLabelledby,\n ['aria-label']: ariaLabel,\n ['aria-modal']: ariaModal,\n children,\n compact = false,\n howToClose,\n id,\n onClickOverlay = noop,\n onClose,\n open = false,\n placement = 'center',\n role,\n ...props\n },\n ref\n ) => {\n useScrollLock(open)\n const defaultLabelId = useId()\n const labelledbyId = ariaLabel ? id : ariaLabelledby ?? defaultLabelId\n const [visible, setVisible] = React.useState<boolean>(open)\n const [fadeType, setFadeType] = React.useState<string>('')\n const closeWithConfirmState = useCloseWithConfirmState()\n const { closeWithConfirm } = closeWithConfirmState\n\n React.useEffect(() => {\n if (open) {\n setVisible(true)\n const fadeTimer = setTimeout(() => {\n setFadeType(fadeInClassName)\n }, 0)\n return () => clearTimeout(fadeTimer)\n } else {\n setFadeType(fadeOutClassName)\n }\n }, [open])\n\n const onTransitionEnd = () => {\n if (fadeType === fadeOutClassName) {\n setVisible(false)\n }\n }\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (!onClose) return\n if (e.key === 'Escape') {\n e.preventDefault()\n e.stopPropagation()\n closeWithConfirm(onClose)(e, 'x')\n }\n }\n\n const { dialogProps: dialogProps_ } = useModalDialogLike({\n 'aria-describedby': ariaDescribedby,\n 'aria-details': ariaDetails,\n 'aria-labelledby': labelledbyId,\n 'aria-label': ariaLabel,\n 'aria-modal': ariaModal,\n id,\n isOpen: open,\n role,\n })\n\n const dialogProps =\n onClose && (role === 'dialog' || role === 'alertdialog')\n ? dialogProps_\n : {}\n\n function onClickScrim(e: React.MouseEvent<HTMLDivElement>) {\n onClickOverlay(e)\n if (onClose && howToClose?.includes('scrim')) {\n closeWithConfirm(onClose)(e, 'scrim')\n }\n }\n\n return visible ? (\n <Portal>\n <ModalCloseContext.Provider value={{ onClose, howToClose }}>\n <LevelContext.Provider value={defaultStartLevel}>\n <ChildRegistryProvider>\n <OverridableFocusScope\n // TODO breaking - always\n autoFocus={!!onClose}\n contain={!!onClose}\n restoreFocus={!!onClose}\n >\n <StyledModal\n className={fadeType}\n ref={ref}\n onTransitionEnd={onTransitionEnd}\n onKeyDown={handleKeyDown}\n {...dialogProps}\n data-id=\"modal\"\n >\n <StyledModalScrim\n data-qa=\"core-modal-scrim\"\n onClick={onClickScrim}\n />\n\n <ModalContainer\n {...props}\n compact={compact}\n placement={placement}\n >\n <StyledModalContent $compact={compact}>\n <ModalBodyScrollObserver ariaLabelledBy={labelledbyId}>\n <CloseWithConfirmContext.Provider\n value={closeWithConfirmState}\n >\n {children}\n </CloseWithConfirmContext.Provider>\n </ModalBodyScrollObserver>\n </StyledModalContent>\n </ModalContainer>\n </StyledModal>\n </OverridableFocusScope>\n </ChildRegistryProvider>\n </LevelContext.Provider>\n </ModalCloseContext.Provider>\n </Portal>\n ) : null\n }\n)\n\ninterface ModalBodyScrollObserverProps {\n ariaLabelledBy?: string\n}\n\nconst ModalBodyScrollObserver = ({\n ariaLabelledBy,\n children,\n}: React.PropsWithChildren<ModalBodyScrollObserverProps>) => {\n const [isBodyScrolled, setIsBodyScrolled] = React.useState<boolean>(false)\n\n return (\n <ModalBodyScrollContext.Provider\n value={{ ariaLabelledBy, isBodyScrolled, setIsBodyScrolled }}\n >\n {children}\n </ModalBodyScrollContext.Provider>\n )\n}\n\nexport const ConfirmModal = React.forwardRef<HTMLDivElement, ConfirmModalProps>(\n ({ children, headline, howToClose = [], onClose, ...props }, ref) => {\n const isDialog = props.role === 'dialog' || props.role === 'alertdialog'\n\n // When role=\"dialog\", pass onClose to Modal for focus management and Escape key.\n // The header X button is handled via ModalCloseContext when howToClose includes 'x'.\n const configuredModalProps =\n isDialog && onClose\n ? {\n onClose: onClose as ModalOnClose,\n howToClose: ['x', ...howToClose] as ModalOptionalCloseStartegy[],\n }\n : undefined\n const headerOnClose =\n !isDialog && onClose\n ? (onClose as (event: React.MouseEvent<HTMLButtonElement>) => void)\n : undefined\n\n return (\n <Modal {...props} {...configuredModalProps} ref={ref}>\n <ModalClosableHeader onClose={headerOnClose}>\n <StyledModalWarningIcon size=\"lg\" />\n <ModalHeading>{headline}</ModalHeading>\n </ModalClosableHeader>\n {children}\n </Modal>\n )\n }\n)\n\n/**\n * Applies proper semantics regardless of where in the Modal.\n * @a11y The primary heading that is auto linked to the dialog and scroll region with\n * aria-labelledby, when inside the Modal.Header.\n */\nconst ModalHeading = (\n props: React.PropsWithChildren<HeadingProps & { level?: number }>\n) => {\n const { ariaLabelledBy } = React.useContext(ModalBodyScrollContext)\n const { inModalHeader } = React.useContext(ModalPrimaryHeadingCheckContext)\n\n return <Heading id={inModalHeader ? ariaLabelledBy : undefined} {...props} />\n}\n\nfunction ModalState(props: RenderProps) {\n useDeprecation({ oldThing: 'Modal.State' })\n return <Visibility {...props} />\n}\n\nModal_.displayName = 'Modal'\n\nConfirmModal.displayName = 'ConfirmModal'\n\nModalBody.displayName = 'Modal.Body'\n\nModalFooterNotation.displayName = 'Modal.FooterNotation'\n\nModalFooterSummary.displayName = 'Modal.FooterSummary'\n\nconst Body = ModalBody\nconst Container = ModalContainer\nconst Content = StyledModalContent\nconst FooterSummary = ModalFooterSummary\nconst Footer = StyledModalFooter\nconst FooterButtons = ModalClosableFooterButtons\nconst FooterNotation = ModalFooterNotation\nconst Header = ModalClosableHeader\nconst Overlay = StyledModal\nconst Scrim = StyledModalScrim\nconst State = ModalState\n\n/**\n\n We use modals to present additional actions, information, or forms on pages\n where a user’s experience would benefit from remaining on the same page.\n They can include graphics, inputs, buttons, and other elements as needed to\n produce the workflow or action needed.\n\n Do not include modals on pages with complicated UI layouts.\n\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-modal--demo)\n\n @see [Design Guidelines](https://design.procore.com/modal)\n\n */\nexport const Modal = addSubcomponents(\n {\n Body,\n Container,\n Content,\n Footer,\n FooterButtons,\n FooterNotation,\n FooterSummary,\n Header,\n /**\n * @a11y The primary heading inside the `Modal.Header` that is auto linked\n * to the dialog and scroll region with aria-labelledby.\n */\n Heading: ModalHeading,\n Overlay,\n Scrim,\n State,\n Section,\n },\n Modal_\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,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AATA,SAAS;EACTC,OAAO,EAAPA,OAAO;EACPE,MAAM,EAANA,MAAM;EACNC,aAAa,EAAbA,aAAa;EACbC,cAAc,EAAdA,cAAc;EACdH,aAAa,EAAbA,aAAa;EACbI,MAAM,EAANA,MAAM;EACN;AACJ;AACA;AACA;EACI/M,OAAO,EAAEkM,YAAY;EACrBc,OAAO,EAAPA,OAAO;EACPC,KAAK,EAALA,KAAK;EACLC,KAAK,EAALA,KAAK;EACLhN,OAAO,EAAPA;AACF,CAAC,EACDmI,MACF,CAAC"}
@@ -32,15 +32,15 @@ var screenWidthPixelBreakpoints = {
32
32
  };
33
33
  export var StyledModal = /*#__PURE__*/styled.div.withConfig({
34
34
  displayName: "StyledModal",
35
- componentId: "core-12_41_0__sc-1ijdug2-0"
35
+ componentId: "core-12_43_0__sc-1ijdug2-0"
36
36
  })(["display:flex;height:100vh;position:absolute;opacity:0;transition:0.3s opacity ease;width:100vw;z-index:0;pointer-events:none;&.", "{opacity:1;pointer-events:auto;}&.", "{opacity:0;pointer-events:none;}"], fadeInClassName, fadeOutClassName);
37
37
  export var StyledModalButtons = /*#__PURE__*/styled.div.withConfig({
38
38
  displayName: "StyledModalButtons",
39
- componentId: "core-12_41_0__sc-1ijdug2-1"
39
+ componentId: "core-12_43_0__sc-1ijdug2-1"
40
40
  })(["display:flex;flex:0 0 auto;margin-left:", "px;> * + *{margin-left:", "px;}"], spacing.lg, spacing.sm);
41
41
  export var StyledModalContainer = /*#__PURE__*/styled(Card).withConfig({
42
42
  displayName: "StyledModalContainer",
43
- componentId: "core-12_41_0__sc-1ijdug2-2"
43
+ componentId: "core-12_43_0__sc-1ijdug2-2"
44
44
  })(["display:flex;flex-direction:row;position:absolute;z-index:2;", " ", " ", ""], function (_ref) {
45
45
  var $compact = _ref.$compact;
46
46
  if (!$compact) {
@@ -64,11 +64,11 @@ export var StyledModalContainer = /*#__PURE__*/styled(Card).withConfig({
64
64
  });
65
65
  export var StyledModalFooter = /*#__PURE__*/styled.div.withConfig({
66
66
  displayName: "StyledModalFooter",
67
- componentId: "core-12_41_0__sc-1ijdug2-3"
67
+ componentId: "core-12_43_0__sc-1ijdug2-3"
68
68
  })(["align-items:center;display:flex;flex:0 0 auto;flex-wrap:wrap;justify-content:flex-end;padding:", "px ", "px ", "px;"], spacing.xl, spacing.xxl, spacing.xxl);
69
69
  export var StyledModalBody = /*#__PURE__*/styled.div.withConfig({
70
70
  displayName: "StyledModalBody",
71
- componentId: "core-12_41_0__sc-1ijdug2-4"
71
+ componentId: "core-12_43_0__sc-1ijdug2-4"
72
72
  })(["", " &:focus-visible{", "}box-sizing:border-box;color:", ";display:flex;flex-direction:column;overflow:auto;", " ", " > ", "{padding-left:0;padding-right:0;&:first-child > ", "{padding-top:0;}}", ""], getTypographyIntent('body'), getFocusInset(), colors.gray15, function (_ref4) {
73
73
  var $noSideSpacing = _ref4.$noSideSpacing;
74
74
  return css(["padding:", "px ", "px;"], spacing.xl, $noSideSpacing ? 0 : spacing.xxl);
@@ -85,7 +85,7 @@ export var StyledModalBody = /*#__PURE__*/styled.div.withConfig({
85
85
  });
86
86
  export var StyledModalContent = /*#__PURE__*/styled.div.withConfig({
87
87
  displayName: "StyledModalContent",
88
- componentId: "core-12_41_0__sc-1ijdug2-5"
88
+ componentId: "core-12_43_0__sc-1ijdug2-5"
89
89
  })(["display:flex;flex-direction:column;max-height:90vh;overflow:hidden;width:100%;", ""], function (_ref7) {
90
90
  var _ref7$$compact = _ref7.$compact,
91
91
  $compact = _ref7$$compact === void 0 ? false : _ref7$$compact;
@@ -96,11 +96,11 @@ export var StyledModalContent = /*#__PURE__*/styled.div.withConfig({
96
96
  });
97
97
  export var StyledModalFooterNotation = /*#__PURE__*/styled(Typography).withConfig({
98
98
  displayName: "StyledModalFooterNotation",
99
- componentId: "core-12_41_0__sc-1ijdug2-6"
99
+ componentId: "core-12_43_0__sc-1ijdug2-6"
100
100
  })(["flex-grow:1;"]);
101
101
  export var StyledModalHeader = /*#__PURE__*/styled.div.withConfig({
102
102
  displayName: "StyledModalHeader",
103
- componentId: "core-12_41_0__sc-1ijdug2-7"
103
+ componentId: "core-12_43_0__sc-1ijdug2-7"
104
104
  })(["align-items:flex-start;color:", ";display:flex;flex:0 0 auto;position:relative;", " ", ""], colors.gray10, function (_ref8) {
105
105
  var $compact = _ref8.$compact,
106
106
  $isBodyScrolled = _ref8.$isBodyScrolled;
@@ -118,7 +118,7 @@ export var StyledModalHeader = /*#__PURE__*/styled.div.withConfig({
118
118
  });
119
119
  export var StyledModalHeading = /*#__PURE__*/styled.div.withConfig({
120
120
  displayName: "StyledModalHeading",
121
- componentId: "core-12_41_0__sc-1ijdug2-8"
121
+ componentId: "core-12_43_0__sc-1ijdug2-8"
122
122
  })(["", " align-items:center;display:flex;flex:1 1 auto;min-height:36px;padding-right:", "px;", ""], function (_ref0) {
123
123
  var $compact = _ref0.$compact;
124
124
  return getTypographyIntent($compact ? 'h3' : 'h2');
@@ -134,18 +134,18 @@ export var StyledModalHeading = /*#__PURE__*/styled.div.withConfig({
134
134
  });
135
135
  export var StyledModalCancel = /*#__PURE__*/styled.div.withConfig({
136
136
  displayName: "StyledModalCancel",
137
- componentId: "core-12_41_0__sc-1ijdug2-9"
137
+ componentId: "core-12_43_0__sc-1ijdug2-9"
138
138
  })(["flex:0 0 auto;"]);
139
139
  export var StyledModalScrim = /*#__PURE__*/styled.div.withConfig({
140
140
  displayName: "StyledModalScrim",
141
- componentId: "core-12_41_0__sc-1ijdug2-10"
141
+ componentId: "core-12_43_0__sc-1ijdug2-10"
142
142
  })(["background:hsla(200,8%,10%,0.6);height:100vh;left:0;position:absolute;top:0;width:100vw;z-index:1;"]);
143
143
  export var StyledModalWarningIcon = /*#__PURE__*/styled(Warning).withConfig({
144
144
  displayName: "StyledModalWarningIcon",
145
- componentId: "core-12_41_0__sc-1ijdug2-11"
145
+ componentId: "core-12_43_0__sc-1ijdug2-11"
146
146
  })(["color:", ";margin-right:", "px;"], colors.yellow40, spacing.sm);
147
147
  export var StyledModalFooterSummary = /*#__PURE__*/styled.div.withConfig({
148
148
  displayName: "StyledModalFooterSummary",
149
- componentId: "core-12_41_0__sc-1ijdug2-12"
149
+ componentId: "core-12_43_0__sc-1ijdug2-12"
150
150
  })(["", " border-top:1px solid ", ";border-bottom:1px solid ", ";padding:", "px ", "px;color:", ";font-style:italic;background-color:", ";margin:-", "px -", "px ", "px -", "px;flex:1 1 100%;"], getTypographyIntent('small'), colors.gray85, colors.gray85, spacing.md, spacing.xxl, colors.gray15, colors.gray98, spacing.xl, spacing.xxl, spacing.xl, spacing.xxl);
151
151
  //# sourceMappingURL=Modal.styles.js.map
@@ -10,7 +10,7 @@ export declare type ModalWidth = 'sm' | 'md' | 'lg' | 'xl';
10
10
  */
11
11
  export declare type ModalOptionalCloseStartegy = 'x' | 'footer-button' | 'scrim';
12
12
  declare type ModalCloseStragety = 'esc' | ModalOptionalCloseStartegy;
13
- declare type ModalOnClose = (event: React.MouseEvent<HTMLDivElement> | React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLElement>, how: ModalCloseStragety) => void;
13
+ export declare type ModalOnClose = (event: React.MouseEvent<HTMLDivElement> | React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLElement>, how: ModalCloseStragety) => void;
14
14
  export interface ModalCloseContextApi {
15
15
  /**
16
16
  * Escape key will always close a dialog. This adds additional UI or UX to close.
@@ -44,6 +44,12 @@ export interface ModalProps extends Props {
44
44
  * @since 11.12.0
45
45
  */
46
46
  'aria-label'?: string;
47
+ /**
48
+ * @a11y Should be used for a single true modal. Cannot open nested modals.
49
+ * @experimental Core-React does not support multiple or nested `aria-modal`s for Tearsheets, Modals, or ConfirmModals.
50
+ * @since 12.42.0
51
+ */
52
+ 'aria-modal'?: boolean;
47
53
  /**
48
54
  * @deprecated @experimental Changes the UI of modal to work on mobile breakpoints, to be used on Helix Header ONLY
49
55
  * @defaultValue false
@@ -65,7 +71,8 @@ export interface ModalProps extends Props {
65
71
  */
66
72
  id?: string;
67
73
  /**
68
- * Callback for clicking the overlay
74
+ * @deprecated Use `howToClose={['scrim']}` with `onClose` instead.
75
+ * @deprecatedSince 12.41.0
69
76
  * @since 10.19.0
70
77
  */
71
78
  onClickOverlay?: (event: React.MouseEvent<HTMLDivElement>) => void;
@@ -85,7 +92,7 @@ export interface ModalProps extends Props {
85
92
  /**
86
93
  * Enable dialog props. REQUIRES `onClose` to enable Escape key and focus management. MUST be labelled, prefer `aria-labelledby` over `aria-label`.
87
94
  */
88
- role?: 'dialog';
95
+ role?: 'dialog' | 'alertdialog';
89
96
  /**
90
97
  * Vertical placement of the modal.
91
98
  * Positioning modal at the top ensures that variable height modal won't shift position during content loading,
@@ -124,10 +131,24 @@ export interface ConfirmModalProps extends Omit<ModalProps, 'onClose'> {
124
131
  */
125
132
  headline?: string;
126
133
  /**
127
- * The dismiss onClick callback
134
+ * Callback when the ConfirmModal is dismissed.
135
+ *
136
+ * @a11y **Accessible pattern (recommended):** Use with `role="dialog"` and `howToClose={['x']}`.
137
+ * This enables focus management, Escape key support, and proper dialog semantics.
138
+ * The callback signature is `(event, how) => void`.
139
+ *
140
+ * **Legacy pattern:** `(event: MouseEvent<HTMLButtonElement>) => void` — only handles X button click,
141
+ * no focus management or Escape key support.
142
+ *
128
143
  * @since 10.19.0
129
144
  */
130
- onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
145
+ onClose?: ModalOnClose | ((event: React.MouseEvent<HTMLButtonElement>) => void);
146
+ /**
147
+ *
148
+ * @a11y Recommended to use. When using alertdialog should be a `aria-modal` because of their urgent nature. **Cannot open nested modals.**
149
+ * @since 12.42.0
150
+ */
151
+ 'aria-modal'?: boolean;
131
152
  }
132
153
  /**
133
154
  * NOTE: Using howToClose 'x' requires the `Modal.Header` component.
@@ -135,6 +156,8 @@ export interface ConfirmModalProps extends Omit<ModalProps, 'onClose'> {
135
156
  */
136
157
  export interface ModalCloseableHeaderProps extends Props {
137
158
  /**
159
+ * @deprecated Use `Modal onClose` with `howToClose={['x']}` instead.
160
+ * @deprecatedSince 12.41.0
138
161
  * @since 10.19.0
139
162
  */
140
163
  onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.types.js","names":[],"sources":["../../src/Modal/Modal.types.ts"],"sourcesContent":["import type React from 'react'\nimport type { Props } from '../_utils/types'\n\nexport type ModalPlacement = 'top' | 'center'\nexport type ModalWidth = 'sm' | 'md' | 'lg' | 'xl'\n\n/**\n * Additional UI/UX to dismiss. (In addition to the Esc key)\n * - `x` Close Button in the Modal Header\n * - `scrim` Overlay dimmed scrim\n * - `footer-button` Cancel Button in the Modal Footer Actions\n */\nexport type ModalOptionalCloseStartegy = 'x' | 'footer-button' | 'scrim'\ntype ModalCloseStragety = 'esc' | ModalOptionalCloseStartegy\n\ntype ModalOnClose = (\n event: // clicked scrim\n | React.MouseEvent<HTMLDivElement>\n // clicked x button\n | React.MouseEvent<HTMLButtonElement>\n // pressed escape key\n | React.KeyboardEvent<HTMLElement>,\n how: ModalCloseStragety\n) => void\n\nexport interface ModalCloseContextApi {\n /**\n * Escape key will always close a dialog. This adds additional UI or UX to close.\n */\n howToClose: ModalOptionalCloseStartegy[] | undefined\n onClose: ModalOnClose | undefined\n}\n\nexport interface ModalCloseableHeaderProps\n extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * @deprecated @experimental Changes the UI of modal to work on mobile breakpoints, to be used on Helix Header ONLY\n * @defaultValue false\n * @since 12.8.0\n */\n compact?: boolean\n qa?: { closeButton?: string }\n}\n\nexport interface ModalProps extends Props {\n 'aria-describedby'?: string\n 'aria-details'?: string\n /**\n * @a11y Automatially created when using `Modal.Heading`. The `role='dialog'` MUST be labelled. Prefer `aria-labelledby` over `aria-label`.\n * @since 11.12.0\n */\n 'aria-labelledby'?: string\n /**\n * @a11y `role='dialog'` MUST be labelled. Prefer `aria-labelledby` over `aria-label`.\n * If using an `aria-label` instead of a node, be sure give the modal an `id` so\n * other regions can reference it.\n * @since 11.12.0\n */\n 'aria-label'?: string\n /**\n * @deprecated @experimental Changes the UI of modal to work on mobile breakpoints, to be used on Helix Header ONLY\n * @defaultValue false\n * @since 12.8.0\n */\n compact?: boolean\n /**\n * This adds additional UI or UX to close. Escape key will always close a dialog, see `onClose`.\n *\n * NOTE 'footer-button': Footer Cancel button still requires at least a rendered self closing `Modal.FooterButtons`.\n *\n * NOTE 'x': The X button still requires a rendered `Modal.Header` component.\n * @defaultValue []\n * @since 11.12.0\n */\n howToClose?: ModalOptionalCloseStartegy[]\n /**\n * Aligns with `role` and `ref` location.\n */\n id?: string\n /**\n * Callback for clicking the overlay\n * @since 10.19.0\n */\n onClickOverlay?: (event: React.MouseEvent<HTMLDivElement>) => void\n /**\n * When a user closes the Modal by some approved `howToClose` method or the Escape key. This also opts-in to dialog focus management.\n * @a11y Future default! Moves focus into and cycles focus in the Modal, and returning focus\n * to the trigger when closed. Also enables the Escape key to close the Modal.\n * @since 11.6.0\n */\n onClose?: ModalOnClose\n /**\n * Modal open state\n * @defaultValue false\n * @since 10.19.0\n */\n open?: boolean\n /**\n * Enable dialog props. REQUIRES `onClose` to enable Escape key and focus management. MUST be labelled, prefer `aria-labelledby` over `aria-label`.\n */\n role?: 'dialog'\n /**\n * Vertical placement of the modal.\n * Positioning modal at the top ensures that variable height modal won't shift position during content loading,\n * providing a more stable user experience.\n * @defaultValue center\n * @since 10.19.0\n */\n placement?: ModalPlacement\n /**\n * Sets a width on the container and uses next centering.\n * Future will default to `md`\n * @since 10.19.0\n */\n width?: ModalWidth\n}\n\nexport interface ModalContainerProps extends Props {\n /**\n * @deprecated @experimental Changes the UI of modal to work on mobile breakpoints, to be used on Helix Header ONLY\n * @defaultValue false\n * @since 12.8.0\n */\n compact?: boolean\n /**\n * @since 10.19.0\n */\n placement: ModalPlacement\n /**\n * @since 10.19.0\n */\n width?: ModalWidth\n}\n\nexport interface ConfirmModalProps extends Omit<ModalProps, 'onClose'> {\n /**\n * Headline message\n * @since 10.19.0\n */\n headline?: string\n\n /**\n * The dismiss onClick callback\n * @since 10.19.0\n */\n onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void\n}\n\n/**\n * NOTE: Using howToClose 'x' requires the `Modal.Header` component.\n * @a11y This component is a not semantic heading! For that, see `Modal.Heading`.\n */\nexport interface ModalCloseableHeaderProps extends Props {\n /**\n * @since 10.19.0\n */\n onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void\n /**\n * @since 10.19.0\n */\n qa?: { closeButton?: string }\n}\n\nexport interface ModalBodyProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * @deprecated @experimental Changes the UI of modal to work on mobile breakpoints, to be used on Helix Header ONLY\n * @defaultValue false\n * @since 12.8.0\n */\n compact?: boolean\n /**\n * Removes left, right paddings from the modal body when true\n * @defaultValue false\n * @since 10.19.0\n */\n noSideSpacing?: boolean\n}\n"],"mappings":""}
1
+ {"version":3,"file":"Modal.types.js","names":[],"sources":["../../src/Modal/Modal.types.ts"],"sourcesContent":["import type React from 'react'\nimport type { Props } from '../_utils/types'\n\nexport type ModalPlacement = 'top' | 'center'\nexport type ModalWidth = 'sm' | 'md' | 'lg' | 'xl'\n\n/**\n * Additional UI/UX to dismiss. (In addition to the Esc key)\n * - `x` Close Button in the Modal Header\n * - `scrim` Overlay dimmed scrim\n * - `footer-button` Cancel Button in the Modal Footer Actions\n */\nexport type ModalOptionalCloseStartegy = 'x' | 'footer-button' | 'scrim'\ntype ModalCloseStragety = 'esc' | ModalOptionalCloseStartegy\n\nexport type ModalOnClose = (\n event: // clicked scrim\n | React.MouseEvent<HTMLDivElement>\n // clicked x button\n | React.MouseEvent<HTMLButtonElement>\n // pressed escape key\n | React.KeyboardEvent<HTMLElement>,\n how: ModalCloseStragety\n) => void\n\nexport interface ModalCloseContextApi {\n /**\n * Escape key will always close a dialog. This adds additional UI or UX to close.\n */\n howToClose: ModalOptionalCloseStartegy[] | undefined\n onClose: ModalOnClose | undefined\n}\n\nexport interface ModalCloseableHeaderProps\n extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * @deprecated @experimental Changes the UI of modal to work on mobile breakpoints, to be used on Helix Header ONLY\n * @defaultValue false\n * @since 12.8.0\n */\n compact?: boolean\n qa?: { closeButton?: string }\n}\n\nexport interface ModalProps extends Props {\n 'aria-describedby'?: string\n 'aria-details'?: string\n /**\n * @a11y Automatially created when using `Modal.Heading`. The `role='dialog'` MUST be labelled. Prefer `aria-labelledby` over `aria-label`.\n * @since 11.12.0\n */\n 'aria-labelledby'?: string\n /**\n * @a11y `role='dialog'` MUST be labelled. Prefer `aria-labelledby` over `aria-label`.\n * If using an `aria-label` instead of a node, be sure give the modal an `id` so\n * other regions can reference it.\n * @since 11.12.0\n */\n 'aria-label'?: string\n /**\n * @a11y Should be used for a single true modal. Cannot open nested modals.\n * @experimental Core-React does not support multiple or nested `aria-modal`s for Tearsheets, Modals, or ConfirmModals.\n * @since 12.42.0\n */\n 'aria-modal'?: boolean\n /**\n * @deprecated @experimental Changes the UI of modal to work on mobile breakpoints, to be used on Helix Header ONLY\n * @defaultValue false\n * @since 12.8.0\n */\n compact?: boolean\n /**\n * This adds additional UI or UX to close. Escape key will always close a dialog, see `onClose`.\n *\n * NOTE 'footer-button': Footer Cancel button still requires at least a rendered self closing `Modal.FooterButtons`.\n *\n * NOTE 'x': The X button still requires a rendered `Modal.Header` component.\n * @defaultValue []\n * @since 11.12.0\n */\n howToClose?: ModalOptionalCloseStartegy[]\n /**\n * Aligns with `role` and `ref` location.\n */\n id?: string\n /**\n * @deprecated Use `howToClose={['scrim']}` with `onClose` instead.\n * @deprecatedSince 12.41.0\n * @since 10.19.0\n */\n onClickOverlay?: (event: React.MouseEvent<HTMLDivElement>) => void\n /**\n * When a user closes the Modal by some approved `howToClose` method or the Escape key. This also opts-in to dialog focus management.\n * @a11y Future default! Moves focus into and cycles focus in the Modal, and returning focus\n * to the trigger when closed. Also enables the Escape key to close the Modal.\n * @since 11.6.0\n */\n onClose?: ModalOnClose\n /**\n * Modal open state\n * @defaultValue false\n * @since 10.19.0\n */\n open?: boolean\n /**\n * Enable dialog props. REQUIRES `onClose` to enable Escape key and focus management. MUST be labelled, prefer `aria-labelledby` over `aria-label`.\n */\n role?: 'dialog' | 'alertdialog'\n /**\n * Vertical placement of the modal.\n * Positioning modal at the top ensures that variable height modal won't shift position during content loading,\n * providing a more stable user experience.\n * @defaultValue center\n * @since 10.19.0\n */\n placement?: ModalPlacement\n /**\n * Sets a width on the container and uses next centering.\n * Future will default to `md`\n * @since 10.19.0\n */\n width?: ModalWidth\n}\n\nexport interface ModalContainerProps extends Props {\n /**\n * @deprecated @experimental Changes the UI of modal to work on mobile breakpoints, to be used on Helix Header ONLY\n * @defaultValue false\n * @since 12.8.0\n */\n compact?: boolean\n /**\n * @since 10.19.0\n */\n placement: ModalPlacement\n /**\n * @since 10.19.0\n */\n width?: ModalWidth\n}\n\nexport interface ConfirmModalProps extends Omit<ModalProps, 'onClose'> {\n /**\n * Headline message\n * @since 10.19.0\n */\n headline?: string\n\n /**\n * Callback when the ConfirmModal is dismissed.\n *\n * @a11y **Accessible pattern (recommended):** Use with `role=\"dialog\"` and `howToClose={['x']}`.\n * This enables focus management, Escape key support, and proper dialog semantics.\n * The callback signature is `(event, how) => void`.\n *\n * **Legacy pattern:** `(event: MouseEvent<HTMLButtonElement>) => void` — only handles X button click,\n * no focus management or Escape key support.\n *\n * @since 10.19.0\n */\n onClose?:\n | ModalOnClose\n | ((event: React.MouseEvent<HTMLButtonElement>) => void)\n /**\n *\n * @a11y Recommended to use. When using alertdialog should be a `aria-modal` because of their urgent nature. **Cannot open nested modals.**\n * @since 12.42.0\n */\n 'aria-modal'?: boolean\n}\n\n/**\n * NOTE: Using howToClose 'x' requires the `Modal.Header` component.\n * @a11y This component is a not semantic heading! For that, see `Modal.Heading`.\n */\nexport interface ModalCloseableHeaderProps extends Props {\n /**\n * @deprecated Use `Modal onClose` with `howToClose={['x']}` instead.\n * @deprecatedSince 12.41.0\n * @since 10.19.0\n */\n onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void\n /**\n * @since 10.19.0\n */\n qa?: { closeButton?: string }\n}\n\nexport interface ModalBodyProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * @deprecated @experimental Changes the UI of modal to work on mobile breakpoints, to be used on Helix Header ONLY\n * @defaultValue false\n * @since 12.8.0\n */\n compact?: boolean\n /**\n * Removes left, right paddings from the modal body when true\n * @defaultValue false\n * @since 10.19.0\n */\n noSideSpacing?: boolean\n}\n"],"mappings":""}
@@ -1,2 +1,2 @@
1
1
  export { ConfirmModal, Modal } from './Modal';
2
- export type { ConfirmModalProps, ModalProps } from './Modal.types';
2
+ export type { ConfirmModalProps, ModalOnClose, ModalProps } from './Modal.types';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ConfirmModal","Modal"],"sources":["../../src/Modal/index.ts"],"sourcesContent":["export { ConfirmModal, Modal } from './Modal'\nexport type { ConfirmModalProps, ModalProps } from './Modal.types'\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,KAAK,QAAQ,SAAS"}
1
+ {"version":3,"file":"index.js","names":["ConfirmModal","Modal"],"sources":["../../src/Modal/index.ts"],"sourcesContent":["export { ConfirmModal, Modal } from './Modal'\nexport type { ConfirmModalProps, ModalOnClose, ModalProps } from './Modal.types'\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,KAAK,QAAQ,SAAS"}
@@ -1,6 +1,7 @@
1
1
  var _excluded = ["getId", "getLabel", "qa", "value"],
2
2
  _excluded2 = ["value"],
3
- _excluded3 = ["afterHide", "afterShow", "beforeHide", "beforeShow", "block", "disabled", "emptyMessage", "error", "footer", "getId", "getLabel", "getGroup", "loading", "onChange", "onScrollBottom", "onSearch", "options", "isOptionDisabled", "optionRenderer", "optgroups", "groupHeaderRenderer", "groupRenderer", "tokenRenderer", "placeholder", "placement", "value", "tabIndex", "aria-labelledby", "aria-describedby", "qa"];
3
+ _excluded3 = ["afterHide", "afterShow", "beforeHide", "beforeShow", "block", "disabled", "emptyMessage", "error", "footer", "getId", "getLabel", "getGroup", "loading", "onChange", "onScrollBottom", "onSearch", "options", "isOptionDisabled", "optionRenderer", "optgroups", "groupHeaderRenderer", "groupRenderer", "tokenRenderer", "placeholder", "placement", "value", "tabIndex", "aria-labelledby", "aria-describedby", "qa"],
4
+ _excluded4 = ["aria-controls"];
4
5
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
7
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -393,7 +394,6 @@ var MultiSelect_ = /*#__PURE__*/React.forwardRef(function MultiSelect(_ref7, ref
393
394
  var targetRef = ref || ownRef;
394
395
  var searchRef = React.useRef(null);
395
396
  var menuRef = React.useRef(null);
396
- var menuId = useId();
397
397
  var tokenListId = useId();
398
398
  var tokenBaseId = useId();
399
399
  var noneSelectedId = useId();
@@ -404,6 +404,8 @@ var MultiSelect_ = /*#__PURE__*/React.forwardRef(function MultiSelect(_ref7, ref
404
404
  var _useMenuImperativeCon = useMenuImperativeControlNavigation(menuRef, isMenuOpen),
405
405
  menuNavigationTriggerProps = _useMenuImperativeCon.menuNavigationTriggerProps,
406
406
  menuProps = _useMenuImperativeCon.menuProps;
407
+ var menuAriaControls = menuNavigationTriggerProps['aria-controls'],
408
+ restMenuNavigationTriggerProps = _objectWithoutProperties(menuNavigationTriggerProps, _excluded4);
407
409
  var I18n = useI18nContext();
408
410
  var multiselect = useMultiSelect({
409
411
  getId: getId,
@@ -426,7 +428,6 @@ var MultiSelect_ = /*#__PURE__*/React.forwardRef(function MultiSelect(_ref7, ref
426
428
  shadowStrength: 2
427
429
  }, /*#__PURE__*/React.createElement(MenuImperative, _extends({}, menuProps, {
428
430
  ref: menuRef,
429
- id: menuId,
430
431
  onScrollBottom: onScrollBottom,
431
432
  onSelect: multiselect.onSelect,
432
433
  "data-qa": "multi-select-menu",
@@ -485,6 +486,7 @@ var MultiSelect_ = /*#__PURE__*/React.forwardRef(function MultiSelect(_ref7, ref
485
486
  var disable = _ref8.disable,
486
487
  enable = _ref8.enable,
487
488
  isVisible = _ref8.isVisible;
489
+ var ariaControls = isNavigatingTokens ? tokenListId : menuAriaControls;
488
490
  return /*#__PURE__*/React.createElement(StyledMultiSelectButton, _extends({
489
491
  $block: block,
490
492
  $error: error,
@@ -520,7 +522,7 @@ var MultiSelect_ = /*#__PURE__*/React.forwardRef(function MultiSelect(_ref7, ref
520
522
  }));
521
523
  })), /*#__PURE__*/React.createElement(StyledMultiSelectSearch, null, /*#__PURE__*/React.createElement(StyledMultiSelectSearchInput, _extends({
522
524
  "aria-activedescendant": activeTokenId,
523
- "aria-controls": isNavigatingTokens ? tokenListId : menuId,
525
+ "aria-controls": ariaControls,
524
526
  "aria-describedby": [ariaDescribedBy, value.length === 0 ? noneSelectedId : undefined].filter(Boolean).join(' ') || undefined,
525
527
  "aria-expanded": isVisible,
526
528
  "aria-invalid": error || undefined,
@@ -533,7 +535,7 @@ var MultiSelect_ = /*#__PURE__*/React.forwardRef(function MultiSelect(_ref7, ref
533
535
  onChange: function onChange(e) {
534
536
  multiselect.onSearch(e);
535
537
  }
536
- }, menuNavigationTriggerProps, {
538
+ }, restMenuNavigationTriggerProps, {
537
539
  onKeyDown: function onKeyDown(e) {
538
540
  if (isNavigatingTokens && e.key !== 'Tab') {
539
541
  // if we are navigating tokens don't do any input but allow Tab