@dxc-technology/halstack-react 0.0.0-da224ae → 0.0.0-da3a230

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 (437) hide show
  1. package/BackgroundColorContext.d.ts +1 -0
  2. package/BackgroundColorContext.js +6 -26
  3. package/HalstackContext.d.ts +1249 -0
  4. package/HalstackContext.js +310 -0
  5. package/README.md +47 -0
  6. package/accordion/Accordion.accessibility.test.js +71 -0
  7. package/accordion/Accordion.d.ts +1 -1
  8. package/accordion/Accordion.js +105 -194
  9. package/accordion/Accordion.stories.tsx +251 -0
  10. package/accordion/Accordion.test.js +56 -0
  11. package/accordion/types.d.ts +12 -23
  12. package/accordion-group/AccordionGroup.accessibility.test.js +88 -0
  13. package/accordion-group/AccordionGroup.d.ts +3 -3
  14. package/accordion-group/AccordionGroup.js +39 -108
  15. package/accordion-group/AccordionGroup.stories.tsx +252 -0
  16. package/accordion-group/AccordionGroup.test.js +98 -0
  17. package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
  18. package/accordion-group/AccordionGroupAccordion.js +31 -0
  19. package/accordion-group/AccordionGroupContext.d.ts +3 -0
  20. package/accordion-group/AccordionGroupContext.js +8 -0
  21. package/accordion-group/types.d.ts +18 -23
  22. package/action-icon/ActionIcon.accessibility.test.js +63 -0
  23. package/action-icon/ActionIcon.d.ts +4 -0
  24. package/action-icon/ActionIcon.js +48 -0
  25. package/action-icon/ActionIcon.stories.tsx +41 -0
  26. package/action-icon/ActionIcon.test.js +64 -0
  27. package/action-icon/types.d.ts +26 -0
  28. package/alert/Alert.accessibility.test.js +95 -0
  29. package/alert/Alert.js +36 -126
  30. package/alert/Alert.stories.tsx +28 -0
  31. package/alert/Alert.test.js +75 -0
  32. package/alert/types.d.ts +6 -6
  33. package/badge/Badge.accessibility.test.js +129 -0
  34. package/badge/Badge.d.ts +4 -0
  35. package/badge/Badge.js +142 -40
  36. package/badge/Badge.stories.tsx +210 -0
  37. package/badge/Badge.test.js +30 -0
  38. package/badge/types.d.ts +54 -0
  39. package/badge/types.js +5 -0
  40. package/bleed/Bleed.d.ts +3 -0
  41. package/bleed/Bleed.js +43 -0
  42. package/bleed/Bleed.stories.tsx +342 -0
  43. package/bleed/types.d.ts +37 -0
  44. package/bleed/types.js +5 -0
  45. package/box/Box.accessibility.test.js +33 -0
  46. package/box/Box.d.ts +1 -1
  47. package/box/Box.js +32 -86
  48. package/box/Box.stories.tsx +38 -51
  49. package/box/Box.test.js +13 -0
  50. package/box/types.d.ts +3 -18
  51. package/bulleted-list/BulletedList.accessibility.test.js +107 -0
  52. package/bulleted-list/BulletedList.d.ts +7 -0
  53. package/bulleted-list/BulletedList.js +92 -0
  54. package/bulleted-list/BulletedList.stories.tsx +115 -0
  55. package/bulleted-list/types.d.ts +38 -0
  56. package/bulleted-list/types.js +5 -0
  57. package/button/Button.accessibility.test.js +127 -0
  58. package/button/Button.d.ts +1 -1
  59. package/button/Button.js +65 -121
  60. package/button/Button.stories.tsx +155 -106
  61. package/button/Button.test.js +38 -0
  62. package/button/types.d.ts +14 -14
  63. package/card/Card.accessibility.test.js +36 -0
  64. package/card/Card.d.ts +1 -1
  65. package/card/Card.js +59 -104
  66. package/card/Card.stories.tsx +171 -0
  67. package/card/Card.test.js +39 -0
  68. package/card/types.d.ts +8 -15
  69. package/checkbox/Checkbox.accessibility.test.js +87 -0
  70. package/checkbox/Checkbox.d.ts +2 -2
  71. package/checkbox/Checkbox.js +145 -183
  72. package/checkbox/Checkbox.stories.tsx +166 -136
  73. package/checkbox/Checkbox.test.js +199 -0
  74. package/checkbox/types.d.ts +20 -8
  75. package/chip/Chip.accessibility.test.js +67 -0
  76. package/chip/Chip.d.ts +4 -0
  77. package/chip/Chip.js +49 -146
  78. package/chip/Chip.stories.tsx +104 -30
  79. package/chip/Chip.test.js +41 -0
  80. package/chip/types.d.ts +45 -0
  81. package/chip/types.js +5 -0
  82. package/common/coreTokens.d.ts +237 -0
  83. package/common/coreTokens.js +184 -0
  84. package/common/utils.d.ts +1 -0
  85. package/common/utils.js +6 -12
  86. package/common/variables.d.ts +1395 -0
  87. package/common/variables.js +1034 -1344
  88. package/container/Container.d.ts +4 -0
  89. package/container/Container.js +194 -0
  90. package/container/Container.stories.tsx +214 -0
  91. package/container/types.d.ts +74 -0
  92. package/container/types.js +5 -0
  93. package/contextual-menu/ContextualMenu.accessibility.test.js +86 -0
  94. package/contextual-menu/ContextualMenu.d.ts +7 -0
  95. package/contextual-menu/ContextualMenu.js +71 -0
  96. package/contextual-menu/ContextualMenu.stories.tsx +182 -0
  97. package/contextual-menu/ContextualMenu.test.js +71 -0
  98. package/contextual-menu/MenuItemAction.d.ts +4 -0
  99. package/contextual-menu/MenuItemAction.js +46 -0
  100. package/contextual-menu/types.d.ts +22 -0
  101. package/contextual-menu/types.js +5 -0
  102. package/date-input/Calendar.d.ts +4 -0
  103. package/date-input/Calendar.js +214 -0
  104. package/date-input/DateInput.accessibility.test.js +216 -0
  105. package/date-input/DateInput.js +174 -313
  106. package/date-input/DateInput.stories.tsx +203 -56
  107. package/date-input/DateInput.test.js +808 -0
  108. package/date-input/DatePicker.d.ts +4 -0
  109. package/date-input/DatePicker.js +121 -0
  110. package/date-input/YearPicker.d.ts +4 -0
  111. package/date-input/YearPicker.js +100 -0
  112. package/date-input/types.d.ts +86 -22
  113. package/dialog/Dialog.accessibility.test.js +69 -0
  114. package/dialog/Dialog.d.ts +1 -1
  115. package/dialog/Dialog.js +69 -130
  116. package/dialog/Dialog.stories.tsx +320 -167
  117. package/dialog/Dialog.test.js +307 -0
  118. package/dialog/types.d.ts +18 -25
  119. package/divider/Divider.accessibility.test.js +33 -0
  120. package/divider/Divider.d.ts +4 -0
  121. package/divider/Divider.js +36 -0
  122. package/divider/Divider.stories.tsx +223 -0
  123. package/divider/Divider.test.js +38 -0
  124. package/divider/types.d.ts +21 -0
  125. package/divider/types.js +5 -0
  126. package/dropdown/Dropdown.accessibility.test.js +180 -0
  127. package/dropdown/Dropdown.d.ts +1 -1
  128. package/dropdown/Dropdown.js +232 -330
  129. package/dropdown/Dropdown.stories.tsx +427 -0
  130. package/dropdown/Dropdown.test.js +599 -0
  131. package/dropdown/DropdownMenu.d.ts +4 -0
  132. package/dropdown/DropdownMenu.js +63 -0
  133. package/dropdown/DropdownMenuItem.d.ts +4 -0
  134. package/dropdown/DropdownMenuItem.js +70 -0
  135. package/dropdown/types.d.ts +38 -31
  136. package/file-input/FileInput.accessibility.test.js +160 -0
  137. package/file-input/FileInput.d.ts +4 -0
  138. package/file-input/FileInput.js +274 -363
  139. package/file-input/FileInput.stories.tsx +618 -0
  140. package/file-input/FileInput.test.js +382 -0
  141. package/file-input/FileItem.d.ts +4 -0
  142. package/file-input/FileItem.js +61 -133
  143. package/file-input/types.d.ts +129 -0
  144. package/file-input/types.js +5 -0
  145. package/flex/Flex.d.ts +4 -0
  146. package/flex/Flex.js +57 -0
  147. package/flex/Flex.stories.tsx +112 -0
  148. package/flex/types.d.ts +97 -0
  149. package/flex/types.js +5 -0
  150. package/footer/Footer.accessibility.test.js +117 -0
  151. package/footer/Footer.d.ts +1 -1
  152. package/footer/Footer.js +74 -200
  153. package/footer/{Footer.stories.jsx → Footer.stories.tsx} +84 -39
  154. package/footer/Footer.test.js +85 -0
  155. package/footer/Icons.d.ts +3 -0
  156. package/footer/Icons.js +67 -8
  157. package/footer/types.d.ts +41 -38
  158. package/grid/Grid.d.ts +7 -0
  159. package/grid/Grid.js +76 -0
  160. package/grid/Grid.stories.tsx +219 -0
  161. package/grid/types.d.ts +115 -0
  162. package/grid/types.js +5 -0
  163. package/header/Header.accessibility.test.js +84 -0
  164. package/header/Header.d.ts +4 -3
  165. package/header/Header.js +103 -218
  166. package/header/Header.stories.tsx +251 -0
  167. package/header/Header.test.js +66 -0
  168. package/header/Icons.d.ts +2 -0
  169. package/header/Icons.js +4 -9
  170. package/header/types.d.ts +6 -18
  171. package/heading/Heading.accessibility.test.js +33 -0
  172. package/heading/Heading.js +11 -33
  173. package/heading/Heading.stories.tsx +54 -0
  174. package/heading/Heading.test.js +169 -0
  175. package/heading/types.d.ts +7 -7
  176. package/icon/Icon.accessibility.test.js +30 -0
  177. package/icon/Icon.d.ts +4 -0
  178. package/icon/Icon.js +33 -0
  179. package/icon/Icon.stories.tsx +28 -0
  180. package/icon/types.d.ts +4 -0
  181. package/icon/types.js +5 -0
  182. package/image/Image.accessibility.test.js +56 -0
  183. package/image/Image.d.ts +4 -0
  184. package/image/Image.js +70 -0
  185. package/image/Image.stories.tsx +129 -0
  186. package/image/types.d.ts +72 -0
  187. package/image/types.js +5 -0
  188. package/inset/Inset.d.ts +3 -0
  189. package/inset/Inset.js +43 -0
  190. package/inset/Inset.stories.tsx +230 -0
  191. package/inset/types.d.ts +37 -0
  192. package/inset/types.js +5 -0
  193. package/layout/ApplicationLayout.d.ts +20 -0
  194. package/layout/ApplicationLayout.js +83 -184
  195. package/layout/ApplicationLayout.stories.tsx +162 -0
  196. package/layout/Icons.d.ts +8 -0
  197. package/layout/Icons.js +49 -48
  198. package/layout/types.d.ts +41 -0
  199. package/layout/types.js +5 -0
  200. package/link/Link.accessibility.test.js +112 -0
  201. package/link/Link.d.ts +3 -2
  202. package/link/Link.js +65 -109
  203. package/link/Link.stories.tsx +199 -16
  204. package/link/Link.test.js +63 -0
  205. package/link/types.d.ts +15 -35
  206. package/main.d.ts +19 -14
  207. package/main.js +92 -98
  208. package/nav-tabs/NavTabs.accessibility.test.js +44 -0
  209. package/nav-tabs/NavTabs.d.ts +7 -0
  210. package/nav-tabs/NavTabs.js +93 -0
  211. package/nav-tabs/NavTabs.stories.tsx +279 -0
  212. package/nav-tabs/NavTabs.test.js +75 -0
  213. package/nav-tabs/NavTabsContext.d.ts +3 -0
  214. package/nav-tabs/NavTabsContext.js +8 -0
  215. package/nav-tabs/Tab.d.ts +4 -0
  216. package/nav-tabs/Tab.js +117 -0
  217. package/nav-tabs/types.d.ts +52 -0
  218. package/nav-tabs/types.js +5 -0
  219. package/number-input/NumberInput.accessibility.test.js +228 -0
  220. package/number-input/NumberInput.js +48 -48
  221. package/number-input/NumberInput.stories.tsx +44 -28
  222. package/number-input/NumberInput.test.js +989 -0
  223. package/number-input/NumberInputContext.d.ts +3 -0
  224. package/number-input/NumberInputContext.js +3 -11
  225. package/number-input/types.d.ts +34 -15
  226. package/package.json +52 -51
  227. package/paginator/Icons.d.ts +5 -0
  228. package/paginator/Icons.js +21 -47
  229. package/paginator/Paginator.accessibility.test.js +79 -0
  230. package/paginator/Paginator.js +35 -98
  231. package/paginator/Paginator.stories.tsx +24 -0
  232. package/paginator/Paginator.test.js +335 -0
  233. package/paginator/types.d.ts +3 -3
  234. package/paragraph/Paragraph.accessibility.test.js +28 -0
  235. package/paragraph/Paragraph.d.ts +5 -0
  236. package/paragraph/Paragraph.js +22 -0
  237. package/paragraph/Paragraph.stories.tsx +27 -0
  238. package/password-input/Icons.d.ts +6 -0
  239. package/password-input/Icons.js +35 -0
  240. package/password-input/PasswordInput.accessibility.test.js +153 -0
  241. package/password-input/PasswordInput.js +60 -125
  242. package/password-input/PasswordInput.stories.tsx +3 -35
  243. package/password-input/PasswordInput.test.js +198 -0
  244. package/password-input/types.d.ts +35 -24
  245. package/progress-bar/ProgressBar.accessibility.test.js +35 -0
  246. package/progress-bar/ProgressBar.js +66 -92
  247. package/progress-bar/ProgressBar.stories.tsx +93 -0
  248. package/progress-bar/ProgressBar.test.js +93 -0
  249. package/progress-bar/types.d.ts +3 -3
  250. package/quick-nav/QuickNav.accessibility.test.js +57 -0
  251. package/quick-nav/QuickNav.d.ts +4 -0
  252. package/quick-nav/QuickNav.js +94 -0
  253. package/quick-nav/QuickNav.stories.tsx +356 -0
  254. package/quick-nav/types.d.ts +21 -0
  255. package/quick-nav/types.js +5 -0
  256. package/radio-group/Radio.d.ts +4 -0
  257. package/radio-group/Radio.js +124 -0
  258. package/radio-group/RadioGroup.accessibility.test.js +97 -0
  259. package/radio-group/RadioGroup.d.ts +4 -0
  260. package/radio-group/RadioGroup.js +235 -0
  261. package/radio-group/RadioGroup.stories.tsx +214 -0
  262. package/radio-group/RadioGroup.test.js +756 -0
  263. package/radio-group/types.d.ts +114 -0
  264. package/radio-group/types.js +5 -0
  265. package/resultset-table/Icons.d.ts +7 -0
  266. package/resultset-table/Icons.js +47 -0
  267. package/resultset-table/ResultsetTable.accessibility.test.js +274 -0
  268. package/resultset-table/ResultsetTable.d.ts +7 -0
  269. package/resultset-table/ResultsetTable.js +170 -0
  270. package/resultset-table/ResultsetTable.stories.tsx +401 -0
  271. package/resultset-table/ResultsetTable.test.js +381 -0
  272. package/resultset-table/types.d.ts +100 -0
  273. package/resultset-table/types.js +5 -0
  274. package/select/Icons.d.ts +10 -0
  275. package/select/Icons.js +89 -0
  276. package/select/Listbox.d.ts +4 -0
  277. package/select/Listbox.js +143 -0
  278. package/select/Option.d.ts +4 -0
  279. package/select/Option.js +87 -0
  280. package/select/Select.accessibility.test.js +217 -0
  281. package/select/Select.d.ts +4 -0
  282. package/select/Select.js +240 -515
  283. package/select/Select.stories.tsx +602 -204
  284. package/select/Select.test.js +2370 -0
  285. package/select/types.d.ts +209 -0
  286. package/select/types.js +5 -0
  287. package/sidenav/Sidenav.accessibility.test.js +59 -0
  288. package/sidenav/Sidenav.d.ts +6 -5
  289. package/sidenav/Sidenav.js +137 -72
  290. package/sidenav/Sidenav.stories.tsx +277 -0
  291. package/sidenav/Sidenav.test.js +37 -0
  292. package/sidenav/SidenavContext.d.ts +5 -0
  293. package/sidenav/SidenavContext.js +13 -0
  294. package/sidenav/types.d.ts +52 -26
  295. package/slider/Slider.accessibility.test.js +104 -0
  296. package/slider/Slider.d.ts +2 -2
  297. package/slider/Slider.js +150 -182
  298. package/slider/Slider.test.js +254 -0
  299. package/slider/types.d.ts +11 -3
  300. package/spinner/Spinner.accessibility.test.js +96 -0
  301. package/spinner/Spinner.js +32 -76
  302. package/spinner/{Spinner.stories.jsx → Spinner.stories.tsx} +53 -26
  303. package/spinner/Spinner.test.js +55 -0
  304. package/spinner/types.d.ts +3 -3
  305. package/status-light/StatusLight.accessibility.test.js +157 -0
  306. package/status-light/StatusLight.d.ts +4 -0
  307. package/status-light/StatusLight.js +51 -0
  308. package/status-light/StatusLight.stories.tsx +74 -0
  309. package/status-light/StatusLight.test.js +25 -0
  310. package/status-light/types.d.ts +17 -0
  311. package/status-light/types.js +5 -0
  312. package/switch/Switch.accessibility.test.js +89 -0
  313. package/switch/Switch.d.ts +2 -2
  314. package/switch/Switch.js +150 -115
  315. package/switch/Switch.stories.tsx +45 -68
  316. package/switch/Switch.test.js +180 -0
  317. package/switch/types.d.ts +13 -5
  318. package/table/DropdownTheme.js +62 -0
  319. package/table/Table.accessibility.test.js +82 -0
  320. package/table/Table.d.ts +6 -2
  321. package/table/Table.js +80 -37
  322. package/table/Table.stories.tsx +651 -0
  323. package/table/Table.test.js +113 -0
  324. package/table/types.d.ts +34 -6
  325. package/tabs/Tab.d.ts +4 -0
  326. package/tabs/Tab.js +117 -0
  327. package/tabs/Tabs.accessibility.test.js +56 -0
  328. package/tabs/Tabs.d.ts +1 -1
  329. package/tabs/Tabs.js +307 -145
  330. package/tabs/Tabs.stories.tsx +224 -0
  331. package/tabs/Tabs.test.js +276 -0
  332. package/tabs/types.d.ts +48 -27
  333. package/tag/Tag.accessibility.test.js +69 -0
  334. package/tag/Tag.d.ts +1 -1
  335. package/tag/Tag.js +44 -86
  336. package/tag/Tag.stories.tsx +37 -30
  337. package/tag/Tag.test.js +41 -0
  338. package/tag/types.d.ts +25 -16
  339. package/text-input/Suggestion.d.ts +4 -0
  340. package/text-input/Suggestion.js +67 -0
  341. package/text-input/Suggestions.d.ts +4 -0
  342. package/text-input/Suggestions.js +86 -0
  343. package/text-input/TextInput.accessibility.test.js +321 -0
  344. package/text-input/TextInput.d.ts +4 -0
  345. package/text-input/TextInput.js +335 -593
  346. package/text-input/TextInput.stories.tsx +465 -0
  347. package/text-input/TextInput.test.js +1756 -0
  348. package/text-input/types.d.ts +205 -0
  349. package/text-input/types.js +5 -0
  350. package/textarea/Textarea.accessibility.test.js +155 -0
  351. package/textarea/Textarea.d.ts +4 -0
  352. package/textarea/Textarea.js +98 -181
  353. package/textarea/Textarea.stories.tsx +174 -0
  354. package/textarea/Textarea.test.js +406 -0
  355. package/textarea/types.d.ts +141 -0
  356. package/textarea/types.js +5 -0
  357. package/toggle-group/ToggleGroup.accessibility.test.js +107 -0
  358. package/toggle-group/ToggleGroup.d.ts +4 -0
  359. package/toggle-group/ToggleGroup.js +101 -142
  360. package/toggle-group/ToggleGroup.stories.tsx +79 -39
  361. package/toggle-group/ToggleGroup.test.js +137 -0
  362. package/toggle-group/types.d.ts +114 -0
  363. package/toggle-group/types.js +5 -0
  364. package/typography/Typography.accessibility.test.js +339 -0
  365. package/typography/Typography.d.ts +4 -0
  366. package/typography/Typography.js +23 -0
  367. package/typography/Typography.stories.tsx +198 -0
  368. package/typography/types.d.ts +18 -0
  369. package/typography/types.js +5 -0
  370. package/useTheme.d.ts +1148 -0
  371. package/useTheme.js +4 -11
  372. package/useTranslatedLabels.d.ts +85 -0
  373. package/useTranslatedLabels.js +14 -0
  374. package/utils/BaseTypography.d.ts +21 -0
  375. package/utils/BaseTypography.js +94 -0
  376. package/utils/FocusLock.d.ts +13 -0
  377. package/utils/FocusLock.js +124 -0
  378. package/wizard/Wizard.accessibility.test.js +55 -0
  379. package/wizard/Wizard.d.ts +1 -1
  380. package/wizard/Wizard.js +123 -104
  381. package/wizard/{Wizard.stories.jsx → Wizard.stories.tsx} +48 -19
  382. package/wizard/Wizard.test.js +114 -0
  383. package/wizard/types.d.ts +15 -15
  384. package/ThemeContext.js +0 -246
  385. package/V3Select/V3Select.js +0 -455
  386. package/V3Select/index.d.ts +0 -27
  387. package/V3Textarea/V3Textarea.js +0 -260
  388. package/V3Textarea/index.d.ts +0 -27
  389. package/chip/index.d.ts +0 -22
  390. package/common/OpenSans.css +0 -81
  391. package/common/RequiredComponent.js +0 -32
  392. package/common/fonts/OpenSans-Bold.ttf +0 -0
  393. package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
  394. package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
  395. package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  396. package/common/fonts/OpenSans-Italic.ttf +0 -0
  397. package/common/fonts/OpenSans-Light.ttf +0 -0
  398. package/common/fonts/OpenSans-LightItalic.ttf +0 -0
  399. package/common/fonts/OpenSans-Regular.ttf +0 -0
  400. package/common/fonts/OpenSans-SemiBold.ttf +0 -0
  401. package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  402. package/date/Date.js +0 -373
  403. package/date/index.d.ts +0 -27
  404. package/file-input/index.d.ts +0 -81
  405. package/input-text/Icons.js +0 -22
  406. package/input-text/InputText.js +0 -611
  407. package/input-text/index.d.ts +0 -36
  408. package/progress-bar/ProgressBar.stories.jsx +0 -58
  409. package/radio/Radio.d.ts +0 -4
  410. package/radio/Radio.js +0 -174
  411. package/radio/Radio.stories.tsx +0 -192
  412. package/radio/types.d.ts +0 -54
  413. package/resultsetTable/ResultsetTable.js +0 -274
  414. package/resultsetTable/index.d.ts +0 -19
  415. package/select/index.d.ts +0 -131
  416. package/slider/Slider.stories.tsx +0 -177
  417. package/table/Table.stories.jsx +0 -276
  418. package/text-input/index.d.ts +0 -135
  419. package/textarea/Textarea.stories.jsx +0 -135
  420. package/textarea/index.d.ts +0 -117
  421. package/toggle/Toggle.js +0 -186
  422. package/toggle/index.d.ts +0 -21
  423. package/toggle-group/index.d.ts +0 -21
  424. package/upload/Upload.js +0 -201
  425. package/upload/buttons-upload/ButtonsUpload.js +0 -111
  426. package/upload/buttons-upload/Icons.js +0 -40
  427. package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
  428. package/upload/dragAndDropArea/Icons.js +0 -39
  429. package/upload/file-upload/FileToUpload.js +0 -115
  430. package/upload/file-upload/Icons.js +0 -66
  431. package/upload/files-upload/FilesToUpload.js +0 -109
  432. package/upload/index.d.ts +0 -15
  433. package/upload/transaction/Icons.js +0 -160
  434. package/upload/transaction/Transaction.js +0 -104
  435. package/upload/transactions/Transactions.js +0 -94
  436. package/wizard/Icons.js +0 -65
  437. /package/{radio → action-icon}/types.js +0 -0
