@dxc-technology/halstack-react 0.0.0-13e0035 → 0.0.0-1418b62

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 (74) hide show
  1. package/dist/ThemeContext.js +130 -98
  2. package/dist/accordion/Accordion.js +44 -39
  3. package/dist/accordion-group/AccordionGroup.js +1 -3
  4. package/dist/alert/Alert.js +124 -113
  5. package/dist/alert/index.d.ts +51 -0
  6. package/dist/button/Button.js +31 -25
  7. package/dist/checkbox/Checkbox.js +19 -13
  8. package/dist/common/variables.js +507 -344
  9. package/dist/date/Date.js +5 -7
  10. package/dist/dialog/Dialog.js +8 -30
  11. package/dist/dropdown/Dropdown.js +108 -68
  12. package/dist/file-input/FileInput.js +644 -0
  13. package/dist/file-input/FileItem.js +280 -0
  14. package/dist/file-input/index.d.ts +81 -0
  15. package/dist/header/Header.js +3 -23
  16. package/dist/layout/ApplicationLayout.js +1 -1
  17. package/dist/link/Link.js +4 -8
  18. package/dist/main.d.ts +8 -0
  19. package/dist/main.js +16 -0
  20. package/dist/new-date/NewDate.js +68 -67
  21. package/dist/new-date/index.d.ts +95 -0
  22. package/dist/new-input-text/NewInputText.js +169 -159
  23. package/dist/new-input-text/index.d.ts +135 -0
  24. package/dist/new-select/NewSelect.js +836 -0
  25. package/dist/new-select/index.d.ts +53 -0
  26. package/dist/new-textarea/NewTextarea.js +60 -37
  27. package/dist/new-textarea/index.d.ts +117 -0
  28. package/dist/number/Number.js +5 -3
  29. package/dist/number/index.d.ts +113 -0
  30. package/dist/password/Password.js +7 -3
  31. package/dist/password/index.d.ts +94 -0
  32. package/dist/progress-bar/ProgressBar.js +62 -26
  33. package/dist/select/Select.js +122 -158
  34. package/dist/sidenav/Sidenav.js +6 -4
  35. package/dist/slider/Slider.js +56 -52
  36. package/dist/spinner/Spinner.js +217 -54
  37. package/dist/tag/Tag.js +26 -32
  38. package/dist/toggle-group/ToggleGroup.js +21 -39
  39. package/dist/upload/transaction/Transaction.js +2 -2
  40. package/package.json +2 -1
  41. package/test/FileInput.test.js +201 -0
  42. package/test/NewDate.test.js +41 -12
  43. package/test/NewInputText.test.js +106 -189
  44. package/test/NewTextarea.test.js +96 -102
  45. package/test/Number.test.js +46 -30
  46. package/test/Paginator.test.js +1 -1
  47. package/test/Password.test.js +17 -10
  48. package/test/ResultsetTable.test.js +1 -2
  49. package/test/Select.test.js +40 -17
  50. package/test/Spinner.test.js +5 -0
  51. package/dist/accordion/Accordion.stories.js +0 -207
  52. package/dist/accordion/readme.md +0 -96
  53. package/dist/accordion-group/AccordionGroup.stories.js +0 -207
  54. package/dist/accordion-group/readme.md +0 -70
  55. package/dist/alert/Alert.stories.js +0 -158
  56. package/dist/alert/close.svg +0 -4
  57. package/dist/alert/error.svg +0 -4
  58. package/dist/alert/info.svg +0 -4
  59. package/dist/alert/readme.md +0 -43
  60. package/dist/alert/success.svg +0 -4
  61. package/dist/alert/warning.svg +0 -4
  62. package/dist/button/Button.stories.js +0 -224
  63. package/dist/button/readme.md +0 -93
  64. package/dist/dialog/Dialog.stories.js +0 -217
  65. package/dist/dialog/readme.md +0 -32
  66. package/dist/dropdown/Dropdown.stories.js +0 -249
  67. package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
  68. package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
  69. package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
  70. package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
  71. package/dist/dropdown/readme.md +0 -69
  72. package/dist/select/Select.stories.js +0 -235
  73. package/dist/select/readme.md +0 -72
  74. package/dist/toggle-group/readme.md +0 -82
@@ -35,9 +35,29 @@ var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColor
35
35
 
36
36
  var _NumberContext = _interopRequireDefault(require("../number/NumberContext.js"));
37
37
 
