@carbon/react 1.89.0 → 1.90.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 (262) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +877 -877
  2. package/README.md +2 -2
  3. package/es/components/AILabel/index.js +8 -6
  4. package/es/components/Breadcrumb/BreadcrumbItem.js +2 -0
  5. package/es/components/Button/Button.js +3 -0
  6. package/es/components/ChatButton/ChatButton.js +1 -0
  7. package/es/components/CheckboxGroup/CheckboxGroup.js +21 -2
  8. package/es/components/ComboBox/ComboBox.js +17 -1
  9. package/es/components/ComboButton/index.js +1 -0
  10. package/es/components/ComposedModal/ComposedModal.js +18 -4
  11. package/es/components/DataTable/DataTable.d.ts +3 -8
  12. package/es/components/DataTable/DataTable.js +14 -0
  13. package/es/components/DataTable/Table.js +3 -3
  14. package/es/components/DataTable/TableExpandHeader.js +5 -1
  15. package/es/components/DataTable/TableExpandRow.d.ts +33 -5
  16. package/es/components/DataTable/TableExpandRow.js +5 -2
  17. package/es/components/DataTable/TableHeader.d.ts +1 -2
  18. package/es/components/DataTable/TableHeader.js +3 -2
  19. package/es/components/DataTable/TableRow.d.ts +3 -6
  20. package/es/components/DataTable/TableRow.js +40 -22
  21. package/es/components/DataTable/TableSlugRow.js +1 -0
  22. package/es/components/DataTable/TableToolbarMenu.js +3 -0
  23. package/es/components/DataTable/state/sorting.d.ts +57 -14
  24. package/es/components/DataTable/state/sorting.js +42 -50
  25. package/es/components/DataTable/tools/sorting.js +5 -0
  26. package/es/components/DatePicker/DatePicker.js +14 -3
  27. package/es/components/DatePickerInput/DatePickerInput.js +6 -0
  28. package/es/components/Dialog/Dialog.js +10 -2
  29. package/es/components/Dropdown/Dropdown.js +16 -4
  30. package/es/components/ErrorBoundary/ErrorBoundaryContext.js +1 -0
  31. package/es/components/FileUploader/FileUploader.js +9 -2
  32. package/es/components/FileUploader/FileUploaderButton.js +1 -1
  33. package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
  34. package/es/components/FileUploader/FileUploaderItem.js +3 -0
  35. package/es/components/FluidMultiSelect/FluidMultiSelect.js +2 -0
  36. package/es/components/FluidNumberInput/FluidNumberInput.js +3 -2
  37. package/es/components/FluidSearch/FluidSearch.js +3 -2
  38. package/es/components/FluidSelect/FluidSelect.js +3 -2
  39. package/es/components/FluidTextInput/FluidTextInput.js +3 -2
  40. package/es/components/FluidTimePicker/FluidTimePicker.js +11 -4
  41. package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +3 -2
  42. package/es/components/Grid/CSSGrid.js +5 -0
  43. package/es/components/Grid/Column.js +3 -0
  44. package/es/components/Grid/ColumnHang.js +1 -0
  45. package/es/components/Grid/FlexGrid.js +1 -0
  46. package/es/components/Grid/Row.js +1 -0
  47. package/es/components/Heading/index.js +3 -1
  48. package/es/components/IconButton/index.js +4 -2
  49. package/es/components/IconIndicator/index.js +4 -2
  50. package/es/components/InlineCheckbox/InlineCheckbox.js +3 -2
  51. package/es/components/Layout/index.js +6 -4
  52. package/es/components/LayoutDirection/LayoutDirection.js +2 -0
  53. package/es/components/Link/Link.js +3 -0
  54. package/es/components/ListBox/ListBoxMenuItem.js +4 -1
  55. package/es/components/ListBox/next/ListBoxTrigger.js +3 -2
  56. package/es/components/Menu/Menu.js +6 -9
  57. package/es/components/Menu/MenuContext.js +1 -0
  58. package/es/components/Menu/MenuItem.js +5 -13
  59. package/es/components/MenuButton/index.js +7 -2
  60. package/es/components/Modal/Modal.js +15 -6
  61. package/es/components/ModalWrapper/ModalWrapper.js +2 -0
  62. package/es/components/MultiSelect/FilterableMultiSelect.js +24 -5
  63. package/es/components/MultiSelect/MultiSelect.js +21 -5
  64. package/es/components/Notification/Notification.js +1 -1
  65. package/es/components/NumberInput/NumberInput.js +18 -7
  66. package/es/components/OverflowMenu/OverflowMenu.js +2 -0
  67. package/es/components/OverflowMenu/next/index.js +3 -2
  68. package/es/components/OverflowMenuItem/OverflowMenuItem.js +2 -0
  69. package/es/components/PageHeader/PageHeader.d.ts +3 -3
  70. package/es/components/PageHeader/PageHeader.js +22 -8
  71. package/es/components/Pagination/Pagination.js +6 -2
  72. package/es/components/PaginationNav/PaginationNav.js +2 -5
  73. package/es/components/Popover/index.js +20 -6
  74. package/es/components/ProgressBar/ProgressBar.js +4 -2
  75. package/es/components/RadioTile/RadioTile.js +2 -2
  76. package/es/components/Search/Search.js +2 -2
  77. package/es/components/Select/Select.js +2 -3
  78. package/es/components/ShapeIndicator/index.js +4 -2
  79. package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +4 -4
  80. package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +1 -2
  81. package/es/components/SkeletonText/SkeletonText.js +0 -2
  82. package/es/components/Slider/Slider.js +11 -16
  83. package/es/components/Stack/HStack.js +1 -0
  84. package/es/components/Stack/Stack.js +6 -9
  85. package/es/components/Stack/VStack.js +1 -0
  86. package/es/components/StructuredList/StructuredList.js +3 -0
  87. package/es/components/Switch/Switch.js +1 -1
  88. package/es/components/Tabs/Tabs.js +28 -17
  89. package/es/components/Tag/DismissibleTag.d.ts +5 -0
  90. package/es/components/Tag/DismissibleTag.js +8 -1
  91. package/es/components/Tag/OperationalTag.js +2 -0
  92. package/es/components/Tag/SelectableTag.js +2 -0
  93. package/es/components/Tag/Tag.js +4 -0
  94. package/es/components/Tag/isEllipsisActive.js +1 -0
  95. package/es/components/Text/Text.js +1 -0
  96. package/es/components/TextInput/ControlledPasswordInput.js +2 -4
  97. package/es/components/TextInput/PasswordInput.js +7 -2
  98. package/es/components/TextInput/TextInput.js +4 -2
  99. package/es/components/Theme/index.js +8 -3
  100. package/es/components/Tile/Tile.js +14 -17
  101. package/es/components/TimePicker/TimePicker.js +1 -0
  102. package/es/components/Toggle/Toggle.js +1 -1
  103. package/es/components/Toggletip/index.js +23 -8
  104. package/es/components/Tooltip/DefinitionTooltip.js +1 -0
  105. package/es/components/Tooltip/Tooltip.js +30 -23
  106. package/es/components/TreeView/TreeNode.d.ts +28 -0
  107. package/es/components/TreeView/TreeNode.js +19 -10
  108. package/es/components/TreeView/TreeView.js +7 -0
  109. package/es/components/UIShell/HeaderContainer.js +3 -1
  110. package/es/components/UIShell/HeaderGlobalAction.js +2 -2
  111. package/es/components/UIShell/HeaderMenu.js +3 -3
  112. package/es/components/UIShell/HeaderPanel.js +2 -2
  113. package/es/components/UIShell/Link.js +2 -0
  114. package/es/components/UIShell/SideNavItems.js +1 -0
  115. package/es/components/UIShell/SideNavMenu.js +2 -2
  116. package/es/components/UIShell/SideNavMenuItem.js +1 -1
  117. package/es/components/UIShell/SideNavSwitcher.js +1 -1
  118. package/es/components/UIShell/Switcher.js +2 -1
  119. package/es/components/UIShell/SwitcherItem.js +4 -2
  120. package/es/internal/FloatingMenu.js +7 -1
  121. package/es/internal/Selection.js +12 -3
  122. package/es/internal/useMergedRefs.js +1 -0
  123. package/es/internal/useNoInteractiveChildren.js +4 -0
  124. package/es/internal/useOutsideClick.js +1 -0
  125. package/es/internal/useOverflowItems.js +6 -0
  126. package/es/internal/useResizeObserver.js +4 -0
  127. package/es/internal/useSavedCallback.js +1 -0
  128. package/es/internal/warning.js +1 -0
  129. package/es/prop-types/isRequiredOneOf.js +4 -1
  130. package/es/tools/events.js +3 -1
  131. package/es/tools/wrapComponent.js +1 -0
  132. package/lib/components/AILabel/index.js +8 -6
  133. package/lib/components/Breadcrumb/BreadcrumbItem.js +2 -0
  134. package/lib/components/Button/Button.js +3 -0
  135. package/lib/components/ChatButton/ChatButton.js +1 -0
  136. package/lib/components/CheckboxGroup/CheckboxGroup.js +20 -1
  137. package/lib/components/ComboBox/ComboBox.js +17 -1
  138. package/lib/components/ComboButton/index.js +1 -0
  139. package/lib/components/ComposedModal/ComposedModal.js +18 -4
  140. package/lib/components/DataTable/DataTable.d.ts +3 -8
  141. package/lib/components/DataTable/DataTable.js +14 -0
  142. package/lib/components/DataTable/Table.js +3 -3
  143. package/lib/components/DataTable/TableExpandHeader.js +5 -1
  144. package/lib/components/DataTable/TableExpandRow.d.ts +33 -5
  145. package/lib/components/DataTable/TableExpandRow.js +5 -2
  146. package/lib/components/DataTable/TableHeader.d.ts +1 -2
  147. package/lib/components/DataTable/TableHeader.js +3 -2
  148. package/lib/components/DataTable/TableRow.d.ts +3 -6
  149. package/lib/components/DataTable/TableRow.js +39 -21
  150. package/lib/components/DataTable/TableSlugRow.js +1 -0
  151. package/lib/components/DataTable/TableToolbarMenu.js +3 -0
  152. package/lib/components/DataTable/state/sorting.d.ts +57 -14
  153. package/lib/components/DataTable/state/sorting.js +41 -50
  154. package/lib/components/DataTable/tools/sorting.js +5 -0
  155. package/lib/components/DatePicker/DatePicker.js +14 -3
  156. package/lib/components/DatePickerInput/DatePickerInput.js +6 -0
  157. package/lib/components/Dialog/Dialog.js +10 -2
  158. package/lib/components/Dropdown/Dropdown.js +16 -4
  159. package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +1 -0
  160. package/lib/components/FileUploader/FileUploader.js +9 -2
  161. package/lib/components/FileUploader/FileUploaderButton.js +1 -1
  162. package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
  163. package/lib/components/FileUploader/FileUploaderItem.js +3 -0
  164. package/lib/components/FluidMultiSelect/FluidMultiSelect.js +2 -0
  165. package/lib/components/FluidNumberInput/FluidNumberInput.js +3 -2
  166. package/lib/components/FluidSearch/FluidSearch.js +3 -2
  167. package/lib/components/FluidSelect/FluidSelect.js +3 -2
  168. package/lib/components/FluidTextInput/FluidTextInput.js +3 -2
  169. package/lib/components/FluidTimePicker/FluidTimePicker.js +11 -4
  170. package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +3 -2
  171. package/lib/components/Grid/CSSGrid.js +5 -0
  172. package/lib/components/Grid/Column.js +3 -0
  173. package/lib/components/Grid/ColumnHang.js +1 -0
  174. package/lib/components/Grid/FlexGrid.js +1 -0
  175. package/lib/components/Grid/Row.js +1 -0
  176. package/lib/components/Heading/index.js +3 -1
  177. package/lib/components/IconButton/index.js +4 -2
  178. package/lib/components/IconIndicator/index.js +4 -2
  179. package/lib/components/InlineCheckbox/InlineCheckbox.js +3 -2
  180. package/lib/components/Layout/index.js +6 -4
  181. package/lib/components/LayoutDirection/LayoutDirection.js +2 -0
  182. package/lib/components/Link/Link.js +3 -0
  183. package/lib/components/ListBox/ListBoxMenuItem.js +4 -1
  184. package/lib/components/ListBox/next/ListBoxTrigger.js +3 -2
  185. package/lib/components/Menu/Menu.js +6 -9
  186. package/lib/components/Menu/MenuContext.js +1 -0
  187. package/lib/components/Menu/MenuItem.js +5 -13
  188. package/lib/components/MenuButton/index.js +7 -2
  189. package/lib/components/Modal/Modal.js +15 -6
  190. package/lib/components/ModalWrapper/ModalWrapper.js +2 -0
  191. package/lib/components/MultiSelect/FilterableMultiSelect.js +24 -5
  192. package/lib/components/MultiSelect/MultiSelect.js +21 -5
  193. package/lib/components/Notification/Notification.js +1 -1
  194. package/lib/components/NumberInput/NumberInput.js +17 -6
  195. package/lib/components/OverflowMenu/OverflowMenu.js +2 -0
  196. package/lib/components/OverflowMenu/next/index.js +3 -2
  197. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +2 -0
  198. package/lib/components/PageHeader/PageHeader.d.ts +3 -3
  199. package/lib/components/PageHeader/PageHeader.js +22 -8
  200. package/lib/components/Pagination/Pagination.js +6 -2
  201. package/lib/components/PaginationNav/PaginationNav.js +2 -5
  202. package/lib/components/Popover/index.js +20 -6
  203. package/lib/components/ProgressBar/ProgressBar.js +4 -2
  204. package/lib/components/RadioTile/RadioTile.js +2 -2
  205. package/lib/components/Search/Search.js +2 -2
  206. package/lib/components/Select/Select.js +2 -3
  207. package/lib/components/ShapeIndicator/index.js +4 -2
  208. package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +4 -4
  209. package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +1 -2
  210. package/lib/components/SkeletonText/SkeletonText.js +0 -2
  211. package/lib/components/Slider/Slider.js +11 -16
  212. package/lib/components/Stack/HStack.js +1 -0
  213. package/lib/components/Stack/Stack.js +6 -9
  214. package/lib/components/Stack/VStack.js +1 -0
  215. package/lib/components/StructuredList/StructuredList.js +3 -0
  216. package/lib/components/Switch/Switch.js +1 -1
  217. package/lib/components/Tabs/Tabs.js +28 -17
  218. package/lib/components/Tag/DismissibleTag.d.ts +5 -0
  219. package/lib/components/Tag/DismissibleTag.js +8 -1
  220. package/lib/components/Tag/OperationalTag.js +2 -0
  221. package/lib/components/Tag/SelectableTag.js +2 -0
  222. package/lib/components/Tag/Tag.js +4 -0
  223. package/lib/components/Tag/isEllipsisActive.js +1 -0
  224. package/lib/components/Text/Text.js +1 -0
  225. package/lib/components/TextInput/ControlledPasswordInput.js +2 -4
  226. package/lib/components/TextInput/PasswordInput.js +7 -2
  227. package/lib/components/TextInput/TextInput.js +4 -2
  228. package/lib/components/Theme/index.js +8 -3
  229. package/lib/components/Tile/Tile.js +14 -17
  230. package/lib/components/TimePicker/TimePicker.js +1 -0
  231. package/lib/components/Toggle/Toggle.js +1 -1
  232. package/lib/components/Toggletip/index.js +22 -7
  233. package/lib/components/Tooltip/DefinitionTooltip.js +1 -0
  234. package/lib/components/Tooltip/Tooltip.js +30 -23
  235. package/lib/components/TreeView/TreeNode.d.ts +28 -0
  236. package/lib/components/TreeView/TreeNode.js +19 -10
  237. package/lib/components/TreeView/TreeView.js +7 -0
  238. package/lib/components/UIShell/HeaderContainer.js +3 -1
  239. package/lib/components/UIShell/HeaderGlobalAction.js +2 -2
  240. package/lib/components/UIShell/HeaderMenu.js +3 -3
  241. package/lib/components/UIShell/HeaderPanel.js +2 -2
  242. package/lib/components/UIShell/Link.js +2 -0
  243. package/lib/components/UIShell/SideNavItems.js +1 -0
  244. package/lib/components/UIShell/SideNavMenu.js +2 -2
  245. package/lib/components/UIShell/SideNavMenuItem.js +1 -1
  246. package/lib/components/UIShell/SideNavSwitcher.js +1 -1
  247. package/lib/components/UIShell/Switcher.js +2 -1
  248. package/lib/components/UIShell/SwitcherItem.js +4 -2
  249. package/lib/internal/FloatingMenu.js +7 -1
  250. package/lib/internal/Selection.js +12 -3
  251. package/lib/internal/useMergedRefs.js +1 -0
  252. package/lib/internal/useNoInteractiveChildren.js +4 -0
  253. package/lib/internal/useOutsideClick.js +1 -0
  254. package/lib/internal/useOverflowItems.js +6 -0
  255. package/lib/internal/useResizeObserver.js +4 -0
  256. package/lib/internal/useSavedCallback.js +1 -0
  257. package/lib/internal/warning.js +1 -0
  258. package/lib/prop-types/isRequiredOneOf.js +4 -1
  259. package/lib/tools/events.js +3 -1
  260. package/lib/tools/wrapComponent.js +1 -0
  261. package/package.json +11 -11
  262. package/telemetry.yml +14 -0
