@carbon/react 1.99.0-rc.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 (255) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +942 -942
  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/NumberInput/NumberInput.d.ts +9 -0
  75. package/es/components/NumberInput/NumberInput.js +206 -38
  76. package/es/components/OverflowMenu/OverflowMenu.d.ts +1 -1
  77. package/es/components/OverflowMenu/OverflowMenu.js +0 -1
  78. package/es/components/OverflowMenu/index.d.ts +1 -1
  79. package/es/components/PageHeader/PageHeader.d.ts +3 -3
  80. package/es/components/Popover/index.js +21 -12
  81. package/es/components/Search/Search.d.ts +2 -2
  82. package/es/components/Select/Select.d.ts +1 -1
  83. package/es/components/Select/Select.js +2 -2
  84. package/es/components/SkeletonIcon/SkeletonIcon.d.ts +16 -2
  85. package/es/components/SkeletonText/SkeletonText.d.ts +1 -1
  86. package/es/components/Tag/Tag.d.ts +1 -1
  87. package/es/components/Tag/Tag.js +2 -0
  88. package/es/components/Text/Text.d.ts +1 -1
  89. package/es/components/Text/Text.js +4 -3
  90. package/es/components/Text/TextDirection.d.ts +1 -1
  91. package/es/components/Text/TextDirection.js +1 -3
  92. package/es/components/Text/TextDirectionContext.d.ts +3 -3
  93. package/es/components/TextInput/ControlledPasswordInput.d.ts +1 -1
  94. package/es/components/TextInput/ControlledPasswordInput.js +2 -2
  95. package/es/components/TextInput/PasswordInput.d.ts +1 -1
  96. package/es/components/TextInput/PasswordInput.js +2 -2
  97. package/es/components/TextInput/TextInput.d.ts +1 -1
  98. package/es/components/TextInput/TextInput.js +2 -2
  99. package/es/components/Toggle/Toggle.Skeleton.d.ts +9 -3
  100. package/es/components/Toggletip/index.d.ts +1 -1
  101. package/es/components/Toggletip/index.js +9 -7
  102. package/es/components/Tooltip/DefinitionTooltip.d.ts +52 -1
  103. package/es/components/Tooltip/Tooltip.js +2 -0
  104. package/es/components/TreeView/TreeNode.d.ts +4 -4
  105. package/es/components/UIShell/Header.d.ts +20 -3
  106. package/es/components/UIShell/HeaderGlobalAction.d.ts +2 -2
  107. package/es/components/UIShell/HeaderName.js +1 -1
  108. package/es/components/UIShell/Link.d.ts +1 -1
  109. package/es/components/UIShell/Link.js +14 -14
  110. package/es/components/UIShell/SideNav.d.ts +3 -3
  111. package/es/components/UIShell/SideNav.js +26 -25
  112. package/es/components/UIShell/SideNavDivider.d.ts +11 -3
  113. package/es/components/UIShell/SideNavHeader.d.ts +24 -1
  114. package/es/components/UIShell/SideNavIcon.d.ts +20 -2
  115. package/es/components/UIShell/SideNavItem.d.ts +20 -2
  116. package/es/components/UIShell/SideNavItems.d.ts +22 -2
  117. package/es/components/UIShell/SideNavLink.d.ts +1 -1
  118. package/es/components/UIShell/SideNavLink.js +14 -14
  119. package/es/components/UIShell/SideNavMenu.d.ts +1 -1
  120. package/es/components/UIShell/SideNavMenu.js +2 -2
  121. package/es/components/UIShell/SideNavMenuItem.d.ts +2 -2
  122. package/es/components/UIShell/SideNavMenuItem.js +2 -2
  123. package/es/components/UIShell/SwitcherDivider.d.ts +10 -2
  124. package/es/internal/FloatingMenu.d.ts +1 -1
  125. package/es/internal/FloatingMenu.js +0 -2
  126. package/es/internal/PolymorphicProps.d.ts +3 -3
  127. package/es/internal/useNoInteractiveChildren.d.ts +1 -1
  128. package/es/internal/useNoInteractiveChildren.js +8 -10
  129. package/es/internal/useOutsideClick.d.ts +1 -1
  130. package/es/internal/useOutsideClick.js +0 -4
  131. package/lib/components/BadgeIndicator/index.d.ts +1 -1
  132. package/lib/components/BadgeIndicator/index.js +7 -5
  133. package/lib/components/Breadcrumb/BreadcrumbItem.d.ts +1 -1
  134. package/lib/components/Breadcrumb/BreadcrumbItem.js +5 -6
  135. package/lib/components/Button/Button.Skeleton.d.ts +28 -2
  136. package/lib/components/Button/Button.js +3 -2
  137. package/lib/components/ChatButton/ChatButton.d.ts +3 -2
  138. package/lib/components/CheckboxGroup/CheckboxGroup.d.ts +60 -2
  139. package/lib/components/ComboBox/ComboBox.d.ts +4 -4
  140. package/lib/components/ComboBox/ComboBox.js +21 -3
  141. package/lib/components/ComposedModal/ComposedModal.d.ts +2 -2
  142. package/lib/components/ContainedList/ContainedList.d.ts +35 -6
  143. package/lib/components/ContainedList/ContainedList.js +3 -1
  144. package/lib/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +32 -3
  145. package/lib/components/ContainedList/index.d.ts +1 -1
  146. package/lib/components/ContainedList/index.js +4 -1
  147. package/lib/components/DangerButton/DangerButton.d.ts +1 -1
  148. package/lib/components/DataTable/DataTable.d.ts +22 -5
  149. package/lib/components/DataTable/DataTable.js +1 -1
  150. package/lib/components/DataTable/TableExpandRow.d.ts +1 -1
  151. package/lib/components/DataTable/TableHeader.d.ts +1 -1
  152. package/lib/components/DataTable/TableHeader.js +17 -15
  153. package/lib/components/DataTable/TableToolbar.d.ts +25 -1
  154. package/lib/components/DataTable/TableToolbarMenu.d.ts +25 -5
  155. package/lib/components/DataTable/TableToolbarMenu.js +0 -3
  156. package/lib/components/DataTableSkeleton/DataTableSkeleton.d.ts +51 -2
  157. package/lib/components/DataTableSkeleton/DataTableSkeleton.js +6 -0
  158. package/lib/components/DatePicker/DatePicker.d.ts +2 -2
  159. package/lib/components/DatePicker/DatePicker.js +37 -52
  160. package/lib/components/DatePicker/plugins/fixEventsPlugin.js +28 -2
  161. package/lib/components/DatePickerInput/DatePickerInput.d.ts +1 -1
  162. package/lib/components/DatePickerInput/DatePickerInput.js +2 -1
  163. package/lib/components/Dialog/Dialog.d.ts +1 -1
  164. package/lib/components/Dropdown/Dropdown.Skeleton.d.ts +19 -2
  165. package/lib/components/ExpandableSearch/ExpandableSearch.d.ts +1 -1
  166. package/lib/components/ExpandableSearch/ExpandableSearch.js +13 -11
  167. package/lib/components/FileUploader/FileUploader.d.ts +1 -1
  168. package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
  169. package/lib/components/FileUploader/FileUploaderDropContainer.js +28 -10
  170. package/lib/components/FluidComboBox/FluidComboBox.Skeleton.d.ts +11 -3
  171. package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.d.ts +15 -3
  172. package/lib/components/FluidDatePicker/FluidDatePicker.d.ts +2 -2
  173. package/lib/components/FluidDropdown/FluidDropdown.Skeleton.d.ts +11 -3
  174. package/lib/components/FluidForm/FluidForm.d.ts +15 -2
  175. package/lib/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +2 -2
  176. package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.d.ts +11 -3
  177. package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.d.ts +11 -3
  178. package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +1 -1
  179. package/lib/components/FluidSearch/FluidSearch.Skeleton.d.ts +11 -3
  180. package/lib/components/FluidSearch/FluidSearch.d.ts +1 -1
  181. package/lib/components/FluidSearch/FluidSearch.js +2 -2
  182. package/lib/components/FluidSelect/FluidSelect.Skeleton.d.ts +11 -3
  183. package/lib/components/FluidTextArea/FluidTextArea.Skeleton.d.ts +11 -3
  184. package/lib/components/FluidTextArea/FluidTextArea.d.ts +95 -1
  185. package/lib/components/FluidTextInput/FluidPasswordInput.d.ts +83 -2
  186. package/lib/components/FluidTextInput/FluidTextInput.Skeleton.d.ts +11 -3
  187. package/lib/components/Grid/GridContext.d.ts +19 -1
  188. package/lib/components/IconButton/index.d.ts +1 -1
  189. package/lib/components/Link/Link.js +3 -0
  190. package/lib/components/ListBox/ListBoxField.d.ts +35 -2
  191. package/lib/components/ListBox/ListBoxMenuIcon.d.ts +16 -3
  192. package/lib/components/ListBox/ListBoxMenuItem.d.ts +1 -1
  193. package/lib/components/ListBox/ListBoxSelection.d.ts +34 -3
  194. package/lib/components/Menu/MenuItem.d.ts +2 -2
  195. package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +2 -2
  196. package/lib/components/MultiSelect/FilterableMultiSelect.js +22 -13
  197. package/lib/components/MultiSelect/MultiSelect.js +22 -13
  198. package/lib/components/Notification/Notification.d.ts +8 -7
  199. package/lib/components/Notification/Notification.js +0 -1
  200. package/lib/components/NumberInput/NumberInput.d.ts +9 -0
  201. package/lib/components/NumberInput/NumberInput.js +206 -37
  202. package/lib/components/OverflowMenu/OverflowMenu.d.ts +1 -1
  203. package/lib/components/OverflowMenu/OverflowMenu.js +0 -1
  204. package/lib/components/OverflowMenu/index.d.ts +1 -1
  205. package/lib/components/PageHeader/PageHeader.d.ts +3 -3
  206. package/lib/components/Popover/index.js +19 -10
  207. package/lib/components/Search/Search.d.ts +2 -2
  208. package/lib/components/Select/Select.d.ts +1 -1
  209. package/lib/components/SkeletonIcon/SkeletonIcon.d.ts +16 -2
  210. package/lib/components/SkeletonText/SkeletonText.d.ts +1 -1
  211. package/lib/components/Tag/Tag.d.ts +1 -1
  212. package/lib/components/Tag/Tag.js +2 -0
  213. package/lib/components/Text/Text.d.ts +1 -1
  214. package/lib/components/Text/Text.js +3 -2
  215. package/lib/components/Text/TextDirection.d.ts +1 -1
  216. package/lib/components/Text/TextDirection.js +1 -3
  217. package/lib/components/Text/TextDirectionContext.d.ts +3 -3
  218. package/lib/components/TextInput/ControlledPasswordInput.d.ts +1 -1
  219. package/lib/components/TextInput/PasswordInput.d.ts +1 -1
  220. package/lib/components/TextInput/TextInput.d.ts +1 -1
  221. package/lib/components/Toggle/Toggle.Skeleton.d.ts +9 -3
  222. package/lib/components/Toggletip/index.d.ts +1 -1
  223. package/lib/components/Toggletip/index.js +7 -5
  224. package/lib/components/Tooltip/DefinitionTooltip.d.ts +52 -1
  225. package/lib/components/Tooltip/Tooltip.js +2 -0
  226. package/lib/components/TreeView/TreeNode.d.ts +4 -4
  227. package/lib/components/UIShell/Header.d.ts +20 -3
  228. package/lib/components/UIShell/HeaderGlobalAction.d.ts +2 -2
  229. package/lib/components/UIShell/HeaderName.js +1 -1
  230. package/lib/components/UIShell/Link.d.ts +1 -1
  231. package/lib/components/UIShell/Link.js +13 -13
  232. package/lib/components/UIShell/SideNav.d.ts +3 -3
  233. package/lib/components/UIShell/SideNav.js +25 -24
  234. package/lib/components/UIShell/SideNavDivider.d.ts +11 -3
  235. package/lib/components/UIShell/SideNavHeader.d.ts +24 -1
  236. package/lib/components/UIShell/SideNavIcon.d.ts +20 -2
  237. package/lib/components/UIShell/SideNavItem.d.ts +20 -2
  238. package/lib/components/UIShell/SideNavItems.d.ts +22 -2
  239. package/lib/components/UIShell/SideNavLink.d.ts +1 -1
  240. package/lib/components/UIShell/SideNavLink.js +14 -14
  241. package/lib/components/UIShell/SideNavMenu.d.ts +1 -1
  242. package/lib/components/UIShell/SideNavMenuItem.d.ts +2 -2
  243. package/lib/components/UIShell/SwitcherDivider.d.ts +10 -2
  244. package/lib/internal/FloatingMenu.d.ts +1 -1
  245. package/lib/internal/FloatingMenu.js +0 -2
  246. package/lib/internal/PolymorphicProps.d.ts +3 -3
  247. package/lib/internal/useNoInteractiveChildren.d.ts +1 -1
  248. package/lib/internal/useNoInteractiveChildren.js +8 -10
  249. package/lib/internal/useOutsideClick.d.ts +1 -1
  250. package/lib/internal/useOutsideClick.js +0 -4
  251. package/package.json +8 -8
  252. package/scss/_carbon-utilities.scss +9 -0
  253. package/telemetry.yml +0 -1
  254. package/es/internal/createClassWrapper.d.ts +0 -12
  255. package/lib/internal/createClassWrapper.d.ts +0 -12
