@dxc-technology/halstack-react 0.0.0-c7ec4d1 → 0.0.0-c83579c

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 (446) hide show
  1. package/BackgroundColorContext.d.ts +10 -0
  2. package/BackgroundColorContext.js +47 -0
  3. package/HalstackContext.d.ts +1336 -0
  4. package/HalstackContext.js +335 -0
  5. package/accordion/Accordion.d.ts +4 -0
  6. package/accordion/Accordion.js +234 -0
  7. package/accordion/Accordion.stories.tsx +395 -0
  8. package/accordion/Accordion.test.js +71 -0
  9. package/accordion/types.d.ts +69 -0
  10. package/accordion/types.js +5 -0
  11. package/accordion-group/AccordionGroup.d.ts +7 -0
  12. package/accordion-group/AccordionGroup.js +149 -0
  13. package/accordion-group/AccordionGroup.stories.tsx +251 -0
  14. package/accordion-group/AccordionGroup.test.js +126 -0
  15. package/accordion-group/types.d.ts +79 -0
  16. package/accordion-group/types.js +5 -0
  17. package/alert/Alert.d.ts +4 -0
  18. package/{dist/alert → alert}/Alert.js +45 -157
  19. package/alert/Alert.stories.tsx +198 -0
  20. package/alert/Alert.test.js +92 -0
  21. package/alert/types.d.ts +49 -0
  22. package/alert/types.js +5 -0
  23. package/badge/Badge.d.ts +4 -0
  24. package/badge/Badge.js +61 -0
  25. package/badge/types.d.ts +5 -0
  26. package/badge/types.js +5 -0
  27. package/bleed/Bleed.d.ts +3 -0
  28. package/bleed/Bleed.js +51 -0
  29. package/bleed/Bleed.stories.tsx +342 -0
  30. package/bleed/types.d.ts +37 -0
  31. package/bleed/types.js +5 -0
  32. package/box/Box.d.ts +4 -0
  33. package/box/Box.js +114 -0
  34. package/box/Box.stories.tsx +147 -0
  35. package/box/Box.test.js +18 -0
  36. package/box/types.d.ts +44 -0
  37. package/box/types.js +5 -0
  38. package/bulleted-list/BulletedList.d.ts +7 -0
  39. package/bulleted-list/BulletedList.js +123 -0
  40. package/bulleted-list/BulletedList.stories.tsx +200 -0
  41. package/bulleted-list/types.d.ts +11 -0
  42. package/bulleted-list/types.js +5 -0
  43. package/button/Button.d.ts +4 -0
  44. package/button/Button.js +153 -0
  45. package/button/Button.stories.tsx +425 -0
  46. package/button/Button.test.js +35 -0
  47. package/button/types.d.ts +53 -0
  48. package/button/types.js +5 -0
  49. package/card/Card.d.ts +4 -0
  50. package/card/Card.js +160 -0
  51. package/card/Card.stories.tsx +200 -0
  52. package/card/Card.test.js +50 -0
  53. package/card/ice-cream.jpg +0 -0
  54. package/card/types.d.ts +68 -0
  55. package/card/types.js +5 -0
  56. package/checkbox/Checkbox.d.ts +4 -0
  57. package/checkbox/Checkbox.js +250 -0
  58. package/checkbox/Checkbox.stories.tsx +260 -0
  59. package/checkbox/Checkbox.test.js +155 -0
  60. package/checkbox/types.d.ts +68 -0
  61. package/checkbox/types.js +5 -0
  62. package/chip/Chip.d.ts +4 -0
  63. package/chip/Chip.js +153 -0
  64. package/chip/Chip.stories.tsx +206 -0
  65. package/chip/Chip.test.js +54 -0
  66. package/chip/types.d.ts +45 -0
  67. package/chip/types.js +5 -0
  68. package/common/OpenSans.css +69 -0
  69. package/common/coreTokens.d.ts +146 -0
  70. package/common/coreTokens.js +167 -0
  71. package/common/utils.d.ts +1 -0
  72. package/{dist/common → common}/utils.js +4 -4
  73. package/common/variables.d.ts +1482 -0
  74. package/common/variables.js +1361 -0
  75. package/date-input/Calendar.d.ts +4 -0
  76. package/date-input/Calendar.js +258 -0
  77. package/date-input/DateInput.d.ts +4 -0
  78. package/date-input/DateInput.js +269 -0
  79. package/date-input/DateInput.stories.tsx +304 -0
  80. package/date-input/DateInput.test.js +835 -0
  81. package/date-input/DatePicker.d.ts +4 -0
  82. package/date-input/DatePicker.js +146 -0
  83. package/date-input/Icons.d.ts +6 -0
  84. package/date-input/Icons.js +75 -0
  85. package/date-input/YearPicker.d.ts +4 -0
  86. package/date-input/YearPicker.js +126 -0
  87. package/date-input/types.d.ts +158 -0
  88. package/date-input/types.js +5 -0
  89. package/dialog/Dialog.d.ts +4 -0
  90. package/dialog/Dialog.js +149 -0
  91. package/dialog/Dialog.stories.tsx +319 -0
  92. package/dialog/Dialog.test.js +369 -0
  93. package/dialog/types.d.ts +44 -0
  94. package/dialog/types.js +5 -0
  95. package/dropdown/Dropdown.d.ts +4 -0
  96. package/dropdown/Dropdown.js +388 -0
  97. package/dropdown/Dropdown.stories.tsx +438 -0
  98. package/dropdown/Dropdown.test.js +586 -0
  99. package/dropdown/DropdownMenu.d.ts +4 -0
  100. package/dropdown/DropdownMenu.js +74 -0
  101. package/dropdown/DropdownMenuItem.d.ts +4 -0
  102. package/dropdown/DropdownMenuItem.js +79 -0
  103. package/dropdown/types.d.ts +100 -0
  104. package/dropdown/types.js +5 -0
  105. package/file-input/FileInput.d.ts +4 -0
  106. package/file-input/FileInput.js +547 -0
  107. package/file-input/FileInput.stories.tsx +618 -0
  108. package/file-input/FileInput.test.js +457 -0
  109. package/file-input/FileItem.d.ts +4 -0
  110. package/file-input/FileItem.js +162 -0
  111. package/file-input/types.d.ts +129 -0
  112. package/file-input/types.js +5 -0
  113. package/flex/Flex.d.ts +4 -0
  114. package/flex/Flex.js +71 -0
  115. package/flex/Flex.stories.tsx +112 -0
  116. package/flex/types.d.ts +97 -0
  117. package/flex/types.js +5 -0
  118. package/footer/Footer.d.ts +4 -0
  119. package/footer/Footer.js +183 -0
  120. package/footer/Footer.stories.tsx +228 -0
  121. package/footer/Footer.test.js +97 -0
  122. package/footer/Icons.d.ts +2 -0
  123. package/{dist/footer → footer}/Icons.js +16 -16
  124. package/footer/types.d.ts +66 -0
  125. package/footer/types.js +5 -0
  126. package/grid/Grid.d.ts +7 -0
  127. package/grid/Grid.js +91 -0
  128. package/grid/Grid.stories.tsx +219 -0
  129. package/grid/types.d.ts +115 -0
  130. package/grid/types.js +5 -0
  131. package/header/Header.d.ts +8 -0
  132. package/header/Header.js +303 -0
  133. package/header/Header.stories.tsx +315 -0
  134. package/header/Header.test.js +79 -0
  135. package/header/Icons.d.ts +2 -0
  136. package/{dist/header → header}/Icons.js +9 -34
  137. package/header/types.d.ts +48 -0
  138. package/header/types.js +5 -0
  139. package/heading/Heading.d.ts +4 -0
  140. package/{dist/heading → heading}/Heading.js +26 -97
  141. package/heading/Heading.stories.tsx +54 -0
  142. package/heading/Heading.test.js +186 -0
  143. package/heading/types.d.ts +33 -0
  144. package/heading/types.js +5 -0
  145. package/inset/Inset.d.ts +3 -0
  146. package/inset/Inset.js +51 -0
  147. package/inset/Inset.stories.tsx +230 -0
  148. package/inset/types.d.ts +37 -0
  149. package/inset/types.js +5 -0
  150. package/layout/ApplicationLayout.d.ts +20 -0
  151. package/layout/ApplicationLayout.js +171 -0
  152. package/layout/ApplicationLayout.stories.tsx +162 -0
  153. package/layout/Icons.d.ts +5 -0
  154. package/{dist/layout → layout}/Icons.js +19 -8
  155. package/layout/SidenavContext.d.ts +5 -0
  156. package/layout/SidenavContext.js +19 -0
  157. package/layout/types.d.ts +41 -0
  158. package/layout/types.js +5 -0
  159. package/link/Link.d.ts +4 -0
  160. package/link/Link.js +136 -0
  161. package/link/Link.stories.tsx +253 -0
  162. package/link/Link.test.js +81 -0
  163. package/link/types.d.ts +54 -0
  164. package/link/types.js +5 -0
  165. package/main.d.ts +45 -0
  166. package/{dist/main.js → main.js} +122 -104
  167. package/nav-tabs/NavTabs.d.ts +8 -0
  168. package/nav-tabs/NavTabs.js +125 -0
  169. package/nav-tabs/NavTabs.stories.tsx +260 -0
  170. package/nav-tabs/NavTabs.test.js +82 -0
  171. package/nav-tabs/Tab.d.ts +4 -0
  172. package/nav-tabs/Tab.js +150 -0
  173. package/nav-tabs/types.d.ts +53 -0
  174. package/nav-tabs/types.js +5 -0
  175. package/number-input/NumberInput.d.ts +4 -0
  176. package/number-input/NumberInput.js +76 -0
  177. package/number-input/NumberInput.stories.tsx +115 -0
  178. package/number-input/NumberInput.test.js +542 -0
  179. package/number-input/NumberInputContext.d.ts +4 -0
  180. package/{dist/number-input → number-input}/NumberInputContext.js +5 -2
  181. package/number-input/numberInputContextTypes.d.ts +19 -0
  182. package/number-input/numberInputContextTypes.js +5 -0
  183. package/number-input/types.d.ts +124 -0
  184. package/number-input/types.js +5 -0
  185. package/package.json +45 -35
  186. package/paginator/Icons.d.ts +5 -0
  187. package/paginator/Icons.js +54 -0
  188. package/paginator/Paginator.d.ts +4 -0
  189. package/paginator/Paginator.js +163 -0
  190. package/paginator/Paginator.stories.tsx +87 -0
  191. package/paginator/Paginator.test.js +305 -0
  192. package/paginator/types.d.ts +38 -0
  193. package/paginator/types.js +5 -0
  194. package/paragraph/Paragraph.d.ts +5 -0
  195. package/paragraph/Paragraph.js +38 -0
  196. package/paragraph/Paragraph.stories.tsx +44 -0
  197. package/password-input/PasswordInput.d.ts +4 -0
  198. package/{dist/password-input → password-input}/PasswordInput.js +40 -77
  199. package/password-input/PasswordInput.stories.tsx +131 -0
  200. package/password-input/PasswordInput.test.js +181 -0
  201. package/password-input/types.d.ts +110 -0
  202. package/password-input/types.js +5 -0
  203. package/progress-bar/ProgressBar.d.ts +4 -0
  204. package/progress-bar/ProgressBar.js +176 -0
  205. package/progress-bar/ProgressBar.stories.jsx +93 -0
  206. package/progress-bar/ProgressBar.test.js +110 -0
  207. package/progress-bar/types.d.ts +37 -0
  208. package/progress-bar/types.js +5 -0
  209. package/quick-nav/QuickNav.d.ts +4 -0
  210. package/quick-nav/QuickNav.js +117 -0
  211. package/quick-nav/QuickNav.stories.tsx +356 -0
  212. package/quick-nav/types.d.ts +21 -0
  213. package/quick-nav/types.js +5 -0
  214. package/radio-group/Radio.d.ts +4 -0
  215. package/radio-group/Radio.js +156 -0
  216. package/radio-group/RadioGroup.d.ts +4 -0
  217. package/radio-group/RadioGroup.js +283 -0
  218. package/radio-group/RadioGroup.stories.tsx +214 -0
  219. package/radio-group/RadioGroup.test.js +722 -0
  220. package/radio-group/types.d.ts +114 -0
  221. package/radio-group/types.js +5 -0
  222. package/resultsetTable/Icons.d.ts +7 -0
  223. package/resultsetTable/Icons.js +51 -0
  224. package/resultsetTable/ResultsetTable.d.ts +4 -0
  225. package/resultsetTable/ResultsetTable.js +195 -0
  226. package/resultsetTable/ResultsetTable.stories.tsx +300 -0
  227. package/resultsetTable/ResultsetTable.test.js +325 -0
  228. package/resultsetTable/types.d.ts +67 -0
  229. package/resultsetTable/types.js +5 -0
  230. package/select/Icons.d.ts +10 -0
  231. package/select/Icons.js +93 -0
  232. package/select/Listbox.d.ts +4 -0
  233. package/select/Listbox.js +169 -0
  234. package/select/Option.d.ts +4 -0
  235. package/select/Option.js +97 -0
  236. package/select/Select.d.ts +4 -0
  237. package/select/Select.js +666 -0
  238. package/select/Select.stories.tsx +971 -0
  239. package/select/Select.test.js +2228 -0
  240. package/select/types.d.ts +210 -0
  241. package/select/types.js +5 -0
  242. package/sidenav/Icons.d.ts +7 -0
  243. package/sidenav/Icons.js +51 -0
  244. package/sidenav/Sidenav.d.ts +10 -0
  245. package/sidenav/Sidenav.js +238 -0
  246. package/sidenav/Sidenav.stories.tsx +282 -0
  247. package/sidenav/Sidenav.test.js +44 -0
  248. package/sidenav/types.d.ts +76 -0
  249. package/sidenav/types.js +5 -0
  250. package/slider/Slider.d.ts +4 -0
  251. package/slider/Slider.js +342 -0
  252. package/slider/Slider.stories.tsx +240 -0
  253. package/slider/Slider.test.js +250 -0
  254. package/slider/types.d.ts +86 -0
  255. package/slider/types.js +5 -0
  256. package/spinner/Spinner.d.ts +4 -0
  257. package/spinner/Spinner.js +244 -0
  258. package/spinner/Spinner.stories.jsx +129 -0
  259. package/spinner/Spinner.test.js +64 -0
  260. package/spinner/types.d.ts +32 -0
  261. package/spinner/types.js +5 -0
  262. package/switch/Switch.d.ts +4 -0
  263. package/switch/Switch.js +262 -0
  264. package/switch/Switch.stories.tsx +171 -0
  265. package/switch/Switch.test.js +225 -0
  266. package/switch/types.d.ts +66 -0
  267. package/switch/types.js +5 -0
  268. package/table/Table.d.ts +4 -0
  269. package/{dist/table → table}/Table.js +14 -28
  270. package/table/Table.stories.jsx +356 -0
  271. package/table/Table.test.js +26 -0
  272. package/table/types.d.ts +21 -0
  273. package/table/types.js +5 -0
  274. package/tabs/Tab.d.ts +4 -0
  275. package/tabs/Tab.js +132 -0
  276. package/tabs/Tabs.d.ts +4 -0
  277. package/tabs/Tabs.js +461 -0
  278. package/tabs/Tabs.stories.tsx +226 -0
  279. package/tabs/Tabs.test.js +350 -0
  280. package/tabs/types.d.ts +92 -0
  281. package/tabs/types.js +5 -0
  282. package/tag/Tag.d.ts +4 -0
  283. package/tag/Tag.js +181 -0
  284. package/tag/Tag.stories.tsx +155 -0
  285. package/tag/Tag.test.js +60 -0
  286. package/tag/types.d.ts +69 -0
  287. package/tag/types.js +5 -0
  288. package/text-input/Icons.d.ts +8 -0
  289. package/text-input/Icons.js +60 -0
  290. package/text-input/Suggestion.d.ts +4 -0
  291. package/text-input/Suggestion.js +84 -0
  292. package/text-input/Suggestions.d.ts +4 -0
  293. package/text-input/Suggestions.js +134 -0
  294. package/text-input/TextInput.d.ts +4 -0
  295. package/text-input/TextInput.js +673 -0
  296. package/text-input/TextInput.stories.tsx +569 -0
  297. package/text-input/TextInput.test.js +1723 -0
  298. package/text-input/types.d.ts +197 -0
  299. package/text-input/types.js +5 -0
  300. package/textarea/Textarea.d.ts +4 -0
  301. package/{dist/textarea → textarea}/Textarea.js +51 -144
  302. package/textarea/Textarea.stories.jsx +216 -0
  303. package/textarea/Textarea.test.js +435 -0
  304. package/textarea/types.d.ts +137 -0
  305. package/textarea/types.js +5 -0
  306. package/toggle-group/ToggleGroup.d.ts +4 -0
  307. package/{dist/toggle-group → toggle-group}/ToggleGroup.js +42 -151
  308. package/toggle-group/ToggleGroup.stories.tsx +215 -0
  309. package/toggle-group/ToggleGroup.test.js +156 -0
  310. package/toggle-group/types.d.ts +105 -0
  311. package/toggle-group/types.js +5 -0
  312. package/typography/Typography.d.ts +4 -0
  313. package/typography/Typography.js +32 -0
  314. package/typography/Typography.stories.tsx +198 -0
  315. package/typography/types.d.ts +18 -0
  316. package/typography/types.js +5 -0
  317. package/useTheme.d.ts +1235 -0
  318. package/{dist/useTheme.js → useTheme.js} +3 -3
  319. package/useTranslatedLabels.d.ts +85 -0
  320. package/useTranslatedLabels.js +20 -0
  321. package/utils/BaseTypography.d.ts +21 -0
  322. package/utils/BaseTypography.js +108 -0
  323. package/utils/FocusLock.d.ts +13 -0
  324. package/utils/FocusLock.js +139 -0
  325. package/wizard/Wizard.d.ts +4 -0
  326. package/wizard/Wizard.js +285 -0
  327. package/wizard/Wizard.stories.tsx +253 -0
  328. package/wizard/Wizard.test.js +141 -0
  329. package/wizard/types.d.ts +64 -0
  330. package/wizard/types.js +5 -0
  331. package/README.md +0 -66
  332. package/babel.config.js +0 -8
  333. package/dist/BackgroundColorContext.js +0 -46
  334. package/dist/ThemeContext.js +0 -250
  335. package/dist/V3Select/V3Select.js +0 -549
  336. package/dist/V3Textarea/V3Textarea.js +0 -264
  337. package/dist/accordion/Accordion.js +0 -353
  338. package/dist/accordion-group/AccordionGroup.js +0 -186
  339. package/dist/alert/index.d.ts +0 -51
  340. package/dist/badge/Badge.js +0 -63
  341. package/dist/box/Box.js +0 -156
  342. package/dist/button/Button.js +0 -238
  343. package/dist/card/Card.js +0 -254
  344. package/dist/checkbox/Checkbox.js +0 -299
  345. package/dist/chip/Chip.js +0 -265
  346. package/dist/common/OpenSans.css +0 -81
  347. package/dist/common/RequiredComponent.js +0 -40
  348. package/dist/common/variables.js +0 -1582
  349. package/dist/date/Date.js +0 -379
  350. package/dist/date-input/DateInput.js +0 -400
  351. package/dist/date-input/index.d.ts +0 -95
  352. package/dist/dialog/Dialog.js +0 -218
  353. package/dist/dropdown/Dropdown.js +0 -544
  354. package/dist/file-input/FileInput.js +0 -644
  355. package/dist/file-input/FileItem.js +0 -287
  356. package/dist/file-input/index.d.ts +0 -81
  357. package/dist/footer/Footer.js +0 -421
  358. package/dist/header/Header.js +0 -470
  359. package/dist/input-text/Icons.js +0 -22
  360. package/dist/input-text/InputText.js +0 -705
  361. package/dist/layout/ApplicationLayout.js +0 -327
  362. package/dist/link/Link.js +0 -237
  363. package/dist/main.d.ts +0 -8
  364. package/dist/number-input/NumberInput.js +0 -136
  365. package/dist/number-input/index.d.ts +0 -113
  366. package/dist/paginator/Icons.js +0 -66
  367. package/dist/paginator/Paginator.js +0 -283
  368. package/dist/password-input/index.d.ts +0 -94
  369. package/dist/progress-bar/ProgressBar.js +0 -242
  370. package/dist/radio/Radio.js +0 -209
  371. package/dist/resultsetTable/ResultsetTable.js +0 -358
  372. package/dist/select/Select.js +0 -1085
  373. package/dist/select/index.d.ts +0 -53
  374. package/dist/sidenav/Sidenav.js +0 -179
  375. package/dist/slider/Slider.js +0 -404
  376. package/dist/spinner/Spinner.js +0 -381
  377. package/dist/switch/Switch.js +0 -222
  378. package/dist/tabs/Tabs.js +0 -343
  379. package/dist/tag/Tag.js +0 -282
  380. package/dist/text-input/TextInput.js +0 -974
  381. package/dist/text-input/index.d.ts +0 -135
  382. package/dist/textarea/index.d.ts +0 -117
  383. package/dist/toggle/Toggle.js +0 -220
  384. package/dist/upload/Upload.js +0 -205
  385. package/dist/upload/buttons-upload/ButtonsUpload.js +0 -135
  386. package/dist/upload/buttons-upload/Icons.js +0 -40
  387. package/dist/upload/dragAndDropArea/DragAndDropArea.js +0 -329
  388. package/dist/upload/dragAndDropArea/Icons.js +0 -39
  389. package/dist/upload/file-upload/FileToUpload.js +0 -189
  390. package/dist/upload/file-upload/Icons.js +0 -66
  391. package/dist/upload/files-upload/FilesToUpload.js +0 -123
  392. package/dist/upload/transaction/Icons.js +0 -160
  393. package/dist/upload/transaction/Transaction.js +0 -148
  394. package/dist/upload/transactions/Transactions.js +0 -138
  395. package/dist/wizard/Icons.js +0 -65
  396. package/dist/wizard/Wizard.js +0 -405
  397. package/test/Accordion.test.js +0 -33
  398. package/test/AccordionGroup.test.js +0 -125
  399. package/test/Alert.test.js +0 -53
  400. package/test/Box.test.js +0 -10
  401. package/test/Button.test.js +0 -18
  402. package/test/Card.test.js +0 -30
  403. package/test/Checkbox.test.js +0 -45
  404. package/test/Chip.test.js +0 -25
  405. package/test/Date.test.js +0 -397
  406. package/test/DateInput.test.js +0 -242
  407. package/test/Dialog.test.js +0 -23
  408. package/test/Dropdown.test.js +0 -145
  409. package/test/FileInput.test.js +0 -201
  410. package/test/Footer.test.js +0 -94
  411. package/test/Header.test.js +0 -34
  412. package/test/Heading.test.js +0 -83
  413. package/test/InputText.test.js +0 -248
  414. package/test/Link.test.js +0 -43
  415. package/test/NumberInput.test.js +0 -259
  416. package/test/Paginator.test.js +0 -177
  417. package/test/PasswordInput.test.js +0 -83
  418. package/test/ProgressBar.test.js +0 -35
  419. package/test/Radio.test.js +0 -37
  420. package/test/ResultsetTable.test.js +0 -329
  421. package/test/Sidenav.test.js +0 -45
  422. package/test/Slider.test.js +0 -74
  423. package/test/Spinner.test.js +0 -32
  424. package/test/Switch.test.js +0 -45
  425. package/test/Table.test.js +0 -36
  426. package/test/Tabs.test.js +0 -109
  427. package/test/Tag.test.js +0 -32
  428. package/test/TextInput.test.js +0 -732
  429. package/test/Textarea.test.js +0 -193
  430. package/test/ToggleGroup.test.js +0 -85
  431. package/test/Upload.test.js +0 -60
  432. package/test/V3Select.test.js +0 -212
  433. package/test/V3TextArea.test.js +0 -51
  434. package/test/Wizard.test.js +0 -130
  435. package/test/mocks/pngMock.js +0 -1
  436. package/test/mocks/svgMock.js +0 -1
  437. /package/{dist/common → common}/fonts/OpenSans-Bold.ttf +0 -0
  438. /package/{dist/common → common}/fonts/OpenSans-BoldItalic.ttf +0 -0
  439. /package/{dist/common → common}/fonts/OpenSans-ExtraBold.ttf +0 -0
  440. /package/{dist/common → common}/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  441. /package/{dist/common → common}/fonts/OpenSans-Italic.ttf +0 -0
  442. /package/{dist/common → common}/fonts/OpenSans-Light.ttf +0 -0
  443. /package/{dist/common → common}/fonts/OpenSans-LightItalic.ttf +0 -0
  444. /package/{dist/common → common}/fonts/OpenSans-Regular.ttf +0 -0
  445. /package/{dist/common → common}/fonts/OpenSans-SemiBold.ttf +0 -0
  446. /package/{dist/common → common}/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
