@dxc-technology/halstack-react 0.0.0-f2bad31 → 0.0.0-f2ee373

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 (426) hide show
  1. package/README.md +1 -2
  2. package/dist/index.d.mts +6670 -0
  3. package/dist/index.d.ts +6670 -0
  4. package/dist/index.js +14289 -0
  5. package/dist/index.mjs +14232 -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 -159
  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 -223
  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 -115
  125. package/date-input/Icons.d.ts +0 -6
  126. package/date-input/Icons.js +0 -58
  127. package/date-input/YearPicker.d.ts +0 -4
  128. package/date-input/YearPicker.js +0 -100
  129. package/date-input/types.d.ts +0 -164
  130. package/date-input/types.js +0 -5
  131. package/dialog/Dialog.accessibility.test.js +0 -69
  132. package/dialog/Dialog.d.ts +0 -4
  133. package/dialog/Dialog.js +0 -104
  134. package/dialog/Dialog.stories.tsx +0 -365
  135. package/dialog/Dialog.test.js +0 -307
  136. package/dialog/types.d.ts +0 -36
  137. package/dialog/types.js +0 -5
  138. package/divider/Divider.accessibility.test.js +0 -33
  139. package/divider/Divider.d.ts +0 -4
  140. package/divider/Divider.js +0 -36
  141. package/divider/Divider.stories.tsx +0 -223
  142. package/divider/Divider.test.js +0 -38
  143. package/divider/types.d.ts +0 -21
  144. package/divider/types.js +0 -5
  145. package/dropdown/Dropdown.accessibility.test.js +0 -180
  146. package/dropdown/Dropdown.d.ts +0 -4
  147. package/dropdown/Dropdown.js +0 -319
  148. package/dropdown/Dropdown.stories.tsx +0 -427
  149. package/dropdown/Dropdown.test.js +0 -599
  150. package/dropdown/DropdownMenu.d.ts +0 -4
  151. package/dropdown/DropdownMenu.js +0 -63
  152. package/dropdown/DropdownMenuItem.d.ts +0 -4
  153. package/dropdown/DropdownMenuItem.js +0 -70
  154. package/dropdown/types.d.ts +0 -96
  155. package/dropdown/types.js +0 -5
  156. package/file-input/FileInput.accessibility.test.js +0 -160
  157. package/file-input/FileInput.d.ts +0 -4
  158. package/file-input/FileInput.js +0 -479
  159. package/file-input/FileInput.stories.tsx +0 -618
  160. package/file-input/FileInput.test.js +0 -459
  161. package/file-input/FileItem.d.ts +0 -4
  162. package/file-input/FileItem.js +0 -135
  163. package/file-input/types.d.ts +0 -129
  164. package/file-input/types.js +0 -5
  165. package/flex/Flex.d.ts +0 -4
  166. package/flex/Flex.js +0 -57
  167. package/flex/Flex.stories.tsx +0 -112
  168. package/flex/types.d.ts +0 -97
  169. package/flex/types.js +0 -5
  170. package/footer/Footer.accessibility.test.js +0 -117
  171. package/footer/Footer.d.ts +0 -4
  172. package/footer/Footer.js +0 -138
  173. package/footer/Footer.stories.tsx +0 -170
  174. package/footer/Footer.test.js +0 -85
  175. package/footer/Icons.d.ts +0 -3
  176. package/footer/Icons.js +0 -136
  177. package/footer/types.d.ts +0 -64
  178. package/footer/types.js +0 -5
  179. package/grid/Grid.d.ts +0 -7
  180. package/grid/Grid.js +0 -76
  181. package/grid/Grid.stories.tsx +0 -219
  182. package/grid/types.d.ts +0 -115
  183. package/grid/types.js +0 -5
  184. package/header/Header.accessibility.test.js +0 -84
  185. package/header/Header.d.ts +0 -8
  186. package/header/Header.js +0 -220
  187. package/header/Header.stories.tsx +0 -251
  188. package/header/Header.test.js +0 -66
  189. package/header/Icons.d.ts +0 -2
  190. package/header/Icons.js +0 -29
  191. package/header/types.d.ts +0 -33
  192. package/header/types.js +0 -5
  193. package/heading/Heading.accessibility.test.js +0 -33
  194. package/heading/Heading.d.ts +0 -4
  195. package/heading/Heading.js +0 -137
  196. package/heading/Heading.stories.tsx +0 -54
  197. package/heading/Heading.test.js +0 -169
  198. package/heading/types.d.ts +0 -33
  199. package/heading/types.js +0 -5
  200. package/icon/Icon.accessibility.test.js +0 -30
  201. package/icon/Icon.d.ts +0 -4
  202. package/icon/Icon.js +0 -33
  203. package/icon/Icon.stories.tsx +0 -28
  204. package/icon/types.d.ts +0 -4
  205. package/icon/types.js +0 -5
  206. package/image/Image.accessibility.test.js +0 -56
  207. package/image/Image.d.ts +0 -4
  208. package/image/Image.js +0 -70
  209. package/image/Image.stories.tsx +0 -129
  210. package/image/types.d.ts +0 -72
  211. package/image/types.js +0 -5
  212. package/inset/Inset.d.ts +0 -3
  213. package/inset/Inset.js +0 -43
  214. package/inset/Inset.stories.tsx +0 -230
  215. package/inset/types.d.ts +0 -37
  216. package/inset/types.js +0 -5
  217. package/layout/ApplicationLayout.d.ts +0 -20
  218. package/layout/ApplicationLayout.js +0 -134
  219. package/layout/ApplicationLayout.stories.tsx +0 -162
  220. package/layout/Icons.d.ts +0 -8
  221. package/layout/Icons.js +0 -56
  222. package/layout/types.d.ts +0 -41
  223. package/layout/types.js +0 -5
  224. package/link/Link.accessibility.test.js +0 -112
  225. package/link/Link.d.ts +0 -4
  226. package/link/Link.js +0 -115
  227. package/link/Link.stories.tsx +0 -253
  228. package/link/Link.test.js +0 -63
  229. package/link/types.d.ts +0 -54
  230. package/link/types.js +0 -5
  231. package/main.d.ts +0 -49
  232. package/main.js +0 -357
  233. package/nav-tabs/NavTabs.accessibility.test.js +0 -52
  234. package/nav-tabs/NavTabs.d.ts +0 -7
  235. package/nav-tabs/NavTabs.js +0 -93
  236. package/nav-tabs/NavTabs.stories.tsx +0 -276
  237. package/nav-tabs/NavTabs.test.js +0 -76
  238. package/nav-tabs/NavTabsContext.d.ts +0 -3
  239. package/nav-tabs/NavTabsContext.js +0 -8
  240. package/nav-tabs/Tab.d.ts +0 -4
  241. package/nav-tabs/Tab.js +0 -118
  242. package/nav-tabs/types.d.ts +0 -52
  243. package/nav-tabs/types.js +0 -5
  244. package/number-input/NumberInput.accessibility.test.js +0 -228
  245. package/number-input/NumberInput.d.ts +0 -4
  246. package/number-input/NumberInput.js +0 -86
  247. package/number-input/NumberInput.stories.tsx +0 -131
  248. package/number-input/NumberInput.test.js +0 -989
  249. package/number-input/NumberInputContext.d.ts +0 -3
  250. package/number-input/NumberInputContext.js +0 -8
  251. package/number-input/types.d.ts +0 -136
  252. package/number-input/types.js +0 -5
  253. package/paginator/Icons.d.ts +0 -5
  254. package/paginator/Icons.js +0 -40
  255. package/paginator/Paginator.accessibility.test.js +0 -79
  256. package/paginator/Paginator.d.ts +0 -4
  257. package/paginator/Paginator.js +0 -135
  258. package/paginator/Paginator.stories.tsx +0 -87
  259. package/paginator/Paginator.test.js +0 -335
  260. package/paginator/types.d.ts +0 -38
  261. package/paginator/types.js +0 -5
  262. package/paragraph/Paragraph.accessibility.test.js +0 -28
  263. package/paragraph/Paragraph.d.ts +0 -5
  264. package/paragraph/Paragraph.js +0 -22
  265. package/paragraph/Paragraph.stories.tsx +0 -27
  266. package/password-input/Icons.d.ts +0 -6
  267. package/password-input/Icons.js +0 -35
  268. package/password-input/PasswordInput.accessibility.test.js +0 -153
  269. package/password-input/PasswordInput.d.ts +0 -4
  270. package/password-input/PasswordInput.js +0 -97
  271. package/password-input/PasswordInput.stories.tsx +0 -99
  272. package/password-input/PasswordInput.test.js +0 -198
  273. package/password-input/types.d.ts +0 -111
  274. package/password-input/types.js +0 -5
  275. package/progress-bar/ProgressBar.accessibility.test.js +0 -35
  276. package/progress-bar/ProgressBar.d.ts +0 -4
  277. package/progress-bar/ProgressBar.js +0 -144
  278. package/progress-bar/ProgressBar.stories.tsx +0 -93
  279. package/progress-bar/ProgressBar.test.js +0 -93
  280. package/progress-bar/types.d.ts +0 -37
  281. package/progress-bar/types.js +0 -5
  282. package/quick-nav/QuickNav.accessibility.test.js +0 -57
  283. package/quick-nav/QuickNav.d.ts +0 -4
  284. package/quick-nav/QuickNav.js +0 -94
  285. package/quick-nav/QuickNav.stories.tsx +0 -356
  286. package/quick-nav/types.d.ts +0 -21
  287. package/quick-nav/types.js +0 -5
  288. package/radio-group/Radio.d.ts +0 -4
  289. package/radio-group/Radio.js +0 -124
  290. package/radio-group/RadioGroup.accessibility.test.js +0 -97
  291. package/radio-group/RadioGroup.d.ts +0 -4
  292. package/radio-group/RadioGroup.js +0 -235
  293. package/radio-group/RadioGroup.stories.tsx +0 -214
  294. package/radio-group/RadioGroup.test.js +0 -756
  295. package/radio-group/types.d.ts +0 -114
  296. package/radio-group/types.js +0 -5
  297. package/resultset-table/Icons.d.ts +0 -7
  298. package/resultset-table/Icons.js +0 -47
  299. package/resultset-table/ResultsetTable.accessibility.test.js +0 -274
  300. package/resultset-table/ResultsetTable.d.ts +0 -7
  301. package/resultset-table/ResultsetTable.js +0 -170
  302. package/resultset-table/ResultsetTable.stories.tsx +0 -401
  303. package/resultset-table/ResultsetTable.test.js +0 -381
  304. package/resultset-table/types.d.ts +0 -100
  305. package/resultset-table/types.js +0 -5
  306. package/select/Icons.d.ts +0 -10
  307. package/select/Icons.js +0 -89
  308. package/select/Listbox.d.ts +0 -4
  309. package/select/Listbox.js +0 -143
  310. package/select/Option.d.ts +0 -4
  311. package/select/Option.js +0 -87
  312. package/select/Select.accessibility.test.js +0 -217
  313. package/select/Select.d.ts +0 -4
  314. package/select/Select.js +0 -590
  315. package/select/Select.stories.tsx +0 -970
  316. package/select/Select.test.js +0 -2370
  317. package/select/types.d.ts +0 -209
  318. package/select/types.js +0 -5
  319. package/sidenav/Icons.d.ts +0 -7
  320. package/sidenav/Icons.js +0 -47
  321. package/sidenav/Sidenav.accessibility.test.js +0 -59
  322. package/sidenav/Sidenav.d.ts +0 -10
  323. package/sidenav/Sidenav.js +0 -197
  324. package/sidenav/Sidenav.stories.tsx +0 -281
  325. package/sidenav/Sidenav.test.js +0 -37
  326. package/sidenav/SidenavContext.d.ts +0 -5
  327. package/sidenav/SidenavContext.js +0 -13
  328. package/sidenav/types.d.ts +0 -76
  329. package/sidenav/types.js +0 -5
  330. package/slider/Slider.accessibility.test.js +0 -104
  331. package/slider/Slider.d.ts +0 -4
  332. package/slider/Slider.js +0 -285
  333. package/slider/Slider.test.js +0 -254
  334. package/slider/types.d.ts +0 -86
  335. package/slider/types.js +0 -5
  336. package/spinner/Spinner.accessibility.test.js +0 -96
  337. package/spinner/Spinner.d.ts +0 -4
  338. package/spinner/Spinner.js +0 -206
  339. package/spinner/Spinner.stories.tsx +0 -129
  340. package/spinner/Spinner.test.js +0 -55
  341. package/spinner/types.d.ts +0 -32
  342. package/spinner/types.js +0 -5
  343. package/status-light/StatusLight.accessibility.test.js +0 -157
  344. package/status-light/StatusLight.d.ts +0 -4
  345. package/status-light/StatusLight.js +0 -51
  346. package/status-light/StatusLight.stories.tsx +0 -74
  347. package/status-light/StatusLight.test.js +0 -25
  348. package/status-light/types.d.ts +0 -17
  349. package/status-light/types.js +0 -5
  350. package/switch/Switch.accessibility.test.js +0 -89
  351. package/switch/Switch.d.ts +0 -4
  352. package/switch/Switch.js +0 -214
  353. package/switch/Switch.stories.tsx +0 -137
  354. package/switch/Switch.test.js +0 -180
  355. package/switch/types.d.ts +0 -66
  356. package/switch/types.js +0 -5
  357. package/table/DropdownTheme.js +0 -62
  358. package/table/Table.accessibility.test.js +0 -82
  359. package/table/Table.d.ts +0 -8
  360. package/table/Table.js +0 -161
  361. package/table/Table.stories.tsx +0 -651
  362. package/table/Table.test.js +0 -113
  363. package/table/types.d.ts +0 -49
  364. package/table/types.js +0 -5
  365. package/tabs/Tab.d.ts +0 -4
  366. package/tabs/Tab.js +0 -116
  367. package/tabs/Tabs.accessibility.test.js +0 -56
  368. package/tabs/Tabs.d.ts +0 -4
  369. package/tabs/Tabs.js +0 -384
  370. package/tabs/Tabs.stories.tsx +0 -226
  371. package/tabs/Tabs.test.js +0 -294
  372. package/tabs/types.d.ts +0 -92
  373. package/tabs/types.js +0 -5
  374. package/tag/Tag.accessibility.test.js +0 -69
  375. package/tag/Tag.d.ts +0 -4
  376. package/tag/Tag.js +0 -151
  377. package/tag/Tag.stories.tsx +0 -155
  378. package/tag/Tag.test.js +0 -49
  379. package/tag/types.d.ts +0 -69
  380. package/tag/types.js +0 -5
  381. package/text-input/Suggestion.d.ts +0 -4
  382. package/text-input/Suggestion.js +0 -67
  383. package/text-input/Suggestions.d.ts +0 -4
  384. package/text-input/Suggestions.js +0 -86
  385. package/text-input/TextInput.accessibility.test.js +0 -321
  386. package/text-input/TextInput.d.ts +0 -4
  387. package/text-input/TextInput.js +0 -567
  388. package/text-input/TextInput.stories.tsx +0 -465
  389. package/text-input/TextInput.test.js +0 -1756
  390. package/text-input/types.d.ts +0 -205
  391. package/text-input/types.js +0 -5
  392. package/textarea/Textarea.accessibility.test.js +0 -155
  393. package/textarea/Textarea.d.ts +0 -4
  394. package/textarea/Textarea.js +0 -234
  395. package/textarea/Textarea.stories.tsx +0 -174
  396. package/textarea/Textarea.test.js +0 -406
  397. package/textarea/types.d.ts +0 -141
  398. package/textarea/types.js +0 -5
  399. package/toggle-group/ToggleGroup.accessibility.test.js +0 -107
  400. package/toggle-group/ToggleGroup.d.ts +0 -4
  401. package/toggle-group/ToggleGroup.js +0 -201
  402. package/toggle-group/ToggleGroup.stories.tsx +0 -218
  403. package/toggle-group/ToggleGroup.test.js +0 -137
  404. package/toggle-group/types.d.ts +0 -114
  405. package/toggle-group/types.js +0 -5
  406. package/typography/Typography.accessibility.test.js +0 -339
  407. package/typography/Typography.d.ts +0 -4
  408. package/typography/Typography.js +0 -23
  409. package/typography/Typography.stories.tsx +0 -198
  410. package/typography/types.d.ts +0 -18
  411. package/typography/types.js +0 -5
  412. package/useTheme.d.ts +0 -1148
  413. package/useTheme.js +0 -15
  414. package/useTranslatedLabels.d.ts +0 -85
  415. package/useTranslatedLabels.js +0 -14
  416. package/utils/BaseTypography.d.ts +0 -21
  417. package/utils/BaseTypography.js +0 -94
  418. package/utils/FocusLock.d.ts +0 -13
  419. package/utils/FocusLock.js +0 -124
  420. package/wizard/Wizard.accessibility.test.js +0 -55
  421. package/wizard/Wizard.d.ts +0 -4
  422. package/wizard/Wizard.js +0 -250
  423. package/wizard/Wizard.stories.tsx +0 -253
  424. package/wizard/Wizard.test.js +0 -114
  425. package/wizard/types.d.ts +0 -64
  426. package/wizard/types.js +0 -5
