@carbon/react 1.92.0 → 1.93.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +1011 -970
  2. package/es/components/AILabel/index.js +4 -4
  3. package/es/components/Breadcrumb/BreadcrumbItem.js +1 -1
  4. package/es/components/Button/Button.js +2 -2
  5. package/es/components/ChatButton/ChatButton.js +1 -1
  6. package/es/components/Checkbox/Checkbox.js +1 -1
  7. package/es/components/CheckboxGroup/CheckboxGroup.js +1 -1
  8. package/es/components/ComboBox/ComboBox.d.ts +3 -11
  9. package/es/components/ComboBox/ComboBox.js +15 -25
  10. package/es/components/ComboButton/index.d.ts +5 -8
  11. package/es/components/ComboButton/index.js +9 -12
  12. package/es/components/ComposedModal/ComposedModal.js +22 -36
  13. package/es/components/DataTable/DataTable.d.ts +25 -16
  14. package/es/components/DataTable/DataTable.js +33 -34
  15. package/es/components/DataTable/Table.js +2 -2
  16. package/es/components/DataTable/TableBatchActions.d.ts +49 -10
  17. package/es/components/DataTable/TableBatchActions.js +26 -21
  18. package/es/components/DataTable/TableExpandHeader.js +2 -2
  19. package/es/components/DataTable/TableExpandRow.js +1 -1
  20. package/es/components/DataTable/TableHeader.d.ts +8 -10
  21. package/es/components/DataTable/TableHeader.js +11 -13
  22. package/es/components/DataTable/TableRow.js +5 -5
  23. package/es/components/DataTable/TableSlugRow.js +1 -1
  24. package/es/components/DataTable/TableToolbarMenu.js +1 -1
  25. package/es/components/DataTable/TableToolbarSearch.d.ts +8 -7
  26. package/es/components/DataTable/TableToolbarSearch.js +11 -11
  27. package/es/components/DataTable/index.d.ts +2 -2
  28. package/es/components/DataTable/state/sorting.d.ts +2 -2
  29. package/es/components/DataTable/state/sorting.js +1 -1
  30. package/es/components/DataTable/tools/sorting.js +1 -1
  31. package/es/components/DatePicker/DatePicker.js +9 -9
  32. package/es/components/DatePickerInput/DatePickerInput.js +5 -5
  33. package/es/components/Dialog/Dialog.js +6 -6
  34. package/es/components/Dropdown/Dropdown.d.ts +1 -1
  35. package/es/components/Dropdown/Dropdown.js +8 -8
  36. package/es/components/ErrorBoundary/ErrorBoundaryContext.js +1 -1
  37. package/es/components/FileUploader/FileUploader.js +4 -4
  38. package/es/components/FileUploader/FileUploaderButton.js +1 -1
  39. package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
  40. package/es/components/FileUploader/FileUploaderItem.js +2 -2
  41. package/es/components/FluidComboBox/FluidComboBox.d.ts +4 -7
  42. package/es/components/FluidComboBox/FluidComboBox.js +1 -1
  43. package/es/components/FluidDropdown/FluidDropdown.d.ts +4 -8
  44. package/es/components/FluidDropdown/FluidDropdown.js +1 -1
  45. package/es/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -7
  46. package/es/components/FluidMultiSelect/FluidMultiSelect.d.ts +3 -7
  47. package/es/components/FluidMultiSelect/FluidMultiSelect.js +3 -3
  48. package/es/components/FluidNumberInput/FluidNumberInput.d.ts +4 -7
  49. package/es/components/FluidNumberInput/FluidNumberInput.js +2 -2
  50. package/es/components/FluidSearch/FluidSearch.js +1 -1
  51. package/es/components/FluidSelect/FluidSelect.js +1 -1
  52. package/es/components/FluidTextInput/FluidTextInput.js +1 -1
  53. package/es/components/FluidTimePicker/FluidTimePicker.js +3 -3
  54. package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +1 -1
  55. package/es/components/Grid/CSSGrid.js +3 -3
  56. package/es/components/Grid/Column.js +2 -2
  57. package/es/components/Grid/ColumnHang.js +1 -1
  58. package/es/components/Grid/FlexGrid.js +1 -1
  59. package/es/components/Grid/Row.js +1 -1
  60. package/es/components/Heading/index.js +2 -2
  61. package/es/components/IconButton/index.js +2 -2
  62. package/es/components/IconIndicator/index.js +2 -2
  63. package/es/components/InlineCheckbox/InlineCheckbox.js +1 -1
  64. package/es/components/Layout/index.js +2 -2
  65. package/es/components/LayoutDirection/LayoutDirection.js +1 -1
  66. package/es/components/Link/Link.js +2 -2
  67. package/es/components/ListBox/ListBoxField.d.ts +0 -1
  68. package/es/components/ListBox/ListBoxMenuIcon.d.ts +8 -4
  69. package/es/components/ListBox/ListBoxMenuIcon.js +10 -6
  70. package/es/components/ListBox/ListBoxMenuItem.js +2 -2
  71. package/es/components/ListBox/ListBoxSelection.d.ts +3 -6
  72. package/es/components/ListBox/ListBoxSelection.js +5 -10
  73. package/es/components/ListBox/index.d.ts +5 -3
  74. package/es/components/ListBox/next/ListBoxSelection.d.ts +6 -13
  75. package/es/components/ListBox/next/ListBoxSelection.js +16 -8
  76. package/es/components/ListBox/next/ListBoxTrigger.d.ts +5 -10
  77. package/es/components/ListBox/next/ListBoxTrigger.js +6 -6
  78. package/es/components/Menu/MenuContext.js +1 -1
  79. package/es/components/Menu/MenuItem.js +1 -1
  80. package/es/components/MenuButton/index.js +5 -5
  81. package/es/components/Modal/Modal.js +20 -36
  82. package/es/components/ModalWrapper/ModalWrapper.js +2 -2
  83. package/es/components/MultiSelect/FilterableMultiSelect.d.ts +3 -12
  84. package/es/components/MultiSelect/FilterableMultiSelect.js +18 -27
  85. package/es/components/MultiSelect/MultiSelect.d.ts +2 -2
  86. package/es/components/MultiSelect/MultiSelect.js +12 -12
  87. package/es/components/Notification/Notification.js +1 -1
  88. package/es/components/NumberInput/NumberInput.d.ts +2 -5
  89. package/es/components/NumberInput/NumberInput.js +13 -18
  90. package/es/components/OverflowMenu/OverflowMenu.d.ts +2 -2
  91. package/es/components/OverflowMenu/OverflowMenu.js +4 -4
  92. package/es/components/OverflowMenu/next/index.d.ts +1 -1
  93. package/es/components/OverflowMenu/next/index.js +2 -2
  94. package/es/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
  95. package/es/components/PageHeader/PageHeader.js +12 -12
  96. package/es/components/Pagination/Pagination.js +3 -3
  97. package/es/components/PaginationNav/PaginationNav.d.ts +6 -9
  98. package/es/components/PaginationNav/PaginationNav.js +21 -22
  99. package/es/components/Popover/index.js +8 -8
  100. package/es/components/ProgressBar/ProgressBar.js +2 -2
  101. package/es/components/ProgressIndicator/ProgressIndicator.d.ts +11 -15
  102. package/es/components/ProgressIndicator/ProgressIndicator.js +15 -15
  103. package/es/components/RadioButton/RadioButton.js +1 -1
  104. package/es/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
  105. package/es/components/RadioTile/RadioTile.js +1 -1
  106. package/es/components/Select/Select.js +7 -5
  107. package/es/components/ShapeIndicator/index.js +2 -2
  108. package/es/components/Slider/Slider.d.ts +7 -9
  109. package/es/components/Slider/Slider.js +16 -20
  110. package/es/components/Stack/HStack.js +1 -1
  111. package/es/components/Stack/Stack.js +1 -1
  112. package/es/components/Stack/VStack.js +1 -1
  113. package/es/components/StructuredList/StructuredList.js +3 -3
  114. package/es/components/Tabs/Tabs.js +12 -12
  115. package/es/components/Tag/DismissibleTag.js +3 -3
  116. package/es/components/Tag/OperationalTag.js +2 -2
  117. package/es/components/Tag/SelectableTag.js +2 -2
  118. package/es/components/Tag/Tag.js +4 -4
  119. package/es/components/Tag/isEllipsisActive.js +1 -1
  120. package/es/components/Text/Text.js +1 -1
  121. package/es/components/TextArea/TextArea.js +1 -1
  122. package/es/components/TextInput/PasswordInput.js +4 -4
  123. package/es/components/TextInput/TextInput.js +3 -3
  124. package/es/components/Theme/index.js +3 -3
  125. package/es/components/Tile/Tile.js +3 -3
  126. package/es/components/TimePicker/TimePicker.js +1 -1
  127. package/es/components/Toggletip/index.js +4 -4
  128. package/es/components/Tooltip/DefinitionTooltip.js +1 -1
  129. package/es/components/Tooltip/Tooltip.js +3 -3
  130. package/es/components/TreeView/TreeNode.js +6 -6
  131. package/es/components/TreeView/TreeView.js +5 -5
  132. package/es/components/UIShell/HeaderContainer.js +1 -1
  133. package/es/components/UIShell/HeaderMenu.js +1 -1
  134. package/es/components/UIShell/Link.js +2 -2
  135. package/es/components/UIShell/SideNavItems.js +1 -1
  136. package/es/components/UIShell/Switcher.js +1 -1
  137. package/es/components/UIShell/SwitcherItem.js +1 -1
  138. package/es/index.d.ts +1 -1
  139. package/es/internal/FloatingMenu.js +4 -4
  140. package/es/internal/Selection.js +6 -6
  141. package/es/internal/useMergedRefs.js +1 -1
  142. package/es/internal/useNoInteractiveChildren.js +4 -4
  143. package/es/internal/useOutsideClick.js +1 -1
  144. package/es/internal/useOverflowItems.js +6 -6
  145. package/es/internal/useResizeObserver.js +3 -3
  146. package/es/internal/useSavedCallback.js +1 -1
  147. package/es/internal/warning.js +1 -1
  148. package/es/prop-types/isRequiredOneOf.js +2 -2
  149. package/es/tools/events.js +1 -1
  150. package/es/tools/wrapComponent.js +1 -1
  151. package/es/types/common.d.ts +6 -2
  152. package/lib/components/AILabel/index.js +4 -4
  153. package/lib/components/Breadcrumb/BreadcrumbItem.js +1 -1
  154. package/lib/components/Button/Button.js +2 -2
  155. package/lib/components/ChatButton/ChatButton.js +1 -1
  156. package/lib/components/Checkbox/Checkbox.js +1 -1
  157. package/lib/components/CheckboxGroup/CheckboxGroup.js +1 -1
  158. package/lib/components/ComboBox/ComboBox.d.ts +3 -11
  159. package/lib/components/ComboBox/ComboBox.js +15 -25
  160. package/lib/components/ComboButton/index.d.ts +5 -8
  161. package/lib/components/ComboButton/index.js +9 -12
  162. package/lib/components/ComposedModal/ComposedModal.js +21 -35
  163. package/lib/components/DataTable/DataTable.d.ts +25 -16
  164. package/lib/components/DataTable/DataTable.js +33 -34
  165. package/lib/components/DataTable/Table.js +2 -2
  166. package/lib/components/DataTable/TableBatchActions.d.ts +49 -10
  167. package/lib/components/DataTable/TableBatchActions.js +26 -21
  168. package/lib/components/DataTable/TableExpandHeader.js +2 -2
  169. package/lib/components/DataTable/TableExpandRow.js +1 -1
  170. package/lib/components/DataTable/TableHeader.d.ts +8 -10
  171. package/lib/components/DataTable/TableHeader.js +11 -13
  172. package/lib/components/DataTable/TableRow.js +5 -5
  173. package/lib/components/DataTable/TableSlugRow.js +1 -1
  174. package/lib/components/DataTable/TableToolbarMenu.js +1 -1
  175. package/lib/components/DataTable/TableToolbarSearch.d.ts +8 -7
  176. package/lib/components/DataTable/TableToolbarSearch.js +11 -11
  177. package/lib/components/DataTable/index.d.ts +2 -2
  178. package/lib/components/DataTable/state/sorting.d.ts +2 -2
  179. package/lib/components/DataTable/state/sorting.js +1 -1
  180. package/lib/components/DataTable/tools/sorting.js +1 -1
  181. package/lib/components/DatePicker/DatePicker.js +9 -9
  182. package/lib/components/DatePickerInput/DatePickerInput.js +5 -5
  183. package/lib/components/Dialog/Dialog.js +6 -6
  184. package/lib/components/Dropdown/Dropdown.d.ts +1 -1
  185. package/lib/components/Dropdown/Dropdown.js +8 -8
  186. package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +1 -1
  187. package/lib/components/FileUploader/FileUploader.js +4 -4
  188. package/lib/components/FileUploader/FileUploaderButton.js +1 -1
  189. package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
  190. package/lib/components/FileUploader/FileUploaderItem.js +2 -2
  191. package/lib/components/FluidComboBox/FluidComboBox.d.ts +4 -7
  192. package/lib/components/FluidComboBox/FluidComboBox.js +1 -1
  193. package/lib/components/FluidDropdown/FluidDropdown.d.ts +4 -8
  194. package/lib/components/FluidDropdown/FluidDropdown.js +1 -1
  195. package/lib/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -7
  196. package/lib/components/FluidMultiSelect/FluidMultiSelect.d.ts +3 -7
  197. package/lib/components/FluidMultiSelect/FluidMultiSelect.js +3 -3
  198. package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +4 -7
  199. package/lib/components/FluidNumberInput/FluidNumberInput.js +2 -2
  200. package/lib/components/FluidSearch/FluidSearch.js +1 -1
  201. package/lib/components/FluidSelect/FluidSelect.js +1 -1
  202. package/lib/components/FluidTextInput/FluidTextInput.js +1 -1
  203. package/lib/components/FluidTimePicker/FluidTimePicker.js +3 -3
  204. package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +1 -1
  205. package/lib/components/Grid/CSSGrid.js +3 -3
  206. package/lib/components/Grid/Column.js +2 -2
  207. package/lib/components/Grid/ColumnHang.js +1 -1
  208. package/lib/components/Grid/FlexGrid.js +1 -1
  209. package/lib/components/Grid/Row.js +1 -1
  210. package/lib/components/Heading/index.js +2 -2
  211. package/lib/components/IconButton/index.js +2 -2
  212. package/lib/components/IconIndicator/index.js +2 -2
  213. package/lib/components/InlineCheckbox/InlineCheckbox.js +1 -1
  214. package/lib/components/Layout/index.js +2 -2
  215. package/lib/components/LayoutDirection/LayoutDirection.js +1 -1
  216. package/lib/components/Link/Link.js +2 -2
  217. package/lib/components/ListBox/ListBoxField.d.ts +0 -1
  218. package/lib/components/ListBox/ListBoxMenuIcon.d.ts +8 -4
  219. package/lib/components/ListBox/ListBoxMenuIcon.js +10 -6
  220. package/lib/components/ListBox/ListBoxMenuItem.js +2 -2
  221. package/lib/components/ListBox/ListBoxSelection.d.ts +3 -6
  222. package/lib/components/ListBox/ListBoxSelection.js +4 -10
  223. package/lib/components/ListBox/index.d.ts +5 -3
  224. package/lib/components/ListBox/next/ListBoxSelection.d.ts +6 -13
  225. package/lib/components/ListBox/next/ListBoxSelection.js +16 -8
  226. package/lib/components/ListBox/next/ListBoxTrigger.d.ts +5 -10
  227. package/lib/components/ListBox/next/ListBoxTrigger.js +5 -6
  228. package/lib/components/Menu/MenuContext.js +1 -1
  229. package/lib/components/Menu/MenuItem.js +1 -1
  230. package/lib/components/MenuButton/index.js +5 -5
  231. package/lib/components/Modal/Modal.js +19 -35
  232. package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
  233. package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +3 -12
  234. package/lib/components/MultiSelect/FilterableMultiSelect.js +18 -27
  235. package/lib/components/MultiSelect/MultiSelect.d.ts +2 -2
  236. package/lib/components/MultiSelect/MultiSelect.js +12 -12
  237. package/lib/components/Notification/Notification.js +1 -1
  238. package/lib/components/NumberInput/NumberInput.d.ts +2 -5
  239. package/lib/components/NumberInput/NumberInput.js +12 -18
  240. package/lib/components/OverflowMenu/OverflowMenu.d.ts +2 -2
  241. package/lib/components/OverflowMenu/OverflowMenu.js +4 -4
  242. package/lib/components/OverflowMenu/next/index.d.ts +1 -1
  243. package/lib/components/OverflowMenu/next/index.js +2 -2
  244. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
  245. package/lib/components/PageHeader/PageHeader.js +12 -12
  246. package/lib/components/Pagination/Pagination.js +3 -3
  247. package/lib/components/PaginationNav/PaginationNav.d.ts +6 -9
  248. package/lib/components/PaginationNav/PaginationNav.js +21 -22
  249. package/lib/components/Popover/index.js +8 -8
  250. package/lib/components/ProgressBar/ProgressBar.js +2 -2
  251. package/lib/components/ProgressIndicator/ProgressIndicator.d.ts +11 -15
  252. package/lib/components/ProgressIndicator/ProgressIndicator.js +15 -15
  253. package/lib/components/RadioButton/RadioButton.js +1 -1
  254. package/lib/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
  255. package/lib/components/RadioTile/RadioTile.js +1 -1
  256. package/lib/components/Select/Select.js +7 -5
  257. package/lib/components/ShapeIndicator/index.js +2 -2
  258. package/lib/components/Slider/Slider.d.ts +7 -9
  259. package/lib/components/Slider/Slider.js +16 -20
  260. package/lib/components/Stack/HStack.js +1 -1
  261. package/lib/components/Stack/Stack.js +1 -1
  262. package/lib/components/Stack/VStack.js +1 -1
  263. package/lib/components/StructuredList/StructuredList.js +3 -3
  264. package/lib/components/Tabs/Tabs.js +12 -12
  265. package/lib/components/Tag/DismissibleTag.js +3 -3
  266. package/lib/components/Tag/OperationalTag.js +2 -2
  267. package/lib/components/Tag/SelectableTag.js +2 -2
  268. package/lib/components/Tag/Tag.js +4 -4
  269. package/lib/components/Tag/isEllipsisActive.js +1 -1
  270. package/lib/components/Text/Text.js +1 -1
  271. package/lib/components/TextArea/TextArea.js +1 -1
  272. package/lib/components/TextInput/PasswordInput.js +4 -4
  273. package/lib/components/TextInput/TextInput.js +3 -3
  274. package/lib/components/Theme/index.js +3 -3
  275. package/lib/components/Tile/Tile.js +3 -3
  276. package/lib/components/TimePicker/TimePicker.js +1 -1
  277. package/lib/components/Toggletip/index.js +4 -4
  278. package/lib/components/Tooltip/DefinitionTooltip.js +1 -1
  279. package/lib/components/Tooltip/Tooltip.js +3 -3
  280. package/lib/components/TreeView/TreeNode.js +6 -6
  281. package/lib/components/TreeView/TreeView.js +5 -5
  282. package/lib/components/UIShell/HeaderContainer.js +1 -1
  283. package/lib/components/UIShell/HeaderMenu.js +1 -1
  284. package/lib/components/UIShell/Link.js +2 -2
  285. package/lib/components/UIShell/SideNavItems.js +1 -1
  286. package/lib/components/UIShell/Switcher.js +1 -1
  287. package/lib/components/UIShell/SwitcherItem.js +1 -1
  288. package/lib/index.d.ts +1 -1
  289. package/lib/internal/FloatingMenu.js +4 -4
  290. package/lib/internal/Selection.js +6 -6
  291. package/lib/internal/useMergedRefs.js +1 -1
  292. package/lib/internal/useNoInteractiveChildren.js +4 -4
  293. package/lib/internal/useOutsideClick.js +1 -1
  294. package/lib/internal/useOverflowItems.js +6 -6
  295. package/lib/internal/useResizeObserver.js +3 -3
  296. package/lib/internal/useSavedCallback.js +1 -1
  297. package/lib/internal/warning.js +1 -1
  298. package/lib/prop-types/isRequiredOneOf.js +2 -2
  299. package/lib/tools/events.js +1 -1
  300. package/lib/tools/wrapComponent.js +1 -1
  301. package/lib/types/common.d.ts +6 -2
  302. package/package.json +9 -9
