@dxc-technology/halstack-react 0.0.0-22220e6 → 0.0.0-2289057

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 (342) hide show
  1. package/BackgroundColorContext.d.ts +1 -10
  2. package/BackgroundColorContext.js +5 -22
  3. package/HalstackContext.d.ts +1249 -0
  4. package/HalstackContext.js +310 -0
  5. package/README.md +47 -0
  6. package/accordion/Accordion.d.ts +1 -1
  7. package/accordion/Accordion.js +116 -181
  8. package/accordion/Accordion.stories.tsx +103 -127
  9. package/accordion/Accordion.test.js +32 -33
  10. package/accordion/types.d.ts +9 -16
  11. package/accordion-group/AccordionGroup.d.ts +5 -4
  12. package/accordion-group/AccordionGroup.js +38 -107
  13. package/accordion-group/AccordionGroup.stories.tsx +95 -68
  14. package/accordion-group/AccordionGroup.test.js +55 -90
  15. package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
  16. package/accordion-group/AccordionGroupAccordion.js +31 -0
  17. package/accordion-group/types.d.ts +15 -16
  18. package/action-icon/ActionIcon.d.ts +4 -0
  19. package/action-icon/ActionIcon.js +47 -0
  20. package/action-icon/ActionIcon.stories.tsx +41 -0
  21. package/action-icon/ActionIcon.test.js +64 -0
  22. package/action-icon/types.d.ts +26 -0
  23. package/alert/Alert.js +23 -59
  24. package/alert/Alert.stories.tsx +28 -0
  25. package/alert/Alert.test.js +29 -46
  26. package/alert/types.d.ts +5 -5
  27. package/badge/Badge.d.ts +1 -1
  28. package/badge/Badge.js +141 -41
  29. package/badge/Badge.stories.tsx +210 -0
  30. package/badge/Badge.test.js +30 -0
  31. package/badge/types.d.ts +52 -2
  32. package/bleed/Bleed.js +14 -55
  33. package/bleed/Bleed.stories.tsx +95 -95
  34. package/bleed/types.d.ts +26 -2
  35. package/box/Box.d.ts +1 -1
  36. package/box/Box.js +30 -81
  37. package/box/Box.stories.tsx +38 -51
  38. package/box/Box.test.js +2 -7
  39. package/box/types.d.ts +3 -14
  40. package/bulleted-list/BulletedList.d.ts +7 -0
  41. package/bulleted-list/BulletedList.js +89 -0
  42. package/bulleted-list/BulletedList.stories.tsx +115 -0
  43. package/bulleted-list/types.d.ts +38 -0
  44. package/button/Button.d.ts +1 -1
  45. package/button/Button.js +62 -113
  46. package/button/Button.stories.tsx +160 -90
  47. package/button/Button.test.js +20 -17
  48. package/button/types.d.ts +12 -8
  49. package/card/Card.d.ts +1 -1
  50. package/card/Card.js +58 -102
  51. package/card/Card.stories.tsx +12 -42
  52. package/card/Card.test.js +11 -22
  53. package/card/types.d.ts +6 -11
  54. package/checkbox/Checkbox.d.ts +2 -2
  55. package/checkbox/Checkbox.js +144 -182
  56. package/checkbox/Checkbox.stories.tsx +166 -136
  57. package/checkbox/Checkbox.test.js +163 -29
  58. package/checkbox/types.d.ts +18 -6
  59. package/chip/Chip.js +39 -79
  60. package/chip/Chip.stories.tsx +121 -26
  61. package/chip/Chip.test.js +16 -31
  62. package/chip/types.d.ts +4 -4
  63. package/common/OpenSans.css +68 -80
  64. package/common/coreTokens.d.ts +237 -0
  65. package/common/coreTokens.js +184 -0
  66. package/common/utils.d.ts +1 -0
  67. package/common/utils.js +6 -12
  68. package/common/variables.d.ts +1395 -0
  69. package/common/variables.js +1030 -1136
  70. package/container/Container.d.ts +4 -0
  71. package/container/Container.js +194 -0
  72. package/container/Container.stories.tsx +214 -0
  73. package/container/types.d.ts +74 -0
  74. package/contextual-menu/ContextualMenu.d.ts +7 -0
  75. package/contextual-menu/ContextualMenu.js +71 -0
  76. package/contextual-menu/ContextualMenu.stories.tsx +182 -0
  77. package/contextual-menu/ContextualMenu.test.js +71 -0
  78. package/contextual-menu/MenuItemAction.d.ts +4 -0
  79. package/contextual-menu/MenuItemAction.js +46 -0
  80. package/contextual-menu/types.d.ts +22 -0
  81. package/date-input/Calendar.d.ts +4 -0
  82. package/date-input/Calendar.js +214 -0
  83. package/date-input/DateInput.js +171 -306
  84. package/date-input/DateInput.stories.tsx +203 -56
  85. package/date-input/DateInput.test.js +708 -369
  86. package/date-input/DatePicker.d.ts +4 -0
  87. package/date-input/DatePicker.js +115 -0
  88. package/date-input/Icons.d.ts +6 -0
  89. package/date-input/Icons.js +58 -0
  90. package/date-input/YearPicker.d.ts +4 -0
  91. package/date-input/YearPicker.js +100 -0
  92. package/date-input/types.d.ts +86 -22
  93. package/dialog/Dialog.d.ts +1 -1
  94. package/dialog/Dialog.js +68 -130
  95. package/dialog/Dialog.stories.tsx +320 -167
  96. package/dialog/Dialog.test.js +287 -20
  97. package/dialog/types.d.ts +18 -25
  98. package/dropdown/Dropdown.d.ts +1 -1
  99. package/dropdown/Dropdown.js +248 -307
  100. package/dropdown/Dropdown.stories.tsx +245 -56
  101. package/dropdown/Dropdown.test.js +575 -165
  102. package/dropdown/DropdownMenu.d.ts +4 -0
  103. package/dropdown/DropdownMenu.js +63 -0
  104. package/dropdown/DropdownMenuItem.d.ts +4 -0
  105. package/dropdown/DropdownMenuItem.js +67 -0
  106. package/dropdown/types.d.ts +32 -14
  107. package/file-input/FileInput.d.ts +2 -2
  108. package/file-input/FileInput.js +246 -357
  109. package/file-input/FileInput.stories.tsx +123 -12
  110. package/file-input/FileInput.test.js +369 -367
  111. package/file-input/FileItem.d.ts +4 -14
  112. package/file-input/FileItem.js +50 -99
  113. package/file-input/types.d.ts +25 -8
  114. package/flex/Flex.d.ts +4 -0
  115. package/flex/Flex.js +57 -0
  116. package/flex/Flex.stories.tsx +112 -0
  117. package/flex/types.d.ts +97 -0
  118. package/footer/Footer.d.ts +1 -1
  119. package/footer/Footer.js +70 -190
  120. package/footer/Footer.stories.tsx +60 -19
  121. package/footer/Footer.test.js +33 -57
  122. package/footer/Icons.d.ts +3 -2
  123. package/footer/Icons.js +67 -8
  124. package/footer/types.d.ts +25 -26
  125. package/grid/Grid.d.ts +7 -0
  126. package/grid/Grid.js +76 -0
  127. package/grid/Grid.stories.tsx +219 -0
  128. package/grid/types.d.ts +115 -0
  129. package/header/Header.d.ts +4 -3
  130. package/header/Header.js +99 -203
  131. package/header/Header.stories.tsx +152 -63
  132. package/header/Header.test.js +31 -28
  133. package/header/Icons.d.ts +2 -2
  134. package/header/Icons.js +4 -9
  135. package/header/types.d.ts +5 -19
  136. package/heading/Heading.js +10 -32
  137. package/heading/Heading.test.js +71 -88
  138. package/heading/types.d.ts +7 -7
  139. package/image/Image.d.ts +4 -0
  140. package/image/Image.js +70 -0
  141. package/image/Image.stories.tsx +129 -0
  142. package/image/types.d.ts +72 -0
  143. package/image/types.js +5 -0
  144. package/inset/Inset.js +14 -55
  145. package/inset/Inset.stories.tsx +37 -36
  146. package/inset/types.d.ts +26 -2
  147. package/layout/ApplicationLayout.d.ts +16 -6
  148. package/layout/ApplicationLayout.js +84 -181
  149. package/layout/ApplicationLayout.stories.tsx +85 -94
  150. package/layout/Icons.d.ts +8 -0
  151. package/layout/Icons.js +51 -48
  152. package/layout/SidenavContext.d.ts +5 -0
  153. package/layout/SidenavContext.js +13 -0
  154. package/layout/types.d.ts +19 -35
  155. package/link/Link.d.ts +3 -2
  156. package/link/Link.js +61 -99
  157. package/link/Link.stories.tsx +155 -53
  158. package/link/Link.test.js +25 -53
  159. package/link/types.d.ts +15 -31
  160. package/main.d.ts +15 -13
  161. package/main.js +72 -101
  162. package/nav-tabs/NavTabs.d.ts +8 -0
  163. package/nav-tabs/NavTabs.js +93 -0
  164. package/nav-tabs/NavTabs.stories.tsx +276 -0
  165. package/nav-tabs/NavTabs.test.js +76 -0
  166. package/nav-tabs/Tab.d.ts +4 -0
  167. package/nav-tabs/Tab.js +118 -0
  168. package/nav-tabs/types.d.ts +52 -0
  169. package/nav-tabs/types.js +5 -0
  170. package/number-input/NumberInput.d.ts +7 -0
  171. package/number-input/NumberInput.js +48 -45
  172. package/number-input/NumberInput.stories.tsx +44 -28
  173. package/number-input/NumberInput.test.js +862 -381
  174. package/number-input/types.d.ts +28 -15
  175. package/package.json +46 -47
  176. package/paginator/Icons.d.ts +5 -0
  177. package/paginator/Icons.js +21 -47
  178. package/paginator/Paginator.js +34 -91
  179. package/paginator/Paginator.stories.tsx +24 -0
  180. package/paginator/Paginator.test.js +280 -211
  181. package/paginator/types.d.ts +3 -3
  182. package/paragraph/Paragraph.d.ts +5 -0
  183. package/paragraph/Paragraph.js +22 -0
  184. package/paragraph/Paragraph.stories.tsx +27 -0
  185. package/password-input/Icons.d.ts +6 -0
  186. package/password-input/Icons.js +35 -0
  187. package/password-input/PasswordInput.js +57 -123
  188. package/password-input/PasswordInput.stories.tsx +1 -33
  189. package/password-input/PasswordInput.test.js +162 -147
  190. package/password-input/types.d.ts +21 -17
  191. package/progress-bar/ProgressBar.js +65 -91
  192. package/progress-bar/ProgressBar.stories.tsx +93 -0
  193. package/progress-bar/ProgressBar.test.js +72 -44
  194. package/progress-bar/types.d.ts +3 -3
  195. package/quick-nav/QuickNav.d.ts +4 -0
  196. package/quick-nav/QuickNav.js +94 -0
  197. package/quick-nav/QuickNav.stories.tsx +356 -0
  198. package/quick-nav/types.d.ts +21 -0
  199. package/quick-nav/types.js +5 -0
  200. package/radio-group/Radio.d.ts +1 -1
  201. package/radio-group/Radio.js +59 -76
  202. package/radio-group/RadioGroup.js +72 -116
  203. package/radio-group/RadioGroup.stories.tsx +135 -17
  204. package/radio-group/RadioGroup.test.js +529 -467
  205. package/radio-group/types.d.ts +86 -9
  206. package/resultset-table/Icons.d.ts +7 -0
  207. package/resultset-table/Icons.js +47 -0
  208. package/resultset-table/ResultsetTable.d.ts +7 -0
  209. package/resultset-table/ResultsetTable.js +166 -0
  210. package/{resultsetTable → resultset-table}/ResultsetTable.stories.tsx +152 -30
  211. package/resultset-table/ResultsetTable.test.js +371 -0
  212. package/{resultsetTable → resultset-table}/types.d.ts +13 -7
  213. package/resultset-table/types.js +5 -0
  214. package/select/Icons.d.ts +7 -7
  215. package/select/Icons.js +1 -5
  216. package/select/Listbox.d.ts +4 -0
  217. package/select/Listbox.js +143 -0
  218. package/select/Option.js +27 -50
  219. package/select/Select.js +212 -362
  220. package/select/Select.stories.tsx +534 -145
  221. package/select/Select.test.js +2009 -1539
  222. package/select/types.d.ts +53 -27
  223. package/sidenav/Icons.d.ts +7 -0
  224. package/sidenav/Icons.js +47 -0
  225. package/sidenav/Sidenav.d.ts +6 -5
  226. package/sidenav/Sidenav.js +131 -71
  227. package/sidenav/Sidenav.stories.tsx +251 -151
  228. package/sidenav/Sidenav.test.js +26 -45
  229. package/sidenav/types.d.ts +52 -26
  230. package/slider/Slider.d.ts +2 -2
  231. package/slider/Slider.js +148 -180
  232. package/slider/Slider.test.js +198 -73
  233. package/slider/types.d.ts +11 -3
  234. package/spinner/Spinner.js +31 -75
  235. package/spinner/{Spinner.stories.jsx → Spinner.stories.tsx} +53 -27
  236. package/spinner/Spinner.test.js +26 -35
  237. package/spinner/types.d.ts +3 -3
  238. package/status-light/StatusLight.d.ts +4 -0
  239. package/status-light/StatusLight.js +51 -0
  240. package/status-light/StatusLight.stories.tsx +74 -0
  241. package/status-light/StatusLight.test.js +25 -0
  242. package/status-light/types.d.ts +17 -0
  243. package/status-light/types.js +5 -0
  244. package/switch/Switch.d.ts +2 -2
  245. package/switch/Switch.js +149 -114
  246. package/switch/Switch.stories.tsx +44 -67
  247. package/switch/Switch.test.js +146 -39
  248. package/switch/types.d.ts +13 -5
  249. package/table/DropdownTheme.js +62 -0
  250. package/table/Table.d.ts +6 -2
  251. package/table/Table.js +87 -35
  252. package/table/Table.stories.tsx +658 -0
  253. package/table/Table.test.js +95 -8
  254. package/table/types.d.ts +48 -6
  255. package/tabs/Tab.d.ts +4 -0
  256. package/tabs/Tab.js +116 -0
  257. package/tabs/Tabs.d.ts +1 -1
  258. package/tabs/Tabs.js +316 -145
  259. package/tabs/Tabs.stories.tsx +120 -14
  260. package/tabs/Tabs.test.js +238 -67
  261. package/tabs/types.d.ts +29 -15
  262. package/tag/Tag.js +41 -78
  263. package/tag/Tag.stories.tsx +25 -8
  264. package/tag/Tag.test.js +20 -31
  265. package/tag/types.d.ts +7 -7
  266. package/text-input/Icons.d.ts +8 -0
  267. package/text-input/Icons.js +56 -0
  268. package/text-input/Suggestion.d.ts +4 -0
  269. package/text-input/Suggestion.js +67 -0
  270. package/text-input/Suggestions.d.ts +4 -0
  271. package/text-input/Suggestions.js +84 -0
  272. package/text-input/TextInput.js +325 -556
  273. package/text-input/TextInput.stories.tsx +272 -281
  274. package/text-input/TextInput.test.js +1442 -1377
  275. package/text-input/types.d.ts +70 -24
  276. package/textarea/Textarea.js +82 -134
  277. package/textarea/Textarea.stories.tsx +174 -0
  278. package/textarea/Textarea.test.js +168 -198
  279. package/textarea/types.d.ts +27 -16
  280. package/toggle-group/ToggleGroup.d.ts +2 -2
  281. package/toggle-group/ToggleGroup.js +92 -105
  282. package/toggle-group/ToggleGroup.stories.tsx +53 -8
  283. package/toggle-group/ToggleGroup.test.js +78 -66
  284. package/toggle-group/types.d.ts +34 -17
  285. package/typography/Typography.d.ts +4 -0
  286. package/typography/Typography.js +23 -0
  287. package/typography/Typography.stories.tsx +198 -0
  288. package/typography/types.d.ts +18 -0
  289. package/typography/types.js +5 -0
  290. package/useTheme.d.ts +1147 -1
  291. package/useTheme.js +4 -11
  292. package/useTranslatedLabels.d.ts +85 -0
  293. package/useTranslatedLabels.js +14 -0
  294. package/utils/BaseTypography.d.ts +21 -0
  295. package/utils/BaseTypography.js +94 -0
  296. package/utils/FocusLock.d.ts +13 -0
  297. package/utils/FocusLock.js +124 -0
  298. package/wizard/Wizard.d.ts +1 -1
  299. package/wizard/Wizard.js +70 -101
  300. package/wizard/Wizard.stories.tsx +48 -19
  301. package/wizard/Wizard.test.js +73 -87
  302. package/wizard/types.d.ts +12 -8
  303. package/ThemeContext.d.ts +0 -10
  304. package/ThemeContext.js +0 -243
  305. package/card/ice-cream.jpg +0 -0
  306. package/common/RequiredComponent.js +0 -32
  307. package/list/List.d.ts +0 -4
  308. package/list/List.js +0 -47
  309. package/list/List.stories.tsx +0 -95
  310. package/list/types.d.ts +0 -7
  311. package/number-input/NumberInputContext.d.ts +0 -4
  312. package/number-input/NumberInputContext.js +0 -19
  313. package/number-input/numberInputContextTypes.d.ts +0 -19
  314. package/progress-bar/ProgressBar.stories.jsx +0 -58
  315. package/radio/Radio.d.ts +0 -4
  316. package/radio/Radio.js +0 -174
  317. package/radio/Radio.stories.tsx +0 -192
  318. package/radio/Radio.test.js +0 -71
  319. package/radio/types.d.ts +0 -54
  320. package/resultsetTable/ResultsetTable.d.ts +0 -4
  321. package/resultsetTable/ResultsetTable.js +0 -254
  322. package/resultsetTable/ResultsetTable.test.js +0 -306
  323. package/row/Row.d.ts +0 -3
  324. package/row/Row.js +0 -127
  325. package/row/Row.stories.tsx +0 -237
  326. package/row/types.d.ts +0 -10
  327. package/slider/Slider.stories.tsx +0 -177
  328. package/stack/Stack.d.ts +0 -3
  329. package/stack/Stack.js +0 -97
  330. package/stack/Stack.stories.tsx +0 -164
  331. package/stack/types.d.ts +0 -9
  332. package/table/Table.stories.jsx +0 -277
  333. package/text/Text.d.ts +0 -7
  334. package/text/Text.js +0 -30
  335. package/text/Text.stories.tsx +0 -19
  336. package/textarea/Textarea.stories.jsx +0 -157
  337. /package/{list → action-icon}/types.js +0 -0
  338. /package/{radio → bulleted-list}/types.js +0 -0
  339. /package/{resultsetTable → container}/types.js +0 -0
  340. /package/{row → contextual-menu}/types.js +0 -0
  341. /package/{stack → flex}/types.js +0 -0
  342. /package/{number-input/numberInputContextTypes.js → grid/types.js} +0 -0
