@carbon/react 1.99.0 → 1.100.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 (277) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +978 -978
  2. package/es/components/BadgeIndicator/index.d.ts +1 -1
  3. package/es/components/BadgeIndicator/index.js +8 -6
  4. package/es/components/Breadcrumb/BreadcrumbItem.d.ts +1 -1
  5. package/es/components/Breadcrumb/BreadcrumbItem.js +6 -7
  6. package/es/components/Button/Button.Skeleton.d.ts +28 -2
  7. package/es/components/Button/Button.js +3 -2
  8. package/es/components/ChatButton/ChatButton.d.ts +3 -2
  9. package/es/components/CheckboxGroup/CheckboxGroup.d.ts +60 -2
  10. package/es/components/ComboBox/ComboBox.d.ts +6 -7
  11. package/es/components/ComboBox/ComboBox.js +22 -10
  12. package/es/components/ComposedModal/ComposedModal.d.ts +2 -2
  13. package/es/components/ContainedList/ContainedList.d.ts +35 -6
  14. package/es/components/ContainedList/ContainedList.js +3 -1
  15. package/es/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +32 -3
  16. package/es/components/ContainedList/index.d.ts +1 -1
  17. package/es/components/ContainedList/index.js +4 -1
  18. package/es/components/DangerButton/DangerButton.d.ts +1 -1
  19. package/es/components/DataTable/DataTable.d.ts +22 -5
  20. package/es/components/DataTable/DataTable.js +1 -1
  21. package/es/components/DataTable/TableExpandRow.d.ts +1 -1
  22. package/es/components/DataTable/TableExpandRow.js +2 -2
  23. package/es/components/DataTable/TableHeader.d.ts +1 -1
  24. package/es/components/DataTable/TableHeader.js +18 -16
  25. package/es/components/DataTable/TableToolbar.d.ts +25 -1
  26. package/es/components/DataTable/TableToolbarMenu.d.ts +25 -5
  27. package/es/components/DataTable/TableToolbarMenu.js +0 -3
  28. package/es/components/DataTableSkeleton/DataTableSkeleton.d.ts +51 -2
  29. package/es/components/DataTableSkeleton/DataTableSkeleton.js +6 -0
  30. package/es/components/DatePicker/DatePicker.d.ts +2 -2
  31. package/es/components/DatePicker/DatePicker.js +38 -53
  32. package/es/components/DatePicker/plugins/fixEventsPlugin.js +28 -2
  33. package/es/components/DatePickerInput/DatePickerInput.d.ts +1 -1
  34. package/es/components/DatePickerInput/DatePickerInput.js +3 -2
  35. package/es/components/Dialog/Dialog.d.ts +1 -1
  36. package/es/components/Dropdown/Dropdown.Skeleton.d.ts +19 -2
  37. package/es/components/Dropdown/Dropdown.d.ts +3 -4
  38. package/es/components/Dropdown/Dropdown.js +16 -13
  39. package/es/components/ExpandableSearch/ExpandableSearch.d.ts +1 -1
  40. package/es/components/ExpandableSearch/ExpandableSearch.js +14 -12
  41. package/es/components/FileUploader/FileUploader.d.ts +1 -1
  42. package/es/components/FileUploader/FileUploader.js +2 -2
  43. package/es/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
  44. package/es/components/FileUploader/FileUploaderDropContainer.js +28 -10
  45. package/es/components/FluidComboBox/FluidComboBox.Skeleton.d.ts +11 -3
  46. package/es/components/FluidComboBox/FluidComboBox.d.ts +2 -7
  47. package/es/components/FluidComboBox/FluidComboBox.js +1 -2
  48. package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.d.ts +15 -3
  49. package/es/components/FluidDatePicker/FluidDatePicker.d.ts +2 -2
  50. package/es/components/FluidDropdown/FluidDropdown.Skeleton.d.ts +11 -3
  51. package/es/components/FluidDropdown/FluidDropdown.d.ts +1 -6
  52. package/es/components/FluidDropdown/FluidDropdown.js +1 -2
  53. package/es/components/FluidForm/FluidForm.d.ts +15 -2
  54. package/es/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +2 -2
  55. package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.d.ts +11 -3
  56. package/es/components/FluidMultiSelect/FluidMultiSelect.d.ts +1 -6
  57. package/es/components/FluidMultiSelect/FluidMultiSelect.js +1 -2
  58. package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.d.ts +11 -3
  59. package/es/components/FluidNumberInput/FluidNumberInput.d.ts +1 -1
  60. package/es/components/FluidSearch/FluidSearch.Skeleton.d.ts +11 -3
  61. package/es/components/FluidSearch/FluidSearch.d.ts +1 -1
  62. package/es/components/FluidSearch/FluidSearch.js +3 -3
  63. package/es/components/FluidSelect/FluidSelect.Skeleton.d.ts +11 -3
  64. package/es/components/FluidTextArea/FluidTextArea.Skeleton.d.ts +11 -3
  65. package/es/components/FluidTextArea/FluidTextArea.d.ts +95 -1
  66. package/es/components/FluidTextInput/FluidPasswordInput.d.ts +83 -2
  67. package/es/components/FluidTextInput/FluidTextInput.Skeleton.d.ts +11 -3
  68. package/es/components/Grid/GridContext.d.ts +19 -1
  69. package/es/components/IconButton/index.d.ts +1 -1
  70. package/es/components/IconButton/index.js +2 -2
  71. package/es/components/InlineLoading/InlineLoading.js +5 -11
  72. package/es/components/Link/Link.js +3 -0
  73. package/es/components/ListBox/ListBoxField.d.ts +35 -2
  74. package/es/components/ListBox/ListBoxMenuIcon.d.ts +16 -3
  75. package/es/components/ListBox/ListBoxMenuItem.d.ts +1 -1
  76. package/es/components/ListBox/ListBoxSelection.d.ts +34 -3
  77. package/es/components/Menu/MenuItem.d.ts +2 -2
  78. package/es/components/MultiSelect/FilterableMultiSelect.d.ts +2 -2
  79. package/es/components/MultiSelect/FilterableMultiSelect.js +22 -13
  80. package/es/components/MultiSelect/MultiSelect.d.ts +3 -4
  81. package/es/components/MultiSelect/MultiSelect.js +24 -22
  82. package/es/components/Notification/Notification.d.ts +8 -7
  83. package/es/components/Notification/Notification.js +4 -4
  84. package/es/components/OverflowMenu/OverflowMenu.d.ts +1 -1
  85. package/es/components/OverflowMenu/OverflowMenu.js +0 -1
  86. package/es/components/OverflowMenu/index.d.ts +1 -1
  87. package/es/components/PageHeader/PageHeader.d.ts +3 -3
  88. package/es/components/Popover/index.js +21 -12
  89. package/es/components/Search/Search.d.ts +2 -2
  90. package/es/components/Select/Select.d.ts +1 -1
  91. package/es/components/Select/Select.js +2 -2
  92. package/es/components/SkeletonIcon/SkeletonIcon.d.ts +16 -2
  93. package/es/components/SkeletonText/SkeletonText.d.ts +1 -1
  94. package/es/components/Tag/Tag.d.ts +1 -1
  95. package/es/components/Tag/Tag.js +2 -0
  96. package/es/components/Text/Text.d.ts +1 -1
  97. package/es/components/Text/Text.js +4 -3
  98. package/es/components/Text/TextDirection.d.ts +1 -1
  99. package/es/components/Text/TextDirection.js +1 -3
  100. package/es/components/Text/TextDirectionContext.d.ts +3 -3
  101. package/es/components/TextArea/TextArea.js +1 -3
  102. package/es/components/TextInput/ControlledPasswordInput.d.ts +1 -1
  103. package/es/components/TextInput/ControlledPasswordInput.js +2 -2
  104. package/es/components/TextInput/PasswordInput.d.ts +1 -1
  105. package/es/components/TextInput/PasswordInput.js +2 -2
  106. package/es/components/TextInput/TextInput.d.ts +1 -1
  107. package/es/components/TextInput/TextInput.js +2 -2
  108. package/es/components/Tile/Tile.d.ts +1 -1
  109. package/es/components/Tile/Tile.js +37 -69
  110. package/es/components/Toggle/Toggle.Skeleton.d.ts +9 -3
  111. package/es/components/Toggletip/index.d.ts +1 -1
  112. package/es/components/Toggletip/index.js +9 -7
  113. package/es/components/Tooltip/DefinitionTooltip.d.ts +52 -1
  114. package/es/components/Tooltip/Tooltip.js +2 -0
  115. package/es/components/TreeView/TreeNode.d.ts +4 -4
  116. package/es/components/UIShell/Header.d.ts +20 -3
  117. package/es/components/UIShell/HeaderGlobalAction.d.ts +2 -2
  118. package/es/components/UIShell/HeaderName.js +1 -1
  119. package/es/components/UIShell/Link.d.ts +1 -1
  120. package/es/components/UIShell/Link.js +14 -14
  121. package/es/components/UIShell/SideNav.d.ts +3 -4
  122. package/es/components/UIShell/SideNav.js +37 -27
  123. package/es/components/UIShell/SideNavDivider.d.ts +11 -3
  124. package/es/components/UIShell/SideNavHeader.d.ts +24 -1
  125. package/es/components/UIShell/SideNavIcon.d.ts +20 -2
  126. package/es/components/UIShell/SideNavItem.d.ts +20 -2
  127. package/es/components/UIShell/SideNavItems.d.ts +22 -2
  128. package/es/components/UIShell/SideNavLink.d.ts +1 -1
  129. package/es/components/UIShell/SideNavLink.js +14 -14
  130. package/es/components/UIShell/SideNavMenu.d.ts +1 -1
  131. package/es/components/UIShell/SideNavMenu.js +2 -2
  132. package/es/components/UIShell/SideNavMenuItem.d.ts +2 -2
  133. package/es/components/UIShell/SideNavMenuItem.js +2 -2
  134. package/es/components/UIShell/SwitcherDivider.d.ts +10 -2
  135. package/es/internal/FloatingMenu.d.ts +1 -1
  136. package/es/internal/FloatingMenu.js +0 -2
  137. package/es/internal/PolymorphicProps.d.ts +3 -3
  138. package/es/internal/useNoInteractiveChildren.d.ts +1 -1
  139. package/es/internal/useNoInteractiveChildren.js +8 -10
  140. package/es/internal/useOutsideClick.d.ts +1 -1
  141. package/es/internal/useOutsideClick.js +0 -4
  142. package/lib/components/BadgeIndicator/index.d.ts +1 -1
  143. package/lib/components/BadgeIndicator/index.js +7 -5
  144. package/lib/components/Breadcrumb/BreadcrumbItem.d.ts +1 -1
  145. package/lib/components/Breadcrumb/BreadcrumbItem.js +5 -6
  146. package/lib/components/Button/Button.Skeleton.d.ts +28 -2
  147. package/lib/components/Button/Button.js +3 -2
  148. package/lib/components/ChatButton/ChatButton.d.ts +3 -2
  149. package/lib/components/CheckboxGroup/CheckboxGroup.d.ts +60 -2
  150. package/lib/components/ComboBox/ComboBox.d.ts +6 -7
  151. package/lib/components/ComboBox/ComboBox.js +22 -10
  152. package/lib/components/ComposedModal/ComposedModal.d.ts +2 -2
  153. package/lib/components/ContainedList/ContainedList.d.ts +35 -6
  154. package/lib/components/ContainedList/ContainedList.js +3 -1
  155. package/lib/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +32 -3
  156. package/lib/components/ContainedList/index.d.ts +1 -1
  157. package/lib/components/ContainedList/index.js +4 -1
  158. package/lib/components/DangerButton/DangerButton.d.ts +1 -1
  159. package/lib/components/DataTable/DataTable.d.ts +22 -5
  160. package/lib/components/DataTable/DataTable.js +1 -1
  161. package/lib/components/DataTable/TableExpandRow.d.ts +1 -1
  162. package/lib/components/DataTable/TableHeader.d.ts +1 -1
  163. package/lib/components/DataTable/TableHeader.js +17 -15
  164. package/lib/components/DataTable/TableToolbar.d.ts +25 -1
  165. package/lib/components/DataTable/TableToolbarMenu.d.ts +25 -5
  166. package/lib/components/DataTable/TableToolbarMenu.js +0 -3
  167. package/lib/components/DataTableSkeleton/DataTableSkeleton.d.ts +51 -2
  168. package/lib/components/DataTableSkeleton/DataTableSkeleton.js +6 -0
  169. package/lib/components/DatePicker/DatePicker.d.ts +2 -2
  170. package/lib/components/DatePicker/DatePicker.js +37 -52
  171. package/lib/components/DatePicker/plugins/fixEventsPlugin.js +28 -2
  172. package/lib/components/DatePickerInput/DatePickerInput.d.ts +1 -1
  173. package/lib/components/DatePickerInput/DatePickerInput.js +2 -1
  174. package/lib/components/Dialog/Dialog.d.ts +1 -1
  175. package/lib/components/Dropdown/Dropdown.Skeleton.d.ts +19 -2
  176. package/lib/components/Dropdown/Dropdown.d.ts +3 -4
  177. package/lib/components/Dropdown/Dropdown.js +16 -13
  178. package/lib/components/ExpandableSearch/ExpandableSearch.d.ts +1 -1
  179. package/lib/components/ExpandableSearch/ExpandableSearch.js +13 -11
  180. package/lib/components/FileUploader/FileUploader.d.ts +1 -1
  181. package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
  182. package/lib/components/FileUploader/FileUploaderDropContainer.js +28 -10
  183. package/lib/components/FluidComboBox/FluidComboBox.Skeleton.d.ts +11 -3
  184. package/lib/components/FluidComboBox/FluidComboBox.d.ts +2 -7
  185. package/lib/components/FluidComboBox/FluidComboBox.js +1 -2
  186. package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.d.ts +15 -3
  187. package/lib/components/FluidDatePicker/FluidDatePicker.d.ts +2 -2
  188. package/lib/components/FluidDropdown/FluidDropdown.Skeleton.d.ts +11 -3
  189. package/lib/components/FluidDropdown/FluidDropdown.d.ts +1 -6
  190. package/lib/components/FluidDropdown/FluidDropdown.js +1 -2
  191. package/lib/components/FluidForm/FluidForm.d.ts +15 -2
  192. package/lib/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +2 -2
  193. package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.d.ts +11 -3
  194. package/lib/components/FluidMultiSelect/FluidMultiSelect.d.ts +1 -6
  195. package/lib/components/FluidMultiSelect/FluidMultiSelect.js +1 -2
  196. package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.d.ts +11 -3
  197. package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +1 -1
  198. package/lib/components/FluidSearch/FluidSearch.Skeleton.d.ts +11 -3
  199. package/lib/components/FluidSearch/FluidSearch.d.ts +1 -1
  200. package/lib/components/FluidSearch/FluidSearch.js +2 -2
  201. package/lib/components/FluidSelect/FluidSelect.Skeleton.d.ts +11 -3
  202. package/lib/components/FluidTextArea/FluidTextArea.Skeleton.d.ts +11 -3
  203. package/lib/components/FluidTextArea/FluidTextArea.d.ts +95 -1
  204. package/lib/components/FluidTextInput/FluidPasswordInput.d.ts +83 -2
  205. package/lib/components/FluidTextInput/FluidTextInput.Skeleton.d.ts +11 -3
  206. package/lib/components/Grid/GridContext.d.ts +19 -1
  207. package/lib/components/IconButton/index.d.ts +1 -1
  208. package/lib/components/InlineLoading/InlineLoading.js +5 -11
  209. package/lib/components/Link/Link.js +3 -0
  210. package/lib/components/ListBox/ListBoxField.d.ts +35 -2
  211. package/lib/components/ListBox/ListBoxMenuIcon.d.ts +16 -3
  212. package/lib/components/ListBox/ListBoxMenuItem.d.ts +1 -1
  213. package/lib/components/ListBox/ListBoxSelection.d.ts +34 -3
  214. package/lib/components/Menu/MenuItem.d.ts +2 -2
  215. package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +2 -2
  216. package/lib/components/MultiSelect/FilterableMultiSelect.js +22 -13
  217. package/lib/components/MultiSelect/MultiSelect.d.ts +3 -4
  218. package/lib/components/MultiSelect/MultiSelect.js +24 -22
  219. package/lib/components/Notification/Notification.d.ts +8 -7
  220. package/lib/components/Notification/Notification.js +4 -4
  221. package/lib/components/OverflowMenu/OverflowMenu.d.ts +1 -1
  222. package/lib/components/OverflowMenu/OverflowMenu.js +0 -1
  223. package/lib/components/OverflowMenu/index.d.ts +1 -1
  224. package/lib/components/PageHeader/PageHeader.d.ts +3 -3
  225. package/lib/components/Popover/index.js +19 -10
  226. package/lib/components/Search/Search.d.ts +2 -2
  227. package/lib/components/Select/Select.d.ts +1 -1
  228. package/lib/components/SkeletonIcon/SkeletonIcon.d.ts +16 -2
  229. package/lib/components/SkeletonText/SkeletonText.d.ts +1 -1
  230. package/lib/components/Tag/Tag.d.ts +1 -1
  231. package/lib/components/Tag/Tag.js +2 -0
  232. package/lib/components/Text/Text.d.ts +1 -1
  233. package/lib/components/Text/Text.js +3 -2
  234. package/lib/components/Text/TextDirection.d.ts +1 -1
  235. package/lib/components/Text/TextDirection.js +1 -3
  236. package/lib/components/Text/TextDirectionContext.d.ts +3 -3
  237. package/lib/components/TextArea/TextArea.js +1 -3
  238. package/lib/components/TextInput/ControlledPasswordInput.d.ts +1 -1
  239. package/lib/components/TextInput/PasswordInput.d.ts +1 -1
  240. package/lib/components/TextInput/TextInput.d.ts +1 -1
  241. package/lib/components/Tile/Tile.d.ts +1 -1
  242. package/lib/components/Tile/Tile.js +35 -67
  243. package/lib/components/Toggle/Toggle.Skeleton.d.ts +9 -3
  244. package/lib/components/Toggletip/index.d.ts +1 -1
  245. package/lib/components/Toggletip/index.js +7 -5
  246. package/lib/components/Tooltip/DefinitionTooltip.d.ts +52 -1
  247. package/lib/components/Tooltip/Tooltip.js +2 -0
  248. package/lib/components/TreeView/TreeNode.d.ts +4 -4
  249. package/lib/components/UIShell/Header.d.ts +20 -3
  250. package/lib/components/UIShell/HeaderGlobalAction.d.ts +2 -2
  251. package/lib/components/UIShell/HeaderName.js +1 -1
  252. package/lib/components/UIShell/Link.d.ts +1 -1
  253. package/lib/components/UIShell/Link.js +13 -13
  254. package/lib/components/UIShell/SideNav.d.ts +3 -4
  255. package/lib/components/UIShell/SideNav.js +36 -26
  256. package/lib/components/UIShell/SideNavDivider.d.ts +11 -3
  257. package/lib/components/UIShell/SideNavHeader.d.ts +24 -1
  258. package/lib/components/UIShell/SideNavIcon.d.ts +20 -2
  259. package/lib/components/UIShell/SideNavItem.d.ts +20 -2
  260. package/lib/components/UIShell/SideNavItems.d.ts +22 -2
  261. package/lib/components/UIShell/SideNavLink.d.ts +1 -1
  262. package/lib/components/UIShell/SideNavLink.js +14 -14
  263. package/lib/components/UIShell/SideNavMenu.d.ts +1 -1
  264. package/lib/components/UIShell/SideNavMenuItem.d.ts +2 -2
  265. package/lib/components/UIShell/SwitcherDivider.d.ts +10 -2
  266. package/lib/internal/FloatingMenu.d.ts +1 -1
  267. package/lib/internal/FloatingMenu.js +0 -2
  268. package/lib/internal/PolymorphicProps.d.ts +3 -3
  269. package/lib/internal/useNoInteractiveChildren.d.ts +1 -1
  270. package/lib/internal/useNoInteractiveChildren.js +8 -10
  271. package/lib/internal/useOutsideClick.d.ts +1 -1
  272. package/lib/internal/useOutsideClick.js +0 -4
  273. package/package.json +7 -7
  274. package/scss/_carbon-utilities.scss +9 -0
  275. package/telemetry.yml +0 -1
  276. package/es/internal/createClassWrapper.d.ts +0 -12
  277. package/lib/internal/createClassWrapper.d.ts +0 -12
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
- import React, { useState, useEffect, useCallback, useRef, cloneElement } from 'react';
9
+ import React, { forwardRef, useState, useEffect, useCallback, useRef, cloneElement, Children } from 'react';
10
10
  import PropTypes from 'prop-types';
