@carbon/react 1.90.0-rc.0 → 1.91.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 (320) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +923 -964
  2. package/es/components/AILabel/index.js +8 -6
  3. package/es/components/Breadcrumb/BreadcrumbItem.js +2 -0
  4. package/es/components/Button/Button.js +3 -0
  5. package/es/components/ChatButton/ChatButton.js +1 -0
  6. package/es/components/CheckboxGroup/CheckboxGroup.js +21 -2
  7. package/es/components/CodeSnippet/CodeSnippet.d.ts +1 -1
  8. package/es/components/CodeSnippet/CodeSnippet.js +1 -1
  9. package/es/components/ComboBox/ComboBox.js +18 -13
  10. package/es/components/ComboButton/index.js +2 -1
  11. package/es/components/ComposedModal/ComposedModal.js +5 -2
  12. package/es/components/Copy/Copy.d.ts +1 -1
  13. package/es/components/Copy/Copy.js +1 -1
  14. package/es/components/CopyButton/CopyButton.d.ts +1 -1
  15. package/es/components/CopyButton/CopyButton.js +1 -1
  16. package/es/components/DataTable/DataTable.d.ts +60 -15
  17. package/es/components/DataTable/DataTable.js +119 -178
  18. package/es/components/DataTable/Table.d.ts +2 -2
  19. package/es/components/DataTable/Table.js +4 -4
  20. package/es/components/DataTable/TableExpandHeader.d.ts +1 -1
  21. package/es/components/DataTable/TableExpandHeader.js +6 -2
  22. package/es/components/DataTable/TableExpandRow.js +1 -0
  23. package/es/components/DataTable/TableHeader.js +2 -0
  24. package/es/components/DataTable/TableRow.js +5 -0
  25. package/es/components/DataTable/TableSlugRow.js +1 -0
  26. package/es/components/DataTable/TableToolbarMenu.js +3 -0
  27. package/es/components/DataTable/state/sorting.d.ts +3 -1
  28. package/es/components/DataTable/state/sorting.js +2 -0
  29. package/es/components/DataTable/tools/sorting.js +1 -0
  30. package/es/components/DatePicker/DatePicker.d.ts +0 -12
  31. package/es/components/DatePicker/DatePicker.js +17 -6
  32. package/es/components/DatePicker/plugins/rangePlugin.d.ts +19 -2
  33. package/es/components/DatePicker/plugins/rangePlugin.js +18 -14
  34. package/es/components/DatePickerInput/DatePickerInput.js +6 -0
  35. package/es/components/Dialog/Dialog.js +10 -2
  36. package/es/components/Dropdown/Dropdown.js +17 -16
  37. package/es/components/ErrorBoundary/ErrorBoundaryContext.js +1 -0
  38. package/es/components/FeatureFlags/index.js +1 -0
  39. package/es/components/FileUploader/FileUploader.js +9 -2
  40. package/es/components/FileUploader/FileUploaderButton.js +1 -1
  41. package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
  42. package/es/components/FileUploader/FileUploaderItem.js +3 -0
  43. package/es/components/FluidMultiSelect/FluidMultiSelect.js +2 -0
  44. package/es/components/FluidNumberInput/FluidNumberInput.js +3 -2
  45. package/es/components/FluidSearch/FluidSearch.js +3 -2
  46. package/es/components/FluidSelect/FluidSelect.js +3 -2
  47. package/es/components/FluidTextInput/FluidTextInput.js +3 -2
  48. package/es/components/FluidTimePicker/FluidTimePicker.js +11 -4
  49. package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +3 -2
  50. package/es/components/Grid/CSSGrid.js +5 -0
  51. package/es/components/Grid/Column.js +3 -0
  52. package/es/components/Grid/ColumnHang.js +1 -0
  53. package/es/components/Grid/FlexGrid.js +1 -0
  54. package/es/components/Grid/Row.js +1 -0
  55. package/es/components/Heading/index.js +3 -1
  56. package/es/components/IconButton/index.js +5 -3
  57. package/es/components/IconIndicator/index.js +4 -2
  58. package/es/components/InlineCheckbox/InlineCheckbox.js +3 -2
  59. package/es/components/Layout/index.js +6 -4
  60. package/es/components/LayoutDirection/LayoutDirection.js +2 -0
  61. package/es/components/Link/Link.js +3 -0
  62. package/es/components/ListBox/ListBoxMenuItem.js +4 -1
  63. package/es/components/ListBox/next/ListBoxTrigger.js +3 -2
  64. package/es/components/Menu/Menu.js +6 -9
  65. package/es/components/Menu/MenuContext.js +1 -0
  66. package/es/components/Menu/MenuItem.d.ts +1 -1
  67. package/es/components/Menu/MenuItem.js +10 -18
  68. package/es/components/MenuButton/index.js +7 -2
  69. package/es/components/Modal/Modal.js +4 -1
  70. package/es/components/ModalWrapper/ModalWrapper.js +2 -0
  71. package/es/components/MultiSelect/FilterableMultiSelect.js +25 -6
  72. package/es/components/MultiSelect/MultiSelect.js +22 -17
  73. package/es/components/Notification/Notification.d.ts +6 -6
  74. package/es/components/Notification/Notification.js +7 -7
  75. package/es/components/NumberInput/NumberInput.js +7 -1
  76. package/es/components/OverflowMenu/OverflowMenu.js +3 -1
  77. package/es/components/OverflowMenu/next/index.js +4 -3
  78. package/es/components/OverflowMenuItem/OverflowMenuItem.js +2 -0
  79. package/es/components/PageHeader/PageHeader.d.ts +3 -3
  80. package/es/components/PageHeader/PageHeader.js +22 -8
  81. package/es/components/Pagination/Pagination.js +6 -2
  82. package/es/components/PaginationNav/PaginationNav.js +2 -5
  83. package/es/components/Popover/index.js +15 -5
  84. package/es/components/ProgressBar/ProgressBar.js +4 -2
  85. package/es/components/RadioTile/RadioTile.js +2 -2
  86. package/es/components/Search/Search.d.ts +4 -2
  87. package/es/components/Search/Search.js +7 -6
  88. package/es/components/Select/Select.js +2 -3
  89. package/es/components/ShapeIndicator/index.js +4 -2
  90. package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +4 -4
  91. package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +1 -2
  92. package/es/components/SkeletonText/SkeletonText.js +0 -2
  93. package/es/components/Slider/Slider.d.ts +144 -188
  94. package/es/components/Slider/Slider.js +798 -726
  95. package/es/components/Slider/index.d.ts +2 -2
  96. package/es/components/Stack/HStack.js +1 -0
  97. package/es/components/Stack/Stack.js +6 -9
  98. package/es/components/Stack/VStack.js +1 -0
  99. package/es/components/StructuredList/StructuredList.js +3 -0
  100. package/es/components/Switch/Switch.js +1 -1
  101. package/es/components/Tabs/Tabs.d.ts +4 -0
  102. package/es/components/Tabs/Tabs.js +28 -17
  103. package/es/components/Tag/DismissibleTag.js +2 -0
  104. package/es/components/Tag/OperationalTag.js +2 -0
  105. package/es/components/Tag/SelectableTag.js +2 -0
  106. package/es/components/Tag/Tag.js +4 -0
  107. package/es/components/Tag/isEllipsisActive.js +1 -0
  108. package/es/components/Text/Text.js +1 -0
  109. package/es/components/TextArea/TextArea.js +13 -6
  110. package/es/components/TextInput/ControlledPasswordInput.js +4 -6
  111. package/es/components/TextInput/PasswordInput.js +9 -4
  112. package/es/components/TextInput/TextInput.js +6 -4
  113. package/es/components/TextInput/util.d.ts +17 -5
  114. package/es/components/TextInput/util.js +2 -7
  115. package/es/components/Theme/index.js +8 -3
  116. package/es/components/Tile/Tile.js +14 -17
  117. package/es/components/TimePicker/TimePicker.js +1 -0
  118. package/es/components/Toggle/Toggle.js +1 -1
  119. package/es/components/Toggletip/index.js +4 -0
  120. package/es/components/Tooltip/DefinitionTooltip.js +1 -0
  121. package/es/components/Tooltip/Tooltip.js +30 -23
  122. package/es/components/TreeView/TreeNode.js +13 -5
  123. package/es/components/TreeView/TreeView.js +7 -0
  124. package/es/components/UIShell/HeaderContainer.js +3 -1
  125. package/es/components/UIShell/HeaderGlobalAction.js +2 -2
  126. package/es/components/UIShell/HeaderMenu.js +3 -3
  127. package/es/components/UIShell/HeaderPanel.d.ts +1 -1
  128. package/es/components/UIShell/HeaderPanel.js +2 -2
  129. package/es/components/UIShell/Link.js +2 -0
  130. package/es/components/UIShell/SideNavItems.js +1 -0
  131. package/es/components/UIShell/SideNavMenu.js +2 -2
  132. package/es/components/UIShell/SideNavMenuItem.js +1 -1
  133. package/es/components/UIShell/SideNavSwitcher.js +1 -1
  134. package/es/components/UIShell/Switcher.js +2 -1
  135. package/es/components/UIShell/SwitcherItem.js +4 -2
  136. package/es/index.d.ts +12 -13
  137. package/es/index.js +25 -24
  138. package/es/internal/FloatingMenu.js +7 -1
  139. package/es/internal/Selection.js +12 -3
  140. package/es/internal/defaultItemToString.d.ts +7 -0
  141. package/es/internal/defaultItemToString.js +17 -0
  142. package/es/internal/index.d.ts +1 -0
  143. package/es/internal/useMergedRefs.js +1 -0
  144. package/es/internal/useNoInteractiveChildren.js +4 -0
  145. package/es/internal/useOutsideClick.js +1 -0
  146. package/es/internal/useOverflowItems.js +6 -0
  147. package/es/internal/useResizeObserver.js +4 -0
  148. package/es/internal/useSavedCallback.js +1 -0
  149. package/es/internal/warning.js +1 -0
  150. package/es/prop-types/deprecateValuesWithin.d.ts +8 -1
  151. package/es/prop-types/deprecateValuesWithin.js +6 -6
  152. package/es/prop-types/isRequiredOneOf.js +4 -1
  153. package/es/prop-types/requiredIfGivenPropIsTruthy.d.ts +8 -7
  154. package/es/prop-types/requiredIfGivenPropIsTruthy.js +10 -10
  155. package/es/tools/events.js +3 -1
  156. package/es/tools/wrapComponent.js +1 -0
  157. package/lib/components/AILabel/index.js +8 -6
  158. package/lib/components/Breadcrumb/BreadcrumbItem.js +2 -0
  159. package/lib/components/Button/Button.js +3 -0
  160. package/lib/components/ChatButton/ChatButton.js +1 -0
  161. package/lib/components/CheckboxGroup/CheckboxGroup.js +20 -1
  162. package/lib/components/CodeSnippet/CodeSnippet.d.ts +1 -1
  163. package/lib/components/CodeSnippet/CodeSnippet.js +1 -1
  164. package/lib/components/ComboBox/ComboBox.js +20 -15
  165. package/lib/components/ComboButton/index.js +2 -1
  166. package/lib/components/ComposedModal/ComposedModal.js +5 -2
  167. package/lib/components/Copy/Copy.d.ts +1 -1
  168. package/lib/components/Copy/Copy.js +1 -1
  169. package/lib/components/CopyButton/CopyButton.d.ts +1 -1
  170. package/lib/components/CopyButton/CopyButton.js +1 -1
  171. package/lib/components/DataTable/DataTable.d.ts +60 -15
  172. package/lib/components/DataTable/DataTable.js +119 -178
  173. package/lib/components/DataTable/Table.d.ts +2 -2
  174. package/lib/components/DataTable/Table.js +4 -4
  175. package/lib/components/DataTable/TableExpandHeader.d.ts +1 -1
  176. package/lib/components/DataTable/TableExpandHeader.js +6 -2
  177. package/lib/components/DataTable/TableExpandRow.js +1 -0
  178. package/lib/components/DataTable/TableHeader.js +2 -0
  179. package/lib/components/DataTable/TableRow.js +5 -0
  180. package/lib/components/DataTable/TableSlugRow.js +1 -0
  181. package/lib/components/DataTable/TableToolbarMenu.js +3 -0
  182. package/lib/components/DataTable/state/sorting.d.ts +3 -1
  183. package/lib/components/DataTable/state/sorting.js +2 -0
  184. package/lib/components/DataTable/tools/sorting.js +1 -0
  185. package/lib/components/DatePicker/DatePicker.d.ts +0 -12
  186. package/lib/components/DatePicker/DatePicker.js +16 -5
  187. package/lib/components/DatePicker/plugins/rangePlugin.d.ts +19 -2
  188. package/lib/components/DatePicker/plugins/rangePlugin.js +18 -16
  189. package/lib/components/DatePickerInput/DatePickerInput.js +6 -0
  190. package/lib/components/Dialog/Dialog.js +10 -2
  191. package/lib/components/Dropdown/Dropdown.js +19 -18
  192. package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +1 -0
  193. package/lib/components/FeatureFlags/index.js +1 -0
  194. package/lib/components/FileUploader/FileUploader.js +9 -2
  195. package/lib/components/FileUploader/FileUploaderButton.js +1 -1
  196. package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
  197. package/lib/components/FileUploader/FileUploaderItem.js +3 -0
  198. package/lib/components/FluidMultiSelect/FluidMultiSelect.js +2 -0
  199. package/lib/components/FluidNumberInput/FluidNumberInput.js +3 -2
  200. package/lib/components/FluidSearch/FluidSearch.js +3 -2
  201. package/lib/components/FluidSelect/FluidSelect.js +3 -2
  202. package/lib/components/FluidTextInput/FluidTextInput.js +3 -2
  203. package/lib/components/FluidTimePicker/FluidTimePicker.js +11 -4
  204. package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +3 -2
  205. package/lib/components/Grid/CSSGrid.js +5 -0
  206. package/lib/components/Grid/Column.js +3 -0
  207. package/lib/components/Grid/ColumnHang.js +1 -0
  208. package/lib/components/Grid/FlexGrid.js +1 -0
  209. package/lib/components/Grid/Row.js +1 -0
  210. package/lib/components/Heading/index.js +3 -1
  211. package/lib/components/IconButton/index.js +5 -3
  212. package/lib/components/IconIndicator/index.js +4 -2
  213. package/lib/components/InlineCheckbox/InlineCheckbox.js +3 -2
  214. package/lib/components/Layout/index.js +6 -4
  215. package/lib/components/LayoutDirection/LayoutDirection.js +2 -0
  216. package/lib/components/Link/Link.js +3 -0
  217. package/lib/components/ListBox/ListBoxMenuItem.js +4 -1
  218. package/lib/components/ListBox/next/ListBoxTrigger.js +3 -2
  219. package/lib/components/Menu/Menu.js +6 -9
  220. package/lib/components/Menu/MenuContext.js +1 -0
  221. package/lib/components/Menu/MenuItem.d.ts +1 -1
  222. package/lib/components/Menu/MenuItem.js +11 -19
  223. package/lib/components/MenuButton/index.js +7 -2
  224. package/lib/components/Modal/Modal.js +4 -1
  225. package/lib/components/ModalWrapper/ModalWrapper.js +2 -0
  226. package/lib/components/MultiSelect/FilterableMultiSelect.js +32 -13
  227. package/lib/components/MultiSelect/MultiSelect.js +23 -18
  228. package/lib/components/Notification/Notification.d.ts +6 -6
  229. package/lib/components/Notification/Notification.js +7 -7
  230. package/lib/components/NumberInput/NumberInput.js +7 -1
  231. package/lib/components/OverflowMenu/OverflowMenu.js +3 -1
  232. package/lib/components/OverflowMenu/next/index.js +4 -3
  233. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +2 -0
  234. package/lib/components/PageHeader/PageHeader.d.ts +3 -3
  235. package/lib/components/PageHeader/PageHeader.js +22 -8
  236. package/lib/components/Pagination/Pagination.js +6 -2
  237. package/lib/components/PaginationNav/PaginationNav.js +2 -5
  238. package/lib/components/Popover/index.js +15 -5
  239. package/lib/components/ProgressBar/ProgressBar.js +4 -2
  240. package/lib/components/RadioTile/RadioTile.js +2 -2
  241. package/lib/components/Search/Search.d.ts +4 -2
  242. package/lib/components/Search/Search.js +7 -6
  243. package/lib/components/Select/Select.js +2 -3
  244. package/lib/components/ShapeIndicator/index.js +4 -2
  245. package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +4 -4
  246. package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +1 -2
  247. package/lib/components/SkeletonText/SkeletonText.js +0 -2
  248. package/lib/components/Slider/Slider.d.ts +144 -188
  249. package/lib/components/Slider/Slider.js +795 -725
  250. package/lib/components/Slider/index.d.ts +2 -2
  251. package/lib/components/Stack/HStack.js +1 -0
  252. package/lib/components/Stack/Stack.js +6 -9
  253. package/lib/components/Stack/VStack.js +1 -0
  254. package/lib/components/StructuredList/StructuredList.js +3 -0
  255. package/lib/components/Switch/Switch.js +1 -1
  256. package/lib/components/Tabs/Tabs.d.ts +4 -0
  257. package/lib/components/Tabs/Tabs.js +28 -17
  258. package/lib/components/Tag/DismissibleTag.js +2 -0
  259. package/lib/components/Tag/OperationalTag.js +2 -0
  260. package/lib/components/Tag/SelectableTag.js +2 -0
  261. package/lib/components/Tag/Tag.js +4 -0
  262. package/lib/components/Tag/isEllipsisActive.js +1 -0
  263. package/lib/components/Text/Text.js +1 -0
  264. package/lib/components/TextArea/TextArea.js +13 -6
  265. package/lib/components/TextInput/ControlledPasswordInput.js +3 -5
  266. package/lib/components/TextInput/PasswordInput.js +8 -3
  267. package/lib/components/TextInput/TextInput.js +5 -3
  268. package/lib/components/TextInput/util.d.ts +17 -5
  269. package/lib/components/TextInput/util.js +2 -7
  270. package/lib/components/Theme/index.js +8 -3
  271. package/lib/components/Tile/Tile.js +14 -17
  272. package/lib/components/TimePicker/TimePicker.js +1 -0
  273. package/lib/components/Toggle/Toggle.js +1 -1
  274. package/lib/components/Toggletip/index.js +4 -0
  275. package/lib/components/Tooltip/DefinitionTooltip.js +1 -0
  276. package/lib/components/Tooltip/Tooltip.js +30 -23
  277. package/lib/components/TreeView/TreeNode.js +13 -5
  278. package/lib/components/TreeView/TreeView.js +7 -0
  279. package/lib/components/UIShell/HeaderContainer.js +3 -1
  280. package/lib/components/UIShell/HeaderGlobalAction.js +2 -2
  281. package/lib/components/UIShell/HeaderMenu.js +3 -3
  282. package/lib/components/UIShell/HeaderPanel.d.ts +1 -1
  283. package/lib/components/UIShell/HeaderPanel.js +2 -2
  284. package/lib/components/UIShell/Link.js +2 -0
  285. package/lib/components/UIShell/SideNavItems.js +1 -0
  286. package/lib/components/UIShell/SideNavMenu.js +2 -2
  287. package/lib/components/UIShell/SideNavMenuItem.js +1 -1
  288. package/lib/components/UIShell/SideNavSwitcher.js +1 -1
  289. package/lib/components/UIShell/Switcher.js +2 -1
  290. package/lib/components/UIShell/SwitcherItem.js +4 -2
  291. package/lib/index.d.ts +12 -13
  292. package/lib/index.js +51 -28
  293. package/lib/internal/FloatingMenu.js +7 -1
  294. package/lib/internal/Selection.js +12 -3
  295. package/lib/internal/defaultItemToString.d.ts +7 -0
  296. package/lib/internal/defaultItemToString.js +19 -0
  297. package/lib/internal/index.d.ts +1 -0
  298. package/lib/internal/useMergedRefs.js +1 -0
  299. package/lib/internal/useNoInteractiveChildren.js +4 -0
  300. package/lib/internal/useOutsideClick.js +1 -0
  301. package/lib/internal/useOverflowItems.js +6 -0
  302. package/lib/internal/useResizeObserver.js +4 -0
  303. package/lib/internal/useSavedCallback.js +1 -0
  304. package/lib/internal/warning.js +1 -0
  305. package/lib/prop-types/deprecateValuesWithin.d.ts +8 -1
  306. package/lib/prop-types/deprecateValuesWithin.js +6 -8
  307. package/lib/prop-types/isRequiredOneOf.js +4 -1
  308. package/lib/prop-types/requiredIfGivenPropIsTruthy.d.ts +8 -7
  309. package/lib/prop-types/requiredIfGivenPropIsTruthy.js +10 -12
  310. package/lib/tools/events.js +3 -1
  311. package/lib/tools/wrapComponent.js +1 -0
  312. package/package.json +10 -9
  313. package/es/components/MultiSelect/tools/itemToString.d.ts +0 -1
  314. package/es/components/MultiSelect/tools/itemToString.js +0 -21
  315. package/es/components/Slider/index.js +0 -14
  316. package/es/internal/createClassWrapper.js +0 -23
  317. package/lib/components/MultiSelect/tools/itemToString.d.ts +0 -1
  318. package/lib/components/MultiSelect/tools/itemToString.js +0 -23
  319. package/lib/components/Slider/index.js +0 -20
  320. package/lib/internal/createClassWrapper.js +0 -25
