@dxc-technology/halstack-react 0.0.0-090152f → 0.0.0-0a9608a

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 (95) hide show
  1. package/HalstackContext.js +7 -8
  2. package/accordion/Accordion.js +7 -13
  3. package/accordion/Accordion.stories.tsx +52 -12
  4. package/accordion/types.d.ts +1 -0
  5. package/accordion-group/types.d.ts +1 -0
  6. package/box/types.d.ts +1 -0
  7. package/button/Button.js +11 -13
  8. package/button/Button.stories.tsx +58 -1
  9. package/card/types.d.ts +1 -0
  10. package/checkbox/Checkbox.d.ts +2 -2
  11. package/checkbox/Checkbox.js +16 -15
  12. package/checkbox/Checkbox.stories.tsx +79 -59
  13. package/checkbox/types.d.ts +4 -0
  14. package/chip/Chip.js +11 -23
  15. package/chip/Chip.stories.tsx +41 -9
  16. package/common/variables.js +130 -126
  17. package/date-input/Calendar.d.ts +4 -0
  18. package/date-input/Calendar.js +246 -0
  19. package/date-input/DateInput.js +134 -237
  20. package/date-input/DateInput.stories.tsx +137 -38
  21. package/date-input/DateInput.test.js +494 -138
  22. package/date-input/DatePicker.d.ts +4 -0
  23. package/date-input/DatePicker.js +132 -0
  24. package/date-input/Icons.d.ts +6 -0
  25. package/date-input/Icons.js +75 -0
  26. package/date-input/YearPicker.d.ts +4 -0
  27. package/date-input/YearPicker.js +116 -0
  28. package/date-input/types.d.ts +51 -0
  29. package/dialog/types.d.ts +1 -0
  30. package/dropdown/Dropdown.js +38 -37
  31. package/dropdown/Dropdown.stories.tsx +175 -94
  32. package/dropdown/Dropdown.test.js +18 -24
  33. package/dropdown/DropdownMenu.js +8 -18
  34. package/dropdown/DropdownMenuItem.js +4 -15
  35. package/file-input/FileInput.d.ts +2 -2
  36. package/file-input/FileInput.js +177 -219
  37. package/file-input/FileInput.stories.tsx +38 -10
  38. package/file-input/FileInput.test.js +53 -12
  39. package/file-input/FileItem.d.ts +4 -14
  40. package/file-input/FileItem.js +38 -63
  41. package/file-input/types.d.ts +17 -0
  42. package/flex/Flex.d.ts +1 -1
  43. package/flex/Flex.js +31 -19
  44. package/flex/types.d.ts +14 -3
  45. package/footer/types.d.ts +1 -0
  46. package/header/Header.js +18 -20
  47. package/header/Header.stories.tsx +34 -1
  48. package/header/types.d.ts +1 -0
  49. package/link/Link.js +1 -1
  50. package/number-input/NumberInput.test.js +43 -7
  51. package/package.json +7 -12
  52. package/paginator/Icons.d.ts +5 -0
  53. package/paginator/Icons.js +16 -28
  54. package/paginator/Paginator.js +6 -12
  55. package/paginator/Paginator.test.js +18 -11
  56. package/password-input/PasswordInput.test.js +13 -12
  57. package/quick-nav/QuickNav.js +11 -12
  58. package/quick-nav/QuickNav.stories.tsx +97 -19
  59. package/radio-group/RadioGroup.js +9 -5
  60. package/radio-group/RadioGroup.test.js +116 -59
  61. package/resultsetTable/Icons.d.ts +7 -0
  62. package/resultsetTable/Icons.js +51 -0
  63. package/resultsetTable/ResultsetTable.js +48 -107
  64. package/resultsetTable/ResultsetTable.stories.tsx +50 -25
  65. package/resultsetTable/ResultsetTable.test.js +40 -63
  66. package/resultsetTable/types.d.ts +2 -2
  67. package/select/Listbox.d.ts +1 -1
  68. package/select/Listbox.js +5 -34
  69. package/select/Option.js +11 -24
  70. package/select/Select.js +46 -25
  71. package/select/Select.stories.tsx +209 -167
  72. package/select/Select.test.js +284 -231
  73. package/select/types.d.ts +2 -2
  74. package/sidenav/Sidenav.js +8 -10
  75. package/sidenav/Sidenav.stories.tsx +59 -50
  76. package/slider/Slider.d.ts +2 -2
  77. package/slider/Slider.js +15 -11
  78. package/slider/types.d.ts +4 -0
  79. package/spinner/Spinner.js +2 -2
  80. package/switch/Switch.d.ts +3 -3
  81. package/switch/Switch.js +5 -4
  82. package/switch/types.d.ts +6 -1
  83. package/table/Table.js +1 -1
  84. package/table/Table.test.js +1 -1
  85. package/tabs/Tab.js +3 -5
  86. package/tabs/Tabs.js +3 -3
  87. package/tabs/Tabs.stories.tsx +7 -5
  88. package/tabs-nav/NavTabs.stories.tsx +8 -6
  89. package/tabs-nav/Tab.js +5 -7
  90. package/text-input/Suggestion.js +32 -5
  91. package/text-input/TextInput.js +172 -162
  92. package/text-input/TextInput.stories.tsx +24 -4
  93. package/text-input/TextInput.test.js +658 -647
  94. package/text-input/types.d.ts +5 -0
  95. package/common/RequiredComponent.js +0 -32
