@carbon/react 1.99.0 → 1.100.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 (251) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +953 -953
  2. package/es/components/BadgeIndicator/index.d.ts +1 -1
  3. package/es/components/BadgeIndicator/index.js +8 -6
  4. package/es/components/Breadcrumb/BreadcrumbItem.d.ts +1 -1
  5. package/es/components/Breadcrumb/BreadcrumbItem.js +6 -7
  6. package/es/components/Button/Button.Skeleton.d.ts +28 -2
  7. package/es/components/Button/Button.js +3 -2
  8. package/es/components/ChatButton/ChatButton.d.ts +3 -2
  9. package/es/components/CheckboxGroup/CheckboxGroup.d.ts +60 -2
  10. package/es/components/ComboBox/ComboBox.d.ts +4 -4
  11. package/es/components/ComboBox/ComboBox.js +21 -3
  12. package/es/components/ComposedModal/ComposedModal.d.ts +2 -2
  13. package/es/components/ContainedList/ContainedList.d.ts +35 -6
  14. package/es/components/ContainedList/ContainedList.js +3 -1
  15. package/es/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +32 -3
  16. package/es/components/ContainedList/index.d.ts +1 -1
  17. package/es/components/ContainedList/index.js +4 -1
  18. package/es/components/DangerButton/DangerButton.d.ts +1 -1
  19. package/es/components/DataTable/DataTable.d.ts +22 -5
  20. package/es/components/DataTable/DataTable.js +1 -1
  21. package/es/components/DataTable/TableExpandRow.d.ts +1 -1
  22. package/es/components/DataTable/TableExpandRow.js +2 -2
  23. package/es/components/DataTable/TableHeader.d.ts +1 -1
  24. package/es/components/DataTable/TableHeader.js +18 -16
  25. package/es/components/DataTable/TableToolbar.d.ts +25 -1
  26. package/es/components/DataTable/TableToolbarMenu.d.ts +25 -5
  27. package/es/components/DataTable/TableToolbarMenu.js +0 -3
  28. package/es/components/DataTableSkeleton/DataTableSkeleton.d.ts +51 -2
  29. package/es/components/DataTableSkeleton/DataTableSkeleton.js +6 -0
  30. package/es/components/DatePicker/DatePicker.d.ts +2 -2
  31. package/es/components/DatePicker/DatePicker.js +38 -53
  32. package/es/components/DatePicker/plugins/fixEventsPlugin.js +28 -2
  33. package/es/components/DatePickerInput/DatePickerInput.d.ts +1 -1
  34. package/es/components/DatePickerInput/DatePickerInput.js +3 -2
  35. package/es/components/Dialog/Dialog.d.ts +1 -1
  36. package/es/components/Dropdown/Dropdown.Skeleton.d.ts +19 -2
  37. package/es/components/ExpandableSearch/ExpandableSearch.d.ts +1 -1
  38. package/es/components/ExpandableSearch/ExpandableSearch.js +14 -12
  39. package/es/components/FileUploader/FileUploader.d.ts +1 -1
  40. package/es/components/FileUploader/FileUploader.js +2 -2
  41. package/es/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
  42. package/es/components/FileUploader/FileUploaderDropContainer.js +28 -10
  43. package/es/components/FluidComboBox/FluidComboBox.Skeleton.d.ts +11 -3
  44. package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.d.ts +15 -3
  45. package/es/components/FluidDatePicker/FluidDatePicker.d.ts +2 -2
  46. package/es/components/FluidDropdown/FluidDropdown.Skeleton.d.ts +11 -3
  47. package/es/components/FluidForm/FluidForm.d.ts +15 -2
  48. package/es/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +2 -2
  49. package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.d.ts +11 -3
  50. package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.d.ts +11 -3
  51. package/es/components/FluidNumberInput/FluidNumberInput.d.ts +1 -1
  52. package/es/components/FluidSearch/FluidSearch.Skeleton.d.ts +11 -3
  53. package/es/components/FluidSearch/FluidSearch.d.ts +1 -1
  54. package/es/components/FluidSearch/FluidSearch.js +3 -3
  55. package/es/components/FluidSelect/FluidSelect.Skeleton.d.ts +11 -3
  56. package/es/components/FluidTextArea/FluidTextArea.Skeleton.d.ts +11 -3
  57. package/es/components/FluidTextArea/FluidTextArea.d.ts +95 -1
  58. package/es/components/FluidTextInput/FluidPasswordInput.d.ts +83 -2
  59. package/es/components/FluidTextInput/FluidTextInput.Skeleton.d.ts +11 -3
  60. package/es/components/Grid/GridContext.d.ts +19 -1
  61. package/es/components/IconButton/index.d.ts +1 -1
  62. package/es/components/IconButton/index.js +2 -2
  63. package/es/components/Link/Link.js +3 -0
  64. package/es/components/ListBox/ListBoxField.d.ts +35 -2
  65. package/es/components/ListBox/ListBoxMenuIcon.d.ts +16 -3
  66. package/es/components/ListBox/ListBoxMenuItem.d.ts +1 -1
  67. package/es/components/ListBox/ListBoxSelection.d.ts +34 -3
  68. package/es/components/Menu/MenuItem.d.ts +2 -2
  69. package/es/components/MultiSelect/FilterableMultiSelect.d.ts +2 -2
  70. package/es/components/MultiSelect/FilterableMultiSelect.js +22 -13
  71. package/es/components/MultiSelect/MultiSelect.js +22 -13
  72. package/es/components/Notification/Notification.d.ts +8 -7
  73. package/es/components/Notification/Notification.js +0 -1
  74. package/es/components/OverflowMenu/OverflowMenu.d.ts +1 -1
  75. package/es/components/OverflowMenu/OverflowMenu.js +0 -1
  76. package/es/components/OverflowMenu/index.d.ts +1 -1
  77. package/es/components/PageHeader/PageHeader.d.ts +3 -3
  78. package/es/components/Popover/index.js +21 -12
  79. package/es/components/Search/Search.d.ts +2 -2
  80. package/es/components/Select/Select.d.ts +1 -1
  81. package/es/components/Select/Select.js +2 -2
  82. package/es/components/SkeletonIcon/SkeletonIcon.d.ts +16 -2
  83. package/es/components/SkeletonText/SkeletonText.d.ts +1 -1
  84. package/es/components/Tag/Tag.d.ts +1 -1
  85. package/es/components/Tag/Tag.js +2 -0
  86. package/es/components/Text/Text.d.ts +1 -1
  87. package/es/components/Text/Text.js +4 -3
  88. package/es/components/Text/TextDirection.d.ts +1 -1
  89. package/es/components/Text/TextDirection.js +1 -3
  90. package/es/components/Text/TextDirectionContext.d.ts +3 -3
  91. package/es/components/TextInput/ControlledPasswordInput.d.ts +1 -1
  92. package/es/components/TextInput/ControlledPasswordInput.js +2 -2
  93. package/es/components/TextInput/PasswordInput.d.ts +1 -1
  94. package/es/components/TextInput/PasswordInput.js +2 -2
  95. package/es/components/TextInput/TextInput.d.ts +1 -1
  96. package/es/components/TextInput/TextInput.js +2 -2
  97. package/es/components/Toggle/Toggle.Skeleton.d.ts +9 -3
  98. package/es/components/Toggletip/index.d.ts +1 -1
  99. package/es/components/Toggletip/index.js +9 -7
  100. package/es/components/Tooltip/DefinitionTooltip.d.ts +52 -1
  101. package/es/components/Tooltip/Tooltip.js +2 -0
  102. package/es/components/TreeView/TreeNode.d.ts +4 -4
  103. package/es/components/UIShell/Header.d.ts +20 -3
  104. package/es/components/UIShell/HeaderGlobalAction.d.ts +2 -2
  105. package/es/components/UIShell/HeaderName.js +1 -1
  106. package/es/components/UIShell/Link.d.ts +1 -1
  107. package/es/components/UIShell/Link.js +14 -14
  108. package/es/components/UIShell/SideNav.d.ts +3 -3
  109. package/es/components/UIShell/SideNav.js +26 -25
  110. package/es/components/UIShell/SideNavDivider.d.ts +11 -3
  111. package/es/components/UIShell/SideNavHeader.d.ts +24 -1
  112. package/es/components/UIShell/SideNavIcon.d.ts +20 -2
  113. package/es/components/UIShell/SideNavItem.d.ts +20 -2
  114. package/es/components/UIShell/SideNavItems.d.ts +22 -2
  115. package/es/components/UIShell/SideNavLink.d.ts +1 -1
  116. package/es/components/UIShell/SideNavLink.js +14 -14
  117. package/es/components/UIShell/SideNavMenu.d.ts +1 -1
  118. package/es/components/UIShell/SideNavMenu.js +2 -2
  119. package/es/components/UIShell/SideNavMenuItem.d.ts +2 -2
  120. package/es/components/UIShell/SideNavMenuItem.js +2 -2
  121. package/es/components/UIShell/SwitcherDivider.d.ts +10 -2
  122. package/es/internal/FloatingMenu.d.ts +1 -1
  123. package/es/internal/FloatingMenu.js +0 -2
  124. package/es/internal/PolymorphicProps.d.ts +3 -3
  125. package/es/internal/useNoInteractiveChildren.d.ts +1 -1
  126. package/es/internal/useNoInteractiveChildren.js +8 -10
  127. package/es/internal/useOutsideClick.d.ts +1 -1
  128. package/es/internal/useOutsideClick.js +0 -4
  129. package/lib/components/BadgeIndicator/index.d.ts +1 -1
  130. package/lib/components/BadgeIndicator/index.js +7 -5
  131. package/lib/components/Breadcrumb/BreadcrumbItem.d.ts +1 -1
  132. package/lib/components/Breadcrumb/BreadcrumbItem.js +5 -6
  133. package/lib/components/Button/Button.Skeleton.d.ts +28 -2
  134. package/lib/components/Button/Button.js +3 -2
  135. package/lib/components/ChatButton/ChatButton.d.ts +3 -2
  136. package/lib/components/CheckboxGroup/CheckboxGroup.d.ts +60 -2
  137. package/lib/components/ComboBox/ComboBox.d.ts +4 -4
  138. package/lib/components/ComboBox/ComboBox.js +21 -3
  139. package/lib/components/ComposedModal/ComposedModal.d.ts +2 -2
  140. package/lib/components/ContainedList/ContainedList.d.ts +35 -6
  141. package/lib/components/ContainedList/ContainedList.js +3 -1
  142. package/lib/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +32 -3
  143. package/lib/components/ContainedList/index.d.ts +1 -1
  144. package/lib/components/ContainedList/index.js +4 -1
  145. package/lib/components/DangerButton/DangerButton.d.ts +1 -1
  146. package/lib/components/DataTable/DataTable.d.ts +22 -5
  147. package/lib/components/DataTable/DataTable.js +1 -1
  148. package/lib/components/DataTable/TableExpandRow.d.ts +1 -1
  149. package/lib/components/DataTable/TableHeader.d.ts +1 -1
  150. package/lib/components/DataTable/TableHeader.js +17 -15
  151. package/lib/components/DataTable/TableToolbar.d.ts +25 -1
  152. package/lib/components/DataTable/TableToolbarMenu.d.ts +25 -5
  153. package/lib/components/DataTable/TableToolbarMenu.js +0 -3
  154. package/lib/components/DataTableSkeleton/DataTableSkeleton.d.ts +51 -2
  155. package/lib/components/DataTableSkeleton/DataTableSkeleton.js +6 -0
  156. package/lib/components/DatePicker/DatePicker.d.ts +2 -2
  157. package/lib/components/DatePicker/DatePicker.js +37 -52
  158. package/lib/components/DatePicker/plugins/fixEventsPlugin.js +28 -2
  159. package/lib/components/DatePickerInput/DatePickerInput.d.ts +1 -1
  160. package/lib/components/DatePickerInput/DatePickerInput.js +2 -1
  161. package/lib/components/Dialog/Dialog.d.ts +1 -1
  162. package/lib/components/Dropdown/Dropdown.Skeleton.d.ts +19 -2
  163. package/lib/components/ExpandableSearch/ExpandableSearch.d.ts +1 -1
  164. package/lib/components/ExpandableSearch/ExpandableSearch.js +13 -11
  165. package/lib/components/FileUploader/FileUploader.d.ts +1 -1
  166. package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
  167. package/lib/components/FileUploader/FileUploaderDropContainer.js +28 -10
  168. package/lib/components/FluidComboBox/FluidComboBox.Skeleton.d.ts +11 -3
  169. package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.d.ts +15 -3
  170. package/lib/components/FluidDatePicker/FluidDatePicker.d.ts +2 -2
  171. package/lib/components/FluidDropdown/FluidDropdown.Skeleton.d.ts +11 -3
  172. package/lib/components/FluidForm/FluidForm.d.ts +15 -2
  173. package/lib/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +2 -2
  174. package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.d.ts +11 -3
  175. package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.d.ts +11 -3
  176. package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +1 -1
  177. package/lib/components/FluidSearch/FluidSearch.Skeleton.d.ts +11 -3
  178. package/lib/components/FluidSearch/FluidSearch.d.ts +1 -1
  179. package/lib/components/FluidSearch/FluidSearch.js +2 -2
  180. package/lib/components/FluidSelect/FluidSelect.Skeleton.d.ts +11 -3
  181. package/lib/components/FluidTextArea/FluidTextArea.Skeleton.d.ts +11 -3
  182. package/lib/components/FluidTextArea/FluidTextArea.d.ts +95 -1
  183. package/lib/components/FluidTextInput/FluidPasswordInput.d.ts +83 -2
  184. package/lib/components/FluidTextInput/FluidTextInput.Skeleton.d.ts +11 -3
  185. package/lib/components/Grid/GridContext.d.ts +19 -1
  186. package/lib/components/IconButton/index.d.ts +1 -1
  187. package/lib/components/Link/Link.js +3 -0
  188. package/lib/components/ListBox/ListBoxField.d.ts +35 -2
  189. package/lib/components/ListBox/ListBoxMenuIcon.d.ts +16 -3
  190. package/lib/components/ListBox/ListBoxMenuItem.d.ts +1 -1
  191. package/lib/components/ListBox/ListBoxSelection.d.ts +34 -3
  192. package/lib/components/Menu/MenuItem.d.ts +2 -2
  193. package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +2 -2
  194. package/lib/components/MultiSelect/FilterableMultiSelect.js +22 -13
  195. package/lib/components/MultiSelect/MultiSelect.js +22 -13
  196. package/lib/components/Notification/Notification.d.ts +8 -7
  197. package/lib/components/Notification/Notification.js +0 -1
  198. package/lib/components/OverflowMenu/OverflowMenu.d.ts +1 -1
  199. package/lib/components/OverflowMenu/OverflowMenu.js +0 -1
  200. package/lib/components/OverflowMenu/index.d.ts +1 -1
  201. package/lib/components/PageHeader/PageHeader.d.ts +3 -3
  202. package/lib/components/Popover/index.js +19 -10
  203. package/lib/components/Search/Search.d.ts +2 -2
  204. package/lib/components/Select/Select.d.ts +1 -1
  205. package/lib/components/SkeletonIcon/SkeletonIcon.d.ts +16 -2
  206. package/lib/components/SkeletonText/SkeletonText.d.ts +1 -1
  207. package/lib/components/Tag/Tag.d.ts +1 -1
  208. package/lib/components/Tag/Tag.js +2 -0
  209. package/lib/components/Text/Text.d.ts +1 -1
  210. package/lib/components/Text/Text.js +3 -2
  211. package/lib/components/Text/TextDirection.d.ts +1 -1
  212. package/lib/components/Text/TextDirection.js +1 -3
  213. package/lib/components/Text/TextDirectionContext.d.ts +3 -3
  214. package/lib/components/TextInput/ControlledPasswordInput.d.ts +1 -1
  215. package/lib/components/TextInput/PasswordInput.d.ts +1 -1
  216. package/lib/components/TextInput/TextInput.d.ts +1 -1
  217. package/lib/components/Toggle/Toggle.Skeleton.d.ts +9 -3
  218. package/lib/components/Toggletip/index.d.ts +1 -1
  219. package/lib/components/Toggletip/index.js +7 -5
  220. package/lib/components/Tooltip/DefinitionTooltip.d.ts +52 -1
  221. package/lib/components/Tooltip/Tooltip.js +2 -0
  222. package/lib/components/TreeView/TreeNode.d.ts +4 -4
  223. package/lib/components/UIShell/Header.d.ts +20 -3
  224. package/lib/components/UIShell/HeaderGlobalAction.d.ts +2 -2
  225. package/lib/components/UIShell/HeaderName.js +1 -1
  226. package/lib/components/UIShell/Link.d.ts +1 -1
  227. package/lib/components/UIShell/Link.js +13 -13
  228. package/lib/components/UIShell/SideNav.d.ts +3 -3
  229. package/lib/components/UIShell/SideNav.js +25 -24
  230. package/lib/components/UIShell/SideNavDivider.d.ts +11 -3
  231. package/lib/components/UIShell/SideNavHeader.d.ts +24 -1
  232. package/lib/components/UIShell/SideNavIcon.d.ts +20 -2
  233. package/lib/components/UIShell/SideNavItem.d.ts +20 -2
  234. package/lib/components/UIShell/SideNavItems.d.ts +22 -2
  235. package/lib/components/UIShell/SideNavLink.d.ts +1 -1
  236. package/lib/components/UIShell/SideNavLink.js +14 -14
  237. package/lib/components/UIShell/SideNavMenu.d.ts +1 -1
  238. package/lib/components/UIShell/SideNavMenuItem.d.ts +2 -2
  239. package/lib/components/UIShell/SwitcherDivider.d.ts +10 -2
  240. package/lib/internal/FloatingMenu.d.ts +1 -1
  241. package/lib/internal/FloatingMenu.js +0 -2
  242. package/lib/internal/PolymorphicProps.d.ts +3 -3
  243. package/lib/internal/useNoInteractiveChildren.d.ts +1 -1
  244. package/lib/internal/useNoInteractiveChildren.js +8 -10
  245. package/lib/internal/useOutsideClick.d.ts +1 -1
  246. package/lib/internal/useOutsideClick.js +0 -4
  247. package/package.json +7 -7
  248. package/scss/_carbon-utilities.scss +9 -0
  249. package/telemetry.yml +0 -1
  250. package/es/internal/createClassWrapper.d.ts +0 -12
  251. package/lib/internal/createClassWrapper.d.ts +0 -12