11
11
  import cx from 'classnames';
12
12
  import { AiLabel, CheckboxCheckedFilled, Checkbox, ChevronDown, ArrowRight, Error } from '@carbon/icons-react';
@@ -363,7 +363,7 @@ SelectableTile.propTypes = {
363
363
  */
364
364
  value: deprecate(PropTypes.oneOfType([PropTypes.string, PropTypes.number]), 'The `value` property is no longer used. It will be removed in the next major release.`')
365
365
  };
366
- const ExpandableTile = /*#__PURE__*/React.forwardRef(({
366
+ const ExpandableTile = /*#__PURE__*/forwardRef(({
367
367
  tabIndex = 0,
368
368
  className,
369
369
  children,
@@ -382,11 +382,8 @@ const ExpandableTile = /*#__PURE__*/React.forwardRef(({
382
382
  hasRoundedCorners,
383
383
  ...rest
384
384
  }, forwardRef) => {
385
- const [isTileMaxHeight, setIsTileMaxHeight] = useState(tileMaxHeight);
386
- const [isTilePadding, setIsTilePadding] = useState(tilePadding);
387
- const [prevExpanded, setPrevExpanded] = useState(expanded);
388
- const [prevTileMaxHeight, setPrevTileMaxHeight] = useState(tileMaxHeight);
389
- const [prevTilePadding, setPrevTilePadding] = useState(tilePadding);
385
+ const [measuredAboveHeight, setMeasuredAboveHeight] = useState(0);
386
+ const [measuredPadding, setMeasuredPadding] = useState(0);
390
387
  const [isExpanded, setIsExpanded] = useState(expanded);
391
388
  const [interactive, setInteractive] = useState(true);
392
389
  const aboveTheFold = useRef(null);
@@ -396,105 +393,74 @@ const ExpandableTile = /*#__PURE__*/React.forwardRef(({
396
393
  const tile = useRef(null);
397
394
  const ref = useMergedRefs([forwardRef, tile]);
398
395
  const prefix = usePrefix();
399
- if (expanded !== prevExpanded) {
396
+ useEffect(() => {
400
397
  setIsExpanded(expanded);
401
- setPrevExpanded(expanded);
402
- setMaxHeight();
403
- }
404
- if (tileMaxHeight !== prevTileMaxHeight) {
405
- setIsTileMaxHeight(tileMaxHeight);
406
- setPrevTileMaxHeight(tileMaxHeight);
407
- }
408
- if (tilePadding !== prevTilePadding) {
409
- setIsTilePadding(tilePadding);
410
- setPrevTilePadding(tilePadding);
411
- }
412
- function setMaxHeight() {
413
- if (isExpanded && tileContent.current) {
414
- setIsTileMaxHeight(tileContent.current.getBoundingClientRect()?.height);
415
- }
416
- if (aboveTheFold.current) {
417
- setIsTileMaxHeight(aboveTheFold.current.getBoundingClientRect().height);
418
- }
419
- }
420
- function handleClick(evt) {
421
- evt?.persist?.();
422
- setIsExpanded(!isExpanded);
423
- setMaxHeight();
424
- }
425
- function handleKeyUp(evt) {
398
+ }, [expanded]);
399
+ const handleClick = () => {
400
+ setIsExpanded(prev => !prev);
401
+ };
402
+ const handleKeyUp = evt => {
426
403
  if (evt.target !== tile.current && evt.target !== chevronInteractiveRef.current) {
427
404
  if (matches(evt, [Enter, Space])) {
428
405
  evt.preventDefault();
429
406
  }
430
407
  }
431
- }
432
- function getChildren() {
433
- return React.Children.toArray(children);
434
- }
408
+ };
435
409
  const classNames = cx(`${prefix}--tile`, `${prefix}--tile--expandable`, {
436
410
  [`${prefix}--tile--is-expanded`]: isExpanded,
437
411
  [`${prefix}--tile--light`]: light
438
412
  }, className);
439
- const interactiveClassNames = cx(`${prefix}--tile`, `${prefix}--tile--expandable`, `${prefix}--tile--expandable--interactive`, {
440
- [`${prefix}--tile--is-expanded`]: isExpanded,
441
- [`${prefix}--tile--light`]: light,
413
+ const interactiveClassNames = cx(classNames, `${prefix}--tile--expandable--interactive`, {
442
414
  [`${prefix}--tile--slug`]: slug,
443
415
  [`${prefix}--tile--slug-rounded`]: slug && hasRoundedCorners,
444
416
  [`${prefix}--tile--decorator`]: decorator,
445
417
  [`${prefix}--tile--decorator-rounded`]: decorator && hasRoundedCorners
446
- }, className);
418
+ });
447
419
  const chevronInteractiveClassNames = cx(`${prefix}--tile__chevron`, `${prefix}--tile__chevron--interactive`);
448
- const childrenAsArray = getChildren();
420
+ const childrenAsArray = Children.toArray(children);
449
421
  useIsomorphicEffect(() => {
450
422
  if (!tile.current || !aboveTheFold.current) {
451
423
  return;
452
424
  }
453
- const getStyle = window.getComputedStyle(tile.current, null);
454
- const {
455
- current: node
456
- } = aboveTheFold;
457
- const {
458
- height
459
- } = node.getBoundingClientRect();
460
- const paddingTop = parseInt(getStyle.getPropertyValue('padding-top'), 10);
461
- const paddingBottom = parseInt(getStyle.getPropertyValue('padding-bottom'), 10);
462
- setIsTileMaxHeight(height);
463
- setIsTilePadding(paddingTop + paddingBottom);
464
- }, [isTileMaxHeight]);
425
+ const style = window.getComputedStyle(tile.current);
426
+ const paddingTop = parseInt(style.getPropertyValue('padding-top'), 10) || 0;
427
+ const paddingBottom = parseInt(style.getPropertyValue('padding-bottom'), 10) || 0;
428
+ setMeasuredPadding(paddingTop + paddingBottom);
429
+ setMeasuredAboveHeight(aboveTheFold.current.scrollHeight);
430
+ }, []);
465
431
  useIsomorphicEffect(() => {
466
432
  if (!aboveTheFold.current || !belowTheFold.current) {
467
433
  return;
468
434
  }
469
-
470
- // Interactive elements or elements that are given a role should be treated
471
- // the same because elements with a role can not be rendered inside a `button`
472
- if (!getInteractiveContent(belowTheFold.current) && !getRoleContent(belowTheFold.current) && !getInteractiveContent(aboveTheFold.current) && !getRoleContent(aboveTheFold.current) && !(slug || decorator)) {
473
- setInteractive(false);
474
- }
475
- }, [slug, decorator]);
435
+ const hasInteractive = Boolean(getInteractiveContent(aboveTheFold.current)) || Boolean(getRoleContent(aboveTheFold.current)) || Boolean(getInteractiveContent(belowTheFold.current)) || Boolean(getRoleContent(belowTheFold.current)) || Boolean(slug || decorator);
436
+ setInteractive(hasInteractive);
437
+ }, [slug, decorator, children]);
476
438
  useIsomorphicEffect(() => {
477
439
  if (!tile.current) {
478
440
  return;
479
441
  }
480
442
  if (isExpanded) {
481
443
  tile.current.style.maxHeight = '';
482
- } else {
483
- tile.current.style.maxHeight = isTileMaxHeight + isTilePadding + 'px';
444
+ return;
484
445
  }
485
- }, [isExpanded, isTileMaxHeight, isTilePadding]);
446
+ const measured = measuredAboveHeight || aboveTheFold.current?.scrollHeight || 0;
447
+ const baseHeight = tileMaxHeight > 0 ? tileMaxHeight : measured;
448
+ const pad = tilePadding > 0 ? tilePadding : measuredPadding;
449
+ tile.current.style.maxHeight = `${baseHeight + pad}px`;
450
+ }, [isExpanded, tileMaxHeight, tilePadding, measuredAboveHeight, measuredPadding]);
486
451
  useEffect(() => {
487
452
  if (!aboveTheFold.current) {
488
453
  return;
489
454
  }
490
- const resizeObserver = new ResizeObserver(entries => {
491
- const [aboveTheFold] = entries;
492
- setIsTileMaxHeight(aboveTheFold.contentRect.height);
455
+ const resizeObserver = new ResizeObserver(() => {
456
+ if (aboveTheFold.current) {
457
+ setMeasuredAboveHeight(aboveTheFold.current.scrollHeight);
458
+ }
493
459
  });
494
460
  resizeObserver.observe(aboveTheFold.current);
495
461
  return () => resizeObserver.disconnect();
496
- }, [isTileMaxHeight, isTilePadding]);
497
- const belowTheFoldId = useId('expandable-tile-interactive');
462
+ }, []);
463
+ const belowTheFoldId = useId(interactive ? 'expandable-tile-interactive' : 'expandable-tile');
498
464
 
499
465
  // AILabel is always size `xs`
500
466
  const candidate = slug ?? decorator;
@@ -529,6 +495,7 @@ const ExpandableTile = /*#__PURE__*/React.forwardRef(({
529
495
  type: "button",
530
496
  ref: ref,
531
497
  className: classNames,
498
+ "aria-controls": belowTheFoldId,
532
499
  "aria-expanded": isExpanded,
533
500
  title: isExpanded ? tileExpandedIconText : tileCollapsedIconText
534
501
  }, rest, {
@@ -544,6 +511,7 @@ const ExpandableTile = /*#__PURE__*/React.forwardRef(({
544
511
  className: `${prefix}--tile__chevron`
545
512
  }, /*#__PURE__*/React.createElement("span", null, isExpanded ? tileExpandedLabel : tileCollapsedLabel), _ChevronDown2 || (_ChevronDown2 = /*#__PURE__*/React.createElement(ChevronDown, null))), /*#__PURE__*/React.createElement("div", {
546
513
  ref: belowTheFold,
514
+ id: belowTheFoldId,
547
515
  className: `${prefix}--tile-content`
548
516
  }, childrenAsArray[1])));
549
517
  });
@@ -1,14 +1,20 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
7
+ import PropTypes from 'prop-types';
8
8
  export interface ToggleSkeletonProps {
9
9
  'aria-label'?: string;
10
10
  className?: string;
11
11
  }
12
- declare const ToggleSkeleton: React.FC<ToggleSkeletonProps>;
12
+ declare const ToggleSkeleton: {
13
+ ({ className, ...rest }: ToggleSkeletonProps): import("react/jsx-runtime").JSX.Element;
14
+ propTypes: {
15
+ 'aria-label': PropTypes.Requireable<string>;
16
+ className: PropTypes.Requireable<string>;
17
+ };
18
+ };
13
19
  export default ToggleSkeleton;
14
20
  export { ToggleSkeleton };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2025
2
+ * Copyright IBM Corp. 2016, 2026
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -8,7 +8,7 @@
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import cx from 'classnames';
10
10
  import PropTypes from 'prop-types';
11
- import React, { useContext, useRef, useState, useEffect } from 'react';
11
+ import React, { forwardRef, useContext, useRef, useState, useEffect } from 'react';
12
12
  import { Popover, PopoverContent } from '../Popover/index.js';
13
13
  import { Escape } from '../../internal/keyboard/keys.js';
14
14
  import { match } from '../../internal/keyboard/match.js';
@@ -184,8 +184,7 @@ Toggletip.propTypes = {
184
184
  * `ToggletipButton` controls the visibility of the Toggletip through mouse
185
185
  * clicks and keyboard interactions.
186
186
  */
187
-
188
- const ToggletipButton = /*#__PURE__*/React.forwardRef(function ToggletipButton({
187
+ const ToggletipButton = /*#__PURE__*/forwardRef(function ToggletipButton({
189
188
  children,
190
189
  className: customClassName,
191
190
  label = 'Show information',
@@ -225,15 +224,18 @@ ToggletipButton.propTypes = {
225
224
  label: PropTypes.string
226
225
  };
227
226
  ToggletipButton.displayName = 'ToggletipButton';
227
+ const frFn = forwardRef;
228
+
228
229
  /**
229
230
  * `ToggletipContent` is a wrapper around `PopoverContent`. It places the
230
231
  * `children` passed in as a prop inside of `PopoverContent` so that they will
231
232
  * be rendered inside of the popover for this component.
232
233
  */
233
- const ToggletipContent = /*#__PURE__*/React.forwardRef(function ToggletipContent({
234
- children,
235
- className: customClassName
236
- }, ref) {
234
+ const ToggletipContent = frFn((props, ref) => {
235
+ const {
236
+ children,
237
+ className: customClassName
238
+ } = props;
237
239
  const toggletip = useToggletip();
238
240
  const prefix = usePrefix();
239
241
  return /*#__PURE__*/React.createElement(PopoverContent, _extends({
@@ -4,6 +4,7 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
+ import PropTypes from 'prop-types';
7
8
  import React from 'react';
8
9
  import { PopoverAlignment } from '../Popover';
9
10
  export interface DefinitionTooltipProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'id' | 'classname' | 'children' | 'type'> {
@@ -54,5 +55,55 @@ export interface DefinitionTooltipProps extends Omit<React.ButtonHTMLAttributes<
54
55
  */
55
56
  triggerClassName?: string;
56
57
  }
57
- declare const DefinitionTooltip: React.FC<DefinitionTooltipProps>;
58
+ declare const DefinitionTooltip: {
59
+ ({ align, autoAlign, className, children, definition, defaultOpen, id, openOnHover, tooltipText, triggerClassName, ...rest }: DefinitionTooltipProps): import("react/jsx-runtime").JSX.Element;
60
+ propTypes: {
61
+ /**
62
+ * Specify how the trigger should align with the tooltip
63
+ */
64
+ align: PropTypes.Requireable<string>;
65
+ /**
66
+ * Will auto-align the popover. This prop is currently experimental and is
67
+ * subject to future changes. Requires React v17+
68
+ * @see https://github.com/carbon-design-system/carbon/issues/18714
69
+ */
70
+ autoAlign: PropTypes.Requireable<boolean>;
71
+ /**
72
+ * The `children` prop will be used as the value that is being defined
73
+ */
74
+ children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
75
+ /**
76
+ * Specify an optional className to be applied to the container node
77
+ */
78
+ className: PropTypes.Requireable<string>;
79
+ /**
80
+ * Specify whether the tooltip should be open when it first renders
81
+ */
82
+ defaultOpen: PropTypes.Requireable<boolean>;
83
+ /**
84
+ * The `definition` prop is used as the content inside of the tooltip that
85
+ * appears when a user interacts with the element rendered by the `children`
86
+ * prop
87
+ */
88
+ definition: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
89
+ /**
90
+ * Provide a value that will be assigned as the id of the tooltip
91
+ */
92
+ id: PropTypes.Requireable<string>;
93
+ /**
94
+ * Specifies whether or not the `DefinitionTooltip` should open on hover or not
95
+ */
96
+ openOnHover: PropTypes.Requireable<boolean>;
97
+ /**
98
+ * [Deprecated in v11] Please use the `definition` prop instead.
99
+ *
100
+ * Provide the text that will be displayed in the tooltip when it is rendered.
101
+ */
102
+ tooltipText: (props: Record<string, any>, propName: string, componentName: string, ...rest: any[]) => any;
103
+ /**
104
+ * The CSS class name of the trigger element
105
+ */
106
+ triggerClassName: PropTypes.Requireable<string>;
107
+ };
108
+ };
58
109
  export { DefinitionTooltip };
@@ -187,6 +187,8 @@ const Tooltip = /*#__PURE__*/React.forwardRef(({
187
187
  }, label || description))
188
188
  );
189
189
  });
190
+
191
+ // @ts-expect-error - `propTypes` isn't typed.
190
192
  Tooltip.propTypes = {
191
193
  /**
192
194
  * Specify how the trigger should align with the tooltip
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2025
2
+ * Copyright IBM Corp. 2016, 2026
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React, { type ComponentType, type FunctionComponent } from 'react';
7
+ import React, { type ElementType } from 'react';
8
8
  type UncontrolledOnToggle = (event: React.MouseEvent | React.KeyboardEvent, node: Pick<TreeNodeProps, 'id' | 'label' | 'value' | 'isExpanded'>) => void;
9
9
  type ControlledOnToggle = (isExpanded: TreeNodeProps['isExpanded']) => void;
10
10
  export type TreeNodeProps = {
@@ -78,7 +78,7 @@ export type TreeNodeProps = {
78
78
  /**
79
79
  * A component used to render an icon.
80
80
  */
81
- renderIcon?: ComponentType | FunctionComponent;
81
+ renderIcon?: ElementType;
82
82
  /**
83
83
  * **Note:** this is controlled by the parent TreeView component, do not set manually.
84
84
  * Array containing all selected node IDs in the tree
@@ -178,7 +178,7 @@ declare const TreeNode: React.ForwardRefExoticComponent<{
178
178
  /**
179
179
  * A component used to render an icon.
180
180
  */
181
- renderIcon?: ComponentType | FunctionComponent;
181
+ renderIcon?: ElementType;
182
182
  /**
183
183
  * **Note:** this is controlled by the parent TreeView component, do not set manually.
184
184
  * Array containing all selected node IDs in the tree
@@ -1,10 +1,11 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React, { ReactNode } from 'react';
7
+ import PropTypes from 'prop-types';
8
+ import { ReactNode } from 'react';
8
9
  export interface HeaderProps {
9
10
  children?: ReactNode;
10
11
  /**
@@ -20,5 +21,21 @@ export interface HeaderProps {
20
21
  */
21
22
  className?: string;
22
23
  }
23
- declare const Header: React.FC<HeaderProps>;
24
+ declare const Header: {
25
+ ({ className: customClassName, children, ...rest }: HeaderProps): import("react/jsx-runtime").JSX.Element;
26
+ propTypes: {
27
+ /**
28
+ * Optionally provide aria-label
29
+ */
30
+ 'aria-label': PropTypes.Requireable<string>;
31
+ /**
32
+ * Optionally provide aria-labelledby
33
+ */
34
+ 'aria-labelledby': PropTypes.Requireable<string>;
35
+ /**
36
+ * Optionally provide a custom class name that is applied to the underlying header
37
+ */
38
+ className: PropTypes.Requireable<string>;
39
+ };
40
+ };
24
41
  export default Header;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -55,5 +55,5 @@ export interface HeaderGlobalActionProps {
55
55
  *
56
56
  * Note: children passed to this component should be an Icon.
57
57
  */
58
- declare const HeaderGlobalAction: React.FC<HeaderGlobalActionProps>;
58
+ declare const HeaderGlobalAction: React.ForwardRefExoticComponent<HeaderGlobalActionProps & React.RefAttributes<HTMLButtonElement>>;
59
59
  export default HeaderGlobalAction;
@@ -24,7 +24,7 @@ function HeaderName({
24
24
  className: className
25
25
  }), prefix && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
26
26
  className: `${selectorPrefix}--header__name--prefix`
27
- }, prefix), "\xA0"), children);
27
+ }, prefix), "\xA0"), /*#__PURE__*/React.createElement("span", null, children));
28
28
  }
29
29
  HeaderName.propTypes = {
30
30
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2025
2
+ * Copyright IBM Corp. 2016, 2026
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -7,29 +7,29 @@
7
7
 
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import PropTypes from 'prop-types';
10
- import React from 'react';
10
+ import React, { forwardRef } from 'react';
11
11
  import { deprecate } from '../../prop-types/deprecate.js';
12
12
 
13
13
  // First define the component without generics
14
14
 
15
- const LinkBase = ({
16
- element,
17
- as: BaseComponent,
18
- // Captured here to prevent it from being passed into the created element.
19
- // See https://github.com/carbon-design-system/carbon/issues/3970
20
- // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
21
- isSideNavExpanded: _isSideNavExpanded,
22
- ...rest
23
- }, ref) => {
15
+ const frFn = forwardRef;
16
+ const Link = frFn((props, ref) => {
17
+ const {
18
+ element,
19
+ as: BaseComponent,
20
+ // Captured here to prevent it from being passed into the created element.
21
+ // See https://github.com/carbon-design-system/carbon/issues/3970
22
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
23
+ isSideNavExpanded: _isSideNavExpanded,
24
+ ...rest
25
+ } = props;
26
+
24
27
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
25
28
  const BaseComponentAsAny = BaseComponent ?? element ?? 'a';
26
29
  return /*#__PURE__*/React.createElement(BaseComponentAsAny, _extends({
27
30
  ref: ref
28
31
  }, rest));
29
- };
30
-
31
- // Use forwardRef with the non-generic function
32
- const Link = /*#__PURE__*/React.forwardRef(LinkBase);
32
+ });
33
33
 
34
34
  /**
35
35
  * Link is a custom component that allows us to supporting rendering elements
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2025
2
+ * Copyright IBM Corp. 2016, 2026
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -9,7 +9,7 @@ export interface SideNavProps {
9
9
  expanded?: boolean | undefined;
10
10
  defaultExpanded?: boolean | undefined;
11
11
  isChildOfHeader?: boolean | undefined;
12
- onToggle?: (event: FocusEvent<HTMLElement> | KeyboardEvent<HTMLElement> | boolean, value: boolean) => void | undefined;
12
+ onToggle?: (event: FocusEvent<HTMLElement> | KeyboardEvent<HTMLElement> | boolean, value: boolean) => void;
13
13
  href?: string | undefined;
14
14
  isFixedNav?: boolean | undefined;
15
15
  isRail?: boolean | undefined;
@@ -17,9 +17,8 @@ export interface SideNavProps {
17
17
  addFocusListeners?: boolean | undefined;
18
18
  addMouseListeners?: boolean | undefined;
19
19
  onOverlayClick?: MouseEventHandler<HTMLDivElement> | undefined;
20
- onSideNavBlur?: () => void | undefined;
20
+ onSideNavBlur?: () => void;
21
21
  enterDelayMs?: number;
22
- inert?: boolean;
23
22
  }
24
23
  interface SideNavContextData {
25
24
  isRail?: boolean | undefined;
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
- import React, { useRef, isValidElement, createContext } from 'react';
9
+ import React, { forwardRef, useRef, isValidElement, useEffect, createContext } from 'react';
10
10
  import cx from 'classnames';
11
11
  import PropTypes from 'prop-types';
12
12
  import { AriaLabelPropType } from '../../prop-types/AriaPropTypes.js';
@@ -24,28 +24,30 @@ import { useMatchMedia } from '../../internal/useMatchMedia.js';
24
24
  // import SideNavFooter from './SideNavFooter';
25
25
 
26
26
  const SideNavContext = /*#__PURE__*/createContext({});
27
- function SideNavRenderFunction({
28
- expanded: expandedProp,
29
- defaultExpanded = false,
30
- isChildOfHeader = true,
31
- 'aria-label': ariaLabel,
32
- 'aria-labelledby': ariaLabelledBy,
33
- children,
34
- onToggle,
35
- className: customClassName,
36
- // TO-DO: comment back in when footer is added for rails
37
- // translateById: t = (id) => translations[id],
38
- href,
39
- isFixedNav = false,
40
- isRail,
41
- isPersistent = true,
42
- addFocusListeners = true,
43
- addMouseListeners = true,
44
- onOverlayClick,
45
- onSideNavBlur,
46
- enterDelayMs = 100,
47
- ...other
48
- }, ref) {
27
+ const frFn = forwardRef;
28
+ const SideNav = frFn((props, ref) => {
29
+ const {
30
+ expanded: expandedProp,
31
+ defaultExpanded = false,
32
+ isChildOfHeader = true,
33
+ 'aria-label': ariaLabel,
34
+ 'aria-labelledby': ariaLabelledBy,
35
+ children,
36
+ onToggle,
37
+ className: customClassName,
38
+ // TO-DO: comment back in when footer is added for rails
39
+ // translateById: t = (id) => translations[id],
40
+ href,
41
+ isFixedNav = false,
42
+ isRail,
43
+ isPersistent = true,
44
+ addFocusListeners = true,
45
+ addMouseListeners = true,
46
+ onOverlayClick,
47
+ onSideNavBlur,
48
+ enterDelayMs = 100,
49
+ ...other
50
+ } = props;
49
51
  const prefix = usePrefix();
50
52
  const {
51
53
  current: controlled
@@ -155,6 +157,16 @@ function SideNavRenderFunction({
155
157
  });
156
158
  const lgMediaQuery = `(min-width: ${breakpoints.lg.width})`;
157
159
  const isLg = useMatchMedia(lgMediaQuery);
160
+ const inertEnabled = !isRail ? !(expanded || isLg) : false;
161
+ useEffect(() => {
162
+ const node = sideNavRef.current;
163
+ if (!node) return;
164
+ if (inertEnabled) {
165
+ node.setAttribute('inert', '');
166
+ } else {
167
+ node.removeAttribute('inert');
168
+ }
169
+ }, [inertEnabled]);
158
170
  return /*#__PURE__*/React.createElement(SideNavContext.Provider, {
159
171
  value: {
160
172
  isRail
@@ -168,11 +180,9 @@ function SideNavRenderFunction({
168
180
  }), /*#__PURE__*/React.createElement("nav", _extends({
169
181
  tabIndex: -1,
170
182
  ref: navRef,
171
- className: `${prefix}--side-nav__navigation ${className}`,
172
- inert: !isRail ? !(expanded || isLg) : undefined
183
+ className: `${prefix}--side-nav__navigation ${className}`
173
184
  }, accessibilityLabel, eventHandlers, other), childrenToRender));
174
- }
175
- const SideNav = /*#__PURE__*/React.forwardRef(SideNavRenderFunction);
185
+ });
176
186
  SideNav.displayName = 'SideNav';
177
187
  SideNav.propTypes = {
178
188
  /**
@@ -1,15 +1,23 @@
1
1
  /**
2
- * Copyright IBM Corp. 2021
2
+ * Copyright IBM Corp. 2021, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
7
+ import PropTypes from 'prop-types';
8
8
  interface SideNavDividerProps {
9
9
  /**
10
10
  * Provide an optional class to be applied to the containing node
11
11
  */
12
12
  className?: string;
13
13
  }
14
- declare const SideNavDivider: React.FC<SideNavDividerProps>;
14
+ declare const SideNavDivider: {
15
+ ({ className }: SideNavDividerProps): import("react/jsx-runtime").JSX.Element;
16
+ propTypes: {
17
+ /**
18
+ * Provide an optional class to be applied to the containing node
19
+ */
20
+ className: PropTypes.Requireable<string>;
21
+ };
22
+ };
15
23
  export default SideNavDivider;
@@ -4,6 +4,7 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
+ import PropTypes from 'prop-types';
7
8
  import React from 'react';
8
9
  export interface SideNavHeaderProps {
9
10
  /**
@@ -24,5 +25,27 @@ export interface SideNavHeaderProps {
24
25
  */
25
26
  renderIcon: React.ComponentType;
26
27
  }
27
- declare const SideNavHeader: React.FC<SideNavHeaderProps>;
28
+ declare const SideNavHeader: {
29
+ ({ children, className: customClassName, renderIcon: IconElement, }: SideNavHeaderProps): import("react/jsx-runtime").JSX.Element;
30
+ displayName: string;
31
+ propTypes: {
32
+ /**
33
+ * The child nodes to be rendered
34
+ */
35
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
36
+ /**
37
+ * Provide an optional class to be applied to the containing node
38
+ */
39
+ className: PropTypes.Requireable<string>;
40
+ /**
41
+ * Property to indicate if the side nav container is open (or not). Use to
42
+ * keep local state and styling in step with the SideNav expansion state.
43
+ */
44
+ isSideNavExpanded: PropTypes.Requireable<boolean>;
45
+ /**
46
+ * A component used to render an icon.
47
+ */
48
+ renderIcon: PropTypes.Validator<object>;
49
+ };
50
+ };
28
51
  export default SideNavHeader;