@@ -39,7 +39,7 @@ var _Icons = _interopRequireDefault(require("./Icons"));
39
39
 
40
40
  var _uuid = require("uuid");
41
41
 
42
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
42
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
43
43
 
44
44
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
45
45
 
@@ -52,6 +52,13 @@ var sizes = {
52
52
  fillParent: "100%"
53
53
  };
54
54
 
55
+ var AutosuggestWrapper = function AutosuggestWrapper(_ref) {
56
+ var condition = _ref.condition,
57
+ wrapper = _ref.wrapper,
58
+ children = _ref.children;
59
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, condition ? wrapper(children) : children);
60
+ };
61
+
55
62
  var calculateWidth = function calculateWidth(margin, size) {
56
63
  return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
57
64
  };
@@ -77,81 +84,99 @@ var makeCancelable = function makeCancelable(promise) {
77
84
  };
78
85
  };
79
86
 
87
+ var hasSuggestions = function hasSuggestions(suggestions) {
88
+ return typeof suggestions === "function" || (suggestions === null || suggestions === void 0 ? void 0 : suggestions.length) > 0;
89
+ };
90
+
91
+ var isNotOptional = function isNotOptional(value, optional) {
92
+ return value === "" && !optional;
93
+ };
94
+
95
+ var isLengthIncorrect = function isLengthIncorrect(value, minLength, maxLength) {
96
+ return value && minLength && maxLength && (value.length < minLength || value.length > maxLength);
97
+ };
98
+
99
+ var isNumberIncorrect = function isNumberIncorrect(value, minNumber, maxNumber) {
100
+ return minNumber && parseInt(value) < minNumber || maxNumber && parseInt(value) > maxNumber;
101
+ };
102
+
80
103
  var patternMissmatch = function patternMissmatch(pattern, value) {
81
104
  return pattern && !new RegExp(pattern).test(value);
82
105
  };
83
106
 
84
- var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
85
- var label = _ref.label,
86
- _ref$name = _ref.name,
87
- name = _ref$name === void 0 ? "" : _ref$name,
88
- _ref$defaultValue = _ref.defaultValue,
89
- defaultValue = _ref$defaultValue === void 0 ? "" : _ref$defaultValue,
90
- value = _ref.value,
91
- helperText = _ref.helperText,
92
- _ref$placeholder = _ref.placeholder,
93
- placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder,
94
- action = _ref.action,
95
- _ref$clearable = _ref.clearable,
96
- clearable = _ref$clearable === void 0 ? false : _ref$clearable,
97
- _ref$disabled = _ref.disabled,
98
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
99
- _ref$optional = _ref.optional,
100
- optional = _ref$optional === void 0 ? false : _ref$optional,
101
- _ref$prefix = _ref.prefix,
102
- prefix = _ref$prefix === void 0 ? "" : _ref$prefix,
103
- _ref$suffix = _ref.suffix,
104
- suffix = _ref$suffix === void 0 ? "" : _ref$suffix,
105
- onChange = _ref.onChange,
106
- onBlur = _ref.onBlur,
107
- error = _ref.error,
108
- suggestions = _ref.suggestions,
109
- pattern = _ref.pattern,
110
- minLength = _ref.minLength,
111
- maxLength = _ref.maxLength,
112
- _ref$autocomplete = _ref.autocomplete,
113
- autocomplete = _ref$autocomplete === void 0 ? "off" : _ref$autocomplete,
114
- margin = _ref.margin,
115
- _ref$size = _ref.size,
116
- size = _ref$size === void 0 ? "medium" : _ref$size,
117
- _ref$tabIndex = _ref.tabIndex,
118
- tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
119
- var id = (0, _react.useState)((0, _uuid.v4)());
120
- var inputId = "input-".concat(id);
121
- var autosuggestId = "suggestions-".concat(id);
122
- var errorId = "error-".concat(id);
123
-
124
- var _useState = (0, _react.useState)(defaultValue),
125
- _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
126
- innerValue = _useState2[0],
127
- setInnerValue = _useState2[1];
128
-
129
- var _useState3 = (0, _react.useState)(false),
107
+ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
108
+ var label = _ref2.label,
109
+ _ref2$name = _ref2.name,
110
+ name = _ref2$name === void 0 ? "" : _ref2$name,
111
+ _ref2$defaultValue = _ref2.defaultValue,
112
+ defaultValue = _ref2$defaultValue === void 0 ? "" : _ref2$defaultValue,
113
+ value = _ref2.value,
114
+ helperText = _ref2.helperText,
115
+ _ref2$placeholder = _ref2.placeholder,
116
+ placeholder = _ref2$placeholder === void 0 ? "" : _ref2$placeholder,
117
+ action = _ref2.action,
118
+ _ref2$clearable = _ref2.clearable,
119
+ clearable = _ref2$clearable === void 0 ? false : _ref2$clearable,
120
+ _ref2$disabled = _ref2.disabled,
121
+ disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
122
+ _ref2$optional = _ref2.optional,
123
+ optional = _ref2$optional === void 0 ? false : _ref2$optional,
124
+ _ref2$prefix = _ref2.prefix,
125
+ prefix = _ref2$prefix === void 0 ? "" : _ref2$prefix,
126
+ _ref2$suffix = _ref2.suffix,
127
+ suffix = _ref2$suffix === void 0 ? "" : _ref2$suffix,
128
+ onChange = _ref2.onChange,
129
+ onBlur = _ref2.onBlur,
130
+ error = _ref2.error,
131
+ suggestions = _ref2.suggestions,
132
+ pattern = _ref2.pattern,
133
+ minLength = _ref2.minLength,
134
+ maxLength = _ref2.maxLength,
135
+ _ref2$autocomplete = _ref2.autocomplete,
136
+ autocomplete = _ref2$autocomplete === void 0 ? "off" : _ref2$autocomplete,
137
+ margin = _ref2.margin,
138
+ _ref2$size = _ref2.size,
139
+ size = _ref2$size === void 0 ? "medium" : _ref2$size,
140
+ _ref2$tabIndex = _ref2.tabIndex,
141
+ tabIndex = _ref2$tabIndex === void 0 ? 0 : _ref2$tabIndex;
142
+
143
+ var _useState = (0, _react.useState)("input-".concat((0, _uuid.v4)())),
144
+ _useState2 = (0, _slicedToArray2["default"])(_useState, 1),
145
+ inputId = _useState2[0];
146
+
147
+ var autosuggestId = "suggestions-".concat(inputId);
148
+ var errorId = "error-".concat(inputId);
149
+
150
+ var _useState3 = (0, _react.useState)(defaultValue),
130
151
  _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
