@carbon/react 1.92.0 → 1.93.0-rc.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 (302) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +1011 -970
  2. package/es/components/AILabel/index.js +4 -4
  3. package/es/components/Breadcrumb/BreadcrumbItem.js +1 -1
  4. package/es/components/Button/Button.js +2 -2
  5. package/es/components/ChatButton/ChatButton.js +1 -1
  6. package/es/components/Checkbox/Checkbox.js +1 -1
  7. package/es/components/CheckboxGroup/CheckboxGroup.js +1 -1
  8. package/es/components/ComboBox/ComboBox.d.ts +3 -11
  9. package/es/components/ComboBox/ComboBox.js +15 -25
  10. package/es/components/ComboButton/index.d.ts +5 -8
  11. package/es/components/ComboButton/index.js +9 -12
  12. package/es/components/ComposedModal/ComposedModal.js +22 -36
  13. package/es/components/DataTable/DataTable.d.ts +25 -16
  14. package/es/components/DataTable/DataTable.js +33 -34
  15. package/es/components/DataTable/Table.js +2 -2
  16. package/es/components/DataTable/TableBatchActions.d.ts +49 -10
  17. package/es/components/DataTable/TableBatchActions.js +26 -21
  18. package/es/components/DataTable/TableExpandHeader.js +2 -2
  19. package/es/components/DataTable/TableExpandRow.js +1 -1
  20. package/es/components/DataTable/TableHeader.d.ts +8 -10
  21. package/es/components/DataTable/TableHeader.js +11 -13
  22. package/es/components/DataTable/TableRow.js +5 -5
  23. package/es/components/DataTable/TableSlugRow.js +1 -1
  24. package/es/components/DataTable/TableToolbarMenu.js +1 -1
  25. package/es/components/DataTable/TableToolbarSearch.d.ts +8 -7
  26. package/es/components/DataTable/TableToolbarSearch.js +11 -11
  27. package/es/components/DataTable/index.d.ts +2 -2
  28. package/es/components/DataTable/state/sorting.d.ts +2 -2
  29. package/es/components/DataTable/state/sorting.js +1 -1
  30. package/es/components/DataTable/tools/sorting.js +1 -1
  31. package/es/components/DatePicker/DatePicker.js +9 -9
  32. package/es/components/DatePickerInput/DatePickerInput.js +5 -5
  33. package/es/components/Dialog/Dialog.js +6 -6
  34. package/es/components/Dropdown/Dropdown.d.ts +1 -1
  35. package/es/components/Dropdown/Dropdown.js +8 -8
  36. package/es/components/ErrorBoundary/ErrorBoundaryContext.js +1 -1
  37. package/es/components/FileUploader/FileUploader.js +4 -4
  38. package/es/components/FileUploader/FileUploaderButton.js +1 -1
  39. package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
  40. package/es/components/FileUploader/FileUploaderItem.js +2 -2
  41. package/es/components/FluidComboBox/FluidComboBox.d.ts +4 -7
  42. package/es/components/FluidComboBox/FluidComboBox.js +1 -1
  43. package/es/components/FluidDropdown/FluidDropdown.d.ts +4 -8
  44. package/es/components/FluidDropdown/FluidDropdown.js +1 -1
  45. package/es/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -7
  46. package/es/components/FluidMultiSelect/FluidMultiSelect.d.ts +3 -7
  47. package/es/components/FluidMultiSelect/FluidMultiSelect.js +3 -3
  48. package/es/components/FluidNumberInput/FluidNumberInput.d.ts +4 -7
  49. package/es/components/FluidNumberInput/FluidNumberInput.js +2 -2
  50. package/es/components/FluidSearch/FluidSearch.js +1 -1
  51. package/es/components/FluidSelect/FluidSelect.js +1 -1
  52. package/es/components/FluidTextInput/FluidTextInput.js +1 -1
  53. package/es/components/FluidTimePicker/FluidTimePicker.js +3 -3
  54. package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +1 -1
  55. package/es/components/Grid/CSSGrid.js +3 -3
  56. package/es/components/Grid/Column.js +2 -2
  57. package/es/components/Grid/ColumnHang.js +1 -1
  58. package/es/components/Grid/FlexGrid.js +1 -1
  59. package/es/components/Grid/Row.js +1 -1
  60. package/es/components/Heading/index.js +2 -2
  61. package/es/components/IconButton/index.js +2 -2
  62. package/es/components/IconIndicator/index.js +2 -2
  63. package/es/components/InlineCheckbox/InlineCheckbox.js +1 -1
  64. package/es/components/Layout/index.js +2 -2
  65. package/es/components/LayoutDirection/LayoutDirection.js +1 -1
  66. package/es/components/Link/Link.js +2 -2
  67. package/es/components/ListBox/ListBoxField.d.ts +0 -1
  68. package/es/components/ListBox/ListBoxMenuIcon.d.ts +8 -4
  69. package/es/components/ListBox/ListBoxMenuIcon.js +10 -6
  70. package/es/components/ListBox/ListBoxMenuItem.js +2 -2
  71. package/es/components/ListBox/ListBoxSelection.d.ts +3 -6
  72. package/es/components/ListBox/ListBoxSelection.js +5 -10
  73. package/es/components/ListBox/index.d.ts +5 -3
  74. package/es/components/ListBox/next/ListBoxSelection.d.ts +6 -13
  75. package/es/components/ListBox/next/ListBoxSelection.js +16 -8
  76. package/es/components/ListBox/next/ListBoxTrigger.d.ts +5 -10
  77. package/es/components/ListBox/next/ListBoxTrigger.js +6 -6
  78. package/es/components/Menu/MenuContext.js +1 -1
  79. package/es/components/Menu/MenuItem.js +1 -1
  80. package/es/components/MenuButton/index.js +5 -5
  81. package/es/components/Modal/Modal.js +20 -36
  82. package/es/components/ModalWrapper/ModalWrapper.js +2 -2
  83. package/es/components/MultiSelect/FilterableMultiSelect.d.ts +3 -12
  84. package/es/components/MultiSelect/FilterableMultiSelect.js +18 -27
  85. package/es/components/MultiSelect/MultiSelect.d.ts +2 -2
  86. package/es/components/MultiSelect/MultiSelect.js +12 -12
  87. package/es/components/Notification/Notification.js +1 -1
  88. package/es/components/NumberInput/NumberInput.d.ts +2 -5
  89. package/es/components/NumberInput/NumberInput.js +13 -18
  90. package/es/components/OverflowMenu/OverflowMenu.d.ts +2 -2
  91. package/es/components/OverflowMenu/OverflowMenu.js +4 -4
  92. package/es/components/OverflowMenu/next/index.d.ts +1 -1
  93. package/es/components/OverflowMenu/next/index.js +2 -2
  94. package/es/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
  95. package/es/components/PageHeader/PageHeader.js +12 -12
  96. package/es/components/Pagination/Pagination.js +3 -3
  97. package/es/components/PaginationNav/PaginationNav.d.ts +6 -9
  98. package/es/components/PaginationNav/PaginationNav.js +21 -22
  99. package/es/components/Popover/index.js +8 -8
  100. package/es/components/ProgressBar/ProgressBar.js +2 -2
  101. package/es/components/ProgressIndicator/ProgressIndicator.d.ts +11 -15
  102. package/es/components/ProgressIndicator/ProgressIndicator.js +15 -15
  103. package/es/components/RadioButton/RadioButton.js +1 -1
  104. package/es/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
  105. package/es/components/RadioTile/RadioTile.js +1 -1
  106. package/es/components/Select/Select.js +7 -5
  107. package/es/components/ShapeIndicator/index.js +2 -2
  108. package/es/components/Slider/Slider.d.ts +7 -9
  109. package/es/components/Slider/Slider.js +16 -20
  110. package/es/components/Stack/HStack.js +1 -1
  111. package/es/components/Stack/Stack.js +1 -1
  112. package/es/components/Stack/VStack.js +1 -1
  113. package/es/components/StructuredList/StructuredList.js +3 -3
  114. package/es/components/Tabs/Tabs.js +12 -12
  115. package/es/components/Tag/DismissibleTag.js +3 -3
  116. package/es/components/Tag/OperationalTag.js +2 -2
  117. package/es/components/Tag/SelectableTag.js +2 -2
  118. package/es/components/Tag/Tag.js +4 -4
  119. package/es/components/Tag/isEllipsisActive.js +1 -1
  120. package/es/components/Text/Text.js +1 -1
  121. package/es/components/TextArea/TextArea.js +1 -1
  122. package/es/components/TextInput/PasswordInput.js +4 -4
  123. package/es/components/TextInput/TextInput.js +3 -3
  124. package/es/components/Theme/index.js +3 -3
  125. package/es/components/Tile/Tile.js +3 -3
  126. package/es/components/TimePicker/TimePicker.js +1 -1
  127. package/es/components/Toggletip/index.js +4 -4
  128. package/es/components/Tooltip/DefinitionTooltip.js +1 -1
  129. package/es/components/Tooltip/Tooltip.js +3 -3
  130. package/es/components/TreeView/TreeNode.js +6 -6
  131. package/es/components/TreeView/TreeView.js +5 -5
  132. package/es/components/UIShell/HeaderContainer.js +1 -1
  133. package/es/components/UIShell/HeaderMenu.js +1 -1
  134. package/es/components/UIShell/Link.js +2 -2
  135. package/es/components/UIShell/SideNavItems.js +1 -1
  136. package/es/components/UIShell/Switcher.js +1 -1
  137. package/es/components/UIShell/SwitcherItem.js +1 -1
  138. package/es/index.d.ts +1 -1
  139. package/es/internal/FloatingMenu.js +4 -4
  140. package/es/internal/Selection.js +6 -6
  141. package/es/internal/useMergedRefs.js +1 -1
  142. package/es/internal/useNoInteractiveChildren.js +4 -4
  143. package/es/internal/useOutsideClick.js +1 -1
  144. package/es/internal/useOverflowItems.js +6 -6
  145. package/es/internal/useResizeObserver.js +3 -3
  146. package/es/internal/useSavedCallback.js +1 -1
  147. package/es/internal/warning.js +1 -1
  148. package/es/prop-types/isRequiredOneOf.js +2 -2
  149. package/es/tools/events.js +1 -1
  150. package/es/tools/wrapComponent.js +1 -1
  151. package/es/types/common.d.ts +6 -2
  152. package/lib/components/AILabel/index.js +4 -4
  153. package/lib/components/Breadcrumb/BreadcrumbItem.js +1 -1
  154. package/lib/components/Button/Button.js +2 -2
  155. package/lib/components/ChatButton/ChatButton.js +1 -1
  156. package/lib/components/Checkbox/Checkbox.js +1 -1
  157. package/lib/components/CheckboxGroup/CheckboxGroup.js +1 -1
  158. package/lib/components/ComboBox/ComboBox.d.ts +3 -11
  159. package/lib/components/ComboBox/ComboBox.js +15 -25
  160. package/lib/components/ComboButton/index.d.ts +5 -8
  161. package/lib/components/ComboButton/index.js +9 -12
  162. package/lib/components/ComposedModal/ComposedModal.js +21 -35
  163. package/lib/components/DataTable/DataTable.d.ts +25 -16
  164. package/lib/components/DataTable/DataTable.js +33 -34
  165. package/lib/components/DataTable/Table.js +2 -2
  166. package/lib/components/DataTable/TableBatchActions.d.ts +49 -10
  167. package/lib/components/DataTable/TableBatchActions.js +26 -21
  168. package/lib/components/DataTable/TableExpandHeader.js +2 -2
  169. package/lib/components/DataTable/TableExpandRow.js +1 -1
  170. package/lib/components/DataTable/TableHeader.d.ts +8 -10
  171. package/lib/components/DataTable/TableHeader.js +11 -13
  172. package/lib/components/DataTable/TableRow.js +5 -5
  173. package/lib/components/DataTable/TableSlugRow.js +1 -1
  174. package/lib/components/DataTable/TableToolbarMenu.js +1 -1
  175. package/lib/components/DataTable/TableToolbarSearch.d.ts +8 -7
  176. package/lib/components/DataTable/TableToolbarSearch.js +11 -11
  177. package/lib/components/DataTable/index.d.ts +2 -2
  178. package/lib/components/DataTable/state/sorting.d.ts +2 -2
  179. package/lib/components/DataTable/state/sorting.js +1 -1
  180. package/lib/components/DataTable/tools/sorting.js +1 -1
  181. package/lib/components/DatePicker/DatePicker.js +9 -9
  182. package/lib/components/DatePickerInput/DatePickerInput.js +5 -5
  183. package/lib/components/Dialog/Dialog.js +6 -6
  184. package/lib/components/Dropdown/Dropdown.d.ts +1 -1
  185. package/lib/components/Dropdown/Dropdown.js +8 -8
  186. package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +1 -1
  187. package/lib/components/FileUploader/FileUploader.js +4 -4
  188. package/lib/components/FileUploader/FileUploaderButton.js +1 -1
  189. package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
  190. package/lib/components/FileUploader/FileUploaderItem.js +2 -2
  191. package/lib/components/FluidComboBox/FluidComboBox.d.ts +4 -7
  192. package/lib/components/FluidComboBox/FluidComboBox.js +1 -1
  193. package/lib/components/FluidDropdown/FluidDropdown.d.ts +4 -8
  194. package/lib/components/FluidDropdown/FluidDropdown.js +1 -1
  195. package/lib/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -7
  196. package/lib/components/FluidMultiSelect/FluidMultiSelect.d.ts +3 -7
  197. package/lib/components/FluidMultiSelect/FluidMultiSelect.js +3 -3
  198. package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +4 -7
  199. package/lib/components/FluidNumberInput/FluidNumberInput.js +2 -2
  200. package/lib/components/FluidSearch/FluidSearch.js +1 -1
  201. package/lib/components/FluidSelect/FluidSelect.js +1 -1
  202. package/lib/components/FluidTextInput/FluidTextInput.js +1 -1
  203. package/lib/components/FluidTimePicker/FluidTimePicker.js +3 -3
  204. package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +1 -1
  205. package/lib/components/Grid/CSSGrid.js +3 -3
  206. package/lib/components/Grid/Column.js +2 -2
  207. package/lib/components/Grid/ColumnHang.js +1 -1
  208. package/lib/components/Grid/FlexGrid.js +1 -1
  209. package/lib/components/Grid/Row.js +1 -1
  210. package/lib/components/Heading/index.js +2 -2
  211. package/lib/components/IconButton/index.js +2 -2
  212. package/lib/components/IconIndicator/index.js +2 -2
  213. package/lib/components/InlineCheckbox/InlineCheckbox.js +1 -1
  214. package/lib/components/Layout/index.js +2 -2
  215. package/lib/components/LayoutDirection/LayoutDirection.js +1 -1
  216. package/lib/components/Link/Link.js +2 -2
  217. package/lib/components/ListBox/ListBoxField.d.ts +0 -1
  218. package/lib/components/ListBox/ListBoxMenuIcon.d.ts +8 -4
  219. package/lib/components/ListBox/ListBoxMenuIcon.js +10 -6
  220. package/lib/components/ListBox/ListBoxMenuItem.js +2 -2
  221. package/lib/components/ListBox/ListBoxSelection.d.ts +3 -6
  222. package/lib/components/ListBox/ListBoxSelection.js +4 -10
  223. package/lib/components/ListBox/index.d.ts +5 -3
  224. package/lib/components/ListBox/next/ListBoxSelection.d.ts +6 -13
  225. package/lib/components/ListBox/next/ListBoxSelection.js +16 -8
  226. package/lib/components/ListBox/next/ListBoxTrigger.d.ts +5 -10
  227. package/lib/components/ListBox/next/ListBoxTrigger.js +5 -6
  228. package/lib/components/Menu/MenuContext.js +1 -1
  229. package/lib/components/Menu/MenuItem.js +1 -1
  230. package/lib/components/MenuButton/index.js +5 -5
  231. package/lib/components/Modal/Modal.js +19 -35
  232. package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
  233. package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +3 -12
  234. package/lib/components/MultiSelect/FilterableMultiSelect.js +18 -27
  235. package/lib/components/MultiSelect/MultiSelect.d.ts +2 -2
  236. package/lib/components/MultiSelect/MultiSelect.js +12 -12
  237. package/lib/components/Notification/Notification.js +1 -1
  238. package/lib/components/NumberInput/NumberInput.d.ts +2 -5
  239. package/lib/components/NumberInput/NumberInput.js +12 -18
  240. package/lib/components/OverflowMenu/OverflowMenu.d.ts +2 -2
  241. package/lib/components/OverflowMenu/OverflowMenu.js +4 -4
  242. package/lib/components/OverflowMenu/next/index.d.ts +1 -1
  243. package/lib/components/OverflowMenu/next/index.js +2 -2
  244. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
  245. package/lib/components/PageHeader/PageHeader.js +12 -12
  246. package/lib/components/Pagination/Pagination.js +3 -3
  247. package/lib/components/PaginationNav/PaginationNav.d.ts +6 -9
  248. package/lib/components/PaginationNav/PaginationNav.js +21 -22
  249. package/lib/components/Popover/index.js +8 -8
  250. package/lib/components/ProgressBar/ProgressBar.js +2 -2
  251. package/lib/components/ProgressIndicator/ProgressIndicator.d.ts +11 -15
  252. package/lib/components/ProgressIndicator/ProgressIndicator.js +15 -15
  253. package/lib/components/RadioButton/RadioButton.js +1 -1
  254. package/lib/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
  255. package/lib/components/RadioTile/RadioTile.js +1 -1
  256. package/lib/components/Select/Select.js +7 -5
  257. package/lib/components/ShapeIndicator/index.js +2 -2
  258. package/lib/components/Slider/Slider.d.ts +7 -9
  259. package/lib/components/Slider/Slider.js +16 -20
  260. package/lib/components/Stack/HStack.js +1 -1
  261. package/lib/components/Stack/Stack.js +1 -1
  262. package/lib/components/Stack/VStack.js +1 -1
  263. package/lib/components/StructuredList/StructuredList.js +3 -3
  264. package/lib/components/Tabs/Tabs.js +12 -12
  265. package/lib/components/Tag/DismissibleTag.js +3 -3
  266. package/lib/components/Tag/OperationalTag.js +2 -2
  267. package/lib/components/Tag/SelectableTag.js +2 -2
  268. package/lib/components/Tag/Tag.js +4 -4
  269. package/lib/components/Tag/isEllipsisActive.js +1 -1
  270. package/lib/components/Text/Text.js +1 -1
  271. package/lib/components/TextArea/TextArea.js +1 -1
  272. package/lib/components/TextInput/PasswordInput.js +4 -4
  273. package/lib/components/TextInput/TextInput.js +3 -3
  274. package/lib/components/Theme/index.js +3 -3
  275. package/lib/components/Tile/Tile.js +3 -3
  276. package/lib/components/TimePicker/TimePicker.js +1 -1
  277. package/lib/components/Toggletip/index.js +4 -4
  278. package/lib/components/Tooltip/DefinitionTooltip.js +1 -1
  279. package/lib/components/Tooltip/Tooltip.js +3 -3
  280. package/lib/components/TreeView/TreeNode.js +6 -6
  281. package/lib/components/TreeView/TreeView.js +5 -5
  282. package/lib/components/UIShell/HeaderContainer.js +1 -1
  283. package/lib/components/UIShell/HeaderMenu.js +1 -1
  284. package/lib/components/UIShell/Link.js +2 -2
  285. package/lib/components/UIShell/SideNavItems.js +1 -1
  286. package/lib/components/UIShell/Switcher.js +1 -1
  287. package/lib/components/UIShell/SwitcherItem.js +1 -1
  288. package/lib/index.d.ts +1 -1
  289. package/lib/internal/FloatingMenu.js +4 -4
  290. package/lib/internal/Selection.js +6 -6
  291. package/lib/internal/useMergedRefs.js +1 -1
  292. package/lib/internal/useNoInteractiveChildren.js +4 -4
  293. package/lib/internal/useOutsideClick.js +1 -1
  294. package/lib/internal/useOverflowItems.js +6 -6
  295. package/lib/internal/useResizeObserver.js +3 -3
  296. package/lib/internal/useSavedCallback.js +1 -1
  297. package/lib/internal/warning.js +1 -1
  298. package/lib/prop-types/isRequiredOneOf.js +2 -2
  299. package/lib/tools/events.js +1 -1
  300. package/lib/tools/wrapComponent.js +1 -1
  301. package/lib/types/common.d.ts +6 -2
  302. package/package.json +9 -9
