carbon-react 110.1.2 → 110.2.1

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 (67) hide show
  1. package/esm/__internal__/character-count/character-count.component.d.ts +8 -25
  2. package/esm/__internal__/character-count/character-count.component.js +12 -18
  3. package/esm/__internal__/character-count/character-count.style.d.ts +3 -1
  4. package/esm/__internal__/character-count/character-count.style.js +4 -0
  5. package/esm/__internal__/form-field/form-field.component.d.ts +5 -1
  6. package/esm/__internal__/form-field/form-field.component.js +8 -5
  7. package/esm/__internal__/input/index.d.ts +1 -1
  8. package/esm/__internal__/utils/helpers/tags/tags.d.ts +5 -2
  9. package/esm/__spec_helper__/test-utils.d.ts +3 -2
  10. package/esm/__spec_helper__/test-utils.js +17 -1
  11. package/esm/components/box/box.component.d.ts +4 -2
  12. package/esm/components/box/box.component.js +2 -1
  13. package/esm/components/dismissible-box/dismissible-box.component.js +398 -0
  14. package/esm/components/numeral-date/numeral-date-context.d.ts +6 -0
  15. package/esm/components/portal/portal.d.ts +15 -12
  16. package/esm/components/portal/portal.js +3 -13
  17. package/esm/components/select/multi-select/multi-select.component.js +1 -1
  18. package/esm/components/select/select-list/select-list.component.js +20 -11
  19. package/esm/components/textarea/textarea.component.js +6 -27
  20. package/esm/components/textarea/textarea.d.ts +2 -1
  21. package/esm/components/textbox/__internal__/prefix.style.d.ts +2 -0
  22. package/esm/components/textbox/index.d.ts +2 -1
  23. package/esm/components/textbox/index.js +1 -1
  24. package/esm/components/textbox/textbox.component.d.ts +92 -0
  25. package/esm/components/textbox/textbox.component.js +533 -197
  26. package/esm/components/textbox/textbox.style.d.ts +5 -0
  27. package/esm/components/textbox/textbox.style.js +0 -12
  28. package/esm/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +1 -1
  29. package/esm/hooks/__internal__/useCharacterCount/useCharacterCount.js +7 -6
  30. package/esm/hooks/__internal__/useInputAccessibility/useInputAccessibility.d.ts +6 -5
  31. package/esm/style/utils/filter-out-position-props.d.ts +3 -0
  32. package/esm/style/utils/filter-out-position-props.js +5 -0
  33. package/lib/__internal__/character-count/character-count.component.d.ts +8 -25
  34. package/lib/__internal__/character-count/character-count.component.js +13 -23
  35. package/lib/__internal__/character-count/character-count.style.d.ts +3 -1
  36. package/lib/__internal__/character-count/character-count.style.js +7 -0
  37. package/lib/__internal__/form-field/form-field.component.d.ts +5 -1
  38. package/lib/__internal__/form-field/form-field.component.js +8 -5
  39. package/lib/__internal__/input/index.d.ts +1 -1
  40. package/lib/__internal__/utils/helpers/tags/tags.d.ts +5 -2
  41. package/lib/__spec_helper__/test-utils.d.ts +3 -2
  42. package/lib/__spec_helper__/test-utils.js +20 -2
  43. package/lib/components/box/box.component.d.ts +4 -2
  44. package/lib/components/box/box.component.js +1 -0
  45. package/lib/components/dismissible-box/dismissible-box.component.js +398 -0
  46. package/lib/components/numeral-date/numeral-date-context.d.ts +6 -0
  47. package/lib/components/portal/portal.d.ts +15 -12
  48. package/lib/components/portal/portal.js +3 -14
  49. package/lib/components/select/multi-select/multi-select.component.js +1 -1
  50. package/lib/components/select/select-list/select-list.component.js +20 -11
  51. package/lib/components/textarea/textarea.component.js +6 -27
  52. package/lib/components/textarea/textarea.d.ts +2 -1
  53. package/lib/components/textbox/__internal__/prefix.style.d.ts +2 -0
  54. package/lib/components/textbox/index.d.ts +2 -1
  55. package/lib/components/textbox/index.js +2 -10
  56. package/lib/components/textbox/textbox.component.d.ts +92 -0
  57. package/lib/components/textbox/textbox.component.js +534 -201
  58. package/lib/components/textbox/textbox.style.d.ts +5 -0
  59. package/lib/components/textbox/textbox.style.js +1 -16
  60. package/lib/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +1 -1
  61. package/lib/hooks/__internal__/useCharacterCount/useCharacterCount.js +7 -6
  62. package/lib/hooks/__internal__/useInputAccessibility/useInputAccessibility.d.ts +6 -5
  63. package/lib/style/utils/filter-out-position-props.d.ts +3 -0
  64. package/lib/style/utils/filter-out-position-props.js +18 -0
  65. package/package.json +1 -1
  66. package/esm/components/textbox/textbox.d.ts +0 -125
  67. package/lib/components/textbox/textbox.d.ts +0 -125
@@ -358,6 +358,105 @@ DismissibleBox.propTypes = {
358
358
  "toString": PropTypes.func.isRequired,
359
359
  "valueOf": PropTypes.func.isRequired
360
360
  }), PropTypes.string]),