@@ -34,17 +34,15 @@ const translationIds = {
34
34
  'increment.number': 'increment.number',
35
35
  'decrement.number': 'decrement.number'
36
36
  };
37
-
38
- /**
39
- * Message ids that will be passed to translateWithId().
40
- */
41
-
42
37
  const defaultTranslations = {
43
38
  [translationIds['increment.number']]: 'Increment number',
44
39
  [translationIds['decrement.number']]: 'Decrement number'
45
40
  };
41
+ const defaultTranslateWithId = messageId => {
42
+ return defaultTranslations[messageId];
43
+ };
46
44
 
47
- // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
45
+ // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
48
46
  const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
49
47
  const {
50
48
  allowEmpty = false,
@@ -75,7 +73,7 @@ const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
75
73
  size = 'md',
76
74
  slug,
77
75
  step = 1,
78
- translateWithId: t = id => defaultTranslations[id],
76
+ translateWithId: t = defaultTranslateWithId,
79
77
  type = 'number',
80
78
  defaultValue = type === 'number' ? 0 : NaN,
81
79
  validate,
@@ -106,7 +104,7 @@ const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
106
104
  }
107
105
  return 0;
108
106
  });
109
- // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
107
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
110
108
  const [prevControlledValue, setPrevControlledValue] = React.useState(controlledValue);
