@dxc-technology/halstack-react 0.0.0-50712b5 → 0.0.0-50acff4

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