@@ -143,36 +143,38 @@ function updateClassNames(calendar, prefix) {
143
143
  });
144
144
  }
145
145
  }
146
- const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
147
- allowInput,
148
- appendTo,
149
- children,
150
- className,
151
- closeOnSelect = true,
152
- dateFormat = 'm/d/Y',
153
- datePickerType,
154
- disable,
155
- enable,
156
- inline,
157
- invalid,
158
- invalidText,
159
- warn,
160
- warnText,
161
- light = false,
162
- locale = 'en',
163
- maxDate,
164
- minDate,
165
- onChange,
166
- onClose,
167
- onOpen,
168
- readOnly = false,
169
- short = false,
170
- value,
171
- parseDate: parseDateProp,
172
- nextMonthAriaLabel = 'Next month',
173
- prevMonthAriaLabel = 'Previous month',
174
- ...rest
175
- }, ref) {
146
+ // eslint-disable-next-line react/display-name
147
+ const DatePicker = /*#__PURE__*/React.forwardRef((props, ref) => {
148
+ const {
149
+ allowInput,
150
+ appendTo,
151
+ children,
152
+ className,
153
+ closeOnSelect = true,
154
+ dateFormat = 'm/d/Y',
155
+ datePickerType,
156
+ disable,
157
+ enable,
158
+ inline,
159
+ invalid,
160
+ invalidText,
161
+ warn,
162
+ warnText,
163
+ light = false,
164
+ locale = 'en',
165
+ maxDate,
166
+ minDate,
167
+ onChange,
168
+ onClose,
169
+ onOpen,
170
+ readOnly = false,
171
+ short = false,
172
+ value,
173
+ parseDate: parseDateProp,
174
+ nextMonthAriaLabel = 'Next month',
175
+ prevMonthAriaLabel = 'Previous month',
176
+ ...rest
177
+ } = props;
176
178
  const prefix = usePrefix.usePrefix();
177
179
  const {
178
180
  isFluid
@@ -201,7 +203,6 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
201
203
  },
202
204
  // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
203
205
  [onClose]);
204
- // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
205
206
  const onCalendarClose = (selectedDates, dateStr, instance, e) => {
206
207
  if (e && e.type === 'clickOutside') {
207
208
  return;
@@ -228,6 +229,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
228
229
  const savedOnChange = useSavedCallback.useSavedCallback(onChange);
229
230
  const savedOnOpen = useSavedCallback.useSavedCallback(onOpen);
230
231
  const effectiveWarn = warn && !invalid;
232
+ const wrapperRef = React.useRef(null);
231
233
  const datePickerClasses = cx(`${prefix}--date-picker`, {
232
234
  [`${prefix}--date-picker--short`]: short,
233
235
  [`${prefix}--date-picker--light`]: light,
@@ -393,7 +395,8 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
393
395
  }), fixEventsPlugin.default({
394
396
  inputFrom: startInputField.current,
395
397
  inputTo: endInputField.current,
396
- lastStartValue
398
+ lastStartValue,
399
+ container: wrapperRef.current
397
400
  })],
398
401
  clickOpens: !readOnly,
399
402
  noCalendar: readOnly,
@@ -600,25 +603,6 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
600
603
  }
601
604
  }
602
605
  }, [value, startInputField]);