361
+ "bottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
362
+ "__@iterator": PropTypes.func.isRequired,
363
+ "anchor": PropTypes.func.isRequired,
364
+ "big": PropTypes.func.isRequired,
365
+ "blink": PropTypes.func.isRequired,
366
+ "bold": PropTypes.func.isRequired,
367
+ "charAt": PropTypes.func.isRequired,
368
+ "charCodeAt": PropTypes.func.isRequired,
369
+ "codePointAt": PropTypes.func.isRequired,
370
+ "concat": PropTypes.func.isRequired,
371
+ "endsWith": PropTypes.func.isRequired,
372
+ "fixed": PropTypes.func.isRequired,
373
+ "fontcolor": PropTypes.func.isRequired,
374
+ "fontsize": PropTypes.func.isRequired,
375
+ "includes": PropTypes.func.isRequired,
376
+ "indexOf": PropTypes.func.isRequired,
377
+ "italics": PropTypes.func.isRequired,
378
+ "lastIndexOf": PropTypes.func.isRequired,
379
+ "length": PropTypes.number.isRequired,
380
+ "link": PropTypes.func.isRequired,
381
+ "localeCompare": PropTypes.func.isRequired,
382
+ "match": PropTypes.func.isRequired,
383
+ "matchAll": PropTypes.func.isRequired,
384
+ "normalize": PropTypes.func.isRequired,
385
+ "padEnd": PropTypes.func.isRequired,
386
+ "padStart": PropTypes.func.isRequired,
387
+ "repeat": PropTypes.func.isRequired,
388
+ "replace": PropTypes.func.isRequired,
389
+ "search": PropTypes.func.isRequired,
390
+ "slice": PropTypes.func.isRequired,
391
+ "small": PropTypes.func.isRequired,
392
+ "split": PropTypes.func.isRequired,
393
+ "startsWith": PropTypes.func.isRequired,
394
+ "strike": PropTypes.func.isRequired,
395
+ "sub": PropTypes.func.isRequired,
396
+ "substr": PropTypes.func.isRequired,
397
+ "substring": PropTypes.func.isRequired,
398
+ "sup": PropTypes.func.isRequired,
399
+ "toLocaleLowerCase": PropTypes.func.isRequired,
400
+ "toLocaleUpperCase": PropTypes.func.isRequired,
401
+ "toLowerCase": PropTypes.func.isRequired,
402
+ "toString": PropTypes.func.isRequired,
403
+ "toUpperCase": PropTypes.func.isRequired,
404
+ "trim": PropTypes.func.isRequired,
405
+ "trimEnd": PropTypes.func.isRequired,
406
+ "trimLeft": PropTypes.func.isRequired,
407
+ "trimRight": PropTypes.func.isRequired,
408
+ "trimStart": PropTypes.func.isRequired,
409
+ "valueOf": PropTypes.func.isRequired
410
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
411
+ "__@iterator": PropTypes.func.isRequired,
412
+ "anchor": PropTypes.func.isRequired,
413
+ "big": PropTypes.func.isRequired,
414
+ "blink": PropTypes.func.isRequired,
415
+ "bold": PropTypes.func.isRequired,
416
+ "charAt": PropTypes.func.isRequired,
417
+ "charCodeAt": PropTypes.func.isRequired,
418
+ "codePointAt": PropTypes.func.isRequired,
419
+ "concat": PropTypes.func.isRequired,
420
+ "endsWith": PropTypes.func.isRequired,
421
+ "fixed": PropTypes.func.isRequired,
422
+ "fontcolor": PropTypes.func.isRequired,
423
+ "fontsize": PropTypes.func.isRequired,
424
+ "includes": PropTypes.func.isRequired,
425
+ "indexOf": PropTypes.func.isRequired,
426
+ "italics": PropTypes.func.isRequired,
427
+ "lastIndexOf": PropTypes.func.isRequired,
428
+ "length": PropTypes.number.isRequired,
429
+ "link": PropTypes.func.isRequired,
430
+ "localeCompare": PropTypes.func.isRequired,
431
+ "match": PropTypes.func.isRequired,
432
+ "matchAll": PropTypes.func.isRequired,
433
+ "normalize": PropTypes.func.isRequired,
434
+ "padEnd": PropTypes.func.isRequired,
435
+ "padStart": PropTypes.func.isRequired,
436
+ "repeat": PropTypes.func.isRequired,
437
+ "replace": PropTypes.func.isRequired,
438
+ "search": PropTypes.func.isRequired,
439
+ "slice": PropTypes.func.isRequired,
440
+ "small": PropTypes.func.isRequired,
441
+ "split": PropTypes.func.isRequired,
442
+ "startsWith": PropTypes.func.isRequired,
443
+ "strike": PropTypes.func.isRequired,
444
+ "sub": PropTypes.func.isRequired,
445
+ "substr": PropTypes.func.isRequired,
446
+ "substring": PropTypes.func.isRequired,
447
+ "sup": PropTypes.func.isRequired,
448
+ "toLocaleLowerCase": PropTypes.func.isRequired,
449
+ "toLocaleUpperCase": PropTypes.func.isRequired,
450
+ "toLowerCase": PropTypes.func.isRequired,
451
+ "toString": PropTypes.func.isRequired,
452
+ "toUpperCase": PropTypes.func.isRequired,
453
+ "trim": PropTypes.func.isRequired,
454
+ "trimEnd": PropTypes.func.isRequired,
455
+ "trimLeft": PropTypes.func.isRequired,
456
+ "trimRight": PropTypes.func.isRequired,
457
+ "trimStart": PropTypes.func.isRequired,
458
+ "valueOf": PropTypes.func.isRequired
459
+ }), PropTypes.string]),
361
460
  "boxSizing": PropTypes.oneOf(["border-box", "content-box"]),