@@ -1,90 +1,45 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  var _typeof3 = require("@babel/runtime/helpers/typeof");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
8
  exports["default"] = void 0;
11
-
12
9
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
13
-
14
10
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
-
16
11
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
17
-
18
12
  var _react = _interopRequireWildcard(require("react"));
19
-
20
13
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
21
-
22
14
  var _useTheme = _interopRequireDefault(require("../useTheme"));
23
-
24
- var _variables = require("../common/variables.js");
25
-
26
- var _utils = require("../common/utils.js");
27
-
15
+ var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
16
+ var _variables = require("../common/variables");
17
+ var _utils = require("../common/utils");
18
+ var _NumberInput = require("../number-input/NumberInput");
19
+ var _Suggestions = _interopRequireDefault(require("./Suggestions"));
20
+ var Popover = _interopRequireWildcard(require("@radix-ui/react-popover"));
21
+ var _Icons = _interopRequireDefault(require("./Icons"));
28
22
  var _uuid = require("uuid");
29
-
30
- var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
31
-
32
- var _NumberInputContext = _interopRequireDefault(require("../number-input/NumberInputContext"));
33
-
34
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18;
35
-
36
- 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); }
37
-
38
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
-
40
- var textInputIcons = {
41
- error: /*#__PURE__*/_react["default"].createElement("svg", {
42
- xmlns: "http://www.w3.org/2000/svg",
43
- height: "24px",
44
- viewBox: "0 0 24 24",
45
- width: "24px",
46
- fill: "currentColor"
47
- }, /*#__PURE__*/_react["default"].createElement("path", {
48
- d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"
49
- })),
50
- clear: /*#__PURE__*/_react["default"].createElement("svg", {
51
- xmlns: "http://www.w3.org/2000/svg",
52
- width: "24",
53
- height: "24",
54
- viewBox: "0 0 24 24",
55
- fill: "currentColor"
56
- }, /*#__PURE__*/_react["default"].createElement("path", {
57
- d: "M0 0h24v24H0V0z",
58
- fill: "none"
59
- }), /*#__PURE__*/_react["default"].createElement("path", {
60
- d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
61
- })),
62
- increment: /*#__PURE__*/_react["default"].createElement("svg", {
63
- xmlns: "http://www.w3.org/2000/svg",
64
- height: "24px",
65
- viewBox: "0 0 24 24",
66
- width: "24px",
67
- fill: "currentColor"
68
- }, /*#__PURE__*/_react["default"].createElement("path", {
69
- d: "M0 0h24v24H0z",
70
- fill: "none"
71
- }), /*#__PURE__*/_react["default"].createElement("path", {
72
- d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
73
- })),
74
- decrement: /*#__PURE__*/_react["default"].createElement("svg", {
75
- xmlns: "http://www.w3.org/2000/svg",
76
- height: "24px",
77
- viewBox: "0 0 24 24",
78
- width: "24px",
79
- fill: "currentColor"
80
- }, /*#__PURE__*/_react["default"].createElement("path", {
81
- d: "M0 0h24v24H0z",
82
- fill: "none"
83
- }), /*#__PURE__*/_react["default"].createElement("path", {
84
- d: "M19 13H5v-2h14v2z"
85
- }))
23
+ var _ActionIcon = _interopRequireDefault(require("../action-icon/ActionIcon"));
24
+ var _Flex = _interopRequireDefault(require("../flex/Flex"));
25
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
26
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
27
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
28
+ var sizes = {
29
+ small: "240px",
30
+ medium: "360px",
31
+ large: "480px",
32
+ fillParent: "100%"
33
+ };
34
+ var AutosuggestWrapper = function AutosuggestWrapper(_ref) {
35
+ var condition = _ref.condition,
36
+ wrapper = _ref.wrapper,
37
+ children = _ref.children;
38
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, condition ? wrapper(children) : children);
39
+ };
40
+ var calculateWidth = function calculateWidth(margin, size) {
41
+ return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
86
42
  };