@@ -1,17 +1,18 @@
1
1
  import React from "react";
2
-
3
- import { userEvent, within, waitFor } from "@storybook/testing-library";
4
- import { fireEvent } from "@testing-library/react";
5
-
2
+ import { userEvent, within } from "@storybook/testing-library";
6
3
  import Title from "../../.storybook/components/Title";
7
4
  import ExampleContainer from "../../.storybook/components/ExampleContainer";
8
-
9
5
  import DxcSelect from "./Select";
6
+ import Listbox from "./Listbox";
7
+ import { ThemeProvider } from "styled-components";
8
+ import useTheme from "../useTheme";
9
+ import { HalstackProvider } from "../HalstackContext";
10
10
 
11
11
  export default {
12
12
  title: "Select",
13
13
  component: DxcSelect,
14
14
  };
15
+
15
16
  const one_option = [{ label: "Option 01", value: "1" }];
16
17
 
17
18
  const single_options = [
@@ -20,6 +21,7 @@ const single_options = [
20
21
  { label: "Option 03", value: "3" },
21
22
  { label: "Option 04", value: "4" },
22
23
  ];
24
+
23
25
  const group_options = [
24
26
  {
25
27
  label: "Group 001",
@@ -62,6 +64,7 @@ const group_options = [
62
64
  ],
63
65
  },
64
66
  ];
67
+
65
68
  const icon_options_grouped = [
66
69
  {
67
70
  label: "Group 001",
@@ -125,6 +128,7 @@ const icon_options_grouped = [
125
128
  ],
126
129
  },
127
130
  ];
131
+
128
132
  const icon_options = [
129
133
  {
130
134
  label: "3G Mobile",
@@ -173,6 +177,7 @@ const icon_options = [
173
177
  ),
174
178
  },
175
179
  ];
180
+
176
181
  const url_options = [
177
182
  {
178
183
  label: "Social Media",
@@ -183,14 +188,35 @@ const url_options = [
183
188
  icon: "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Instagram_logo_2016.svg/800px-Instagram_logo_2016.svg.png",
184
189
  },
185
190
  {
186
- label: "Twitter",
187
- value: "twitter",
188
- icon: "https://cdn.computerhoy.com/sites/navi.axelspringer.es/public/styles/480/public/media/image/2013/08/17981-logo-twitter.png?itok=dElA6iAV",
191
+ label: "X",
192
+ value: "x",
193
+ icon: "https://static.dezeen.com/uploads/2023/07/x-logo-twitter-elon-musk_dezeen_2364_col_0.jpg",
189
194
  },
190
195
  {
191
196
  label: "Facebook",
192
197
  value: "facebook",
193
- icon: "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b8/2021_Facebook_icon.svg/2048px-2021_Facebook_icon.svg.png",
198
+ icon: (
199
+ <svg
200
+ version="1.1"
201
+ x="0px"
202
+ y="0px"
203
+ width="438.536px"
204
+ height="438.536px"
205
+ viewBox="0 0 438.536 438.536"
206
+ fill="#4267B2"
207
+ >
208
+ <g>
209
+ <path
210
+ d="M414.41,24.123C398.333,8.042,378.963,0,356.315,0H82.228C59.58,0,40.21,8.042,24.126,24.123
211
+ C8.045,40.207,0.003,59.576,0.003,82.225v274.084c0,22.647,8.042,42.018,24.123,58.102c16.084,16.084,35.454,24.126,58.102,24.126
212
+ h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225
213
+ C438.532,59.576,430.49,40.204,414.41,24.123z M373.155,225.548h-49.963V406.84h-74.802V225.548H210.99V163.02h37.401v-37.402
214
+ c0-26.838,6.283-47.107,18.843-60.813c12.559-13.706,33.304-20.555,62.242-20.555h49.963v62.526h-31.401
215
+ c-10.663,0-17.467,1.853-20.417,5.568c-2.949,3.711-4.428,10.23-4.428,19.558v31.119h56.534L373.155,225.548z"
216
+ />
217
+ </g>
218
+ </svg>
219
+ ),
194
220
  },
195
221
  {
196
222
  label: "Pinterest",
@@ -220,14 +246,25 @@ const url_options = [
220
246
  ],
221
247
  },
222
248
  ];
249
+
223
250
  const optionsWithEllipsisMedium = [
224
251
  { label: "Optiond1234567890123456789012345678901234", value: "1" },
225
252
  { label: "Optiond12345678901234567890123456789012345", value: "2" },
226
253
  { label: "Option 031111111111111111111111111111222", value: "3" },
227
- { label: "Option 03111111111111111111111111111122", value: "4" },
228
254
  ];
255
+
256
+ const opinionatedTheme = {
257
+ select: {
258
+ selectedOptionBackgroundColor: "#e6f4ff",
259
+ fontColor: "#000000",
260
+ optionFontColor: "#000000",
261
+ hoverBorderColor: "#a46ede",
262
+ },
263
+ };
264
+
229
265
  const Select = () => (
230
266
  <>
267
+ <Title title="States" theme="light" level={2} />
231
268
  <ExampleContainer pseudoState="pseudo-hover">
232
269
  <Title title="Hovered" theme="light" level={4} />
233
270
  <DxcSelect label="Hovered" options={single_options} />
@@ -242,126 +279,500 @@ const Select = () => (
242
279
  </ExampleContainer>
243
280
  <ExampleContainer>
244
281
  <Title title="Disabled with value" theme="light" level={4} />
245
- <DxcSelect label="Disabled with value" disabled options={single_options} value="1" />
282
+ <DxcSelect label="Disabled with value" disabled options={single_options} defaultValue="1" />
246
283
  </ExampleContainer>
247
284
  <ExampleContainer>
248
- <Title title="With label" theme="light" level={4} />
249
- <DxcSelect label="Label" options={single_options} />
250
- <Title title="Label and placeholder" theme="light" level={4} />
251
- <DxcSelect label="Label" options={single_options} placeholder="Placeholder" />
252
- <Title title="Label, placeholder and helper text" theme="light" level={4} />
253
- <DxcSelect label="Label" options={single_options} helperText="Helper text" placeholder="Placeholder" />
254
285
  <Title title="Error" theme="light" level={4} />
255
286
  <DxcSelect
256
287
  label="Label"
257
288
  options={single_options}
258
- error="Error message"
289
+ error="Error message."
259
290
  helperText="Helper text"
260
291
  placeholder="Placeholder"
261
292
  />
293
+ </ExampleContainer>
294
+ <ExampleContainer pseudoState="pseudo-hover">
295
+ <Title title="Hovered error" theme="light" level={4} />
296
+ <DxcSelect
297
+ label="Label"
298
+ options={single_options}
299
+ error="Error message."
300
+ helperText="Helper text"
301
+ placeholder="Placeholder"
302
+ />
303
+ </ExampleContainer>
304
+ <Title title="Anatomy" theme="light" level={2} />
305
+ <ExampleContainer>
306
+ <Title title="Label, placeholder and helper text" theme="light" level={4} />
307
+ <DxcSelect label="Label" options={single_options} helperText="Helper text" placeholder="Placeholder" />
308
+ </ExampleContainer>
309
+ <Title title="Variants" theme="light" level={2} />
310
+ <ExampleContainer>
262
311
  <Title title="Simple selection" theme="light" level={4} />
263
- <DxcSelect label="Simple selection" searchable options={single_options} value="2" />
312
+ <DxcSelect label="Simple selection" searchable options={single_options} defaultValue="2" />
313
+ </ExampleContainer>
314
+ <ExampleContainer>
264
315
  <Title title="Multiple selection" theme="light" level={4} />
265
- <DxcSelect label="Multiple select" searchable options={single_options} multiple value={["1", "2"]} />
316
+ <DxcSelect label="Multiple select" searchable options={single_options} multiple defaultValue={["1", "2"]} />
266
317
  </ExampleContainer>
267
-
268
318
  <ExampleContainer pseudoState="pseudo-hover">
269
319
  <Title title="Multiple clear hovered" theme="light" level={4} />
270
- <DxcSelect label="Multiple select" options={single_options} multiple value={["1", "2"]} />
320
+ <DxcSelect label="Multiple select" options={single_options} multiple defaultValue={["1", "2"]} />
271
321
  </ExampleContainer>
272
-
273
322
  <ExampleContainer pseudoState="pseudo-active">
274
323
  <Title title="Multiple clear actived" theme="light" level={4} />
275
- <DxcSelect label="Multiple select" options={single_options} multiple value={["1", "2"]} />
324
+ <DxcSelect label="Multiple select" options={single_options} multiple defaultValue={["1", "2"]} />
325
+ </ExampleContainer>
326
+ <Title title="Sizes" theme="light" level={2} />
327
+ <ExampleContainer>
328
+ <Title title="Small size" theme="light" level={4} />
329
+ <DxcSelect label="Small" options={single_options} size="small" />
330
+ </ExampleContainer>
331
+ <ExampleContainer>
332
+ <Title title="Medium size" theme="light" level={4} />
333
+ <DxcSelect label="Medium" options={single_options} size="medium" />
334
+ </ExampleContainer>
335
+ <ExampleContainer>
336
+ <Title title="Large size" theme="light" level={4} />
337
+ <DxcSelect label="Large" options={single_options} size="large" />
338
+ </ExampleContainer>
339
+ <ExampleContainer>
340
+ <Title title="Fillparent size" theme="light" level={4} />
341
+ <DxcSelect label="Fillparent" options={single_options} size="fillParent" />
342
+ </ExampleContainer>
343
+ <Title title="Margins" theme="light" level={2} />
344
+ <ExampleContainer>
345
+ <Title title="xxsmall margin" theme="light" level={4} />
346
+ <DxcSelect label="xxSmall" options={single_options} margin="xxsmall" />
347
+ </ExampleContainer>
348
+ <ExampleContainer>
349
+ <Title title="xsmall margin" theme="light" level={4} />
350
+ <DxcSelect label="xSmall" options={single_options} margin="xsmall" />
351
+ </ExampleContainer>
352
+ <ExampleContainer>
353
+ <Title title="small margin" theme="light" level={4} />
354
+ <DxcSelect label="Small" options={single_options} margin="small" />
355
+ </ExampleContainer>
356
+ <ExampleContainer>
357
+ <Title title="medium margin" theme="light" level={4} />
358
+ <DxcSelect label="Medium" options={single_options} margin="medium" />
359
+ </ExampleContainer>
360
+ <ExampleContainer>
361
+ <Title title="large margin" theme="light" level={4} />
362
+ <DxcSelect label="Large" options={single_options} margin="large" />
363
+ </ExampleContainer>
364
+ <ExampleContainer>
365
+ <Title title="xlarge margin" theme="light" level={4} />
366
+ <DxcSelect label="xLarge" options={single_options} margin="xlarge" />
367
+ </ExampleContainer>
368
+ <ExampleContainer>
369
+ <Title title="xxlarge margin" theme="light" level={4} />
370
+ <DxcSelect label="xxLarge" options={single_options} margin="xxlarge" />
276
371
  </ExampleContainer>
277
- <>
278
- <Title title="Sizes" theme="light" level={2} />
279
- <ExampleContainer>
280
- <Title title="Small size" theme="light" level={4} />
281
- <DxcSelect label="Small" options={single_options} size="small" />
282
- </ExampleContainer>
283
- <ExampleContainer>
284
- <Title title="Medium size" theme="light" level={4} />
285
- <DxcSelect label="Medium" options={single_options} size="medium" />
286
- </ExampleContainer>
287
- <ExampleContainer>
288
- <Title title="Large size" theme="light" level={4} />
289
- <DxcSelect label="Large" options={single_options} size="large" />
290
- </ExampleContainer>
291
- <ExampleContainer>
292
- <Title title="Fillparent size" theme="light" level={4} />
293
- <DxcSelect label="Fillparent" options={single_options} size="fillParent" />
294
- </ExampleContainer>
295
- </>
296
- <>
297
- <Title title="Margins" theme="light" level={2} />
298
- <ExampleContainer>
299
- <Title title="xxsmall margin" theme="light" level={4} />
300
- <DxcSelect label="xxSmall" options={single_options} margin="xxsmall" />
301
- </ExampleContainer>
302
- <ExampleContainer>
303
- <Title title="xsmall margin" theme="light" level={4} />
304
- <DxcSelect label="xSmall" options={single_options} margin="xsmall" />
305
- </ExampleContainer>
306
- <ExampleContainer>
307
- <Title title="small margin" theme="light" level={4} />
308
- <DxcSelect label="Small" options={single_options} margin="small" />
309
- </ExampleContainer>
310
- <ExampleContainer>
311
- <Title title="medium margin" theme="light" level={4} />
312
- <DxcSelect label="Medium" options={single_options} margin="medium" />
313
- </ExampleContainer>
314
- <ExampleContainer>
315
- <Title title="large margin" theme="light" level={4} />
316
- <DxcSelect label="Large" options={single_options} margin="large" />
317
- </ExampleContainer>
318
- <ExampleContainer>
319
- <Title title="xlarge margin" theme="light" level={4} />
320
- <DxcSelect label="xLarge" options={single_options} margin="xlarge" />
321
- </ExampleContainer>
322
- <ExampleContainer>
323
- <Title title="xxlarge margin" theme="light" level={4} />
324
- <DxcSelect label="xxLarge" options={single_options} margin="xxlarge" />
325
- </ExampleContainer>
326
- </>
327
372
  <ExampleContainer expanded>
328
373
  <Title title="Ellipsis" theme="light" level={2} />
329
374
  <Title title="Multiple selection with ellipsis" theme="light" level={4} />
330
- <DxcSelect label="Label" options={single_options} multiple value={["1", "2", "3", "4"]} />
375
+ <DxcSelect label="Label" options={single_options} multiple defaultValue={["1", "2", "3", "4"]} />
331
376
  <Title title="Value with ellipsis" theme="light" level={4} />
332
- <DxcSelect label="Label" options={optionsWithEllipsisMedium} value="1" size="medium" />
333
- <Title title="Option with ellipsis" theme="light" level={4} />
377
+ <DxcSelect label="Label" options={optionsWithEllipsisMedium} defaultValue="1" />
378
+ <Title title="Options with ellipsis" theme="light" level={4} />
334
379
  <DxcSelect
335
380
  label="Label"
336
381
  placeholder="Choose an option"
337
- value="1"
382
+ defaultValue="1"
338
383
  options={optionsWithEllipsisMedium}
339
- size="medium"
384
+ margin={{ top: "xxlarge" }}
340
385
  />
341
386
  </ExampleContainer>
387
+ <Title title="Opinionated theme" theme="light" level={2} />
388
+ <ExampleContainer pseudoState="pseudo-hover">
389
+ <Title title="Hovered" theme="light" level={4} />
390
+ <HalstackProvider theme={opinionatedTheme}>
391
+ <DxcSelect label="Hovered" options={single_options} />
392
+ </HalstackProvider>
393
+ </ExampleContainer>
394
+ <ExampleContainer pseudoState="pseudo-focus-within">
395
+ <Title title="Focused" theme="light" level={4} />
396
+ <HalstackProvider theme={opinionatedTheme}>
397
+ <DxcSelect label="Focused" options={single_options} />
398
+ </HalstackProvider>
399
+ </ExampleContainer>
400
+ <ExampleContainer>
401
+ <Title title="Disabled" theme="light" level={4} />
402
+ <HalstackProvider theme={opinionatedTheme}>
403
+ <DxcSelect label="Disabled" placeholder="Placeholder" disabled options={single_options} />
404
+ </HalstackProvider>
405
+ </ExampleContainer>
406
+ <ExampleContainer>
407
+ <Title title="Disabled with value" theme="light" level={4} />
408
+ <HalstackProvider theme={opinionatedTheme}>
409
+ <DxcSelect label="Disabled with value" disabled options={single_options} defaultValue="1" />
410
+ </HalstackProvider>
411
+ </ExampleContainer>
412
+ <ExampleContainer>
413
+ <Title title="Error" theme="light" level={4} />
414
+ <HalstackProvider theme={opinionatedTheme}>
415
+ <DxcSelect
416
+ label="Label"
417
+ options={single_options}
418
+ error="Error message."
419
+ helperText="Helper text"
420
+ placeholder="Placeholder"
421
+ />
422
+ <ExampleContainer>
423
+ <Title title="Multiple selection" theme="light" level={4} />
424
+ <DxcSelect label="Multiple select" searchable options={single_options} multiple defaultValue={["1", "2"]} />
425
+ </ExampleContainer>
426
+ <ExampleContainer pseudoState="pseudo-hover">
427
+ <Title title="Multiple clear hovered" theme="light" level={4} />
428
+ <DxcSelect label="Multiple select" options={single_options} multiple defaultValue={["1", "2"]} />
429
+ </ExampleContainer>
430
+ <ExampleContainer pseudoState="pseudo-active">
431
+ <Title title="Multiple clear actived" theme="light" level={4} />
432
+ <DxcSelect label="Multiple select" options={single_options} multiple defaultValue={["1", "2"]} />
433
+ </ExampleContainer>
434
+ </HalstackProvider>
435
+ </ExampleContainer>
342
436
  </>
343
437
  );
344
- export const Chromatic = Select.bind({});
345
- Chromatic.play = async ({ canvasElement }) => {
346
- const canvas = within(canvasElement);
347
- await userEvent.click(canvas.getAllByRole("combobox")[25]);
438
+
439
+ const SelectListbox = () => {
440
+ const colorsTheme: any = useTheme();
441
+
442
+ return (
443
+ <>
444
+ <ThemeProvider theme={colorsTheme.select}>
445
+ <Title title="Listbox" theme="light" level={2} />
446
+ <ExampleContainer>
447
+ <Title
448
+ title="List dialog uses a Radix Popover to appear over elements with a certain z-index"
449
+ theme="light"
450
+ level={3}
451
+ />
452
+ <div
453
+ style={{
454
+ position: "relative",
455
+ display: "flex",
456
+ flexDirection: "column",
457
+ gap: "20px",
458
+ height: "150px",
459
+ width: "min-content",
460
+ marginBottom: "100px",
461
+ padding: "20px",
462
+ border: "1px solid black",
463
+ borderRadius: "4px",
464
+ overflow: "auto",
465
+ zIndex: "1300",
466
+ }}
467
+ >
468
+ <DxcSelect label="Label" options={single_options} optional placeholder="Choose an option" />
469
+ <button style={{ zIndex: "1", width: "100px" }}>Submit</button>
470
+ </div>
471
+ </ExampleContainer>
472
+ <Title title="Listbox option states" theme="light" level={3} />
473
+ <ExampleContainer pseudoState="pseudo-hover">
474
+ <Title title="Hovered option" theme="light" level={4} />
475
+ <Listbox
476
+ id="x"
477
+ currentValue=""
478
+ options={one_option}
479
+ visualFocusIndex={-1}
480
+ lastOptionIndex={0}
481
+ multiple={false}
482
+ optional={false}
483
+ optionalItem={{ label: "Empty", value: "" }}
484
+ searchable={false}
485
+ handleOptionOnClick={() => {}}
486
+ styles={{ width: 360 }}
487
+ />
488
+ </ExampleContainer>
489
+ <ExampleContainer pseudoState="pseudo-active">
490
+ <Title title="Active option" theme="light" level={4} />
491
+ <Listbox
492
+ id="x"
493
+ currentValue=""
494
+ options={one_option}
495
+ visualFocusIndex={-1}
496
+ lastOptionIndex={0}
497
+ multiple={false}
498
+ optional={false}
499
+ optionalItem={{ label: "Empty", value: "" }}
500
+ searchable={false}
501
+ handleOptionOnClick={() => {}}
502
+ styles={{ width: 360 }}
503
+ />
504
+ </ExampleContainer>
505
+ <ExampleContainer>
506
+ <Title title="Focused option" theme="light" level={4} />
507
+ <Listbox
508
+ id="x"
509
+ currentValue=""
510
+ options={one_option}
511
+ visualFocusIndex={0}
512
+ lastOptionIndex={0}
513
+ multiple={false}
514
+ optional={false}
515
+ optionalItem={{ label: "Empty", value: "" }}
516
+ searchable={false}
517
+ handleOptionOnClick={() => {}}
518
+ styles={{ width: 360 }}
519
+ />
520
+ </ExampleContainer>
521
+ <ExampleContainer pseudoState="pseudo-hover">
522
+ <Title title="Hovered selected option" theme="light" level={4} />
523
+ <Listbox
524
+ id="x"
525
+ currentValue="1"
526
+ options={single_options}
527
+ visualFocusIndex={-1}
528
+ lastOptionIndex={3}
529
+ multiple={false}
530
+ optional={false}
531
+ optionalItem={{ label: "Empty", value: "" }}
532
+ searchable={false}
533
+ handleOptionOnClick={() => {}}
534
+ styles={{ width: 360 }}
535
+ />
536
+ </ExampleContainer>
537
+ <ExampleContainer pseudoState="pseudo-active">
538
+ <Title title="Active selected option" theme="light" level={4} />
539
+ <Listbox
540
+ id="x"
541
+ currentValue="2"
542
+ options={single_options}
543
+ visualFocusIndex={0}
544
+ lastOptionIndex={3}
545
+ multiple={false}
546
+ optional={false}
547
+ optionalItem={{ label: "Empty", value: "" }}
548
+ searchable={false}
549
+ handleOptionOnClick={() => {}}
550
+ styles={{ width: 360 }}
551
+ />
552
+ </ExampleContainer>
553
+ <Title title="Listbox with icons" theme="light" level={3} />
554
+ <ExampleContainer>
555
+ <Title title="Icons (SVGs)" theme="light" level={4} />
556
+ <Listbox
557
+ id="x"
558
+ currentValue="3"
559
+ options={icon_options}
560
+ visualFocusIndex={-1}
561
+ lastOptionIndex={3}
562
+ multiple={false}
563
+ optional={false}
564
+ optionalItem={{ label: "Empty", value: "" }}
565
+ searchable={false}
566
+ handleOptionOnClick={() => {}}
567
+ styles={{ width: 360 }}
568
+ />
569
+ </ExampleContainer>
570
+ <ExampleContainer>
571
+ <Title title="Icons (Images)" theme="light" level={4} />
572
+ <Listbox
573
+ id="x"
574
+ currentValue="facebook"
575
+ options={url_options}
576
+ visualFocusIndex={-1}
577
+ lastOptionIndex={6}
578
+ multiple={false}
579
+ optional={false}
580
+ optionalItem={{ label: "Empty", value: "" }}
581
+ searchable={false}
582
+ handleOptionOnClick={() => {}}
583
+ styles={{ width: 360 }}
584
+ />
585
+ </ExampleContainer>
586
+ <ExampleContainer>
587
+ <Title title="Grouped icons (SVGs)" theme="light" level={4} />
588
+ <Listbox
589
+ id="x"
590
+ currentValue={["0", "3"]}
591
+ options={icon_options_grouped}
592
+ visualFocusIndex={-1}
593
+ lastOptionIndex={3}
594
+ multiple={false}
595
+ optional={false}
596
+ optionalItem={{ label: "Empty", value: "" }}
597
+ searchable={false}
598
+ handleOptionOnClick={() => {}}
599
+ styles={{ width: 360 }}
600
+ />
601
+ </ExampleContainer>
602
+ <ExampleContainer>
603
+ <Title title="Grouped icons (Images)" theme="light" level={4} />
604
+ <Listbox
605
+ id="x"
606
+ currentValue={["facebook", "figma"]}
607
+ options={url_options}
608
+ visualFocusIndex={-1}
609
+ lastOptionIndex={6}
610
+ multiple={true}
611
+ optional={false}
612
+ optionalItem={{ label: "Empty", value: "" }}
613
+ searchable={false}
614
+ handleOptionOnClick={() => {}}
615
+ styles={{ width: 360 }}
616
+ />
617
+ </ExampleContainer>
618
+ </ThemeProvider>
619
+ <ThemeProvider theme={colorsTheme.select}>
620
+ <Title title="Opinionated theme" theme="light" level={2} />
621
+ <ExampleContainer pseudoState="pseudo-hover">
622
+ <Title title="Hovered option" theme="light" level={4} />
623
+ <HalstackProvider theme={opinionatedTheme}>
624
+ <Listbox
625
+ id="x"
626
+ currentValue=""
627
+ options={one_option}
628
+ visualFocusIndex={-1}
629
+ lastOptionIndex={0}
630
+ multiple={false}
631
+ optional={false}
632
+ optionalItem={{ label: "Empty", value: "" }}
633
+ searchable={false}
634
+ handleOptionOnClick={() => {}}
635
+ styles={{ width: 360 }}
636
+ />
637
+ </HalstackProvider>
638
+ </ExampleContainer>
639
+ <ExampleContainer pseudoState="pseudo-active">
640
+ <Title title="Active option" theme="light" level={4} />{" "}
641
+ <HalstackProvider theme={opinionatedTheme}>
642
+ <Listbox
643
+ id="x"
644
+ currentValue=""
645
+ options={one_option}
646
+ visualFocusIndex={-1}
647
+ lastOptionIndex={0}
648
+ multiple={false}
649
+ optional={false}
650
+ optionalItem={{ label: "Empty", value: "" }}
651
+ searchable={false}
652
+ handleOptionOnClick={() => {}}
653
+ styles={{ width: 360 }}
654
+ />
655
+ </HalstackProvider>
656
+ </ExampleContainer>
657
+ <ExampleContainer>
658
+ <Title title="Focused option" theme="light" level={4} />{" "}
659
+ <HalstackProvider theme={opinionatedTheme}>
660
+ <Listbox
661
+ id="x"
662
+ currentValue=""
663
+ options={one_option}
664
+ visualFocusIndex={0}
665
+ lastOptionIndex={0}
666
+ multiple={false}
667
+ optional={false}
668
+ optionalItem={{ label: "Empty", value: "" }}
669
+ searchable={false}
670
+ handleOptionOnClick={() => {}}
671
+ styles={{ width: 360 }}
672
+ />
673
+ </HalstackProvider>
674
+ </ExampleContainer>
675
+ <ExampleContainer pseudoState="pseudo-hover">
676
+ <Title title="Hovered selected option" theme="light" level={4} />{" "}
677
+ <HalstackProvider theme={opinionatedTheme}>
678
+ <Listbox
679
+ id="x"
680
+ currentValue="1"
681
+ options={single_options}
682
+ visualFocusIndex={-1}
683
+ lastOptionIndex={3}
684
+ multiple={false}
685
+ optional={false}
686
+ optionalItem={{ label: "Empty", value: "" }}
687
+ searchable={false}
688
+ handleOptionOnClick={() => {}}
689
+ styles={{ width: 360 }}
690
+ />
691
+ </HalstackProvider>
692
+ </ExampleContainer>
693
+ <ExampleContainer pseudoState="pseudo-active">
694
+ <Title title="Active selected option" theme="light" level={4} />{" "}
695
+ <HalstackProvider theme={opinionatedTheme}>
696
+ <Listbox
697
+ id="x"
698
+ currentValue="2"
699
+ options={single_options}
700
+ visualFocusIndex={0}
701
+ lastOptionIndex={3}
702
+ multiple={false}
703
+ optional={false}
704
+ optionalItem={{ label: "Empty", value: "" }}
705
+ searchable={false}
706
+ handleOptionOnClick={() => {}}
707
+ styles={{ width: 360 }}
708
+ />
709
+ </HalstackProvider>
710
+ </ExampleContainer>
711
+ <Title title="Listbox with icons" theme="light" level={3} />
712
+ <ExampleContainer>
713
+ <Title title="Icons (SVGs)" theme="light" level={4} />{" "}
714
+ <HalstackProvider theme={opinionatedTheme}>
715
+ <Listbox
716
+ id="x"
717
+ currentValue="3"
718
+ options={icon_options}
719
+ visualFocusIndex={-1}
720
+ lastOptionIndex={3}
721
+ multiple={false}
722
+ optional={false}
723
+ optionalItem={{ label: "Empty", value: "" }}
724
+ searchable={false}
725
+ handleOptionOnClick={() => {}}
726
+ styles={{ width: 360 }}
727
+ />
728
+ </HalstackProvider>
729
+ </ExampleContainer>
730
+ </ThemeProvider>
731
+ </>
732
+ );
348
733
  };
349
- const DefaultSelect = () => (
734
+
735
+ const SearchableSelect = () => (
350
736
  <ExampleContainer expanded>
351
- <Title title="Default select" theme="light" level={4} />
352
- <DxcSelect label="Select label" options={single_options} optional placeholder="Choose an option" />
737
+ <Title title="Searchable select" theme="light" level={4} />
738
+ <DxcSelect label="Select Label" searchable options={single_options} placeholder="Choose an option" />
353
739
  </ExampleContainer>
354
740
  );
355
- const SearchableSelect = () => (
741
+
742
+ const SearchableSelectOpinionated = () => (
356
743
  <ExampleContainer expanded>
357
744
  <Title title="Searchable select" theme="light" level={4} />
358
- <DxcSelect label="Select Label" searchable options={single_options} placeholder="Choose an option" />
745
+ <HalstackProvider theme={opinionatedTheme}>
746
+ <DxcSelect label="Select Label" searchable options={single_options} placeholder="Choose an option" />
747
+ </HalstackProvider>
359
748
  </ExampleContainer>
360
749
  );
361
- const SearchableWithValue = () => (
750
+
751
+ const SearchValue = () => (
362
752
  <ExampleContainer expanded>
363
753
  <Title title="Searchable select with value" theme="light" level={4} />
364
- <DxcSelect label="Select Label" searchable value="1" options={single_options} placeholder="Choose an option" />
754
+ <DxcSelect
755
+ label="Select Label"
756
+ searchable
757
+ defaultValue="1"
758
+ options={single_options}
759
+ placeholder="Choose an option"
760
+ />
761
+ </ExampleContainer>
762
+ );
763
+
764
+ const SearchValueOpinionated = () => (
765
+ <ExampleContainer expanded>
766
+ <Title title="Searchable select with value" theme="light" level={4} />
767
+ <HalstackProvider theme={opinionatedTheme}>
768
+ <DxcSelect
769
+ label="Select Label"
770
+ searchable
771
+ defaultValue="1"
772
+ options={single_options}
773
+ placeholder="Choose an option"
774
+ />
775
+ </HalstackProvider>
365
776
  </ExampleContainer>
366
777
  );
367
778
 
@@ -372,85 +783,73 @@ const MultipleSelect = () => (
372
783
  <DxcSelect
373
784
  label="Select label"
374
785
  options={single_options}
375
- value={["1", "4"]}
786
+ defaultValue={["1", "4"]}
376
787
  multiple
377
788
  placeholder="Choose an option"
378
789
  />
379
790
  </ExampleContainer>
380
791
  </>
381
792
  );
382
- const DefaultGroupedOptionsSelect = () => (
383
- <ExampleContainer expanded>
384
- <Title title="Grouped options simple select" theme="light" level={4} />
385
- <DxcSelect label="Label" options={group_options} value="9" placeholder="Choose an option" />
386
- </ExampleContainer>
387
- );
388
- const MultipleGroupedOptionsSelect = () => (
389
- <ExampleContainer expanded>
390
- <Title title="Grouped options multiple select" theme="light" level={4} />
391
- <DxcSelect label="Label" options={group_options} value={["0", "2"]} multiple placeholder="Choose an option" />
392
- </ExampleContainer>
393
- );
394
- const RescaledIcons = () => (
793
+
794
+ const MultipleSelectOpinioated = () => (
395
795
  <ExampleContainer expanded>
396
- <Title title="Rescaled icons displayed" theme="light" level={4} />
397
- <DxcSelect label="Label" options={url_options} value="facebook" placeholder="Choose an option" />
796
+ <Title title="Multiple select" theme="light" level={4} />
797
+ <HalstackProvider theme={opinionatedTheme}>
798
+ <DxcSelect
799
+ label="Select label"
800
+ options={single_options}
801
+ defaultValue={["1", "4"]}
802
+ multiple
803
+ placeholder="Choose an option"
804
+ />
805
+ </HalstackProvider>
398
806
  </ExampleContainer>
399
807
  );
400
- const SelectWithIcons = () => (
808
+
809
+ const DefaultGroupedOptionsSelect = () => (
401
810
  <ExampleContainer expanded>
402
- <Title title="Normal icons displayed" theme="light" level={4} />
403
- <DxcSelect label="Label" options={icon_options} value="3" placeholder="Choose an option" />
811
+ <Title title="Grouped options simple select" theme="light" level={4} />
812
+ <DxcSelect label="Label" options={group_options} defaultValue="9" placeholder="Choose an option" />
404
813
  </ExampleContainer>
405
814
  );
406
- const SelectMultipleWithIcons = () => (
815
+
816
+ const DefaultGroupedOptionsSelectOpinionated = () => (
407
817
  <ExampleContainer expanded>
408
- <Title title="Multiple select with icons" theme="light" level={4} />
409
- <DxcSelect label="Label" options={icon_options} multiple value={["1", "3"]} placeholder="Choose an option" />
818
+ <Title title="Grouped options simple select" theme="light" level={4} />
819
+ <HalstackProvider theme={opinionatedTheme}>
820
+ <DxcSelect label="Label" options={group_options} defaultValue="9" placeholder="Choose an option" />
821
+ </HalstackProvider>
410
822
  </ExampleContainer>
411
823
  );
412
- const MultipleGroupedOptionsSelectWithIcons = () => (
824
+
825
+ const MultipleGroupedOptionsSelect = () => (
413
826
  <ExampleContainer expanded>
414
- <Title title="Multiple grouped options with icons" theme="light" level={4} />
827
+ <Title title="Grouped options multiple select" theme="light" level={4} />
415
828
  <DxcSelect
416
829
  label="Label"
417
- options={icon_options_grouped}
830
+ options={group_options}
831
+ defaultValue={["0", "2"]}
418
832
  multiple
419
- value={["3", "2"]}
420
833
  placeholder="Choose an option"
421
834
  />
422
835
  </ExampleContainer>
423
836
  );
424
- const OnlyOneOptionHovered = () => (
425
- <ExampleContainer pseudoState="pseudo-hover" expanded>
426
- <Title title="Hovered Option" theme="light" level={4} />
427
- <DxcSelect label="Hovered" options={one_option} placeholder="Choose an option" />
428
- </ExampleContainer>
429
- );
430
- const OnlyOneOptionFocused = () => (
431
- <ExampleContainer pseudoState="pseudo-focus" expanded>
432
- <Title title="Focused Option" theme="light" level={4} />
433
- <DxcSelect label="Focused" options={one_option} placeholder="Choose an option" />
434
- </ExampleContainer>
435
- );
436
- const OnlyOneOptionActived = () => (
437
- <ExampleContainer pseudoState="pseudo-active" expanded>
438
- <Title title="Actived Option" theme="light" level={4} />
439
- <DxcSelect label="Actived" options={one_option} placeholder="Choose an option" />
440
- </ExampleContainer>
441
- );
442
- const SelectedOptionHovered = () => (
443
- <ExampleContainer pseudoState="pseudo-hover" expanded>
444
- <Title title="Hovered Selected Option" theme="light" level={4} />
445
- <DxcSelect label="Hovered" value="1" options={one_option} placeholder="Choose an option" />
446
- </ExampleContainer>
447
- );
448
- const SelectedOptionActived = () => (
449
- <ExampleContainer pseudoState="pseudo-active" expanded>
450
- <Title title="Actived Selected Option" theme="light" level={4} />
451
- <DxcSelect label="Actived" value="1" options={one_option} placeholder="Choose an option" />
837
+
838
+ const MultipleGroupedOptionsSelectOpinionated = () => (
839
+ <ExampleContainer expanded>
840
+ <Title title="Grouped options multiple select" theme="light" level={4} />
841
+ <HalstackProvider theme={opinionatedTheme}>
842
+ <DxcSelect
843
+ label="Label"
844
+ options={group_options}
845
+ defaultValue={["0", "2"]}
846
+ multiple
847
+ placeholder="Choose an option"
848
+ />
849
+ </HalstackProvider>
452
850
  </ExampleContainer>
453
851
  );
852
+
454
853
  const MultipleSearchable = () => (
455
854
  <ExampleContainer expanded>
456
855
  <Title title="Searchable multiple select with value" theme="light" level={4} />
@@ -458,114 +857,113 @@ const MultipleSearchable = () => (
458
857
  label="Select Label"
459
858
  searchable
460
859
  multiple
461
- value={["1", "4"]}
860
+ defaultValue={["1", "4"]}
462
861
  options={single_options}
463
862
  placeholder="Choose an option"
464
863
  />
465
864
  </ExampleContainer>
466
865
  );
467
- export const OptionsDisplayed = DefaultSelect.bind({});
468
- OptionsDisplayed.play = async ({ canvasElement }) => {
866
+
867
+ const MultipleSearchableOpinionated = () => (
868
+ <ExampleContainer expanded>
869
+ <Title title="Searchable multiple select with value" theme="light" level={4} />
870
+ <HalstackProvider theme={opinionatedTheme}>
871
+ <DxcSelect
872
+ label="Select Label"
873
+ searchable
874
+ multiple
875
+ defaultValue={["1", "4"]}
876
+ options={single_options}
877
+ placeholder="Choose an option"
878
+ />
879
+ </HalstackProvider>
880
+ </ExampleContainer>
881
+ );
882
+
883
+ export const Chromatic = Select.bind({});
884
+ Chromatic.play = async ({ canvasElement }) => {
885
+ const canvas = within(canvasElement);
886
+ await userEvent.click(canvas.getAllByRole("combobox")[24]);
887
+ };
888
+
889
+ export const ListboxStates = SelectListbox.bind({});
890
+ ListboxStates.play = async ({ canvasElement }) => {
469
891
  const canvas = within(canvasElement);
470
892
  const select = canvas.getByRole("combobox");
471
893
  await userEvent.click(select);
472
894
  };
895
+
473
896
  export const Searchable = SearchableSelect.bind({});
474
897
  Searchable.play = async ({ canvasElement }) => {
475
898
  const canvas = within(canvasElement);
476
- await userEvent.click(canvas.getByRole("combobox"));
477
- await waitFor(async () => {
478
- userEvent.type(canvas.getByRole("combobox"), "r");
479
- });
899
+ await userEvent.type(canvas.getByRole("combobox"), "r");
480
900
  };
481
- export const SelectSearchableWithValue = SearchableWithValue.bind({});
482
- SelectSearchableWithValue.play = async ({ canvasElement }) => {
901
+
902
+ export const SearchableOpinionated = SearchableSelectOpinionated.bind({});
903
+ SearchableOpinionated.play = async ({ canvasElement }) => {
483
904
  const canvas = within(canvasElement);
484
- await userEvent.click(canvas.getByRole("combobox"));
905
+ await userEvent.type(canvas.getByRole("combobox"), "r");
485
906
  };
486
907
 
487
- export const SelectMultipleSearchableWithValue = MultipleSearchable.bind({});
488
- SelectMultipleSearchableWithValue.play = async ({ canvasElement }) => {
908
+ export const SearchableWithValue = SearchValue.bind({});
909
+ SearchableWithValue.play = async ({ canvasElement }) => {
489
910
  const canvas = within(canvasElement);
490
- await userEvent.click(canvas.getAllByRole("combobox")[0]);
911
+ await userEvent.click(canvas.getByRole("combobox"));
491
912
  };
492
913
 
493
- export const GroupOptionsDisplayed = DefaultGroupedOptionsSelect.bind({});
494
- GroupOptionsDisplayed.play = async ({ canvasElement }) => {
914
+ export const SearchableWithValueOpinionated = SearchValueOpinionated.bind({});
915
+ SearchableWithValueOpinionated.play = async ({ canvasElement }) => {
495
916
  const canvas = within(canvasElement);
496
- const select = canvas.getByRole("combobox");
497
- await userEvent.click(select);
917
+ await userEvent.click(canvas.getByRole("combobox"));
498
918
  };
499
919
 
500
- export const SelectMultipleOptionsDisplayed = MultipleSelect.bind({});
501
- SelectMultipleOptionsDisplayed.play = async ({ canvasElement }) => {
920
+ export const MultipleSearchableWithValue = MultipleSearchable.bind({});
921
+ MultipleSearchableWithValue.play = async ({ canvasElement }) => {
502
922
  const canvas = within(canvasElement);
503
923
  await userEvent.click(canvas.getAllByRole("combobox")[0]);
504
924
  };
505
925
 
506
- export const SelectMultipleGroupedOptionsDisplayed = MultipleGroupedOptionsSelect.bind({});
507
- SelectMultipleGroupedOptionsDisplayed.play = async ({ canvasElement }) => {
926
+ export const MultipleSearchableWithValueOpinionated = MultipleSearchableOpinionated.bind({});
927
+ MultipleSearchableWithValueOpinionated.play = async ({ canvasElement }) => {
508
928
  const canvas = within(canvasElement);
509
- const select = canvas.getByRole("combobox");
510
- await userEvent.click(select);
511
- };
512
- export const SelectWithIconsDisplayed = SelectWithIcons.bind({});
513
- SelectWithIconsDisplayed.play = async ({ canvasElement }) => {
514
- const canvas = within(canvasElement);
515
- const select = canvas.getByRole("combobox");
516
- await userEvent.click(select);
929
+ await userEvent.click(canvas.getAllByRole("combobox")[0]);
517
930
  };
518
931
 
519
- export const SelectWithRescaledIconsDisplayed = RescaledIcons.bind({});
520
- SelectWithRescaledIconsDisplayed.play = async ({ canvasElement }) => {
521
- const canvas = within(canvasElement);
522
- const select = canvas.getByRole("combobox");
523
- await userEvent.click(select);
524
- };
525
- export const SelectMultipleWithIconsDisplayed = SelectMultipleWithIcons.bind({});
526
- SelectMultipleWithIconsDisplayed.play = async ({ canvasElement }) => {
932
+ export const GroupOptionsDisplayed = DefaultGroupedOptionsSelect.bind({});
933
+ GroupOptionsDisplayed.play = async ({ canvasElement }) => {
527
934
  const canvas = within(canvasElement);
528
935
  const select = canvas.getByRole("combobox");
529
936
  await userEvent.click(select);
530
937
  };
531
938
 
532
- export const SelectMultipleGroupedWithIconsDisplayed = MultipleGroupedOptionsSelectWithIcons.bind({});
533
- SelectMultipleGroupedWithIconsDisplayed.play = async ({ canvasElement }) => {
939
+ export const GroupOptionsDisplayedOpinionated = DefaultGroupedOptionsSelectOpinionated.bind({});
940
+ GroupOptionsDisplayedOpinionated.play = async ({ canvasElement }) => {
534
941
  const canvas = within(canvasElement);
535
942
  const select = canvas.getByRole("combobox");
536
943
  await userEvent.click(select);
537
944
  };
538
945
 
539
- export const OptionHovered = OnlyOneOptionHovered.bind({});
540
- OptionHovered.play = async ({ canvasElement }) => {
946
+ export const MultipleOptionsDisplayed = MultipleSelect.bind({});
947
+ MultipleOptionsDisplayed.play = async ({ canvasElement }) => {
541
948
  const canvas = within(canvasElement);
542
- const select = canvas.getByRole("combobox");
543
- await userEvent.click(select);
949
+ await userEvent.click(canvas.getAllByRole("combobox")[0]);
544
950
  };
545
951
 
546
- export const OptionFocused = OnlyOneOptionFocused.bind({});
547
- OptionFocused.play = async ({ canvasElement }) => {
548
- const canvas = within(canvasElement);
549
- const select = canvas.getByRole("combobox");
550
- await userEvent.click(select);
551
- await waitFor(async () => {
552
- fireEvent.keyDown(select, { key: "ArrowDown", code: "ArrowDown", keyCode: 40, charCode: 40 });
553
- });
554
- };
555
- export const OptionActived = OnlyOneOptionActived.bind({});
556
- OptionActived.play = async ({ canvasElement }) => {
952
+ export const MultipleOptionsDisplayedOpinionated = MultipleSelectOpinioated.bind({});
953
+ MultipleOptionsDisplayedOpinionated.play = async ({ canvasElement }) => {
557
954
  const canvas = within(canvasElement);
558
- const select = canvas.getByRole("combobox");
559
- await userEvent.click(select);
955
+ await userEvent.click(canvas.getAllByRole("combobox")[0]);
560
956
  };
561
- export const OptionSelectedHovered = SelectedOptionHovered.bind({});
562
- OptionSelectedHovered.play = async ({ canvasElement }) => {
957
+
958
+ export const MultipleGroupedOptionsDisplayed = MultipleGroupedOptionsSelect.bind({});
959
+ MultipleGroupedOptionsDisplayed.play = async ({ canvasElement }) => {
563
960
  const canvas = within(canvasElement);
564
961
  const select = canvas.getByRole("combobox");
565
962
  await userEvent.click(select);
566
963
  };
567
- export const OptionSelectedActived = SelectedOptionActived.bind({});
568
- OptionSelectedActived.play = async ({ canvasElement }) => {
964
+
965
+ export const MultipleGroupedOptionsDisplayedOpinionated = MultipleGroupedOptionsSelectOpinionated.bind({});
966
+ MultipleGroupedOptionsDisplayedOpinionated.play = async ({ canvasElement }) => {
569
967
  const canvas = within(canvasElement);
570
968
  const select = canvas.getByRole("combobox");
571
969
  await userEvent.click(select);