@@ -53,7 +53,9 @@ function getPageSize(pageSizes, pageSize) {
53
53
  }
54
54
  return pageSizes[0].value;
55
55
  }
56
- const Pagination = /*#__PURE__*/React.forwardRef(function Pagination({
56
+
57
+ // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
58
+ const Pagination = /*#__PURE__*/React.forwardRef(({
57
59
  backwardText = 'Previous page',
58
60
  className: customClassName = '',
59
61
  disabled = false,
@@ -64,6 +66,7 @@ const Pagination = /*#__PURE__*/React.forwardRef(function Pagination({
64
66
  itemRangeText = (min, max, total) => `${min}–${max} of ${total} items`,
65
67
  itemsPerPageText = 'Items per page:',
66
68
  onChange,
69
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
67
70
  pageNumberText: _pageNumberText = 'Page Number',
68
71
  pageRangeText = (_current, total) => `of ${total} ${total === 1 ? 'page' : 'pages'}`,
69
72
  page: controlledPage = 1,
@@ -76,7 +79,7 @@ const Pagination = /*#__PURE__*/React.forwardRef(function Pagination({
76
79
  size = 'md',
77
80
  totalItems,
78
81
  ...rest
79
- }, ref) {
82
+ }, ref) => {
80
83
  const prefix = usePrefix.usePrefix();
81
84
  const inputId = useId.useFallbackId(id?.toString());
82
85
  const backBtnRef = React.useRef(null);
@@ -126,6 +129,7 @@ const Pagination = /*#__PURE__*/React.forwardRef(function Pagination({
126
129
  handleFocus(focusTarget);
127
130
  setFocusTarget(null);
128
131
  }
132
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
129
133
  }, [focusTarget]);
130
134
 
131
135
  // Sync state with props
@@ -111,7 +111,6 @@ function PaginationOverflow({
111
111
  fromIndex = NaN,
112
112
  count = NaN,
113
113
  onSelect,
114
- // eslint-disable-next-line react/prop-types
115
114
  disableOverflow,
116
115
  translateWithId: t = translateWithId
117
116
  }) {
@@ -169,7 +168,7 @@ function PaginationOverflow({
169
168
  }
170
169
  return null;
171
170
  }
172
- const PaginationNav = /*#__PURE__*/React.forwardRef(function PaginationNav({
171
+ const PaginationNav = /*#__PURE__*/React.forwardRef(({
173
172
  className,
174
173
  onChange = () => {},
175
174
  totalItems = NaN,
@@ -180,7 +179,7 @@ const PaginationNav = /*#__PURE__*/React.forwardRef(function PaginationNav({
180
179
  size = 'lg',
181
180
  translateWithId: t = translateWithId,
182
181
  ...rest
183
- }, ref) {
182
+ }, ref) => {
184
183
  const smMediaQuery = `(max-width: ${layout.breakpoints.sm.width})`;
185
184
  const isSm = useMatchMedia.useMatchMedia(smMediaQuery);
186
185
  let numberOfPages;
@@ -400,8 +399,6 @@ PaginationNav.propTypes = {
400
399
  * Set this to true if you are having performance problems with large data sets.
401
400
  */
402
401
  disableOverflow: PropTypes.bool,
403
- // eslint-disable-line react/prop-types
404
-
405
402
  /**
406
403
  * The number of items to be shown (minimum of 4 unless props.items < 4).
407
404
  */
@@ -50,8 +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
54
  },
54
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
55
57
  forwardRef) {
56
58
  const prefix = usePrefix.usePrefix();
57
59
  const floating = React.useRef(null);
@@ -93,7 +95,12 @@ forwardRef) {
93
95
  // needs to be placed 1px further outside the popover content. To do so,
94
96
  // we look to see if any of the children has a className containing "slug"
95
97
  const initialCaretHeight = React.Children.toArray(children).some(x => {
96
- return x?.props?.className?.includes('slug') || x?.props?.className?.includes('ai-label');
98
+ return (
99
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
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
102
+ x?.props?.className?.includes('ai-label')
103
+ );
97
104
  }) ? 7 : 6;
98
105
  // These defaults match the defaults defined in packages/styles/scss/components/popover/_popover.scss
99
106
  const popoverDimensions = React.useRef({
@@ -212,6 +219,7 @@ forwardRef) {
212
219
  [`${prefix}--popover--tab-tip`]: isTabTip
213
220
  }, customClassName);
214
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
215
223
  const item = child;
216
224
  const displayName = item?.type?.displayName;
217
225
 
@@ -226,9 +234,13 @@ forwardRef) {
226
234
  const isTriggerComponent = enableFloatingStyles && displayName && ['ToggletipButton'].includes(displayName);
227
235
  const isAllowedTriggerComponent = enableFloatingStyles && !['ToggletipContent', 'PopoverContent'].includes(displayName);
228
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
229
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
230
240
  const ref = (item?.props).ref;
231
241
  const tabTipClasses = cx(`${prefix}--popover--tab-tip__button`, className);
242
+
243
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
232
244
  return /*#__PURE__*/React.cloneElement(item, {
233
245
  className: isTabTip && item?.type === 'button' ? tabTipClasses : className || '',
234
246
  // With cloneElement, if you pass a `ref`, it overrides the original ref.
@@ -278,7 +290,7 @@ Popover.propTypes = {
278
290
  /**
279
291
  * Specify how the popover should align with the trigger element
280
292
  */
281
- align: deprecateValuesWithin.default(PropTypes.oneOf(['top', 'top-left',
293
+ align: deprecateValuesWithin.deprecateValuesWithin(PropTypes.oneOf(['top', 'top-left',
282
294
  // deprecated use top-start instead
283
295
  'top-right',
284
296
  // deprecated use top-end instead
@@ -360,9 +372,7 @@ Popover.propTypes = {
360
372
  */
361
373
  open: PropTypes.bool.isRequired
362
374
  };
363
- function PopoverContentRenderFunction(
364
- // eslint-disable-next-line react/prop-types
365
- {
375
+ function PopoverContentRenderFunction({
366
376
  className,
367
377
  children,
368
378
  ...rest
@@ -59,14 +59,16 @@ function ProgressBar({
59
59
  });
60
60
  let StatusIcon = null;
61
61
  if (isError) {
62
- StatusIcon = /*#__PURE__*/React.forwardRef(function ErrorFilled16(props, ref) {
62
+ // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
63
+ StatusIcon = /*#__PURE__*/React.forwardRef((props, ref) => {
63
64
  return /*#__PURE__*/React.createElement(iconsReact.ErrorFilled, _rollupPluginBabelHelpers.extends({
64
65
  ref: ref,
65
66
  size: 16
66
67
  }, props));
67
68
  });
68
69
  } else if (isFinished) {
69
- StatusIcon = /*#__PURE__*/React.forwardRef(function CheckmarkFilled16(props, ref) {
70
+ // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
71
+ StatusIcon = /*#__PURE__*/React.forwardRef((props, ref) => {
70
72
  return /*#__PURE__*/React.createElement(iconsReact.CheckmarkFilled, _rollupPluginBabelHelpers.extends({
71
73
  ref: ref,
72
74
  size: 16
@@ -27,7 +27,7 @@ var utils = require('../../internal/utils.js');
27
27
  var Text = require('../Text/Text.js');
28
28
 
29
29
  var _RadioButtonChecked, _RadioButton, _CheckmarkFilled;
30
- const RadioTile = /*#__PURE__*/React.forwardRef(function RadioTile({
30
+ const RadioTile = /*#__PURE__*/React.forwardRef(({
31
31
  children,
32
32
  className: customClassName,
33
33
  decorator,
@@ -43,7 +43,7 @@ const RadioTile = /*#__PURE__*/React.forwardRef(function RadioTile({
43
43
  slug,
44
44
  required,
45
45
  ...rest
46
- }, ref) {
46
+ }, ref) => {
47
47
  const prefix = usePrefix.usePrefix();
48
48
  const inputId = useId.useFallbackId(id);
49
49
  const className = cx(customClassName, `${prefix}--tile`, `${prefix}--tile--selectable`, `${prefix}--tile--radio`, {
@@ -63,7 +63,9 @@ export interface SearchProps extends InputPropsBase {
63
63
  */
64
64
  renderIcon?: ComponentType | FunctionComponent;
65
65
  /**
66
- * Specify the role for the underlying `<input>`, defaults to `searchbox`
66
+ * @deprecated Specify the role for the underlying `<input>`.
67
+ * No longer needed since `<input type="search">` already provides the correct semantics.
68
+ * This prop will be removed in the next major release of Carbon.
67
69
  */
68
70
  role?: string;
69
71
  /**
@@ -71,7 +73,7 @@ export interface SearchProps extends InputPropsBase {
71
73
  */
72
74
  size?: 'sm' | 'md' | 'lg';
73
75
  /**
74
- * Optional prop to specify the type of the `<input>`
76
+ * Specify the type of the `<input>`
75
77
  */
76
78
  type?: string;
77
79
  /**
@@ -26,7 +26,7 @@ var FormContext = require('../FluidForm/FormContext.js');
26
26
  var noopFn = require('../../internal/noopFn.js');
27
27
 
28
28
  var _Close;
29
- const Search = /*#__PURE__*/React.forwardRef(function Search({
29
+ const Search = /*#__PURE__*/React.forwardRef(({
30
30
  autoComplete = 'off',
31
31
  className,
32
32
  closeButtonLabelText = 'Clear search input',
@@ -43,12 +43,12 @@ const Search = /*#__PURE__*/React.forwardRef(function Search({
43
43
  onExpand,
44
44
  placeholder = 'Search',
45
45
  renderIcon,
46
- role = 'searchbox',
46
+ role,
47
47
  size = 'md',
48
- type = 'text',
48
+ type = 'search',
49
49
  value,
50
50
  ...rest
51
- }, forwardRef) {
51
+ }, forwardRef) => {
52
52
  const hasPropValue = value || defaultValue ? true : false;
53
53
  const prefix = usePrefix.usePrefix();
54
54
  const {
@@ -242,15 +242,16 @@ Search.propTypes = {
242
242
  */
243
243
  renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
244
244
  /**
245
+ * Deprecated, since <input type="search"> already provides correct semantics.
245
246
  * Specify the role for the underlying `<input>`, defaults to `searchbox`
246
247
  */
247
- role: PropTypes.string,
248
+ role: deprecate.deprecate(PropTypes.string, 'The `role` prop has been deprecated since <input type="search"> already provides correct semantics. ' + 'It will be removed in the next major release of Carbon.'),
248
249
  /**
249
250
  * Specify the size of the Search
250
251
  */
251
252
  size: PropTypes.oneOf(['sm', 'md', 'lg']),
252
253
  /**
253
- * Optional prop to specify the type of the `<input>`
254
+ * Specify the type of the `<input>`
254
255
  */
255
256
  type: PropTypes.string,
256
257
  /**
@@ -25,7 +25,7 @@ var index = require('../AILabel/index.js');
25
25
  var utils = require('../../internal/utils.js');
26
26
  var Text = require('../Text/Text.js');
27
27
 
28
- const Select = /*#__PURE__*/React.forwardRef(function Select({
28
+ const Select = /*#__PURE__*/React.forwardRef(({
29
29
  className,
30
30
  decorator,
31
31
  id,
@@ -35,7 +35,6 @@ const Select = /*#__PURE__*/React.forwardRef(function Select({
35
35
  children,
36
36
  // reserved for use with Pagination component
37
37
  noLabel = false,
38
- // eslint-disable-next-line no-unused-vars
39
38
  hideLabel = false,
40
39
  invalid = false,
41
40
  invalidText = '',
@@ -48,7 +47,7 @@ const Select = /*#__PURE__*/React.forwardRef(function Select({
48
47
  onChange,
49
48
  slug,
50
49
  ...other
51
- }, ref) {
50
+ }, ref) => {
52
51
  const prefix = usePrefix.usePrefix();
53
52
  const {
54
53
  isFluid
@@ -50,13 +50,15 @@ const shapeTypes = {
50
50
  incomplete: incompleteIcon,
51
51
  draft: iconsReact.CircleStroke
52
52
  };
53
- const ShapeIndicator = /*#__PURE__*/React.forwardRef(function ShapeIndicatorContent({
53
+ // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
54
+ const ShapeIndicator = /*#__PURE__*/React.forwardRef(({
54
55
  className: customClassName,
55
56
  kind,
56
57
  label,
57
58
  textSize = 12,
59
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
58
60
  ...rest
59
- }, ref) {
61
+ }, ref) => {
60
62
  const prefix = usePrefix.usePrefix();
61
63
  const classNames = cx(`${prefix}--shape-indicator`, customClassName, {
62
64
  [`${prefix}--shape-indicator--14`]: textSize == 14
@@ -1,11 +1,12 @@
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 { type HTMLAttributes } from 'react';
7
8
  import PropTypes from 'prop-types';
8
- export interface SkeletonPlaceholderProps {
9
+ export interface SkeletonPlaceholderProps extends HTMLAttributes<HTMLDivElement> {
9
10
  /**
10
11
  * Add a custom class to the component to set the height and width
11
12
  */
@@ -15,8 +16,7 @@ declare const SkeletonPlaceholder: {
15
16
  ({ className, ...other }: SkeletonPlaceholderProps): import("react/jsx-runtime").JSX.Element;
16
17
  propTypes: {
17
18
  /**
18
- * Add a custom class to the component
19
- * to set the height and width
19
+ * Add a custom class to the component to set the height and width
20
20
  */
21
21
  className: PropTypes.Requireable<string>;
22
22
  };
@@ -29,8 +29,7 @@ const SkeletonPlaceholder = ({
29
29
  };
30
30
  SkeletonPlaceholder.propTypes = {
31
31
  /**
32
- * Add a custom class to the component
33
- * to set the height and width
32
+ * Add a custom class to the component to set the height and width
34
33
  */
35
34
  className: PropTypes.string
36
35
  };
@@ -70,8 +70,6 @@ const SkeletonText = ({
70
70
  if (lineCountNumber !== 1) {
71
71
  return /*#__PURE__*/React.createElement("div", null, lines);
72
72
  }
73
-
74
- // eslint-disable-next-line react/jsx-no-useless-fragment
75
73
  return /*#__PURE__*/React.createElement(React.Fragment, null, lines);
76
74
  };
77
75
  SkeletonText.propTypes = {
@@ -4,7 +4,8 @@
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, { PureComponent, ReactNode, type ChangeEvent, type FocusEvent, type InputHTMLAttributes, type KeyboardEvent, type KeyboardEventHandler, type MouseEvent, type RefObject, type TouchEvent } from 'react';
7
+ import { type InputHTMLAttributes, type KeyboardEventHandler, type ReactNode } from 'react';
8
+ import PropTypes from 'prop-types';
8
9
  import { TranslateWithId } from '../../types/common';
9
10
  declare const translationIds: {
10
11
  readonly autoCorrectAnnouncement: "carbon.slider.auto-correct-announcement";
@@ -163,191 +164,146 @@ export interface SliderProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
163
164
  */
164
165
  warnText?: ReactNode;
165
166
  }
166
- interface CalcLeftPercentProps {
167
- clientX?: number;
168
- value?: number;
169
- range?: number;
170
- }
171
- declare class Slider extends PureComponent<SliderProps> {
172
- static contextType: React.Context<any>;
173
- static translationIds: "carbon.slider.auto-correct-announcement"[];
174
- state: {
175
- value: number;
176
- valueUpper: number | undefined;
177
- left: number;
178
- leftUpper: number;
179
- needsOnRelease: boolean;
180
- isValid: boolean;
181
- isValidUpper: boolean;
182
- activeHandle: undefined;
183
- correctedValue: null;
184
- correctedPosition: null;
185
- isRtl: boolean;
167
+ export declare const Slider: {
168
+ (props: SliderProps): import("react/jsx-runtime").JSX.Element;
169
+ propTypes: {
170
+ /**
171
+ * The `ariaLabel` for the `<input>`.
172
+ */
173
+ ariaLabelInput: PropTypes.Requireable<string>;
174
+ /**
175
+ * The child nodes.
176
+ */
177
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
178
+ /**
179
+ * The CSS class name for the slider.
180
+ */
181
+ className: PropTypes.Requireable<string>;
182
+ /**
183
+ * `true` to disable this slider.
184
+ */
185
+ disabled: PropTypes.Requireable<boolean>;
186
+ /**
187
+ * The callback to format the label associated with the minimum/maximum value.
188
+ */
189
+ formatLabel: PropTypes.Requireable<(...args: any[]) => any>;
190
+ /**
191
+ * `true` to hide the number input box.
192
+ */
193
+ hideTextInput: PropTypes.Requireable<boolean>;
194
+ /**
195
+ * The ID of the `<input>`.
196
+ */
197
+ id: PropTypes.Requireable<string>;
198
+ /**
199
+ * The `type` attribute of the `<input>`.
200
+ */
201
+ inputType: PropTypes.Requireable<string>;
202
+ /**
203
+ * `Specify whether the Slider is currently invalid
204
+ */
205
+ invalid: PropTypes.Requireable<boolean>;
206
+ /**
207
+ * Provide the text that is displayed when the Slider is in an invalid state
208
+ */
209
+ invalidText: PropTypes.Requireable<PropTypes.ReactNodeLike>;
210
+ /**
211
+ * The label for the slider.
212
+ */
213
+ labelText: PropTypes.Requireable<PropTypes.ReactNodeLike>;
214
+ /**
215
+ * Specify whether you want the underlying label to be visually hidden
216
+ */
217
+ hideLabel: PropTypes.Requireable<boolean>;
218
+ /**
219
+ * `true` to use the light version.
220
+ */
221
+ light: (props: Record<string, any>, propName: string, componentName: string, ...rest: any[]) => any;
222
+ /**
223
+ * The maximum value.
224
+ */
225
+ max: PropTypes.Validator<number>;
226
+ /**
227
+ * The label associated with the maximum value.
228
+ */
229
+ maxLabel: PropTypes.Requireable<string>;
230
+ /**
231
+ * The minimum value.
232
+ */
233
+ min: PropTypes.Validator<number>;
234
+ /**
235
+ * The label associated with the minimum value.
236
+ */
237
+ minLabel: PropTypes.Requireable<string>;
238
+ /**
239
+ * The `name` attribute of the `<input>`.
240
+ */
241
+ name: PropTypes.Requireable<string>;
242
+ /**
243
+ * Provide an optional function to be called when the input element
244
+ * loses focus
245
+ */
246
+ onBlur: PropTypes.Requireable<(...args: any[]) => any>;
247
+ /**
248
+ * The callback to get notified of change in value.
249
+ */
250
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
251
+ /**
252
+ * Provide an optional function to be called when a key is pressed in the number input.
253
+ */
254
+ onInputKeyUp: PropTypes.Requireable<(...args: any[]) => any>;
255
+ /**
256
+ * The callback to get notified of value on handle release.
257
+ */
258
+ onRelease: PropTypes.Requireable<(...args: any[]) => any>;
259
+ /**
260
+ * Whether the slider should be read-only
261
+ */
262
+ readOnly: PropTypes.Requireable<boolean>;
263
+ /**
264
+ * `true` to specify if the control is required.
265
+ */
266
+ required: PropTypes.Requireable<boolean>;
267
+ /**
268
+ * A value determining how much the value should increase/decrease by moving the thumb by mouse. If a value other than 1 is provided and the input is *not* hidden, the new step requirement should be added to a visible label. Values outside the `step` increment will be considered invalid.
269
+ */
270
+ step: PropTypes.Requireable<number>;
271
+ /**
272
+ * A value determining how much the value should increase/decrease by Shift+arrow keys,
273
+ * which will be `(max - min) / stepMultiplier`.
274
+ */
275
+ stepMultiplier: PropTypes.Requireable<number>;
276
+ /**
277
+ * Supply a method to translate internal strings with your i18n tool of
278
+ * choice. Translation keys are available on the `translationIds` field for
279
+ * this component.
280
+ */
281
+ translateWithId: PropTypes.Requireable<(...args: any[]) => any>;
282
+ /**
283
+ * The `ariaLabel` for the upper bound `<input>` when there are two handles.
284
+ */
285
+ unstable_ariaLabelInputUpper: PropTypes.Requireable<string>;
286
+ /**
287
+ * The `name` attribute of the upper bound `<input>` when there are two handles.
288
+ */
289
+ unstable_nameUpper: PropTypes.Requireable<string>;
290
+ /**
291
+ * The upper bound when there are two handles.
292
+ */
293
+ unstable_valueUpper: PropTypes.Requireable<number>;
294
+ /**
295
+ * The value of the slider. When there are two handles, value is the lower
296
+ * bound.
297
+ */
298
+ value: PropTypes.Validator<number>;
299
+ /**
300
+ * `Specify whether the Slider is in a warn state
301
+ */
302
+ warn: PropTypes.Requireable<boolean>;
303
+ /**
304
+ * Provide the text that is displayed when the Slider is in a warn state
305
+ */
306
+ warnText: PropTypes.Requireable<PropTypes.ReactNodeLike>;
186
307
  };
187
- thumbRef: RefObject<HTMLDivElement | null>;
188
- thumbRefUpper: RefObject<HTMLDivElement | null>;
189
- filledTrackRef: RefObject<HTMLDivElement | null>;
190
- element: HTMLDivElement | null;
191
- inputId: string;
192
- track: HTMLDivElement | null | undefined;
193
- constructor(props: any);
194
- /**
195
- * Sets up initial slider position and value in response to component mount.
196
- */
197
- componentDidMount(): void;
198
- /**
199
- * Handles firing of `onChange` and `onRelease` callbacks to parent in
200
- * response to state changes.
201
- *
202
- * @param {*} prevProps prevProps
203
- * @param {*} prevState The previous Slider state, used to see if callbacks
204
- * should be called.
205
- */
206
- componentDidUpdate(prevProps: any, prevState: any): void;
207
- /**
208
- * Rounds a given value to the nearest step defined by the slider's `step`
209
- * prop.
210
- *
211
- * @param value - The value to adjust to the nearest step. Defaults to `0`.
212
- * @returns The value rounded to the precision determined by the step.
213
- */
214
- nearestStepValue(value?: number): number;
215
- handleDrag: (event: Event) => void;
216
- /**
217
- * Sets up "drag" event handlers and calls `this.onDrag` in case dragging
218
- * started on somewhere other than the thumb without a corresponding "move"
219
- * event.
220
- */
221
- onDragStart: (evt: MouseEvent<HTMLDivElement> | TouchEvent<HTMLDivElement>) => void;
222
- /**
223
- * Removes "drag" and "drag stop" event handlers and calls sets the flag
224
- * indicating that the `onRelease` callback should be called.
225
- */
226
- onDragStop: () => void;
227
- /**
228
- * Handles a "drag" event by recalculating the value/thumb and setting state
229
- * accordingly.
230
- *
231
- * @param evt The event.
232
- * @param activeHandle The first drag event call, we may have an explicit
233
- * activeHandle value, which is to be used before state is used.
234
- */
235
- _onDrag: (evt: globalThis.MouseEvent | globalThis.TouchEvent, activeHandle?: HandlePosition) => void;
236
- /**
237
- * Throttles calls to `this._onDrag` by limiting events to being processed at
238
- * most once every `EVENT_THROTTLE` milliseconds.
239
- */
240
- onDrag: import("es-toolkit/compat").DebouncedFunc<(evt: globalThis.MouseEvent | globalThis.TouchEvent, activeHandle?: HandlePosition) => void>;
241
- /**
242
- * Handles a `keydown` event by recalculating the value/thumb and setting
243
- * state accordingly.
244
- */
245
- onKeyDown: (evt: KeyboardEvent<HTMLDivElement>) => void;
246
- /**
247
- * Provides the two-way binding for the input field of the Slider. It also
248
- * Handles a change to the input field by recalculating the value/thumb and
249
- * setting state accordingly.
250
- */
251
- onChange: (evt: ChangeEvent<HTMLInputElement>) => void;
252
- /**
253
- * Checks for validity of input value after clicking out of the input. It also
254
- * Handles state change to isValid state.
255
- */
256
- onBlur: (evt: FocusEvent<HTMLInputElement>) => void;
257
- onInputKeyDown: (evt: KeyboardEvent<HTMLInputElement>) => void;
258
- processNewInputValue: (input: HTMLInputElement) => void;
259
- calcLeftPercent: ({ clientX, value, range }: CalcLeftPercentProps) => number;
260
- /**
261
- * Calculates the discrete value (snapped to the nearest step) along
262
- * with the corresponding handle position percentage.
263
- */
264
- calcDiscreteValueAndPercent: ({ leftPercent, }: {
265
- /** The percentage representing the position on the track. */
266
- leftPercent: number;
267
- }) => {
268
- discreteValue: number;
269
- discretePercent: number;
270
- };
271
- /**
272
- * Calculates the slider's value and handle position based on either a
273
- * mouse/touch event or an explicit value.
274
- */
275
- calcValue: ({ clientX, value, useRawValue, }: {
276
- /** The x-coordinate from a mouse/touch event. */
277
- clientX?: number;
278
- /** Value to base the calculations on (if no `clientX`). */
279
- value?: number;
280
- /** Whether to bypass the stepping logic and use the raw value. */
281
- useRawValue?: boolean;
282
- }) => {
283
- value: number | undefined;
284
- left: number;
285
- };
286
- calcDistanceToHandle: (handle: HandlePosition, clientX: number) => number;
287
- /**
288
- * Calculates a new slider value based on the current value, a change delta,
289
- * and a step.
290
- *
291
- * @param currentValue - The starting value from which the slider is moving.
292
- * @param delta - The amount to adjust the current value by.
293
- * @param step - The step. Defaults to `1`.
294
- * @returns The new slider value, rounded to the same number of decimal places
295
- * as the step.
296
- */
297
- calcValueForDelta: (currentValue: number, delta: number, step?: number) => number;
298
- /**
299
- * Sets state relevant to the given handle position.
300
- *
301
- * Guards against setting either lower or upper values beyond its counterpart.
302
- */
303
- setValueLeftForHandle: (handle: HandlePosition, { value: newValue, left: newLeft }: {
304
- value: number;
305
- left: number;
306
- }) => void;
307
- setValueForHandle: (handle: HandlePosition, value: number | string) => void;
308
- isValidValueForPosition: ({ handle, value: newValue, min, max, }: {
309
- handle: HandlePosition;
310
- value: number;
311
- min: number;
312
- max: number;
313
- }) => boolean;
314
- isValidValue: ({ value, min, max, }: {
315
- value: number;
316
- min: number;
317
- max: number;
318
- }) => boolean;
319
- getAdjustedValueForPosition: ({ handle, value: newValue, min, max, }: {
320
- handle: HandlePosition;
321
- value: number;
322
- min: number;
323
- max: number;
324
- }) => number;
325
- getAdjustedValue: ({ value, min, max, }: {
326
- value: number;
327
- min: number;
328
- max: number;
329
- }) => number;
330
- /**
331
- * Get the bounding rect for the requested handles' DOM element.
332
- *
333
- * If the bounding rect is not available, a new, empty DOMRect is returned.
334
- */
335
- getHandleBoundingRect: (handle: HandlePosition) => DOMRect;
336
- getClientXFromEvent(event: globalThis.MouseEvent | globalThis.TouchEvent): number | undefined;
337
- hasTwoHandles(): boolean;
338
- static getDerivedStateFromProps(props: SliderProps, state: Slider['state']): Partial<{
339
- value: number;
340
- valueUpper: number | undefined;
341
- left: number;
342
- leftUpper: number;
343
- needsOnRelease: boolean;
344
- isValid: boolean;
345
- isValidUpper: boolean;
346
- activeHandle: undefined;
347
- correctedValue: null;
348
- correctedPosition: null;
349
- isRtl: boolean;
350
- }> | null;
351
- render(): import("react/jsx-runtime").JSX.Element;
352
- }
353
- export default Slider;
308
+ };
309
+ export {};