362
461
  "children": PropTypes.node,
363
462
  "color": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
@@ -899,6 +998,105 @@ DismissibleBox.propTypes = {
899
998
  "trimStart": PropTypes.func.isRequired,
900
999
  "valueOf": PropTypes.func.isRequired
901
1000
  })]),
1001
+ "left": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
1002
+ "__@iterator": PropTypes.func.isRequired,
1003
+ "anchor": PropTypes.func.isRequired,
1004
+ "big": PropTypes.func.isRequired,
1005
+ "blink": PropTypes.func.isRequired,
1006
+ "bold": PropTypes.func.isRequired,
1007
+ "charAt": PropTypes.func.isRequired,
1008
+ "charCodeAt": PropTypes.func.isRequired,
1009
+ "codePointAt": PropTypes.func.isRequired,
1010
+ "concat": PropTypes.func.isRequired,
1011
+ "endsWith": PropTypes.func.isRequired,
1012
+ "fixed": PropTypes.func.isRequired,
1013
+ "fontcolor": PropTypes.func.isRequired,
1014
+ "fontsize": PropTypes.func.isRequired,
1015
+ "includes": PropTypes.func.isRequired,
1016
+ "indexOf": PropTypes.func.isRequired,
1017
+ "italics": PropTypes.func.isRequired,
1018
+ "lastIndexOf": PropTypes.func.isRequired,
1019
+ "length": PropTypes.number.isRequired,
1020
+ "link": PropTypes.func.isRequired,
1021
+ "localeCompare": PropTypes.func.isRequired,
1022
+ "match": PropTypes.func.isRequired,
1023
+ "matchAll": PropTypes.func.isRequired,
1024
+ "normalize": PropTypes.func.isRequired,
1025
+ "padEnd": PropTypes.func.isRequired,
1026
+ "padStart": PropTypes.func.isRequired,
1027
+ "repeat": PropTypes.func.isRequired,
1028
+ "replace": PropTypes.func.isRequired,
1029
+ "search": PropTypes.func.isRequired,
1030
+ "slice": PropTypes.func.isRequired,
1031
+ "small": PropTypes.func.isRequired,
1032
+ "split": PropTypes.func.isRequired,
1033
+ "startsWith": PropTypes.func.isRequired,
1034
+ "strike": PropTypes.func.isRequired,
1035
+ "sub": PropTypes.func.isRequired,
1036
+ "substr": PropTypes.func.isRequired,
1037
+ "substring": PropTypes.func.isRequired,
1038
+ "sup": PropTypes.func.isRequired,
1039
+ "toLocaleLowerCase": PropTypes.func.isRequired,
1040
+ "toLocaleUpperCase": PropTypes.func.isRequired,
1041
+ "toLowerCase": PropTypes.func.isRequired,
1042
+ "toString": PropTypes.func.isRequired,
1043
+ "toUpperCase": PropTypes.func.isRequired,
1044
+ "trim": PropTypes.func.isRequired,
1045
+ "trimEnd": PropTypes.func.isRequired,
1046
+ "trimLeft": PropTypes.func.isRequired,
1047
+ "trimRight": PropTypes.func.isRequired,
1048
+ "trimStart": PropTypes.func.isRequired,
1049
+ "valueOf": PropTypes.func.isRequired
1050
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
1051
+ "__@iterator": PropTypes.func.isRequired,
1052
+ "anchor": PropTypes.func.isRequired,
1053
+ "big": PropTypes.func.isRequired,
1054
+ "blink": PropTypes.func.isRequired,
1055
+ "bold": PropTypes.func.isRequired,
1056
+ "charAt": PropTypes.func.isRequired,
1057
+ "charCodeAt": PropTypes.func.isRequired,
1058
+ "codePointAt": PropTypes.func.isRequired,
1059
+ "concat": PropTypes.func.isRequired,
1060
+ "endsWith": PropTypes.func.isRequired,
1061
+ "fixed": PropTypes.func.isRequired,
1062
+ "fontcolor": PropTypes.func.isRequired,
1063
+ "fontsize": PropTypes.func.isRequired,
1064
+ "includes": PropTypes.func.isRequired,
1065
+ "indexOf": PropTypes.func.isRequired,
1066
+ "italics": PropTypes.func.isRequired,
1067
+ "lastIndexOf": PropTypes.func.isRequired,
1068
+ "length": PropTypes.number.isRequired,
1069
+ "link": PropTypes.func.isRequired,
1070
+ "localeCompare": PropTypes.func.isRequired,
1071
+ "match": PropTypes.func.isRequired,
1072
+ "matchAll": PropTypes.func.isRequired,
1073
+ "normalize": PropTypes.func.isRequired,
1074
+ "padEnd": PropTypes.func.isRequired,
1075
+ "padStart": PropTypes.func.isRequired,
1076
+ "repeat": PropTypes.func.isRequired,
1077
+ "replace": PropTypes.func.isRequired,
1078
+ "search": PropTypes.func.isRequired,
1079
+ "slice": PropTypes.func.isRequired,
1080
+ "small": PropTypes.func.isRequired,
1081
+ "split": PropTypes.func.isRequired,
1082
+ "startsWith": PropTypes.func.isRequired,
1083
+ "strike": PropTypes.func.isRequired,
1084
+ "sub": PropTypes.func.isRequired,
1085
+ "substr": PropTypes.func.isRequired,
1086
+ "substring": PropTypes.func.isRequired,
1087
+ "sup": PropTypes.func.isRequired,
1088
+ "toLocaleLowerCase": PropTypes.func.isRequired,
1089
+ "toLocaleUpperCase": PropTypes.func.isRequired,
1090
+ "toLowerCase": PropTypes.func.isRequired,
1091
+ "toString": PropTypes.func.isRequired,
1092
+ "toUpperCase": PropTypes.func.isRequired,
1093
+ "trim": PropTypes.func.isRequired,
1094
+ "trimEnd": PropTypes.func.isRequired,
1095
+ "trimLeft": PropTypes.func.isRequired,
1096
+ "trimRight": PropTypes.func.isRequired,
1097
+ "trimStart": PropTypes.func.isRequired,
1098
+ "valueOf": PropTypes.func.isRequired
1099
+ }), PropTypes.string]),
902
1100
  "m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