@@ -43,8 +43,41 @@ const getSeparators = locale => {
43
43
  const numberWithGroupAndDecimal = 1234567.89;
44
44
  const formatted = new Intl.NumberFormat(locale).format(numberWithGroupAndDecimal);
45
45
 
46
- // Extract separators using regex
47
- const match = formatted.match(/(\D+)\d{3}(\D+)\d{2}$/);
46
+ // Comprehensive Unicode digit pattern that includes all common numeral systems
47
+ // supported by Intl.NumberFormat across different locales
48
+ const digitPattern = '[' + '\\u0030-\\u0039' +
49
+ // Western
50
+ '\\u0660-\\u0669' +
51
+ // Eastern Arabic
52
+ '\\u0966-\\u096F' +
53
+ // Devanagari
54
+ '\\u09E6-\\u09EF' +
55
+ // Bengali
56
+ '\\uFF10-\\uFF19' +
57
+ // Fullwidth Japanese 0-9
58
+ '一二三四五六七八九〇零' +
59
+ // Kanji digits
60
+ ']';
61
+
62
+ // Non-digit pattern that excludes ALL digit types (not just ASCII 0-9)
63
+ const nonDigitPattern = '[^' + '\\u0030-\\u0039' +
64
+ // Western
65
+ '\\u0660-\\u0669' +
66
+ // Eastern Arabic
67
+ '\\u0966-\\u096F' +
68
+ // Devanagari
69
+ '\\u09E6-\\u09EF' +
70
+ // Bengali
71
+ '\\uFF10-\\uFF19' +
72
+ // Fullwidth Japanese 0-9
73
+ '一二三四五六七八九〇零' +
74
+ // Kanji digits
75
+ ']+';
76
+
77
+ // Extract separators using regex that handles all numeral systems
78
+ // Use nonDigitPattern instead of \D+ to correctly identify separators
79
+ const regex = new RegExp(`(${nonDigitPattern})${digitPattern}{3}(${nonDigitPattern})${digitPattern}{2}$`);
80
+ const match = formatted.match(regex);
48
81
  if (match) {
49
82
  const groupSeparator = match[1];
50
83
  const decimalSeparator = match[2];
@@ -59,11 +92,116 @@ const getSeparators = locale => {
59
92
  };
60
93
  }
61
94
  };