87
-
88
43
  var makeCancelable = function makeCancelable(promise) {
89
44
  var hasCanceled_ = false;
90
45
  var wrappedPromise = new Promise(function (resolve, reject) {
@@ -105,341 +60,264 @@ var makeCancelable = function makeCancelable(promise) {
105
60
  }
106
61
  };
107
62
  };
108
-
109
- var getNotOptionalErrorMessage = function getNotOptionalErrorMessage() {
110
- return "This field is required. Please, enter a value.";
63
+ var hasSuggestions = function hasSuggestions(suggestions) {
64
+ return typeof suggestions === "function" || (suggestions === null || suggestions === void 0 ? void 0 : suggestions.length) > 0;
111
65
  };
112
-
113
- var getPatternErrorMessage = function getPatternErrorMessage() {
114
- return "Please match the format requested.";
66
+ var isRequired = function isRequired(value, optional) {
67
+ return value === "" && !optional;
115
68
  };
116
-
117
- var patternMatch = function patternMatch(pattern, value) {
118
- return new RegExp(pattern).test(value);
69
+ var isLengthIncorrect = function isLengthIncorrect(value, minLength, maxLength) {
70
+ return value != null && (value.length < minLength || value.length > maxLength);
119
71
  };
120
-
121
- var getLastOptionIndex = function getLastOptionIndex(filteredSuggestions) {
122
- var last = 0;
123
-
124
- var reducer = function reducer(acc, current) {
125
- var _current$options;
126
-
127
- return acc + ((_current$options = current.options) === null || _current$options === void 0 ? void 0 : _current$options.length);
128
- };
129
-
130
- if (filteredSuggestions.length > 0) filteredSuggestions[0].options ? last = filteredSuggestions.reduce(reducer, 0) - 1 : last = filteredSuggestions.length - 1;
131
- return last;
72
+ var isNumberIncorrect = function isNumberIncorrect(value, minNumber, maxNumber) {
73
+ return value < minNumber || value > maxNumber;
132
74
  };
133
-
134
- var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
135
- var label = _ref.label,
136
- _ref$name = _ref.name,
137
- name = _ref$name === void 0 ? "" : _ref$name,
138
- value = _ref.value,
139
- helperText = _ref.helperText,
140
- _ref$placeholder = _ref.placeholder,
141
- placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder,
142
- action = _ref.action,
143
- _ref$clearable = _ref.clearable,
144
- clearable = _ref$clearable === void 0 ? false : _ref$clearable,
145
- _ref$disabled = _ref.disabled,
146
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
147
- _ref$optional = _ref.optional,
148
- optional = _ref$optional === void 0 ? false : _ref$optional,
149
- _ref$prefix = _ref.prefix,
150
- prefix = _ref$prefix === void 0 ? "" : _ref$prefix,
151
- _ref$suffix = _ref.suffix,
152
- suffix = _ref$suffix === void 0 ? "" : _ref$suffix,
153
- onChange = _ref.onChange,
154
- onBlur = _ref.onBlur,
155
- error = _ref.error,
156
- suggestions = _ref.suggestions,
157
- pattern = _ref.pattern,
158
- minLength = _ref.minLength,
159
- maxLength = _ref.maxLength,
160
- _ref$autocomplete = _ref.autocomplete,
161
- autocomplete = _ref$autocomplete === void 0 ? "off" : _ref$autocomplete,
162
- margin = _ref.margin,
163
- _ref$size = _ref.size,
164
- size = _ref$size === void 0 ? "medium" : _ref$size,
165
- _ref$tabIndex = _ref.tabIndex,
166
- tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
167
-
168
- var _useState = (0, _react.useState)("input-".concat((0, _uuid.v4)())),
169
- _useState2 = (0, _slicedToArray2["default"])(_useState, 1),
170
- inputId = _useState2[0];
171
-
172
- var _useState3 = (0, _react.useState)(""),
173
- _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
174
- innerValue = _useState4[0],
175
- setInnerValue = _useState4[1];
176
-
177
- var _useState5 = (0, _react.useState)(false),
178
- _useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
179
- isOpen = _useState6[0],
180
- changeIsOpen = _useState6[1];
181
-
75
+ var patternMismatch = function patternMismatch(pattern, value) {
76
+ return pattern != null && !new RegExp(pattern).test(value);
77
+ };
78
+ var useWidth = function useWidth(target) {
79
+ var _useState = (0, _react.useState)(0),
80
+ _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
81
+ width = _useState2[0],
82
+ setWidth = _useState2[1];
83
+ (0, _react.useEffect)(function () {
84
+ if (target != null) {
85
+ setWidth(target.getBoundingClientRect().width);
86
+ var triggerObserver = new ResizeObserver(function (entries) {
87
+ var rect = entries[0].target.getBoundingClientRect();
88
+ setWidth(rect === null || rect === void 0 ? void 0 : rect.width);
89
+ });
90
+ triggerObserver.observe(target);
91
+ return function () {
92
+ triggerObserver.unobserve(target);
93
+ };
94
+ }
95
+ }, [target]);
96
+ return width;
97
+ };
98
+ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
99
+ var label = _ref2.label,
100
+ _ref2$name = _ref2.name,
101
+ name = _ref2$name === void 0 ? "" : _ref2$name,
102
+ _ref2$defaultValue = _ref2.defaultValue,
103
+ defaultValue = _ref2$defaultValue === void 0 ? "" : _ref2$defaultValue,
104
+ value = _ref2.value,
105
+ helperText = _ref2.helperText,
106
+ _ref2$placeholder = _ref2.placeholder,
107
+ placeholder = _ref2$placeholder === void 0 ? "" : _ref2$placeholder,
108
+ action = _ref2.action,
109
+ _ref2$clearable = _ref2.clearable,
110
+ clearable = _ref2$clearable === void 0 ? false : _ref2$clearable,
111
+ _ref2$disabled = _ref2.disabled,
112
+ disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
113
+ _ref2$readOnly = _ref2.readOnly,
114
+ readOnly = _ref2$readOnly === void 0 ? false : _ref2$readOnly,
115
+ _ref2$optional = _ref2.optional,
116
+ optional = _ref2$optional === void 0 ? false : _ref2$optional,
117
+ _ref2$prefix = _ref2.prefix,
118
+ prefix = _ref2$prefix === void 0 ? "" : _ref2$prefix,
119
+ _ref2$suffix = _ref2.suffix,
120
+ suffix = _ref2$suffix === void 0 ? "" : _ref2$suffix,
121
+ onChange = _ref2.onChange,
122
+ onBlur = _ref2.onBlur,
123
+ error = _ref2.error,
124
+ suggestions = _ref2.suggestions,
125
+ pattern = _ref2.pattern,
126
+ minLength = _ref2.minLength,
127
+ maxLength = _ref2.maxLength,
128
+ _ref2$autocomplete = _ref2.autocomplete,
129
+ autocomplete = _ref2$autocomplete === void 0 ? "off" : _ref2$autocomplete,
130
+ margin = _ref2.margin,
131
+ _ref2$size = _ref2.size,
132
+ size = _ref2$size === void 0 ? "medium" : _ref2$size,
133
+ _ref2$tabIndex = _ref2.tabIndex,
134
+ tabIndex = _ref2$tabIndex === void 0 ? 0 : _ref2$tabIndex;
135
+ var _useState3 = (0, _react.useState)("input-".concat((0, _uuid.v4)())),
136
+ _useState4 = (0, _slicedToArray2["default"])(_useState3, 1),
137
+ inputId = _useState4[0];
138
+ var autosuggestId = "suggestions-".concat(inputId);
139
+ var errorId = "error-".concat(inputId);
140
+ var _useState5 = (0, _react.useState)(defaultValue),
141
+ _useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
142
+ innerValue = _useState6[0],
143
+ setInnerValue = _useState6[1];
182
144
  var _useState7 = (0, _react.useState)(false),
183
- _useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
184
- isSearching = _useState8[0],
185
- changeIsSearching = _useState8[1];
186
-
145
+ _useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
146
+ isOpen = _useState8[0],
147
+ changeIsOpen = _useState8[1];
187
148
  var _useState9 = (0, _react.useState)(false),
188
- _useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
189
- isAutosuggestError = _useState10[0],
190
- changeIsAutosuggestError = _useState10[1];
191
-
192
- var _useState11 = (0, _react.useState)([]),
193
- _useState12 = (0, _slicedToArray2["default"])(_useState11, 2),
194
- filteredSuggestions = _useState12[0],
195
- changeFilteredSuggestions = _useState12[1];
196
-
197
- var _useState13 = (0, _react.useState)(-1),
198
- _useState14 = (0, _slicedToArray2["default"])(_useState13, 2),
199
- visualFocusedSuggIndex = _useState14[0],
200
- changeVisualFocusedSuggIndex = _useState14[1];
201
-
202
- var suggestionsRef = (0, _react.useRef)(null);
149
+ _useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
150
+ isSearching = _useState10[0],
151
+ changeIsSearching = _useState10[1];
152
+ var _useState11 = (0, _react.useState)(false),
153
+ _useState12 = (0, _slicedToArray2["default"])(_useState11, 2),
154
+ isAutosuggestError = _useState12[0],
155
+ changeIsAutosuggestError = _useState12[1];
156
+ var _useState13 = (0, _react.useState)([]),
157
+ _useState14 = (0, _slicedToArray2["default"])(_useState13, 2),
158
+ filteredSuggestions = _useState14[0],
159
+ changeFilteredSuggestions = _useState14[1];
160
+ var _useState15 = (0, _react.useState)(-1),
161
+ _useState16 = (0, _slicedToArray2["default"])(_useState15, 2),
162
+ visualFocusIndex = _useState16[0],
163
+ changeVisualFocusIndex = _useState16[1];
203
164
  var inputRef = (0, _react.useRef)(null);
165
+ var inputContainerRef = (0, _react.useRef)(null);
204
166
  var actionRef = (0, _react.useRef)(null);
167
+ var width = useWidth(inputContainerRef.current);
205
168
  var colorsTheme = (0, _useTheme["default"])();
206
- var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
207
- var autosuggestId = "".concat(inputId, "-listBox");
208
- var errorId = "error-".concat(inputId);
209
- var numberInputContext = (0, _react.useContext)(_NumberInputContext["default"]);
210
- var lastOptionIndex = (0, _react.useMemo)(function () {
211
- return getLastOptionIndex(filteredSuggestions);
212
- }, [filteredSuggestions]);
213
-
214
- var isNotOptional = function isNotOptional(value) {
215
- return value === "" && !optional;
216
- };
217
-
218
- var isLengthIncorrect = function isLengthIncorrect(value) {
219
- return value && minLength && maxLength && (value.length < minLength || value.length > maxLength);
220
- };
221
-
222
- var getLengthErrorMessage = function getLengthErrorMessage() {
223
- return "Min length ".concat(minLength, ", max length ").concat(maxLength, ".");
224
- };
225
-
226
- var isNumberIncorrect = function isNumberIncorrect(value) {
227
- 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);
228
- };
229
-
230
- var isTextInputType = function isTextInputType() {
231
- var _inputRef$current, _inputRef$current2;
232
-
233
- 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";
234
- };
235
-
169
+ var translatedLabels = (0, _useTranslatedLabels["default"])();
170
+ var numberInputContext = (0, _react.useContext)(_NumberInput.NumberInputContext);
236
171
  var getNumberErrorMessage = function getNumberErrorMessage(value) {
237
- if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && parseInt(value) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) return "Value must be greater than or equal to ".concat(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber, ".");else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && parseInt(value) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) return "Value must be less than or equal to ".concat(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber, ".");
172
+ if (value < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) return translatedLabels.numberInput.valueGreaterThanOrEqualToErrorMessage(numberInputContext.minNumber);else if (value > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) return translatedLabels.numberInput.valueLessThanOrEqualToErrorMessage(numberInputContext.maxNumber);
238
173
  };
239
-
240
- var hasSuggestions = function hasSuggestions() {
241
- return typeof suggestions === "function" || (suggestions === null || suggestions === void 0 ? void 0 : suggestions.length) > 0;
242
- };
243
-
244
174
  var openSuggestions = function openSuggestions() {
245
- hasSuggestions() && changeIsOpen(true);
175
+ hasSuggestions(suggestions) && changeIsOpen(true);
246
176
  };
247
-
248
177
  var closeSuggestions = function closeSuggestions() {
249
- changeIsOpen(false);
250
- changeVisualFocusedSuggIndex(-1);
178
+ if (hasSuggestions(suggestions)) {
179
+ changeIsOpen(false);
180
+ changeVisualFocusIndex(-1);
181
+ }
251
182
  };
252
-
253
183
  var changeValue = function changeValue(newValue) {
254
- value !== null && value !== void 0 ? value : setInnerValue(newValue);
255
- var changedValue = typeof newValue === "number" ? newValue.toString() : newValue;
256
- if (isNotOptional(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
257
- value: changedValue,
258
- error: getNotOptionalErrorMessage()
259
- });else if (isLengthIncorrect(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
260
- value: changedValue,
261
- error: getLengthErrorMessage()
262
- });else if (newValue && pattern && !patternMatch(pattern, newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
263
- value: changedValue,
264
- error: getPatternErrorMessage()
265
- });else if (newValue && isNumberIncorrect(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
266
- value: changedValue,
267
- error: getNumberErrorMessage(newValue)
184
+ var formattedValue = typeof newValue === "number" ? newValue.toString() : newValue;
185
+ value !== null && value !== void 0 ? value : setInnerValue(formattedValue);
186
+ if (isRequired(formattedValue, optional)) onChange === null || onChange === void 0 ? void 0 : onChange({
187
+ value: formattedValue,
188
+ error: translatedLabels.formFields.requiredValueErrorMessage
189
+ });else if (isLengthIncorrect(formattedValue, minLength, maxLength)) onChange === null || onChange === void 0 ? void 0 : onChange({
190
+ value: formattedValue,
191
+ error: translatedLabels.formFields.lengthErrorMessage(minLength, maxLength)
192
+ });else if (patternMismatch(pattern, formattedValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
193
+ value: formattedValue,
194
+ error: translatedLabels.formFields.formatRequestedErrorMessage
195
+ });else if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" && isNumberIncorrect(Number(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({
196
+ value: formattedValue,
197
+ error: getNumberErrorMessage(Number(newValue))
268
198
  });else onChange === null || onChange === void 0 ? void 0 : onChange({
269
- value: changedValue,
270
- error: null
199
+ value: formattedValue
271
200
  });
272
201
  };
273
-
202
+ var decrementNumber = function decrementNumber() {
203
+ var currentValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : value !== null && value !== void 0 ? value : innerValue;
204
+ if (!disabled && !readOnly) {
205
+ var numberValue = Number(currentValue);
206
+ var steppedValue = Math.round((numberValue - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) + Number.EPSILON) * 100) / 100;
207
+ if (currentValue !== "") {
208
+ if (numberValue < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || steppedValue < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) changeValue(numberValue);else if (numberValue > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else if (numberValue === (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else changeValue(steppedValue);
209
+ } else {
210
+ if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) >= 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) < 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else changeValue(-numberInputContext.stepNumber);
211
+ }
212
+ }
213
+ };
214
+ var incrementNumber = function incrementNumber() {
215
+ var currentValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : value !== null && value !== void 0 ? value : innerValue;
216
+ if (!disabled && !readOnly) {
217
+ var numberValue = Number(currentValue);
218
+ var steppedValue = Math.round((numberValue + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) + Number.EPSILON) * 100) / 100;
219
+ if (currentValue !== "") {
220
+ if (numberValue > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) || steppedValue > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) changeValue(numberValue);else if (numberValue < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else if (numberValue === (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else changeValue(steppedValue);
221
+ } else {
222
+ if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) > 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) <= 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else changeValue(numberInputContext.stepNumber);
223
+ }
224
+ }
225
+ };
274
226
  var handleInputContainerOnClick = function handleInputContainerOnClick() {
275
227
  document.activeElement !== actionRef.current && inputRef.current.focus();
276
228
  };
277
-
278
229
  var handleInputContainerOnMouseDown = function handleInputContainerOnMouseDown(event) {
279
230
  // Avoid input to lose the focus when the container is pressed
280
231
  document.activeElement === inputRef.current && event.preventDefault();
281
232
  };
282
-
283
- var handleIOnChange = function handleIOnChange(event) {
233
+ var handleInputOnChange = function handleInputOnChange(event) {
284
234
  openSuggestions();
285
235
  changeValue(event.target.value);
286
236
  };
287
-
288
- var handleIOnBlur = function handleIOnBlur(event) {
289
- suggestions && closeSuggestions();
290
- if (isNotOptional(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
237
+ var handleInputOnBlur = function handleInputOnBlur(event) {
238
+ closeSuggestions();
239
+ if (isRequired(event.target.value, optional)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
291
240
  value: event.target.value,
292
- error: getNotOptionalErrorMessage()
293
- });else if (isLengthIncorrect(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
241
+ error: translatedLabels.formFields.requiredValueErrorMessage
242
+ });else if (isLengthIncorrect(event.target.value, minLength, maxLength)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
294
243
  value: event.target.value,
295
- error: getLengthErrorMessage()
296
- });else if (event.target.value && pattern && !patternMatch(pattern, event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
244
+ error: translatedLabels.formFields.lengthErrorMessage(minLength, maxLength)
245
+ });else if (patternMismatch(pattern, event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
297
246
  value: event.target.value,
298
- error: getPatternErrorMessage()
299
- });else if (event.target.value && isNumberIncorrect(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
247
+ error: translatedLabels.formFields.formatRequestedErrorMessage
248
+ });else if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" && isNumberIncorrect(Number(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({
300
249
  value: event.target.value,
301
- error: getNumberErrorMessage(event.target.value)
250
+ error: getNumberErrorMessage(Number(event.target.value))
302
251
  });else onBlur === null || onBlur === void 0 ? void 0 : onBlur({
303
- value: event.target.value,
304
- error: null
252
+ value: event.target.value
305
253
  });
306
254
  };
307
-
308
- var handleIOnKeyDown = function handleIOnKeyDown(event) {
309
- switch (event.keyCode) {
310
- case 40:
311
- // Arrow Down
312
- if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") {
313
- decrementNumber();
314
- event.preventDefault();
315
- } else {
316
- event.preventDefault();
255
+ var handleInputOnKeyDown = function handleInputOnKeyDown(event) {
256
+ switch (event.key) {
257
+ case "Down":
258
+ case "ArrowDown":
259
+ event.preventDefault();
260
+ if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") decrementNumber();else {
317
261
  openSuggestions();
318
-
319
262
  if (!isAutosuggestError && !isSearching && filteredSuggestions.length > 0) {
320
- changeVisualFocusedSuggIndex(function (visualFocusedSuggIndex) {
263
+ changeVisualFocusIndex(function (visualFocusedSuggIndex) {
321
264
  if (visualFocusedSuggIndex < filteredSuggestions.length - 1) return visualFocusedSuggIndex + 1;else if (visualFocusedSuggIndex === filteredSuggestions.length - 1) return 0;
322
265
  });
323
266
  }
324
267
  }
325
-
326
268
  break;
327
-
328
- case 38:
329
- // Arrow Up
330
- if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") {
331
- incrementNumber();
332
- event.preventDefault();
333
- } else {
334
- event.preventDefault();
269
+ case "Up":
270
+ case "ArrowUp":
271
+ event.preventDefault();
272
+ if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") incrementNumber();else {
335
273
  openSuggestions();
336
-
337
274
  if (!isAutosuggestError && !isSearching && filteredSuggestions.length > 0) {
338
- changeVisualFocusedSuggIndex(function (visualFocusedSuggIndex) {
275
+ changeVisualFocusIndex(function (visualFocusedSuggIndex) {
339
276
  if (visualFocusedSuggIndex === 0 || visualFocusedSuggIndex === -1) return filteredSuggestions.length > 0 ? filteredSuggestions.length - 1 : suggestions.length - 1;else return visualFocusedSuggIndex - 1;
340
277
  });
341
278
  }
342
279
  }
343
-
344
280
  break;
345
-
346
- case 27:
347
- // Esc
281
+ case "Esc":
282
+ case "Escape":
348
283
  event.preventDefault();
349
-
350
- if (hasSuggestions()) {
284
+ if (hasSuggestions(suggestions)) {
351
285
  changeValue("");
352
286
  isOpen && closeSuggestions();
353
287
  }
354
-
355
288
  break;
356
-
357
- case 13:
358
- // Enter
359
- if (hasSuggestions() && !isSearching) {
360
- var validFocusedSuggestion = filteredSuggestions.length > 0 && visualFocusedSuggIndex >= 0 && visualFocusedSuggIndex < filteredSuggestions.length;
361
- validFocusedSuggestion && changeValue(filteredSuggestions[visualFocusedSuggIndex]);
289
+ case "Enter":
290
+ if (hasSuggestions(suggestions) && !isSearching) {
291
+ var validFocusedSuggestion = filteredSuggestions.length > 0 && visualFocusIndex >= 0 && visualFocusIndex < filteredSuggestions.length;
292
+ validFocusedSuggestion && changeValue(filteredSuggestions[visualFocusIndex]);
362
293
  isOpen && closeSuggestions();
363
294
  }
364
-
365
295
  break;
366
296
  }
367
297
  };
368
-
298
+ var handleNumberInputWheel = function handleNumberInputWheel(event) {
299
+ if (document.activeElement === inputRef.current) event.deltaY < 0 ? incrementNumber(inputRef.current.value) : decrementNumber(inputRef.current.value);
300
+ };
369
301
  var handleClearActionOnClick = function handleClearActionOnClick() {
370
302
  changeValue("");
371
303
  inputRef.current.focus();
372
304
  suggestions && closeSuggestions();
373
305
  };
374
-
375
306
  var handleDecrementActionOnClick = function handleDecrementActionOnClick() {
376
307
  decrementNumber();
377
308
  inputRef.current.focus();
378
309
  };
379
-
380
310
  var handleIncrementActionOnClick = function handleIncrementActionOnClick() {
381
311
  incrementNumber();
382
312
  inputRef.current.focus();
383
313
  };
384
-
385
314
  var setNumberProps = function setNumberProps(type, min, max, step) {
386
- var _inputRef$current3, _inputRef$current4, _inputRef$current5, _inputRef$current6;
387
-
388
- type && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.setAttribute("type", type));
389
- min && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.setAttribute("min", min));
390
- max && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 ? void 0 : _inputRef$current5.setAttribute("max", max));
391
- step && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current6 = inputRef.current) === null || _inputRef$current6 === void 0 ? void 0 : _inputRef$current6.setAttribute("step", step));
392
- };
393
-
394
- var decrementNumber = function decrementNumber() {
395
- var numberValue = value !== null && value !== void 0 ? value : innerValue;
396
-
397
- if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && parseInt(numberValue) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) {
398
- changeValue(parseInt(numberValue));
399
- } else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && parseInt(numberValue) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) {
400
- changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);
401
- } else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && (parseInt(numberValue) === (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || numberValue === "" || numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && parseInt(numberValue) - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber))) {
402
- changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);
403
- } else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && parseInt(numberValue) - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) >= (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberValue !== "") {
404
- changeValue(parseInt(numberValue) - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber));
405
- } else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberValue == "") {
406
- changeValue(-(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber));
407
- } else if (numberValue === "") {
408
- changeValue(-1);
409
- } else {
410
- changeValue(parseInt(numberValue) - 1);
411
- }
315
+ var _inputRef$current, _inputRef$current2, _inputRef$current3, _inputRef$current4;
316
+ min && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.setAttribute("min", min));
317
+ max && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.setAttribute("max", max));
318
+ inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.setAttribute("step", step);
319
+ inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.setAttribute("type", type);
412
320
  };