903
1101
  "__@toStringTag": PropTypes.string.isRequired,
904
1102
  "description": PropTypes.string,
@@ -1776,6 +1974,7 @@ DismissibleBox.propTypes = {
1776
1974
  "toString": PropTypes.func.isRequired,
1777
1975
  "valueOf": PropTypes.func.isRequired
1778
1976
  }), PropTypes.string]),
1977
+ "position": PropTypes.oneOfType([PropTypes.oneOf(["-moz-initial", "-webkit-sticky", "absolute", "fixed", "inherit", "initial", "relative", "revert", "static", "sticky", "unset"]), PropTypes.arrayOf(PropTypes.oneOf(["-moz-initial", "-webkit-sticky", "absolute", "fixed", "inherit", "initial", "relative", "revert", "static", "sticky", "unset", null])), PropTypes.object]),
1779
1978
  "pr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
1780
1979
  "__@toStringTag": PropTypes.string.isRequired,
1781
1980
  "description": PropTypes.string,
@@ -1820,6 +2019,105 @@ DismissibleBox.propTypes = {
1820
2019
  "toString": PropTypes.func.isRequired,
1821
2020
  "valueOf": PropTypes.func.isRequired
1822
2021
  }), PropTypes.string]),
2022
+ "right": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
2023
+ "__@iterator": PropTypes.func.isRequired,
2024
+ "anchor": PropTypes.func.isRequired,
2025
+ "big": PropTypes.func.isRequired,
2026
+ "blink": PropTypes.func.isRequired,
2027
+ "bold": PropTypes.func.isRequired,
2028
+ "charAt": PropTypes.func.isRequired,
2029
+ "charCodeAt": PropTypes.func.isRequired,
2030
+ "codePointAt": PropTypes.func.isRequired,
2031
+ "concat": PropTypes.func.isRequired,
2032
+ "endsWith": PropTypes.func.isRequired,
2033
+ "fixed": PropTypes.func.isRequired,
2034
+ "fontcolor": PropTypes.func.isRequired,
2035
+ "fontsize": PropTypes.func.isRequired,
2036
+ "includes": PropTypes.func.isRequired,
2037
+ "indexOf": PropTypes.func.isRequired,
2038
+ "italics": PropTypes.func.isRequired,
2039
+ "lastIndexOf": PropTypes.func.isRequired,
2040
+ "length": PropTypes.number.isRequired,
2041
+ "link": PropTypes.func.isRequired,
2042
+ "localeCompare": PropTypes.func.isRequired,
2043
+ "match": PropTypes.func.isRequired,
2044
+ "matchAll": PropTypes.func.isRequired,
2045
+ "normalize": PropTypes.func.isRequired,
2046
+ "padEnd": PropTypes.func.isRequired,
2047
+ "padStart": PropTypes.func.isRequired,
2048
+ "repeat": PropTypes.func.isRequired,
2049
+ "replace": PropTypes.func.isRequired,
2050
+ "search": PropTypes.func.isRequired,
2051
+ "slice": PropTypes.func.isRequired,
2052
+ "small": PropTypes.func.isRequired,
2053
+ "split": PropTypes.func.isRequired,
2054
+ "startsWith": PropTypes.func.isRequired,
2055
+ "strike": PropTypes.func.isRequired,
2056
+ "sub": PropTypes.func.isRequired,
2057
+ "substr": PropTypes.func.isRequired,
2058
+ "substring": PropTypes.func.isRequired,
2059
+ "sup": PropTypes.func.isRequired,
2060
+ "toLocaleLowerCase": PropTypes.func.isRequired,
2061
+ "toLocaleUpperCase": PropTypes.func.isRequired,
2062
+ "toLowerCase": PropTypes.func.isRequired,
2063
+ "toString": PropTypes.func.isRequired,
2064
+ "toUpperCase": PropTypes.func.isRequired,
2065
+ "trim": PropTypes.func.isRequired,
2066
+ "trimEnd": PropTypes.func.isRequired,
2067
+ "trimLeft": PropTypes.func.isRequired,
2068
+ "trimRight": PropTypes.func.isRequired,
2069
+ "trimStart": PropTypes.func.isRequired,
2070
+ "valueOf": PropTypes.func.isRequired
2071
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
2072
+ "__@iterator": PropTypes.func.isRequired,
2073
+ "anchor": PropTypes.func.isRequired,
2074
+ "big": PropTypes.func.isRequired,
2075
+ "blink": PropTypes.func.isRequired,
2076
+ "bold": PropTypes.func.isRequired,
2077
+ "charAt": PropTypes.func.isRequired,
2078
+ "charCodeAt": PropTypes.func.isRequired,
2079
+ "codePointAt": PropTypes.func.isRequired,
2080
+ "concat": PropTypes.func.isRequired,
2081
+ "endsWith": PropTypes.func.isRequired,
2082
+ "fixed": PropTypes.func.isRequired,
2083
+ "fontcolor": PropTypes.func.isRequired,
2084
+ "fontsize": PropTypes.func.isRequired,
2085
+ "includes": PropTypes.func.isRequired,
2086
+ "indexOf": PropTypes.func.isRequired,
2087
+ "italics": PropTypes.func.isRequired,
2088
+ "lastIndexOf": PropTypes.func.isRequired,
2089
+ "length": PropTypes.number.isRequired,
2090
+ "link": PropTypes.func.isRequired,
2091
+ "localeCompare": PropTypes.func.isRequired,
2092
+ "match": PropTypes.func.isRequired,
2093
+ "matchAll": PropTypes.func.isRequired,
2094
+ "normalize": PropTypes.func.isRequired,
2095
+ "padEnd": PropTypes.func.isRequired,
2096
+ "padStart": PropTypes.func.isRequired,
2097
+ "repeat": PropTypes.func.isRequired,
2098
+ "replace": PropTypes.func.isRequired,
2099
+ "search": PropTypes.func.isRequired,
2100
+ "slice": PropTypes.func.isRequired,
2101
+ "small": PropTypes.func.isRequired,
2102
+ "split": PropTypes.func.isRequired,
2103
+ "startsWith": PropTypes.func.isRequired,
2104
+ "strike": PropTypes.func.isRequired,
2105
+ "sub": PropTypes.func.isRequired,
2106
+ "substr": PropTypes.func.isRequired,
2107
+ "substring": PropTypes.func.isRequired,
2108
+ "sup": PropTypes.func.isRequired,
2109
+ "toLocaleLowerCase": PropTypes.func.isRequired,
2110
+ "toLocaleUpperCase": PropTypes.func.isRequired,
2111
+ "toLowerCase": PropTypes.func.isRequired,
2112
+ "toString": PropTypes.func.isRequired,
2113
+ "toUpperCase": PropTypes.func.isRequired,
2114
+ "trim": PropTypes.func.isRequired,
2115
+ "trimEnd": PropTypes.func.isRequired,
2116
+ "trimLeft": PropTypes.func.isRequired,
2117
+ "trimRight": PropTypes.func.isRequired,
2118
+ "trimStart": PropTypes.func.isRequired,
2119
+ "valueOf": PropTypes.func.isRequired
2120
+ }), PropTypes.string]),
1823
2121
  "scrollVariant": PropTypes.oneOf(["dark", "light"]),