131
- isOpen = _useState4[0],
132
- changeIsOpen = _useState4[1];
152
+ innerValue = _useState4[0],
153
+ setInnerValue = _useState4[1];
133
154
 
134
155
  var _useState5 = (0, _react.useState)(false),
135
156
  _useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
136
- isSearching = _useState6[0],
137
- changeIsSearching = _useState6[1];
157
+ isOpen = _useState6[0],
158
+ changeIsOpen = _useState6[1];
138
159
 
139
160
  var _useState7 = (0, _react.useState)(false),
140
161
  _useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
141
- isAutosuggestError = _useState8[0],
142
- changeIsAutosuggestError = _useState8[1];
162
+ isSearching = _useState8[0],
163
+ changeIsSearching = _useState8[1];
143
164
 
144
- var _useState9 = (0, _react.useState)([]),
165
+ var _useState9 = (0, _react.useState)(false),
145
166
  _useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
146
- filteredSuggestions = _useState10[0],
147
- changeFilteredSuggestions = _useState10[1];
167
+ isAutosuggestError = _useState10[0],
168
+ changeIsAutosuggestError = _useState10[1];
148
169
 
149
- var _useState11 = (0, _react.useState)(-1),
170
+ var _useState11 = (0, _react.useState)([]),
150
171
  _useState12 = (0, _slicedToArray2["default"])(_useState11, 2),
151
- visualFocusIndex = _useState12[0],
152
- changeVisualFocusIndex = _useState12[1];
172
+ filteredSuggestions = _useState12[0],
173
+ changeFilteredSuggestions = _useState12[1];
174
+
175
+ var _useState13 = (0, _react.useState)(-1),
176
+ _useState14 = (0, _slicedToArray2["default"])(_useState13, 2),
177
+ visualFocusIndex = _useState14[0],
178
+ changeVisualFocusIndex = _useState14[1];
153
179
 
154
- var inputContainerRef = (0, _react.useRef)(null);
155
180
  var inputRef = (0, _react.useRef)(null);
156
181
  var actionRef = (0, _react.useRef)(null);
157
182
  var colorsTheme = (0, _useTheme["default"])();
@@ -159,38 +184,23 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
159
184
  var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
160
185
  var numberInputContext = (0, _react.useContext)(_NumberInputContext["default"]);
161
186
 
162
- var isNotOptional = function isNotOptional(value) {
163
- return value === "" && !optional;
164
- };
165
-
166
- var isLengthIncorrect = function isLengthIncorrect(value) {
167
- return value && minLength && maxLength && (value.length < minLength || value.length > maxLength);
168
- };
169
-
170
- var isNumberIncorrect = function isNumberIncorrect(value) {
171
- return (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) && parseInt(value) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) && parseInt(value) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);
172
- };
173
-
174
- var isTextInputType = function isTextInputType() {
175
- var _inputRef$current, _inputRef$current2;
176
-
177
- 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";
178
- };
179
-
180
187
  var getNumberErrorMessage = function getNumberErrorMessage(value) {
181
188
  if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && parseInt(value) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) return translatedLabels.numberInput.valueGreaterThanOrEqualToErrorMessage(numberInputContext.minNumber);else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && parseInt(value) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) return translatedLabels.numberInput.valueLessThanOrEqualToErrorMessage(numberInputContext.maxNumber);