@@ -7,7 +7,7 @@
7
7
 
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import PropTypes from 'prop-types';
10
- import React, { useContext, useRef, useState, useEffect, cloneElement } from 'react';
10
+ import React, { useContext, useRef, useEffect, cloneElement } from 'react';
11
11
  import cx from 'classnames';
12
12
  import { Close } from '@carbon/icons-react';
13
13
  import { toggleClass } from '../../tools/toggleClass.js';
@@ -18,7 +18,7 @@ import InlineLoading from '../InlineLoading/InlineLoading.js';
18
18
  import { Layer } from '../Layer/index.js';
19
19
  import { requiredIfGivenPropIsTruthy } from '../../prop-types/requiredIfGivenPropIsTruthy.js';
20
20
  import { wrapFocus, wrapFocusWithoutSentinels, elementOrParentIsFloatingMenu } from '../../internal/wrapFocus.js';
21
- import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
21
+ import { useResizeObserver } from '../../internal/useResizeObserver.js';
22
22
  import { useId } from '../../internal/useId.js';
23
23
  import { useMergedRefs } from '../../internal/useMergedRefs.js';
24
24
  import { usePrefix } from '../../internal/usePrefix.js';
@@ -37,7 +37,6 @@ import { AILabel } from '../AILabel/index.js';
37
37
  import { isComponentElement } from '../../internal/utils.js';