1824
2122
  "size": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
1825
2123
  "__@iterator": PropTypes.func.isRequired,
@@ -1920,6 +2218,106 @@ DismissibleBox.propTypes = {
1920
2218
  "trimStart": PropTypes.func.isRequired,
1921
2219
  "valueOf": PropTypes.func.isRequired
1922
2220
  }), PropTypes.string]),
2221
+ "tabIndex": PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
2222
+ "top": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
2223
+ "__@iterator": PropTypes.func.isRequired,
2224
+ "anchor": PropTypes.func.isRequired,
2225
+ "big": PropTypes.func.isRequired,
2226
+ "blink": PropTypes.func.isRequired,
2227
+ "bold": PropTypes.func.isRequired,
2228
+ "charAt": PropTypes.func.isRequired,
2229
+ "charCodeAt": PropTypes.func.isRequired,
2230
+ "codePointAt": PropTypes.func.isRequired,
2231
+ "concat": PropTypes.func.isRequired,
2232
+ "endsWith": PropTypes.func.isRequired,
2233
+ "fixed": PropTypes.func.isRequired,
2234
+ "fontcolor": PropTypes.func.isRequired,
2235
+ "fontsize": PropTypes.func.isRequired,
2236
+ "includes": PropTypes.func.isRequired,
2237
+ "indexOf": PropTypes.func.isRequired,
2238
+ "italics": PropTypes.func.isRequired,
2239
+ "lastIndexOf": PropTypes.func.isRequired,
2240
+ "length": PropTypes.number.isRequired,
2241
+ "link": PropTypes.func.isRequired,
2242
+ "localeCompare": PropTypes.func.isRequired,
2243
+ "match": PropTypes.func.isRequired,
2244
+ "matchAll": PropTypes.func.isRequired,
2245
+ "normalize": PropTypes.func.isRequired,
2246
+ "padEnd": PropTypes.func.isRequired,
2247
+ "padStart": PropTypes.func.isRequired,
2248
+ "repeat": PropTypes.func.isRequired,
2249
+ "replace": PropTypes.func.isRequired,
2250
+ "search": PropTypes.func.isRequired,
2251
+ "slice": PropTypes.func.isRequired,
2252
+ "small": PropTypes.func.isRequired,
2253
+ "split": PropTypes.func.isRequired,
2254
+ "startsWith": PropTypes.func.isRequired,
2255
+ "strike": PropTypes.func.isRequired,
2256
+ "sub": PropTypes.func.isRequired,
2257
+ "substr": PropTypes.func.isRequired,
2258
+ "substring": PropTypes.func.isRequired,
2259
+ "sup": PropTypes.func.isRequired,
2260
+ "toLocaleLowerCase": PropTypes.func.isRequired,
2261
+ "toLocaleUpperCase": PropTypes.func.isRequired,
2262
+ "toLowerCase": PropTypes.func.isRequired,
2263
+ "toString": PropTypes.func.isRequired,
2264
+ "toUpperCase": PropTypes.func.isRequired,
2265
+ "trim": PropTypes.func.isRequired,
2266
+ "trimEnd": PropTypes.func.isRequired,
2267
+ "trimLeft": PropTypes.func.isRequired,
2268
+ "trimRight": PropTypes.func.isRequired,
2269
+ "trimStart": PropTypes.func.isRequired,
2270
+ "valueOf": PropTypes.func.isRequired
2271
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
2272
+ "__@iterator": PropTypes.func.isRequired,
2273
+ "anchor": PropTypes.func.isRequired,
2274
+ "big": PropTypes.func.isRequired,
2275
+ "blink": PropTypes.func.isRequired,
2276
+ "bold": PropTypes.func.isRequired,
2277
+ "charAt": PropTypes.func.isRequired,
2278
+ "charCodeAt": PropTypes.func.isRequired,
2279
+ "codePointAt": PropTypes.func.isRequired,
2280
+ "concat": PropTypes.func.isRequired,
2281
+ "endsWith": PropTypes.func.isRequired,
2282
+ "fixed": PropTypes.func.isRequired,
2283
+ "fontcolor": PropTypes.func.isRequired,
2284
+ "fontsize": PropTypes.func.isRequired,
2285
+ "includes": PropTypes.func.isRequired,
2286
+ "indexOf": PropTypes.func.isRequired,
2287
+ "italics": PropTypes.func.isRequired,
2288
+ "lastIndexOf": PropTypes.func.isRequired,
2289
+ "length": PropTypes.number.isRequired,
2290
+ "link": PropTypes.func.isRequired,
2291
+ "localeCompare": PropTypes.func.isRequired,
2292
+ "match": PropTypes.func.isRequired,
2293
+ "matchAll": PropTypes.func.isRequired,
2294
+ "normalize": PropTypes.func.isRequired,
2295
+ "padEnd": PropTypes.func.isRequired,
2296
+ "padStart": PropTypes.func.isRequired,
2297
+ "repeat": PropTypes.func.isRequired,
2298
+ "replace": PropTypes.func.isRequired,
2299
+ "search": PropTypes.func.isRequired,
2300
+ "slice": PropTypes.func.isRequired,
2301
+ "small": PropTypes.func.isRequired,
2302
+ "split": PropTypes.func.isRequired,
2303
+ "startsWith": PropTypes.func.isRequired,
2304
+ "strike": PropTypes.func.isRequired,
2305
+ "sub": PropTypes.func.isRequired,
2306
+ "substr": PropTypes.func.isRequired,
2307
+ "substring": PropTypes.func.isRequired,
2308
+ "sup": PropTypes.func.isRequired,
2309
+ "toLocaleLowerCase": PropTypes.func.isRequired,
2310
+ "toLocaleUpperCase": PropTypes.func.isRequired,
2311
+ "toLowerCase": PropTypes.func.isRequired,
2312
+ "toString": PropTypes.func.isRequired,
2313
+ "toUpperCase": PropTypes.func.isRequired,
2314
+ "trim": PropTypes.func.isRequired,
2315
+ "trimEnd": PropTypes.func.isRequired,
2316
+ "trimLeft": PropTypes.func.isRequired,
2317
+ "trimRight": PropTypes.func.isRequired,
2318
+ "trimStart": PropTypes.func.isRequired,
2319
+ "valueOf": PropTypes.func.isRequired
2320
+ }), PropTypes.string]),
1923
2321
  "variant": PropTypes.oneOf(["dark", "light"]),