603
- React.useEffect(() => {
604
- const handleMouseDown = event => {
605
- if (calendarRef.current && calendarRef.current.isOpen && !calendarRef.current.calendarContainer.contains(event.target) && !startInputField.current.contains(event.target) && !endInputField.current?.contains(event.target)) {
606
- // Close the calendar immediately on mousedown
607
- closeCalendar();
608
- }
609
- };
610
- const closeCalendar = () => {
611
- calendarRef.current?.close();
612
- // Remove focus from endDate calendar input
613
- onCalendarClose(calendarRef.current?.selectedDates, '', calendarRef.current, {
614
- type: 'clickOutside'
615
- });
616
- };
617
- document.addEventListener('mousedown', handleMouseDown, true);
618
- return () => {
619
- document.removeEventListener('mousedown', handleMouseDown, true);
620
- };
621
- }, [calendarRef, startInputField, endInputField, onCalendarClose]);
622
606
  React.useEffect(() => {
623
607
  if (calendarRef.current?.set) {
624
608
  if (value !== undefined) {
@@ -662,7 +646,8 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
662
646
  className: wrapperClasses,
663
647
  ref: ref
664
648
  }, rest), /*#__PURE__*/React.createElement("div", {
665
- className: datePickerClasses
649
+ className: datePickerClasses,
650
+ ref: wrapperRef
666
651
  }, childrenWithProps), fluidError);
667
652
  });