413
-
414
- var incrementNumber = function incrementNumber() {
415
- var numberValue = value !== null && value !== void 0 ? value : innerValue;
416
-
417
- if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && parseInt(numberValue) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) {
418
- changeValue(parseInt(numberValue));
419
- } else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && (parseInt(numberValue) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || numberValue === "")) {
420
- changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);
421
- } else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && (parseInt(numberValue) === (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) || numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && parseInt(numberValue) + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber))) {
422
- changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);
423
- } else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && parseInt(numberValue) + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) <= (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) || numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberValue !== "") {
424
- changeValue(parseInt(numberValue) + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber));
425
- } else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberValue == "") {
426
- changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber);
427
- } else if (numberValue === "") {
428
- changeValue(1);
429
- } else {
430
- changeValue(parseInt(numberValue) + 1);
431
- }
432
- };
433
-
434
- (0, _react.useLayoutEffect)(function () {
435
- var _suggestionsRef$curre, _visualFocusedOptionE;
436
-
437
- var visualFocusedOptionEl = suggestionsRef === null || suggestionsRef === void 0 ? void 0 : (_suggestionsRef$curre = suggestionsRef.current) === null || _suggestionsRef$curre === void 0 ? void 0 : _suggestionsRef$curre.querySelectorAll("[role='option']")[visualFocusedSuggIndex];
438
- visualFocusedOptionEl === null || visualFocusedOptionEl === void 0 ? void 0 : (_visualFocusedOptionE = visualFocusedOptionEl.scrollIntoView) === null || _visualFocusedOptionE === void 0 ? void 0 : _visualFocusedOptionE.call(visualFocusedOptionEl, {
439
- block: "nearest",
440
- inline: "start"
441
- });
442
- }, [visualFocusedSuggIndex]);
443
321
  (0, _react.useEffect)(function () {
444
322
  if (typeof suggestions === "function") {
445
323
  changeIsSearching(true);
@@ -463,182 +341,140 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
463
341
  changeFilteredSuggestions(suggestions.filter(function (suggestion) {
464
342
  return suggestion.toUpperCase().startsWith((value !== null && value !== void 0 ? value : innerValue).toUpperCase());
465
343
  }));
466
- changeVisualFocusedSuggIndex(-1);
344
+ changeVisualFocusIndex(-1);
467
345
  }
468
-
469
- (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" && setNumberProps(numberInputContext.typeNumber, numberInputContext.minNumber, numberInputContext.maxNumber, numberInputContext.stepNumber);
346
+ numberInputContext != null && setNumberProps(numberInputContext.typeNumber, numberInputContext.minNumber, numberInputContext.maxNumber, numberInputContext.stepNumber);
470
347
  }, [value, innerValue, suggestions, numberInputContext]);
471
-
472
- var HighlightedSuggestion = function HighlightedSuggestion(_ref2) {
473
- var suggestion = _ref2.suggestion,
474
- index = _ref2.index;
475
- var regEx = new RegExp(value !== null && value !== void 0 ? value : innerValue, "i");
476
- var matchedWords = suggestion.match(regEx);
477
- var noMatchedWords = suggestion.replace(regEx, "");
478
- var isLastOption = index === lastOptionIndex;
479
- return /*#__PURE__*/_react["default"].createElement(Suggestion, {
480
- id: "suggestion-".concat(index),
481
- onClick: function onClick() {
482
- changeValue(suggestion);
483
- closeSuggestions();
484
- },
485
- visualFocused: visualFocusedSuggIndex === index,
486
- role: "option",
487
- "aria-selected": visualFocusedSuggIndex === index && "true"
488
- }, /*#__PURE__*/_react["default"].createElement(StyledSuggestion, {
489
- last: isLastOption,
490
- visualFocused: visualFocusedSuggIndex === index
491
- }, typeof suggestions === "function" ? suggestion : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("strong", null, matchedWords), noMatchedWords)));
492
- };
493
-
494
348
  return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