1924
2322
  "verticalAlign": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
1925
2323
  "__@iterator": PropTypes.func.isRequired,
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ declare type NumeralContextType = {
3
+ disableErrorBorder?: boolean;
4
+ };
5
+ declare const _default: React.Context<NumeralContextType>;
6
+ export default _default;
@@ -1,14 +1,17 @@
1
- import * as React from "react";
2
-
3
- export interface PortalProps {
4
- /** The content of the portal. */
5
- children?: React.ReactNode;
6
- className?: string;
7
- id?: string;
8
- /** Callback function triggered when parent element is scrolled or window resized. */
9
- onReposition?: () => void;
1
+ import React from "react";
2
+ interface PortalContextProps {
3
+ renderInRoot?: boolean;
10
4
  }
11
-
12
- declare function Portal(props: PortalProps): JSX.Element;
13
-
5
+ export declare const PortalContext: React.Context<PortalContextProps>;
6
+ interface PortalProps {
7
+ /** The content of the portal. */
8
+ children?: React.ReactNode;
9
+ /** Classname attached to portal container. */
10
+ className?: string;
11
+ /** Id attribute attached to portal container. */
12
+ id?: string;
13
+ /** Callback function triggered when parent element is scrolled or window resized. */
14
+ onReposition?: () => void;
15
+ }
16
+ declare const Portal: ({ children, className, id, onReposition }: PortalProps) => JSX.Element;
14
17
  export default Portal;
@@ -1,5 +1,4 @@
1
1
  import React, { useContext, useEffect, useMemo, useState } from "react";
2
- import PropTypes from "prop-types";
3
2
  import ReactDOM from "react-dom";
4
3
  import guid from "../../__internal__/utils/helpers/guid";
5
4
  import CarbonScopedTokensProvider from "../../style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component";
@@ -30,13 +29,13 @@ const Portal = ({
30
29
  }, [onReposition]);
31
30
  useEffect(() => {
32
31
  return () => {
33
- portalNode.remove();
32
+ portalNode === null || portalNode === void 0 ? void 0 : portalNode.remove();
34
33
  }; // eslint-disable-next-line react-hooks/exhaustive-deps
35
34
  }, []);
36
35
 
37
36
  const addClassNames = node => {
38
- className.split(" ").forEach(el => {
39
- node.classList.add(el);
37
+ className === null || className === void 0 ? void 0 : className.split(" ").forEach(el => {
38
+ node === null || node === void 0 ? void 0 : node.classList.add(el);
40
39
  });
41
40
  return node;
42
41
  };
@@ -80,13 +79,4 @@ const Portal = ({
80
79
  }, /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(CarbonScopedTokensProvider, null, children), getPortalContainer()));
81
80
  };
82
81
 
83
- Portal.propTypes = {
84
- /** The content of the portal. */
85
- children: PropTypes.node,
86
- className: PropTypes.string,
87
- id: PropTypes.string,
88
-
89
- /** Callback function triggered when parent element is scrolled or window resized. */
90
- onReposition: PropTypes.func
91
- };
92
82
  export default Portal;
@@ -208,7 +208,7 @@ const MultiSelect = /*#__PURE__*/React.forwardRef(({
208
208
  wrapText: wrapPillText
209
209
  }, pillProps), title));