668
653
  DatePicker.propTypes = {
@@ -20,17 +20,41 @@ var carbonFlatpickrFixEventsPlugin = config => fp => {
20
20
  const {
21
21
  inputFrom,
22
22
  inputTo,
23
- lastStartValue
23
+ lastStartValue,
24
+ container
24
25
  } = config;
26
+ // Avoid closing when mousedown starts inside but click lands outside after
27
+ // scroll or blur (e.g., scrollable modal masks).
28
+ let mouseDownInside = false;
29
+ const getEventPath = event => typeof event.composedPath === 'function' ? event.composedPath() : [];
30
+ const isEventInside = event => {
31
+ const path = getEventPath(event);
32
+ return Boolean(container && (path.includes(container) || container.contains(event.target)) || fp.calendarContainer && (path.includes(fp.calendarContainer) || fp.calendarContainer.contains(event.target)) || inputFrom && (path.includes(inputFrom) || inputFrom.contains(event.target)) || inputTo && (path.includes(inputTo) || inputTo.contains(event.target)));
33
+ };
34
+
25
35
  /**
26
36
  * Handles `click` outside to close calendar
27
37
  */
28
38
  const handleClickOutside = event => {
29
- if (!fp.isOpen || fp.calendarContainer.contains(event.target) || event.target === inputFrom || event.target === inputTo) {
39
+ if (mouseDownInside) {
40
+ mouseDownInside = false;
30
41
  return;
31
42
  }
43
+ if (!fp.isOpen || isEventInside(event)) {
44
+ mouseDownInside = false;
45
+ return;
46
+ }
47
+ mouseDownInside = false;
32
48
  fp.close();
33
49
  };
50
+
51
+ /**
52
+ * Tracks the initial mouse target to avoid closing on click after scroll.
53
+ */
54
+ const handleMouseDown = event => {
55
+ mouseDownInside = isEventInside(event);
56
+ };
57
+
34
58
  /**
35
59
  * Handles `keydown` event.
36
60
  */
@@ -124,6 +148,7 @@ var carbonFlatpickrFixEventsPlugin = config => fp => {
124
148
  inputTo.removeEventListener('blur', handleBlur, true);
125
149
  }
126
150
  inputFrom.removeEventListener('keydown', handleKeydown, true);
151
+ document.removeEventListener('mousedown', handleMouseDown, true);
127
152
  document.removeEventListener('click', handleClickOutside, true);
128
153
  };
129
154
 
@@ -141,6 +166,7 @@ var carbonFlatpickrFixEventsPlugin = config => fp => {
141
166
  inputTo.addEventListener('keydown', handleKeydown, true);
142
167
  inputTo.addEventListener('blur', handleBlur, true);
143
168
  }
169
+ document.addEventListener('mousedown', handleMouseDown, true);
144
170
  document.addEventListener('click', handleClickOutside, true);
145
171
  };
146
172
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2025
2
+ * Copyright IBM Corp. 2016, 2026
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -28,7 +28,8 @@ var useNormalizedInputProps = require('../../internal/useNormalizedInputProps.js
28
28
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
29
29
 
30
30
  let didWarnAboutDatePickerInputValue = false;
31
- const DatePickerInput = /*#__PURE__*/React.forwardRef(function DatePickerInput(props, ref) {
31
+ const frFn = React.forwardRef;
32
+ const DatePickerInput = frFn((props, ref) => {
32
33
  const {
33
34
  datePickerType,
34
35
  decorator,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2025
2
+ * Copyright IBM Corp. 2025, 2026
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -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, { type HTMLAttributes } from 'react';
7
+ import PropTypes from 'prop-types';
8
+ import { type HTMLAttributes } from 'react';
8
9
  import { type ListBoxSize } from '../ListBox';
9
10
  export interface DropdownSkeletonProps extends HTMLAttributes<HTMLDivElement> {
10
11
  /**
@@ -20,6 +21,22 @@ export interface DropdownSkeletonProps extends HTMLAttributes<HTMLDivElement> {
20
21
  */
21
22
  size?: ListBoxSize;
22
23
  }
23
- declare const DropdownSkeleton: React.FC<DropdownSkeletonProps>;
24
+ declare const DropdownSkeleton: {
25
+ ({ className, size, hideLabel, ...rest }: DropdownSkeletonProps): import("react/jsx-runtime").JSX.Element;
26
+ propTypes: {
27
+ /**
28
+ * Specify an optional className to add.
29
+ */
30
+ className: PropTypes.Requireable<string>;
31
+ /**
32
+ * Specify whether the label should be hidden, or not
33
+ */
34
+ hideLabel: PropTypes.Requireable<boolean>;
35
+ /**
36
+ * Specify the size of the ListBox.
37
+ */
38
+ size: PropTypes.Requireable<"sm" | "md" | "lg">;
39
+ };
40
+ };
24
41
  export default DropdownSkeleton;
25
42
  export { DropdownSkeleton };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2021, 2025
2
+ * Copyright IBM Corp. 2021, 2026
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -20,15 +20,17 @@ var keys = require('../../internal/keyboard/keys.js');
20
20
  var match = require('../../internal/keyboard/match.js');
21
21
  var mergeRefs = require('../../tools/mergeRefs.js');
22
22
 
23
- const ExpandableSearch = /*#__PURE__*/React.forwardRef(function ExpandableSearch({
24
- onBlur,
25
- onChange,
26
- onExpand,
27
- onKeyDown,
28
- defaultValue,
29
- isExpanded,
30
- ...props
31
- }, forwardedRef) {
23
+ const frFn = React.forwardRef;
24
+ const ExpandableSearch = frFn((props, forwardedRef) => {
25
+ const {
26
+ onBlur,
27
+ onChange,
28
+ onExpand,
29
+ onKeyDown,
30
+ defaultValue,
31
+ isExpanded,
32
+ ...rest
33
+ } = props;
32
34
  const [expanded, setExpanded] = React.useState(isExpanded || false);
33
35
  const [hasContent, setHasContent] = React.useState(defaultValue ? true : false);
34
36
  const searchRef = React.useRef(null);
@@ -61,8 +63,8 @@ const ExpandableSearch = /*#__PURE__*/React.forwardRef(function ExpandableSearch
61
63
  }
62
64
  const classes = cx(`${prefix}--search--expandable`, {
63
65
  [`${prefix}--search--expanded`]: expanded
64
- }, props.className);
65
- return /*#__PURE__*/React.createElement(Search.default, _rollupPluginBabelHelpers.extends({}, props, {
66
+ }, rest.className);
67
+ return /*#__PURE__*/React.createElement(Search.default, _rollupPluginBabelHelpers.extends({}, rest, {
66
68
  defaultValue: defaultValue,
67
69
  isExpanded: expanded,
68
70
  ref: mergeRefs.mergeRefs(searchRef, forwardedRef),
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2025
2
+ * Copyright IBM Corp. 2016, 2026
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2025
2
+ * Copyright IBM Corp. 2016, 2026
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -77,22 +77,40 @@ function FileUploaderDropContainer({
77
77
  return acc.concat([curr]);
78
78
  }, []);
79
79
  }
80
- function handleChange(event) {
81
- const files = [...(event.target.files ?? [])];
82
- const filesToValidate = multiple ? files : [files[0]];
83
- const addedFiles = validateFiles(filesToValidate);
84
- return onAddFiles(event, {
85
- addedFiles
80
+ const handleFiles = (event, files) => {
81
+ if (!files.length) return onAddFiles(event, {
82
+ addedFiles: []
86
83
  });
87
- }
88
- function handleDrop(event) {
89
- const files = [...event.dataTransfer.files];
90
84
  const filesToValidate = multiple ? files : [files[0]];
91
85
  const addedFiles = validateFiles(filesToValidate);
92
86
  return onAddFiles(event, {
93
87
  addedFiles
94
88
  });
95
- }
89
+ };
90
+ const handleChange = event => {
91
+ const files = [...(event.target.files ?? [])];
92
+ return handleFiles(event, files);
93
+ };
94
+ const handleDrop = event => {
95
+ const items = [...(event.dataTransfer.items ?? [])];
96
+ const files = items.length ?
97
+ // Normalize dropped items to files. Skip directories and non-file items.
98
+ items.reduce((acc, item) => {
99
+ if (item.kind !== 'file') {
100
+ return acc;
101
+ }
102
+ const entry = item.webkitGetAsEntry();
103
+ if (entry?.isDirectory) {
104
+ return acc;
105
+ }
106
+ const file = item.getAsFile();
107
+ if (file) {
108
+ acc.push(file);
109
+ }
110
+ return acc;
111
+ }, []) : [...event.dataTransfer.files];
112
+ return handleFiles(event, files);
113
+ };
96
114
  const handleClick = () => {
97
115
  if (!disabled) {
98
116
  inputRef.current?.click();
@@ -1,15 +1,23 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
7
+ import PropTypes from 'prop-types';
8
8
  export interface FluidComboBoxSkeletonProps {
9
9
  /**
10
10
  * Specify an optional className to add.
11
11
  */
12
12
  className?: string;
13
13
  }
14
- declare const FluidComboBoxSkeleton: React.FC<FluidComboBoxSkeletonProps>;
14
+ declare const FluidComboBoxSkeleton: {
15
+ ({ className, ...rest }: FluidComboBoxSkeletonProps): import("react/jsx-runtime").JSX.Element;
16
+ propTypes: {
17
+ /**
18
+ * Specify an optional className to add.
19
+ */
20
+ className: PropTypes.Requireable<string>;
21
+ };
22
+ };
15
23
  export default FluidComboBoxSkeleton;
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
7
+ import PropTypes from 'prop-types';
8
8
  export interface FluidDatePickerSkeletonProps {
9
9
  /**
10
10
  * Specify an optional className to be applied to the outer FluidForm wrapper
@@ -15,5 +15,17 @@ export interface FluidDatePickerSkeletonProps {
15
15
  */
16
16
  datePickerType?: 'simple' | 'single' | 'range';
17
17
  }
18
- declare const FluidDatePickerSkeleton: React.FC<FluidDatePickerSkeletonProps>;
18
+ declare const FluidDatePickerSkeleton: {
19
+ ({ className, datePickerType, ...other }: FluidDatePickerSkeletonProps): import("react/jsx-runtime").JSX.Element;
20
+ propTypes: {
21
+ /**
22
+ * Specify an optional className to be applied to the outer FluidForm wrapper
23
+ */
24
+ className: PropTypes.Requireable<string>;
25
+ /**
26
+ * Specify which variant of the DatePicker the skeleton should mimic
27
+ */
28
+ datePickerType: PropTypes.Requireable<string>;
29
+ };
30
+ };
19
31
  export default FluidDatePickerSkeleton;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2022
2
+ * Copyright IBM Corp. 2022, 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.
@@ -35,5 +35,5 @@ export interface FluidDatePickerProps {
35
35
  */
36
36
  warnText?: React.ReactNode;
37
37
  }
38
- declare const FluidDatePicker: React.FC<FluidDatePickerProps>;
38
+ declare const FluidDatePicker: React.ForwardRefExoticComponent<FluidDatePickerProps & React.RefAttributes<HTMLInputElement>>;
39
39
  export default FluidDatePicker;
@@ -1,15 +1,23 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
7
+ import PropTypes from 'prop-types';
8
8
  export interface FluidDropdownSkeletonProps {
9
9
  /**
10
10
  * Specify an optional className to add.
11
11
  */
12
12
  className?: string;
13
13
  }
14
- declare const FluidDropdownSkeleton: React.FC<FluidDropdownSkeletonProps>;
14
+ declare const FluidDropdownSkeleton: {
15
+ ({ className, ...rest }: FluidDropdownSkeletonProps): import("react/jsx-runtime").JSX.Element;
16
+ propTypes: {
17
+ /**
18
+ * Specify an optional className to add.
19
+ */
20
+ className: PropTypes.Requireable<string>;
21
+ };
22
+ };
15
23
  export default FluidDropdownSkeleton;
@@ -4,7 +4,20 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React, { type HTMLAttributes } from 'react';
7
+ import PropTypes from 'prop-types';
8
+ import { type HTMLAttributes } from 'react';
8
9
  export type FluidFormProps = HTMLAttributes<HTMLFormElement>;
9
- declare const FluidForm: React.FC<FluidFormProps>;
10
+ declare const FluidForm: {
11
+ ({ className, children, ...other }: FluidFormProps): import("react/jsx-runtime").JSX.Element;
12
+ propTypes: {
13
+ /**
14
+ * Provide children to be rendered inside of the <form> element
15
+ */
16
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
17
+ /**
18
+ * Provide a custom className to be applied on the containing <form> node
19
+ */
20
+ className: PropTypes.Requireable<string>;
21
+ };
22
+ };
10
23
  export default FluidForm;
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React, { FunctionComponent, type ComponentProps } from 'react';
7
+ import React, { type ComponentProps, type ReactNode } from 'react';
8
8
  import type { UseComboboxProps, UseMultipleSelectionProps } from 'downshift';
9
9
  import { type FilterableMultiSelectProps, type MultiSelect } from '../MultiSelect';
10
10
  interface OnChangeData<ItemType> {
@@ -65,7 +65,7 @@ export interface FluidFilterableMultiSelectProps<ItemType> extends FilterableMul
65
65
  * Function to render items as custom components instead of strings.
66
66
  * Defaults to null and is overridden by a getter
67
67
  */
68
- itemToElement?: FunctionComponent<ItemType>;
68
+ itemToElement?: (item: ItemType) => ReactNode;
69
69
  /**
70
70
  * Helper function passed to downshift that allows the library to render a
71
71
  * given item to a string label. By default, it extracts the `label` field
@@ -1,15 +1,23 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
7
+ import PropTypes from 'prop-types';
8
8
  export interface FluidMultiSelectSkeletonProps {
9
9
  /**
10
10
  * Specify an optional className to add.
11
11
  */
12
12
  className?: string;
13
13
  }
14
- declare const FluidMultiSelectSkeleton: React.FC<FluidMultiSelectSkeletonProps>;
14
+ declare const FluidMultiSelectSkeleton: {
15
+ ({ className, ...rest }: FluidMultiSelectSkeletonProps): import("react/jsx-runtime").JSX.Element;
16
+ propTypes: {
17
+ /**
18
+ * Specify an optional className to add.
19
+ */
20
+ className: PropTypes.Requireable<string>;
21
+ };
22
+ };
15
23
  export default FluidMultiSelectSkeleton;
@@ -1,15 +1,23 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
7
+ import PropTypes from 'prop-types';
8
8
  export interface FluidNumberInputSkeletonProps {
9
9
  /**
10
10
  * Specify an optional className to be applied to the outer FluidForm wrapper
11
11
  */
12
12
  className?: string;
13
13
  }
14
- declare const FluidNumberInputSkeleton: React.FC<FluidNumberInputSkeletonProps>;
14
+ declare const FluidNumberInputSkeleton: {
15
+ ({ className, ...other }: FluidNumberInputSkeletonProps): import("react/jsx-runtime").JSX.Element;
16
+ propTypes: {
17
+ /**
18
+ * Specify an optional className to be applied to the outer FluidForm wrapper
19
+ */
20
+ className: PropTypes.Requireable<string>;
21
+ };
22
+ };
15
23
  export default FluidNumberInputSkeleton;
@@ -132,5 +132,5 @@ export interface FluidNumberInputProps extends Pick<ComponentProps<typeof Number
132
132
  */
133
133
  readOnly?: boolean;
134
134
  }
135
- declare const FluidNumberInput: React.FC<FluidNumberInputProps>;
135
+ declare const FluidNumberInput: React.ForwardRefExoticComponent<FluidNumberInputProps & React.RefAttributes<HTMLInputElement>>;
136
136
  export default FluidNumberInput;
@@ -1,15 +1,23 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
7
+ import PropTypes from 'prop-types';
8
8
  export interface FluidSearchSkeletonProps {
9
9
  /**
10
10
  * Specify an optional className to be applied to the outer FluidForm wrapper
11
11
  */
12
12
  className?: string;
13
13
  }
14
- declare const FluidSearchSkeleton: React.FC<FluidSearchSkeletonProps>;
14
+ declare const FluidSearchSkeleton: {
15
+ ({ className, ...other }: FluidSearchSkeletonProps): import("react/jsx-runtime").JSX.Element;
16
+ propTypes: {
17
+ /**
18
+ * Specify an optional className to be applied to the outer FluidForm wrapper
19
+ */
20
+ className: PropTypes.Requireable<string>;
21
+ };
22
+ };
15
23
  export default FluidSearchSkeleton;
@@ -66,5 +66,5 @@ export interface FluidSearchProps {
66
66
  */
67
67
  value?: string | number;
68
68
  }
69
- declare const FluidSearch: React.FC<FluidSearchProps>;
69
+ declare const FluidSearch: React.ForwardRefExoticComponent<FluidSearchProps & React.RefAttributes<HTMLInputElement>>;
70
70
  export default FluidSearch;
@@ -18,8 +18,8 @@ require('../Search/Search.Skeleton.js');
18
18
  var usePrefix = require('../../internal/usePrefix.js');
19
19
  var FormContext = require('../FluidForm/FormContext.js');
20
20
 
21
- // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
22
- const FluidSearch = /*#__PURE__*/React.forwardRef(({
21
+ const frFn = React.forwardRef;
22
+ const FluidSearch = frFn(({
23
23
  className,
24
24
  ...other
25
25
  }, ref) => {
@@ -1,15 +1,23 @@
1
1
  /**
2
- * Copyright IBM Corp. 2022
2
+ * Copyright IBM Corp. 2022, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
7
+ import PropTypes from 'prop-types';
8
8
  export interface FluidSelectSkeletonProps {
9
9
  /**
10
10
  * Specify an optional className to add.
11
11
  */
12
12
  className?: string;
13
13
  }
14
- declare const FluidSelectSkeleton: React.FC<FluidSelectSkeletonProps>;
14
+ declare const FluidSelectSkeleton: {
15
+ ({ className, ...rest }: FluidSelectSkeletonProps): import("react/jsx-runtime").JSX.Element;
16
+ propTypes: {
17
+ /**
18
+ * Specify an optional className to add.
19
+ */
20
+ className: PropTypes.Requireable<string>;
21
+ };
22
+ };
15
23
  export default FluidSelectSkeleton;