495
349
  theme: colorsTheme.textInput
496
- }, /*#__PURE__*/_react["default"].createElement(DxcInput, {
350
+ }, /*#__PURE__*/_react["default"].createElement(TextInputContainer, {
497
351
  margin: margin,
498
- ref: ref,
499
- size: size
352
+ size: size,
353
+ ref: ref
500
354
  }, label && /*#__PURE__*/_react["default"].createElement(Label, {
501
355
  htmlFor: inputId,
502
356
  disabled: disabled,
503
- backgroundType: backgroundType,
504
- helperText: helperText
505
- }, label, " ", optional && /*#__PURE__*/_react["default"].createElement(OptionalLabel, null, "(Optional)")), helperText && /*#__PURE__*/_react["default"].createElement(HelperText, {
506
- disabled: disabled,
507
- backgroundType: backgroundType
508
- }, helperText), /*#__PURE__*/_react["default"].createElement(InputContainer, {
509
- error: error,
357
+ hasHelperText: helperText ? true : false
358
+ }, label, " ", optional && /*#__PURE__*/_react["default"].createElement(OptionalLabel, null, translatedLabels.formFields.optionalLabel)), helperText && /*#__PURE__*/_react["default"].createElement(HelperText, {
359
+ disabled: disabled
360
+ }, helperText), /*#__PURE__*/_react["default"].createElement(AutosuggestWrapper, {
361
+ condition: hasSuggestions(suggestions),
362
+ wrapper: function wrapper(children) {
363
+ return /*#__PURE__*/_react["default"].createElement(Popover.Root, {
364
+ open: isOpen && (filteredSuggestions.length > 0 || isSearching || isAutosuggestError)
365
+ }, /*#__PURE__*/_react["default"].createElement(Popover.Trigger, {
366
+ asChild: true,
367
+ "aria-controls": undefined
368
+ }, children), /*#__PURE__*/_react["default"].createElement(Popover.Portal, null, /*#__PURE__*/_react["default"].createElement(Popover.Content, {
369
+ sideOffset: 5,
370
+ style: {
371
+ zIndex: "2147483647"
372
+ },
373
+ onOpenAutoFocus: function onOpenAutoFocus(event) {
374
+ // Avoid select to lose focus when the list is opened
375
+ event.preventDefault();
376
+ },
377
+ onCloseAutoFocus: function onCloseAutoFocus(event) {
378
+ // Avoid select to lose focus when the list is closed
379
+ event.preventDefault();
380
+ }
381
+ }, /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], {
382
+ id: autosuggestId,
383
+ value: value !== null && value !== void 0 ? value : innerValue,
384
+ suggestions: filteredSuggestions,
385
+ visualFocusIndex: visualFocusIndex,
386
+ highlightedSuggestions: typeof suggestions !== "function",
387
+ searchHasErrors: isAutosuggestError,
388
+ isSearching: isSearching,
389
+ suggestionOnClick: function suggestionOnClick(suggestion) {
390
+ changeValue(suggestion);
391
+ closeSuggestions();
392
+ },
393
+ styles: {
394
+ width: width
395
+ }
396
+ }))));
397
+ }
398
+ }, /*#__PURE__*/_react["default"].createElement(InputContainer, {
399
+ error: error ? true : false,
510
400
  disabled: disabled,
511
- backgroundType: backgroundType,
401
+ readOnly: readOnly,
512
402
  onClick: handleInputContainerOnClick,
513
- onMouseDown: handleInputContainerOnMouseDown
403
+ onMouseDown: handleInputContainerOnMouseDown,
404
+ ref: inputContainerRef
514
405
  }, prefix && /*#__PURE__*/_react["default"].createElement(Prefix, {
515
- disabled: disabled,
516
- backgroundType: backgroundType
517
- }, prefix), /*#__PURE__*/_react["default"].createElement(Input, {
406
+ disabled: disabled
407
+ }, prefix), /*#__PURE__*/_react["default"].createElement(_Flex["default"], {
408
+ gap: "0.25rem",
409
+ alignItems: "center",
410
+ grow: 1
411
+ }, /*#__PURE__*/_react["default"].createElement(Input, {
518
412
  id: inputId,
519
413
  name: name,
520
414
  value: value !== null && value !== void 0 ? value : innerValue,
521
415
  placeholder: placeholder,
522
- onBlur: handleIOnBlur,
523
- onChange: handleIOnChange,
524
- onFocus: function onFocus() {
525
- openSuggestions();
526
- },
527
- onKeyDown: handleIOnKeyDown,
416
+ onBlur: handleInputOnBlur,
417
+ onChange: handleInputOnChange,
418
+ onFocus: !readOnly ? openSuggestions : undefined,
419
+ onKeyDown: !readOnly ? handleInputOnKeyDown : undefined,
528
420
  onMouseDown: function onMouseDown(event) {
529
421
  event.stopPropagation();
530
422
  },
423
+ onWheel: (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" ? handleNumberInputWheel : undefined,
531
424
  disabled: disabled,
425
+ readOnly: readOnly,
532
426
  ref: inputRef,
533
- backgroundType: backgroundType,
534
427
  pattern: pattern,
535
428
  minLength: minLength,
536
429
  maxLength: maxLength,
537
- autoComplete: autocomplete,
430
+ autoComplete: autocomplete === "off" ? "nope" : autocomplete,
538
431
  tabIndex: tabIndex,
539
- role: isTextInputType() && hasSuggestions() ? "combobox" : "textbox",
540
- "aria-autocomplete": isTextInputType() && hasSuggestions() ? "list" : undefined,
541
- "aria-controls": isTextInputType() && hasSuggestions() ? autosuggestId : undefined,
542
- "aria-disabled": disabled,
543
- "aria-expanded": isTextInputType() && hasSuggestions() ? isOpen ? "true" : "false" : undefined,
544
- "aria-activedescendant": isTextInputType() && hasSuggestions() && isOpen && visualFocusedSuggIndex !== -1 ? "suggestion-".concat(visualFocusedSuggIndex) : undefined,
545
- "aria-invalid": error ? "true" : "false",
432
+ type: "text",
433
+ role: hasSuggestions(suggestions) ? "combobox" : undefined,
434
+ "aria-autocomplete": hasSuggestions(suggestions) ? "list" : undefined,
435
+ "aria-controls": hasSuggestions(suggestions) ? autosuggestId : undefined,
436
+ "aria-expanded": hasSuggestions(suggestions) ? isOpen : undefined,
437
+ "aria-haspopup": hasSuggestions(suggestions) ? "listbox" : undefined,
438
+ "aria-activedescendant": hasSuggestions(suggestions) && isOpen && visualFocusIndex !== -1 ? "suggestion-".concat(visualFocusIndex) : undefined,
439
+ "aria-invalid": error ? true : false,
546
440
  "aria-errormessage": error ? errorId : undefined,
547
- "aria-required": optional ? "false" : "true"
441
+ "aria-required": !disabled && !optional
548
442
  }), !disabled && error && /*#__PURE__*/_react["default"].createElement(ErrorIcon, {
549
- backgroundType: backgroundType,
550
443
  "aria-label": "Error"
551
- }, textInputIcons.error), !disabled && clearable && (value !== null && value !== void 0 ? value : innerValue).length > 0 && /*#__PURE__*/_react["default"].createElement(Action, {
552
- onClick: function onClick() {
553
- return handleClearActionOnClick();
554
- },
555
- onMouseDown: function onMouseDown(event) {
556
- event.stopPropagation();
557
- },
558
- backgroundType: backgroundType,
444
+ }, _Icons["default"].error), !disabled && !readOnly && clearable && (value !== null && value !== void 0 ? value : innerValue).length > 0 && /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
445
+ onClick: handleClearActionOnClick,
446
+ icon: _Icons["default"].clear,
447
+ tabIndex: tabIndex,
448
+ title: translatedLabels.textInput.clearFieldActionTitle
449
+ }), (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
450
+ onClick: !readOnly ? handleDecrementActionOnClick : undefined,
451
+ icon: _Icons["default"].decrement,
559
452
  tabIndex: tabIndex,
560
- title: "Clear field",
561
- "aria-label": "Clear field"
562
- }, textInputIcons.clear), (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(Action, {
563
453
  ref: actionRef,
564
- disabled: disabled,
565
- onClick: function onClick() {
566
- return handleDecrementActionOnClick();
567
- },
568
- onMouseDown: function onMouseDown(event) {
569
- event.stopPropagation();
570
- },
571
- backgroundType: backgroundType,
454
+ title: translatedLabels.numberInput.decrementValueTitle,
455
+ disabled: disabled
456
+ }), /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
457
+ onClick: !readOnly ? handleIncrementActionOnClick : undefined,
458
+ icon: _Icons["default"].increment,
572
459
  tabIndex: tabIndex,
573
- title: "Decrement value",
574
- "aria-label": "Decrement value"
575
- }, textInputIcons.decrement), /*#__PURE__*/_react["default"].createElement(Action, {
576
460
  ref: actionRef,
577
- disabled: disabled,
578
- onClick: function onClick() {
579
- return handleIncrementActionOnClick();
580
- },
581
- onMouseDown: function onMouseDown(event) {
582
- event.stopPropagation();
583
- },
584
- backgroundType: backgroundType,
461
+ title: translatedLabels.numberInput.incrementValueTitle,
462
+ disabled: disabled
463
+ })), action && /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
464
+ onClick: !readOnly ? action.onClick : undefined,
465
+ icon: action.icon,
585
466
  tabIndex: tabIndex,