210
210
  }); // eslint-disable-next-line react-hooks/exhaustive-deps
211
- }, [children, disabled, readOnly, selectedValue]);
211
+ }, [children, disabled, readOnly, actualValue]);
212
212
  useEffect(() => {
213
213
  const modeSwitchedMessage = "Input elements should not switch from uncontrolled to controlled (or vice versa). " + "Decide between using a controlled or uncontrolled input element for the lifetime of the component";
214
214
  const onChangeMissingMessage = "onChange prop required when using a controlled input element";
@@ -61,6 +61,24 @@ const SelectList = /*#__PURE__*/React.forwardRef(({
61
61
  blockScroll,
62
62
  allowScroll
63
63
  } = useScrollBlock();
64
+
65
+ const updateListHeight = () => {
66
+ let newHeight = listRef.current.clientHeight;
67
+
68
+ if (listActionButtonRef.current) {
69
+ newHeight += listActionButtonRef.current.parentElement.clientHeight;
70
+ }
71
+
72
+ setListHeight(`${newHeight}px`);
73
+ };
74
+
75
+ const listCallbackRef = useCallback(element => {
76
+ listRef.current = element;
77
+
78
+ if (element) {
79
+ setTimeout(updateListHeight, 0);
80
+ }
81
+ }, []);
64
82
  useEffect(() => {
65
83
  blockScroll();
66
84
  return () => {
@@ -225,16 +243,7 @@ const SelectList = /*#__PURE__*/React.forwardRef(({
225
243
  window.removeEventListener("resize", assignListWidth);
226
244
  };
227
245
  }, [assignListWidth]);
228
- useLayoutEffect(() => {
229
- let newHeight;
230
- newHeight = listRef.current.clientHeight;
231
-
232
- if (listActionButtonRef.current) {
233
- newHeight += listActionButtonRef.current.parentElement.clientHeight;
234
- }
235
-
236
- setListHeight(`${newHeight}px`);
237
- }, [children]);
246
+ useLayoutEffect(updateListHeight, [children]);
238
247
  useEffect(() => {
239
248
  const keyboardEvent = "keydown";
240
249
  const listElement = listRef.current;
@@ -325,7 +334,7 @@ const SelectList = /*#__PURE__*/React.forwardRef(({
325
334
  "aria-labelledby": labelId,
326
335
  "data-element": "select-list",
327
336
  role: "listbox",
328
- ref: listRef,
337
+ ref: listCallbackRef,
329
338
  tabIndex: "-1",
330
339
  isLoading: isLoading,
331
340
  multiColumn: multiColumn
@@ -5,22 +5,18 @@ import PropTypes from "prop-types";
5
5
  import styledSystemPropTypes from "@styled-system/prop-types";
6
6
  import { InputPresentation } from "../../__internal__/input";
7
7
  import FormField from "../../__internal__/form-field";
8
- import CharacterCount from "../../__internal__/character-count";
8
+ import useCharacterCount from "../../hooks/__internal__/useCharacterCount";
9
9
  import Input from "../../__internal__/input/input.component";
10
10
  import { InputBehaviour } from "../../__internal__/input-behaviour";
11
11
  import { filterStyledSystemMarginProps } from "../../style/utils";
12
12
  import InputIconToggle from "../../__internal__/input-icon-toggle";
13
13
  import guid from "../../__internal__/utils/helpers/guid";
14
14
  import StyledTextarea, { MIN_HEIGHT } from "./textarea.style";
15
- import LocaleContext from "../../__internal__/i18n-context";
16
15
  import { TooltipProvider } from "../../__internal__/tooltip-provider";
17
16
  import useInputAccessibility from "../../hooks/__internal__/useInputAccessibility";
18
17
  import { NewValidationContext } from "../carbon-provider/carbon-provider.component";
19
18
  import { ErrorBorder, StyledHintText } from "../textbox/textbox.style";
20
19
  import ValidationMessage from "../../__internal__/validation-message";
21
-
22
- const getFormatNumber = (value, locale) => new Intl.NumberFormat(locale).format(value);
23
-
24
20
  const marginPropTypes = filterStyledSystemMarginProps(styledSystemPropTypes.space);
25
21
 
26
22
  const Textarea = ({
@@ -61,7 +57,6 @@ const Textarea = ({
61
57
  helpAriaLabel,
62
58
  ...props
63
59
  }) => {
64
- const locale = useContext(LocaleContext);
65
60
  const {
66
61
  validationRedesignOptIn
67
62
  } = useContext(NewValidationContext);
@@ -98,6 +93,8 @@ const Textarea = ({
98
93
  label,
99
94
  fieldHelp
100
95
  });
96
+ const [maxLength, characterCount] = useCharacterCount(value, // TODO: Can be removed after the characterLimit type is changed to number
97
+ typeof characterLimit === "string" ? parseInt(characterLimit, 10) : characterLimit, warnOverLimit, enforceCharacterLimit);
101
98
  useEffect(() => {
102
99
  if (rows) {
103
100
  minHeight.current = inputRef.current.scrollHeight;
@@ -120,24 +117,6 @@ const Textarea = ({
120
117
  }
121
118
  };
122
119
  }, [expandable]);
123
-
124
- const isOverLimit = () => {
125
- return (value || "").length > parseInt(characterLimit, 10);
126
- };
127
-
128
- const characterCount = () => {
129
- if (!characterLimit) {
130
- return null;
131
- }
132
-
133
- return /*#__PURE__*/React.createElement(CharacterCount, {
134
- isOverLimit: isOverLimit() && warnOverLimit,
135
- value: getFormatNumber((value || "").length, locale.locale()),
136
- limit: getFormatNumber(characterLimit, locale.locale()),
137
- "data-element": "character-limit"
138
- });
139
- };
140
-
141
120
  return /*#__PURE__*/React.createElement(TooltipProvider, {
142
121
  tooltipPosition: tooltipPosition,
143
122
  helpAriaLabel: helpAriaLabel
@@ -186,7 +165,7 @@ const Textarea = ({
186
165
  name: name,
187
166
  value: value,
188
167
  ref: inputRef,
189
- maxLength: enforceCharacterLimit && characterLimit ? characterLimit : undefined,
168
+ maxLength: maxLength,
190
169
  onChange: onChange,
191
170
  disabled: disabled,
192
171
  readOnly: readOnly,
@@ -206,7 +185,7 @@ const Textarea = ({
206
185
  info: info,
207
186
  validationIconId: validationRedesignOptIn ? undefined : validationIconId,
208
187
  useValidationIcon: !(validationRedesignOptIn || validationOnLabel)
209
- }))), characterCount())));
188
+ }))), characterCount)));
210
189
  };
211
190
 
212
191
  Textarea.propTypes = { ...marginPropTypes,
@@ -227,7 +206,7 @@ Textarea.propTypes = { ...marginPropTypes,
227
206
  id: PropTypes.string,
228
207
 
229
208
  /** Character limit of the textarea */
230
- characterLimit: PropTypes.string,
209
+ characterLimit: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
231
210
 
232
211
  /** Type of the icon that will be rendered next to the input */
233
212
  children: PropTypes.node,