@dxc-technology/halstack-react 0.0.0-c293b72 → 0.0.0-c2aa807

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 (418) hide show
  1. package/README.md +1 -2
  2. package/dist/index.d.mts +6500 -0
  3. package/dist/index.d.ts +6500 -0
  4. package/dist/index.js +13516 -0
  5. package/dist/index.mjs +13459 -0
  6. package/package.json +66 -66
  7. package/BackgroundColorContext.d.ts +0 -1
  8. package/BackgroundColorContext.js +0 -30
  9. package/HalstackContext.d.ts +0 -1249
  10. package/HalstackContext.js +0 -310
  11. package/accordion/Accordion.accessibility.test.js +0 -71
  12. package/accordion/Accordion.d.ts +0 -4
  13. package/accordion/Accordion.js +0 -169
  14. package/accordion/Accordion.stories.tsx +0 -251
  15. package/accordion/Accordion.test.js +0 -56
  16. package/accordion/types.d.ts +0 -57
  17. package/accordion/types.js +0 -5
  18. package/accordion-group/AccordionGroup.accessibility.test.js +0 -88
  19. package/accordion-group/AccordionGroup.d.ts +0 -7
  20. package/accordion-group/AccordionGroup.js +0 -101
  21. package/accordion-group/AccordionGroup.stories.tsx +0 -252
  22. package/accordion-group/AccordionGroup.test.js +0 -98
  23. package/accordion-group/AccordionGroupAccordion.d.ts +0 -4
  24. package/accordion-group/AccordionGroupAccordion.js +0 -31
  25. package/accordion-group/AccordionGroupContext.d.ts +0 -3
  26. package/accordion-group/AccordionGroupContext.js +0 -8
  27. package/accordion-group/types.d.ts +0 -67
  28. package/accordion-group/types.js +0 -5
  29. package/action-icon/ActionIcon.accessibility.test.js +0 -63
  30. package/action-icon/ActionIcon.d.ts +0 -4
  31. package/action-icon/ActionIcon.js +0 -48
  32. package/action-icon/ActionIcon.stories.tsx +0 -41
  33. package/action-icon/ActionIcon.test.js +0 -64
  34. package/action-icon/types.d.ts +0 -26
  35. package/action-icon/types.js +0 -5
  36. package/alert/Alert.accessibility.test.js +0 -95
  37. package/alert/Alert.d.ts +0 -4
  38. package/alert/Alert.js +0 -200
  39. package/alert/Alert.stories.tsx +0 -198
  40. package/alert/Alert.test.js +0 -75
  41. package/alert/types.d.ts +0 -49
  42. package/alert/types.js +0 -5
  43. package/badge/Badge.accessibility.test.js +0 -129
  44. package/badge/Badge.d.ts +0 -4
  45. package/badge/Badge.js +0 -161
  46. package/badge/Badge.stories.tsx +0 -210
  47. package/badge/Badge.test.js +0 -30
  48. package/badge/types.d.ts +0 -54
  49. package/badge/types.js +0 -5
  50. package/bleed/Bleed.d.ts +0 -3
  51. package/bleed/Bleed.js +0 -43
  52. package/bleed/Bleed.stories.tsx +0 -342
  53. package/bleed/types.d.ts +0 -37
  54. package/bleed/types.js +0 -5
  55. package/box/Box.accessibility.test.js +0 -33
  56. package/box/Box.d.ts +0 -4
  57. package/box/Box.js +0 -75
  58. package/box/Box.stories.tsx +0 -119
  59. package/box/Box.test.js +0 -13
  60. package/box/types.d.ts +0 -32
  61. package/box/types.js +0 -5
  62. package/bulleted-list/BulletedList.accessibility.test.js +0 -107
  63. package/bulleted-list/BulletedList.d.ts +0 -7
  64. package/bulleted-list/BulletedList.js +0 -92
  65. package/bulleted-list/BulletedList.stories.tsx +0 -115
  66. package/bulleted-list/types.d.ts +0 -38
  67. package/bulleted-list/types.js +0 -5
  68. package/button/Button.accessibility.test.js +0 -127
  69. package/button/Button.d.ts +0 -4
  70. package/button/Button.js +0 -121
  71. package/button/Button.stories.tsx +0 -325
  72. package/button/Button.test.js +0 -38
  73. package/button/types.d.ts +0 -57
  74. package/button/types.js +0 -5
  75. package/card/Card.accessibility.test.js +0 -36
  76. package/card/Card.d.ts +0 -4
  77. package/card/Card.js +0 -120
  78. package/card/Card.stories.tsx +0 -171
  79. package/card/Card.test.js +0 -39
  80. package/card/types.d.ts +0 -62
  81. package/card/types.js +0 -5
  82. package/checkbox/Checkbox.accessibility.test.js +0 -87
  83. package/checkbox/Checkbox.d.ts +0 -4
  84. package/checkbox/Checkbox.js +0 -215
  85. package/checkbox/Checkbox.stories.tsx +0 -222
  86. package/checkbox/Checkbox.test.js +0 -199
  87. package/checkbox/types.d.ts +0 -72
  88. package/checkbox/types.js +0 -5
  89. package/chip/Chip.accessibility.test.js +0 -67
  90. package/chip/Chip.d.ts +0 -4
  91. package/chip/Chip.js +0 -124
  92. package/chip/Chip.stories.tsx +0 -195
  93. package/chip/Chip.test.js +0 -41
  94. package/chip/types.d.ts +0 -45
  95. package/chip/types.js +0 -5
  96. package/common/coreTokens.d.ts +0 -237
  97. package/common/coreTokens.js +0 -184
  98. package/common/utils.d.ts +0 -1
  99. package/common/utils.js +0 -16
  100. package/common/variables.d.ts +0 -1395
  101. package/common/variables.js +0 -1267
  102. package/container/Container.d.ts +0 -4
  103. package/container/Container.js +0 -194
  104. package/container/Container.stories.tsx +0 -214
  105. package/container/types.d.ts +0 -74
  106. package/container/types.js +0 -5
  107. package/contextual-menu/ContextualMenu.accessibility.test.js +0 -86
  108. package/contextual-menu/ContextualMenu.d.ts +0 -7
  109. package/contextual-menu/ContextualMenu.js +0 -71
  110. package/contextual-menu/ContextualMenu.stories.tsx +0 -182
  111. package/contextual-menu/ContextualMenu.test.js +0 -71
  112. package/contextual-menu/MenuItemAction.d.ts +0 -4
  113. package/contextual-menu/MenuItemAction.js +0 -46
  114. package/contextual-menu/types.d.ts +0 -22
  115. package/contextual-menu/types.js +0 -5
  116. package/date-input/Calendar.d.ts +0 -4
  117. package/date-input/Calendar.js +0 -214
  118. package/date-input/DateInput.accessibility.test.js +0 -216
  119. package/date-input/DateInput.d.ts +0 -4
  120. package/date-input/DateInput.js +0 -222
  121. package/date-input/DateInput.stories.tsx +0 -285
  122. package/date-input/DateInput.test.js +0 -808
  123. package/date-input/DatePicker.d.ts +0 -4
  124. package/date-input/DatePicker.js +0 -121
  125. package/date-input/YearPicker.d.ts +0 -4
  126. package/date-input/YearPicker.js +0 -100
  127. package/date-input/types.d.ts +0 -164
  128. package/date-input/types.js +0 -5
  129. package/dialog/Dialog.accessibility.test.js +0 -69
  130. package/dialog/Dialog.d.ts +0 -4
  131. package/dialog/Dialog.js +0 -104
  132. package/dialog/Dialog.stories.tsx +0 -365
  133. package/dialog/Dialog.test.js +0 -307
  134. package/dialog/types.d.ts +0 -36
  135. package/dialog/types.js +0 -5
  136. package/divider/Divider.accessibility.test.js +0 -33
  137. package/divider/Divider.d.ts +0 -4
  138. package/divider/Divider.js +0 -36
  139. package/divider/Divider.stories.tsx +0 -223
  140. package/divider/Divider.test.js +0 -38
  141. package/divider/types.d.ts +0 -21
  142. package/divider/types.js +0 -5
  143. package/dropdown/Dropdown.accessibility.test.js +0 -180
  144. package/dropdown/Dropdown.d.ts +0 -4
  145. package/dropdown/Dropdown.js +0 -319
  146. package/dropdown/Dropdown.stories.tsx +0 -427
  147. package/dropdown/Dropdown.test.js +0 -599
  148. package/dropdown/DropdownMenu.d.ts +0 -4
  149. package/dropdown/DropdownMenu.js +0 -63
  150. package/dropdown/DropdownMenuItem.d.ts +0 -4
  151. package/dropdown/DropdownMenuItem.js +0 -70
  152. package/dropdown/types.d.ts +0 -96
  153. package/dropdown/types.js +0 -5
  154. package/file-input/FileInput.accessibility.test.js +0 -160
  155. package/file-input/FileInput.d.ts +0 -4
  156. package/file-input/FileInput.js +0 -443
  157. package/file-input/FileInput.stories.tsx +0 -618
  158. package/file-input/FileInput.test.js +0 -382
  159. package/file-input/FileItem.d.ts +0 -4
  160. package/file-input/FileItem.js +0 -121
  161. package/file-input/types.d.ts +0 -129
  162. package/file-input/types.js +0 -5
  163. package/flex/Flex.d.ts +0 -4
  164. package/flex/Flex.js +0 -57
  165. package/flex/Flex.stories.tsx +0 -112
  166. package/flex/types.d.ts +0 -97
  167. package/flex/types.js +0 -5
  168. package/footer/Footer.accessibility.test.js +0 -117
  169. package/footer/Footer.d.ts +0 -4
  170. package/footer/Footer.js +0 -140
  171. package/footer/Footer.stories.tsx +0 -196
  172. package/footer/Footer.test.js +0 -85
  173. package/footer/Icons.d.ts +0 -3
  174. package/footer/Icons.js +0 -136
  175. package/footer/types.d.ts +0 -64
  176. package/footer/types.js +0 -5
  177. package/grid/Grid.d.ts +0 -7
  178. package/grid/Grid.js +0 -76
  179. package/grid/Grid.stories.tsx +0 -219
  180. package/grid/types.d.ts +0 -115
  181. package/grid/types.js +0 -5
  182. package/header/Header.accessibility.test.js +0 -84
  183. package/header/Header.d.ts +0 -8
  184. package/header/Header.js +0 -209
  185. package/header/Header.stories.tsx +0 -251
  186. package/header/Header.test.js +0 -66
  187. package/header/Icons.d.ts +0 -2
  188. package/header/Icons.js +0 -29
  189. package/header/types.d.ts +0 -33
  190. package/header/types.js +0 -5
  191. package/heading/Heading.accessibility.test.js +0 -33
  192. package/heading/Heading.d.ts +0 -4
  193. package/heading/Heading.js +0 -137
  194. package/heading/Heading.stories.tsx +0 -54
  195. package/heading/Heading.test.js +0 -169
  196. package/heading/types.d.ts +0 -33
  197. package/heading/types.js +0 -5
  198. package/icon/Icon.accessibility.test.js +0 -30
  199. package/icon/Icon.d.ts +0 -4
  200. package/icon/Icon.js +0 -33
  201. package/icon/Icon.stories.tsx +0 -28
  202. package/icon/types.d.ts +0 -4
  203. package/icon/types.js +0 -5
  204. package/image/Image.accessibility.test.js +0 -56
  205. package/image/Image.d.ts +0 -4
  206. package/image/Image.js +0 -70
  207. package/image/Image.stories.tsx +0 -129
  208. package/image/types.d.ts +0 -72
  209. package/image/types.js +0 -5
  210. package/inset/Inset.d.ts +0 -3
  211. package/inset/Inset.js +0 -43
  212. package/inset/Inset.stories.tsx +0 -230
  213. package/inset/types.d.ts +0 -37
  214. package/inset/types.js +0 -5
  215. package/layout/ApplicationLayout.d.ts +0 -20
  216. package/layout/ApplicationLayout.js +0 -134
  217. package/layout/ApplicationLayout.stories.tsx +0 -162
  218. package/layout/Icons.d.ts +0 -8
  219. package/layout/Icons.js +0 -56
  220. package/layout/types.d.ts +0 -41
  221. package/layout/types.js +0 -5
  222. package/link/Link.accessibility.test.js +0 -112
  223. package/link/Link.d.ts +0 -4
  224. package/link/Link.js +0 -117
  225. package/link/Link.stories.tsx +0 -253
  226. package/link/Link.test.js +0 -63
  227. package/link/types.d.ts +0 -54
  228. package/link/types.js +0 -5
  229. package/main.d.ts +0 -49
  230. package/main.js +0 -357
  231. package/nav-tabs/NavTabs.accessibility.test.js +0 -44
  232. package/nav-tabs/NavTabs.d.ts +0 -7
  233. package/nav-tabs/NavTabs.js +0 -93
  234. package/nav-tabs/NavTabs.stories.tsx +0 -279
  235. package/nav-tabs/NavTabs.test.js +0 -75
  236. package/nav-tabs/NavTabsContext.d.ts +0 -3
  237. package/nav-tabs/NavTabsContext.js +0 -8
  238. package/nav-tabs/Tab.d.ts +0 -4
  239. package/nav-tabs/Tab.js +0 -117
  240. package/nav-tabs/types.d.ts +0 -52
  241. package/nav-tabs/types.js +0 -5
  242. package/number-input/NumberInput.accessibility.test.js +0 -228
  243. package/number-input/NumberInput.d.ts +0 -4
  244. package/number-input/NumberInput.js +0 -86
  245. package/number-input/NumberInput.stories.tsx +0 -131
  246. package/number-input/NumberInput.test.js +0 -989
  247. package/number-input/NumberInputContext.d.ts +0 -3
  248. package/number-input/NumberInputContext.js +0 -8
  249. package/number-input/types.d.ts +0 -136
  250. package/number-input/types.js +0 -5
  251. package/paginator/Icons.d.ts +0 -5
  252. package/paginator/Icons.js +0 -40
  253. package/paginator/Paginator.accessibility.test.js +0 -79
  254. package/paginator/Paginator.d.ts +0 -4
  255. package/paginator/Paginator.js +0 -135
  256. package/paginator/Paginator.stories.tsx +0 -87
  257. package/paginator/Paginator.test.js +0 -335
  258. package/paginator/types.d.ts +0 -38
  259. package/paginator/types.js +0 -5
  260. package/paragraph/Paragraph.accessibility.test.js +0 -28
  261. package/paragraph/Paragraph.d.ts +0 -5
  262. package/paragraph/Paragraph.js +0 -22
  263. package/paragraph/Paragraph.stories.tsx +0 -27
  264. package/password-input/PasswordInput.accessibility.test.js +0 -153
  265. package/password-input/PasswordInput.d.ts +0 -4
  266. package/password-input/PasswordInput.js +0 -96
  267. package/password-input/PasswordInput.stories.tsx +0 -99
  268. package/password-input/PasswordInput.test.js +0 -198
  269. package/password-input/types.d.ts +0 -111
  270. package/password-input/types.js +0 -5
  271. package/progress-bar/ProgressBar.accessibility.test.js +0 -35
  272. package/progress-bar/ProgressBar.d.ts +0 -4
  273. package/progress-bar/ProgressBar.js +0 -144
  274. package/progress-bar/ProgressBar.stories.tsx +0 -93
  275. package/progress-bar/ProgressBar.test.js +0 -93
  276. package/progress-bar/types.d.ts +0 -37
  277. package/progress-bar/types.js +0 -5
  278. package/quick-nav/QuickNav.accessibility.test.js +0 -57
  279. package/quick-nav/QuickNav.d.ts +0 -4
  280. package/quick-nav/QuickNav.js +0 -94
  281. package/quick-nav/QuickNav.stories.tsx +0 -356
  282. package/quick-nav/types.d.ts +0 -21
  283. package/quick-nav/types.js +0 -5
  284. package/radio-group/Radio.d.ts +0 -4
  285. package/radio-group/Radio.js +0 -124
  286. package/radio-group/RadioGroup.accessibility.test.js +0 -97
  287. package/radio-group/RadioGroup.d.ts +0 -4
  288. package/radio-group/RadioGroup.js +0 -235
  289. package/radio-group/RadioGroup.stories.tsx +0 -214
  290. package/radio-group/RadioGroup.test.js +0 -756
  291. package/radio-group/types.d.ts +0 -114
  292. package/radio-group/types.js +0 -5
  293. package/resultset-table/Icons.d.ts +0 -7
  294. package/resultset-table/Icons.js +0 -47
  295. package/resultset-table/ResultsetTable.accessibility.test.js +0 -274
  296. package/resultset-table/ResultsetTable.d.ts +0 -7
  297. package/resultset-table/ResultsetTable.js +0 -170
  298. package/resultset-table/ResultsetTable.stories.tsx +0 -401
  299. package/resultset-table/ResultsetTable.test.js +0 -381
  300. package/resultset-table/types.d.ts +0 -100
  301. package/resultset-table/types.js +0 -5
  302. package/select/Listbox.d.ts +0 -4
  303. package/select/Listbox.js +0 -145
  304. package/select/Option.d.ts +0 -4
  305. package/select/Option.js +0 -88
  306. package/select/Select.accessibility.test.js +0 -217
  307. package/select/Select.d.ts +0 -4
  308. package/select/Select.js +0 -598
  309. package/select/Select.stories.tsx +0 -907
  310. package/select/Select.test.js +0 -2276
  311. package/select/types.d.ts +0 -209
  312. package/select/types.js +0 -5
  313. package/sidenav/Sidenav.accessibility.test.js +0 -59
  314. package/sidenav/Sidenav.d.ts +0 -10
  315. package/sidenav/Sidenav.js +0 -201
  316. package/sidenav/Sidenav.stories.tsx +0 -277
  317. package/sidenav/Sidenav.test.js +0 -37
  318. package/sidenav/SidenavContext.d.ts +0 -5
  319. package/sidenav/SidenavContext.js +0 -13
  320. package/sidenav/types.d.ts +0 -76
  321. package/sidenav/types.js +0 -5
  322. package/slider/Slider.accessibility.test.js +0 -104
  323. package/slider/Slider.d.ts +0 -4
  324. package/slider/Slider.js +0 -285
  325. package/slider/Slider.test.js +0 -254
  326. package/slider/types.d.ts +0 -86
  327. package/slider/types.js +0 -5
  328. package/spinner/Spinner.accessibility.test.js +0 -96
  329. package/spinner/Spinner.d.ts +0 -4
  330. package/spinner/Spinner.js +0 -206
  331. package/spinner/Spinner.stories.tsx +0 -129
  332. package/spinner/Spinner.test.js +0 -55
  333. package/spinner/types.d.ts +0 -32
  334. package/spinner/types.js +0 -5
  335. package/status-light/StatusLight.accessibility.test.js +0 -157
  336. package/status-light/StatusLight.d.ts +0 -4
  337. package/status-light/StatusLight.js +0 -51
  338. package/status-light/StatusLight.stories.tsx +0 -74
  339. package/status-light/StatusLight.test.js +0 -25
  340. package/status-light/types.d.ts +0 -17
  341. package/status-light/types.js +0 -5
  342. package/switch/Switch.accessibility.test.js +0 -89
  343. package/switch/Switch.d.ts +0 -4
  344. package/switch/Switch.js +0 -214
  345. package/switch/Switch.stories.tsx +0 -137
  346. package/switch/Switch.test.js +0 -180
  347. package/switch/types.d.ts +0 -66
  348. package/switch/types.js +0 -5
  349. package/table/DropdownTheme.js +0 -62
  350. package/table/Table.accessibility.test.js +0 -82
  351. package/table/Table.d.ts +0 -8
  352. package/table/Table.js +0 -161
  353. package/table/Table.stories.tsx +0 -651
  354. package/table/Table.test.js +0 -113
  355. package/table/types.d.ts +0 -49
  356. package/table/types.js +0 -5
  357. package/tabs/Tab.d.ts +0 -4
  358. package/tabs/Tab.js +0 -117
  359. package/tabs/Tabs.accessibility.test.js +0 -56
  360. package/tabs/Tabs.d.ts +0 -4
  361. package/tabs/Tabs.js +0 -373
  362. package/tabs/Tabs.stories.tsx +0 -224
  363. package/tabs/Tabs.test.js +0 -276
  364. package/tabs/types.d.ts +0 -92
  365. package/tabs/types.js +0 -5
  366. package/tag/Tag.accessibility.test.js +0 -69
  367. package/tag/Tag.d.ts +0 -4
  368. package/tag/Tag.js +0 -151
  369. package/tag/Tag.stories.tsx +0 -152
  370. package/tag/Tag.test.js +0 -41
  371. package/tag/types.d.ts +0 -69
  372. package/tag/types.js +0 -5
  373. package/text-input/Suggestion.d.ts +0 -4
  374. package/text-input/Suggestion.js +0 -67
  375. package/text-input/Suggestions.d.ts +0 -4
  376. package/text-input/Suggestions.js +0 -86
  377. package/text-input/TextInput.accessibility.test.js +0 -321
  378. package/text-input/TextInput.d.ts +0 -4
  379. package/text-input/TextInput.js +0 -567
  380. package/text-input/TextInput.stories.tsx +0 -465
  381. package/text-input/TextInput.test.js +0 -1756
  382. package/text-input/types.d.ts +0 -205
  383. package/text-input/types.js +0 -5
  384. package/textarea/Textarea.accessibility.test.js +0 -155
  385. package/textarea/Textarea.d.ts +0 -4
  386. package/textarea/Textarea.js +0 -234
  387. package/textarea/Textarea.stories.tsx +0 -174
  388. package/textarea/Textarea.test.js +0 -406
  389. package/textarea/types.d.ts +0 -141
  390. package/textarea/types.js +0 -5
  391. package/toggle-group/ToggleGroup.accessibility.test.js +0 -107
  392. package/toggle-group/ToggleGroup.d.ts +0 -4
  393. package/toggle-group/ToggleGroup.js +0 -202
  394. package/toggle-group/ToggleGroup.stories.tsx +0 -218
  395. package/toggle-group/ToggleGroup.test.js +0 -137
  396. package/toggle-group/types.d.ts +0 -114
  397. package/toggle-group/types.js +0 -5
  398. package/typography/Typography.accessibility.test.js +0 -339
  399. package/typography/Typography.d.ts +0 -4
  400. package/typography/Typography.js +0 -23
  401. package/typography/Typography.stories.tsx +0 -198
  402. package/typography/types.d.ts +0 -18
  403. package/typography/types.js +0 -5
  404. package/useTheme.d.ts +0 -1148
  405. package/useTheme.js +0 -15
  406. package/useTranslatedLabels.d.ts +0 -85
  407. package/useTranslatedLabels.js +0 -14
  408. package/utils/BaseTypography.d.ts +0 -21
  409. package/utils/BaseTypography.js +0 -94
  410. package/utils/FocusLock.d.ts +0 -13
  411. package/utils/FocusLock.js +0 -124
  412. package/wizard/Wizard.accessibility.test.js +0 -55
  413. package/wizard/Wizard.d.ts +0 -4
  414. package/wizard/Wizard.js +0 -247
  415. package/wizard/Wizard.stories.tsx +0 -272
  416. package/wizard/Wizard.test.js +0 -114
  417. package/wizard/types.d.ts +0 -64
  418. package/wizard/types.js +0 -5