182
189
  };
183
190
 
184
- var hasSuggestions = function hasSuggestions() {
185
- return typeof suggestions === "function" || (suggestions === null || suggestions === void 0 ? void 0 : suggestions.length) > 0;
186
- };
191
+ var getTextInputWidth = (0, _react.useCallback)(function () {
192
+ var _inputRef$current, _inputRef$current$par;
193
+
194
+ var rect = inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : (_inputRef$current$par = _inputRef$current.parentElement) === null || _inputRef$current$par === void 0 ? void 0 : _inputRef$current$par.getBoundingClientRect();
195
+ return rect === null || rect === void 0 ? void 0 : rect.width;
196
+ }, []);
187
197
 
188
198
  var openSuggestions = function openSuggestions() {
189
- hasSuggestions() && changeIsOpen(true);
199
+ hasSuggestions(suggestions) && changeIsOpen(true);
190
200
  };
191
201
 
192
202
  var closeSuggestions = function closeSuggestions() {
193
- if (hasSuggestions()) {
203
+ if (hasSuggestions(suggestions)) {
194
204
  changeIsOpen(false);
195
205
  changeVisualFocusIndex(-1);
196
206
  }
@@ -199,16 +209,16 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
199
209
  var changeValue = function changeValue(newValue) {
200
210
  value !== null && value !== void 0 ? value : setInnerValue(newValue);
201
211
  var changedValue = typeof newValue === "number" ? newValue.toString() : newValue;
202
- if (isNotOptional(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
212
+ if (isNotOptional(newValue, optional)) onChange === null || onChange === void 0 ? void 0 : onChange({
203
213
  value: changedValue,
204
214
  error: translatedLabels.formFields.requiredValueErrorMessage
205
- });else if (isLengthIncorrect(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
215
+ });else if (isLengthIncorrect(newValue, minLength, maxLength)) onChange === null || onChange === void 0 ? void 0 : onChange({
206
216
  value: changedValue,
207
217
  error: translatedLabels.formFields.lengthErrorMessage(minLength, maxLength)
208
218
  });else if (patternMissmatch(pattern, newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
209
219
  value: changedValue,
210
220
  error: translatedLabels.formFields.formatRequestedErrorMessage
211
- });else if (isNumberIncorrect(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
221
+ });else if (isNumberIncorrect(newValue, numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber, numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) onChange === null || onChange === void 0 ? void 0 : onChange({
212
222
  value: changedValue,
213
223
  error: getNumberErrorMessage(newValue)
214
224
  });else onChange === null || onChange === void 0 ? void 0 : onChange({
@@ -225,23 +235,23 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
225
235
  document.activeElement === inputRef.current && event.preventDefault();
226
236
  };
227
237
 
228
- var handleIOnChange = function handleIOnChange(event) {
238
+ var handleInputOnChange = function handleInputOnChange(event) {
229
239
  openSuggestions();
230
240
  changeValue(event.target.value);
231
241
  };
232
242
 
233
- var handleIOnBlur = function handleIOnBlur(event) {
243
+ var handleInputOnBlur = function handleInputOnBlur(event) {
234
244
  closeSuggestions();
235
- if (isNotOptional(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
245
+ if (isNotOptional(event.target.value, optional)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
236
246
  value: event.target.value,
237
247
  error: translatedLabels.formFields.requiredValueErrorMessage
238
- });else if (isLengthIncorrect(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
248
+ });else if (isLengthIncorrect(event.target.value, minLength, maxLength)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
239
249
  value: event.target.value,
240
250
  error: translatedLabels.formFields.lengthErrorMessage(minLength, maxLength)
241
251
  });else if (patternMissmatch(pattern, event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
242
252
  value: event.target.value,
243
253
  error: translatedLabels.formFields.formatRequestedErrorMessage
244
- });else if (isNumberIncorrect(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
254
+ });else if (isNumberIncorrect(event.target.value, numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber, numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
245
255
  value: event.target.value,
246
256
  error: getNumberErrorMessage(event.target.value)
247
257
  });else onBlur === null || onBlur === void 0 ? void 0 : onBlur({
@@ -249,7 +259,7 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
249
259
  });
250
260
  };
251
261
 
252
- var handleIOnKeyDown = function handleIOnKeyDown(event) {
262
+ var handleInputOnKeyDown = function handleInputOnKeyDown(event) {
253
263
  switch (event.key) {
254
264
  case "Down":
255
265
  case "ArrowDown":
@@ -291,7 +301,7 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
291
301
  case "Escape":
292
302
  event.preventDefault();
293
303
 
294
- if (hasSuggestions()) {
304
+ if (hasSuggestions(suggestions)) {
295
305
  changeValue("");
296
306
  isOpen && closeSuggestions();
297
307
  }
@@ -299,7 +309,7 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
299
309
  break;
300
310
 
301
311
  case "Enter":
302
- if (hasSuggestions() && !isSearching) {
312
+ if (hasSuggestions(suggestions) && !isSearching) {
303
313
  var validFocusedSuggestion = filteredSuggestions.length > 0 && visualFocusIndex >= 0 && visualFocusIndex < filteredSuggestions.length;
304
314
  validFocusedSuggestion && changeValue(filteredSuggestions[visualFocusIndex]);
305
315
  isOpen && closeSuggestions();
@@ -326,12 +336,12 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
326
336
  };
327
337
 
328
338
  var setNumberProps = function setNumberProps(type, min, max, step) {
329
- var _inputRef$current3, _inputRef$current4, _inputRef$current5, _inputRef$current6;
339
+ var _inputRef$current2, _inputRef$current3, _inputRef$current4, _inputRef$current5;
330
340
 
331
- type && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.setAttribute("type", type));
332
- min && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.setAttribute("min", min));
333
- max && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 ? void 0 : _inputRef$current5.setAttribute("max", max));
334
- step && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current6 = inputRef.current) === null || _inputRef$current6 === void 0 ? void 0 : _inputRef$current6.setAttribute("step", step));
341
+ type && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.setAttribute("type", type));
342
+ min && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.setAttribute("min", min));
343
+ max && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.setAttribute("max", max));
344
+ step && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 ? void 0 : _inputRef$current5.setAttribute("step", step));
335
345
  };
336
346
 
337
347
  var decrementNumber = function decrementNumber() {
@@ -374,12 +384,6 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
374
384
  }
375
385
  };
376
386
 
377
- var getTextInputWidth = (0, _react.useCallback)(function () {
378
- var _inputContainerRef$cu;
379
-
380
- var rect = inputContainerRef === null || inputContainerRef === void 0 ? void 0 : (_inputContainerRef$cu = inputContainerRef.current) === null || _inputContainerRef$cu === void 0 ? void 0 : _inputContainerRef$cu.getBoundingClientRect();
381
- return rect === null || rect === void 0 ? void 0 : rect.width;
382
- }, []);
383
387
  (0, _react.useEffect)(function () {
384
388
  if (typeof suggestions === "function") {
385
389
  changeIsSearching(true);
@@ -422,29 +426,57 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
422
426
  }, label, " ", optional && /*#__PURE__*/_react["default"].createElement(OptionalLabel, null, translatedLabels.formFields.optionalLabel)), helperText && /*#__PURE__*/_react["default"].createElement(HelperText, {
423
427
  disabled: disabled,
424
428
  backgroundType: backgroundType
425
- }, helperText), /*#__PURE__*/_react["default"].createElement(Popover.Root, {
426
- open: isOpen && (filteredSuggestions.length > 0 || isSearching || isAutosuggestError)
427
- }, /*#__PURE__*/_react["default"].createElement(Popover.Trigger, {
428
- asChild: true
429
- }, /*#__PURE__*/_react["default"].createElement(InputContainer, {
429
+ }, helperText), /*#__PURE__*/_react["default"].createElement(InputContainer, {
430
430
  error: error ? true : false,
431
431
  disabled: disabled,
432
432
  backgroundType: backgroundType,
433
433
  onClick: handleInputContainerOnClick,
434
- onMouseDown: handleInputContainerOnMouseDown,
435
- ref: inputContainerRef
434
+ onMouseDown: handleInputContainerOnMouseDown
436
435
  }, prefix && /*#__PURE__*/_react["default"].createElement(Prefix, {
437
436
  disabled: disabled,
438
437
  backgroundType: backgroundType
439
- }, prefix), /*#__PURE__*/_react["default"].createElement(Input, {
438
+ }, prefix), /*#__PURE__*/_react["default"].createElement(AutosuggestWrapper, {
439
+ condition: hasSuggestions(suggestions),
440
+ wrapper: function wrapper(children) {
441
+ return /*#__PURE__*/_react["default"].createElement(Popover.Root, {
442
+ open: isOpen && (filteredSuggestions.length > 0 || isSearching || isAutosuggestError)
443
+ }, /*#__PURE__*/_react["default"].createElement(Popover.Trigger, {
444
+ asChild: true,
445
+ "aria-controls": undefined
446
+ }, children), /*#__PURE__*/_react["default"].createElement(Popover.Content, {
447
+ sideOffset: 5,
448
+ onOpenAutoFocus: function onOpenAutoFocus(event) {
449
+ // Avoid select to lose focus when the list is opened
450
+ event.preventDefault();
451
+ },
452
+ onCloseAutoFocus: function onCloseAutoFocus(event) {
453
+ // Avoid select to lose focus when the list is closed
454
+ event.preventDefault();
455
+ }
456
+ }, /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], {
457
+ id: autosuggestId,
458
+ value: value !== null && value !== void 0 ? value : innerValue,
459
+ suggestions: filteredSuggestions,
460
+ visualFocusIndex: visualFocusIndex,
461
+ highlightedSuggestions: typeof suggestions !== "function",
462
+ searchHasErrors: isAutosuggestError,
463
+ isSearching: isSearching,
464
+ suggestionOnClick: function suggestionOnClick(suggestion) {
465
+ changeValue(suggestion);
466
+ closeSuggestions();
467
+ },
468
+ getTextInputWidth: getTextInputWidth
469
+ })));
470
+ }
471
+ }, /*#__PURE__*/_react["default"].createElement(Input, {
440
472
  id: inputId,
441
473
  name: name,
442
474
  value: value !== null && value !== void 0 ? value : innerValue,
443
475
  placeholder: placeholder,
444
- onBlur: handleIOnBlur,
445
- onChange: handleIOnChange,
476
+ onBlur: handleInputOnBlur,
477
+ onChange: handleInputOnChange,
446
478
  onFocus: openSuggestions,
447
- onKeyDown: handleIOnKeyDown,
479
+ onKeyDown: handleInputOnKeyDown,
448
480
  onMouseDown: function onMouseDown(event) {
449
481
  event.stopPropagation();
450
482
  },
@@ -456,16 +488,17 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
456
488
  maxLength: maxLength,
457
489
  autoComplete: autocomplete === "off" ? "nope" : autocomplete,
458
490
  tabIndex: tabIndex,
459
- role: isTextInputType() && hasSuggestions() ? "combobox" : "textbox",
460
- "aria-autocomplete": isTextInputType() && hasSuggestions() ? "list" : undefined,
461
- "aria-controls": isTextInputType() && hasSuggestions() ? autosuggestId : undefined,
462
- "aria-disabled": disabled,
463
- "aria-expanded": isTextInputType() && hasSuggestions() ? isOpen : undefined,
464
- "aria-activedescendant": isTextInputType() && hasSuggestions() && isOpen && visualFocusIndex !== -1 ? "suggestion-".concat(visualFocusIndex) : undefined,
491
+ type: "text",
492
+ role: hasSuggestions(suggestions) ? "combobox" : undefined,
493
+ "aria-autocomplete": hasSuggestions(suggestions) ? "list" : undefined,
494
+ "aria-controls": hasSuggestions(suggestions) ? autosuggestId : undefined,
495
+ "aria-expanded": hasSuggestions(suggestions) ? isOpen : undefined,
496
+ "aria-haspopup": hasSuggestions(suggestions) ? "listbox" : undefined,
497
+ "aria-activedescendant": hasSuggestions(suggestions) && isOpen && visualFocusIndex !== -1 ? "suggestion-".concat(visualFocusIndex) : undefined,
465
498
  "aria-invalid": error ? true : false,
466
499
  "aria-errormessage": error ? errorId : undefined,
467
500
  "aria-required": optional ? false : true
468
- }), !disabled && error && /*#__PURE__*/_react["default"].createElement(ErrorIcon, {
501
+ })), !disabled && error && /*#__PURE__*/_react["default"].createElement(ErrorIcon, {
469
502
  backgroundType: backgroundType,
470
503
  "aria-label": "Error"
471
504
  }, _Icons["default"].error), !disabled && clearable && (value !== null && value !== void 0 ? value : innerValue).length > 0 && /*#__PURE__*/_react["default"].createElement(Action, {
@@ -476,7 +509,8 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
476
509
  backgroundType: backgroundType,
477
510
  tabIndex: tabIndex,
478
511
  title: translatedLabels.textInput.clearFieldActionTitle,
479
- "aria-label": translatedLabels.textInput.clearFieldActionTitle
512
+ "aria-label": translatedLabels.textInput.clearFieldActionTitle,
513
+ type: "button"
480
514
  }, _Icons["default"].clear), (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(Action, {
481
515
  ref: actionRef,
482
516
  disabled: disabled,
@@ -487,7 +521,8 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
487
521
  backgroundType: backgroundType,
488
522
  tabIndex: tabIndex,
489
523
  title: translatedLabels.numberInput.decrementValueTitle,
490
- "aria-label": translatedLabels.numberInput.decrementValueTitle
524
+ "aria-label": translatedLabels.numberInput.decrementValueTitle,
525
+ type: "button"
491
526
  }, _Icons["default"].decrement), /*#__PURE__*/_react["default"].createElement(Action, {
492
527
  ref: actionRef,
493
528
  disabled: disabled,
@@ -498,7 +533,8 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
498
533
  backgroundType: backgroundType,
499
534
  tabIndex: tabIndex,
500
535
  title: translatedLabels.numberInput.incrementValueTitle,
501
- "aria-label": translatedLabels.numberInput.incrementValueTitle
536
+ "aria-label": translatedLabels.numberInput.incrementValueTitle,
537
+ type: "button"
502
538
  }, _Icons["default"].increment)), action && /*#__PURE__*/_react["default"].createElement(Action, {
503
539
  ref: actionRef,
504
540
  disabled: disabled,
@@ -509,36 +545,14 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
509
545
  title: action.title,
510
546
  "aria-label": action.title,
511
547
  backgroundType: backgroundType,
512
- tabIndex: tabIndex
513
- }, typeof action.icon === "string" ? /*#__PURE__*/_react["default"].createElement(ActionIcon, {
548
+ tabIndex: tabIndex,
549
+ type: "button"
550
+ }, typeof action.icon === "string" ? /*#__PURE__*/_react["default"].createElement("img", {
514
551
  src: action.icon
515
552
  }) : action.icon), suffix && /*#__PURE__*/_react["default"].createElement(Suffix, {
516
553
  disabled: disabled,
517
554
  backgroundType: backgroundType
518
- }, suffix))), /*#__PURE__*/_react["default"].createElement(Popover.Content, {
519
- sideOffset: 4,
520
- onOpenAutoFocus: function onOpenAutoFocus(event) {
521
- // Avoid select to lose focus when the list is opened
522
- event.preventDefault();
523
- },
524
- onCloseAutoFocus: function onCloseAutoFocus(event) {
525
- // Avoid select to lose focus when the list is closed
526
- event.preventDefault();
527
- }
528
- }, /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], {
529
- id: autosuggestId,
530
- value: value !== null && value !== void 0 ? value : innerValue,
531
- suggestions: filteredSuggestions,
532
- visualFocusIndex: visualFocusIndex,
533
- highlightedSuggestions: typeof suggestions !== "function",
534
- searchHasErrors: isAutosuggestError,
535
- isSearching: isSearching,
536
- suggestionOnClick: function suggestionOnClick(suggestion) {
537
- changeValue(suggestion);
538
- closeSuggestions();
539
- },
540
- getTextInputWidth: getTextInputWidth
541
- }))), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
555
+ }, suffix)), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
542
556
  id: errorId,