111
109
  const numberParser = React.useMemo(() => new utilities.NumberParser(locale, formatOptions), [locale, formatOptions]);
112
110
  /**
@@ -239,7 +237,7 @@ const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
239
237
  [`${prefix}--number-input--fluid--disabled`]: isFluid && disabled
240
238
  });
241
239
 
242
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
240
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
243
241
  const Icon = normalizedProps.icon;
244
242
  const getDecimalPlaces = num => {
245
243
  const parts = num.toString().split('.');
@@ -308,13 +306,10 @@ const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
308
306
  const candidateIsAILabel = utils.isComponentElement(candidate, index.AILabel);
309
307
  const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/React.cloneElement(candidate, {
310
308
  size: 'mini'
311
- }) : null;
309
+ }) : candidate;
312
310
 
313
311
  // Need to update the internal value when the revert button is clicked
314
- let isRevertActive;
315
- if (normalizedDecorator?.type === index.AILabel) {
316
- isRevertActive = normalizedDecorator.props.revertActive;
317
- }
312
+ const isRevertActive = utils.isComponentElement(normalizedDecorator, index.AILabel) ? normalizedDecorator.props.revertActive : undefined;
318
313
  React.useEffect(() => {
319
314
  if (!isRevertActive && slug && defaultValue) {
320
315
  setValue(defaultValue);
@@ -349,9 +344,9 @@ const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
349
344
  onKeyUp: onKeyUp,
350
345
  onKeyDown: e => {
351
346
  if (type === 'text') {
352
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
347
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
353
348
  match.match(e, keys.ArrowUp) && handleStep(e, 'up');
354
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
349
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
355
350
  match.match(e, keys.ArrowDown) && handleStep(e, 'down');
356
351
  }
357
352
  if (rest?.onKeyDown) {
@@ -599,7 +594,7 @@ NumberInput.propTypes = {
599
594
  */
