@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
@@ -45,8 +45,41 @@ const getSeparators = locale => {
45
45
  const numberWithGroupAndDecimal = 1234567.89;
46
46
  const formatted = new Intl.NumberFormat(locale).format(numberWithGroupAndDecimal);
47
47
 
48
- // Extract separators using regex
49
- const match = formatted.match(/(\D+)\d{3}(\D+)\d{2}$/);
48
+ // Comprehensive Unicode digit pattern that includes all common numeral systems
49
+ // supported by Intl.NumberFormat across different locales
50
+ const digitPattern = '[' + '\\u0030-\\u0039' +
51
+ // Western
52
+ '\\u0660-\\u0669' +
53
+ // Eastern Arabic
54
+ '\\u0966-\\u096F' +
55
+ // Devanagari
56
+ '\\u09E6-\\u09EF' +
57
+ // Bengali
58
+ '\\uFF10-\\uFF19' +
59
+ // Fullwidth Japanese 0-9
60
+ '一二三四五六七八九〇零' +
61
+ // Kanji digits
62
+ ']';
63
+
64
+ // Non-digit pattern that excludes ALL digit types (not just ASCII 0-9)
65
+ const nonDigitPattern = '[^' + '\\u0030-\\u0039' +
66
+ // Western
67
+ '\\u0660-\\u0669' +
68
+ // Eastern Arabic
69
+ '\\u0966-\\u096F' +
70
+ // Devanagari
71
+ '\\u09E6-\\u09EF' +
72
+ // Bengali
73
+ '\\uFF10-\\uFF19' +
74
+ // Fullwidth Japanese 0-9
75
+ '一二三四五六七八九〇零' +
76
+ // Kanji digits
77
+ ']+';
78
+
79
+ // Extract separators using regex that handles all numeral systems
80
+ // Use nonDigitPattern instead of \D+ to correctly identify separators
81
+ const regex = new RegExp(`(${nonDigitPattern})${digitPattern}{3}(${nonDigitPattern})${digitPattern}{2}$`);
82
+ const match = formatted.match(regex);
50
83
  if (match) {
51
84
  const groupSeparator = match[1];
52
85
  const decimalSeparator = match[2];
@@ -61,11 +94,116 @@ const getSeparators = locale => {
61
94
  };
62
95
  }
63
96
  };