543
557
  backgroundType: backgroundType,
544
558
  "aria-live": error ? "assertive" : "off"
@@ -602,7 +616,7 @@ var InputContainer = _styledComponents["default"].div(_templateObject5 || (_temp
602
616
  }, function (props) {
603
617
  return props.disabled && "cursor: not-allowed;";
604
618
  }, function (props) {
605
- return !props.disabled && "\n &:hover {\n border-color: ".concat(props.error ? "transparent" : props.backgroundType === "dark" ? props.theme.hoverBorderColorOnDark : props.theme.hoverBorderColor, ";\n ").concat(props.error && "box-shadow: 0 0 0 2px ".concat(props.backgroundType === "dark" ? props.theme.hoverErrorBorderColorOnDark : props.theme.hoverErrorBorderColor, ";"), "\n }\n &:focus-within {\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(props.backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor, ";\n }\n ");
619
+ return !props.disabled && "\n &:hover {\n border-color: ".concat(props.error ? "transparent" : props.backgroundType === "dark" ? props.theme.hoverBorderColorOnDark : props.theme.hoverBorderColor, ";\n ").concat(props.error ? "box-shadow: 0 0 0 2px ".concat(props.backgroundType === "dark" ? props.theme.hoverErrorBorderColorOnDark : props.theme.hoverErrorBorderColor, ";") : "", "\n }\n &:focus-within {\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(props.backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor, ";\n }\n ");
606
620
  });