@@ -16,7 +16,7 @@ import { usePrefix } from '../../internal/usePrefix.js';
16
16
  import { SideNavContext } from './SideNav.js';
17
17
 
18
18
  var _ChevronDown;
19
- const SideNavMenu = /*#__PURE__*/React.forwardRef(function SideNavMenu({
19
+ const SideNavMenu = /*#__PURE__*/React.forwardRef(({
20
20
  className: customClassName,
21
21
  children,
22
22
  defaultExpanded = false,
@@ -26,7 +26,7 @@ const SideNavMenu = /*#__PURE__*/React.forwardRef(function SideNavMenu({
26
26
  isSideNavExpanded,
27
27
  tabIndex,
28
28
  title
29
- }, ref) {
29
+ }, ref) => {
30
30
  const {
31
31
  isRail
32
32
  } = useContext(SideNavContext);
@@ -13,7 +13,7 @@ import SideNavLinkText from './SideNavLinkText.js';
13
13
  import Link from './Link.js';
14
14
  import { usePrefix } from '../../internal/usePrefix.js';
15
15
 
16
- const SideNavMenuItem = /*#__PURE__*/React.forwardRef(function SideNavMenuItem(props, ref) {
16
+ const SideNavMenuItem = /*#__PURE__*/React.forwardRef((props, ref) => {
17
17
  const prefix = usePrefix();
18
18
  const {
19
19
  children,
@@ -13,7 +13,7 @@ import { useId } from '../../internal/useId.js';
13
13
  import { usePrefix } from '../../internal/usePrefix.js';
14
14
 
15
15
  var _ChevronDown;
16
- const SideNavSwitcher = /*#__PURE__*/forwardRef(function SideNavSwitcher(props, ref) {
16
+ const SideNavSwitcher = /*#__PURE__*/forwardRef((props, ref) => {
17
17
  const id = useId('side-nav-switcher');
18
18
  const prefix = usePrefix();
19
19
  const {
@@ -41,7 +41,7 @@ import './SideNavMenu.js';
41
41
  import './SideNavMenuItem.js';
42
42
  import './SideNavSwitcher.js';
43
43
 
44
- const Switcher = /*#__PURE__*/forwardRef(function Switcher(props, forwardRef) {
44
+ const Switcher = /*#__PURE__*/forwardRef((props, forwardRef) => {
45
45
  const switcherRef = useRef(null);
46
46
  const ref = useMergedRefs([switcherRef, forwardRef]);
47
47
  const prefix = usePrefix();
@@ -81,6 +81,7 @@ const Switcher = /*#__PURE__*/forwardRef(function Switcher(props, forwardRef) {
81
81
  if (direction === 1) {
82
82
  return enabledIndices[1];
83
83
  }
84
+ // eslint-disable-next-line no-fallthrough -- https://github.com/carbon-design-system/carbon/issues/20071
84
85
  default:
85
86
  return enabledIndices[nextIndex];
86
87
  }
@@ -15,7 +15,7 @@ import { ArrowDown, ArrowUp } from '../../internal/keyboard/keys.js';
15
15
  import { match } from '../../internal/keyboard/match.js';
16
16
  import { AriaLabelPropType } from '../../prop-types/AriaPropTypes.js';
17
17
 
18
- const SwitcherItem = /*#__PURE__*/forwardRef(function SwitcherItem(props, forwardRef) {
18
+ const SwitcherItem = /*#__PURE__*/forwardRef((props, forwardRef) => {
19
19
  const {
20
20
  'aria-label': ariaLabel,
21
21
  'aria-labelledby': ariaLabelledBy,
@@ -68,7 +68,9 @@ const SwitcherItem = /*#__PURE__*/forwardRef(function SwitcherItem(props, forwar
68
68
  },
69
69
  href: href,
70
70
  target: target,
71
- rel: rel,
71
+ rel: rel
72
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
73
+ ,
72
74
  ref: forwardRef
73
75
  }, rest, {
74
76
  className: linkClassName,
@@ -198,6 +198,7 @@ const FloatingMenu = ({
198
198
  }
199
199
  placeInProgressRef.current = false;
200
200
  }
201
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
201
202
  }, [floatingPosition, onPlace]);
202
203
 
203
204
  // Attach a resize listener.
@@ -208,11 +209,13 @@ const FloatingMenu = ({
208
209
  return () => {
209
210
  resizeHandler.remove();
210
211
  };
212
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
211
213
  }, [triggerRef, menuOffset, menuDirection, flipped, target, updateOrientation]);
212
214
 
213
215
  // Update menu position when key props change.
214
216
  useEffect(() => {
215
217
  updateMenuPosition();
218
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
216
219
  }, [menuOffset, menuDirection, flipped, triggerRef, target, updateOrientation]);
217
220
 
218
221
  /**
@@ -274,7 +277,10 @@ const FloatingMenu = ({
274
277
  const focusTrapWithoutSentinels = FeatureFlags.enabled('enable-experimental-focus-wrap-without-sentinels');
275
278
  if (typeof document !== 'undefined') {
276
279
  const portalTarget = target ? target() : document.body;
277
- return /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/React.createElement("div", {
280
+ return /*#__PURE__*/ReactDOM.createPortal(
281
+ /*#__PURE__*/
282
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions -- https://github.com/carbon-design-system/carbon/issues/20071
283
+ React.createElement("div", {
278
284
  onBlur: focusTrap && !focusTrapWithoutSentinels ? handleBlur : undefined,
279
285
  onKeyDown: focusTrapWithoutSentinels ? handleKeyDown : undefined
280
286
  }, !focusTrapWithoutSentinels && /*#__PURE__*/React.createElement("span", {
@@ -42,21 +42,28 @@ const useSelection = ({
42
42
  const savedOnChange = useRef(onChange);
43
43
  const [uncontrolledItems, setUncontrolledItems] = useState(initialSelectedItems);
44
44
  const isControlled = !!controlledItems;
45
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20071
45
46
  const selectedItems = isControlled ? controlledItems : uncontrolledItems;
46
47
  const onItemChange = useCallback(item => {
47
48
  if (disabled) return;
48
49
 
49
50
  // Assert special properties (e.g., `disabled`, `isSelectAll`, etc.) are
50
51
  // `any` since those properties aren’t part of the generic type.
51
- const allSelectableItems = filteredItems.filter(item => !item?.disabled && !item?.isSelectAll);
52
- const disabledItemCount = filteredItems.filter(item => item?.disabled).length;
52
+ const allSelectableItems = filteredItems.filter(
53
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
54
+ item => !item?.disabled && !item?.isSelectAll);
55
+ const disabledItemCount = filteredItems.filter(
56
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
57
+ item => item?.disabled).length;
53
58
  let newSelectedItems;
54
59
 
55
60
  // deselect all on click to All/indeterminate option
61
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
56
62
  if (item?.isSelectAll && selectedItems.length > 0) {
57
63
  newSelectedItems = [];
58
64
  }
59
65
  // select all options
66
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
60
67
  else if (item?.isSelectAll && selectedItems.length === 0) {
61
68
  newSelectedItems = allSelectableItems;
62
69
  } else {
@@ -69,7 +76,9 @@ const useSelection = ({
69
76
  }
70
77
  } else {
71
78
  newSelectedItems = removeAtIndex(selectedItems, selectedIndex);
72
- newSelectedItems = newSelectedItems.filter(item => !item?.isSelectAll);
79
+ newSelectedItems = newSelectedItems.filter(
80
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
81
+ item => !item?.isSelectAll);
73
82
  }
74
83
  }
75
84
  callOnChangeHandler({
@@ -16,6 +16,7 @@ import { useMemo, useCallback } from 'react';
16
16
  * node, assigns that node to every ref in the array.
17
17
  */
18
18
  const useMergedRefs = refs => {
19
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
19
20
  const memoizedRefs = useMemo(() => refs, refs);
20
21
  return useCallback(node => {
21
22
  memoizedRefs.forEach(ref => {
@@ -14,13 +14,16 @@ const useNoInteractiveChildren = (ref, message = 'component should have no inter
14
14
  /*
15
15
  // eslint-disable-next-line react-hooks/rules-of-hooks
16
16
  */
17
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
17
18
  useEffect(() => {
18
19
  const node = ref.current ? getInteractiveContent(ref.current) : false;
19
20
  if (node) {
20
21
  const errorMessage = `Error: ${message}.\n\nInstead found: ${node.outerHTML}`;
22
+ // eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
21
23
  console.error(errorMessage);
22
24
  throw new Error(errorMessage);
23
25
  }
26
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
24
27
  }, []);
25
28
  }
26
29
  };
@@ -31,6 +34,7 @@ const useInteractiveChildrenNeedDescription = (ref, message = `interactive child
31
34
  /*
32
35
  // eslint-disable-next-line react-hooks/rules-of-hooks
33
36
  */
37
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
34
38
  useEffect(() => {
35
39
  const node = ref.current ? getInteractiveContent(ref.current) : false;
36
40
  if (node && !node.hasAttribute('aria-describedby')) {
@@ -23,6 +23,7 @@ const useOutsideClick = (ref, callback) => {
23
23
  /*
24
24
  // eslint-disable-next-line react-hooks/rules-of-hooks
25
25
  */
26
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
26
27
  useWindowEvent('click', event => {
27
28
  const {
28
29
  target
@@ -36,6 +36,7 @@ const useOverflowItems = (items, containerRef, offsetRef, maxItems, onChange) =>
36
36
  setMaxWidth(newMax);
37
37
  }
38
38
  };
39
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
39
40
  useResizeObserver({
40
41
  ref: containerRef,
41
42
  onResize: handleResize
@@ -85,14 +86,17 @@ const useOverflowItems = (items, containerRef, offsetRef, maxItems, onChange) =>
85
86
  };
86
87
 
87
88
  // Memoize visible items calculation to avoid recalculating on every render
89
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
88
90
  const visibleItems = useMemo(() => {
89
91
  if (!Array.isArray(items)) {
90
92
  return [];
91
93
  }
92
94
  return getVisibleItems();
95
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
93
96
  }, [items, maxWidth, maxItems]);
94
97
 
95
98
  // Memoize hidden items calculation
99
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
96
100
  const hiddenItems = useMemo(() => {
97
101
  if (!Array.isArray(items)) {
98
102
  return [];
@@ -101,9 +105,11 @@ const useOverflowItems = (items, containerRef, offsetRef, maxItems, onChange) =>
101
105
  }, [items, visibleItems]);
102
106
 
103
107
  // Use previous value to compare and only call onChange when needed
108
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
104
109
  const previousHiddenItems = usePreviousValue(hiddenItems);
105
110
 
106
111
  // Only call onChange if hidden items actually changed
112
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
107
113
  useEffect(() => {
108
114
  }, [hiddenItems, previousHiddenItems, onChange]);
109
115
  return {
@@ -35,6 +35,7 @@ const useResizeObserver = ({
35
35
  return;
36
36
  }
37
37
  getInitialSize();
38
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
38
39
  }, [width, height]);
39
40
  useLayoutEffect(() => {
40
41
  if (!ref?.current) {
@@ -47,6 +48,8 @@ const useResizeObserver = ({
47
48
  const entry = entriesToHandle.current[0];
48
49
  setWidth(entry.contentRect.width);
49
50
  setHeight(entry.contentRect.height);
51
+
52
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
50
53
  cb.current && cb.current(entry.contentRect);
51
54
  };
52
55
  const observer = new ResizeObserver(entries => {
@@ -63,6 +66,7 @@ const useResizeObserver = ({
63
66
  return () => {
64
67
  observer.disconnect();
65
68
  };
69
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
66
70
  }, []);
67
71
  return {
68
72
  width,
@@ -15,6 +15,7 @@ import { useRef, useEffect, useCallback } from 'react';
15
15
  *
16
16
  * @param callback - The callback to track.
17
17
  */
18
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
18
19
  const useSavedCallback = callback => {
19
20
  const savedCallback = useRef(callback);
20
21
  useEffect(() => {
@@ -22,6 +22,7 @@ const warning = process.env.NODE_ENV !== 'production' ? (condition, message) =>
22
22
  throw new Error('`warning(condition, message)` requires a warning ' + 'format argument');
23
23
  }
24
24
  if (!condition) {
25
+ // eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
25
26
  console.warn('Warning: ' + message);
26
27
  }
27
28
  } : noopFn;
@@ -13,9 +13,12 @@
13
13
  * are the names of the props, and the values are the prop-type validators.
14
14
  * @returns A new object of wrapped prop-type validators.
15
15
  */
16
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
16
17
  const isRequiredOneOf = propTypes => {
17
18
  const names = Object.keys(propTypes);
18
- const checker = propType => (props, propName, componentName, ...rest) => {
19
+ const checker = propType =>
20
+ // eslint-disable-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
21
+ (props, propName, componentName, ...rest) => {
19
22
  if (process.env.NODE_ENV !== 'production' && names.every(name => typeof props[name] === 'undefined')) {
20
23
  return new Error(`${componentName} requires one of the following props: ${names.join(', ')}`);
21
24
  }
@@ -14,7 +14,9 @@
14
14
  * @param handlers - An array of event handler functions.
15
15
  * @returns A composite event handler.
16
16
  */
17
- const composeEventHandlers = handlers => (event, ...args) => {
17
+ const composeEventHandlers = handlers =>
18
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
19
+ (event, ...args) => {
18
20
  for (const handler of handlers) {
19
21
  if (event.defaultPrevented) {
20
22
  break;
@@ -42,6 +42,7 @@ const wrapComponent = ({
42
42
  Component.propTypes = {
43
43
  className: PropTypes.string
44
44
  };
45
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
45
46
  return Component;
46
47
  };
47
48
 
@@ -21,17 +21,19 @@ var deprecate = require('../../prop-types/deprecate.js');
21
21
  var _Undo;
22
22
  const AILabelContent = /*#__PURE__*/React.forwardRef(function AILabelContent({
23
23
  className,
24
- children,
25
- ...rest
26
- }, ref) {
24
+ children
25
+ }, ref // eslint-disable-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
26
+ ) {
27
27
  const prefix = usePrefix.usePrefix();
28
28
  const hasAILabelActions = React.Children.toArray(children).some(child => {
29
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
29
30
  const item = child;
30
31
  // TODO: Is there supposed to be a `return` here? If so, this issue would
31
32
  // have been caught by ESLint. It's concerning that this code is 7 months
32
33
  // old and no one has noticed any issues with it. It also makes me question
33
34
  // whether the code is necessary.
34
35
  // https://github.com/carbon-design-system/carbon/issues/18991
36
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
35
37
  item.type === AILabelActions;
36
38
  });
37
39
  const aiLabelContentClasses = cx(className, {
@@ -55,9 +57,9 @@ AILabelContent.propTypes = {
55
57
  };
56
58
  const AILabelActions = /*#__PURE__*/React.forwardRef(function AILabelActions({
57
59
  className,
58
- children,
59
- ...rest
60
- }, ref) {
60
+ children
61
+ }, ref // eslint-disable-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
62
+ ) {
61
63
  const prefix = usePrefix.usePrefix();
62
64
  const aiLabelActionsClasses = cx(className, {
63
65
  [`${prefix}--ai-label-actions`]: true
@@ -37,6 +37,8 @@ const BreadcrumbItem = frFn((props, ref) => {
37
37
  [`${prefix}--breadcrumb-item--current`]: isCurrentPage && ariaCurrent !== 'page',
38
38
  [customClassName]: !!customClassName
39
39
  });
40
+
41
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
40
42
  const child = children;
41
43
  if (child.type && child.type.displayName !== undefined && child.type.displayName.includes('OverflowMenu')) {
42
44
  const horizontalOverflowIcon = /*#__PURE__*/React.createElement(iconsReact.OverflowMenuHorizontal, {
@@ -25,6 +25,8 @@ function isIconOnlyButton(hasIconOnly, _kind) {
25
25
  }
26
26
  return false;
27
27
  }
28
+
29
+ // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
28
30
  const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
29
31
  const {
30
32
  as,
@@ -47,6 +49,7 @@ const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
47
49
  ...rest
48
50
  } = props;
49
51
  if (ButtonImageElement && !children && !iconDescription) {
52
+ // eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
50
53
  console.error('Button: renderIcon property specified without also providing an iconDescription property. ' + 'This may impact accessibility for screen reader users.');
51
54
  }
52
55
  const iconOnlyImage = !ButtonImageElement ? null : /*#__PURE__*/React.createElement(ButtonImageElement, null);
@@ -42,6 +42,7 @@ const ChatButton = /*#__PURE__*/React.forwardRef(function ChatButton({
42
42
  } else {
43
43
  // Check if size is valid and warn if not
44
44
  if (size && !allowedSizes.includes(size)) {
45
+ // eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
45
46
  console.error(`Invalid size "${size}" provided to ChatButton. Size must be one of: ${allowedSizes.join(', ')}. Defaulting to "lg".`);
46
47
  size = 'lg';
47
48
  }
@@ -19,6 +19,8 @@ var iconsReact = require('@carbon/icons-react');
19
19
  var useId = require('../../internal/useId.js');
20
20
  var index = require('../AILabel/index.js');
21
21
  var utils = require('../../internal/utils.js');
22
+ var Checkbox = require('../Checkbox/Checkbox.js');
23
+ require('../Checkbox/Checkbox.Skeleton.js');
22
24
 
23
25
  const CheckboxGroup = ({
24
26
  children,
@@ -61,6 +63,23 @@ const CheckboxGroup = ({
61
63
  size: 'mini',
62
64
  kind: 'default'
63
65
  }) : null;
66
+ const clonedChildren = React.Children.map(children, child => {
67
+ if (/*#__PURE__*/React.isValidElement(child) && child.type === Checkbox.default) {
68
+ const childProps = {
69
+ ...(typeof invalid !== 'undefined' && typeof child.props.invalid === 'undefined' ? {
70
+ invalid
71
+ } : {}),
72
+ ...(typeof readOnly !== 'undefined' && typeof child.props.readOnly === 'undefined' ? {
73
+ readOnly
74
+ } : {}),
75
+ ...(typeof warn !== 'undefined' && typeof child.props.warn === 'undefined' ? {
76
+ warn
77
+ } : {})
78
+ };
79
+ return Object.keys(childProps).length ? /*#__PURE__*/React.cloneElement(child, childProps) : child;
80
+ }
81
+ return child;
82
+ });
64
83
  return /*#__PURE__*/React.createElement("fieldset", _rollupPluginBabelHelpers.extends({
65
84
  className: fieldsetClasses,
66
85
  "data-invalid": invalid ? true : undefined,
@@ -72,7 +91,7 @@ const CheckboxGroup = ({
72
91
  id: legendId || rest['aria-labelledby']
73
92
  }, legendText, slug ? normalizedDecorator : decorator ? /*#__PURE__*/React.createElement("div", {
74
93
  className: `${prefix}--checkbox-group-inner--decorator`
75
- }, normalizedDecorator) : ''), children, /*#__PURE__*/React.createElement("div", {
94
+ }, normalizedDecorator) : ''), clonedChildren, /*#__PURE__*/React.createElement("div", {
76
95
  className: `${prefix}--checkbox-group__validation-msg`
77
96
  }, !readOnly && invalid && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(iconsReact.WarningFilled, {
78
97
  className: `${prefix}--checkbox__invalid-icon`
@@ -184,6 +184,7 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
184
184
  refs.floating.current.style.width = parentWidth + 'px';
185
185
  }
186
186
  }
187
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
187
188
  }, [enableFloatingStyles, floatingStyles, refs.floating, parentWidth]);
188
189
  const [inputValue, setInputValue] = React.useState(getInputValue({
189
190
  initialSelectedItem,
@@ -213,6 +214,7 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
213
214
  }
214
215
  prevInputLengthRef.current = inputValue.length;
215
216
  }
217
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
216
218
  }, [typeahead, inputValue, items, itemToString, autocompleteCustomFilter]);
217
219
  const isManualClearingRef = React.useRef(false);
218
220
  const [isClearing, setIsClearing] = React.useState(false);
@@ -253,6 +255,7 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
253
255
  }
254
256
  prevSelectedItemProp.current = selectedItemProp;
255
257
  }
258
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
256
259
  }, [selectedItemProp]);
257
260
  const filterItems = (items, itemToString, inputValue) => items.filter(item => typeahead ? autocompleteCustomFilter({
258
261
  item: itemToString(item),
@@ -267,8 +270,10 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
267
270
  React.useEffect(() => {
268
271
  if (prevInputValue.current !== inputValue) {
269
272
  prevInputValue.current = inputValue;
273
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
270
274
  onInputChange && onInputChange(inputValue);
271
275
  }
276
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
272
277
  }, [inputValue]);
273
278
  const handleSelectionClear = () => {
274
279
  if (textInput?.current) {
@@ -321,6 +326,8 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
321
326
  if (state.highlightedIndex !== -1) {
322
327
  const filteredList = filterItems(items, itemToString, inputValue);
323
328
  const highlightedItem = filteredList[state.highlightedIndex];
329
+
330
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
324
331
  if (highlightedItem && !highlightedItem.disabled) {
325
332
  return {
326
333
  ...changes,
@@ -332,6 +339,8 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
332
339
  const autoIndex = indexToHighlight(inputValue);
333
340
  if (autoIndex !== -1) {
334
341
  const matchingItem = items[autoIndex];
342
+
343
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
335
344
  if (matchingItem && !matchingItem.disabled) {
336
345
  return {
337
346
  ...changes,
@@ -484,8 +493,10 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
484
493
  onHighlightedIndexChange: ({
485
494
  highlightedIndex
486
495
  }) => {
496
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion , valid-typeof , no-constant-binary-expression -- https://github.com/carbon-design-system/carbon/issues/20071
487
497
  if (highlightedIndex > -1 && typeof window !== undefined) {
488
498
  const itemArray = document.querySelectorAll(`li.${prefix}--list-box__menu-item[role="option"]`);
499
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20071
489
500
  const highlightedItem = itemArray[highlightedIndex];
490
501
  if (highlightedItem) {
491
502
  highlightedItem.scrollIntoView({
@@ -498,7 +509,9 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
498
509
  initialSelectedItem: initialSelectedItem,
499
510
  inputId: id,
500
511
  stateReducer,
512
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
501
513
  isItemDisabled(item, _index) {
514
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
502
515
  return item?.disabled;
503
516
  },
504
517
  ...downshiftProps,
@@ -535,6 +548,7 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
535
548
  toggleMenu
536
549
  };
537
550
  }
551
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
538
552
  }, [closeMenu, openMenu, reset, selectItem, setHighlightedIndex, downshiftSetInputValue, toggleMenu]);
539
553
  const buttonProps = getToggleButtonProps({
540
554
  disabled: disabled || readOnly,
@@ -583,7 +597,9 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
583
597
  // Memoize the value of getMenuProps to avoid an infinite loop
584
598
  const menuProps = React.useMemo(() => getMenuProps({
585
599
  ref: enableFloatingStyles ? refs.setFloating : null
586
- }), [enableFloatingStyles, deprecatedAriaLabel, ariaLabel, getMenuProps, refs.setFloating]);
600
+ }),
601
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
602
+ [enableFloatingStyles, deprecatedAriaLabel, ariaLabel, getMenuProps, refs.setFloating]);
587
603
  React.useEffect(() => {
588
604
  if (textInput.current) {
589
605
  if (inputRef.current && typeaheadText) {
@@ -56,6 +56,7 @@ const ComboButton = /*#__PURE__*/React.forwardRef(function ComboButton({
56
56
  const id = useId.useId('combobutton');
57
57
  const prefix = usePrefix.usePrefix();
58
58
  const containerRef = React.useRef(null);
59
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
59
60
  let middlewares = [];
60
61
  if (!enableOnlyFloatingStyles) {
61
62
  middlewares = [react.flip({
@@ -138,6 +138,7 @@ const ComposedModal = /*#__PURE__*/React.forwardRef(function ComposedModal({
138
138
  setWasOpen(!!open);
139
139
  toggleClass.toggleClass(document.body, `${prefix}--body--with-modal-open`, !!open);
140
140
  }
141
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
141
142
  }, [open, wasOpen, prefix]);
142
143
  // Remove the document.body className on unmount
143
144
  React.useEffect(() => {
@@ -170,9 +171,14 @@ const ComposedModal = /*#__PURE__*/React.forwardRef(function ComposedModal({
170
171
  } = evt;
171
172
  const mouseDownTarget = onMouseDownTarget.current;
172
173
  evt.stopPropagation();
173
- const containsModalFooter = React.Children.toArray(childrenWithProps).some(child => utils.isComponentElement(child, ModalFooter.ModalFooter));
174
- const isPassive = !containsModalFooter;
175
- const shouldCloseOnOutsideClick = isPassive ? preventCloseOnClickOutside !== false : preventCloseOnClickOutside === true;
174
+ const shouldCloseOnOutsideClick =
175
+ // Passive modals can close on clicks outside the modal when
176
+ // preventCloseOnClickOutside is undefined or explicitly set to false.
177
+ isPassive && !preventCloseOnClickOutside ||
178
+ // Non-passive modals have to explicitly opt-in for close on outside
179
+ // behavior by explicitly setting preventCloseOnClickOutside to false,
180
+ // rather than just leaving it undefined.
181
+ !isPassive && preventCloseOnClickOutside === false;
176
182
  if (shouldCloseOnOutsideClick && target instanceof Node && !wrapFocus.elementOrParentIsFloatingMenu(target, selectorsFloatingMenus) && innerModal.current && !innerModal.current.contains(target) && !innerModal.current.contains(mouseDownTarget)) {
177
183
  closeModal(evt);
178
184
  }
@@ -208,7 +214,7 @@ const ComposedModal = /*#__PURE__*/React.forwardRef(function ComposedModal({
208
214
  }
209
215
  const lastContent = modalContent.children[modalContent.children.length - 1];
210
216
  const gradientSpacing = modalContent.scrollHeight - lastContent.offsetTop - lastContent.clientHeight;
211
- for (let elem of modalContent.children) {
217
+ for (const elem of modalContent.children) {
212
218
  if (elem.contains(currentActiveNode)) {
213
219
  const spaceBelow = modalContent.clientHeight - elem.offsetTop + modalContent.scrollTop - elem.clientHeight;
214
220
  if (spaceBelow < gradientSpacing) {
@@ -256,6 +262,12 @@ const ComposedModal = /*#__PURE__*/React.forwardRef(function ComposedModal({
256
262
  return child;
257
263
  }
258
264
  });
265
+
266
+ // Modals without a footer are considered passive and carry limitations as
267
+ // outlined in the design spec.
268
+ const containsModalFooter = React.Children.toArray(childrenWithProps).some(child => utils.isComponentElement(child, ModalFooter.ModalFooter));
269
+ const isPassive = !containsModalFooter;
270
+ process.env.NODE_ENV !== "production" ? warning.warning(!(!isPassive && preventCloseOnClickOutside === false), '`<ComposedModal>` prop `preventCloseOnClickOutside` should not be ' + '`false` when `<ModalFooter>` is present. Transactional, non-passive ' + 'Modals should not be dissmissable by clicking outside. ' + 'See: https://carbondesignsystem.com/components/modal/usage/#transactional-modal') : void 0;
259
271
  React.useEffect(() => {
260
272
  if (!open) return;
261
273
  const handleEscapeKey = event => {
@@ -269,6 +281,7 @@ const ComposedModal = /*#__PURE__*/React.forwardRef(function ComposedModal({
269
281
  return () => {
270
282
  document.removeEventListener('keydown', handleEscapeKey, true);
271
283
  };
284
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
272
285
  }, [open]);
273
286
  React.useEffect(() => {
274
287
  if (!enableDialogElement && !open && launcherButtonRef) {
@@ -300,6 +313,7 @@ const ComposedModal = /*#__PURE__*/React.forwardRef(function ComposedModal({
300
313
  focusButton(innerModal.current);
301
314
  }
302
315
  }
316
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
303
317
  }, [open, selectorPrimaryFocus, isOpen]);
304
318
 
305
319
  // AILabel is always size `sm`
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
8
  import React, { type ChangeEvent, type MouseEvent, type ReactElement, type ReactNode } from 'react';
9
+ import { type SortRowFn } from './state/sorting';
9
10
  import type { DataTableSortState } from './state/sortStates';
10
11
  import { TranslateWithId } from '../../types/common';
11
12
  declare const translationKeys: {
@@ -181,13 +182,7 @@ export interface DataTableProps<RowType, ColTypes extends any[]> extends Transla
181
182
  render?: (renderProps: DataTableRenderProps<RowType, ColTypes>) => ReactElement;
182
183
  rows: Omit<DataTableRow<ColTypes>, 'cells'>[];
183
184
  size?: DataTableSize;
184
- sortRow?: (cellA: any, cellB: any, options: {
185
- sortDirection: DataTableSortState;
186
- sortStates: Record<DataTableSortState, DataTableSortState>;
187
- locale: string;
188
- key: string;
189
- compare: (a: number | string, b: number | string, locale?: string) => number;
190
- }) => number;
185
+ sortRow?: SortRowFn;
191
186
  stickyHeader?: boolean;
192
187
  useStaticWidth?: boolean;
193
188
  useZebraStyles?: boolean;
@@ -286,7 +281,7 @@ export declare const DataTable: {
286
281
  };
287
282
  TableHead: (props: React.HTMLAttributes<"thead">) => React.ReactElement<any>;
288
283
  TableHeader: React.ForwardRefExoticComponent<import("./TableHeader").TableHeaderProps & React.RefAttributes<HTMLTableCellElement>>;
289
- TableRow: React.ForwardRefExoticComponent<import("./TableRow").TableRowProps & React.RefAttributes<HTMLTableCellElement>>;
284
+ TableRow: React.ForwardRefExoticComponent<import("./TableRow").TableRowProps & React.RefAttributes<HTMLTableRowElement>>;
290
285
  TableSelectAll: {
291
286
  ({ ariaLabel: deprecatedAriaLabel, ["aria-label"]: ariaLabel, checked, id, indeterminate, name, onSelect, disabled, className, }: import("./TableSelectAll").TableSelectAllProps): import("react/jsx-runtime").JSX.Element;
292
287
  propTypes: {