97
+
98
+ // Normalizes all Unicode minus variants to ASCII hyphen-minus (-)
99
+ const normalizeMinus = value => value.replace(/[\u2212\u2012\u2013\u2014\uFE63\uFF0D]/g, '-');
100
+ const normalizeNumericInput = value => value
101
+ // Remove bidi / direction control characters (Arabic keyboards)
102
+ .replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g, '')
103
+ // Normalize Unicode minus variants to ASCII "-"
104
+ .replace(/[\u2212\u2012\u2013\u2014\uFE63\uFF0D]/g, '-');
105
+ /**
106
+ * Converts a string with any Unicode numeral system to a JavaScript number.
107
+ * Handles all numeral systems supported by Intl.NumberFormat.
108
+ *
109
+ * @param {string} input - The input string with numerals in any Unicode system
110
+ * @param {string} locale - The locale for parsing separators
111
+ * @returns {number} The parsed number, or NaN if invalid
112
+ */
113
+ const parseNumberWithLocale = (input, locale) => {
114
+ // Handle empty, null, or undefined inputs
115
+ if (input === '' || input === undefined || input === null) {
116
+ return NaN;
117
+ }
118
+ input = normalizeNumericInput(input);
119
+ const {
120
+ groupSeparator,
121
+ decimalSeparator
122
+ } = getSeparators(locale);
123
+
124
+ // Kanji digit map
125
+ const kanjiMap = {
126
+ 零: '0',
127
+ 〇: '0',
128
+ 一: '1',
129
+ 二: '2',
130
+ 三: '3',
131
+ 四: '4',
132
+ 五: '5',
133
+ 六: '6',
134
+ 七: '7',
135
+ 八: '8',
136
+ 九: '9'
137
+ };
138
+ const digitRanges = [{
139
+ start: 0x0030,
140
+ end: 0x0039,
141
+ base: 0x0030
142
+ }, {
143
+ start: 0x0660,
144
+ end: 0x0669,
145
+ base: 0x0660
146
+ }, {
147
+ start: 0x0966,
148
+ end: 0x096f,
149
+ base: 0x0966
150
+ }, {
151
+ start: 0x09e6,
152
+ end: 0x09ef,
153
+ base: 0x09e6
154
+ }, {
155
+ start: 0xff10,
156
+ end: 0xff19,
157
+ base: 0xff10
158
+ }];
159
+ let normalized = Array.from(input).map(char => {
160
+ // Preserve scientific notation characters
161
+ if (char === 'e' || char === 'E' || char === '+' || char === '-') {
162
+ return char;
163
+ }
164
+
165
+ // Check Kanji first
166
+ if (kanjiMap[char] !== undefined) {
167
+ return kanjiMap[char];
168
+ }
169
+ const code = char.charCodeAt(0);
170
+ for (const range of digitRanges) {
171
+ if (code >= range.start && code <= range.end) {
172
+ return String(code - range.start);
173
+ }
174
+ }
175
+ return char;
176
+ }).join('');
177
+
178
+ // Remove grouping separators
179
+ if (groupSeparator) {
180
+ if (groupSeparator?.trim() === '') {
181
+ normalized = normalized?.replace(/[\u00A0\u202F\s]/g, '');
182
+ } else {
183
+ if (decimalSeparator !== ',' && decimalSeparator !== '٬') {
184
+ normalized = normalized?.replace(/[,٬]/g, '');
185
+ }
186
+ if (groupSeparator !== ',' && groupSeparator !== '٬') {
187
+ const escaped = groupSeparator?.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
188
+ normalized = normalized?.replace(new RegExp(escaped, 'g'), '');
189
+ }
190
+ }
191
+ }
192
+ normalized = normalized.replace(/٫/g, '.');
193
+ if (decimalSeparator && decimalSeparator !== '.' && decimalSeparator !== '٫') {
194
+ const escaped = decimalSeparator.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
195
+ normalized = normalized.replace(new RegExp(escaped, 'g'), '.');
196
+ }
197
+ normalized = normalizeMinus(normalized);
198
+ return Number(normalized);
199
+ };
64
200
  const validateNumberSeparators = (input, locale) => {
65
- // allow empty string
66
- if (input === '' || Number.isNaN(input)) {
201
+ if (input === '') {
67
202
  return true;
68
203
  }
204
+
205
+ // Normalize bidi marks + minus signs FIRST
206
+ input = normalizeNumericInput(input);
69
207
  const {
70
208
  groupSeparator,
71
209
  decimalSeparator
@@ -74,35 +212,54 @@ const validateNumberSeparators = (input, locale) => {
74
212
  return !isNaN(Number(input));
75
213
  }
76
214
  const esc = s => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
215
+ const digit = '[' + '\\u0030-\\u0039' + '\\u0660-\\u0669' + '\\u0966-\\u096F' + '\\u09E6-\\u09EF' + '\\uFF10-\\uFF19' + '一二三四五六七八九〇零' + ']';
216
+
217
+ // Group separator regex
77
218
  let group = '';
78
219
  if (groupSeparator) {
79
- if (groupSeparator.trim() === '') {
80
- group = '[\\u00A0\\u202F\\s]'; // handle NBSP, narrow NBSP, space
220
+ if (groupSeparator?.trim() === '') {
221
+ group = '[\\u00A0\\u202F\\s]';
222
+ } else if (groupSeparator === ',' || groupSeparator === '٬') {
223
+ group = '[,٬]';
81
224
  } else {
82
225
  group = esc(groupSeparator);
83
226
  }
84
227
  }
85
- const decimal = esc(decimalSeparator);
86
228
 
87
- // Regex for:
88
- // - integers (with/without grouping)
89
- // - optional decimal with 0+ digits after separator
90
- const regex = new RegExp(`^-?\\d{1,3}(${group}\\d{3})*(${decimal}\\d*)?$|^-?\\d+(${decimal}\\d*)?$`);
91
- if (!regex.test(input)) {
92
- return false;
229
+ // Decimal separator regex
230
+ let decimal = esc(decimalSeparator);
231
+ if (decimalSeparator === '.' || decimalSeparator === '٫') {
232
+ decimal = '[.٫]';
93
233
  }
234
+ const sign = '[\\-\\u2212]?';
235
+ const scientific = `([eE][+-]?${digit}+)?`;
94
236
 
95
- // Normalize
96
- let normalized = input;
97
- if (groupSeparator) {
98
- if (groupSeparator.trim() === '') {
99
- normalized = normalized?.replace(/[\u00A0\u202F\s]/g, '');
100
- } else {
101
- normalized = normalized?.split(groupSeparator).join('');
102
- }
237
+ // Detect if grouping is used AT ALL
238
+ const usesGrouping = group && (groupSeparator?.trim() === '' ? /[\u00A0\u202F\s]/.test(input) : groupSeparator === ',' || groupSeparator === '٬' ? /[,٬]/.test(input) : groupSeparator ? input.includes(groupSeparator) : false);
239
+ const scientificMatch = input?.match(/^([^eE]+)([eE][+-]?.*)?$/);
240
+ const baseNumber = scientificMatch ? scientificMatch[1] : input;
241
+
242
+ // Split integer part from the base number - handle both decimal separator variants
243
+ let integerPart;
244
+ if (decimalSeparator === '.' || decimalSeparator === '٫') {
245
+ // Split by either . or ٫
246
+ integerPart = baseNumber?.split(/[.,]/)[0];
247
+ } else {
248
+ integerPart = baseNumber?.split(decimalSeparator)[0];
103
249
  }
104
- normalized = normalized?.replace(decimalSeparator, '.');
105
- return !isNaN(Number(normalized));
250
+
251
+ // STEP 1: strict integer validation
252
+ // When grouping is used, we need to handle two cases:
253
+ // 1. Numbers with 1-3 digits (no separator required): 1, 12, 123
254
+ // 2. Numbers with 4+ digits (separator required): 1,234 or 12,345 or 123,456
255
+ const integerRegex = usesGrouping ? new RegExp(`^${sign}(${digit}{1,3}|${digit}{1,3}(${group}${digit}{3})+)$`) : new RegExp(`^${sign}${digit}+$`);
256
+ if (!integerRegex.test(integerPart)) {
257
+ return false;
258
+ }
259
+
260
+ // STEP 2: full number validation
261
+ const fullRegex = new RegExp(`^${sign}${digit}+` + (usesGrouping ? `(${group}${digit}{3})*` : '') + `(${decimal}${digit}+)?${scientific}$`);
262
+ return fullRegex.test(input);
106
263
  };
107
264
 
108
265
  // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
@@ -294,8 +451,9 @@ const NumberInput = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
294
451
  }
295
452
  };
296
453
  const outerElementClasses = cx(`${prefix}--form-item`, {
297
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
298
- [customClassName]: !!customClassName,
454
+ ...(customClassName ? {
455
+ [customClassName]: true
456
+ } : {}),
299
457
  [`${prefix}--number-input--fluid--invalid`]: isFluid && normalizedProps.invalid,
300
458
  [`${prefix}--number-input--fluid--focus`]: isFluid && isFocused,
301
459
  [`${prefix}--number-input--fluid--disabled`]: isFluid && disabled
@@ -766,23 +924,33 @@ function getInputValidity({
766
924
  validate,
767
925
  locale
768
926
  }) {
769
- if (typeof validate === 'function') {
770
- const result = validate(value, locale);
771
- if (result === false) {
772
- return false; // immediate invalid
773
- }
774
- // If true or undefined, continue to further validations
775
- }
776
927
  if (invalid) {
777
928
  return false;
778
929
  }
779
- if (value === '') {
780
- return allowEmpty;
930
+
931
+ // Skip validation if value is empty and allowEmpty
932
+ if (value === '') return allowEmpty;
933
+
934
+ // Normalize the value
935
+ let numericValue;
936
+ if (typeof value === 'string') {
937
+ numericValue = parseNumberWithLocale(value, locale); // safe: handles Arabic, Kanji, etc.
938
+ } else {
939
+ numericValue = value;
781
940
  }
782
- if (value > max || value < min) {
783
- return false;
941
+
942
+ // Use custom validate ONLY for formatting, not numeric comparison
943
+ if (validate && typeof value === 'string') {
944
+ const isFormatValid = validate(value, locale);
945
+ if (isFormatValid === false) {
946
+ return false; // invalid format
947
+ }
784
948
  }
785
- return true;
949
+
950
+ // Check min/max bounds
951
+ if (max !== undefined && numericValue > max) return false;
952
+ if (min !== undefined && numericValue < min) return false;
953
+ return true; // valid
786
954
  }
787
955
 
788
956
  /**
@@ -804,4 +972,5 @@ function disableWheel(e) {
804
972
  }
805
973
 
806
974
  exports.NumberInput = NumberInput;
975
+ exports.parseNumberWithLocale = parseNumberWithLocale;
807
976
  exports.validateNumberSeparators = 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.
@@ -79,7 +79,6 @@ const getMenuOffset = (menuBody, direction, trigger, flip) => {
79
79
  case 'top':
80
80
  case 'bottom':
81
81
  {
82
- // TODO: Ensure `trigger` is there for `<OverflowMenu open>`
83
82
  const triggerWidth = !trigger ? 0 : trigger.offsetWidth;
84
83
  return {
85
84
  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
  */
@@ -149,7 +149,9 @@ forwardRef) {
149
149
  refs,
150
150
  floatingStyles,
151
151
  placement,
152
- middlewareData
152
+ middlewareData,
153
+ elements,
154
+ update
153
155
  } = react.useFloating(enableFloatingStyles ? {
154
156
  placement: align,
155
157
  // The floating element is positioned relative to its nearest
@@ -169,12 +171,18 @@ forwardRef) {
169
171
  }), react.arrow({
170
172
  element: caretRef,
171
173
  padding: 16
172
- }), autoAlign && react.hide()],
173
- whileElementsMounted: react.autoUpdate
174
+ }), autoAlign && react.hide()]
174
175
  } : {}
175
176
  // When autoAlign is turned off & the `enable-v12-dynamic-floating-styles` feature flag is not
176
177
  // enabled, floating-ui will not be used
177
178
  );