38
- function _templateObject15() {
38
+ function _templateObject17() {
39
39
  var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: calc((39px - 1.75em) / 2) 0 calc((39px - 1.75em) / 2) 1em;\n align-items: center;\n font-size: 0.875rem;\n line-height: 1.75em;\n"]);
40
40
 
41
+ _templateObject17 = function _templateObject17() {
42
+ return data;
43
+ };
44
+
45
+ return data;
46
+ }
47
+
48
+ function _templateObject16() {
49
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n margin-right: 0.5rem;\n height: 18px;\n width: 18px;\n color: ", ";\n\n svg {\n line-height: 1.75em;\n font-size: 0.875rem;\n }\n"]);
50
+
51
+ _templateObject16 = function _templateObject16() {
52
+ return data;
53
+ };
54
+
55
+ return data;
56
+ }
57
+
58
+ function _templateObject15() {
59
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: calc((39px - 1.75em) / 2) 0 calc((39px - 1.75em) / 2) 1em;\n color: ", ";\n font-size: 0.875rem;\n line-height: 1.75em;\n"]);
60
+
41
61
  _templateObject15 = function _templateObject15() {
42
62
  return data;
43
63
  };
@@ -46,7 +66,7 @@ function _templateObject15() {
46
66
  }
47
67
 
48
68
  function _templateObject14() {
49
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: calc((39px - 1.75em) / 2) 0 calc((39px - 1.75em) / 2) 1em;\n color: ", ";\n font-size: 0.875rem;\n line-height: 1.75em;\n"]);
69
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n padding: calc((39px - 1.75em) / 2) 0 calc((39px - 1.75em) / 2) 1em;\n line-height: 1.75em;\n list-style-type: none;\n cursor: pointer;\n\n ", "\n"]);
50
70
 
51
71
  _templateObject14 = function _templateObject14() {
52
72
  return data;
@@ -56,7 +76,7 @@ function _templateObject14() {
56
76
  }
57
77
 
58
78
  function _templateObject13() {
59
- var data = (0, _taggedTemplateLiteral2["default"])(["\n padding: calc((39px - 1.75em) / 2) 0 calc((39px - 1.75em) / 2) 1em;\n line-height: 1.75em;\n list-style-type: none;\n cursor: pointer;\n\n ", "\n"]);
79
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n position: absolute;\n z-index: 1;\n max-height: 160px;\n overflow: auto;\n top: calc(100% + 4px);\n left: 0;\n margin: 0;\n padding: 0;\n width: 100%;\n box-sizing: border-box;\n cursor: default;\n border-radius: 4px;\n border: 1px solid ", ";\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n"]);
60
80
 
61
81
  _templateObject13 = function _templateObject13() {
62
82
  return data;
@@ -66,7 +86,7 @@ function _templateObject13() {
66
86
  }
67
87
 
68
88
  function _templateObject12() {
69
- var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n position: absolute;\n z-index: 1;\n max-height: 160px;\n overflow: auto;\n top: calc(100% + 4px);\n left: 0;\n margin: 0;\n padding: 0;\n width: 100%;\n box-sizing: border-box;\n cursor: default;\n border-radius: 4px;\n border: 1px solid ", ";\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n"]);
89
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n min-height: 1.5em;\n color: ", ";\n font-family: ", ";\n font-size: 0.75rem;\n font-weight: 400;\n line-height: 1.5em;\n"]);
70
90
 
71
91
  _templateObject12 = function _templateObject12() {
72
92
  return data;
@@ -76,7 +96,7 @@ function _templateObject12() {
76
96
  }
77
97
 
78
98
  function _templateObject11() {
79
- var data = (0, _taggedTemplateLiteral2["default"])(["\n min-height: 1.5em;\n color: ", ";\n font-family: ", ";\n font-size: 0.75rem;\n font-weight: 400;\n line-height: 1.5em;\n"]);
99
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n padding: 3px;\n height: 18px;\n width: 18px;\n margin-left: calc(1rem * 0.25);\n color: ", ";\n\n svg {\n line-height: 18px;\n font-size: 1.25rem;\n }\n"]);
80
100
 
81
101
  _templateObject11 = function _templateObject11() {
82
102
  return data;
@@ -86,7 +106,7 @@ function _templateObject11() {
86
106
  }
87
107
 
88
108
  function _templateObject10() {
89
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n padding: 3px;\n height: 18px;\n width: 18px;\n margin-left: calc(1rem * 0.25);\n pointer-events: none;\n color: ", ";\n\n svg {\n line-height: 18px;\n font-size: 1.25rem;\n }\n"]);
109
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n height: calc(1rem * 1.5);\n line-height: calc(1rem * 1.5);\n margin: 0 calc(1rem * 0.25);\n padding: 0 0 0 calc(1rem * 0.5);\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"]);
90
110
 
91
111
  _templateObject10 = function _templateObject10() {
92
112
  return data;
@@ -96,7 +116,7 @@ function _templateObject10() {
96
116
  }
97
117
 
98
118
  function _templateObject9() {
99
- var data = (0, _taggedTemplateLiteral2["default"])(["\n height: calc(1rem * 1.5);\n line-height: calc(1rem * 1.5);\n margin: 0 calc(1rem * 0.25);\n padding: 0 0 0 calc(1rem * 0.5);\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"]);
119
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n height: calc(1rem * 1.5);\n line-height: calc(1rem * 1.5);\n margin-left: calc(1rem * 0.25);\n padding: 0 calc(1rem * 0.5) 0 0;\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"]);
100
120
 
101
121
  _templateObject9 = function _templateObject9() {
102
122
  return data;
@@ -106,7 +126,7 @@ function _templateObject9() {
106
126
  }
107
127
 
108
128
  function _templateObject8() {
109
- var data = (0, _taggedTemplateLiteral2["default"])(["\n height: calc(1rem * 1.5);\n line-height: calc(1rem * 1.5);\n margin-left: calc(1rem * 0.25);\n padding: 0 calc(1rem * 0.5) 0 0;\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"]);
129
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n font-size: 1rem;\n font-family: ", ";\n border: 1px solid transparent;\n border-radius: 4px;\n padding: 3px;\n margin-left: calc(1rem * 0.25);\n ", "\n\n box-shadow: 0 0 0 2px transparent;\n background-color: ", ";\n\n color: ", ";\n\n ", "\n\n svg {\n line-height: 18px;\n }\n"]);
110
130
 
111
131
  _templateObject8 = function _templateObject8() {
112
132
  return data;
@@ -116,7 +136,7 @@ function _templateObject8() {
116
136
  }
117
137
 
118
138
  function _templateObject7() {
119
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n font-size: 1rem;\n font-family: ", ";\n border: 1px solid transparent;\n border-radius: 4px;\n padding: 3px;\n margin-left: calc(1rem * 0.25);\n ", ";\n\n background-color: ", ";\n\n color: ", ";\n\n ", "\n\n svg {\n line-height: 18px;\n }\n"]);
139
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n width: 16px;\n height: 16px;\n"]);
120
140
 
121
141
  _templateObject7 = function _templateObject7() {
122
142
  return data;
@@ -136,7 +156,7 @@ function _templateObject6() {
136
156
  }
137
157
 
138
158
  function _templateObject5() {
139
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n position: relative;\n align-items: center;\n height: calc(calc(1rem * 2.5) - calc(1px * 2));\n margin: calc(1rem * 0.25) 0;\n padding: 0 calc(1rem * 0.5);\n\n ", "\n\n box-shadow: 0 0 0 2px transparent;\n border-radius: 4px;\n border: 1px solid\n ", ";\n ", "\n\n ", ";\n ", ";\n"]);
159
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n position: relative;\n align-items: center;\n height: calc(calc(1rem * 2.5) - calc(1px * 2));\n margin: calc(1rem * 0.25) 0;\n padding: 0 calc(1rem * 0.5);\n\n ", "\n box-shadow: 0 0 0 2px transparent;\n border-radius: 4px;\n border: 1px solid\n ", ";\n ", "\n ", ";\n\n ", ";\n"]);
140
160
 
141
161
  _templateObject5 = function _templateObject5() {
142
162
  return data;
@@ -206,18 +226,22 @@ var makeCancelable = function makeCancelable(promise) {
206
226
  };
207
227
  };
208
228
 
209
- var getLengthErrorMessage = function getLengthErrorMessage(length) {
210
- return "Min length ".concat(length.min, ", max length ").concat(length.max, ".");
229
+ var getNotOptionalErrorMessage = function getNotOptionalErrorMessage() {
230
+ return "This field is required. Please, enter a value.";
211
231
  };
212
232
 
213
- var patternMatch = function patternMatch(pattern, value) {
214
- return new RegExp(pattern).test(value);
233
+ var getLengthErrorMessage = function getLengthErrorMessage(length) {
234
+ return "Min length ".concat(length.min, ", max length ").concat(length.max, ".");
215
235
  };
216
236
 
217
237
  var getPatternErrorMessage = function getPatternErrorMessage() {
218
238
  return "Please match the format requested.";
219
239
  };
220
240
 
241
+ var patternMatch = function patternMatch(pattern, value) {
242
+ return new RegExp(pattern).test(value);
243
+ };
244
+
221
245
  var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
222
246
  var _ref$label = _ref.label,
223
247
  label = _ref$label === void 0 ? "" : _ref$label,
@@ -243,12 +267,14 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
243
267
  onBlur = _ref.onBlur,
244
268
  _ref$error = _ref.error,
245
269
  error = _ref$error === void 0 ? "" : _ref$error,
246
- margin = _ref.margin,
247
- _ref$size = _ref.size,
248
- size = _ref$size === void 0 ? "medium" : _ref$size,
249
270
  suggestions = _ref.suggestions,
250
271
  pattern = _ref.pattern,
251
272
  length = _ref.length,
273
+ _ref$autocomplete = _ref.autocomplete,
274
+ autocomplete = _ref$autocomplete === void 0 ? "off" : _ref$autocomplete,
275
+ margin = _ref.margin,
276
+ _ref$size = _ref.size,
277
+ size = _ref$size === void 0 ? "medium" : _ref$size,
252
278
  _ref$tabIndex = _ref.tabIndex,
253
279
  tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
254
280
 
@@ -269,67 +295,44 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
269
295
 
270
296
  var _useState7 = (0, _react.useState)(false),
271
297
  _useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
272
- isError = _useState8[0],
273
- changeIsError = _useState8[1];
298
+ isScrollable = _useState8[0],
299
+ changeIsScrollable = _useState8[1];
274
300
 
275
301
  var _useState9 = (0, _react.useState)(false),
276
302
  _useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
277
- isScrollable = _useState10[0],
278
- changeIsScrollable = _useState10[1];
303
+ isActiveSuggestion = _useState10[0],
304
+ changeIsActiveSuggestion = _useState10[1];
279
305
 
280
306
  var _useState11 = (0, _react.useState)(false),
281
307
  _useState12 = (0, _slicedToArray2["default"])(_useState11, 2),
282
- isActiveSuggestion = _useState12[0],
283
- changeIsActiveSuggestion = _useState12[1];
308
+ isAutosuggestError = _useState12[0],
309
+ changeIsAutosuggestError = _useState12[1];
284
310
 
285
- var _useState13 = (0, _react.useState)(false),
311
+ var _useState13 = (0, _react.useState)([]),
286
312
  _useState14 = (0, _slicedToArray2["default"])(_useState13, 2),
287
- isAutosuggestError = _useState14[0],
288
- changeIsAutosuggestError = _useState14[1];
313
+ filteredSuggestions = _useState14[0],
314
+ changeFilteredSuggestions = _useState14[1];
289
315
 
290
- var _useState15 = (0, _react.useState)(""),
316
+ var _useState15 = (0, _react.useState)(-1),
291
317
  _useState16 = (0, _slicedToArray2["default"])(_useState15, 2),
292
- validationError = _useState16[0],
293
- changeValidationError = _useState16[1];
294
-
295
- var _useState17 = (0, _react.useState)([]),
296
- _useState18 = (0, _slicedToArray2["default"])(_useState17, 2),
297
- filteredSuggestions = _useState18[0],
298
- changeFilteredSuggestions = _useState18[1];
299
-
300
- var _useState19 = (0, _react.useState)(-1),
301
- _useState20 = (0, _slicedToArray2["default"])(_useState19, 2),
302
- visualFocusedSuggIndex = _useState20[0],
303
- changeVisualFocusedSuggIndex = _useState20[1];
304
-
305
- var _useState21 = (0, _react.useState)(null),
306
- _useState22 = (0, _slicedToArray2["default"])(_useState21, 2),
307
- minNumber = _useState22[0],
308
- setMinNumber = _useState22[1];
309
-
310
- var _useState23 = (0, _react.useState)(null),
311
- _useState24 = (0, _slicedToArray2["default"])(_useState23, 2),
312
- maxNumber = _useState24[0],
313
- setMaxNumber = _useState24[1];
314
-
315
- var _useState25 = (0, _react.useState)(null),
316
- _useState26 = (0, _slicedToArray2["default"])(_useState25, 2),
317
- stepNumber = _useState26[0],
318
- setStepNumber = _useState26[1];
318
+ visualFocusedSuggIndex = _useState16[0],
319
+ changeVisualFocusedSuggIndex = _useState16[1];
320
+
321
+ var _useState17 = (0, _react.useState)("input-".concat((0, _uuid.v4)())),
322
+ _useState18 = (0, _slicedToArray2["default"])(_useState17, 1),
323
+ inputId = _useState18[0];
319
324
 
320
325
  var suggestionsRef = (0, _react.useRef)(null);
321
326
  var inputRef = (0, _react.useRef)(null);
322
327
  var actionRef = (0, _react.useRef)(null);
323
328
  var colorsTheme = (0, _useTheme["default"])();
324
329
  var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
325
- var inputId = "input-".concat((0, _uuid.v4)());
326
330
  var autosuggestId = "".concat(inputId, "-listBox");
331
+ var errorId = "error-message-".concat(inputId);
327
332
  var numberContext = (0, _react.useContext)(_NumberContext["default"]);
328
333
 
329
- var changeValue = function changeValue(newValue) {
330
- var changedValue = typeof newValue === "number" ? newValue.toString() : newValue;
331
- value !== null && value !== void 0 ? value : setInnerValue(newValue);
332
- typeof onChange === "function" && onChange(changedValue);
334
+ var isNotOptional = function isNotOptional(value) {
335
+ return value === "" && !optional;
333
336
  };
334
337
 
335
338
  var isLengthIncorrect = function isLengthIncorrect(value) {
@@ -337,15 +340,17 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
337
340
  };
338
341
 
339
342
  var isNumberIncorrect = function isNumberIncorrect(value) {
340
- return minNumber && parseInt(value) < minNumber || maxNumber && parseInt(value) > maxNumber;
343
+ return (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber) && parseInt(value) < (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber) || (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber) && parseInt(value) > (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber);
344
+ };
345
+
346
+ var isTextInputType = function isTextInputType() {
347
+ var _inputRef$current, _inputRef$current2;
348
+
349
+ return !(inputRef !== null && inputRef !== void 0 && (_inputRef$current = inputRef.current) !== null && _inputRef$current !== void 0 && _inputRef$current.getAttribute("type")) || (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.getAttribute("type")) === "text";
341
350
  };
342
351
 
343
352
  var getNumberErrorMessage = function getNumberErrorMessage(value) {
344
- if (minNumber && parseInt(value) < minNumber) {
345
- return "Value must be greater than or equal to ".concat(minNumber, ".");
346
- } else if (maxNumber && parseInt(value) > maxNumber) {
347
- return "Value must be less than or equal to ".concat(maxNumber, ".");
348
- }
353
+ if (numberContext !== null && numberContext !== void 0 && numberContext.minNumber && parseInt(value) < (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber)) return "Value must be greater than or equal to ".concat(numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber, ".");else if (numberContext !== null && numberContext !== void 0 && numberContext.maxNumber && parseInt(value) > (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber)) return "Value must be less than or equal to ".concat(numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber, ".");
349
354
  };
350
355
 
351
356
  var hasInputSuggestions = function hasInputSuggestions() {
@@ -361,6 +366,27 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
361
366
  changeVisualFocusedSuggIndex(-1);
362
367
  };
363
368
 
369
+ var changeValue = function changeValue(newValue) {
370
+ value !== null && value !== void 0 ? value : setInnerValue(newValue);
371
+ var changedValue = typeof newValue === "number" ? newValue.toString() : newValue;
372
+ if (isNotOptional(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
373
+ value: changedValue,
374
+ error: getNotOptionalErrorMessage()
375
+ });else if (isLengthIncorrect(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
376
+ value: changedValue,
377
+ error: getLengthErrorMessage(length)
378
+ });else if (newValue && pattern && !patternMatch(pattern, newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
379
+ value: changedValue,
380
+ error: getPatternErrorMessage()
381
+ });else if (newValue && isNumberIncorrect(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
382
+ value: changedValue,
383
+ error: getNumberErrorMessage(newValue)
384
+ });else onChange === null || onChange === void 0 ? void 0 : onChange({
385
+ value: changedValue,
386
+ error: null
387
+ });
388
+ };
389
+
364
390
  var handleInputContainerOnClick = function handleInputContainerOnClick() {
365
391
  document.activeElement !== actionRef.current && inputRef.current.focus();
366
392
  };
@@ -376,36 +402,22 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
376
402
 
377
403
  var handleIOnBlur = function handleIOnBlur(event) {
378
404
  suggestions && closeSuggestions();
379
-
380
- if (isLengthIncorrect(event.target.value)) {
381
- changeIsError(true);
382
- changeValidationError(getLengthErrorMessage(length, event));
383
- onBlur === null || onBlur === void 0 ? void 0 : onBlur({
384
- value: event.target.value,
385
- error: getLengthErrorMessage(length)
386
- });
387
- } else if (event.target.value && pattern && !patternMatch(pattern, event.target.value)) {
388
- changeIsError(true);
389
- changeValidationError(getPatternErrorMessage());
390
- onBlur === null || onBlur === void 0 ? void 0 : onBlur({
391
- value: event.target.value,
392
- error: getPatternErrorMessage()
393
- });
394
- } else if (event.target.value && isNumberIncorrect(event.target.value)) {
395
- changeIsError(true);
396
- changeValidationError(getNumberErrorMessage(event.target.value));
397
- onBlur === null || onBlur === void 0 ? void 0 : onBlur({
398
- value: event.target.value,
399
- error: getNumberErrorMessage(event.target.value)
400
- });
401
- } else {
402
- changeIsError(false);
403
- changeValidationError("");
404
- onBlur === null || onBlur === void 0 ? void 0 : onBlur({
405
- value: event.target.value,
406
- error: null
407
- });
408
- }
405
+ if (isNotOptional(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
406
+ value: event.target.value,
407
+ error: getNotOptionalErrorMessage()
408
+ });else if (isLengthIncorrect(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
409
+ value: event.target.value,
410
+ error: getLengthErrorMessage(length)
411
+ });else if (event.target.value && pattern && !patternMatch(pattern, event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
412
+ value: event.target.value,
413
+ error: getPatternErrorMessage()
414
+ });else if (event.target.value && isNumberIncorrect(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
415
+ value: event.target.value,
416
+ error: getNumberErrorMessage(event.target.value)
417
+ });else onBlur === null || onBlur === void 0 ? void 0 : onBlur({
418
+ value: event.target.value,
419
+ error: null
420
+ });
409
421
  };
410
422
 
411
423
  var handleIOnFocus = function handleIOnFocus() {
@@ -478,15 +490,12 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
478
490
  };
479
491
 
480
492
  var setNumberProps = function setNumberProps(type, min, max, step) {
481
- var _inputRef$current, _inputRef$current2, _inputRef$current3, _inputRef$current4;
493
+ var _inputRef$current3, _inputRef$current4, _inputRef$current5, _inputRef$current6;
482
494
 
483
- type && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.setAttribute("type", type));
484
- min && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.setAttribute("min", min));
485
- max && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.setAttribute("max", max));
486
- step && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.setAttribute("step", step));
487
- setMinNumber(min);
488
- setMaxNumber(max);
489
- setStepNumber(step);
495
+ type && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.setAttribute("type", type));
496
+ min && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.setAttribute("min", min));
497
+ max && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 ? void 0 : _inputRef$current5.setAttribute("max", max));
498
+ step && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current6 = inputRef.current) === null || _inputRef$current6 === void 0 ? void 0 : _inputRef$current6.setAttribute("step", step));
490
499
  };
491
500
 
492
501
  (0, _react.useLayoutEffect)(function () {
@@ -498,8 +507,6 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
498
507
  return changeIsScrollable(false);
499
508
  }, [isScrollable, visualFocusedSuggIndex]);
500
509
  (0, _react.useEffect)(function () {
501
- var _inputRef$current5;
502
-
503
510
  if (typeof suggestions === "function") {
504
511
  changeIsSearching(true);
505
512
  changeIsAutosuggestError(false);
@@ -526,9 +533,6 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
526
533
  }
527
534
 
528
535
  numberContext && setNumberProps(numberContext.typeNumber, numberContext.minNumber, numberContext.maxNumber, numberContext.stepNumber);
529
- inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 ? void 0 : _inputRef$current5.addEventListener("wheel", function (event) {
530
- return event.preventDefault();
531
- });
532
536
  }, [value, innerValue, suggestions]);
533
537
  var defaultClearAction = {
534
538
  onClick: function onClick() {
@@ -561,18 +565,18 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
561
565
  }));
562
566
 
563
567
  var decrementNumber = function decrementNumber() {
564
- var numberValue = value || innerValue;
568
+ var numberValue = value !== null && value !== void 0 ? value : innerValue;
565
569
 
566
- if (minNumber && parseInt(numberValue) < minNumber) {
570
+ if (numberContext !== null && numberContext !== void 0 && numberContext.minNumber && parseInt(numberValue) < (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber)) {
567
571
  changeValue(parseInt(numberValue));
568
- } else if (maxNumber && parseInt(numberValue) > maxNumber) {
569
- changeValue(maxNumber);
570
- } else if (minNumber && (parseInt(numberValue) === minNumber || numberValue === "" || stepNumber && parseInt(numberValue) - stepNumber < minNumber)) {
571
- changeValue(minNumber);
572
- } else if (stepNumber && minNumber && parseInt(numberValue) - stepNumber >= minNumber || stepNumber && numberValue !== "") {
573
- changeValue(parseInt(numberValue) - stepNumber);
574
- } else if (stepNumber && numberValue == "") {
575
- changeValue(-stepNumber);
572
+ } else if (numberContext !== null && numberContext !== void 0 && numberContext.maxNumber && parseInt(numberValue) > (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber)) {
573
+ changeValue(numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber);
574
+ } else if (numberContext !== null && numberContext !== void 0 && numberContext.minNumber && (parseInt(numberValue) === (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber) || numberValue === "" || numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && parseInt(numberValue) - (numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber) < (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber))) {
575
+ changeValue(numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber);
576
+ } else if (numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && numberContext !== null && numberContext !== void 0 && numberContext.minNumber && parseInt(numberValue) - (numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber) >= (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber) || numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && numberValue !== "") {
577
+ changeValue(parseInt(numberValue) - (numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber));
578
+ } else if (numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && numberValue == "") {
579
+ changeValue(-(numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber));
576
580
  } else if (numberValue === "") {
577
581
  changeValue(-1);
578
582
  } else {
@@ -581,18 +585,18 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
581
585
  };
582
586
 
583
587
  var incrementNumber = function incrementNumber() {
584
- var numberValue = value || innerValue;
588
+ var numberValue = value !== null && value !== void 0 ? value : innerValue;
585
589
 
586
- if (maxNumber && parseInt(numberValue) > maxNumber) {
590
+ if (numberContext !== null && numberContext !== void 0 && numberContext.maxNumber && parseInt(numberValue) > (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber)) {
587
591
  changeValue(parseInt(numberValue));
588
- } else if (minNumber && (parseInt(numberValue) < minNumber || numberValue === "")) {
589
- changeValue(minNumber);
590
- } else if (maxNumber && (parseInt(numberValue) === maxNumber || stepNumber && parseInt(numberValue) + stepNumber > maxNumber)) {
591
- changeValue(maxNumber);
592
- } else if (stepNumber && maxNumber && parseInt(numberValue) + stepNumber <= maxNumber || stepNumber && numberValue !== "") {
593
- changeValue(parseInt(numberValue) + stepNumber);
594
- } else if (stepNumber && numberValue == "") {
595
- changeValue(stepNumber);
592
+ } else if (numberContext !== null && numberContext !== void 0 && numberContext.minNumber && (parseInt(numberValue) < (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber) || numberValue === "")) {
593
+ changeValue(numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber);
594
+ } else if (numberContext !== null && numberContext !== void 0 && numberContext.maxNumber && (parseInt(numberValue) === (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber) || numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && parseInt(numberValue) + (numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber) > (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber))) {
595
+ changeValue(numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber);
596
+ } else if (numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && numberContext !== null && numberContext !== void 0 && numberContext.maxNumber && parseInt(numberValue) + (numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber) <= (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber) || numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && numberValue !== "") {
597
+ changeValue(parseInt(numberValue) + (numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber));
598
+ } else if (numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && numberValue == "") {
599
+ changeValue(numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber);
596
600
  } else if (numberValue === "") {
597
601
  changeValue(1);
598
602
  } else {
@@ -637,12 +641,6 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
637
641
  }))
638
642
  };
639
643
 
640
- var isTextInputType = function isTextInputType() {
641
- var _inputRef$current6, _inputRef$current7;
642
-
643
- return !(inputRef !== null && inputRef !== void 0 && (_inputRef$current6 = inputRef.current) !== null && _inputRef$current6 !== void 0 && _inputRef$current6.getAttribute("type")) || (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current7 = inputRef.current) === null || _inputRef$current7 === void 0 ? void 0 : _inputRef$current7.getAttribute("type")) === "text";
644
- };
645
-
646
644
  var HighlightedSuggestion = function HighlightedSuggestion(_ref2) {
647
645
  var suggestion = _ref2.suggestion,
648
646
  index = _ref2.index;
@@ -688,7 +686,7 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
688
686
  disabled: disabled,
689
687
  backgroundType: backgroundType
690
688
  }, helperText), _react["default"].createElement(InputContainer, {
691
- error: error || validationError,
689
+ error: error,
692
690
  disabled: disabled,
693
691
  backgroundType: backgroundType,
694
692
  onClick: handleInputContainerOnClick
@@ -709,13 +707,19 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
709
707
  ref: inputRef,
710
708
  backgroundType: backgroundType,
711
709
  pattern: pattern,
710
+ minLength: length === null || length === void 0 ? void 0 : length.min,
711
+ maxLength: length === null || length === void 0 ? void 0 : length.max,
712
+ autoComplete: autocomplete,
712
713
  tabIndex: tabIndex,
713
714
  role: isTextInputType() && hasInputSuggestions() ? "combobox" : "textbox",
714
715
  "aria-autocomplete": isTextInputType() && hasInputSuggestions() ? "list" : undefined,
715
716
  "aria-controls": isTextInputType() && hasInputSuggestions() ? inputId : undefined,
716
717
  "aria-expanded": isTextInputType() && hasInputSuggestions() ? isOpen ? "true" : "false" : undefined,
717
- "aria-activedescendant": isTextInputType() && hasInputSuggestions() && isOpen && visualFocusedSuggIndex !== -1 ? "suggestion-".concat(visualFocusedSuggIndex) : undefined
718
- }), (error || isError) && _react["default"].createElement(ErrorIcon, {
718
+ "aria-activedescendant": isTextInputType() && hasInputSuggestions() && isOpen && visualFocusedSuggIndex !== -1 ? "suggestion-".concat(visualFocusedSuggIndex) : undefined,
719
+ "aria-invalid": error ? "true" : "false",
720
+ "aria-describedby": error ? errorId : undefined,
721
+ "aria-required": optional ? "false" : "true"
722
+ }), !disabled && error && _react["default"].createElement(ErrorIcon, {
719
723
  backgroundType: backgroundType,
720
724
  "aria-label": "Error"
721
725
  }, errorIcon), !disabled && clearable && (value !== null && value !== void 0 ? value : innerValue).length > 0 && _react["default"].createElement(Action, {
@@ -743,7 +747,9 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
743
747
  onClick: action.onClick,
744
748
  backgroundType: backgroundType,
745
749
  tabIndex: tabIndex
746
- }, action.icon), suffix && _react["default"].createElement(Suffix, {
750
+ }, typeof action.icon === "string" ? _react["default"].createElement(ActionIcon, {
751
+ src: action.icon
752
+ }) : action.icon), suffix && _react["default"].createElement(Suffix, {
747
753
  disabled: disabled,
748
754
  backgroundType: backgroundType
749
755
  }, suffix), isOpen && _react["default"].createElement(Suggestions, {
@@ -764,11 +770,12 @@ var DxcNewInputText = _react["default"].forwardRef(function (_ref, ref) {
764
770
  suggestion: suggestion,
765
771
  index: index
766
772
  });
767
- }), isSearching && _react["default"].createElement(SuggestionsSystemMessage, null, "Searching..."), isAutosuggestError && _react["default"].createElement(SuggestionsError, null, _react["default"].createElement(ErrorIcon, {
773
+ }), isSearching && _react["default"].createElement(SuggestionsSystemMessage, null, "Searching..."), isAutosuggestError && _react["default"].createElement(SuggestionsError, null, _react["default"].createElement(SuggestionsErrorIcon, {
768
774
  backgroundType: backgroundType
769
- }, errorIcon), "Error fetching data"))), _react["default"].createElement(Error, {
775
+ }, errorIcon), "Error fetching data"))), !disabled && _react["default"].createElement(Error, {
776
+ id: errorId,
770
777
  backgroundType: backgroundType
771
- }, error || validationError)));
778
+ }, error)));
772
779
  });