38
38
  import { warning } from '../../internal/warning.js';
39
39
  import { ModalPresenceContext, useExclusiveModalPresenceContext, ModalPresence } from './ModalPresence.js';
40
- import { debounce } from '../../node_modules/es-toolkit/dist/compat/function/debounce.js';
41
40
 
42
41
  const ModalSizes = ['xs', 'sm', 'md', 'lg'];
43
42
  const invalidOutsideClickMessage = '`<Modal>` prop `preventCloseOnClickOutside` should not be `false` when ' + '`passiveModal` is `false`. Transactional, non-passive Modals should ' + 'not be dissmissable by clicking outside. ' + 'See: https://carbondesignsystem.com/components/modal/usage/#transactional-modal';
@@ -112,7 +111,6 @@ const ModalDialog = /*#__PURE__*/React.forwardRef(function ModalDialog({
112
111
  const startTrap = useRef(null);
113
112
  const endTrap = useRef(null);
114
113
  const wrapFocusTimeout = useRef(null);
115
- const [isScrollable, setIsScrollable] = useState(false);
116
114
  const modalInstanceId = `modal-${useId()}`;
117
115
  const modalLabelId = `${prefix}--modal-header__label--${modalInstanceId}`;
118
116
  const modalHeadingId = `${prefix}--modal-header__heading--${modalInstanceId}`;
@@ -207,21 +205,16 @@ const ModalDialog = /*#__PURE__*/React.forwardRef(function ModalDialog({
207
205
  if (!modalContent || !modalContent.classList.contains(`${prefix}--modal-scroll-content`) || !currentActiveNode || !modalContent.contains(currentActiveNode)) {
208
206
  return;
209
207
  }
210
- const lastContent = modalContent.children[modalContent.children.length - 1];
211
- const gradientSpacing = modalContent.scrollHeight - lastContent.offsetTop - lastContent.clientHeight;
212
-
213
- // eslint-disable-next-line prefer-const -- https://github.com/carbon-design-system/carbon/issues/20071
214
- for (let elem of modalContent.children) {
215
- if (elem.contains(currentActiveNode)) {
216
- const spaceBelow = modalContent.clientHeight - elem.offsetTop + modalContent.scrollTop - elem.clientHeight;
217
- if (spaceBelow < gradientSpacing) {
218
- modalContent.scrollTop = modalContent.scrollTop + (gradientSpacing - spaceBelow);
219
- }
220
- break;
221
- }
222
- }
208
+ currentActiveNode.scrollIntoView({
209
+ block: 'center'
210
+ });
223
211
  }
224
212
  const onSecondaryButtonClick = onSecondarySubmit ? onSecondarySubmit : onRequestClose;
213
+ const {
214
+ height
215
+ } = useResizeObserver({
216
+ ref: contentRef
217
+ });
225
218
  const modalClasses = cx(`${prefix}--modal`, {
226
219
  [`${prefix}--modal-tall`]: !passiveModal,
227
220
  'is-visible': enablePresence || open,
@@ -234,8 +227,15 @@ const ModalDialog = /*#__PURE__*/React.forwardRef(function ModalDialog({
234
227
  [`${prefix}--modal-container--${size}`]: size,
235
228
  [`${prefix}--modal-container--full-width`]: isFullWidth
236
229
  });
230
+
231
+ /**
232
+ * isScrollable is implicitly dependent on height, when height gets updated
233
+ * via `useResizeObserver`, clientHeight and scrollHeight get updated too
234
+ */
235
+ const isScrollable = !!contentRef.current && contentRef?.current?.scrollHeight > contentRef?.current?.clientHeight;
237
236
  const contentClasses = cx(`${prefix}--modal-content`, {
238
- [`${prefix}--modal-scroll-content`]: hasScrollingContent || isScrollable
237
+ [`${prefix}--modal-scroll-content`]: hasScrollingContent || isScrollable,
238
+ [`${prefix}--modal-scroll-content--no-fade`]: height <= 300
239
239
  });
240
240
  const footerClasses = cx(`${prefix}--modal-footer`, {
241
241
  [`${prefix}--modal-footer--three-button`]: Array.isArray(secondaryButtons) && secondaryButtons.length === 2
@@ -274,7 +274,7 @@ const ModalDialog = /*#__PURE__*/React.forwardRef(function ModalDialog({
274
274
  return () => {
275
275
  document.removeEventListener('keydown', handleEscapeKey, true);
276
276
  };
277
- // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
277
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
278
278
  }, [open]);
279
279
  useEffect(() => {
280
280
  return () => {
@@ -329,29 +329,13 @@ const ModalDialog = /*#__PURE__*/React.forwardRef(function ModalDialog({
329
329
  }
330
330
  }
331
331
  }, [open, selectorPrimaryFocus, danger, prefix, enableDialogElement]);
332
- useIsomorphicEffect(() => {
333
- if (contentRef.current) {
334
- setIsScrollable(contentRef.current.scrollHeight > contentRef.current.clientHeight);
335
- }
336
- function handler() {
337
- if (contentRef.current) {
338
- setIsScrollable(contentRef.current.scrollHeight > contentRef.current.clientHeight);
339
- }
340
- }
341
- const debouncedHandler = debounce(handler, 200);
342
- window.addEventListener('resize', debouncedHandler);
343
- return () => {
344
- debouncedHandler.cancel();
345
- window.removeEventListener('resize', debouncedHandler);
346
- };
347
- }, []);
348
332
 
349
333
  // AILabel always size `sm`
350
334
  const candidate = slug ?? decorator;
351
335
  const candidateIsAILabel = isComponentElement(candidate, AILabel);
352
336
  const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/cloneElement(candidate, {
353
337
  size: 'sm'
354
- }) : null;
338
+ }) : candidate;
355
339
  const modalButton = /*#__PURE__*/React.createElement("div", {
356
340
  className: `${prefix}--modal-close-button`
357
341
  }, /*#__PURE__*/React.createElement(IconButton, {
@@ -17,7 +17,7 @@ import { Escape } from '../../internal/keyboard/keys.js';
17
17
  import { match } from '../../internal/keyboard/match.js';
18
18
 
19
19
  let didWarnAboutDeprecation = false;
20
- // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
20
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
21
21
  process.env.NODE_ENV !== 'production';
22
22
  class ModalWrapper extends React.Component {
23
23
  constructor(...args) {
@@ -54,7 +54,7 @@ class ModalWrapper extends React.Component {
54
54
  handleSubmit?.(evt);
55
55
  });
56
56
  }
57
- // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
57
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
58
58
  if(isDev) {
59
59
  process.env.NODE_ENV !== "production" ? warning(didWarnAboutDeprecation, '`<ModalWrapper>` has been deprecated in favor of `<ComposedModal/>` and will be removed in the next major version, `@carbon/react@v2.x`') : void 0;
60
60
  didWarnAboutDeprecation = true;
@@ -7,17 +7,9 @@
7
7
  import { type UseComboboxProps, type UseMultipleSelectionProps } from 'downshift';
8
8
  import React, { type FunctionComponent, type ReactElement, type ReactNode } from 'react';
9
9
  import { type MultiSelectSortingProps } from './MultiSelectPropTypes';
10
- import { type ListBoxSize, type ListBoxType } from '../ListBox';
11
- import { TranslateWithId } from '../../types/common';
12
- /**
13
- * Message ids that will be passed to translateWithId().
14
- * Combination of message ids from ListBox/next/ListBoxSelection.js and
15
- * ListBox/next/ListBoxTrigger.js, but we can't access those values directly
16
- * because those components aren't Typescript. (If you try, TranslationKey
17
- * ends up just being defined as "string".)
18
- */
19
- type TranslationKey = 'close.menu' | 'open.menu' | 'clear.all' | 'clear.selection';
20
- export interface FilterableMultiSelectProps<ItemType> extends MultiSelectSortingProps<ItemType>, React.RefAttributes<HTMLDivElement>, TranslateWithId<TranslationKey> {
10
+ import { type ListBoxMenuIconTranslationKey, type ListBoxSelectionTranslationKey, type ListBoxSize, type ListBoxType } from '../ListBox';
11
+ import type { TranslateWithId } from '../../types/common';
12
+ export interface FilterableMultiSelectProps<ItemType> extends MultiSelectSortingProps<ItemType>, React.RefAttributes<HTMLDivElement>, TranslateWithId<ListBoxSelectionTranslationKey | ListBoxMenuIconTranslationKey> {
21
13
  /**
22
14
  * Specify a label to be read by screen readers on the container node
23
15
  * @deprecated
@@ -209,4 +201,3 @@ export declare const FilterableMultiSelect: {
209
201
  defaultProps?: any;
210
202
  displayName?: any;
211
203
  };
212
- export {};
@@ -56,15 +56,6 @@ const {
56
56
  DropdownKeyDownBackspace,
57
57
  FunctionRemoveSelectedItem
58
58
  } = useMultipleSelection.stateChangeTypes;
59
-
60
- /**
61
- * Message ids that will be passed to translateWithId().
62
- * Combination of message ids from ListBox/next/ListBoxSelection.js and
63
- * ListBox/next/ListBoxTrigger.js, but we can't access those values directly
64
- * because those components aren't Typescript. (If you try, TranslationKey
65
- * ends up just being defined as "string".)
66
- */
67
-
68
59
  const FilterableMultiSelect = /*#__PURE__*/forwardRef(function FilterableMultiSelect({
69
60
  autoAlign = false,
70
61
  className: containerClassName,
@@ -111,7 +102,7 @@ const FilterableMultiSelect = /*#__PURE__*/forwardRef(function FilterableMultiSe
111
102
  isFluid
112
103
  } = useContext(FormContext);
113
104
  const isFirstRender = useRef(true);
114
- // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
105
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
115
106
  const [isFocused, setIsFocused] = useState(false);
116
107
  const [isOpen, setIsOpen] = useState(!!open);
117
108
  const [prevOpen, setPrevOpen] = useState(!!open);
@@ -123,9 +114,9 @@ const FilterableMultiSelect = /*#__PURE__*/forwardRef(function FilterableMultiSe
123
114
  inputValue
124
115
  }), [items, inputValue, itemToString, filterItems]);
125
116
  const nonSelectAllItems = useMemo(
126
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
117
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
127
118
  () => filteredItems.filter(item => !item.isSelectAll), [filteredItems]);
128
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
119
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
129
120
  const selectAll = filteredItems.some(item => item.isSelectAll);
130
121
  const {
131
122
  selectedItems: controlledSelectedItems,
@@ -142,7 +133,7 @@ const FilterableMultiSelect = /*#__PURE__*/forwardRef(function FilterableMultiSe
142
133
  });
143
134
  const selectAllStatus = useMemo(() => {
144
135
  const selectable = nonSelectAllItems.filter(
145
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
136
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
146
137
  item => !item.disabled);
147
138
  const nonSelectedCount = selectable.filter(item => !controlledSelectedItems.some(sel => isEqual(sel, item))).length;
148
139
  const totalCount = selectable.length;
@@ -152,7 +143,7 @@ const FilterableMultiSelect = /*#__PURE__*/forwardRef(function FilterableMultiSe
152
143
  };
153
144
  }, [controlledSelectedItems, nonSelectAllItems]);
154
145
  const handleSelectAllClick = useCallback(() => {
155
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
146
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
156
147
  const selectable = nonSelectAllItems.filter(i => !i.disabled);
157
148
  const {
158
149
  checked,
@@ -169,7 +160,7 @@ const FilterableMultiSelect = /*#__PURE__*/forwardRef(function FilterableMultiSe
169
160
  const toSelect = selectable.filter(e => !controlledSelectedItems.some(sel => isEqual(sel, e)));
170
161
  toggleAll([...controlledSelectedItems, ...toSelect]);
171
162
  }
172
- // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
163
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
173
164
  }, [nonSelectAllItems, selectAllStatus, controlledSelectedItems, toggleAll]);
174
165
  const {
175
166
  refs,
@@ -220,14 +211,14 @@ const FilterableMultiSelect = /*#__PURE__*/forwardRef(function FilterableMultiSe
220
211
 
221
212
  // memoize sorted items to reduce unnecessary expensive sort on rerender
222
213
  const sortedItems = useMemo(() => {
223
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
214
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
224
215
  const selectAllItem = items.find(item => item.isSelectAll);
225
216
  const selectableRealItems = nonSelectAllItems.filter(
226
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
217
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
227
218
  item => !item.disabled);
228
219
 
229
220
  // Sort only non-select-all items, select-all item must stay at the top
230
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20071
221
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452
231
222
  const sortedReal = sortItems(nonSelectAllItems, {
232
223
  selectedItems: {
233
224
  top: controlledSelectedItems,
@@ -244,7 +235,7 @@ const FilterableMultiSelect = /*#__PURE__*/forwardRef(function FilterableMultiSe
244
235
  return [selectAllItem, ...sortedReal];
245
236
  }
246
237
  return sortedReal;
247
- // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
238
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
248
239
  }, [items, inputValue, controlledSelectedItems, topItems, selectionFeedback, itemToString, compareItems, locale, sortItems, nonSelectAllItems]);
249
240
  const inline = type === 'inline';
250
241
  const showWarning = !invalid && warn;
@@ -328,7 +319,7 @@ const FilterableMultiSelect = /*#__PURE__*/forwardRef(function FilterableMultiSe
328
319
  return () => {
329
320
  document.removeEventListener('mousedown', handleClickOutside);
330
321
  };
331
- // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
322
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
332
323
  }, [isOpen, inputFocused]);
333
324
  const {
334
325
  getToggleButtonProps,
@@ -351,9 +342,9 @@ const FilterableMultiSelect = /*#__PURE__*/forwardRef(function FilterableMultiSe
351
342
  inputId,
352
343
  inputValue,
353
344
  stateReducer,
354
- // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
345
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
355
346
  isItemDisabled(item, _index) {
356
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
347
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
357
348
  return item?.disabled;
358
349
  }
359
350
  });
@@ -521,11 +512,11 @@ const FilterableMultiSelect = /*#__PURE__*/forwardRef(function FilterableMultiSe
521
512
  const candidateIsAILabel = isComponentElement(candidate, AILabel);
522
513
  const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/cloneElement(candidate, {
523
514
  size: 'mini'
524
- }) : null;
515
+ }) : candidate;
525
516
 
526
517
  // exclude the select-all item from the count
527
518
  const selectedItemsLength = controlledSelectedItems.filter(
528
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
519
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
529
520
  item => !item.isSelectAll).length;
530
521
  const className = cx(`${prefix}--multi-select`, `${prefix}--combo-box`, `${prefix}--multi-select--filterable`, {
531
522
  [`${prefix}--multi-select--invalid`]: invalid,
@@ -707,7 +698,7 @@ const FilterableMultiSelect = /*#__PURE__*/forwardRef(function FilterableMultiSe
707
698
  }, normalizedDecorator) : '', /*#__PURE__*/React.createElement(ListBox.Menu, menuProps, isOpen ? sortedItems.map((item, index) => {
708
699
  let isChecked;
709
700
  let isIndeterminate = false;
710
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
701
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
711
702
  if (item.isSelectAll) {
712
703
  isChecked = selectAllStatus.checked;
713
704
  isIndeterminate = selectAllStatus.indeterminate;
@@ -805,7 +796,7 @@ FilterableMultiSelect.propTypes = {
805
796
  * change, and in some cases they can not be shimmed by Carbon to shield you
806
797
  * from potentially breaking changes.
807
798
  */
808
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20071
799
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
809
800
  // @ts-ignore
810
801
  downshiftProps: PropTypes.shape(Downshift.propTypes),
811
802
  /**
@@ -897,7 +888,7 @@ FilterableMultiSelect.propTypes = {
897
888
  */
898
889
  titleText: PropTypes.node,
899
890
  /**
900
- * Callback function for translating ListBoxMenuIcon SVG title
891
+ * Translates component strings using your i18n tool.
901
892
  */
902
893
  translateWithId: PropTypes.func,
903
894
  type: ListBoxTypePropType,
@@ -6,14 +6,14 @@
6
6
  */
7
7
  import { UseSelectProps } from 'downshift';
8
8
  import React, { type ReactNode } from 'react';
9
- import { type ListBoxSize, type ListBoxType } from '../ListBox';
9
+ import { type ListBoxMenuIconTranslationKey, type ListBoxSelectionTranslationKey, type ListBoxSize, type ListBoxType } from '../ListBox';
10
10
  import { MultiSelectSortingProps } from './MultiSelectPropTypes';
11
11
  import { ListBoxProps } from '../ListBox/ListBox';
12
12
  import type { TranslateWithId } from '../../types/common';
13
13
  interface OnChangeData<ItemType> {
14
14
  selectedItems: ItemType[] | null;
15
15
  }
16
- export interface MultiSelectProps<ItemType> extends MultiSelectSortingProps<ItemType>, TranslateWithId<'close.menu' | 'open.menu' | 'clear.all' | 'clear.selection'> {
16
+ export interface MultiSelectProps<ItemType> extends MultiSelectSortingProps<ItemType>, TranslateWithId<ListBoxMenuIconTranslationKey | ListBoxSelectionTranslationKey> {
17
17
  /**
18
18
  * **Experimental**: Will attempt to automatically align the floating
19
19
  * element to avoid collisions with the viewport and being clipped by
@@ -101,14 +101,14 @@ const MultiSelect = /*#__PURE__*/React.forwardRef(({
101
101
  });
102
102
  }, [items]);
103
103
 
104
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
104
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
105
105
  const selectAll = filteredItems.some(item => item.isSelectAll);
106
106
  const prefix = usePrefix();
107
107
  const {
108
108
  isFluid
109
109
  } = useContext(FormContext);
110
110
  const multiSelectInstanceId = useId();
111
- // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
111
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
112
112
  const [isFocused, setIsFocused] = useState(false);
113
113
  const [inputFocused, setInputFocused] = useState(false);
114
114
  const [isOpen, setIsOpen] = useState(open || false);
@@ -183,9 +183,9 @@ const MultiSelect = /*#__PURE__*/React.forwardRef(({
183
183
  },
184
184
  selectedItem: controlledSelectedItems,
185
185
  items: filteredItems,
186
- // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
186
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
187
187
  isItemDisabled(item, _index) {
188
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
188
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
189
189
  return item?.disabled;
190
190
  },
191
191
  ...downshiftProps
@@ -381,7 +381,7 @@ const MultiSelect = /*#__PURE__*/React.forwardRef(({
381
381
  [`${prefix}--list-box__field--wrapper--input-focused`]: inputFocused
382
382
  });
383
383
  const handleFocus = evt => {
384
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
384
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
385
385
  evt.target.classList.contains(`${prefix}--tag__close-icon`) ? setIsFocused(false) : setIsFocused(evt.type === 'focus' ? true : false);
386
386
  };
387
387
  const readOnlyEventHandlers = readOnly ? {
@@ -407,10 +407,10 @@ const MultiSelect = /*#__PURE__*/React.forwardRef(({
407
407
  const candidateIsAILabel = isComponentElement(candidate, AILabel);
408
408
  const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/cloneElement(candidate, {
409
409
  size: 'mini'
410
- }) : null;
410
+ }) : candidate;
411
411
  const itemsSelectedText = selectedItems.length > 0 && selectedItems.map(item => item?.text);
412
412
  const selectedItemsLength = selectAll ?
413
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
413
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
414
414
  selectedItems.filter(item => !item.isSelectAll).length : selectedItems.length;
415
415
 
416
416
  // Memoize the value of getMenuProps to avoid an infinite loop
@@ -431,7 +431,7 @@ const MultiSelect = /*#__PURE__*/React.forwardRef(({
431
431
  totalSelectableCount
432
432
  };
433
433
  },
434
- // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
434
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
435
435
  [selectedItems, filteredItems]);
436
436
  return /*#__PURE__*/React.createElement("div", {
437
437
  className: wrapperClasses
@@ -485,7 +485,7 @@ const MultiSelect = /*#__PURE__*/React.forwardRef(({
485
485
  })), slug ? normalizedDecorator : decorator ? /*#__PURE__*/React.createElement("div", {
486
486
  className: `${prefix}--list-box__inner-wrapper--decorator`
487
487
  }, normalizedDecorator) : ''), /*#__PURE__*/React.createElement(ListBox.Menu, menuProps, isOpen &&
488
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20071
488
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452
489
489
  sortItems(filteredItems, sortOptions).map((item, index) => {
490
490
  const {
491
491
  hasIndividualSelections,
@@ -493,10 +493,10 @@ const MultiSelect = /*#__PURE__*/React.forwardRef(({
493
493
  totalSelectableCount
494
494
  } = getSelectionStats(selectedItems, filteredItems);
495
495
 
496
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
496
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
497
497
  const isChecked = item.isSelectAll ? nonSelectAllSelectedCount === totalSelectableCount && totalSelectableCount > 0 : selectedItems.some(selected => isEqual(selected, item));
498
498
  const isIndeterminate =
499
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
499
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
500
500
  item.isSelectAll && hasIndividualSelections && nonSelectAllSelectedCount < totalSelectableCount;
501
501
  const itemProps = getItemProps({
502
502
  item,
@@ -700,7 +700,7 @@ MultiSelect.propTypes = {
700
700
  */
701
701
  titleText: PropTypes.node,
702
702
  /**
703
- * Callback function for translating ListBoxMenuIcon SVG title
703
+ * Translates component strings using your i18n tool.
704
704
  */
705
705
  translateWithId: PropTypes.func,
706
706
  /**
@@ -807,7 +807,7 @@ Callout.propTypes = {
807
807
  /**
808
808
  * @deprecated Use `CalloutProps` instead.
809
809
  */
810
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type -- https://github.com/carbon-design-system/carbon/issues/20071
810
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type -- https://github.com/carbon-design-system/carbon/issues/20452
811
811
 
812
812
  let didWarnAboutDeprecation = false;
813
813
  const StaticNotification = props => {
@@ -5,15 +5,12 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React, { type ReactNode } from 'react';
8
- import { TranslateWithId } from '../../types/common';
8
+ import type { TranslateWithId } from '../../types/common';
9
9
  import { type NumberFormatOptions } from '@carbon/utilities';
10
- export declare const translationIds: {
10
+ declare const translationIds: {
11
11
  readonly 'increment.number': "increment.number";
12
12
  readonly 'decrement.number': "decrement.number";
13
13
  };
14
- /**
15
- * Message ids that will be passed to translateWithId().
16
- */
17
14
  type TranslationKey = keyof typeof translationIds;
18
15
  type ExcludedAttributes = 'defaultValue' | 'id' | 'min' | 'max' | 'onChange' | 'onClick' | 'size' | 'step' | 'value';
19
16
  export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, ExcludedAttributes>, TranslateWithId<TranslationKey> {
@@ -32,17 +32,15 @@ const translationIds = {
32
32
  'increment.number': 'increment.number',
33
33
  'decrement.number': 'decrement.number'
34
34
  };
35
-
36
- /**
37
- * Message ids that will be passed to translateWithId().
38
- */
39
-
40
35
  const defaultTranslations = {
41
36
  [translationIds['increment.number']]: 'Increment number',
42
37
  [translationIds['decrement.number']]: 'Decrement number'
43
38
  };
39
+ const defaultTranslateWithId = messageId => {
40
+ return defaultTranslations[messageId];
41
+ };
44
42
 
45
- // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
43
+ // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
46
44
  const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
47
45
  const {
48
46
  allowEmpty = false,
@@ -73,7 +71,7 @@ const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
73
71
  size = 'md',
74
72
  slug,
75
73
  step = 1,
76
- translateWithId: t = id => defaultTranslations[id],
74
+ translateWithId: t = defaultTranslateWithId,
77
75
  type = 'number',
78
76
  defaultValue = type === 'number' ? 0 : NaN,
79
77
  validate,
@@ -104,7 +102,7 @@ const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
104
102
  }
105
103
  return 0;
106
104
  });
107
- // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
105
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
108
106
  const [prevControlledValue, setPrevControlledValue] = useState(controlledValue);
109
107
  const numberParser = useMemo(() => new NumberParser(locale, formatOptions), [locale, formatOptions]);
110
108
  /**
@@ -237,7 +235,7 @@ const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
237
235
  [`${prefix}--number-input--fluid--disabled`]: isFluid && disabled
238
236
  });
239
237
 
240
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
238
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
241
239
  const Icon = normalizedProps.icon;
242
240
  const getDecimalPlaces = num => {
243
241
  const parts = num.toString().split('.');
@@ -306,13 +304,10 @@ const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
306
304
  const candidateIsAILabel = isComponentElement(candidate, AILabel);
307
305
  const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/cloneElement(candidate, {
308
306
  size: 'mini'
309
- }) : null;
307
+ }) : candidate;
310
308
 
311
309
  // Need to update the internal value when the revert button is clicked
312
- let isRevertActive;
313
- if (normalizedDecorator?.type === AILabel) {
314
- isRevertActive = normalizedDecorator.props.revertActive;
315
- }
310
+ const isRevertActive = isComponentElement(normalizedDecorator, AILabel) ? normalizedDecorator.props.revertActive : undefined;
316
311
  useEffect(() => {
317
312
  if (!isRevertActive && slug && defaultValue) {
318
313
  setValue(defaultValue);
@@ -347,9 +342,9 @@ const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
347
342
  onKeyUp: onKeyUp,
348
343
  onKeyDown: e => {
349
344
  if (type === 'text') {
350
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
345
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
351
346
  match(e, ArrowUp) && handleStep(e, 'up');
352
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
347
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
353
348
  match(e, ArrowDown) && handleStep(e, 'down');
354
349
  }
355
350
  if (rest?.onKeyDown) {
@@ -597,7 +592,7 @@ NumberInput.propTypes = {
597
592
  */
598
593
  step: PropTypes.number,
599
594
  /**
600
- * Provide custom text for the component for each translation id
595
+ * Translates component strings using your i18n tool.
601
596
  */
602
597
  translateWithId: PropTypes.func,
603
598
  /**
@@ -731,4 +726,4 @@ function disableWheel(e) {
731
726
  e.preventDefault();
732
727
  }
733
728
 
734
- export { NumberInput, translationIds };
729
+ export { NumberInput };
@@ -102,9 +102,9 @@ export interface OverflowMenuProps extends Omit<IconButtonProps, 'type' | 'aria-
102
102
  */
103
103
  selectorPrimaryFocus?: string;
104
104
  /**
105
- * Specify the size of the OverflowMenu. Currently supports either `sm`, `md` (default) or `lg` as an option.
105
+ * Specify the size of the OverflowMenu. Currently supports either `xs`, `sm`, `md` (default) or `lg` as an option.
106
106
  */
107
- size?: 'sm' | 'md' | 'lg';
107
+ size?: 'xs' | 'sm' | 'md' | 'lg';
108
108
  /**
109
109
  * The ref to the overflow menu's trigger button element.
110
110
  * @deprecated Use the standard React `ref` prop instead.
@@ -66,7 +66,7 @@ const getMenuOffset = (menuBody, direction, trigger, flip) => {
66
66
  if (process.env.NODE_ENV !== 'production') {
67
67
  !(triggerButtonPositionProp && triggerButtonPositionFactor) ? process.env.NODE_ENV !== "production" ? invariant(false, '[OverflowMenu] wrong floating menu direction: `%s`', direction) : invariant(false) : void 0;
68
68
  }
69
- // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
69
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
70
70
  const {
71
71
  offsetWidth: menuWidth,
72
72
  offsetHeight: menuHeight
@@ -89,7 +89,7 @@ const getMenuOffset = (menuBody, direction, trigger, flip) => {
89
89
  };
90
90
  }
91
91
  };
92
- // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
92
+ // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
93
93
  const OverflowMenu = /*#__PURE__*/forwardRef(({
94
94
  align,
95
95
  ['aria-label']: ariaLabel = null,
@@ -463,9 +463,9 @@ OverflowMenu.propTypes = {
463
463
  */
464
464
  selectorPrimaryFocus: PropTypes.string,
465
465
  /**
466
- * Specify the size of the OverflowMenu. Currently supports either `sm`, `md` (default) or `lg` as an option.
466
+ * Specify the size of the OverflowMenu. Currently supports either `xs`, `sm`, `md` (default) or `lg` as an option.
467
467
  */
468
- size: PropTypes.oneOf(['sm', 'md', 'lg'])
468
+ size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg'])
469
469
  };
470
470
 
471
471
  export { OverflowMenu, OverflowMenu as default, getMenuOffset };
@@ -37,7 +37,7 @@ interface OverflowMenuProps {
37
37
  /**
38
38
  * Specify the size of the menu, from a list of available sizes.
39
39
  */
40
- size?: 'sm' | 'md' | 'lg';
40
+ size?: 'xs' | 'sm' | 'md' | 'lg';
41
41
  /**
42
42
  * Specify how the trigger tooltip should be aligned.
43
43
  */
@@ -23,7 +23,7 @@ import { deprecateValuesWithin } from '../../../prop-types/deprecateValuesWithin
23
23
  import { mapPopoverAlign } from '../../../tools/mapPopoverAlign.js';
24
24
 
25
25
  const defaultSize = 'md';
26
- // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
26
+ // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
27
27
  const OverflowMenu = /*#__PURE__*/React.forwardRef(({
28
28
  autoAlign = false,
29
29
  children,
@@ -162,7 +162,7 @@ OverflowMenu.propTypes = {
162
162
  /**
163
163
  * Specify the size of the menu, from a list of available sizes.
164
164
  */
165
- size: PropTypes.oneOf(['sm', 'md', 'lg']),
165
+ size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg']),
166
166
  /**
167
167
  * Specify how the trigger tooltip should be aligned.
168
168
  */
@@ -89,14 +89,14 @@ const OverflowMenuItem = frFn((props, ref) => {
89
89
  // ref as any: the type of `ref` is `ForwardedRef<HTMLButtonElement>` in `Button` component
90
90
  // but `OverflowMenuItem` can be rendered as `a` tag as well, which is `HTMLAnchorElement`
91
91
  // so we have to use `any` here
92
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
92
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
93
93
  ,
94
94
  ref: ref,
95
95
  tabIndex: -1
96
96
  // itemText as any: itemText may be a ReactNode, but `title` only accepts string
97
97
  // to avoid compatibility issue, we use `any` here. Consider to enforce `itemText` to be `string?`
98
98
  // in the next major release
99
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
99
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
100
100
  ,
101
101
  title: requireTitle ? title || itemText : undefined
102
102
  }, rest), OverflowMenuItemContent));