179
+ React.useEffect(() => {
180
+ if (!enableFloatingStyles) return;
181
+ if (open && elements.reference && elements.floating) {
182
+ const cleanup = react.autoUpdate(elements.reference, elements.floating, update);
183
+ return cleanup;
184
+ }
185
+ }, [enableFloatingStyles, open, elements, update]);
178
186
  const value = React.useMemo(() => {
179
187
  return {
180
188
  floating,
@@ -399,11 +407,13 @@ Popover.propTypes = {
399
407
  */
400
408
  open: PropTypes.bool.isRequired
401
409
  };
402
- function PopoverContentRenderFunction({
403
- className,
404
- children,
405
- ...rest
406
- }, forwardRef) {
410
+ const frFn = React.forwardRef;
411
+ const PopoverContent = frFn((props, forwardRef) => {
412
+ const {
413
+ className,
414
+ children,
415
+ ...rest
416
+ } = props;
407
417
  const prefix = usePrefix.usePrefix();
408
418
  const {
409
419
  setFloating,
@@ -429,8 +439,7 @@ function PopoverContentRenderFunction({
429
439
  }),
430
440
  ref: caretRef
431
441
  }));
432
- }
433
- const PopoverContent = /*#__PURE__*/React.forwardRef(PopoverContentRenderFunction);
442
+ });
434
443
  PopoverContent.displayName = 'PopoverContent';
435
444
  PopoverContent.propTypes = {
436
445
  /**
@@ -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.
@@ -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
  /**
@@ -156,6 +156,8 @@ const TagBase = /*#__PURE__*/React.forwardRef(({
156
156
  }, normalizedDecorator) : '');
157
157
  });