607
621
 
608
622
  var Input = _styledComponents["default"].input(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n height: calc(2.5rem - 2px);\n width: 100%;\n background: none;\n border: none;\n outline: none;\n padding: 0 0.5rem;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5em;\n ", "\n\n ::placeholder {\n color: ", ";\n }\n"])), function (props) {
@@ -621,11 +635,7 @@ var Input = _styledComponents["default"].input(_templateObject6 || (_templateObj
621
635
  return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPlaceholderFontColorOnDark : props.theme.disabledPlaceholderFontColor : props.backgroundType === "dark" ? props.theme.placeholderFontColorOnDark : props.theme.placeholderFontColor;
622
636
  });
623
637
 
624
- var ActionIcon = _styledComponents["default"].img(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n width: 16px;\n height: 16px;\n"])));
625
-
626
- var Action = _styledComponents["default"].button(_templateObject8 || (_templateObject8 = (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: 2px;\n padding: 3px;\n margin-left: 0.25rem;\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"])), function (props) {
627
- return props.theme.fontFamily;
628
- }, function (props) {
638
+ var Action = _styledComponents["default"].button(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n border: 1px solid transparent;\n border-radius: 2px;\n width: 24px;\n height: 24px;\n padding: 3px;\n margin-left: 0.25rem;\n ", "\n\n box-shadow: 0 0 0 2px transparent;\n background-color: ", ";\n\n color: ", ";\n\n ", "\n\n img, svg {\n width: 16px;\n height: 16px;\n }\n"])), function (props) {
629
639
  return props.disabled ? "cursor: not-allowed;" : "cursor: pointer;";
630
640
  }, function (props) {
631
641
  return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionBackgroundColorOnDark : props.theme.disabledActionBackgroundColor : props.backgroundType === "dark" ? props.theme.actionBackgroundColorOnDark : props.theme.actionBackgroundColor;
@@ -635,25 +645,25 @@ var Action = _styledComponents["default"].button(_templateObject8 || (_templateO
635
645
  return !props.disabled && "\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 &: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 &: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 ");
636
646
  });
637
647
 
638
- var Prefix = _styledComponents["default"].span(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n line-height: 1.5rem;\n margin-left: 0.25rem;\n padding: 0 0.5rem 0 0;\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"])), function (props) {
648
+ var Prefix = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n line-height: 1.5rem;\n margin-left: 0.25rem;\n padding: 0 0.5rem 0 0;\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"])), function (props) {
639
649
  var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPrefixColorOnDark : props.theme.disabledPrefixColor : props.backgroundType === "dark" ? props.theme.prefixColorOnDark : props.theme.prefixColor;
640
650
  return "color: ".concat(color, "; border-right: 1px solid ").concat(color, ";");
641
651
  }, function (props) {
642
652
  return props.theme.fontFamily;
643
653
  });
644
654
 
645
- var Suffix = _styledComponents["default"].span(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n line-height: 1.5rem;\n margin: 0 0.25rem;\n padding: 0 0 0 0.5rem;\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"])), function (props) {
655
+ var Suffix = _styledComponents["default"].span(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n line-height: 1.5rem;\n margin: 0 0.25rem;\n padding: 0 0 0 0.5rem;\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"])), function (props) {
646
656
  var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledSuffixColorOnDark : props.theme.disabledSuffixColor : props.backgroundType === "dark" ? props.theme.suffixColorOnDark : props.theme.suffixColor;
647
657
  return "color: ".concat(color, "; border-left: 1px solid ").concat(color, ";");
648
658
  }, function (props) {
649
659
  return props.theme.fontFamily;
650
660
  });
651
661
 
652
- var ErrorIcon = _styledComponents["default"].span(_templateObject11 || (_templateObject11 = (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: 0.25rem;\n color: ", ";\n\n svg {\n line-height: 18px;\n font-size: 1.25rem;\n }\n"])), function (props) {
662
+ var ErrorIcon = _styledComponents["default"].span(_templateObject10 || (_templateObject10 = (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: 0.25rem;\n color: ", ";\n\n svg {\n line-height: 18px;\n font-size: 1.25rem;\n }\n"])), function (props) {
653
663
  return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
654
664
  });
655
665
 
656
- var Error = _styledComponents["default"].span(_templateObject12 || (_templateObject12 = (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 margin-top: 0.25rem;\n"])), function (props) {
666
+ var Error = _styledComponents["default"].span(_templateObject11 || (_templateObject11 = (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 margin-top: 0.25rem;\n"])), function (props) {
657
667
  return props.backgroundType === "dark" ? props.theme.errorMessageColorOnDark : props.theme.errorMessageColor;
658
668
  }, function (props) {
659
669
  return props.theme.fontFamily;
@@ -27,7 +27,7 @@ const action = {
27
27
  ),
28
28
  };
29
29
 
30
- const actionLargeIcon = {
30
+ const actionLargeIconSVG = {
31
31
  onClick: () => {},
32
32
  icon: (
33
33
  <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 0 24 24" width="48px" fill="currentColor">
@@ -37,6 +37,11 @@ const actionLargeIcon = {
37
37
  ),
38
38
  };
39
39
 
40
+ const actionLargeIconURL = {
41
+ onClick: () => {},
42
+ icon: "https://iconape.com/wp-content/files/yd/367773/svg/logo-linkedin-logo-icon-png-svg.png",
43
+ };
44
+
40
45
  const country = ["Afghanistan"];
41
46
  const countries = [
42
47
  "Afghanistan",
@@ -61,6 +66,7 @@ const countries = [
61
66
  "Dominica",
62
67
  "Denmark",
63
68
  "Djibouti",
69
+ "*",
64
70
  ];
65
71
 
66
72
  export const Chromatic = () => (
@@ -98,12 +104,21 @@ export const Chromatic = () => (
98
104
  <DxcTextInput label="Text input" clearable defaultValue="Text" helperText="Help message" optional />
99
105
  </ExampleContainer>
100
106
  <ExampleContainer>
101
- <Title title="Clearable and large icon action" theme="light" level={4} />
107
+ <Title title="Clearable and large icon action (SVG)" theme="light" level={4} />
102
108
  <DxcTextInput
103
109
  label="Text input"
104
110
  defaultValue="Text text text text text text text text text text"
105
111
  clearable
106
- action={actionLargeIcon}
112
+ action={actionLargeIconSVG}
113
+ />
114
+ </ExampleContainer>
115
+ <ExampleContainer>
116
+ <Title title="Clearable and large icon action (URL)" theme="light" level={4} />
117
+ <DxcTextInput
118
+ label="Text input"
119
+ defaultValue="Text text text text text text text text text text"
120
+ clearable
121
+ action={actionLargeIconURL}
107
122
  />
108
123
  </ExampleContainer>
109
124
  <ExampleContainer>
@@ -308,7 +323,11 @@ const AutosuggestListbox = () => {
308
323
  <ExampleContainer>
309
324
  <Title title="Autosuggest listbox" theme="light" level={2} />
310
325
  <ExampleContainer>
311
- <Title title="List dialog uses a Radix Popover to appear over elements with a certain z-index" theme="light" level={3} />
326
+ <Title
327
+ title="List dialog uses a Radix Popover to appear over elements with a certain z-index"
328
+ theme="light"
329
+ level={3}
330
+ />
312
331
  <div
313
332
  style={{
314
333
  display: "flex",
@@ -322,6 +341,7 @@ const AutosuggestListbox = () => {
322
341
  borderRadius: "4px",
323
342
  overflow: "auto",
324
343
  zIndex: "1300",
344
+ position: "relative",
325
345
  }}
326
346
  >
327
347
  <DxcTextInput