773
780
 
774
781
  var sizes = {
@@ -852,10 +859,12 @@ var Input = _styledComponents["default"].input(_templateObject6(), function (pro
852
859
  return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPlaceholderFontColorOnDark : props.theme.disabledPlaceholderFontColor : props.backgroundType === "dark" ? props.theme.placeholderFontColorOnDark : props.theme.placeholderFontColor;
853
860
  });
854
861
 
855
- var Action = _styledComponents["default"].button(_templateObject7(), function (props) {
862
+ var ActionIcon = _styledComponents["default"].img(_templateObject7());
863
+
864
+ var Action = _styledComponents["default"].button(_templateObject8(), function (props) {
856
865
  return props.theme.fontFamily;
857
866
  }, function (props) {
858
- return props.disabled ? "cursor: not-allowed;" : "cursor: pointer";
867
+ return props.disabled ? "cursor: not-allowed;" : "cursor: pointer;";
859
868
  }, function (props) {
860
869
  return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionBackgroundColorOnDark : props.theme.disabledActionBackgroundColor : props.backgroundType === "dark" ? props.theme.actionBackgroundColorOnDark : props.theme.actionBackgroundColor;
861
870
  }, function (props) {
@@ -864,31 +873,31 @@ var Action = _styledComponents["default"].button(_templateObject7(), function (p
864
873
  return !props.disabled && "\n &:hover {\n background-color: ".concat(props.backgroundType === "dark" ? props.theme.hoverActionBackgroundColorOnDark : props.theme.hoverActionBackgroundColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.hoverActionIconColorOnDark : props.theme.hoverActionIconColor, ";\n }\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ").concat(props.backgroundType === "dark" ? props.theme.focusActionBorderColorOnDark : props.theme.focusActionBorderColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.focusActionIconColorOnDark : props.theme.focusActionIconColor, ";\n }\n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px ").concat(props.backgroundType === "dark" ? props.theme.focusActionBorderColorOnDark : props.theme.focusActionBorderColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.focusActionIconColorOnDark : props.theme.focusActionIconColor, ";\n }\n &:active {\n background-color: ").concat(props.backgroundType === "dark" ? props.theme.activeActionBackgroundColorOnDark : props.theme.activeActionBackgroundColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.activeActionIconColorOnDark : props.theme.activeActionIconColor, ";\n }\n ");
865
874
  });
866
875
 
867
- var Prefix = _styledComponents["default"].span(_templateObject8(), function (props) {
876
+ var Prefix = _styledComponents["default"].span(_templateObject9(), function (props) {
868
877
  var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPrefixColorOnDark : props.theme.disabledPrefixColor : props.backgroundType === "dark" ? props.theme.prefixColorOnDark : props.theme.prefixColor;
869
878
  return "color: ".concat(color, "; border-right: 1px solid ").concat(color, ";");
870
879
  }, function (props) {
871
880
  return props.theme.fontFamily;
872
881
  });
873
882
 
874
- var Suffix = _styledComponents["default"].span(_templateObject9(), function (props) {
883
+ var Suffix = _styledComponents["default"].span(_templateObject10(), function (props) {
875
884
  var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledSuffixColorOnDark : props.theme.disabledSuffixColor : props.backgroundType === "dark" ? props.theme.suffixColorOnDark : props.theme.suffixColor;
876
885
  return "color: ".concat(color, "; border-left: 1px solid ").concat(color, ";");
877
886
  }, function (props) {
878
887
  return props.theme.fontFamily;
879
888
  });
880
889
 
881
- var ErrorIcon = _styledComponents["default"].span(_templateObject10(), function (props) {
890
+ var ErrorIcon = _styledComponents["default"].span(_templateObject11(), function (props) {
882
891
  return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
883
892
  });
884
893
 
885
- var Error = _styledComponents["default"].span(_templateObject11(), function (props) {
894
+ var Error = _styledComponents["default"].span(_templateObject12(), function (props) {
886
895
  return props.backgroundType === "dark" ? props.theme.errorMessageColorOnDark : props.theme.errorMessageColor;
887
896
  }, function (props) {
888
897
  return props.theme.fontFamily;
889
898
  });
890
899
 
891
- var Suggestions = _styledComponents["default"].ul(_templateObject12(), function (props) {
900
+ var Suggestions = _styledComponents["default"].ul(_templateObject13(), function (props) {
892
901
  return props.isError ? props.theme.errorMessageBackgroundColor : "#ffffff";
893
902
  }, function (props) {
894
903
  return props.isError ? props.theme.errorMessageBorderColor : props.theme.enabledBorderColor;
@@ -904,15 +913,19 @@ var Suggestions = _styledComponents["default"].ul(_templateObject12(), function
904
913
  return props.theme.listOptionFontWeight;
905
914
  });
906
915
 
907
- var Suggestion = _styledComponents["default"].li(_templateObject13(), function (props) {
916
+ var Suggestion = _styledComponents["default"].li(_templateObject14(), function (props) {
908
917
  return props.active ? "background-color: ".concat(props.theme.activeListOptionBackgroundColor, ";") : props.visualFocused && "background-color: ".concat(props.theme.hoverListOptionBackgroundColor, ";");
909
918
  });
910
919
 
911
- var SuggestionsSystemMessage = _styledComponents["default"].span(_templateObject14(), function (props) {
920
+ var SuggestionsSystemMessage = _styledComponents["default"].span(_templateObject15(), function (props) {
912
921
  return props.theme.systemMessageFontColor;
913
922
  });
914
923
 
915
- var SuggestionsError = _styledComponents["default"].span(_templateObject15());
924
+ var SuggestionsErrorIcon = _styledComponents["default"].span(_templateObject16(), function (props) {
925
+ return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
926
+ });
927
+
928
+ var SuggestionsError = _styledComponents["default"].span(_templateObject17());
916
929
 
917
930
  DxcNewInputText.propTypes = {
918
931
  label: _propTypes["default"].string,
@@ -922,22 +935,19 @@ DxcNewInputText.propTypes = {
922
935
  placeholder: _propTypes["default"].string,
923
936
  action: _propTypes["default"].shape({
924
937
  onClick: _propTypes["default"].func.isRequired,
925
- icon: _propTypes["default"].shape({
938
+ icon: _propTypes["default"].oneOfType([_propTypes["default"].shape({
926
939
  type: _propTypes["default"].oneOf(["svg"])
927
- }).isRequired
940
+ }), _propTypes["default"].string]).isRequired
928
941
  }),
929
942
  clearable: _propTypes["default"].bool,
930
943
  disabled: _propTypes["default"].bool,
931
944
  optional: _propTypes["default"].bool,
932
- prefix: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].shape({
933
- type: _propTypes["default"].oneOf(["svg"])
934
- })]),
935
- suffix: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].shape({
936
- type: _propTypes["default"].oneOf(["svg"])
937
- })]),
945
+ prefix: _propTypes["default"].string,
946
+ suffix: _propTypes["default"].string,
938
947
  onChange: _propTypes["default"].func,
939
948
  onBlur: _propTypes["default"].func,
940
949
  error: _propTypes["default"].string,
950
+ autocomplete: _propTypes["default"].string,
941
951
  margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
942
952
  top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
943
953
  bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),