158
158
  const Tag = TagBase;
159
+
160
+ // @ts-expect-error - `propTypes` isn't typed.
159
161
  Tag.propTypes = {
160
162
  /**
161
163
  * 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.
@@ -13,7 +13,7 @@ var React = require('react');
13
13
  var TextDirectionContext = require('./TextDirectionContext.js');
14
14
 
15
15
  // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
16
- const TextBase = /*#__PURE__*/React.forwardRef(({
16
+ const Text = /*#__PURE__*/React.forwardRef(({
17
17
  as,
18
18
  children,
19
19
  dir = 'auto',
@@ -55,7 +55,8 @@ const TextBase = /*#__PURE__*/React.forwardRef(({
55
55
  ref: ref
56
56
  }, rest, textProps), children));
57
57
  });
58
- const Text = TextBase;
58
+
59
+ // @ts-expect-error - `propTypes` isn't typed.
59
60
  Text.propTypes = {
60
61
  /**
61
62
  * 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.
@@ -25,9 +25,7 @@ const TextDirection = ({
25
25
  }, [dir]);
26
26
  React.useEffect(() => {
27
27
  savedCallback.current = getTextDirection;
28
- // TODO: Is this `useEffect` supposed to have a dependency on
29
- // `getTextDirection`?
30
- });
28
+ }, [getTextDirection]);
31
29
  return /*#__PURE__*/React.createElement(TextDirectionContext.TextDirectionContext.Provider, {
32
30
  value: value
33
31
  }, 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.
@@ -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.
@@ -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,14 +1,20 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
7
+ import PropTypes from 'prop-types';
8
8
  export interface ToggleSkeletonProps {
9
9
  'aria-label'?: string;
10
10
  className?: string;
11
11
  }
12
- declare const ToggleSkeleton: React.FC<ToggleSkeletonProps>;
12
+ declare const ToggleSkeleton: {
13
+ ({ className, ...rest }: ToggleSkeletonProps): import("react/jsx-runtime").JSX.Element;
14
+ propTypes: {
15
+ 'aria-label': PropTypes.Requireable<string>;
16
+ className: PropTypes.Requireable<string>;
17
+ };
18
+ };
13
19
  export default ToggleSkeleton;
14
20
  export { ToggleSkeleton };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2025
2
+ * Copyright IBM Corp. 2016, 2026
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -188,7 +188,6 @@ Toggletip.propTypes = {
188
188
  * `ToggletipButton` controls the visibility of the Toggletip through mouse
189
189
  * clicks and keyboard interactions.
190
190
  */
191
-
192
191
  const ToggletipButton = /*#__PURE__*/React.forwardRef(function ToggletipButton({
193
192
  children,
194
193
  className: customClassName,
@@ -229,15 +228,18 @@ ToggletipButton.propTypes = {
229
228
  label: PropTypes.string
230
229
  };
231
230
  ToggletipButton.displayName = 'ToggletipButton';
231
+ const frFn = React.forwardRef;
232
+
232
233
  /**
233
234
  * `ToggletipContent` is a wrapper around `PopoverContent`. It places the
234
235
  * `children` passed in as a prop inside of `PopoverContent` so that they will
235
236
  * be rendered inside of the popover for this component.
236
237
  */
237
- const ToggletipContent = /*#__PURE__*/React.forwardRef(function ToggletipContent({
238
- children,
239
- className: customClassName
240
- }, ref) {
238
+ const ToggletipContent = frFn((props, ref) => {
239
+ const {
240
+ children,
241
+ className: customClassName
242
+ } = props;
241
243
  const toggletip = useToggletip();
242
244
  const prefix = usePrefix.usePrefix();
243
245
  return /*#__PURE__*/React.createElement(index.PopoverContent, _rollupPluginBabelHelpers.extends({