600
595
  step: PropTypes.number,
601
596
  /**
602
- * Provide custom text for the component for each translation id
597
+ * Translates component strings using your i18n tool.
603
598
  */
604
599
  translateWithId: PropTypes.func,
605
600
  /**
@@ -734,4 +729,3 @@ function disableWheel(e) {
734
729
  }
735
730
 
736
731
  exports.NumberInput = NumberInput;
737
- exports.translationIds = translationIds;
@@ -102,9 +102,9 @@ export interface OverflowMenuProps extends Omit<IconButtonProps, 'type' | 'aria-
102
102
  */
103
103
  selectorPrimaryFocus?: string;
104
104
  /**
105
- * Specify the size of the OverflowMenu. Currently supports either `sm`, `md` (default) or `lg` as an option.
105
+ * Specify the size of the OverflowMenu. Currently supports either `xs`, `sm`, `md` (default) or `lg` as an option.
106
106
  */
107
- size?: 'sm' | 'md' | 'lg';
107
+ size?: 'xs' | 'sm' | 'md' | 'lg';
108
108
  /**
109
109
  * The ref to the overflow menu's trigger button element.
110
110
  * @deprecated Use the standard React `ref` prop instead.
@@ -70,7 +70,7 @@ const getMenuOffset = (menuBody, direction, trigger, flip) => {
70
70
  if (process.env.NODE_ENV !== 'production') {
71
71
  !(triggerButtonPositionProp && triggerButtonPositionFactor) ? process.env.NODE_ENV !== "production" ? invariant(false, '[OverflowMenu] wrong floating menu direction: `%s`', direction) : invariant(false) : void 0;
72
72
  }
73
- // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
73
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
74
74
  const {
75
75
  offsetWidth: menuWidth,
76
76
  offsetHeight: menuHeight
@@ -93,7 +93,7 @@ const getMenuOffset = (menuBody, direction, trigger, flip) => {
93
93
  };
94
94
  }
95
95
  };
96
- // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
96
+ // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
97
97
  const OverflowMenu = /*#__PURE__*/React.forwardRef(({
98
98
  align,
99
99
  ['aria-label']: ariaLabel = null,
@@ -467,9 +467,9 @@ OverflowMenu.propTypes = {
467
467
  */
468
468
  selectorPrimaryFocus: PropTypes.string,
469
469
  /**
470
- * Specify the size of the OverflowMenu. Currently supports either `sm`, `md` (default) or `lg` as an option.
470
+ * Specify the size of the OverflowMenu. Currently supports either `xs`, `sm`, `md` (default) or `lg` as an option.
471
471
  */
472
- size: PropTypes.oneOf(['sm', 'md', 'lg'])
472
+ size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg'])
473
473
  };
474
474
 
475
475
  exports.OverflowMenu = OverflowMenu;
@@ -37,7 +37,7 @@ interface OverflowMenuProps {
37
37
  /**
38
38
  * Specify the size of the menu, from a list of available sizes.
39
39
  */
40
- size?: 'sm' | 'md' | 'lg';
40
+ size?: 'xs' | 'sm' | 'md' | 'lg';
41
41
  /**
42
42
  * Specify how the trigger tooltip should be aligned.
43
43
  */
@@ -25,7 +25,7 @@ var deprecateValuesWithin = require('../../../prop-types/deprecateValuesWithin.j
25
25
  var mapPopoverAlign = require('../../../tools/mapPopoverAlign.js');
26
26
 
27
27
  const defaultSize = 'md';
28
- // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
28
+ // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
29
29
  const OverflowMenu = /*#__PURE__*/React.forwardRef(({
30
30
  autoAlign = false,
31
31
  children,
@@ -164,7 +164,7 @@ OverflowMenu.propTypes = {
164
164
  /**
165
165
  * Specify the size of the menu, from a list of available sizes.
166
166
  */
167
- size: PropTypes.oneOf(['sm', 'md', 'lg']),
167
+ size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg']),
168
168
  /**
169
169
  * Specify how the trigger tooltip should be aligned.
170
170
  */
@@ -93,14 +93,14 @@ const OverflowMenuItem = frFn((props, ref) => {
93
93
  // ref as any: the type of `ref` is `ForwardedRef<HTMLButtonElement>` in `Button` component
94
94
  // but `OverflowMenuItem` can be rendered as `a` tag as well, which is `HTMLAnchorElement`
95
95
  // so we have to use `any` here
96
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
96
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
97
97
  ,
98
98
  ref: ref,
99
99
  tabIndex: -1
100
100
  // itemText as any: itemText may be a ReactNode, but `title` only accepts string
101
101
  // to avoid compatibility issue, we use `any` here. Consider to enforce `itemText` to be `string?`
102
102
  // in the next major release
103
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
103
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
104
104
  ,
105
105
  title: requireTitle ? title || itemText : undefined
106
106
  }, rest), OverflowMenuItemContent));
@@ -133,7 +133,7 @@ const PageHeaderContent = /*#__PURE__*/React.forwardRef(({
133
133
  return element.offsetHeight < element.scrollHeight;
134
134
  };
135
135
  React.useLayoutEffect(() => {
136
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
136
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
137
137
  titleRef.current && isEllipsisActive(titleRef.current);
138
138
  }, [title]);
139
139
  return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
@@ -205,7 +205,7 @@ PageHeaderContent.propTypes = {
205
205
 
206
206
  const PageHeaderContentPageActions = ({
207
207
  className,
208
- // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
208
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
209
209
  children,
210
210
  menuButtonLabel = 'Actions',
211
211
  actions,
@@ -241,7 +241,7 @@ const PageHeaderContentPageActions = ({
241
241
  }
242
242
  }
243
243
  });
244
- // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
244
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
245
245
  }, []);
246
246
  return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
247
247
  className: classNames,
@@ -385,26 +385,26 @@ const PageHeaderTabBar = /*#__PURE__*/React.forwardRef(({
385
385
  sm: 4
386
386
  }, children)));
387
387
  }
388
- // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
388
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
389
389
  const [openPopover, setOpenPopover] = React.useState(false);
390
390
  const tagSize = tags[0]?.size || 'md';
391
- // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
391
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
392
392
  const instanceId = useId.useId('PageHeaderTabBar');
393
- // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
393
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
394
394
  const tagsWithIds = React.useMemo(() => {
395
395
  return tags.map((tag, index) => ({
396
396
  ...tag,
397
397
  id: tag.id || `tag-${index}-${instanceId}`
398
398
  }));
399
- // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
399
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
400
400
  }, [tags]);
401
401
 
402
- // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
402
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
403
403
  const tagsContainerRef = React.useRef(null);
404
- // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
404
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
405
405
  const offsetRef = React.useRef(null);
406
406
  // To close popover when window resizes
407
- // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
407
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
408
408
  React.useEffect(() => {
409
409
  const handleResize = () => {
410
410
  // Close the popover when window resizes to prevent unwanted opens
@@ -421,14 +421,14 @@ const PageHeaderTabBar = /*#__PURE__*/React.forwardRef(({
421
421
  visibleItems = [],
422
422
  hiddenItems = [],
423
423
  itemRefHandler = () => {}
424
- // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
424
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
425
425
  } = useOverflowItems.default(tagsWithIds, tagsContainerRef, offsetRef) || {
426
426
  visibleItems: [],
427
427
  hiddenItems: [],
428
428
  itemRefHandler: () => {}
429
429
  };
430
430
 
431
- // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
431
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
432
432
  const handleOverflowClick = React.useCallback(event => {
433
433
  event.stopPropagation();
434
434
  setOpenPopover(prev => !prev);
@@ -54,7 +54,7 @@ function getPageSize(pageSizes, pageSize) {
54
54
  return pageSizes[0].value;
55
55
  }
56
56
 
57
- // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
57
+ // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
58
58
  const Pagination = /*#__PURE__*/React.forwardRef(({
59
59
  backwardText = 'Previous page',
60
60
  className: customClassName = '',
@@ -66,7 +66,7 @@ const Pagination = /*#__PURE__*/React.forwardRef(({
66
66
  itemRangeText = (min, max, total) => `${min}–${max} of ${total} items`,
67
67
  itemsPerPageText = 'Items per page:',
68
68
  onChange,
69
- // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
69
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
70
70
  pageNumberText: _pageNumberText = 'Page Number',
71
71
  pageRangeText = (_current, total) => `of ${total} ${total === 1 ? 'page' : 'pages'}`,
72
72
  page: controlledPage = 1,
@@ -129,7 +129,7 @@ const Pagination = /*#__PURE__*/React.forwardRef(({
129
129
  handleFocus(focusTarget);
130
130
  setFocusTarget(null);
131
131
  }
132
- // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
132
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
133
133
  }, [focusTarget]);
134
134
 
135
135
  // Sync state with props
@@ -5,19 +5,16 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React from 'react';
8
- import { TranslateWithId } from '../../types/common';
8
+ import type { TranslateWithId } from '../../types/common';
9
9
  type TooltipAlignment = 'start' | 'center' | 'end';
10
10
  type TooltipPosition = 'top' | 'right' | 'bottom' | 'left';
11
11
  declare const translationIds: {
12
- readonly 'carbon.pagination-nav.next': "Next";
13
- readonly 'carbon.pagination-nav.previous': "Previous";
14
- readonly 'carbon.pagination-nav.item': "Page";
15
- readonly 'carbon.pagination-nav.active': "Active";
16
- readonly 'carbon.pagination-nav.of': "of";
12
+ readonly 'carbon.pagination-nav.next': "carbon.pagination-nav.next";
13
+ readonly 'carbon.pagination-nav.previous': "carbon.pagination-nav.previous";
14
+ readonly 'carbon.pagination-nav.item': "carbon.pagination-nav.item";
15
+ readonly 'carbon.pagination-nav.active': "carbon.pagination-nav.active";
16
+ readonly 'carbon.pagination-nav.of': "carbon.pagination-nav.of";
17
17
  };
18
- /**
19
- * Message ids that will be passed to translateWithId().
20
- */
21
18
  type TranslationKey = keyof typeof translationIds;
22
19
  export interface DirectionButtonProps {
23
20
  /**
@@ -22,20 +22,22 @@ var clamp = require('../../internal/clamp.js');
22
22
 
23
23
  var _CaretRight, _CaretLeft, _option;
24
24
  const translationIds = {
25
- 'carbon.pagination-nav.next': 'Next',
26
- 'carbon.pagination-nav.previous': 'Previous',
27
- 'carbon.pagination-nav.item': 'Page',
28
- 'carbon.pagination-nav.active': 'Active',
29
- 'carbon.pagination-nav.of': 'of'
25
+ 'carbon.pagination-nav.next': 'carbon.pagination-nav.next',
26
+ 'carbon.pagination-nav.previous': 'carbon.pagination-nav.previous',
27
+ 'carbon.pagination-nav.item': 'carbon.pagination-nav.item',
28
+ 'carbon.pagination-nav.active': 'carbon.pagination-nav.active',
29
+ 'carbon.pagination-nav.of': 'carbon.pagination-nav.of'
30
+ };
31
+ const defaultTranslations = {
32
+ [translationIds['carbon.pagination-nav.next']]: 'Next',
33
+ [translationIds['carbon.pagination-nav.previous']]: 'Previous',
34
+ [translationIds['carbon.pagination-nav.item']]: 'Page',
35
+ [translationIds['carbon.pagination-nav.active']]: 'Active',
36
+ [translationIds['carbon.pagination-nav.of']]: 'of'
37
+ };
38
+ const defaultTranslateWithId = messageId => {
39
+ return defaultTranslations[messageId];
30
40
  };
31
-
32
- /**
33
- * Message ids that will be passed to translateWithId().
34
- */
35
-
36
- function translateWithId(messageId) {
37
- return translationIds[messageId];
38
- }
39
41
 
40
42
  // https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
41
43
  function usePrevious(value) {
@@ -92,7 +94,7 @@ function PaginationItem({
92
94
  page,
93
95
  isActive,
94
96
  onClick,
95
- translateWithId: t = translateWithId
97
+ translateWithId: t = defaultTranslateWithId
96
98
  }) {
97
99
  const prefix = usePrefix.usePrefix();
98
100
  const itemLabel = t('carbon.pagination-nav.item');
@@ -115,7 +117,7 @@ function PaginationOverflow({
115
117
  count = NaN,
116
118
  onSelect,
117
119
  disableOverflow,
118
- translateWithId: t = translateWithId
120
+ translateWithId: t = defaultTranslateWithId
119
121
  }) {
120
122
  const prefix = usePrefix.usePrefix();
121
123
 
@@ -182,7 +184,7 @@ const PaginationNav = /*#__PURE__*/React.forwardRef(({
182
184
  size = 'lg',
183
185
  tooltipAlignment,
184
186
  tooltipPosition,
185
- translateWithId: t = translateWithId,
187
+ translateWithId: t = defaultTranslateWithId,
186
188
  ...rest
187
189
  }, ref) => {
188
190
  const smMediaQuery = `(max-width: ${layout.breakpoints.sm.width})`;
@@ -383,8 +385,7 @@ PaginationItem.propTypes = {
383
385
  */
384
386
  page: PropTypes.number,
385
387
  /**
386
- * Specify a custom translation function that takes in a message identifier
387
- * and returns the localized string for the message
388
+ * Translates component strings using your i18n tool.
388
389
  */
389
390
  translateWithId: PropTypes.func
390
391
  };
@@ -402,8 +403,7 @@ PaginationOverflow.propTypes = {
402
403
  */
403
404
  onSelect: PropTypes.func,
404
405
  /**
405
- * Specify a custom translation function that takes in a message identifier
406
- * and returns the localized string for the message
406
+ * Translates component strings using your i18n tool.
407
407
  */
408
408
  translateWithId: PropTypes.func
409
409
  };
@@ -453,8 +453,7 @@ PaginationNav.propTypes = {
453
453
  */
454
454
  totalItems: PropTypes.number,
455
455
  /**
456
- * Specify a custom translation function that takes in a message identifier
457
- * and returns the localized string for the message
456
+ * Translates component strings using your i18n tool.
458
457
  */
459
458
  translateWithId: PropTypes.func
460
459
  };
@@ -50,10 +50,10 @@ const Popover = /*#__PURE__*/React.forwardRef(function PopoverRenderFunction({
50
50
  open,
51
51
  alignmentAxisOffset,
52
52
  ...rest
53
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
53
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
54
54
  },
55
55
  //this is a workaround, have to come back and fix this.
56
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
56
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
57
57
  forwardRef) {
58
58
  const prefix = usePrefix.usePrefix();
59
59
  const floating = React.useRef(null);
@@ -96,9 +96,9 @@ forwardRef) {
96
96
  // we look to see if any of the children has a className containing "slug"
97
97
  const initialCaretHeight = React.Children.toArray(children).some(x => {
98
98
  return (
99
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
99
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
100
100
  x?.props?.className?.includes('slug') ||
101
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
101
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
102
102
  x?.props?.className?.includes('ai-label')
103
103
  );
104
104
  }) ? 7 : 6;
@@ -219,7 +219,7 @@ forwardRef) {
219
219
  [`${prefix}--popover--tab-tip`]: isTabTip
220
220
  }, customClassName);
221
221
  const mappedChildren = React.Children.map(children, child => {
222
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
222
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
223
223
  const item = child;
224
224
  const displayName = item?.type?.displayName;
225
225
 
@@ -234,13 +234,13 @@ forwardRef) {
234
234
  const isTriggerComponent = enableFloatingStyles && displayName && ['ToggletipButton'].includes(displayName);
235
235
  const isAllowedTriggerComponent = enableFloatingStyles && !['ToggletipContent', 'PopoverContent'].includes(displayName);
236
236
  if (/*#__PURE__*/React.isValidElement(item) && (isTriggerElement || isTriggerComponent || isAllowedTriggerComponent)) {
237
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
237
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
238
238
  const className = item?.props?.className;
239
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
239
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
240
240
  const ref = (item?.props).ref;
241
241
  const tabTipClasses = cx(`${prefix}--popover--tab-tip__button`, className);
242
242
 
243
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
243
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
244
244
  return /*#__PURE__*/React.cloneElement(item, {
245
245
  className: isTabTip && item?.type === 'button' ? tabTipClasses : className || '',
246
246
  // With cloneElement, if you pass a `ref`, it overrides the original ref.
@@ -59,7 +59,7 @@ function ProgressBar({
59
59
  });
60
60
  let StatusIcon = null;
61
61
  if (isError) {
62
- // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
62
+ // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
63
63
  StatusIcon = /*#__PURE__*/React.forwardRef((props, ref) => {
64
64
  return /*#__PURE__*/React.createElement(iconsReact.ErrorFilled, _rollupPluginBabelHelpers.extends({
65
65
  ref: ref,
@@ -67,7 +67,7 @@ function ProgressBar({
67
67
  }, props));
68
68
  });
69
69
  } else if (isFinished) {
70
- // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
70
+ // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
71
71
  StatusIcon = /*#__PURE__*/React.forwardRef((props, ref) => {
72
72
  return /*#__PURE__*/React.createElement(iconsReact.CheckmarkFilled, _rollupPluginBabelHelpers.extends({
73
73
  ref: ref,
@@ -1,22 +1,19 @@
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
7
  import PropTypes from 'prop-types';
8
8
  import React from 'react';
9
- import { TranslateWithId } from '../../types/common';
10
- declare const defaultTranslations: {
11
- readonly 'carbon.progress-step.complete': "Complete";
12
- readonly 'carbon.progress-step.incomplete': "Incomplete";
13
- readonly 'carbon.progress-step.current': "Current";
14
- readonly 'carbon.progress-step.invalid': "Invalid";
9
+ import type { TranslateWithId } from '../../types/common';
10
+ declare const translationIds: {
11
+ readonly 'carbon.progress-step.complete': "carbon.progress-step.complete";
12
+ readonly 'carbon.progress-step.incomplete': "carbon.progress-step.incomplete";
13
+ readonly 'carbon.progress-step.current': "carbon.progress-step.current";
14
+ readonly 'carbon.progress-step.invalid': "carbon.progress-step.invalid";
15
15
  };
16
- /**
17
- * Message ids that will be passed to translateWithId().
18
- */
19
- type TranslationKey = keyof typeof defaultTranslations;
16
+ type TranslationKey = keyof typeof translationIds;
20
17
  export interface ProgressIndicatorProps extends Omit<React.HTMLAttributes<HTMLUListElement>, 'onChange'> {
21
18
  /**
22
19
  * Provide `<ProgressStep>` components to be rendered in the
@@ -32,7 +29,7 @@ export interface ProgressIndicatorProps extends Omit<React.HTMLAttributes<HTMLUL
32
29
  */
33
30
  currentIndex?: number;
34
31
  /**
35
- * Optional callback called if a ProgressStep is clicked on. Returns the index of the step.
32
+ * Optional callback called if a ProgressStep is clicked on. Returns the index of the step.
36
33
  */
37
34
  onChange?: (data: number) => void;
38
35
  /**
@@ -61,7 +58,7 @@ declare namespace ProgressIndicator {
61
58
  */
62
59
  currentIndex: PropTypes.Requireable<number>;
63
60
  /**
64
- * Optional callback called if a ProgressStep is clicked on. Returns the index of the step.
61
+ * Optional callback called if a ProgressStep is clicked on. Returns the index of the step.
65
62
  */
66
63
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
67
64
  /**
@@ -176,8 +173,7 @@ declare namespace ProgressStep {
176
173
  */
177
174
  tooltipId: PropTypes.Requireable<string>;
178
175
  /**
179
- * Optional method that takes in a message id and returns an
180
- * internationalized string.
176
+ * Translates component strings using your i18n tool.
181
177
  */
182
178
  translateWithId: PropTypes.Requireable<(...args: any[]) => any>;
183
179
  };
@@ -18,20 +18,21 @@ var usePrefix = require('../../internal/usePrefix.js');
18
18
  var Text = require('../Text/Text.js');
19
19
  require('../Text/TextDirection.js');
20
20
 
21
+ const translationIds = {
22
+ 'carbon.progress-step.complete': 'carbon.progress-step.complete',
23
+ 'carbon.progress-step.incomplete': 'carbon.progress-step.incomplete',
24
+ 'carbon.progress-step.current': 'carbon.progress-step.current',
25
+ 'carbon.progress-step.invalid': 'carbon.progress-step.invalid'
26
+ };
21
27
  const defaultTranslations = {
22
- 'carbon.progress-step.complete': 'Complete',
23
- 'carbon.progress-step.incomplete': 'Incomplete',
24
- 'carbon.progress-step.current': 'Current',
25
- 'carbon.progress-step.invalid': 'Invalid'
28
+ [translationIds['carbon.progress-step.complete']]: 'Complete',
29
+ [translationIds['carbon.progress-step.incomplete']]: 'Incomplete',
30
+ [translationIds['carbon.progress-step.current']]: 'Current',
31
+ [translationIds['carbon.progress-step.invalid']]: 'Invalid'
26
32
  };
27
-
28
- /**
29
- * Message ids that will be passed to translateWithId().
30
- */
31
-
32
- function translateWithId(messageId) {
33
+ const defaultTranslateWithId = messageId => {
33
34
  return defaultTranslations[messageId];
34
- }
35
+ };
35
36
  function ProgressIndicator({
36
37
  children,
37
38
  className: customClassName,
@@ -103,7 +104,7 @@ ProgressIndicator.propTypes = {
103
104
  */
104
105
  currentIndex: PropTypes.number,
105
106
  /**
106
- * Optional callback called if a ProgressStep is clicked on. Returns the index of the step.
107
+ * Optional callback called if a ProgressStep is clicked on. Returns the index of the step.
107
108
  */
108
109
  onChange: PropTypes.func,
109
110
  /**
@@ -125,7 +126,7 @@ function ProgressStep({
125
126
  secondaryLabel,
126
127
  disabled,
127
128
  onClick,
128
- translateWithId: t = translateWithId,
129
+ translateWithId: t = defaultTranslateWithId,
129
130
  ...rest
130
131
  }) {
131
132
  const prefix = usePrefix.usePrefix();
@@ -255,8 +256,7 @@ ProgressStep.propTypes = {
255
256
  */
256
257
  tooltipId: PropTypes.string,
257
258
  /**
258
- * Optional method that takes in a message id and returns an
259
- * internationalized string.
259
+ * Translates component strings using your i18n tool.
260
260
  */
261
261
  translateWithId: PropTypes.func
262
262
  };
@@ -57,7 +57,7 @@ const RadioButton = /*#__PURE__*/React.forwardRef((props, ref) => {
57
57
  const candidateIsAILabel = utils.isComponentElement(candidate, index.AILabel);
58
58
  const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/React.cloneElement(candidate, {
59
59
  size: candidate.props?.['kind'] === 'inline' ? 'md' : 'mini'
60
- }) : null;
60
+ }) : candidate;
61
61
  return /*#__PURE__*/React.createElement("div", {
62
62
  className: wrapperClasses
63
63
  }, /*#__PURE__*/React.createElement("input", _rollupPluginBabelHelpers.extends({}, rest, {
@@ -114,7 +114,7 @@ const RadioButtonGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
114
114
  const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/React.cloneElement(candidate, {
115
115
  size: 'mini',
116
116
  kind: 'default'
117
- }) : null;
117
+ }) : candidate;
118
118
  return /*#__PURE__*/React.createElement("div", {
119
119
  className: wrapperClasses,
120
120
  ref: mergeRefs.mergeRefs(divRef, ref)
@@ -82,7 +82,7 @@ const RadioTile = /*#__PURE__*/React.forwardRef(({
82
82
  const candidateIsAILabel = utils.isComponentElement(candidate, index$1.AILabel);
83
83
  const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/React.cloneElement(candidate, {
84
84
  size: 'xs'
85
- }) : null;
85
+ }) : candidate;
86
86
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("input", {
87
87
  checked: checked,
88
88
  className: `${prefix}--tile-input`,