package/wizard/Wizard.js DELETED
@@ -1,247 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof3 = require("@babel/runtime/helpers/typeof");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
10
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
12
- var _react = _interopRequireWildcard(require("react"));
13
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
14
- var _variables = require("../common/variables");
15
- var _useTheme = _interopRequireDefault(require("../useTheme"));
16
- var _Icon = _interopRequireDefault(require("../icon/Icon"));
17
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
18
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
19
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
20
- var icons = {
21
- validIcon: /*#__PURE__*/_react["default"].createElement("svg", {
22
- id: "check_circle_black_18dp",
23
- xmlns: "http://www.w3.org/2000/svg",
24
- width: "18",
25
- height: "18",
26
- viewBox: "0 0 18 18"
27
- }, /*#__PURE__*/_react["default"].createElement("path", {
28
- id: "Path_2946",
29
- "data-name": "Path 2946",
30
- d: "M0,0H18V18H0Z",
31
- fill: "none"
32
- }), /*#__PURE__*/_react["default"].createElement("path", {
33
- id: "Path_2947",
34
- "data-name": "Path 2947",
35
- d: "M9.986,4a5.986,5.986,0,1,0,5.986,5.986A5.994,5.994,0,0,0,9.986,4Zm-1.5,9.727L5.5,10.734,6.551,9.679l1.938,1.93L13.42,6.679l1.055,1.063Z",
36
- transform: "translate(-0.986 -0.986)",
37
- fill: "#eafaef",
38
- opacity: "0.999"
39
- }), /*#__PURE__*/_react["default"].createElement("path", {
40
- id: "Path_2948",
41
- "data-name": "Path 2948",
42
- d: "M9.493,2a7.493,7.493,0,1,0,7.493,7.493A7.5,7.5,0,0,0,9.493,2Zm0,13.487a5.994,5.994,0,1,1,5.994-5.994A6,6,0,0,1,9.493,15.487Zm3.439-9.306L7.994,11.119,6.054,9.186,5,10.242l3,3,5.994-5.994Z",
43
- transform: "translate(-0.493 -0.493)",
44
- fill: "#24a148"
45
- })),
46
- invalidIcon: /*#__PURE__*/_react["default"].createElement("svg", {
47
- id: "highlight_off_black_18dp",
48
- xmlns: "http://www.w3.org/2000/svg",
49
- width: "18",
50
- height: "18",
51
- viewBox: "0 0 18 18"
52
- }, /*#__PURE__*/_react["default"].createElement("path", {
53
- id: "Path_2943",
54
- "data-name": "Path 2943",
55
- d: "M0,0H18V18H0Z",
56
- fill: "none"
57
- }), /*#__PURE__*/_react["default"].createElement("path", {
58
- id: "Path_2944",
59
- "data-name": "Path 2944",
60
- d: "M10,4a6,6,0,1,0,6,6A6.01,6.01,0,0,0,10,4Zm3,7.945L11.945,13,10,11.06,8.059,13,7,11.945,8.944,10,7,8.059,8.059,7,10,8.944,11.945,7,13,8.059,11.06,10Z",
61
- transform: "translate(-1.002 -1.002)",
62
- fill: "#ffe6e9"
63
- }), /*#__PURE__*/_react["default"].createElement("path", {
64
- id: "Path_2945",
65
- "data-name": "Path 2945",
66
- d: "M11.444,6.5,9.5,8.443,7.558,6.5,6.5,7.558,8.443,9.5,6.5,11.444,7.558,12.5,9.5,10.558,11.444,12.5,12.5,11.444,10.558,9.5,12.5,7.558ZM9.5,2A7.5,7.5,0,1,0,17,9.5,7.494,7.494,0,0,0,9.5,2Zm0,13.5a6,6,0,1,1,6-6A6.009,6.009,0,0,1,9.5,15.5Z",
67
- transform: "translate(-0.501 -0.501)",
68
- fill: "#d0011b"
69
- }))
70
- };
71
- var DxcWizard = function DxcWizard(_ref) {
72
- var _ref2;
73
- var _ref$mode = _ref.mode,
74
- mode = _ref$mode === void 0 ? "horizontal" : _ref$mode,
75
- defaultCurrentStep = _ref.defaultCurrentStep,
76
- currentStep = _ref.currentStep,
77
- onStepClick = _ref.onStepClick,
78
- steps = _ref.steps,
79
- margin = _ref.margin,
80
- _ref$tabIndex = _ref.tabIndex,
81
- tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
82
- var _useState = (0, _react.useState)((_ref2 = currentStep !== null && currentStep !== void 0 ? currentStep : defaultCurrentStep) !== null && _ref2 !== void 0 ? _ref2 : 0),
83
- _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
84
- innerCurrent = _useState2[0],
85
- setInnerCurrentStep = _useState2[1];
86
- var renderedCurrent = currentStep == null ? innerCurrent : currentStep;
87
- var colorsTheme = (0, _useTheme["default"])();
88
- var handleStepClick = function handleStepClick(newValue) {
89
- if (currentStep == null) {
90
- setInnerCurrentStep(newValue);
91
- }
92
- if (onStepClick) {
93
- onStepClick(newValue);
94
- }
95
- };
96
- return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
97
- theme: colorsTheme.wizard
98
- }, /*#__PURE__*/_react["default"].createElement(StepsContainer, {
99
- mode: mode,
100
- margin: margin,
101
- role: "group"
102
- }, steps === null || steps === void 0 ? void 0 : steps.map(function (step, i) {
103
- return /*#__PURE__*/_react["default"].createElement(StepContainer, {
104
- key: "step".concat(i),
105
- mode: mode,
106
- lastStep: i === (steps === null || steps === void 0 ? void 0 : steps.length) - 1
107
- }, /*#__PURE__*/_react["default"].createElement(Step, {
108
- onClick: function onClick() {
109
- handleStepClick(i);
110
- },
111
- disabled: step.disabled,
112
- mode: mode,
113
- first: i === 0,
114
- last: i === (steps === null || steps === void 0 ? void 0 : steps.length) - 1,
115
- "aria-current": renderedCurrent === i ? "step" : "false",
116
- tabIndex: tabIndex
117
- }, /*#__PURE__*/_react["default"].createElement(StepHeader, {
118
- validityIcon: step.valid !== undefined
119
- }, /*#__PURE__*/_react["default"].createElement(IconContainer, {
120
- current: i === renderedCurrent,
121
- visited: i < renderedCurrent,
122
- disabled: step.disabled
123
- }, step.icon ? typeof step.icon === "string" ? /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
124
- icon: step.icon
125
- }) : step.icon : /*#__PURE__*/_react["default"].createElement(Number, null, i + 1)), step.valid !== undefined && (step.valid ? /*#__PURE__*/_react["default"].createElement(ValidityIconContainer, null, icons.validIcon) : /*#__PURE__*/_react["default"].createElement(ValidityIconContainer, null, icons.invalidIcon))), (step.label || step.description) && /*#__PURE__*/_react["default"].createElement(InfoContainer, null, step.label && /*#__PURE__*/_react["default"].createElement(Label, {
126
- current: i === renderedCurrent,
127
- disabled: step.disabled,
128
- visited: i <= innerCurrent
129
- }, step.label), step.description && /*#__PURE__*/_react["default"].createElement(Description, {
130
- current: i === renderedCurrent,
131
- disabled: step.disabled,
132
- visited: i <= innerCurrent
133
- }, step.description))), i === steps.length - 1 ? "" : /*#__PURE__*/_react["default"].createElement(StepSeparator, {
134
- mode: mode
135
- }));
136
- })));
137
- };
138
- var StepsContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n justify-content: center;\n ", ";\n font-family: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
139
- return props.mode === "vertical" ? "column" : "row";
140
- }, function (props) {
141
- return props.mode === "vertical" && "height: 500px";
142
- }, function (props) {
143
- return props.theme.fontFamily;
144
- }, function (props) {
145
- return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
146
- }, function (props) {
147
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
148
- }, function (props) {
149
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
150
- }, function (props) {
151
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
152
- }, function (props) {
153
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
154
- });
155
- var StepContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n ", "\n flex-grow: ", ";\n flex-direction: ", ";\n ", "\n"])), function (props) {
156
- return props.mode !== "vertical" && "align-items: center;";
157
- }, function (props) {
158
- return props.lastStep ? "0" : "1";
159
- }, function (props) {
160
- return props.mode === "vertical" ? "column" : "row";
161
- }, function (props) {
162
- return props.mode === "vertical" && "width: fit-content;";
163
- });
164
- var Step = _styledComponents["default"].button(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: flex-start;\n align-items: center;\n border: none;\n border-radius: 0.25rem;\n background: inherit;\n margin: ", ";\n\n padding: 0px;\n ", ";\n\n &:hover {\n ", ";\n }\n &:focus {\n outline: 2px solid ", ";\n }\n"])), function (props) {
165
- return props.first ? props.mode === "vertical" ? "0 0 24px 0" : "0 24px 0 0" : props.last ? props.mode === "vertical" ? "24px 0 0 0" : "0 0 0 24px" : props.mode === "vertical" ? "24px 0" : "0 24px";
166
- }, function (props) {
167
- return props.disabled ? "cursor: not-allowed" : "";
168
- }, function (props) {
169
- return props.disabled ? "" : "cursor: pointer";
170
- }, function (props) {
171
- return props.theme.focusColor;
172
- });
173
- var StepHeader = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n display: inline-flex;\n ", "\n"])), function (props) {
174
- return props.validityIcon && "padding-bottom: 4px;";
175
- });
176
- var IconContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n\n ", "\n ", ";\n\n border-radius: ", ";\n\n display: flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n font-size: ", ";\n svg {\n width: ", ";\n height: ", ";\n }\n"])), function (props) {
177
- return props.disabled ? props.theme.disabledStepWidth : props.current ? props.theme.selectedStepWidth : props.theme.stepWidth;
178
- }, function (props) {
179
- return props.disabled ? props.theme.disabledStepHeight : props.current ? props.theme.selectedStepHeight : props.theme.stepHeight;
180
- }, function (props) {
181
- return "\n ".concat(props.disabled ? "border: ".concat(props.theme.disabledStepBorderThickness, " ").concat(props.theme.disabledStepBorderStyle, " ").concat(props.theme.disabledStepBorderColor, ";") : props.current ? "border: ".concat(props.theme.selectedStepBorderThickness, " ").concat(props.theme.selectedStepBorderStyle, " ").concat(props.theme.selectedStepBorderColor, ";") : props.visited ? "border: ".concat(props.theme.stepBorderThickness, " ").concat(props.theme.stepBorderStyle, " ").concat(props.theme.visitedStepBorderColor, ";") : "border: ".concat(props.theme.stepBorderThickness, " ").concat(props.theme.stepBorderStyle, " ").concat(props.theme.unvisitedStepBorderColor, ";"), "\n background: ").concat(props.disabled ? "".concat(props.theme.disabledStepBackgroundColor) : props.current ? "".concat(props.theme.selectedStepBackgroundColor) : !props.visited ? "".concat(props.theme.unvisitedStepBackgroundColor) : "".concat(props.theme.visitedStepBackgroundColor), ";\n ");
182
- }, function (props) {
183
- return props.disabled ? "color: ".concat(props.theme.disabledStepFontColor, ";") : "color: ".concat(props.current ? props.theme.selectedStepFontColor : !props.visited ? props.theme.unvisitedStepFontColor : props.theme.visitedStepFontColor, ";");
184
- }, function (props) {
185
- return !props.current && !props.disabled ? props.theme.stepBorderRadius : props.current ? props.theme.selectedStepBorderRadius : props.disabled ? props.theme.disabledStepBorderRadius : "";
186
- }, function (props) {
187
- return props.theme.stepIconSize;
188
- }, function (props) {
189
- return props.theme.stepIconSize;
190
- }, function (props) {
191
- return props.theme.stepIconSize;
192
- });
193
- var Number = _styledComponents["default"].p(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-family: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n opacity: 1;\n margin: 0px 0px 0px 1px;\n"])), function (props) {
194
- return props.theme.stepFontSize;
195
- }, function (props) {
196
- return props.theme.stepFontFamily;
197
- }, function (props) {
198
- return props.theme.stepFontStyle;
199
- }, function (props) {
200
- return props.theme.stepFontWeight;
201
- }, function (props) {
202
- return props.theme.stepFontTracking;
203
- });
204
- var ValidityIconContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n width: 18px;\n height: 18px;\n position: absolute;\n top: 22.5px;\n left: 22.5px;\n"])));
205
- var InfoContainer = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: 12px;\n"])));
206
- var Label = _styledComponents["default"].p(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n text-align: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n ", ";\n text-transform: ", ";\n margin: 0;\n"])), function (props) {
207
- return props.theme.labelTextAlign;
208
- }, function (props) {
209
- return props.theme.labelFontFamily;
210
- }, function (props) {
211
- return props.theme.labelFontSize;
212
- }, function (props) {
213
- return props.theme.labelFontStyle;
214
- }, function (props) {
215
- return props.theme.labelFontWeight;
216
- }, function (props) {
217
- return props.theme.labelFontTracking;
218
- }, function (props) {
219
- return props.disabled ? "color: ".concat(props.theme.disabledLabelFontColor, ";") : "color: ".concat(!props.visited ? props.theme.unvisitedLabelFontColor : props.current ? props.theme.selectedLabelFontColor : props.theme.visitedLabelFontColor, ";");
220
- }, function (props) {
221
- return props.theme.labelFontTextTransform;
222
- });
223
- var Description = _styledComponents["default"].p(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n text-align: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n ", ";\n margin: 0;\n"])), function (props) {
224
- return props.theme.helperTextTextAlign;
225
- }, function (props) {
226
- return props.theme.helperTextFontFamily;
227
- }, function (props) {
228
- return props.theme.helperTextFontSize;
229
- }, function (props) {
230
- return props.theme.helperTextFontStyle;
231
- }, function (props) {
232
- return props.theme.helperTextFontWeight;
233
- }, function (props) {
234
- return props.theme.helperTextFontTracking;
235
- }, function (props) {
236
- return props.theme.helperTextFontTextTransform;
237
- }, function (props) {
238
- return props.disabled ? "color: ".concat(props.theme.disabledHelperTextFontColor, ";") : "color: ".concat(!props.visited ? props.theme.unvisitedHelperTextFontColor : props.current ? props.theme.selectedHelperTextFontColor : props.theme.visitedHelperTextFontColor, ";");
239
- });
240
- var StepSeparator = _styledComponents["default"].div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["\n ", ";\n ", "\n border: ", ";\n opacity: 1;\n flex-grow: 1;\n"])), function (props) {
241
- return props.mode === "horizontal" ? "height: 0;" : "width: 0;";
242
- }, function (props) {
243
- return props.mode === "vertical" && "margin: 0 18px;";
244
- }, function (props) {
245
- return "".concat(props.theme.separatorBorderStyle, " ").concat(props.theme.separatorBorderThickness, " ").concat(props.theme.separatorColor);
246
- });
247
- var _default = exports["default"] = DxcWizard;
@@ -1,272 +0,0 @@
1
- import React from "react";
2
- import DxcWizard from "./Wizard";
3
- import Title from "../../.storybook/components/Title";
4
- import ExampleContainer from "../../.storybook/components/ExampleContainer";
5
- import { userEvent, within } from "@storybook/testing-library";
6
- import { HalstackProvider } from "../HalstackContext";
7
-
8
- export default {
9
- title: "Wizard",
10
- component: DxcWizard,
11
- };
12
-
13
- const favoriteSVG = (
14
- <svg viewBox="0 0 24 24" fill="currentColor">
15
- <path d="M0 0h24v24H0z" fill="none" />
16
- <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" />
17
- </svg>
18
- );
19
- const largeIcon = (
20
- <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 0 24 24" width="48px" fill="currentColor">
21
- <path d="M0 0h24v24H0z" fill="none" />
22
- <path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z" />
23
- </svg>
24
- );
25
-
26
- const stepWithLabel = [
27
- {
28
- label: "First step",
29
- },
30
- {
31
- label: "Second step",
32
- },
33
- {
34
- label: "Third step",
35
- },
36
- {
37
- label: "Forth step",
38
- },
39
- ];
40
-
41
- const stepWithLabelDescription = [
42
- {
43
- label: "First step",
44
- description: "Description",
45
- },
46
- {
47
- label: "Second step",
48
- description: "Description",
49
- },
50
- {
51
- label: "Third step",
52
- description: "Description",
53
- valid: true,
54
- },
55
- {
56
- label: "Forth step",
57
- description: "Description",
58
- valid: false,
59
- },
60
- ];
61
-
62
- const stepWithLongDescription = [
63
- {
64
- label: "First step",
65
- description:
66
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. ",
67
- },
68
- {
69
- label: "Second step",
70
- description:
71
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. ",
72
- },
73
- {
74
- label: "Third step",
75
- description:
76
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. ",
77
- },
78
- ];
79
-
80
- const stepDisabled = [
81
- {
82
- label: "First step",
83
- description: "Description",
84
- disabled: true,
85
- },
86
- {
87
- label: "Second step",
88
- description: "Description",
89
- icon: favoriteSVG,
90
- disabled: true,
91
- },
92
- {
93
- label: "Third step",
94
- description: "Description",
95
- disabled: true,
96
- valid: true,
97
- },
98
- {
99
- label: "Forth step",
100
- description: "Description",
101
- valid: false,
102
- disabled: true,
103
- },
104
- ];
105
-
106
- const stepIcons = [
107
- {
108
- label: "First step",
109
- icon: favoriteSVG,
110
- },
111
- {
112
- label: "Second step",
113
- icon: favoriteSVG,
114
- },
115
- {
116
- label: "Third step",
117
- icon: favoriteSVG,
118
- },
119
- ];
120
-
121
- const stepLargeIcons = [
122
- {
123
- label: "First step",
124
- icon: largeIcon,
125
- },
126
- {
127
- label: "Second step",
128
- icon: largeIcon,
129
- },
130
- {
131
- label: "Third step",
132
- icon: largeIcon,
133
- },
134
- ];
135
-
136
- const stepMaterialSymbols = [
137
- {
138
- label: "First step",
139
- icon: "filled_home",
140
- },
141
- {
142
- label: "Second step",
143
- icon: "filled_favorite",
144
- },
145
- {
146
- label: "Third step",
147
- icon: "filled_star",
148
- },
149
- ];
150
-
151
- const opinionatedTheme = {
152
- wizard: {
153
- baseColor: "#5f249f",
154
- fontColor: "#000000",
155
- selectedStepFontColor: "#ffffff",
156
- },
157
- };
158
-
159
- export const Chromatic = () => (
160
- <>
161
- <ExampleContainer>
162
- <Title title="Current step in the third step, labels and description" theme="light" level={4} />
163
- <DxcWizard defaultCurrentStep={2} steps={stepWithLabelDescription}></DxcWizard>
164
- </ExampleContainer>
165
- <ExampleContainer>
166
- <Title title="With long description in horizontal" theme="light" level={4} />
167
- <DxcWizard steps={stepWithLongDescription}></DxcWizard>
168
- </ExampleContainer>
169
- <ExampleContainer>
170
- <Title title="With long description in vertical" theme="light" level={4} />
171
- <DxcWizard mode="vertical" steps={stepWithLongDescription}></DxcWizard>
172
- </ExampleContainer>
173
- <ExampleContainer>
174
- <Title title="Disabled steps" theme="light" level={4} />
175
- <DxcWizard steps={stepDisabled}></DxcWizard>
176
- </ExampleContainer>
177
- <ExampleContainer pseudoState="pseudo-focus">
178
- <Title title="Focused steps" theme="light" level={4} />
179
- <DxcWizard steps={stepIcons}></DxcWizard>
180
- </ExampleContainer>
181
- <ExampleContainer>
182
- <Title title="With icons" theme="light" level={4} />
183
- <DxcWizard steps={stepIcons}></DxcWizard>
184
- </ExampleContainer>
185
- <ExampleContainer>
186
- <Title title="With large icons" theme="light" level={4} />
187
- <DxcWizard steps={stepLargeIcons}></DxcWizard>
188
- </ExampleContainer>
189
- <ExampleContainer>
190
- <Title title="With Material Symbols" theme="light" level={4} />
191
- <DxcWizard steps={stepMaterialSymbols}></DxcWizard>
192
- </ExampleContainer>
193
- <Title title="Margins horizontal" theme="light" level={2} />
194
- <ExampleContainer>
195
- <Title title="Xxsmall margin" theme="light" level={4} />
196
- <DxcWizard margin="xxsmall" steps={stepWithLabel}></DxcWizard>
197
- </ExampleContainer>
198
- <ExampleContainer>
199
- <Title title="Xsmall margin" theme="light" level={4} />
200
- <DxcWizard margin="xsmall" steps={stepWithLabel}></DxcWizard>
201
- </ExampleContainer>
202
- <ExampleContainer>
203
- <Title title="Small margin" theme="light" level={4} />
204
- <DxcWizard margin="small" steps={stepWithLabel}></DxcWizard>
205
- </ExampleContainer>
206
- <ExampleContainer>
207
- <Title title="Medium margin" theme="light" level={4} />
208
- <DxcWizard margin="medium" steps={stepWithLabel}></DxcWizard>
209
- </ExampleContainer>
210
- <ExampleContainer>
211
- <Title title="Large margin" theme="light" level={4} />
212
- <DxcWizard margin="large" steps={stepWithLabel}></DxcWizard>
213
- </ExampleContainer>
214
- <ExampleContainer>
215
- <Title title="Xlarge margin" theme="light" level={4} />
216
- <DxcWizard margin="xlarge" steps={stepWithLabel}></DxcWizard>
217
- </ExampleContainer>
218
- <ExampleContainer>
219
- <Title title="Xxlarge margin" theme="light" level={4} />
220
- <DxcWizard margin="xxlarge" steps={stepWithLabel}></DxcWizard>
221
- </ExampleContainer>
222
- <Title title="Margins vertical" theme="light" level={2} />
223
- <ExampleContainer>
224
- <Title title="Xxsmall margin" theme="light" level={4} />
225
- <DxcWizard mode="vertical" margin="xxsmall" steps={stepWithLabelDescription}></DxcWizard>
226
- </ExampleContainer>
227
- <ExampleContainer>
228
- <Title title="Xsmall margin" theme="light" level={4} />
229
- <DxcWizard mode="vertical" margin="xsmall" steps={stepWithLabel}></DxcWizard>
230
- </ExampleContainer>
231
- <ExampleContainer>
232
- <Title title="Small margin" theme="light" level={4} />
233
- <DxcWizard mode="vertical" margin="small" steps={stepWithLabel}></DxcWizard>
234
- </ExampleContainer>
235
- <ExampleContainer>
236
- <Title title="Medium margin" theme="light" level={4} />
237
- <DxcWizard mode="vertical" margin="medium" steps={stepWithLabel}></DxcWizard>
238
- </ExampleContainer>
239
- <ExampleContainer>
240
- <Title title="Large margin" theme="light" level={4} />
241
- <DxcWizard mode="vertical" margin="large" steps={stepWithLabel}></DxcWizard>
242
- </ExampleContainer>
243
- <ExampleContainer>
244
- <Title title="Xlarge margin" theme="light" level={4} />
245
- <DxcWizard mode="vertical" margin="xlarge" steps={stepWithLabel}></DxcWizard>
246
- </ExampleContainer>
247
- <ExampleContainer>
248
- <Title title="Xxlarge margin" theme="light" level={4} />
249
- <DxcWizard mode="vertical" margin="xxlarge" steps={stepWithLabel}></DxcWizard>
250
- </ExampleContainer>
251
- <Title title="Opinionated theme" theme="light" level={2} />
252
- <ExampleContainer>
253
- <HalstackProvider theme={opinionatedTheme}>
254
- <DxcWizard defaultCurrentStep={2} steps={stepWithLabelDescription}></DxcWizard>
255
- </HalstackProvider>
256
- </ExampleContainer>
257
- </>
258
- );
259
-
260
- const WizardSelected = () => (
261
- <ExampleContainer>
262
- <Title title="Clicked step" theme="light" level={4} />
263
- <DxcWizard steps={stepWithLabel} mode="vertical"></DxcWizard>
264
- </ExampleContainer>
265
- );
266
-
267
- export const WizardStepActived = WizardSelected.bind({});
268
- WizardStepActived.play = async ({ canvasElement }) => {
269
- const canvas = within(canvasElement);
270
- const option = canvas.getByText("Third step");
271
- await userEvent.click(option);
272
- };
@@ -1,114 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _react = _interopRequireDefault(require("react"));
5
- var _react2 = require("@testing-library/react");
6
- var _Wizard = _interopRequireDefault(require("./Wizard.tsx"));
7
- describe("Wizard components tests", function () {
8
- test("Wizard renders with correct steps", function () {
9
- var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Wizard["default"], {
10
- steps: [{
11
- label: "first-step"
12
- }, {
13
- label: "second-step"
14
- }]
15
- })),
16
- getByText = _render.getByText,
17
- getAllByRole = _render.getAllByRole;
18
- var steps = getAllByRole("button");
19
- expect(getByText("first-step")).toBeTruthy();
20
- expect(getByText("second-step")).toBeTruthy();
21
- expect(steps[0].getAttribute("aria-current")).toBe("step");
22
- expect(steps[1].getAttribute("aria-current")).toBe("false");
23
- });
24
- test("Wizard renders with initially selected step", function () {
25
- var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Wizard["default"], {
26
- defaultCurrentStep: 1,
27
- steps: [{
28
- label: "first-step"
29
- }, {
30
- label: "second-step"
31
- }]
32
- })),
33
- getAllByRole = _render2.getAllByRole;
34
- var steps = getAllByRole("button");
35
- expect(steps[1].getAttribute("aria-current")).toBe("step");
36
- });
37
- test("Click on step text", function () {
38
- var onClick = jest.fn();
39
- var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Wizard["default"], {
40
- onStepClick: onClick,
41
- steps: [{
42
- label: "first-step"
43
- }]
44
- })),
45
- getByText = _render3.getByText;
46
- var step = getByText("first-step");
47
- _react2.fireEvent.click(step);
48
- expect(onClick).toHaveBeenCalled();
49
- });
50
- test("Click on step description", function () {
51
- var onClick = jest.fn();
52
- var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Wizard["default"], {
53
- onStepClick: onClick,
54
- steps: [{
55
- label: "first-step",
56
- description: "step-description"
57
- }]
58
- })),
59
- getByText = _render4.getByText;
60
- var step = getByText("step-description");
61
- _react2.fireEvent.click(step);
62
- expect(onClick).toHaveBeenCalled();
63
- });
64
- test("Click on step number", function () {
65
- var onClick = jest.fn();
66
- var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Wizard["default"], {
67
- onStepClick: onClick,
68
- steps: [{
69
- label: "first-step"
70
- }]
71
- })),
72
- getByText = _render5.getByText;
73
- var step = getByText("1");
74
- _react2.fireEvent.click(step);
75
- expect(onClick).toHaveBeenCalled();
76
- });
77
- test("Click on disable step", function () {
78
- var onClick = jest.fn();
79
- var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Wizard["default"], {
80
- onStepClick: onClick,
81
- steps: [{
82
- label: "first-step"
83
- }, {
84
- label: "second-step",
85
- disabled: true
86
- }]
87
- })),
88
- getByText = _render6.getByText;
89
- var step = getByText("second-step");
90
- _react2.fireEvent.click(step);
91
- expect(onClick).toHaveBeenCalledTimes(0);
92
- });
93
- test("Controlled wizard function is called", function () {
94
- var onClick = jest.fn(function (i) {
95
- return i;
96
- });
97
- var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Wizard["default"], {
98
- currentStep: 0,
99
- onStepClick: onClick,
100
- steps: [{
101
- label: "first-step"
102
- }, {
103
- label: "second-step"
104
- }]
105
- })),
106
- getAllByRole = _render7.getAllByRole;
107
- var steps = getAllByRole("button");
108
- _react2.fireEvent.click(steps[1]);
109
- _react2.fireEvent.click(steps[0]);
110
- expect(onClick).toHaveBeenCalledTimes(2);
111
- expect(onClick).toHaveBeenNthCalledWith(1, 1);
112
- expect(onClick).toHaveBeenNthCalledWith(2, 0);
113
- });
114
- });