95
+
96
+ // Normalizes all Unicode minus variants to ASCII hyphen-minus (-)
97
+ const normalizeMinus = value => value.replace(/[\u2212\u2012\u2013\u2014\uFE63\uFF0D]/g, '-');
98
+ const normalizeNumericInput = value => value
99
+ // Remove bidi / direction control characters (Arabic keyboards)
100
+ .replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g, '')
101
+ // Normalize Unicode minus variants to ASCII "-"
102
+ .replace(/[\u2212\u2012\u2013\u2014\uFE63\uFF0D]/g, '-');
103
+ /**
104
+ * Converts a string with any Unicode numeral system to a JavaScript number.
105
+ * Handles all numeral systems supported by Intl.NumberFormat.
106
+ *
107
+ * @param {string} input - The input string with numerals in any Unicode system
108
+ * @param {string} locale - The locale for parsing separators
109
+ * @returns {number} The parsed number, or NaN if invalid
110
+ */
111
+ const parseNumberWithLocale = (input, locale) => {
112
+ // Handle empty, null, or undefined inputs
113
+ if (input === '' || input === undefined || input === null) {
114
+ return NaN;
115
+ }
116
+ input = normalizeNumericInput(input);
117
+ const {
118
+ groupSeparator,
119
+ decimalSeparator
120
+ } = getSeparators(locale);
121
+
122
+ // Kanji digit map
123
+ const kanjiMap = {
124
+ 零: '0',
125
+ 〇: '0',
126
+ 一: '1',
127
+ 二: '2',
128
+ 三: '3',
129
+ 四: '4',
130
+ 五: '5',
131
+ 六: '6',
132
+ 七: '7',
133
+ 八: '8',
134
+ 九: '9'
135
+ };
136
+ const digitRanges = [{
137
+ start: 0x0030,
138
+ end: 0x0039,
139
+ base: 0x0030
140
+ }, {
141
+ start: 0x0660,
142
+ end: 0x0669,
143
+ base: 0x0660
144
+ }, {
145
+ start: 0x0966,
146
+ end: 0x096f,
147
+ base: 0x0966
148
+ }, {
149
+ start: 0x09e6,
150
+ end: 0x09ef,
151
+ base: 0x09e6
152
+ }, {
153
+ start: 0xff10,
154
+ end: 0xff19,
155
+ base: 0xff10
156
+ }];
157
+ let normalized = Array.from(input).map(char => {
158
+ // Preserve scientific notation characters
159
+ if (char === 'e' || char === 'E' || char === '+' || char === '-') {
160
+ return char;
161
+ }
162
+
163
+ // Check Kanji first
164
+ if (kanjiMap[char] !== undefined) {
165
+ return kanjiMap[char];
166
+ }
167
+ const code = char.charCodeAt(0);
168
+ for (const range of digitRanges) {
169
+ if (code >= range.start && code <= range.end) {
170
+ return String(code - range.start);
171
+ }
172
+ }
173
+ return char;
174
+ }).join('');
175
+
176
+ // Remove grouping separators
177
+ if (groupSeparator) {
178
+ if (groupSeparator?.trim() === '') {
179
+ normalized = normalized?.replace(/[\u00A0\u202F\s]/g, '');
180
+ } else {
181
+ if (decimalSeparator !== ',' && decimalSeparator !== '٬') {
182
+ normalized = normalized?.replace(/[,٬]/g, '');
183
+ }
184
+ if (groupSeparator !== ',' && groupSeparator !== '٬') {
185
+ const escaped = groupSeparator?.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
186
+ normalized = normalized?.replace(new RegExp(escaped, 'g'), '');
187
+ }
188
+ }
189
+ }
190
+ normalized = normalized.replace(/٫/g, '.');
191
+ if (decimalSeparator && decimalSeparator !== '.' && decimalSeparator !== '٫') {
192
+ const escaped = decimalSeparator.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
193
+ normalized = normalized.replace(new RegExp(escaped, 'g'), '.');
194
+ }
195
+ normalized = normalizeMinus(normalized);
196
+ return Number(normalized);
197
+ };
62
198
  const validateNumberSeparators = (input, locale) => {
63
- // allow empty string
64
- if (input === '' || Number.isNaN(input)) {
199
+ if (input === '') {
65
200
  return true;
66
201
  }
202
+
203
+ // Normalize bidi marks + minus signs FIRST
204
+ input = normalizeNumericInput(input);
67
205
  const {
68
206
  groupSeparator,
69
207
  decimalSeparator
@@ -72,35 +210,54 @@ const validateNumberSeparators = (input, locale) => {
72
210
  return !isNaN(Number(input));
73
211
  }
74
212
  const esc = s => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
213
+ const digit = '[' + '\\u0030-\\u0039' + '\\u0660-\\u0669' + '\\u0966-\\u096F' + '\\u09E6-\\u09EF' + '\\uFF10-\\uFF19' + '一二三四五六七八九〇零' + ']';
214
+
215
+ // Group separator regex
75
216
  let group = '';
76
217
  if (groupSeparator) {
77
- if (groupSeparator.trim() === '') {
78
- group = '[\\u00A0\\u202F\\s]'; // handle NBSP, narrow NBSP, space
218
+ if (groupSeparator?.trim() === '') {
219
+ group = '[\\u00A0\\u202F\\s]';
220
+ } else if (groupSeparator === ',' || groupSeparator === '٬') {
221
+ group = '[,٬]';
79
222
  } else {
80
223
  group = esc(groupSeparator);
81
224
  }
82
225
  }
83
- const decimal = esc(decimalSeparator);
84
226
 
85
- // Regex for:
86
- // - integers (with/without grouping)
87
- // - optional decimal with 0+ digits after separator
88
- const regex = new RegExp(`^-?\\d{1,3}(${group}\\d{3})*(${decimal}\\d*)?$|^-?\\d+(${decimal}\\d*)?$`);
89
- if (!regex.test(input)) {
90
- return false;
227
+ // Decimal separator regex
228
+ let decimal = esc(decimalSeparator);
229
+ if (decimalSeparator === '.' || decimalSeparator === '٫') {
230
+ decimal = '[.٫]';
91
231
  }
232
+ const sign = '[\\-\\u2212]?';
233
+ const scientific = `([eE][+-]?${digit}+)?`;
92
234
 
93
- // Normalize
94
- let normalized = input;
95
- if (groupSeparator) {
96
- if (groupSeparator.trim() === '') {
97
- normalized = normalized?.replace(/[\u00A0\u202F\s]/g, '');
98
- } else {
99
- normalized = normalized?.split(groupSeparator).join('');
100
- }
235
+ // Detect if grouping is used AT ALL
236
+ const usesGrouping = group && (groupSeparator?.trim() === '' ? /[\u00A0\u202F\s]/.test(input) : groupSeparator === ',' || groupSeparator === '٬' ? /[,٬]/.test(input) : groupSeparator ? input.includes(groupSeparator) : false);
237
+ const scientificMatch = input?.match(/^([^eE]+)([eE][+-]?.*)?$/);
238
+ const baseNumber = scientificMatch ? scientificMatch[1] : input;
239
+
240
+ // Split integer part from the base number - handle both decimal separator variants
241
+ let integerPart;
242
+ if (decimalSeparator === '.' || decimalSeparator === '٫') {
243
+ // Split by either . or ٫
244
+ integerPart = baseNumber?.split(/[.,]/)[0];
245
+ } else {
246
+ integerPart = baseNumber?.split(decimalSeparator)[0];
101
247
  }
102
- normalized = normalized?.replace(decimalSeparator, '.');
103
- return !isNaN(Number(normalized));
248
+
249
+ // STEP 1: strict integer validation
250
+ // When grouping is used, we need to handle two cases:
251
+ // 1. Numbers with 1-3 digits (no separator required): 1, 12, 123
252
+ // 2. Numbers with 4+ digits (separator required): 1,234 or 12,345 or 123,456
253
+ const integerRegex = usesGrouping ? new RegExp(`^${sign}(${digit}{1,3}|${digit}{1,3}(${group}${digit}{3})+)$`) : new RegExp(`^${sign}${digit}+$`);
254
+ if (!integerRegex.test(integerPart)) {
255
+ return false;
256
+ }
257
+
258
+ // STEP 2: full number validation
259
+ const fullRegex = new RegExp(`^${sign}${digit}+` + (usesGrouping ? `(${group}${digit}{3})*` : '') + `(${decimal}${digit}+)?${scientific}$`);
260
+ return fullRegex.test(input);
104
261
  };
105
262
 
106
263
  // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
@@ -292,8 +449,9 @@ const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
292
449
  }
293
450
  };
294
451
  const outerElementClasses = cx(`${prefix}--form-item`, {
295
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
296
- [customClassName]: !!customClassName,
452
+ ...(customClassName ? {
453
+ [customClassName]: true
454
+ } : {}),
297
455
  [`${prefix}--number-input--fluid--invalid`]: isFluid && normalizedProps.invalid,
298
456
  [`${prefix}--number-input--fluid--focus`]: isFluid && isFocused,
299
457
  [`${prefix}--number-input--fluid--disabled`]: isFluid && disabled
@@ -764,23 +922,33 @@ function getInputValidity({
764
922
  validate,
765
923
  locale
766
924
  }) {
767
- if (typeof validate === 'function') {
768
- const result = validate(value, locale);
769
- if (result === false) {
770
- return false; // immediate invalid
771
- }
772
- // If true or undefined, continue to further validations
773
- }
774
925
  if (invalid) {
775
926
  return false;
776
927
  }
777
- if (value === '') {
778
- return allowEmpty;
928
+
929
+ // Skip validation if value is empty and allowEmpty
930
+ if (value === '') return allowEmpty;
931
+
932
+ // Normalize the value
933
+ let numericValue;
934
+ if (typeof value === 'string') {
935
+ numericValue = parseNumberWithLocale(value, locale); // safe: handles Arabic, Kanji, etc.
936
+ } else {
937
+ numericValue = value;
779
938
  }
780
- if (value > max || value < min) {
781
- return false;
939
+
940
+ // Use custom validate ONLY for formatting, not numeric comparison
941
+ if (validate && typeof value === 'string') {
942
+ const isFormatValid = validate(value, locale);
943
+ if (isFormatValid === false) {
944
+ return false; // invalid format
945
+ }
782
946
  }
783
- return true;
947
+
948
+ // Check min/max bounds
949
+ if (max !== undefined && numericValue > max) return false;
950
+ if (min !== undefined && numericValue < min) return false;
951
+ return true; // valid
784
952
  }
785
953
 
786
954
  /**
@@ -801,4 +969,4 @@ function disableWheel(e) {
801
969
  e.preventDefault();
802
970
  }
803
971
 
804
- export { NumberInput, validateNumberSeparators };
972
+ export { NumberInput, parseNumberWithLocale, validateNumberSeparators };
@@ -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.
@@ -75,7 +75,6 @@ const getMenuOffset = (menuBody, direction, trigger, flip) => {
75
75
  case 'top':
76
76
  case 'bottom':
77
77
  {
78
- // TODO: Ensure `trigger` is there for `<OverflowMenu open>`
79
78
  const triggerWidth = !trigger ? 0 : trigger.offsetWidth;
80
79
  return {
81
80
  left: (!flip ? 1 : -1) * (menuWidth / 2 - triggerWidth / 2),
@@ -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.
@@ -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, { type ComponentType, type FunctionComponent } from 'react';
7
+ import React, { type ElementType } from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import { TYPES } from '../Tag/Tag';
10
10
  /**
@@ -32,7 +32,7 @@ interface PageHeaderBreadcrumbBarProps {
32
32
  /**
33
33
  * Provide an optional icon to render in front of the PageHeaderContent's title.
34
34
  */
35
- renderIcon?: ComponentType | FunctionComponent;
35
+ renderIcon?: ElementType;
36
36
  /**
37
37
  * The PageHeaderBreadcrumbBar's content actions
38
38
  */
@@ -68,7 +68,7 @@ interface PageHeaderContentProps {
68
68
  /**
69
69
  * Provide an optional icon to render in front of the PageHeaderContent's title.
70
70
  */
71
- renderIcon?: ComponentType | FunctionComponent;
71
+ renderIcon?: ElementType;
72
72
  /**
73
73
  * The PageHeaderContent's title
74
74
  */
@@ -9,13 +9,13 @@ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js
9
9
  import cx from 'classnames';
10
10
  import PropTypes from 'prop-types';
11
11
  import { deprecateValuesWithin } from '../../prop-types/deprecateValuesWithin.js';
12
- import React, { useRef, useMemo, useEffect } from 'react';
12
+ import React, { forwardRef, useRef, useEffect, useMemo } from 'react';
13
13
  import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
14
14
  import { useMergedRefs } from '../../internal/useMergedRefs.js';
15
15
  import { usePrefix } from '../../internal/usePrefix.js';
16
16
  import { useEvent, useWindowEvent } from '../../internal/useEvent.js';
17
17
  import { mapPopoverAlign } from '../../tools/mapPopoverAlign.js';
18
- import { useFloating, autoUpdate, offset, flip, arrow, hide } from '@floating-ui/react';
18
+ import { useFloating, offset, flip, arrow, hide, autoUpdate } from '@floating-ui/react';
19
19
  import { useFeatureFlag } from '../FeatureFlags/index.js';
20
20
 
21
21
  const PopoverContext = /*#__PURE__*/React.createContext({
@@ -147,7 +147,9 @@ forwardRef) {
147
147
  refs,
148
148
  floatingStyles,
149
149
  placement,
150
- middlewareData
150
+ middlewareData,
151
+ elements,
152
+ update
151
153
  } = useFloating(enableFloatingStyles ? {
152
154
  placement: align,
153
155
  // The floating element is positioned relative to its nearest
@@ -167,12 +169,18 @@ forwardRef) {
167
169
  }), arrow({
168
170
  element: caretRef,
169
171
  padding: 16
170
- }), autoAlign && hide()],
171
- whileElementsMounted: autoUpdate
172
+ }), autoAlign && hide()]
172
173
  } : {}
173
174
  // When autoAlign is turned off & the `enable-v12-dynamic-floating-styles` feature flag is not
174
175
  // enabled, floating-ui will not be used
175
176
  );
177
+ useEffect(() => {
178
+ if (!enableFloatingStyles) return;
179
+ if (open && elements.reference && elements.floating) {
180
+ const cleanup = autoUpdate(elements.reference, elements.floating, update);
181
+ return cleanup;
182
+ }
183
+ }, [enableFloatingStyles, open, elements, update]);
176
184
  const value = useMemo(() => {
177
185
  return {
178
186
  floating,
@@ -397,11 +405,13 @@ Popover.propTypes = {
397
405
  */
398
406
  open: PropTypes.bool.isRequired
399
407
  };
400
- function PopoverContentRenderFunction({
401
- className,
402
- children,
403
- ...rest
404
- }, forwardRef) {
408
+ const frFn = forwardRef;
409
+ const PopoverContent = frFn((props, forwardRef) => {
410
+ const {
411
+ className,
412
+ children,
413
+ ...rest
414
+ } = props;
405
415
  const prefix = usePrefix();
406
416
  const {
407
417
  setFloating,
@@ -427,8 +437,7 @@ function PopoverContentRenderFunction({
427
437
  }),
428
438
  ref: caretRef
429
439
  }));
430
- }
431
- const PopoverContent = /*#__PURE__*/React.forwardRef(PopoverContentRenderFunction);
440
+ });
432
441
  PopoverContent.displayName = 'PopoverContent';
433
442
  PopoverContent.propTypes = {
434
443
  /**
@@ -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, { type ChangeEvent, type ComponentType, type FunctionComponent, type HTMLAttributes, type KeyboardEvent, type MouseEvent, type ReactNode } from 'react';
7
+ import React, { type ChangeEvent, type ElementType, type HTMLAttributes, type KeyboardEvent, type MouseEvent, type ReactNode } from 'react';
8
8
  type InputPropsBase = Omit<HTMLAttributes<HTMLInputElement>, 'onChange'>;
9
9
  export interface SearchProps extends InputPropsBase {
10
10
  /**
@@ -61,7 +61,7 @@ export interface SearchProps extends InputPropsBase {
61
61
  /**
62
62
  * A component used to render an icon.
63
63
  */
64
- renderIcon?: ComponentType | FunctionComponent;
64
+ renderIcon?: ElementType;
65
65
  /**
66
66
  * @deprecated Specify the role for the underlying `<input>`.
67
67
  * No longer needed since `<input type="search">` already provides the correct semantics.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2025
2
+ * Copyright IBM Corp. 2016, 2026
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -7,7 +7,7 @@
7
7
 
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import PropTypes from 'prop-types';
10
- import React, { useContext, useState, cloneElement } from 'react';
10
+ import React, { forwardRef, useContext, useState, cloneElement } from 'react';
11
11
  import cx from 'classnames';
12
12
  import { ChevronDown, WarningFilled, WarningAltFilled } from '@carbon/icons-react';
13
13
  import { deprecate } from '../../prop-types/deprecate.js';
@@ -21,7 +21,7 @@ import { AILabel } from '../AILabel/index.js';
21
21
  import { isComponentElement } from '../../internal/utils.js';
22
22
  import { useNormalizedInputProps } from '../../internal/useNormalizedInputProps.js';
23
23
 
24
- const Select = /*#__PURE__*/React.forwardRef(({
24
+ const Select = /*#__PURE__*/forwardRef(({
25
25
  className,
26
26
  decorator,
27
27
  id,
@@ -1,9 +1,23 @@
1
- import React from 'react';
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import PropTypes from 'prop-types';
2
8
  export interface SkeletonIconProps {
3
9
  /**
4
10
  * Specify an optional className to add.
5
11
  */
6
12
  className?: string;
7
13
  }
8
- declare const SkeletonIcon: React.FC<SkeletonIconProps>;
14
+ declare const SkeletonIcon: {
15
+ ({ className, ...other }: SkeletonIconProps): import("react/jsx-runtime").JSX.Element;
16
+ propTypes: {
17
+ /**
18
+ * Specify an optional className to add.
19
+ */
20
+ className: PropTypes.Requireable<string>;
21
+ };
22
+ };
9
23
  export default SkeletonIcon;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
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.
@@ -72,7 +72,7 @@ export interface TagBaseProps {
72
72
  */
73
73
  slug?: ReactNode;
74
74
  /**
75
- * @deprecated The `title` prop has been deprecated and will be removed in the next major version. Use DismissibleTag instead.
75
+ * @deprecated The `title` prop has been deprecated and will be removed in the next major version. Use `children` instead.
76
76
  */
77
77
  title?: string;
78
78
  /**
@@ -152,6 +152,8 @@ const TagBase = /*#__PURE__*/React.forwardRef(({
152
152
  }, normalizedDecorator) : '');
153
153
  });
154
154
  const Tag = TagBase;
155
+
156
+ // @ts-expect-error - `propTypes` isn't typed.
155
157
  Tag.propTypes = {
156
158
  /**
157
159
  * Provide an alternative tag or component to use instead of the default
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2025
2
+ * Copyright IBM Corp. 2016, 2026
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -7,11 +7,11 @@
7
7
 
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import PropTypes from 'prop-types';
10
- import React, { useContext, Children } from 'react';
10
+ import React, { forwardRef, useContext, Children } from 'react';
11
11
  import { TextDirectionContext } from './TextDirectionContext.js';
12
12
 
13
13
  // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
14
- const TextBase = /*#__PURE__*/React.forwardRef(({
14
+ const Text = /*#__PURE__*/forwardRef(({
15
15
  as,
16
16
  children,
17
17
  dir = 'auto',
@@ -53,7 +53,8 @@ const TextBase = /*#__PURE__*/React.forwardRef(({
53
53
  ref: ref
54
54
  }, rest, textProps), children));
55
55
  });
56
- const Text = TextBase;
56
+
57
+ // @ts-expect-error - `propTypes` isn't typed.
57
58
  Text.propTypes = {
58
59
  /**
59
60
  * Provide a custom element type used to render the outermost node
@@ -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.
@@ -23,9 +23,7 @@ const TextDirection = ({
23
23
  }, [dir]);
24
24
  useEffect(() => {
25
25
  savedCallback.current = getTextDirection;
26
- // TODO: Is this `useEffect` supposed to have a dependency on
27
- // `getTextDirection`?
28
- });
26
+ }, [getTextDirection]);
29
27
  return /*#__PURE__*/React.createElement(TextDirectionContext.Provider, {
30
28
  value: value
31
29
  }, children);
@@ -1,14 +1,14 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2025
2
+ * Copyright IBM Corp. 2016, 2026
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import { type MutableRefObject } from 'react';
7
+ import { type RefObject } from 'react';
8
8
  export type TextDir = 'ltr' | 'rtl' | 'auto' | string;
9
9
  export type GetTextDirection = (text: string | string[] | undefined) => TextDir;
10
10
  export interface TextDirectionContextType {
11
11
  direction: TextDir;
12
- getTextDirection: MutableRefObject<GetTextDirection | undefined>;
12
+ getTextDirection: RefObject<GetTextDirection | undefined>;
13
13
  }
14
14
  export declare const TextDirectionContext: import("react").Context<TextDirectionContextType>;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2023, 2025
2
+ * Copyright IBM Corp. 2023, 2026
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
- import React from 'react';
9
+ import React, { forwardRef } from 'react';
10
10
  import cx from 'classnames';
11
11
  import PropTypes from 'prop-types';
12
12
  import { WarningFilled, ViewOff, View } from '@carbon/icons-react';
@@ -16,7 +16,7 @@ import { usePrefix } from '../../internal/usePrefix.js';
16
16
  import { useId } from '../../internal/useId.js';
17
17
  import { noopFn } from '../../internal/noopFn.js';
18
18
 
19
- const ControlledPasswordInput = /*#__PURE__*/React.forwardRef(({
19
+ const ControlledPasswordInput = /*#__PURE__*/forwardRef(({
20
20
  labelText,
21
21
  className,
22
22
  id,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2023, 2025
2
+ * Copyright IBM Corp. 2023, 2026
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
- import React, { useState, useContext, useEffect } from 'react';
9
+ import React, { forwardRef, useState, useContext, useEffect } from 'react';
10
10
  import cx from 'classnames';
11
11
  import PropTypes from 'prop-types';
12
12
  import { ViewOff, View } from '@carbon/icons-react';
@@ -19,7 +19,7 @@ import { Tooltip } from '../Tooltip/Tooltip.js';
19
19
  import { deprecate } from '../../prop-types/deprecate.js';
20
20
  import { usePrefix } from '../../internal/usePrefix.js';
21
21
 
22
- const PasswordInput = /*#__PURE__*/React.forwardRef(({
22
+ const PasswordInput = /*#__PURE__*/forwardRef(({
23
23
  className,
24
24
  disabled = false,
25
25
  helperText,
@@ -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.