@@ -1,134 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
- var _react = _interopRequireWildcard(require("react"));
12
- var _Header = _interopRequireDefault(require("../header/Header"));
13
- var _Footer = _interopRequireDefault(require("../footer/Footer"));
14
- var _Sidenav = _interopRequireDefault(require("../sidenav/Sidenav"));
15
- var _styledComponents = _interopRequireDefault(require("styled-components"));
16
- var _variables = require("../common/variables");
17
- var _Icons = _interopRequireDefault(require("./Icons"));
18
- var _SidenavContext = require("../sidenav/SidenavContext");
19
- var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
20
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
21
- 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); }
22
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(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; }
23
- var year = new Date().getFullYear();
24
- var Main = function Main(_ref) {
25
- var children = _ref.children;
26
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children);
27
- };
28
- var defaultHeader = function defaultHeader() {
29
- return /*#__PURE__*/_react["default"].createElement(_Header["default"], {
30
- underlined: true
31
- });
32
- };
33
- var defaultFooter = function defaultFooter() {
34
- return /*#__PURE__*/_react["default"].createElement(_Footer["default"], {
35
- copyright: "\xA9 DXC Technology ".concat(year, "\u200B\u200B\u200B\u200B. All rights reserved."),
36
- bottomLinks: [{
37
- href: "https://www.linkedin.com/company/dxctechnology",
38
- text: "Linkedin"
39
- }, {
40
- href: "https://x.com/dxctechnology",
41
- text: "X"
42
- }, {
43
- href: "https://www.facebook.com/DXCTechnology/",
44
- text: "Facebook"
45
- }],
46
- socialLinks: [{
47
- href: "https://www.linkedin.com/company/dxctechnology",
48
- logo: _Icons["default"].linkedinLogo,
49
- title: "Linkedin"
50
- }, {
51
- href: "https://x.com/dxctechnology",
52
- logo: _Icons["default"].xLogo,
53
- title: "X"
54
- }, {
55
- href: "https://www.facebook.com/DXCTechnology/",
56
- logo: _Icons["default"].facebookLogo,
57
- title: "Facebook"
58
- }]
59
- });
60
- };
61
- var childTypeExists = function childTypeExists(children, childType) {
62
- return children.find(function (child) {
63
- return (child === null || child === void 0 ? void 0 : child.type) === childType;
64
- });
65
- };
66
- var DxcApplicationLayout = function DxcApplicationLayout(_ref2) {
67
- var _ref2$visibilityToggl = _ref2.visibilityToggleLabel,
68
- visibilityToggleLabel = _ref2$visibilityToggl === void 0 ? "" : _ref2$visibilityToggl,
69
- header = _ref2.header,
70
- sidenav = _ref2.sidenav,
71
- footer = _ref2.footer,
72
- children = _ref2.children;
73
- var _useState = (0, _react.useState)(false),
74
- _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
75
- isSidenavVisibleResponsive = _useState2[0],
76
- setIsSidenavVisibleResponsive = _useState2[1];
77
- var _useState3 = (0, _react.useState)(false),
78
- _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
79
- isResponsive = _useState4[0],
80
- setIsResponsive = _useState4[1];
81
- var ref = (0, _react.useRef)(null);
82
- var translatedLabels = (0, _useTranslatedLabels["default"])();
83
- var childrenArray = _react["default"].Children.toArray(children);
84
- var headerContent = header || defaultHeader();
85
- var footerContent = footer || defaultFooter();
86
- var main = childTypeExists(childrenArray, Main);
87
- var handleResize = function handleResize() {
88
- setIsResponsive(window.matchMedia("(max-width: ".concat(_variables.responsiveSizes.medium, "rem)")).matches);
89
- };
90
- var handleSidenavVisibility = function handleSidenavVisibility() {
91
- setIsSidenavVisibleResponsive(function (isSidenavVisibleResponsive) {
92
- return !isSidenavVisibleResponsive;
93
- });
94
- };
95
- (0, _react.useEffect)(function () {
96
- handleResize();
97
- window.addEventListener("resize", handleResize);
98
- return function () {
99
- window.removeEventListener("resize", handleResize);
100
- };
101
- }, []);
102
- (0, _react.useEffect)(function () {
103
- !isResponsive && setIsSidenavVisibleResponsive(false);
104
- }, [isResponsive]);
105
- return /*#__PURE__*/_react["default"].createElement(ApplicationLayoutContainer, {
106
- hasSidenav: sidenav ? true : false,
107
- isSidenavVisible: isSidenavVisibleResponsive,
108
- ref: ref
109
- }, /*#__PURE__*/_react["default"].createElement(HeaderContainer, null, headerContent), sidenav && isResponsive && /*#__PURE__*/_react["default"].createElement(VisibilityToggle, null, /*#__PURE__*/_react["default"].createElement(HamburgerTrigger, {
110
- onClick: handleSidenavVisibility,
111
- "aria-label": visibilityToggleLabel ? undefined : translatedLabels.applicationLayout.visibilityToggleTitle,
112
- title: translatedLabels.applicationLayout.visibilityToggleTitle
113
- }, _Icons["default"].hamburgerIcon, visibilityToggleLabel)), /*#__PURE__*/_react["default"].createElement(BodyContainer, null, /*#__PURE__*/_react["default"].createElement(_SidenavContext.SidenavContextProvider, {
114
- value: setIsSidenavVisibleResponsive
115
- }, sidenav && (isResponsive ? isSidenavVisibleResponsive : true) && /*#__PURE__*/_react["default"].createElement(SidenavContainer, null, sidenav)), /*#__PURE__*/_react["default"].createElement(MainContainer, null, /*#__PURE__*/_react["default"].createElement(MainContentContainer, null, main), footerContent)));
116
- };
117
- var ApplicationLayoutContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n top: 64px;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n flex-direction: column;\n\n @media (max-width: ", "rem) {\n ", ";\n ", "\n }\n"])), _variables.responsiveSizes.medium, function (props) {
118
- return props.hasSidenav && "top: 116px";
119
- }, function (props) {
120
- return props.isSidenavVisible && "overflow: hidden;";
121
- });
122
- var HeaderContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n z-index: 3;\n"])));
123
- var VisibilityToggle = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n position: fixed;\n top: 64px;\n left: 0;\n right: 0;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n padding: 4px 16px;\n width: 100%;\n background-color: #f2f2f2;\n user-select: none;\n z-index: 2;\n"])));
124
- var HamburgerTrigger = _styledComponents["default"].button(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n border: 0px solid transparent;\n border-radius: 2px;\n padding: 12px 4px;\n background-color: transparent;\n box-shadow: 0 0 0 2px transparent;\n font-family: Open Sans, sans-serif;\n font-weight: 600;\n font-size: 14px;\n color: #000;\n cursor: pointer;\n\n :active {\n background-color: #cccccc;\n }\n :focus,\n :focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px #0095ff;\n }\n & > svg {\n height: 20px;\n width: 20px;\n }\n"])));
125
- var BodyContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n flex: 1;\n"])));
126
- var SidenavContainer = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n position: sticky;\n top: 64px;\n display: flex;\n height: calc(100vh - 64px);\n z-index: 1;\n\n @media (max-width: ", "rem) {\n position: absolute;\n top: 0px;\n height: 100%;\n }\n"])), _variables.responsiveSizes.medium);
127
- var MainContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n width: 100%;\n"])));
128
- var MainContentContainer = _styledComponents["default"].main(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n flex: 1;\n background-color: #fff;\n"])));
129
- DxcApplicationLayout.Header = _Header["default"];
130
- DxcApplicationLayout.Main = Main;
131
- DxcApplicationLayout.Footer = _Footer["default"];
132
- DxcApplicationLayout.SideNav = _Sidenav["default"];
133
- DxcApplicationLayout.useResponsiveSidenavVisibility = _SidenavContext.useResponsiveSidenavVisibility;
134
- var _default = exports["default"] = DxcApplicationLayout;
@@ -1,162 +0,0 @@
1
- import React from "react";
2
- import DxcApplicationLayout from "./ApplicationLayout";
3
- import Title from "../../.storybook/components/Title";
4
- import { INITIAL_VIEWPORTS } from "@storybook/addon-viewport";
5
-
6
- export default {
7
- title: "Application Layout",
8
- component: DxcApplicationLayout,
9
- parameters: {
10
- viewport: {
11
- viewports: INITIAL_VIEWPORTS,
12
- },
13
- },
14
- };
15
-
16
- export const DefaultApplicationLayout = () => (
17
- <>
18
- <DxcApplicationLayout>
19
- <DxcApplicationLayout.Main>
20
- <Title title="Default application layout" theme="light" level={4} />
21
- <p>Main Content</p>
22
- <p>Main Content</p>
23
- <p>Main Content</p>
24
- <p>Main Content</p>
25
- </DxcApplicationLayout.Main>
26
- </DxcApplicationLayout>
27
- </>
28
- );
29
-
30
- export const ApplicationLayoutWithDefaultSidenav = () => (
31
- <>
32
- <DxcApplicationLayout
33
- sidenav={
34
- <DxcApplicationLayout.SideNav
35
- title={
36
- <DxcApplicationLayout.SideNav.Title>
37
- Application layout with push sidenav
38
- </DxcApplicationLayout.SideNav.Title>
39
- }
40
- >
41
- <DxcApplicationLayout.SideNav.Section>
42
- <p>SideNav Content</p>
43
- <p>SideNav Content</p>
44
- <p>SideNav Content</p>
45
- <p>SideNav Content</p>
46
- <p>SideNav Content</p>
47
- </DxcApplicationLayout.SideNav.Section>
48
- </DxcApplicationLayout.SideNav>
49
- }
50
- >
51
- <DxcApplicationLayout.Main>
52
- <p>Main Content</p>
53
- <p>Main Content</p>
54
- <p>Main Content</p>
55
- <p>Main Content</p>
56
- </DxcApplicationLayout.Main>
57
- </DxcApplicationLayout>
58
- </>
59
- );
60
-
61
- export const ApplicationLayoutWithResponsiveSidenav = () => (
62
- <>
63
- <DxcApplicationLayout
64
- visibilityToggleLabel="Example"
65
- sidenav={
66
- <DxcApplicationLayout.SideNav
67
- title={
68
- <DxcApplicationLayout.SideNav.Title>
69
- Application layout with push sidenav
70
- </DxcApplicationLayout.SideNav.Title>
71
- }
72
- >
73
- <DxcApplicationLayout.SideNav.Section>
74
- <p>SideNav Content</p>
75
- <p>SideNav Content</p>
76
- <p>SideNav Content</p>
77
- <p>SideNav Content</p>
78
- <p>SideNav Content</p>
79
- </DxcApplicationLayout.SideNav.Section>
80
- </DxcApplicationLayout.SideNav>
81
- }
82
- >
83
- <DxcApplicationLayout.Main>
84
- <p>Main Content</p>
85
- <p>Main Content</p>
86
- <p>Main Content</p>
87
- <p>Main Content</p>
88
- </DxcApplicationLayout.Main>
89
- </DxcApplicationLayout>
90
- </>
91
- );
92
-
93
- ApplicationLayoutWithResponsiveSidenav.parameters = {
94
- viewport: {
95
- defaultViewport: "pixel",
96
- },
97
- chromatic: { viewports: [540] },
98
- };
99
-
100
- export const ApplicationLayoutWithCustomHeader = () => (
101
- <>
102
- <DxcApplicationLayout
103
- header={<p>Custom Header</p>}
104
- sidenav={
105
- <DxcApplicationLayout.SideNav
106
- title={
107
- <DxcApplicationLayout.SideNav.Title>
108
- Application layout with push sidenav
109
- </DxcApplicationLayout.SideNav.Title>
110
- }
111
- >
112
- <DxcApplicationLayout.SideNav.Section>
113
- <p>SideNav Content</p>
114
- <p>SideNav Content</p>
115
- <p>SideNav Content</p>
116
- <p>SideNav Content</p>
117
- <p>SideNav Content</p>
118
- </DxcApplicationLayout.SideNav.Section>
119
- </DxcApplicationLayout.SideNav>
120
- }
121
- >
122
- <DxcApplicationLayout.Main>
123
- <p>Main Content</p>
124
- <p>Main Content</p>
125
- <p>Main Content</p>
126
- <p>Main Content</p>
127
- </DxcApplicationLayout.Main>
128
- </DxcApplicationLayout>
129
- </>
130
- );
131
-
132
- export const ApplicationLayoutWithCustomFooter = () => (
133
- <>
134
- <DxcApplicationLayout
135
- footer={<p>Custom Footer</p>}
136
- sidenav={
137
- <DxcApplicationLayout.SideNav
138
- title={
139
- <DxcApplicationLayout.SideNav.Title>
140
- Application layout with push sidenav
141
- </DxcApplicationLayout.SideNav.Title>
142
- }
143
- >
144
- <DxcApplicationLayout.SideNav.Section>
145
- <p>SideNav Content</p>
146
- <p>SideNav Content</p>
147
- <p>SideNav Content</p>
148
- <p>SideNav Content</p>
149
- <p>SideNav Content</p>
150
- </DxcApplicationLayout.SideNav.Section>
151
- </DxcApplicationLayout.SideNav>
152
- }
153
- >
154
- <DxcApplicationLayout.Main>
155
- <p>Main Content</p>
156
- <p>Main Content</p>
157
- <p>Main Content</p>
158
- <p>Main Content</p>
159
- </DxcApplicationLayout.Main>
160
- </DxcApplicationLayout>
161
- </>
162
- );
package/layout/Icons.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- declare const layoutIcons: {
3
- facebookLogo: React.JSX.Element;
4
- xLogo: React.JSX.Element;
5
- linkedinLogo: React.JSX.Element;
6
- hamburgerIcon: React.JSX.Element;
7
- };
8
- export default layoutIcons;
package/layout/Icons.js DELETED
@@ -1,56 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports["default"] = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var layoutIcons = {
10
- facebookLogo: /*#__PURE__*/_react["default"].createElement("svg", {
11
- version: "1.1",
12
- x: "0px",
13
- y: "0px",
14
- width: "438.536px",
15
- height: "438.536px",
16
- viewBox: "0 0 438.536 438.536",
17
- fill: "#FFFFFF"
18
- }, /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("path", {
19
- 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 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 h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225 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 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 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"
20
- }))),
21
- xLogo: /*#__PURE__*/_react["default"].createElement("svg", {
22
- width: "256",
23
- height: "256",
24
- viewBox: "0 0 256 256",
25
- fill: "none",
26
- xmlns: "http://www.w3.org/2000/svg"
27
- }, /*#__PURE__*/_react["default"].createElement("rect", {
28
- width: "256",
29
- height: "256",
30
- rx: "40",
31
- fill: "white"
32
- }), /*#__PURE__*/_react["default"].createElement("path", {
33
- d: "M140.192 118.205L187.848 64H176.556L135.158 111.056L102.117 64H64L113.975 135.163L64 192H75.2914L118.982 142.296L153.883 192H192L140.192 118.205ZM124.722 135.787L119.65 128.697L79.3634 72.3294H96.7094L129.232 117.837L134.282 124.927L176.551 184.076H159.205L124.722 135.787Z",
34
- fill: "#0F1419"
35
- })),
36
- linkedinLogo: /*#__PURE__*/_react["default"].createElement("svg", {
37
- version: "1.1",
38
- x: "0px",
39
- y: "0px",
40
- width: "438.536px",
41
- height: "438.536px",
42
- viewBox: "0 0 438.536 438.536",
43
- fill: "#FFFFFF"
44
- }, /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("path", {
45
- 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 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 h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225 C438.532,59.576,430.49,40.204,414.41,24.123z M133.618,367.157H67.666V169.016h65.952V367.157z M127.626,132.332 c-6.851,6.567-15.893,9.851-27.124,9.851h-0.288c-10.848,0-19.648-3.284-26.407-9.851c-6.76-6.567-10.138-14.703-10.138-24.41 c0-9.897,3.476-18.083,10.421-24.556c6.95-6.471,15.942-9.708,26.98-9.708c11.039,0,19.89,3.237,26.553,9.708 c6.661,6.473,10.088,14.659,10.277,24.556C137.899,117.625,134.477,125.761,127.626,132.332z M370.873,367.157h-65.952v-105.92 c0-29.879-11.036-44.823-33.116-44.823c-8.374,0-15.42,2.331-21.128,6.995c-5.715,4.661-9.996,10.324-12.847,16.991 c-1.335,3.422-1.999,8.75-1.999,15.981v110.775h-65.952c0.571-119.529,0.571-185.579,0-198.142h65.952v27.974 c13.867-21.681,33.558-32.544,59.101-32.544c22.84,0,41.21,7.52,55.104,22.554c13.895,15.037,20.841,37.214,20.841,66.519v113.64 H370.873z"
46
- }))),
47
- hamburgerIcon: /*#__PURE__*/_react["default"].createElement("svg", {
48
- xmlns: "http://www.w3.org/2000/svg",
49
- height: "24",
50
- width: "24",
51
- viewBox: "0 0 24 24"
52
- }, /*#__PURE__*/_react["default"].createElement("path", {
53
- d: "M3 18V16H21V18ZM3 13V11H21V13ZM3 8V6H21V8Z"
54
- }))
55
- };
56
- var _default = exports["default"] = layoutIcons;
package/layout/types.d.ts DELETED
@@ -1,41 +0,0 @@
1
- /// <reference types="react" />
2
- export type AppLayoutMainPropsType = {
3
- /**
4
- * Everything between the tags will be displayed as the content of the main part of the application.
5
- */
6
- children: React.ReactNode;
7
- };
8
- export type AppLayoutSidenavPropsType = {
9
- /**
10
- * The area inside the sidenav. This area can be used to render the content inside the sidenav.
11
- */
12
- children: React.ReactNode;
13
- /**
14
- * The area assigned to render the sidenav title. It is highly recommended to use the sidenav title.
15
- */
16
- title?: React.ReactNode;
17
- };
18
- type AppLayoutPropsType = {
19
- /**
20
- * Text to be placed next to the hamburger button that toggles the
21
- * visibility of the sidenav.
22
- */
23
- visibilityToggleLabel?: string;
24
- /**
25
- * Header content.
26
- */
27
- header?: React.ReactNode;
28
- /**
29
- * Sidenav content
30
- */
31
- sidenav?: React.ReactNode;
32
- /**
33
- * Footer content
34
- */
35
- footer?: React.ReactNode;
36
- /**
37
- * Use the DxcApplicationLayout.Main provided to render main content.
38
- */
39
- children: React.ReactElement<AppLayoutMainPropsType>;
40
- };
41
- export default AppLayoutPropsType;
package/layout/types.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,112 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
5
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
6
- var _react = _interopRequireDefault(require("react"));
7
- var _react2 = require("@testing-library/react");
8
- var _jestAxe = require("jest-axe");
9
- var _Link = _interopRequireDefault(require("./Link.tsx"));
10
- var _Flex = _interopRequireDefault(require("../flex/Flex.tsx"));
11
- var icon = /*#__PURE__*/_react["default"].createElement("svg", {
12
- viewBox: "0 0 24 24",
13
- enableBackground: "new 0 0 24 24",
14
- fill: "currentColor"
15
- }, /*#__PURE__*/_react["default"].createElement("g", {
16
- id: "Bounding_Box"
17
- }, /*#__PURE__*/_react["default"].createElement("rect", {
18
- fill: "none",
19
- width: "24",
20
- height: "24"
21
- })), /*#__PURE__*/_react["default"].createElement("g", {
22
- id: "Master"
23
- }, /*#__PURE__*/_react["default"].createElement("path", {
24
- d: "M19,9.3V4h-3v2.6L12,3L2,12h3v8h5v-6h4v6h5v-8h3L19,9.3z M10,10c0-1.1,0.9-2,2-2s2,0.9,2,2H10z"
25
- })));
26
- describe("Link component accessibility tests", function () {
27
- it("Should not have basic accessibility issues", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
28
- var _render, container, results;
29
- return _regenerator["default"].wrap(function _callee$(_context) {
30
- while (1) switch (_context.prev = _context.next) {
31
- case 0:
32
- _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Flex["default"], null, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
33
- href: "https://www.google.com",
34
- icon: icon,
35
- iconPosition: "before",
36
- margin: "medium"
37
- }, "Link"), /*#__PURE__*/_react["default"].createElement(_Link["default"], {
38
- href: "https://www.google.com",
39
- icon: icon,
40
- iconPosition: "after",
41
- margin: "medium"
42
- }, "Link"))), container = _render.container;
43
- _context.next = 3;
44
- return (0, _jestAxe.axe)(container);
45
- case 3:
46
- results = _context.sent;
47
- expect(results).toHaveNoViolations();
48
- case 5:
49
- case "end":
50
- return _context.stop();
51
- }
52
- }, _callee);
53
- })));
54
- it("Should not have basic accessibility issues for disabled mode", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
55
- var _render2, container, results;
56
- return _regenerator["default"].wrap(function _callee2$(_context2) {
57
- while (1) switch (_context2.prev = _context2.next) {
58
- case 0:
59
- _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Flex["default"], null, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
60
- href: "https://www.google.com",
61
- icon: icon,
62
- iconPosition: "before",
63
- margin: "medium",
64
- disabled: true
65
- }, "Link"), /*#__PURE__*/_react["default"].createElement(_Link["default"], {
66
- href: "https://www.google.com",
67
- icon: icon,
68
- iconPosition: "after",
69
- margin: "medium",
70
- disabled: true
71
- }, "Link"))), container = _render2.container;
72
- _context2.next = 3;
73
- return (0, _jestAxe.axe)(container);
74
- case 3:
75
- results = _context2.sent;
76
- expect(results).toHaveNoViolations();
77
- case 5:
78
- case "end":
79
- return _context2.stop();
80
- }
81
- }, _callee2);
82
- })));
83
- it("Should not have basic accessibility issues for new-window mode", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
84
- var _render3, container, results;
85
- return _regenerator["default"].wrap(function _callee3$(_context3) {
86
- while (1) switch (_context3.prev = _context3.next) {
87
- case 0:
88
- _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Flex["default"], null, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
89
- href: "https://www.google.com",
90
- icon: icon,
91
- iconPosition: "before",
92
- margin: "medium",
93
- newWindow: true
94
- }, "Link"), /*#__PURE__*/_react["default"].createElement(_Link["default"], {
95
- href: "https://www.google.com",
96
- icon: icon,
97
- iconPosition: "after",
98
- margin: "medium",
99
- newWindow: true
100
- }, "Link"))), container = _render3.container;
101
- _context3.next = 3;
102
- return (0, _jestAxe.axe)(container);
103
- case 3:
104
- results = _context3.sent;
105
- expect(results).toHaveNoViolations();
106
- case 5:
107
- case "end":
108
- return _context3.stop();
109
- }
110
- }, _callee3);
111
- })));
112
- });
package/link/Link.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import { LinkProps } from "./types";
3
- declare const DxcLink: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
4
- export default DxcLink;
package/link/Link.js DELETED
@@ -1,115 +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 _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
- var _react = _interopRequireWildcard(require("react"));
14
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
15
- var _variables = require("../common/variables");
16
- var _useTheme = _interopRequireDefault(require("../useTheme"));
17
- var _templateObject, _templateObject2, _templateObject3;
18
- var _excluded = ["inheritColor", "disabled", "icon", "iconPosition", "href", "newWindow", "onClick", "margin", "tabIndex", "children"];
19
- 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); }
20
- 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; }
21
- var LinkContent = /*#__PURE__*/_react["default"].memo(function (_ref) {
22
- var iconPosition = _ref.iconPosition,
23
- icon = _ref.icon,
24
- children = _ref.children;
25
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, iconPosition === "after" && children, icon && /*#__PURE__*/_react["default"].createElement(LinkIconContainer, {
26
- iconPosition: iconPosition
27
- }, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement(LinkIcon, {
28
- src: icon
29
- }) : icon), iconPosition === "before" && children);
30
- });
31
- var DxcLink = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
32
- var _ref2$inheritColor = _ref2.inheritColor,
33
- inheritColor = _ref2$inheritColor === void 0 ? false : _ref2$inheritColor,
34
- _ref2$disabled = _ref2.disabled,
35
- disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
36
- icon = _ref2.icon,
37
- _ref2$iconPosition = _ref2.iconPosition,
38
- iconPosition = _ref2$iconPosition === void 0 ? "before" : _ref2$iconPosition,
39
- _ref2$href = _ref2.href,
40
- href = _ref2$href === void 0 ? "" : _ref2$href,
41
- _ref2$newWindow = _ref2.newWindow,
42
- newWindow = _ref2$newWindow === void 0 ? false : _ref2$newWindow,
43
- onClick = _ref2.onClick,
44
- margin = _ref2.margin,
45
- _ref2$tabIndex = _ref2.tabIndex,
46
- tabIndex = _ref2$tabIndex === void 0 ? 0 : _ref2$tabIndex,
47
- children = _ref2.children,
48
- otherProps = (0, _objectWithoutProperties2["default"])(_ref2, _excluded);
49
- var colorsTheme = (0, _useTheme["default"])();
50
- return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
51
- theme: colorsTheme.link
52
- }, /*#__PURE__*/_react["default"].createElement(StyledLink, (0, _extends2["default"])({
53
- as: href ? "a" : "button",
54
- tabIndex: tabIndex,
55
- onClick: !disabled ? onClick : undefined,
56
- href: !disabled && href ? href : undefined,
57
- target: href ? newWindow ? "_blank" : "_self" : undefined,
58
- disabled: disabled,
59
- inheritColor: inheritColor,
60
- margin: margin,
61
- ref: ref
62
- }, otherProps), /*#__PURE__*/_react["default"].createElement(LinkContent, {
63
- iconPosition: iconPosition,
64
- icon: icon,
65
- children: children
66
- })));
67
- });
68
- var StyledLink = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: baseline;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n font-size: ", ";\n font-weight: ", ";\n font-style: ", ";\n font-family: ", ";\n text-decoration-color: transparent;\n width: fit-content;\n ", "\n ", "\n color: ", ";\n ", "\n &:visited {\n color: ", ";\n &:hover {\n ", "\n }\n }\n &:hover {\n ", "\n }\n &:focus {\n border-radius: 2px;\n outline: 2px solid ", ";\n ", "\n }\n &:active {\n ", "\n }\n"])), function (props) {
69
- return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
70
- }, function (props) {
71
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
72
- }, function (props) {
73
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
74
- }, function (props) {
75
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
76
- }, function (props) {
77
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
78
- }, function (props) {
79
- return props.theme.fontSize;
80
- }, function (props) {
81
- return props.theme.fontWeight;
82
- }, function (props) {
83
- return props.theme.fontStyle;
84
- }, function (props) {
85
- return props.theme.fontFamily;
86
- }, function (props) {
87
- return "padding-bottom: ".concat(props.theme.underlineSpacing, ";\n border-bottom: ").concat(props.theme.underlineThickness, " ").concat(props.theme.underlineStyle, " transparent;");
88
- }, function (props) {
89
- return props.disabled && "cursor: default;";
90
- }, function (props) {
91
- return props.inheritColor ? "inherit" : !props.disabled ? props.theme.fontColor : props.theme.disabledFontColor;
92
- }, function (props) {
93
- return props.disabled ? "pointer-events: none;" : "";
94
- }, function (props) {
95
- return !props.inheritColor && !props.disabled ? props.theme.visitedFontColor : "";
96
- }, function (props) {
97
- return "color: ".concat(props.theme.visitedFontColor, ";\n border-bottom-color: ").concat(props.theme.visitedUnderlineColor, ";");
98
- }, function (props) {
99
- return "color: ".concat(props.theme.hoverFontColor, ";\n border-bottom-color: ").concat(props.theme.hoverUnderlineColor, ";\n cursor: pointer;");
100
- }, function (props) {
101
- return props.theme.focusColor;
102
- }, function (props) {
103
- return props.disabled && "outline: none";
104
- }, function (props) {
105
- return "color: ".concat(props.theme.activeFontColor, " !important;\n border-bottom-color: ").concat(props.theme.activeUnderlineColor, " !important;");
106
- });
107
- var LinkIcon = _styledComponents["default"].img(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])([""])));
108
- var LinkIconContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n ", ";\n overflow: hidden;\n align-self: center;\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
109
- return props.theme.iconSize;
110
- }, function (props) {
111
- return props.theme.iconSize;
112
- }, function (props) {
113
- return "".concat(props.iconPosition === "before" ? "margin-right" : "margin-left", ": ").concat(props.theme.iconSpacing);
114
- });
115
- var _default = exports["default"] = DxcLink;