586
- title: "Increment value",
587
- "aria-label": "Increment value"
588
- }, textInputIcons.increment)) : action && /*#__PURE__*/_react["default"].createElement(Action, {
589
467
  ref: actionRef,
590
- disabled: disabled,
591
- onClick: function onClick() {
592
- return action.onClick();
593
- },
594
- onMouseDown: function onMouseDown(event) {
595
- event.stopPropagation();
596
- },
597
468
  title: action.title,
598
- "aria-label": action.title,
599
- backgroundType: backgroundType,
600
- tabIndex: tabIndex
601
- }, typeof action.icon === "string" ? /*#__PURE__*/_react["default"].createElement(ActionIcon, {
602
- src: action.icon
603
- }) : action.icon), suffix && /*#__PURE__*/_react["default"].createElement(Suffix, {
604
- disabled: disabled,
605
- backgroundType: backgroundType
606
- }, suffix), isOpen && (filteredSuggestions.length > 0 || isSearching || isAutosuggestError) && /*#__PURE__*/_react["default"].createElement(Suggestions, {
607
- id: autosuggestId,
608
- isError: isAutosuggestError,
609
- onMouseDown: function onMouseDown(event) {
610
- event.preventDefault();
611
- },
612
- ref: suggestionsRef,
613
- role: "listbox",
614
- "aria-label": label
615
- }, !isSearching && !isAutosuggestError && filteredSuggestions.length > 0 && filteredSuggestions.map(function (suggestion, index) {
616
- return /*#__PURE__*/_react["default"].createElement(HighlightedSuggestion, {
617
- key: "suggestion-".concat((0, _uuid.v4)()),
618
- suggestion: suggestion,
619
- index: index
620
- });
621
- }), isSearching && /*#__PURE__*/_react["default"].createElement(SuggestionsSystemMessage, null, "Searching..."), isAutosuggestError && /*#__PURE__*/_react["default"].createElement(SuggestionsError, null, /*#__PURE__*/_react["default"].createElement(SuggestionsErrorIcon, {
622
- backgroundType: backgroundType
623
- }, textInputIcons.error), "Error fetching data"))), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
469
+ disabled: disabled
470
+ })), suffix && /*#__PURE__*/_react["default"].createElement(Suffix, {
471
+ disabled: disabled
472
+ }, suffix))), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
624
473
  id: errorId,