@@ -1,1085 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
-
5
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports["default"] = void 0;
11
-
12
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
13
-
14
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
-
16
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
17
-
18
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
19
-
20
- var _react = _interopRequireWildcard(require("react"));
21
-
22
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
23
-
24
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
25
-
26
- var _variables = require("../common/variables.js");
27
-
28
- var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
29
-
30
- var _uuid = require("uuid");
31
-
32
- var _utils = require("../common/utils.js");
33
-
34
- var _Checkbox = _interopRequireDefault(require("../checkbox/Checkbox"));
35
-
36
- function _templateObject27() {
37
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n height: 16px;\n width: 16px;\n margin-left: 4px;\n color: #4d4d4d;\n"]);
38
-
39
- _templateObject27 = function _templateObject27() {
40
- return data;
41
- };
42
-
43
- return data;
44
- }
45
-
46
- function _templateObject26() {
47
- var data = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"]);
48
-
49
- _templateObject26 = function _templateObject26() {
50
- return data;
51
- };
52
-
53
- return data;
54
- }
55
-
56
- function _templateObject25() {
57
- var data = (0, _taggedTemplateLiteral2["default"])(["\n width: 16px;\n height: 16px;\n"]);
58
-
59
- _templateObject25 = function _templateObject25() {
60
- return data;
61
- };
62
-
63
- return data;
64
- }
65
-
66
- function _templateObject24() {
67
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n margin-left: 8px;\n"]);
68
-
69
- _templateObject24 = function _templateObject24() {
70
- return data;
71
- };
72
-
73
- return data;
74
- }
75
-
76
- function _templateObject23() {
77
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n width: 100%;\n overflow: hidden;\n padding-left: 8px;\n ", "\n"]);
78
-
79
- _templateObject23 = function _templateObject23() {
80
- return data;
81
- };
82
-
83
- return data;
84
- }
85
-
86
- function _templateObject22() {
87
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 4px 8px 3px 0;\n min-height: 24px;\n ", "\n ", ";\n"]);
88
-
89
- _templateObject22 = function _templateObject22() {
90
- return data;
91
- };
92
-
93
- return data;
94
- }
95
-
96
- function _templateObject21() {
97
- var data = (0, _taggedTemplateLiteral2["default"])(["\n padding: 0 8px;\n line-height: 1.715em;\n cursor: pointer;\n\n ", ";\n"]);
98
-
99
- _templateObject21 = function _templateObject21() {
100
- return data;
101
- };
102
-
103
- return data;
104
- }
105
-
106
- function _templateObject20() {
107
- var data = (0, _taggedTemplateLiteral2["default"])(["\n padding: 4px 16px;\n line-height: 1.715em;\n font-weight: 600;\n"]);
108
-
109
- _templateObject20 = function _templateObject20() {
110
- return data;
111
- };
112
-
113
- return data;
114
- }
115
-
116
- function _templateObject19() {
117
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 16px;\n width: 16px;\n padding: 4px;\n margin-right: calc(1rem * 0.25);\n"]);
118
-
119
- _templateObject19 = function _templateObject19() {
120
- return data;
121
- };
122
-
123
- return data;
124
- }
125
-
126
- function _templateObject18() {
127
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 4px 16px;\n color: ", ";\n font-size: 0.875rem;\n line-height: 1.715em;\n"]);
128
-
129
- _templateObject18 = function _templateObject18() {
130
- return data;
131
- };
132
-
133
- return data;
134
- }
135
-
136
- function _templateObject17() {
137
- var data = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n z-index: 1;\n max-height: 304px;\n overflow-x: auto;\n top: calc(100% + 4px);\n left: 0;\n margin: 0;\n padding: 4px 0;\n width: 100%;\n box-sizing: border-box;\n background-color: #ffffff;\n border-radius: 4px;\n border: 1px solid ", ";\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n cursor: default;\n font-family: ", ";\n color: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n"]);
138
-
139
- _templateObject17 = function _templateObject17() {
140
- return data;
141
- };
142
-
143
- return data;
144
- }
145
-
146
- function _templateObject16() {
147
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n font-size: 1rem;\n font-family: ", ";\n border: 1px solid transparent;\n border-radius: 2px;\n padding: 3px;\n margin-left: calc(1rem * 0.25);\n ", "\n\n background-color: ", ";\n color: ", ";\n\n ", "\n\n svg {\n line-height: 18px;\n }\n"]);
148
-
149
- _templateObject16 = function _templateObject16() {
150
- return data;
151
- };
152
-
153
- return data;
154
- }
155
-
156
- function _templateObject15() {
157
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 16px;\n width: 16px;\n padding: 4px;\n margin-left: calc(1rem * 0.25);\n\n color: ", ";\n"]);
158
-
159
- _templateObject15 = function _templateObject15() {
160
- return data;
161
- };
162
-
163
- return data;
164
- }
165
-
166
- function _templateObject14() {
167
- var data = (0, _taggedTemplateLiteral2["default"])(["\n min-height: 1.5em;\n color: ", ";\n font-family: ", ";\n font-size: 0.75rem;\n font-weight: 400;\n line-height: 1.5em;\n"]);
168
-
169
- _templateObject14 = function _templateObject14() {
170
- return data;
171
- };
172
-
173
- return data;
174
- }
175
-
176
- function _templateObject13() {
177
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n padding: 3px;\n height: 18px;\n width: 18px;\n margin-left: calc(1rem * 0.25);\n pointer-events: none;\n color: ", ";\n\n svg {\n line-height: 18px;\n font-size: 1.25rem;\n }\n"]);
178
-
179
- _templateObject13 = function _templateObject13() {
180
- return data;
181
- };
182
-
183
- return data;
184
- }
185
-
186
- function _templateObject12() {
187
- var data = (0, _taggedTemplateLiteral2["default"])(["\n grid-area: 1 / 1 / 1 / 1;\n height: calc(calc(1rem * 2.5) - calc(1px * 2));\n background: none;\n border: none;\n outline: none;\n padding: 0 calc(1rem * 0.5);\n\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5em;\n\n ::placeholder {\n color: ", ";\n }\n"]);
188
-
189
- _templateObject12 = function _templateObject12() {
190
- return data;
191
- };
192
-
193
- return data;
194
- }
195
-
196
- function _templateObject11() {
197
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: none;\n"]);
198
-
199
- _templateObject11 = function _templateObject11() {
200
- return data;
201
- };
202
-
203
- return data;
204
- }
205
-
206
- function _templateObject10() {
207
- var data = (0, _taggedTemplateLiteral2["default"])(["\n grid-area: 1 / 1 / 1 / 1;\n display: inline-flex;\n align-items: center;\n height: calc(calc(1rem * 2.5) - calc(1px * 2));\n padding: 0 calc(1rem * 0.5);\n user-select: none;\n overflow: hidden;\n\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5em;\n"]);
208
-
209
- _templateObject10 = function _templateObject10() {
210
- return data;
211
- };
212
-
213
- return data;
214
- }
215
-
216
- function _templateObject9() {
217
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: grid;\n width: 100%;\n"]);
218
-
219
- _templateObject9 = function _templateObject9() {
220
- return data;
221
- };
222
-
223
- return data;
224
- }
225
-
226
- function _templateObject8() {
227
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n user-select: none;\n background-color: ", ";\n border-right: 1px solid ", ";\n font-family: ", ";\n font-size: 11px;\n ", "\n"]);
228
-
229
- _templateObject8 = function _templateObject8() {
230
- return data;
231
- };
232
-
233
- return data;
234
- }
235
-
236
- function _templateObject7() {
237
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n font-size: 1rem;\n font-family: ", ";\n border: 1px solid transparent;\n padding: 3px;\n ", "\n background-color: ", ";\n color: ", ";\n\n ", "\n\n svg {\n line-height: 18px;\n }\n"]);
238
-
239
- _templateObject7 = function _templateObject7() {
240
- return data;
241
- };
242
-
243
- return data;
244
- }
245
-
246
- function _templateObject6() {
247
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n border: 1px solid ", ";\n border-radius: 2px;\n width: 48px;\n"]);
248
-
249
- _templateObject6 = function _templateObject6() {
250
- return data;
251
- };
252
-
253
- return data;
254
- }
255
-
256
- function _templateObject5() {
257
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n position: relative;\n align-items: center;\n height: calc(calc(1rem * 2.5) - calc(1px * 2));\n margin: calc(1rem * 0.25) 0;\n padding: 0 calc(1rem * 0.5);\n outline: none;\n ", "\n box-shadow: 0 0 0 2px transparent;\n border-radius: 4px;\n border: 1px solid\n ", ";\n ", "\n ", ";\n\n ", ";\n"]);
258
-
259
- _templateObject5 = function _templateObject5() {
260
- return data;
261
- };
262
-
263
- return data;
264
- }
265
-
266
- function _templateObject4() {
267
- var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5em;\n"]);
268
-
269
- _templateObject4 = function _templateObject4() {
270
- return data;
271
- };
272
-
273
- return data;
274
- }
275
-
276
- function _templateObject3() {
277
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"]);
278
-
279
- _templateObject3 = function _templateObject3() {
280
- return data;
281
- };
282
-
283
- return data;
284
- }
285
-
286
- function _templateObject2() {
287
- var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.715em;\n cursor: default;\n"]);
288
-
289
- _templateObject2 = function _templateObject2() {
290
- return data;
291
- };
292
-
293
- return data;
294
- }
295
-
296
- function _templateObject() {
297
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"]);
298
-
299
- _templateObject = function _templateObject() {
300
- return data;
301
- };
302
-
303
- return data;
304
- }
305
-
306
- var selectIcons = {
307
- error: _react["default"].createElement("svg", {
308
- xmlns: "http://www.w3.org/2000/svg",
309
- height: "24px",
310
- viewBox: "0 0 24 24",
311
- width: "24px",
312
- fill: "currentColor"
313
- }, _react["default"].createElement("path", {
314
- 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"
315
- })),
316
- arrowUp: _react["default"].createElement("svg", {
317
- xmlns: "http://www.w3.org/2000/svg",
318
- height: "24px",
319
- viewBox: "0 0 24 24",
320
- width: "24px",
321
- fill: "currentColor"
322
- }, _react["default"].createElement("path", {
323
- d: "M0 0h24v24H0V0z",
324
- fill: "none"
325
- }), _react["default"].createElement("path", {
326
- d: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6 1.41 1.41z"
327
- })),
328
- arrowDown: _react["default"].createElement("svg", {
329
- xmlns: "http://www.w3.org/2000/svg",
330
- height: "24px",
331
- viewBox: "0 0 24 24",
332
- width: "24px",
333
- fill: "currentColor"
334
- }, _react["default"].createElement("path", {
335
- d: "M0 0h24v24H0V0z",
336
- fill: "none"
337
- }), _react["default"].createElement("path", {
338
- d: "M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"
339
- })),
340
- clear: _react["default"].createElement("svg", {
341
- xmlns: "http://www.w3.org/2000/svg",
342
- width: "24",
343
- height: "24",
344
- viewBox: "0 0 24 24",
345
- fill: "currentColor"
346
- }, _react["default"].createElement("path", {
347
- d: "M0 0h24v24H0V0z",
348
- fill: "none"
349
- }), _react["default"].createElement("path", {
350
- 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"
351
- })),
352
- selected: _react["default"].createElement("svg", {
353
- xmlns: "http://www.w3.org/2000/svg",
354
- height: "24px",
355
- viewBox: "0 0 24 24",
356
- width: "24px",
357
- fill: "currentColor"
358
- }, _react["default"].createElement("path", {
359
- d: "M0 0h24v24H0z",
360
- fill: "none"
361
- }), _react["default"].createElement("path", {
362
- d: "M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"
363
- })),
364
- searchOff: _react["default"].createElement("svg", {
365
- xmlns: "http://www.w3.org/2000/svg",
366
- height: "24px",
367
- viewBox: "0 0 24 24",
368
- width: "24px",
369
- fill: "currentColor"
370
- }, _react["default"].createElement("g", null, _react["default"].createElement("rect", {
371
- fill: "none",
372
- height: "24",
373
- width: "24"
374
- })), _react["default"].createElement("g", null, _react["default"].createElement("g", null, _react["default"].createElement("path", {
375
- d: "M15.5,14h-0.79l-0.28-0.27C15.41,12.59,16,11.11,16,9.5C16,5.91,13.09,3,9.5,3C6.08,3,3.28,5.64,3.03,9h2.02 C5.3,6.75,7.18,5,9.5,5C11.99,5,14,7.01,14,9.5S11.99,14,9.5,14c-0.17,0-0.33-0.03-0.5-0.05v2.02C9.17,15.99,9.33,16,9.5,16 c1.61,0,3.09-0.59,4.23-1.57L14,14.71v0.79l5,4.99L20.49,19L15.5,14z"
376
- }), _react["default"].createElement("polygon", {
377
- points: "6.47,10.82 4,13.29 1.53,10.82 0.82,11.53 3.29,14 0.82,16.47 1.53,17.18 4,14.71 6.47,17.18 7.18,16.47 4.71,14 7.18,11.53"
378
- }))))
379
- };
380
-
381
- var getNotOptionalErrorMessage = function getNotOptionalErrorMessage() {
382
- return "This field is required. Please, enter a value.";
383
- };
384
-
385
- var DxcSelect = _react["default"].forwardRef(function (_ref, ref) {
386
- var _ref3;
387
-
388
- var _ref$label = _ref.label,
389
- label = _ref$label === void 0 ? "" : _ref$label,
390
- _ref$name = _ref.name,
391
- name = _ref$name === void 0 ? "" : _ref$name,
392
- value = _ref.value,
393
- options = _ref.options,
394
- _ref$helperText = _ref.helperText,
395
- helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
396
- _ref$placeholder = _ref.placeholder,
397
- placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder,
398
- _ref$disabled = _ref.disabled,
399
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
400
- _ref$optional = _ref.optional,
401
- optional = _ref$optional === void 0 ? false : _ref$optional,
402
- _ref$searchable = _ref.searchable,
403
- searchable = _ref$searchable === void 0 ? false : _ref$searchable,
404
- _ref$multiple = _ref.multiple,
405
- multiple = _ref$multiple === void 0 ? false : _ref$multiple,
406
- onChange = _ref.onChange,
407
- onBlur = _ref.onBlur,
408
- _ref$error = _ref.error,
409
- error = _ref$error === void 0 ? "" : _ref$error,
410
- margin = _ref.margin,
411
- _ref$size = _ref.size,
412
- size = _ref$size === void 0 ? "medium" : _ref$size,
413
- _ref$tabIndex = _ref.tabIndex,
414
- tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
415
-
416
- var _useState = (0, _react.useState)("select-".concat((0, _uuid.v4)())),
417
- _useState2 = (0, _slicedToArray2["default"])(_useState, 1),
418
- selectId = _useState2[0];
419
-
420
- var selectLabelId = "label-".concat(selectId);
421
-
422
- var _useState3 = (0, _react.useState)(multiple ? [] : ""),
423
- _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
424
- innerValue = _useState4[0],
425
- setInnerValue = _useState4[1];
426
-
427
- var _useState5 = (0, _react.useState)(""),
428
- _useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
429
- searchValue = _useState6[0],
430
- setSearchValue = _useState6[1];
431
-
432
- var _useState7 = (0, _react.useState)(false),
433
- _useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
434
- isBackgroundValue = _useState8[0],
435
- changeIsBackgroundValue = _useState8[1];
436
-
437
- var _useState9 = (0, _react.useState)(false),
438
- _useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
439
- isOpen = _useState10[0],
440
- changeIsOpen = _useState10[1];
441
-
442
- var _useState11 = (0, _react.useState)(false),
443
- _useState12 = (0, _slicedToArray2["default"])(_useState11, 2),
444
- isActiveOption = _useState12[0],
445
- changeIsActiveOption = _useState12[1];
446
-
447
- var _useState13 = (0, _react.useState)(false),
448
- _useState14 = (0, _slicedToArray2["default"])(_useState13, 2),
449
- isScrollable = _useState14[0],
450
- changeIsScrollable = _useState14[1];
451
-
452
- var _useState15 = (0, _react.useState)([]),
453
- _useState16 = (0, _slicedToArray2["default"])(_useState15, 2),
454
- filteredOptions = _useState16[0],
455
- setFilteredOptions = _useState16[1];
456
-
457
- var _useState17 = (0, _react.useState)(-1),
458
- _useState18 = (0, _slicedToArray2["default"])(_useState17, 2),
459
- visualFocusIndex = _useState18[0],
460
- changeVisualFocusIndex = _useState18[1];
461
-
462
- var selectContainerRef = (0, _react.useRef)(null);
463
- var selectSearchInputRef = (0, _react.useRef)(null);
464
- var selectOptionsListRef = (0, _react.useRef)(null);
465
- var colorsTheme = (0, _useTheme["default"])();
466
- var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
467
- var optionalEmptyOption = {
468
- label: placeholder,
469
- value: ""
470
- };
471
-
472
- var notOptionalCheck = function notOptionalCheck(value) {
473
- return value === "" && !optional;
474
- };
475
-
476
- var notOptionalMultipleCheck = function notOptionalMultipleCheck() {
477
- return (value !== null && value !== void 0 ? value : innerValue).length === 0 && !optional;
478
- };
479
-
480
- var canBeOpenOptions = function canBeOpenOptions() {
481
- return !disabled && (options === null || options === void 0 ? void 0 : options.length) > 0 && groupsHaveOptions();
482
- };
483
-
484
- var groupsHaveOptions = function groupsHaveOptions() {
485
- return options[0].hasOwnProperty("options") ? options[0].options ? options.some(function (groupOption) {
486
- return groupOption.options.length > 0;
487
- }) : false : true;
488
- };
489
-
490
- var filteredGroupsHaveOptions = function filteredGroupsHaveOptions() {
491
- return filteredOptions !== null && filteredOptions !== void 0 && filteredOptions[0].options ? filteredOptions.some(function (groupOption) {
492
- var _groupOption$options;
493
-
494
- return ((_groupOption$options = groupOption.options) === null || _groupOption$options === void 0 ? void 0 : _groupOption$options.length) > 0;
495
- }) : true;
496
- };
497
-
498
- var openOptions = function openOptions() {
499
- if (!isOpen && canBeOpenOptions()) {
500
- searchable && changeIsBackgroundValue(true);
501
- changeIsOpen(true);
502
- }
503
- };
504
-
505
- var closeOptions = function closeOptions() {
506
- if (isOpen) {
507
- searchable && changeIsBackgroundValue(false);
508
- changeIsOpen(false);
509
- changeVisualFocusIndex(-1);
510
- }
511
- };
512
-
513
- var handleSelectChangeValue = function handleSelectChangeValue(newOption) {
514
- if (multiple) {
515
- var _res, _res2;
516
-
517
- var res;
518
- if ((value !== null && value !== void 0 ? value : innerValue).includes(newOption.value)) value ? res = value.filter(function (optionVal) {
519
- return optionVal !== newOption.value;
520
- }) : setInnerValue(function (previous) {
521
- return previous.filter(function (optionVal) {
522
- return optionVal !== newOption.value;
523
- });
524
- });else value ? res = [].concat((0, _toConsumableArray2["default"])(value), [newOption.value]) : setInnerValue(function (previous) {
525
- return [].concat((0, _toConsumableArray2["default"])(previous), [newOption.value]);
526
- });
527
- if (notOptionalMultipleCheck(newOption.value)) onChange === null || onChange === void 0 ? void 0 : onChange({
528
- value: (_res = res) !== null && _res !== void 0 ? _res : innerValue,
529
- error: getNotOptionalErrorMessage()
530
- });else onChange === null || onChange === void 0 ? void 0 : onChange({
531
- value: (_res2 = res) !== null && _res2 !== void 0 ? _res2 : innerValue,
532
- error: null
533
- });
534
- } else {
535
- value !== null && value !== void 0 ? value : setInnerValue(newOption.value);
536
- if (notOptionalCheck(newOption.value)) onChange === null || onChange === void 0 ? void 0 : onChange({
537
- value: newOption.value,
538
- error: getNotOptionalErrorMessage()
539
- });else onChange === null || onChange === void 0 ? void 0 : onChange({
540
- value: newOption.value,
541
- error: null
542
- });
543
- }
544
- };
545
-
546
- var handleSelectOnClick = function handleSelectOnClick() {
547
- changeVisualFocusIndex(0);
548
- isOpen ? closeOptions() : openOptions();
549
- searchable && selectSearchInputRef.current.focus();
550
- };
551
-
552
- var handleSelectOnFocus = function handleSelectOnFocus() {
553
- searchable && selectSearchInputRef.current.focus();
554
- };
555
-
556
- var handleSelectOnBlur = function handleSelectOnBlur(event) {
557
- // focus leaves container (outside, not to childs)
558
- if (!event.currentTarget.contains(event.relatedTarget)) {
559
- closeOptions();
560
- setSearchValue("");
561
- if (notOptionalCheck(value !== null && value !== void 0 ? value : innerValue)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
562
- value: value !== null && value !== void 0 ? value : innerValue,
563
- error: getNotOptionalErrorMessage()
564
- });else onBlur === null || onBlur === void 0 ? void 0 : onBlur({
565
- value: value !== null && value !== void 0 ? value : innerValue,
566
- error: null
567
- });
568
- }
569
- };
570
-
571
- var handleSelectOnKeyDown = function handleSelectOnKeyDown(event) {
572
- switch (event.keyCode) {
573
- case 40:
574
- // Arrow Down
575
- event.preventDefault();
576
- changeVisualFocusIndex(function (visualFocusIndex) {
577
- if (visualFocusIndex < lastOptionIndex) return visualFocusIndex + 1;else if (visualFocusIndex === lastOptionIndex) return 0;
578
- });
579
- openOptions();
580
- changeIsActiveOption(false);
581
- isOpen && changeIsScrollable(true);
582
- break;
583
-
584
- case 38:
585
- // Arrow Up
586
- event.preventDefault();
587
- changeVisualFocusIndex(function (visualFocusIndex) {
588
- return visualFocusIndex === 0 || visualFocusIndex === -1 ? lastOptionIndex : visualFocusIndex - 1;
589
- });
590
- openOptions();
591
- changeIsActiveOption(false);
592
- isOpen && changeIsScrollable(true);
593
- break;
594
-
595
- case 27:
596
- // Esc
597
- event.preventDefault();
598
- closeOptions();
599
- setSearchValue("");
600
- break;
601
-
602
- case 13:
603
- // Enter
604
- if (isOpen) {
605
- var accLength = optional && !multiple ? 1 : 0;
606
-
607
- if (searchable) {
608
- if (filteredOptions.length > 0) {
609
- if (optional && !multiple && visualFocusIndex === 0 && filteredGroupsHaveOptions()) handleSelectChangeValue(optionalEmptyOption);else filteredOptions[0].options ? filteredGroupsHaveOptions() && filteredOptions.some(function (groupOption) {
610
- var groupLength = accLength + groupOption.options.length;
611
- groupLength > visualFocusIndex && handleSelectChangeValue(groupOption.options[visualFocusIndex - accLength]);
612
- accLength = groupLength;
613
- return groupLength > visualFocusIndex;
614
- }) : handleSelectChangeValue(filteredOptions[visualFocusIndex - accLength]);
615
- }
616
- } else {
617
- if (optional && !multiple && visualFocusIndex === 0) handleSelectChangeValue(optionalEmptyOption);else options[0].options ? options.some(function (groupOption) {
618
- var groupLength = accLength + groupOption.options.length;
619
- groupLength > visualFocusIndex && handleSelectChangeValue(groupOption.options[visualFocusIndex - accLength]);
620
- accLength = groupLength;
621
- return groupLength > visualFocusIndex;
622
- }) : handleSelectChangeValue(options[visualFocusIndex - accLength]);
623
- }
624
-
625
- !multiple && closeOptions();
626
- setSearchValue("");
627
- }
628
-
629
- break;
630
- }
631
- };
632
-
633
- var handleSearchIOnChange = function handleSearchIOnChange(event) {
634
- setSearchValue(event.target.value);
635
- !isOpen && changeVisualFocusIndex(0);
636
- openOptions();
637
- };
638
-
639
- var handleClearActionOnClick = function handleClearActionOnClick(event) {
640
- event.stopPropagation();
641
- setSearchValue("");
642
- };
643
-
644
- var handleClearOptionsActionOnClick = function handleClearOptionsActionOnClick(event) {
645
- event.stopPropagation();
646
- value !== null && value !== void 0 ? value : setInnerValue([]);
647
- onChange === null || onChange === void 0 ? void 0 : onChange({
648
- value: [],
649
- error: getNotOptionalErrorMessage()
650
- });
651
- selectContainerRef.current.focus();
652
- };
653
-
654
- var getLastOptionIndex = function getLastOptionIndex() {
655
- var last = 0;
656
-
657
- var reducer = function reducer(acc, current) {
658
- var _current$options;
659
-
660
- return acc + ((_current$options = current.options) === null || _current$options === void 0 ? void 0 : _current$options.length);
661
- };
662
-
663
- if (searchable && filteredOptions.length > 0) filteredOptions[0].options ? last = filteredOptions.reduce(reducer, 0) - 1 : last = filteredOptions.length - 1;else if ((options === null || options === void 0 ? void 0 : options.length) > 0) options[0].options ? last = options.reduce(reducer, 0) - 1 : last = options.length - 1;
664
- return optional && !multiple ? last + 1 : last;
665
- };
666
-
667
- var lastOptionIndex = (0, _react.useMemo)(function () {
668
- return getLastOptionIndex();
669
- }, [searchable, optional, multiple, searchable ? filteredOptions : options]);
670
-
671
- var getSelectedOption = function getSelectedOption() {
672
- var val = value !== null && value !== void 0 ? value : innerValue;
673
- var selectedOption = multiple ? [] : "";
674
-
675
- if (multiple) {
676
- if ((options === null || options === void 0 ? void 0 : options.length) > 0) {
677
- options.forEach(function (option) {
678
- if (option.options) {
679
- option.options.forEach(function (singleOption) {
680
- if (val.includes(singleOption.value)) selectedOption.push(singleOption);
681
- });
682
- } else if (val.includes(option.value)) selectedOption.push(option);
683
- });
684
- }
685
- } else {
686
- if ((options === null || options === void 0 ? void 0 : options.length) > 0) {
687
- options.forEach(function (option) {
688
- if (option.options) {
689
- option.options.forEach(function (singleOption) {
690
- if (singleOption.value === val) selectedOption = singleOption;
691
- });
692
- } else if (option.value === val) selectedOption = option;
693
- });
694
- }
695
- }
696
-
697
- return selectedOption;
698
- };
699
-
700
- var selectedOption = (0, _react.useMemo)(function () {
701
- return getSelectedOption();
702
- }, [options, multiple, value !== null && value !== void 0 ? value : innerValue]);
703
- (0, _react.useLayoutEffect)(function () {
704
- if (isScrollable) {
705
- var _selectOptionsListRef;
706
-
707
- var visualFocusedOptionEl = selectOptionsListRef === null || selectOptionsListRef === void 0 ? void 0 : (_selectOptionsListRef = selectOptionsListRef.current) === null || _selectOptionsListRef === void 0 ? void 0 : _selectOptionsListRef.querySelectorAll("[role='option']")[visualFocusIndex];
708
- visualFocusedOptionEl === null || visualFocusedOptionEl === void 0 ? void 0 : visualFocusedOptionEl.scrollIntoView({
709
- block: "nearest",
710
- inline: "start"
711
- });
712
- return changeIsScrollable(false);
713
- }
714
- }, [isScrollable]);
715
- (0, _react.useEffect)(function () {
716
- if (searchable && (options === null || options === void 0 ? void 0 : options.length) > 0) {
717
- if (options[0].options) {
718
- setFilteredOptions(options.map(function (optionGroup) {
719
- var group = JSON.parse(JSON.stringify(optionGroup)); // circular issue
720
-
721
- group.options = group.options.filter(function (option) {
722
- return option.label.toUpperCase().includes(searchValue.toUpperCase());
723
- });
724
- return group;
725
- }));
726
- } else setFilteredOptions(options.filter(function (option) {
727
- return option.label.toUpperCase().includes(searchValue.toUpperCase());
728
- }));
729
- }
730
- }, [options, searchable, searchValue]);
731
- (0, _react.useEffect)(function () {
732
- visualFocusIndex > lastOptionIndex && changeVisualFocusIndex(0);
733
- }, [filteredOptions]);
734
-
735
- var Option = function Option(_ref2) {
736
- var option = _ref2.option,
737
- index = _ref2.index,
738
- _ref2$isGroupedOption = _ref2.isGroupedOption,
739
- isGroupedOption = _ref2$isGroupedOption === void 0 ? false : _ref2$isGroupedOption;
740
- var isSelected = multiple ? (value !== null && value !== void 0 ? value : innerValue).includes(option.value) : (value !== null && value !== void 0 ? value : innerValue) === option.value;
741
- var isLastOption = index === lastOptionIndex;
742
- return _react["default"].createElement(OptionItem, {
743
- onMouseDown: function onMouseDown(event) {
744
- // left mouse button only
745
- event.button === 0 && changeIsActiveOption(true);
746
- },
747
- onMouseUp: function onMouseUp(event) {
748
- if (event.button === 0 && isActiveOption) {
749
- // left mouse button only
750
- handleSelectChangeValue(option);
751
- !multiple && closeOptions();
752
- setSearchValue("");
753
- changeIsActiveOption(false);
754
- }
755
- },
756
- onMouseEnter: function onMouseEnter() {
757
- changeVisualFocusIndex(index);
758
- },
759
- onMouseLeave: function onMouseLeave() {
760
- changeIsActiveOption(false);
761
- },
762
- visualFocused: visualFocusIndex === index,
763
- active: visualFocusIndex === index && isActiveOption,
764
- selected: isSelected,
765
- "aria-selected": isSelected && "true",
766
- role: "option"
767
- }, _react["default"].createElement(StyledOption, {
768
- visualFocused: visualFocusIndex === index,
769
- active: visualFocusIndex === index && isActiveOption,
770
- selected: isSelected,
771
- last: isLastOption,
772
- grouped: isGroupedOption,
773
- multiple: multiple
774
- }, multiple && _react["default"].createElement(_Checkbox["default"], {
775
- tabIndex: -1,
776
- checked: isSelected
777
- }), option.icon && _react["default"].createElement(OptionIcon, null, typeof option.icon === "string" ? _react["default"].createElement(OptionIconImg, {
778
- src: option.icon
779
- }) : option.icon), _react["default"].createElement(OptionContent, {
780
- grouped: isGroupedOption,
781
- hasIcon: option.icon,
782
- multiple: multiple
783
- }, _react["default"].createElement(OptionLabel, null, option.label), !multiple && isSelected && _react["default"].createElement(SelectedIcon, null, selectIcons.selected))));
784
- };
785
-
786
- var global_index = optional && !multiple ? 0 : -1; // index for options (not groups), starting from 0 to options.length -1
787
-
788
- var mapOptionFunc = function mapOptionFunc(option) {
789
- if (option.options) {
790
- return _react["default"].createElement(_react["default"].Fragment, null, option.options.length > 0 && _react["default"].createElement(OptionGroupLabel, null, option.label), option.options.map(function (singleOption) {
791
- global_index++;
792
- return _react["default"].createElement(Option, {
793
- option: singleOption,
794
- index: global_index,
795
- isGroupedOption: true
796
- });
797
- }));
798
- } else {
799
- global_index++;
800
- return _react["default"].createElement(Option, {
801
- option: option,
802
- index: global_index
803
- });
804
- }
805
- };
806
-
807
- return _react["default"].createElement(_styledComponents.ThemeProvider, {
808
- theme: colorsTheme.select
809
- }, _react["default"].createElement(DxcSelectContainer, {
810
- margin: margin,
811
- size: size,
812
- ref: ref
813
- }, _react["default"].createElement(Label, {
814
- id: selectLabelId,
815
- disabled: disabled,
816
- backgroundType: backgroundType,
817
- onClick: function onClick() {
818
- selectContainerRef.current.focus();
819
- }
820
- }, label, " ", optional && _react["default"].createElement(OptionalLabel, null, "(Optional)")), _react["default"].createElement(HelperText, {
821
- disabled: disabled,
822
- backgroundType: backgroundType
823
- }, helperText), _react["default"].createElement(SelectContainer, {
824
- id: selectId,
825
- backgroundType: backgroundType,
826
- disabled: disabled,
827
- error: error,
828
- onBlur: handleSelectOnBlur,
829
- onClick: handleSelectOnClick,
830
- onFocus: handleSelectOnFocus,
831
- onKeyDown: handleSelectOnKeyDown,
832
- ref: selectContainerRef,
833
- tabIndex: tabIndex,
834
- "aria-labelledby": selectLabelId
835
- }, multiple && selectedOption.length > 0 && _react["default"].createElement(SelectionIndicator, null, _react["default"].createElement(SelectionValue, null, selectedOption.length, " "), _react["default"].createElement(ClearOptionsAction, {
836
- onClick: handleClearOptionsActionOnClick,
837
- backgroundType: backgroundType,
838
- tabIndex: -1,
839
- title: "Clear selected options",
840
- "aria-label": "Clear selected options"
841
- }, selectIcons.clear)), _react["default"].createElement(SearchableValueContainer, null, _react["default"].createElement(ValueInput, {
842
- name: name,
843
- value: value !== null && value !== void 0 ? value : innerValue,
844
- readOnly: true
845
- }), searchable && _react["default"].createElement(SearchInput, {
846
- value: searchValue,
847
- disabled: disabled,
848
- onChange: handleSearchIOnChange,
849
- ref: selectSearchInputRef,
850
- autoComplete: "off",
851
- autoCorrect: "off"
852
- }), (!searchable || searchValue === "") && (multiple ? _react["default"].createElement(SelectedOption, {
853
- disabled: disabled,
854
- backgroundValue: (value !== null && value !== void 0 ? value : innerValue).length === 0 || isBackgroundValue
855
- }, _react["default"].createElement(OptionLabel, null, selectedOption.map(function (option) {
856
- return option.label;
857
- }).join(", ")), selectedOption.length === 0 && placeholder) : _react["default"].createElement(SelectedOption, {
858
- disabled: disabled,
859
- backgroundValue: !(value !== null && value !== void 0 ? value : innerValue) || isBackgroundValue
860
- }, _react["default"].createElement(OptionLabel, null, (_ref3 = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) !== null && _ref3 !== void 0 ? _ref3 : placeholder)))), !disabled && error && _react["default"].createElement(ErrorIcon, {
861
- backgroundType: backgroundType
862
- }, selectIcons.error), searchable && searchValue.length > 0 && _react["default"].createElement(ClearAction, {
863
- onClick: handleClearActionOnClick,
864
- backgroundType: backgroundType,
865
- tabIndex: -1,
866
- title: "Clear search text",
867
- "aria-label": "Clear search text"
868
- }, selectIcons.clear), _react["default"].createElement(Arrow, {
869
- disabled: disabled,
870
- backgroundType: backgroundType
871
- }, isOpen ? selectIcons.arrowUp : selectIcons.arrowDown), isOpen && _react["default"].createElement(OptionsList, {
872
- onClick: function onClick(event) {
873
- event.stopPropagation();
874
- },
875
- onMouseDown: function onMouseDown(event) {
876
- event.preventDefault();
877
- },
878
- ref: selectOptionsListRef,
879
- role: "listbox",
880
- "aria-label": label
881
- }, searchable && (filteredOptions.length === 0 || !filteredGroupsHaveOptions()) ? _react["default"].createElement(OptionsSystemMessage, null, _react["default"].createElement(NoMatchesFoundIcon, null, selectIcons.searchOff), "No matches found") : optional && !multiple && _react["default"].createElement(Option, {
882
- option: optionalEmptyOption,
883
- index: 0
884
- }), searchable ? filteredOptions.map(mapOptionFunc) : options.map(mapOptionFunc))), !disabled && _react["default"].createElement(Error, {
885
- backgroundType: backgroundType
886
- }, error)));
887
- });
888
-
889
- var sizes = {
890
- small: "240px",
891
- medium: "360px",
892
- large: "480px",
893
- fillParent: "100%"
894
- };
895
-
896
- var calculateWidth = function calculateWidth(margin, size) {
897
- return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
898
- };
899
-
900
- var DxcSelectContainer = _styledComponents["default"].div(_templateObject(), function (props) {
901
- return calculateWidth(props.margin, props.size);
902
- }, function (props) {
903
- return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
904
- }, function (props) {
905
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
906
- }, function (props) {
907
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
908
- }, function (props) {
909
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
910
- }, function (props) {
911
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
912
- });
913
-
914
- var Label = _styledComponents["default"].span(_templateObject2(), function (props) {
915
- return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledLabelFontColorOnDark : props.theme.disabledLabelFontColor : props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
916
- }, function (props) {
917
- return props.theme.fontFamily;
918
- }, function (props) {
919
- return props.theme.labelFontSize;
920
- }, function (props) {
921
- return props.theme.labelFontStyle;
922
- }, function (props) {
923
- return props.theme.labelFontWeight;
924
- });
925
-
926
- var OptionalLabel = _styledComponents["default"].span(_templateObject3(), function (props) {
927
- return props.theme.optionalLabelFontWeight;
928
- });
929
-
930
- var HelperText = _styledComponents["default"].span(_templateObject4(), function (props) {
931
- return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledHelperTextFontColorOnDark : props.theme.disabledHelperTextFontColor : props.backgroundType === "dark" ? props.theme.helperTextFontColorOnDark : props.theme.helperTextFontColor;
932
- }, function (props) {
933
- return props.theme.fontFamily;
934
- }, function (props) {
935
- return props.theme.helperTextFontSize;
936
- }, function (props) {
937
- return props.theme.helperTextFontStyle;
938
- }, function (props) {
939
- return props.theme.helperTextFontWeight;
940
- });
941
-
942
- var SelectContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
943
- if (props.disabled) return props.backgroundType === "dark" ? "background-color: ".concat(props.theme.disabledContainerFillColorOnDark, ";") : "background-color: ".concat(props.theme.disabledContainerFillColor, ";");
944
- }, function (props) {
945
- if (props.disabled) return props.backgroundType === "dark" ? props.theme.disabledBorderColorOnDark : props.theme.disabledBorderColor;else return props.backgroundType === "dark" ? props.theme.enabledBorderColorOnDark : props.theme.enabledBorderColor;
946
- }, function (props) {
947
- 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 ");
948
- }, function (props) {
949
- return props.disabled ? "cursor: not-allowed;" : "cursor: pointer;";
950
- }, function (props) {
951
- 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 ");
952
- });
953
-
954
- var SelectionIndicator = _styledComponents["default"].span(_templateObject6(), function (props) {
955
- return props.theme.selectionIndicatorBorderColor;
956
- });
957
-
958
- var ClearOptionsAction = _styledComponents["default"].button(_templateObject7(), function (props) {
959
- return props.theme.fontFamily;
960
- }, function (props) {
961
- return props.disabled ? "cursor: not-allowed;" : "cursor: pointer;";
962
- }, function (props) {
963
- return props.theme.enabledSelectionIndicatorActionBackgroundColor;
964
- }, function (props) {
965
- return props.theme.enabledSelectionIndicatorActionIconColor;
966
- }, function (props) {
967
- return !props.disabled && "\n &:hover {\n background-color: ".concat(props.theme.hoverSelectionIndicatorActionBackgroundColor, ";\n color: ").concat(props.theme.hoverSelectionIndicatorActionIconColor, ";\n }\n &:active {\n background-color: ").concat(props.theme.activeSelectionIndicatorActionBackgroundColor, ";\n color: ").concat(props.theme.activeSelectionIndicatorActionIconColor, ";\n }\n ");
968
- });
969
-
970
- var SelectionValue = _styledComponents["default"].span(_templateObject8(), function (props) {
971
- return props.theme.selectionIndicatorBackgroundColor;
972
- }, function (props) {
973
- return props.theme.selectionIndicatorBorderColor;
974
- }, function (props) {
975
- return props.theme.fontFamily;
976
- }, function (props) {
977
- return props.disabled ? "cursor: not-allowed;" : "cursor: default;";
978
- });
979
-
980
- var SearchableValueContainer = _styledComponents["default"].div(_templateObject9());
981
-
982
- var SelectedOption = _styledComponents["default"].span(_templateObject10(), function (props) {
983
- if (props.backgroundValue) return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPlaceholderFontColorOnDark : props.theme.disabledPlaceholderFontColor : props.backgroundType === "dark" ? props.theme.placeholderFontColorOnDark : props.theme.placeholderFontColor;else return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledValueFontColorOnDark : props.theme.disabledValueFontColor : props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
984
- }, function (props) {
985
- return props.theme.fontFamily;
986
- }, function (props) {
987
- return props.theme.valueFontSize;
988
- }, function (props) {
989
- return props.theme.valueFontStyle;
990
- }, function (props) {
991
- return props.theme.valueFontWeight;
992
- });
993
-
994
- var ValueInput = _styledComponents["default"].input(_templateObject11());
995
-
996
- var SearchInput = _styledComponents["default"].input(_templateObject12(), function (props) {
997
- return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledValueFontColorOnDark : props.theme.disabledValueFontColor : props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
998
- }, function (props) {
999
- return props.theme.fontFamily;
1000
- }, function (props) {
1001
- return props.theme.valueFontSize;
1002
- }, function (props) {
1003
- return props.theme.valueFontStyle;
1004
- }, function (props) {
1005
- return props.theme.valueFontWeight;
1006
- }, function (props) {
1007
- return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPlaceholderFontColorOnDark : props.theme.disabledPlaceholderFontColor : props.backgroundType === "dark" ? props.theme.placeholderFontColorOnDark : props.theme.placeholderFontColor;
1008
- });
1009
-
1010
- var ErrorIcon = _styledComponents["default"].span(_templateObject13(), function (props) {
1011
- return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
1012
- });
1013
-
1014
- var Error = _styledComponents["default"].span(_templateObject14(), function (props) {
1015
- return props.backgroundType === "dark" ? props.theme.errorMessageColorOnDark : props.theme.errorMessageColor;
1016
- }, function (props) {
1017
- return props.theme.fontFamily;
1018
- });
1019
-
1020
- var Arrow = _styledComponents["default"].span(_templateObject15(), function (props) {
1021
- return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledArrowColorOnDark : props.theme.disabledArrowColor : props.backgroundType === "dark" ? props.theme.arrowColorOnDark : props.theme.arrowColor;
1022
- });
1023
-
1024
- var ClearAction = _styledComponents["default"].button(_templateObject16(), function (props) {
1025
- return props.theme.fontFamily;
1026
- }, function (props) {
1027
- return props.disabled ? "cursor: not-allowed;" : "cursor: pointer;";
1028
- }, function (props) {
1029
- return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionBackgroundColorOnDark : props.theme.disabledActionBackgroundColor : props.backgroundType === "dark" ? props.theme.actionBackgroundColorOnDark : props.theme.actionBackgroundColor;
1030
- }, function (props) {
1031
- return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionIconColorOnDark : props.theme.disabledActionIconColor : props.backgroundType === "dark" ? props.theme.actionIconColorOnDark : props.theme.actionIconColor;
1032
- }, function (props) {
1033
- return !props.disabled && "\n &:hover {\n background-color: ".concat(props.backgroundType === "dark" ? props.theme.hoverActionBackgroundColorOnDark : props.theme.hoverActionBackgroundColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.hoverActionIconColorOnDark : props.theme.hoverActionIconColor, ";\n }\n &: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 ");
1034
- });
1035
-
1036
- var OptionsList = _styledComponents["default"].ul(_templateObject17(), function (props) {
1037
- return props.theme.enabledListBorderColor;
1038
- }, function (props) {
1039
- return props.theme.fontFamily;
1040
- }, function (props) {
1041
- return props.theme.listOptionFontColor;
1042
- }, function (props) {
1043
- return props.theme.listOptionFontSize;
1044
- }, function (props) {
1045
- return props.theme.listOptionFontStyle;
1046
- }, function (props) {
1047
- return props.theme.listOptionFontWeight;
1048
- });
1049
-
1050
- var OptionsSystemMessage = _styledComponents["default"].span(_templateObject18(), function (props) {
1051
- return props.theme.systemMessageFontColor;
1052
- });
1053
-
1054
- var NoMatchesFoundIcon = _styledComponents["default"].span(_templateObject19());
1055
-
1056
- var OptionGroupLabel = _styledComponents["default"].li(_templateObject20());
1057
-
1058
- var OptionItem = _styledComponents["default"].li(_templateObject21(), function (props) {
1059
- if (props.selected) {
1060
- if (props.active) return "background-color: #BFBFBF";else if (props.visualFocused) return "background-color: #CCCCCC";else return "background-color: ".concat(props.theme.selectedListOptionBackgroundColor);
1061
- } else {
1062
- if (props.active) return "background-color: ".concat(props.theme.activeListOptionBackgroundColor, ";");else if (props.visualFocused) return "background-color: ".concat(props.theme.hoverListOptionBackgroundColor, ";");
1063
- }
1064
- });
1065
-
1066
- var StyledOption = _styledComponents["default"].span(_templateObject22(), function (props) {
1067
- return props.grouped && props.multiple && "padding-left: 16px;";
1068
- }, function (props) {
1069
- return props.last ? "border-bottom: 1px solid transparent" : "border-bottom: 1px solid ".concat(props.theme.listOptionBorderBottomColor);
1070
- });
1071
-
1072
- var OptionContent = _styledComponents["default"].span(_templateObject23(), function (props) {
1073
- return props.grouped && !props.multiple && !props.hasIcon && "padding-left: 16px;";
1074
- });
1075
-
1076
- var OptionIcon = _styledComponents["default"].span(_templateObject24());
1077
-
1078
- var OptionIconImg = _styledComponents["default"].img(_templateObject25());
1079
-
1080
- var OptionLabel = _styledComponents["default"].span(_templateObject26());
1081
-
1082
- var SelectedIcon = _styledComponents["default"].span(_templateObject27());
1083
-
1084
- var _default = DxcSelect;
1085
- exports["default"] = _default;