625
- backgroundType: backgroundType,
626
474
  "aria-live": error ? "assertive" : "off"
627
475
  }, error)));
628
476
  });
629
-
630
- var sizes = {
631
- small: "240px",
632
- medium: "360px",
633
- large: "480px",
634
- fillParent: "100%"
635
- };
636
-
637
- var calculateWidth = function calculateWidth(margin, size) {
638
- return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
639
- };
640
-
641
- var DxcInput = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
477
+ var TextInputContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
642
478
  return calculateWidth(props.margin, props.size);
643
479
  }, function (props) {
644
480
  return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
@@ -651,9 +487,8 @@ var DxcInput = _styledComponents["default"].div(_templateObject || (_templateObj
651
487
  }, function (props) {
652
488
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
653
489
  });
654
-
655
490
  var Label = _styledComponents["default"].label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n ", "\n"])), function (props) {
656
- return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledLabelFontColorOnDark : props.theme.disabledLabelFontColor : props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
491
+ return props.disabled ? props.theme.disabledLabelFontColor : props.theme.labelFontColor;
657
492
  }, function (props) {
658
493
  return props.theme.fontFamily;
659
494
  }, function (props) {
@@ -665,15 +500,13 @@ var Label = _styledComponents["default"].label(_templateObject2 || (_templateObj
665
500
  }, function (props) {
666
501
  return props.theme.labelLineHeight;
667
502
  }, function (props) {
668
- return !props.helperText && "margin-bottom: 0.25rem";
503
+ return !props.hasHelperText && "margin-bottom: 0.25rem";
669
504
  });
670
-
671
505
  var OptionalLabel = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"])), function (props) {
672
506
  return props.theme.optionalLabelFontWeight;
673
507
  });
674
-
675
- var HelperText = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-bottom: 0.25rem;\n"])), function (props) {
676
- return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledHelperTextFontColorOnDark : props.theme.disabledHelperTextFontColor : props.backgroundType === "dark" ? props.theme.helperTextFontColorOnDark : props.theme.helperTextFontColor;
508
+ var HelperText = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-bottom: 0.25rem;\n"])), function (props) {
509
+ return props.disabled ? props.theme.disabledHelperTextFontColor : props.theme.helperTextFontColor;
677
510
  }, function (props) {
678
511
  return props.theme.fontFamily;
679
512
  }, function (props) {
@@ -685,21 +518,17 @@ var HelperText = _styledComponents["default"].span(_templateObject4 || (_templat
685
518
  }, function (props) {
686
519
  return props.theme.helperTextLineHeight;
687
520
  });
688
-
689
- var InputContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n position: relative;\n align-items: center;\n height: calc(2.5rem - 2px);\n padding: 0 0.5rem;\n\n ", "\n box-shadow: 0 0 0 2px transparent;\n border-radius: 4px;\n border: 1px solid\n ", ";\n ", "\n ", ";\n\n ", ";\n"])), function (props) {
690
- if (props.disabled) return props.backgroundType === "dark" ? "background-color: ".concat(props.theme.disabledContainerFillColorOnDark, ";") : "background-color: ".concat(props.theme.disabledContainerFillColor, ";");
521
+ var InputContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n display: flex;\n align-items: center;\n height: calc(2.5rem - 2px);\n padding: 0 0.5rem;\n\n ", "\n box-shadow: 0 0 0 2px transparent;\n border-radius: 4px;\n border: 1px solid\n ", ";\n ", "\n\n ", ";\n"])), function (props) {
522
+ if (props.disabled) return "background-color: ".concat(props.theme.disabledContainerFillColor, ";");
691
523
  }, function (props) {
692
- if (props.disabled) return props.backgroundType === "dark" ? props.theme.disabledBorderColorOnDark : props.theme.disabledBorderColor;else return props.backgroundType === "dark" ? props.theme.enabledBorderColorOnDark : props.theme.enabledBorderColor;
524
+ if (props.disabled) return props.theme.disabledBorderColor;else if (props.readOnly) return props.theme.readOnlyBorderColor;else return props.theme.enabledBorderColor;
693
525
  }, function (props) {
694
- return props.error && !props.disabled && "border-color: transparent;\n box-shadow: 0 0 0 2px ".concat(props.backgroundType === "dark" ? props.theme.errorBorderColorOnDark : props.theme.errorBorderColor, ";\n ");
695
- }, function (props) {
696
- return props.disabled && "cursor: not-allowed;";
526
+ return props.error && !props.disabled && "border-color: transparent;\n box-shadow: 0 0 0 2px ".concat(props.theme.errorBorderColor, ";\n ");
697
527
  }, function (props) {
698
- 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 ");
528
+ return !props.disabled ? "\n &:hover {\n border-color: ".concat(props.error ? "transparent" : props.readOnly ? props.theme.hoverReadOnlyBorderColor : props.theme.hoverBorderColor, ";\n ").concat(props.error ? "box-shadow: 0 0 0 2px ".concat(props.theme.hoverErrorBorderColor, ";") : "", "\n }\n &:focus-within {\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(props.theme.focusBorderColor, ";\n }\n ") : "cursor: not-allowed;";
699
529
  });
700
-
701
530
  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) {
702
- return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledValueFontColorOnDark : props.theme.disabledValueFontColor : props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
531
+ return props.disabled ? props.theme.disabledValueFontColor : props.theme.valueFontColor;
703
532
  }, function (props) {
704
533
  return props.theme.fontFamily;
705
534
  }, function (props) {
@@ -711,86 +540,26 @@ var Input = _styledComponents["default"].input(_templateObject6 || (_templateObj
711
540
  }, function (props) {
712
541
  return props.disabled && "cursor: not-allowed;";
713
542
  }, function (props) {
714
- return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPlaceholderFontColorOnDark : props.theme.disabledPlaceholderFontColor : props.backgroundType === "dark" ? props.theme.placeholderFontColorOnDark : props.theme.placeholderFontColor;
715
- });
716
-
717
- var ActionIcon = _styledComponents["default"].img(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n width: 16px;\n height: 16px;\n"])));
718
-
719
- 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) {
720
- return props.theme.fontFamily;
721
- }, function (props) {
722
- return props.disabled ? "cursor: not-allowed;" : "cursor: pointer;";
723
- }, function (props) {
724
- return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionBackgroundColorOnDark : props.theme.disabledActionBackgroundColor : props.backgroundType === "dark" ? props.theme.actionBackgroundColorOnDark : props.theme.actionBackgroundColor;
725
- }, function (props) {
726
- return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionIconColorOnDark : props.theme.disabledActionIconColor : props.backgroundType === "dark" ? props.theme.actionIconColorOnDark : props.theme.actionIconColor;
727
- }, function (props) {
728
- 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 ");
543
+ return props.disabled ? props.theme.disabledPlaceholderFontColor : props.theme.placeholderFontColor;
729
544
  });
730
-
731
- 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) {
732
- var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPrefixColorOnDark : props.theme.disabledPrefixColor : props.backgroundType === "dark" ? props.theme.prefixColorOnDark : props.theme.prefixColor;
545
+ var Prefix = _styledComponents["default"].span(_templateObject7 || (_templateObject7 = (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) {
546
+ var color = props.disabled ? props.theme.disabledPrefixColor : props.theme.prefixColor;
733
547
  return "color: ".concat(color, "; border-right: 1px solid ").concat(color, ";");
734
548
  }, function (props) {
735
549
  return props.theme.fontFamily;
736
550
  });
737
-
738
- 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) {
739
- var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledSuffixColorOnDark : props.theme.disabledSuffixColor : props.backgroundType === "dark" ? props.theme.suffixColorOnDark : props.theme.suffixColor;
551
+ var Suffix = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (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) {
552
+ var color = props.disabled ? props.theme.disabledSuffixColor : props.theme.suffixColor;
740
553
  return "color: ".concat(color, "; border-left: 1px solid ").concat(color, ";");
741
554
  }, function (props) {
742
555
  return props.theme.fontFamily;
743
556
  });
744
-
745
- 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) {
746
- return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
557
+ var ErrorIcon = _styledComponents["default"].span(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n padding: 3px;\n height: 18px;\n width: 18px;\n color: ", ";\n\n svg {\n line-height: 18px;\n font-size: 1.25rem;\n }\n"])), function (props) {
558
+ return props.theme.errorIconColor;
747
559
  });
748
-
749
- 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) {
750
- return props.backgroundType === "dark" ? props.theme.errorMessageColorOnDark : props.theme.errorMessageColor;
560
+ var Error = _styledComponents["default"].span(_templateObject10 || (_templateObject10 = (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) {
561
+ return props.theme.errorMessageColor;
751
562
  }, function (props) {
752
563
  return props.theme.fontFamily;
753
564
  });
754
-
755
- var Suggestions = _styledComponents["default"].ul(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n z-index: 1;\n max-height: 304px;\n overflow-y: auto;\n top: calc(100% + 4px);\n left: 0;\n margin: 0;\n padding: 0.25rem 0;\n width: 100%;\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: 0.25rem;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n cursor: default;\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n"])), function (props) {
756
- return props.isError ? props.theme.errorListDialogBackgroundColor : props.theme.listDialogBackgroundColor;
757
- }, function (props) {
758
- return props.isError ? props.theme.errorListDialogBorderColor : props.theme.listDialogBorderColor;
759
- }, function (props) {
760
- return props.theme.listOptionFontColor;
761
- }, function (props) {
762
- return props.theme.fontFamily;
763
- }, function (props) {
764
- return props.theme.listOptionFontSize;
765
- }, function (props) {
766
- return props.theme.listOptionFontStyle;
767
- }, function (props) {
768
- return props.theme.listOptionFontWeight;
769
- });
770
-
771
- var Suggestion = _styledComponents["default"].li(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 0 0.5rem;\n line-height: 1.715em;\n cursor: pointer;\n\n box-shadow: inset 0 0 0 2px\n ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n"])), function (props) {
772
- return props.visualFocused ? props.theme.focusListOptionBorderColor : "transparent";
773
- }, function (props) {
774
- return props.theme.hoverListOptionBackgroundColor;
775
- }, function (props) {
776
- return props.theme.activeListOptionBackgroundColor;
777
- });
778
-
779
- var StyledSuggestion = _styledComponents["default"].span(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2["default"])(["\n width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 0.25rem 0.5rem 0.188rem 0.5rem;\n ", ";\n"])), function (props) {
780
- return props.last || props.visualFocused ? "border-bottom: 1px solid transparent" : "border-bottom: 1px solid ".concat(props.theme.listOptionDividerColor);
781
- });
782
-
783
- var SuggestionsSystemMessage = _styledComponents["default"].span(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 0.25rem 1rem;\n color: ", ";\n line-height: 1.715em;\n"])), function (props) {
784
- return props.theme.systemMessageFontColor;
785
- });
786
-
787
- var SuggestionsErrorIcon = _styledComponents["default"].span(_templateObject17 || (_templateObject17 = (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"])), function (props) {
788
- return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
789
- });
790
-
791
- var SuggestionsError = _styledComponents["default"].span(_templateObject18 || (_templateObject18 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 0.25rem 1rem;\n align-items: center;\n line-height: 1.715em;\n color: ", ";\n"])), function (props) {
792
- return props.theme.errorListDialogFontColor;
793
- });
794
-
795
- var _default = DxcTextInput;
796
- exports["default"] = _default;
565
+ var _default = exports["default"] = DxcTextInput;