@worksafevictoria/wcl7.5 1.0.0

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 (392) hide show
  1. package/.editorconfig +13 -0
  2. package/.env +4 -0
  3. package/.eslintrc.cjs +10 -0
  4. package/.eslintrc.js +25 -0
  5. package/.husky/commit-msg +4 -0
  6. package/.prettierrc +5 -0
  7. package/.prettierrc.json +8 -0
  8. package/.storybook/main.js +18 -0
  9. package/.storybook/preview.js +34 -0
  10. package/LICENSE +21 -0
  11. package/README.md +159 -0
  12. package/babel.config.js +8 -0
  13. package/bin/clean.sh +52 -0
  14. package/bin/deploy.sh +25 -0
  15. package/ci/build/Build_Validation.md +35 -0
  16. package/ci/build/build_validation.yml +47 -0
  17. package/ci/release/Release_Beta.md +39 -0
  18. package/ci/release/Release_Master.md +29 -0
  19. package/ci/release/beta.yml +69 -0
  20. package/ci/release/master.yml +39 -0
  21. package/commitlint.config.js +1 -0
  22. package/index.html +13 -0
  23. package/jest.config.js +21 -0
  24. package/lib/detect-browser.js +33 -0
  25. package/lib/utility.js +59 -0
  26. package/lib/utility.test.js +15 -0
  27. package/package.json +93 -0
  28. package/public/favicon.ico +0 -0
  29. package/src/assets/base.css +86 -0
  30. package/src/assets/fonts/VIC-Bold.eot +0 -0
  31. package/src/assets/fonts/VIC-Bold.ttf +0 -0
  32. package/src/assets/fonts/VIC-Bold.woff +0 -0
  33. package/src/assets/fonts/VIC-Bold.woff2 +0 -0
  34. package/src/assets/fonts/VIC-BoldItalic.eot +0 -0
  35. package/src/assets/fonts/VIC-BoldItalic.ttf +0 -0
  36. package/src/assets/fonts/VIC-BoldItalic.woff +0 -0
  37. package/src/assets/fonts/VIC-BoldItalic.woff2 +0 -0
  38. package/src/assets/fonts/VIC-ExtraLight.eot +0 -0
  39. package/src/assets/fonts/VIC-ExtraLight.ttf +0 -0
  40. package/src/assets/fonts/VIC-ExtraLight.woff +0 -0
  41. package/src/assets/fonts/VIC-ExtraLight.woff2 +0 -0
  42. package/src/assets/fonts/VIC-ExtraLightItalic.eot +0 -0
  43. package/src/assets/fonts/VIC-ExtraLightItalic.ttf +0 -0
  44. package/src/assets/fonts/VIC-ExtraLightItalic.woff +0 -0
  45. package/src/assets/fonts/VIC-ExtraLightItalic.woff2 +0 -0
  46. package/src/assets/fonts/VIC-Italic.eot +0 -0
  47. package/src/assets/fonts/VIC-Italic.ttf +0 -0
  48. package/src/assets/fonts/VIC-Italic.woff +0 -0
  49. package/src/assets/fonts/VIC-Italic.woff2 +0 -0
  50. package/src/assets/fonts/VIC-Light.eot +0 -0
  51. package/src/assets/fonts/VIC-Light.ttf +0 -0
  52. package/src/assets/fonts/VIC-Light.woff +0 -0
  53. package/src/assets/fonts/VIC-Light.woff2 +0 -0
  54. package/src/assets/fonts/VIC-LightItalic.eot +0 -0
  55. package/src/assets/fonts/VIC-LightItalic.ttf +0 -0
  56. package/src/assets/fonts/VIC-LightItalic.woff +0 -0
  57. package/src/assets/fonts/VIC-LightItalic.woff2 +0 -0
  58. package/src/assets/fonts/VIC-Medium.eot +0 -0
  59. package/src/assets/fonts/VIC-Medium.ttf +0 -0
  60. package/src/assets/fonts/VIC-Medium.woff +0 -0
  61. package/src/assets/fonts/VIC-Medium.woff2 +0 -0
  62. package/src/assets/fonts/VIC-MediumItalic.eot +0 -0
  63. package/src/assets/fonts/VIC-MediumItalic.ttf +0 -0
  64. package/src/assets/fonts/VIC-MediumItalic.woff +0 -0
  65. package/src/assets/fonts/VIC-MediumItalic.woff2 +0 -0
  66. package/src/assets/fonts/VIC-Regular.eot +0 -0
  67. package/src/assets/fonts/VIC-Regular.ttf +0 -0
  68. package/src/assets/fonts/VIC-Regular.woff +0 -0
  69. package/src/assets/fonts/VIC-Regular.woff2 +0 -0
  70. package/src/assets/fonts/VIC-SemiBold.eot +0 -0
  71. package/src/assets/fonts/VIC-SemiBold.ttf +0 -0
  72. package/src/assets/fonts/VIC-SemiBold.woff +0 -0
  73. package/src/assets/fonts/VIC-SemiBold.woff2 +0 -0
  74. package/src/assets/fonts/VIC-SemiBoldItalic.eot +0 -0
  75. package/src/assets/fonts/VIC-SemiBoldItalic.ttf +0 -0
  76. package/src/assets/fonts/VIC-SemiBoldItalic.woff +0 -0
  77. package/src/assets/fonts/VIC-SemiBoldItalic.woff2 +0 -0
  78. package/src/assets/icons/AppFooter/australian-aboriginal-flag.svg +7 -0
  79. package/src/assets/icons/AppFooter/facebook-ws-footer.svg +58 -0
  80. package/src/assets/icons/AppFooter/facebook-ww-footer.svg +59 -0
  81. package/src/assets/icons/AppFooter/instagram-ww-footer.svg +70 -0
  82. package/src/assets/icons/AppFooter/linkedin-ws-footer.svg +59 -0
  83. package/src/assets/icons/AppFooter/linkedin-ww-footer.svg +60 -0
  84. package/src/assets/icons/AppFooter/logo-workwell-reversed.svg +45 -0
  85. package/src/assets/icons/AppFooter/pride-flag.svg +12 -0
  86. package/src/assets/icons/AppFooter/torres-strait-islanders-flag.svg +9 -0
  87. package/src/assets/icons/AppFooter/twitter-ws-footer.svg +58 -0
  88. package/src/assets/icons/AppFooter/twitter-ww-footer.svg +59 -0
  89. package/src/assets/icons/AppFooter/worksafe-footer-logo.svg +9 -0
  90. package/src/assets/icons/AppFooter/youtube-ws-footer.svg +55 -0
  91. package/src/assets/icons/AppFooter/youtube-ww-footer.svg +56 -0
  92. package/src/assets/icons/AppHeader/chev-down-16.svg +17 -0
  93. package/src/assets/icons/AppHeader/chev-left-24px.svg +13 -0
  94. package/src/assets/icons/AppHeader/chev-right-16px.svg +25 -0
  95. package/src/assets/icons/AppHeader/chev-right-24px.svg +13 -0
  96. package/src/assets/icons/AppHeader/close-32px.svg +15 -0
  97. package/src/assets/icons/AppHeader/menu-32px.svg +20 -0
  98. package/src/assets/icons/AppHeader/search-32px.svg +19 -0
  99. package/src/assets/icons/Email-circle-black.svg +4 -0
  100. package/src/assets/icons/Info-circle-fill.svg +10 -0
  101. package/src/assets/icons/Phone-circle-black.svg +4 -0
  102. package/src/assets/icons/SocialShare/bookmark-white.svg +3 -0
  103. package/src/assets/icons/SocialShare/bookmark-ww-footer.svg +57 -0
  104. package/src/assets/icons/SocialShare/bookmark.svg +56 -0
  105. package/src/assets/icons/SocialShare/email-white.svg +3 -0
  106. package/src/assets/icons/SocialShare/facebook-white.svg +3 -0
  107. package/src/assets/icons/SocialShare/facebook-ws-footer.svg +58 -0
  108. package/src/assets/icons/SocialShare/facebook-ww-footer.svg +59 -0
  109. package/src/assets/icons/SocialShare/facebook.svg +1 -0
  110. package/src/assets/icons/SocialShare/office-file-pdf.svg +1 -0
  111. package/src/assets/icons/SocialShare/print.svg +3 -0
  112. package/src/assets/icons/SocialShare/twitter-white.svg +3 -0
  113. package/src/assets/icons/SocialShare/twitter-ws-footer.svg +58 -0
  114. package/src/assets/icons/SocialShare/twitter-ww-footer.svg +59 -0
  115. package/src/assets/icons/SocialShare/twitter.svg +1 -0
  116. package/src/assets/icons/Strip/AlertDismiss.svg +4 -0
  117. package/src/assets/icons/Strip/Arrow right.svg +4 -0
  118. package/src/assets/icons/Strip/Chevron right.svg +3 -0
  119. package/src/assets/icons/Strip/Dismiss.svg +4 -0
  120. package/src/assets/icons/Strip/Exclamation triangle fill.svg +8 -0
  121. package/src/assets/icons/Strip/Info circle fill.svg +15 -0
  122. package/src/assets/icons/Strip/Information.svg +15 -0
  123. package/src/assets/icons/Strip/Warning.svg +8 -0
  124. package/src/assets/icons/arrow-left.svg +9 -0
  125. package/src/assets/icons/arrow-right.svg +9 -0
  126. package/src/assets/icons/bookmark.svg +56 -0
  127. package/src/assets/icons/brand-VicStateGov-logo-reversed.svg +72 -0
  128. package/src/assets/icons/bullet-empty.svg +3 -0
  129. package/src/assets/icons/bullet.svg +3 -0
  130. package/src/assets/icons/caret-down.svg +1 -0
  131. package/src/assets/icons/caret-left.svg +9 -0
  132. package/src/assets/icons/caret-right.svg +9 -0
  133. package/src/assets/icons/caret-up.svg +1 -0
  134. package/src/assets/icons/chev-down-white.svg +3 -0
  135. package/src/assets/icons/chev-down.svg +3 -0
  136. package/src/assets/icons/chev-left.svg +3 -0
  137. package/src/assets/icons/chev-right.svg +3 -0
  138. package/src/assets/icons/chev-up.svg +3 -0
  139. package/src/assets/icons/clock.svg +3 -0
  140. package/src/assets/icons/close.svg +1 -0
  141. package/src/assets/icons/cross.svg +3 -0
  142. package/src/assets/icons/document.svg +1 -0
  143. package/src/assets/icons/earth.svg +1 -0
  144. package/src/assets/icons/email.svg +6 -0
  145. package/src/assets/icons/external-link-16px.svg +18 -0
  146. package/src/assets/icons/external-link.svg +4 -0
  147. package/src/assets/icons/icon-close.svg +15 -0
  148. package/src/assets/icons/instagram.svg +3 -0
  149. package/src/assets/icons/key.svg +3 -0
  150. package/src/assets/icons/location.svg +10 -0
  151. package/src/assets/icons/phone.svg +3 -0
  152. package/src/assets/icons/refresh.svg +3 -0
  153. package/src/assets/icons/right-arrow.svg +3 -0
  154. package/src/assets/icons/search.svg +5 -0
  155. package/src/assets/icons/tick.svg +3 -0
  156. package/src/assets/icons/video-play.svg +4 -0
  157. package/src/assets/images/hero-header-chevron.svg +9 -0
  158. package/src/assets/images/hero-header-mask.png +0 -0
  159. package/src/assets/images/hero-header-mask.svg +3 -0
  160. package/src/assets/logo.svg +1 -0
  161. package/src/assets/main.css +35 -0
  162. package/src/assets/styles/button.scss +206 -0
  163. package/src/assets/styles/focus.scss +4 -0
  164. package/src/assets/styles/generated-icons.scss +374 -0
  165. package/src/assets/styles/modal.scss +12 -0
  166. package/src/assets/styles/rtl.scss +8 -0
  167. package/src/assets/styles/storybook.scss +9 -0
  168. package/src/assets/styles/stylesheet.scss +7 -0
  169. package/src/assets/styles/webfonts.css +155 -0
  170. package/src/components/Common/CardGrid/cardgrid.stories.js +269 -0
  171. package/src/components/Common/CardGrid/index.vue +321 -0
  172. package/src/components/Common/CardGridItem/card-grid-item-caret.vue +164 -0
  173. package/src/components/Common/CardGridItem/card-grid-item-icon.vue +163 -0
  174. package/src/components/Common/CardGridItem/index.vue +848 -0
  175. package/src/components/Common/FilterButton/index.vue +93 -0
  176. package/src/components/Containers/Column/index.stories.js +35 -0
  177. package/src/components/Containers/Column/index.vue +14 -0
  178. package/src/components/Containers/Container/index.stories.js +13 -0
  179. package/src/components/Containers/Container/index.vue +15 -0
  180. package/src/components/Containers/HomepageHeader/index.stories.js +78 -0
  181. package/src/components/Containers/HomepageHeader/index.vue +186 -0
  182. package/src/components/Containers/Row/index.stories.js +12 -0
  183. package/src/components/Containers/Row/index.vue +14 -0
  184. package/src/components/Containers/SectionGroup/index.stories.js +148 -0
  185. package/src/components/Containers/SectionGroup/index.vue +310 -0
  186. package/src/components/Containers/Subheader/index.stories.js +74 -0
  187. package/src/components/Containers/Subheader/index.vue +149 -0
  188. package/src/components/Global/AlertStrip/index.stories.js +13 -0
  189. package/src/components/Global/AlertStrip/index.vue +145 -0
  190. package/src/components/Global/AlertStrip/styles.scss +78 -0
  191. package/src/components/Global/AppFooter/FooterSocialShare/index.vue +105 -0
  192. package/src/components/Global/AppFooter/FooterSocialShare/styles.scss +41 -0
  193. package/src/components/Global/AppFooter/index.stories.js +24 -0
  194. package/src/components/Global/AppFooter/index.vue +632 -0
  195. package/src/components/Global/AppFooter/storiesConst.js +110 -0
  196. package/src/components/Global/AppFooter/styles.scss +393 -0
  197. package/src/components/Global/AppHeader/ModalSearch/index.vue +66 -0
  198. package/src/components/Global/AppHeader/ModalSearch/styles.scss +43 -0
  199. package/src/components/Global/AppHeader/includes.scss +68 -0
  200. package/src/components/Global/AppHeader/index.stories.js +82 -0
  201. package/src/components/Global/AppHeader/index.vue +878 -0
  202. package/src/components/Global/AppHeader/mobile.scss +240 -0
  203. package/src/components/Global/AppHeader/styles.scss +371 -0
  204. package/src/components/Global/BackToTop/index.stories.js +18 -0
  205. package/src/components/Global/BackToTop/index.vue +67 -0
  206. package/src/components/Global/BackToTop/styles.scss +46 -0
  207. package/src/components/Global/ContrastMode/index.stories.js +39 -0
  208. package/src/components/Global/ContrastMode/index.vue +308 -0
  209. package/src/components/Global/Cookies/Constants.js +72 -0
  210. package/src/components/Global/Cookies/index.storieshide.js +45 -0
  211. package/src/components/Global/Cookies/index.vue +453 -0
  212. package/src/components/Global/Cookies/styles.scss +259 -0
  213. package/src/components/Global/DirectoryFilters/SingleTaxonomy/index.vue +196 -0
  214. package/src/components/Global/DirectoryFilters/index.vue +176 -0
  215. package/src/components/Global/GlobalNotice/index.vue +266 -0
  216. package/src/components/Global/HeroHeader/index.stories.js +93 -0
  217. package/src/components/Global/HeroHeader/index.vue +343 -0
  218. package/src/components/Global/HeroHeader/styles.scss +480 -0
  219. package/src/components/Global/ProgressBar/index.stories.js +51 -0
  220. package/src/components/Global/ProgressBar/index.vue +58 -0
  221. package/src/components/Global/ProgressBar/styles.scss +116 -0
  222. package/src/components/Global/SocialShare/index.stories.js +18 -0
  223. package/src/components/Global/SocialShare/index.vue +318 -0
  224. package/src/components/Global/Strip/index.stories.js +70 -0
  225. package/src/components/Global/Strip/index.vue +357 -0
  226. package/src/components/HelloWorld.vue +44 -0
  227. package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +232 -0
  228. package/src/components/Paragraphs/Accordion/StepperItem/index.vue +274 -0
  229. package/src/components/Paragraphs/Accordion/index.stories.js +84 -0
  230. package/src/components/Paragraphs/Accordion/index.vue +202 -0
  231. package/src/components/Paragraphs/Breakout/index.stories.js +39 -0
  232. package/src/components/Paragraphs/Breakout/index.vue +115 -0
  233. package/src/components/Paragraphs/BrowseContent/index.stories.js +220 -0
  234. package/src/components/Paragraphs/BrowseContent/index.vue +298 -0
  235. package/src/components/Paragraphs/BrowseContent/switcher.vue +63 -0
  236. package/src/components/Paragraphs/Calculator/CardContainer/index.vue +278 -0
  237. package/src/components/Paragraphs/Calculator/CardContainer/styles.scss +152 -0
  238. package/src/components/Paragraphs/Calculator/Constants.js +246 -0
  239. package/src/components/Paragraphs/Calculator/RiskLevel/index.vue +124 -0
  240. package/src/components/Paragraphs/Calculator/RiskLevel/styles.scss +73 -0
  241. package/src/components/Paragraphs/Calculator/index.stories.js +27 -0
  242. package/src/components/Paragraphs/Calculator/index.vue +284 -0
  243. package/src/components/Paragraphs/Calculator/styles.scss +49 -0
  244. package/src/components/Paragraphs/Directory/Records/CJ/index.vue +59 -0
  245. package/src/components/Paragraphs/Directory/Records/ISP/distance.js +46 -0
  246. package/src/components/Paragraphs/Directory/Records/ISP/index.vue +88 -0
  247. package/src/components/Paragraphs/Directory/Records/PRS/index.vue +59 -0
  248. package/src/components/Paragraphs/Directory/Records/PRS/recordContent.vue +91 -0
  249. package/src/components/Paragraphs/Directory/Records/PRS/recordDetails.vue +49 -0
  250. package/src/components/Paragraphs/Directory/Records/index.vue +203 -0
  251. package/src/components/Paragraphs/Directory/Records/styles.scss +129 -0
  252. package/src/components/Paragraphs/Directory/constants.js +79 -0
  253. package/src/components/Paragraphs/Directory/index.vue +334 -0
  254. package/src/components/Paragraphs/ListGroup/Constants.js +72 -0
  255. package/src/components/Paragraphs/ListGroup/Link/list-link.stories.js +71 -0
  256. package/src/components/Paragraphs/ListGroup/index.vue +333 -0
  257. package/src/components/Paragraphs/ListGroup/list-group.stories.js +64 -0
  258. package/src/components/Paragraphs/ListGroup/navigation-card.stories.js +66 -0
  259. package/src/components/Paragraphs/MarketingBanner/index.stories.js +65 -0
  260. package/src/components/Paragraphs/MarketingBanner/index.vue +118 -0
  261. package/src/components/Paragraphs/MarketingBanner/styles.scss +87 -0
  262. package/src/components/Paragraphs/ProofPoints/index.stories.js +173 -0
  263. package/src/components/Paragraphs/ProofPoints/index.vue +64 -0
  264. package/src/components/Paragraphs/RelatedInformation/index.stories.js +32 -0
  265. package/src/components/Paragraphs/RelatedInformation/index.vue +62 -0
  266. package/src/components/Paragraphs/RelatedInformation/styles.scss +50 -0
  267. package/src/components/Paragraphs/RichText/index.stories.js +393 -0
  268. package/src/components/Paragraphs/RichText/index.vue +113 -0
  269. package/src/components/Paragraphs/RichText/scss/base.scss +355 -0
  270. package/src/components/Paragraphs/RichText/scss/definition-list.scss +35 -0
  271. package/src/components/Paragraphs/RichText/scss/styled-list.scss +152 -0
  272. package/src/components/Paragraphs/RichText/scss/table.scss +85 -0
  273. package/src/components/Paragraphs/ScrollSpy/index.stories.js +184 -0
  274. package/src/components/Paragraphs/ScrollSpy/index.vue +147 -0
  275. package/src/components/Paragraphs/SelectableCards/Control/index.stories.js +29 -0
  276. package/src/components/Paragraphs/SelectableCards/cardbody.vue +25 -0
  277. package/src/components/Paragraphs/SelectableCards/cardtop.vue +113 -0
  278. package/src/components/Paragraphs/SelectableCards/index.stories.js +27 -0
  279. package/src/components/Paragraphs/SelectableCards/index.vue +116 -0
  280. package/src/components/Paragraphs/Statistics/index.stories.js +106 -0
  281. package/src/components/Paragraphs/Statistics/index.vue +95 -0
  282. package/src/components/Paragraphs/TabbedCards/TempIcons/cake-black-18dp.svg +1 -0
  283. package/src/components/Paragraphs/TabbedCards/TempIcons/commute-black-18dp.svg +1 -0
  284. package/src/components/Paragraphs/TabbedCards/TempIcons/fire_extinguisher-black-18dp.svg +1 -0
  285. package/src/components/Paragraphs/TabbedCards/TempIcons/free_breakfast-black-18dp.svg +1 -0
  286. package/src/components/Paragraphs/TabbedCards/TempIcons/portrait-black-18dp.svg +1 -0
  287. package/src/components/Paragraphs/TabbedCards/TempIcons/storefront-black-18dp.svg +1 -0
  288. package/src/components/Paragraphs/TabbedCards/TempIcons/tag_faces-black-18dp.svg +1 -0
  289. package/src/components/Paragraphs/TabbedCards/index.stories.js +36 -0
  290. package/src/components/Paragraphs/TabbedCards/index.vue +393 -0
  291. package/src/components/Paragraphs/Tabs/index.stories.js +60 -0
  292. package/src/components/Paragraphs/Tabs/index.vue +127 -0
  293. package/src/components/Paragraphs/Tabs/styles.scss +150 -0
  294. package/src/components/Paragraphs/TabulatedData/Constants.js +158 -0
  295. package/src/components/Paragraphs/TabulatedData/index.stories.js +39 -0
  296. package/src/components/Paragraphs/TabulatedData/index.vue +145 -0
  297. package/src/components/Paragraphs/TaskFinder/index.stories.js +45 -0
  298. package/src/components/Paragraphs/TaskFinder/index.vue +192 -0
  299. package/src/components/Paragraphs/TaskFinder/pdf/index.vue +109 -0
  300. package/src/components/Paragraphs/TaskFinder/task-finder-column.vue +146 -0
  301. package/src/components/Paragraphs/TextMedia/MediaTypes/Image/index.vue +24 -0
  302. package/src/components/Paragraphs/TextMedia/MediaTypes/Video/index.vue +29 -0
  303. package/src/components/Paragraphs/TextMedia/index.stories.js +94 -0
  304. package/src/components/Paragraphs/TextMedia/index.vue +150 -0
  305. package/src/components/Paragraphs/VideoGrid/index.stories.js +167 -0
  306. package/src/components/Paragraphs/VideoGrid/index.vue +124 -0
  307. package/src/components/Paragraphs/VideoPlayer/index.stories.js +95 -0
  308. package/src/components/Paragraphs/VideoPlayer/index.vue +110 -0
  309. package/src/components/Paragraphs/Webform/index.stories.js +70 -0
  310. package/src/components/Paragraphs/Webform/index.vue +103 -0
  311. package/src/components/SubComponents/Breadcrumb/constants.js +15 -0
  312. package/src/components/SubComponents/Breadcrumb/index.stories.js +22 -0
  313. package/src/components/SubComponents/Breadcrumb/index.vue +91 -0
  314. package/src/components/SubComponents/CardGroup/cardbody.vue +109 -0
  315. package/src/components/SubComponents/CardGroup/cardtop.vue +106 -0
  316. package/src/components/SubComponents/CardGroup/index.stories.js +145 -0
  317. package/src/components/SubComponents/CardGroup/index.vue +297 -0
  318. package/src/components/SubComponents/CtaButton/index.stories.js +357 -0
  319. package/src/components/SubComponents/CtaButton/index.vue +256 -0
  320. package/src/components/SubComponents/FormAddressPostcode/index.stories.js +43 -0
  321. package/src/components/SubComponents/FormAddressPostcode/index.vue +314 -0
  322. package/src/components/SubComponents/FormInstance/index.stories.js +8 -0
  323. package/src/components/SubComponents/FormInstance/index.vue +12 -0
  324. package/src/components/SubComponents/GoogleSearch/index.stories.js +8 -0
  325. package/src/components/SubComponents/GoogleSearch/index.vue +405 -0
  326. package/src/components/SubComponents/Icon/README.md +40 -0
  327. package/src/components/SubComponents/Icon/example.js +41 -0
  328. package/src/components/SubComponents/Icon/index.stories.js +84 -0
  329. package/src/components/SubComponents/Icon/index.vue +127 -0
  330. package/src/components/SubComponents/Icon/styles.scss +38 -0
  331. package/src/components/SubComponents/Loading/index.stories.js +9 -0
  332. package/src/components/SubComponents/Loading/index.vue +15 -0
  333. package/src/components/SubComponents/MediaPlayer/index.stories.js +58 -0
  334. package/src/components/SubComponents/MediaPlayer/index.vue +69 -0
  335. package/src/components/SubComponents/Pagination/index.stories.js +119 -0
  336. package/src/components/SubComponents/Pagination/index.vue +184 -0
  337. package/src/components/SubComponents/Pagination/pagination.js +58 -0
  338. package/src/components/SubComponents/ResourceGroup/List/index.stories.js +268 -0
  339. package/src/components/SubComponents/ResourceGroup/cardbody.vue +221 -0
  340. package/src/components/SubComponents/ResourceGroup/cardfooter.vue +61 -0
  341. package/src/components/SubComponents/ResourceGroup/cardtop.vue +94 -0
  342. package/src/components/SubComponents/ResourceGroup/index.stories.js +268 -0
  343. package/src/components/SubComponents/ResourceGroup/index.vue +575 -0
  344. package/src/components/SubComponents/ResourceGroup/styles.scss +317 -0
  345. package/src/components/SubComponents/ResourceGroup/switcher.vue +63 -0
  346. package/src/components/SubComponents/Search/SearchListing/index.vue +217 -0
  347. package/src/components/SubComponents/Search/index.stories.js +43 -0
  348. package/src/components/SubComponents/Search/index.vue +238 -0
  349. package/src/components/SubComponents/SingleImage/index.stories.js +60 -0
  350. package/src/components/SubComponents/SingleImage/index.vue +98 -0
  351. package/src/components/SubComponents/VideoThumbnail/index.stories.js +41 -0
  352. package/src/components/SubComponents/VideoThumbnail/index.vue +239 -0
  353. package/src/components/TheWelcome.vue +88 -0
  354. package/src/components/WelcomeItem.vue +87 -0
  355. package/src/components/icons/IconCommunity.vue +7 -0
  356. package/src/components/icons/IconDocumentation.vue +7 -0
  357. package/src/components/icons/IconEcosystem.vue +7 -0
  358. package/src/components/icons/IconSupport.vue +7 -0
  359. package/src/components/icons/IconTooling.vue +19 -0
  360. package/src/includes/scss/all.scss +2 -0
  361. package/src/includes/scss/mixins/all.scss +6 -0
  362. package/src/includes/scss/mixins/src/focus.scss +38 -0
  363. package/src/includes/scss/mixins/src/fp.scss +31 -0
  364. package/src/includes/scss/mixins/src/grid.scss +125 -0
  365. package/src/includes/scss/mixins/src/mq.scss +30 -0
  366. package/src/includes/scss/mixins/src/rtl.scss +8 -0
  367. package/src/includes/scss/mixins/src/units.scss +110 -0
  368. package/src/includes/scss/vars/all.scss +2 -0
  369. package/src/includes/scss/vars/src/breakpoints.scss +20 -0
  370. package/src/includes/scss/vars/src/colors.module.scss +53 -0
  371. package/src/includes/scss/vars/src/colors.scss +53 -0
  372. package/src/index.js +116 -0
  373. package/src/main.js +18 -0
  374. package/src/mock/accordion.js +104 -0
  375. package/src/mock/app-header.js +683 -0
  376. package/src/mock/control-selectable-cards.js +58 -0
  377. package/src/mock/jest.svgtransformer.js +7 -0
  378. package/src/mock/list-group.js +46 -0
  379. package/src/mock/proof-points.js +55 -0
  380. package/src/mock/related-info.js +44 -0
  381. package/src/mock/selectable-cards.js +48 -0
  382. package/src/mock/statistics.js +63 -0
  383. package/src/mock/styleMock.js +1 -0
  384. package/src/mock/tabbed-cards.js +197 -0
  385. package/src/mock/task-finder.js +68 -0
  386. package/src/mock/video-grid.js +409 -0
  387. package/src/mock/video-media.js +51 -0
  388. package/src/public/places/api/v1/geocode/json +69 -0
  389. package/src/public/places/api/v1/place/autocomplete/json +226 -0
  390. package/stylelint.config.js +63 -0
  391. package/vite.config.js +19 -0
  392. package/vitest.config.js +14 -0
@@ -0,0 +1,106 @@
1
+ import Statistics from './index.vue'
2
+
3
+ const itemListDefault = [
4
+ {
5
+ heading: 'Statistic 1',
6
+ description:
7
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
8
+ statistic: '100%'
9
+ },
10
+ {
11
+ heading: 'Statistic 2',
12
+ description:
13
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
14
+ statistic: '10,000'
15
+ },
16
+ {
17
+ heading: 'Statistic 3',
18
+ description:
19
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
20
+ statistic: '3 of 10'
21
+ },
22
+ {
23
+ heading: 'Statistic 4',
24
+ description:
25
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
26
+ statistic: '$500'
27
+ }
28
+ ]
29
+
30
+ const itemListAr = [
31
+ {
32
+ heading: 'نقطة إثبات 1',
33
+ description:
34
+ 'لكن لا بد أن أوضح لك أن كل هذه الأفكار المغلوطة حول استنكار النشوة وتمجيد الألم نشأت بالفعل، وسأعرض لك التفاصيل لتكتشف حقيقة وأساس تلك السعادة البشرية، ',
35
+ statistic: '100%'
36
+ },
37
+ {
38
+ heading: 'نقطة إثبات 2',
39
+ description:
40
+ 'لكن لا بد أن أوضح لك أن كل هذه الأفكار المغلوطة حول استنكار النشوة وتمجيد الألم نشأت بالفعل، وسأعرض لك التفاصيل لتكتشف حقيقة وأساس تلك السعادة البشرية، ',
41
+ statistic: '10,000'
42
+ },
43
+ {
44
+ heading: 'نقطة إثبات 3',
45
+ description:
46
+ 'لكن لا بد أن أوضح لك أن كل هذه الأفكار المغلوطة حول استنكار النشوة وتمجيد الألم نشأت بالفعل، وسأعرض لك التفاصيل لتكتشف حقيقة وأساس تلك السعادة البشرية، ',
47
+ statistic: '3 من 10'
48
+ },
49
+ {
50
+ heading: 'نقطة إثبات 4',
51
+ description:
52
+ 'لكن لا بد أن أوضح لك أن كل هذه الأفكار المغلوطة حول استنكار النشوة وتمجيد الألم نشأت بالفعل، وسأعرض لك التفاصيل لتكتشف حقيقة وأساس تلك السعادة البشرية، ',
53
+ statistic: '$500'
54
+ }
55
+ ]
56
+
57
+ export default {
58
+ title: 'Paragraphs/Statistics',
59
+ component: Statistics,
60
+ argTypes: {
61
+ headingTag: {
62
+ control: 'select',
63
+ options: ['h2', 'h3']
64
+ },
65
+ columns: {
66
+ control: 'select',
67
+ options: [3, 4]
68
+ },
69
+ itemList: {
70
+ table: { disable: true }
71
+ }
72
+ },
73
+ args: {
74
+ title: 'Section heading',
75
+ headingTag: 'h2',
76
+ rtl: false,
77
+ columns: 3
78
+ }
79
+ }
80
+
81
+ const DefaultStatistics = (args) => ({
82
+ components: { Statistics },
83
+ setup() {
84
+ return { args }
85
+ },
86
+ data() {
87
+ return {
88
+ itemListDefault,
89
+ itemListAr
90
+ }
91
+ },
92
+ template: `
93
+ <statistics v-bind="args" :item-list="dynamicItemList" ></statistics>
94
+ `,
95
+ computed: {
96
+ dynamicItemList() {
97
+ if (args.rtl) {
98
+ return this.itemListAr
99
+ } else {
100
+ return this.itemListDefault
101
+ }
102
+ }
103
+ }
104
+ })
105
+
106
+ export const Default = DefaultStatistics.bind({})
@@ -0,0 +1,95 @@
1
+ <template>
2
+ <card-grid
3
+ :title="title"
4
+ :title-tag="headingTag"
5
+ :cards="itemList"
6
+ :rtl="rtl"
7
+ :force-md-columns-per-row="columns < 3 ? 3 : columns"
8
+ :force-lg-columns-per-row="columns < 3 ? 3 : columns"
9
+ class="statistics__grid"
10
+ >
11
+ <template v-slot:cardItem="{ card }">
12
+ <hr class="statistics__hr" />
13
+ <card-grid-item
14
+ :card-header-title="card.statistic"
15
+ :header-tag="'div'"
16
+ :header-size="'extra-2x-large'"
17
+ :rtl="rtl"
18
+ class="statistics"
19
+ >
20
+ <template v-slot:cardDescription>
21
+ <p
22
+ v-if="card.heading !== null && card.heading !== undefined"
23
+ class="statistics__sub-heading"
24
+ >
25
+ {{ card.heading }}
26
+ </p>
27
+ <rich-text
28
+ v-if="card.description"
29
+ class="statistics__description"
30
+ :content="card.description"
31
+ :without-container="true"
32
+ />
33
+ </template>
34
+ </card-grid-item>
35
+ </template>
36
+ </card-grid>
37
+ </template>
38
+
39
+ <script>
40
+ import CardGrid from './../../Common/CardGrid/index.vue'
41
+ import CardGridItem from './../../Common/CardGridItem/index.vue'
42
+ import RichText from '../../Paragraphs/RichText/index.vue'
43
+
44
+ export default {
45
+ name: 'Statistics',
46
+ components: { CardGrid, CardGridItem, RichText },
47
+ props: {
48
+ title: {
49
+ type: String,
50
+ default: null
51
+ },
52
+ headingTag: {
53
+ type: String,
54
+ default: 'h2'
55
+ },
56
+ itemList: {
57
+ type: Array,
58
+ required: true
59
+ },
60
+ rtl: {
61
+ type: Boolean,
62
+ default: false
63
+ },
64
+ columns: {
65
+ type: Number,
66
+ default: 3
67
+ }
68
+ }
69
+ }
70
+ </script>
71
+
72
+ <style lang="scss" scoped>
73
+ @import '../../../includes/scss/all';
74
+
75
+ .statistics {
76
+ &__hr {
77
+ background-color: $orange;
78
+ height: 8px;
79
+ position: relative;
80
+ border-radius: 10px 10px 10px 10px;
81
+ margin-bottom: 16px;
82
+ border-top: none;
83
+ }
84
+ :deep(.card-title) {
85
+ line-height: 1.2;
86
+ font-weight: 700;
87
+ font-size: 40px;
88
+ }
89
+
90
+ :deep(.statistics__description) {
91
+ margin-top: 14px;
92
+ line-height: 1.5;
93
+ }
94
+ }
95
+ </style>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12.68 5.88c.7-.24 1.22-.9 1.3-1.64.05-.47-.05-.91-.28-1.27L12.42.75c-.19-.33-.67-.33-.87 0l-1.28 2.22c-.17.3-.27.65-.27 1.03 0 1.32 1.3 2.35 2.68 1.88zm3.85 10.04l-1-1-1.08 1.07c-1.3 1.3-3.58 1.31-4.89 0l-1.07-1.07-1.09 1.07C6.75 16.64 5.88 17 4.96 17c-.73 0-1.4-.23-1.96-.61V20c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-3.61c-.75.51-1.71.75-2.74.52-.66-.14-1.25-.51-1.73-.99zM18 9h-5V8c0-.55-.45-1-1-1s-1 .45-1 1v1H6c-1.66 0-3 1.34-3 3v1.46c0 .85.5 1.67 1.31 1.94.73.24 1.52.06 2.03-.46l2.14-2.13 2.13 2.13c.76.76 2.01.76 2.77 0l2.14-2.13 2.13 2.13c.43.43 1.03.63 1.65.55.99-.13 1.69-1.06 1.69-2.06v-1.42C21 10.34 19.66 9 18 9z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 4H5C3.34 4 2 5.34 2 7v8c0 1.66 1.34 3 3 3l-.77.77c-.28.28-.28.72 0 1s.72.28 1 0L7 18h2v-5H4.5c-.28 0-.5-.22-.5-.5v-6c0-.28.22-.5.5-.5h8c.28 0 .5.22.5.5V8h2V7c0-1.66-1.34-3-3-3zM5 14c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm15.57-4.34c-.14-.4-.52-.66-.97-.66h-7.19c-.46 0-.83.26-.98.66l-1.42 4.11v5.24c0 .55.45.99 1 .99s1-.45 1-1v-1h8v1c0 .55.45 1 1 1s.99-.44 1-.99L22 13.77l-1.43-4.11zm-7.8.34h6.48c.21 0 .4.14.47.34l.69 2c.11.32-.13.66-.47.66h-7.85c-.34 0-.58-.34-.47-.66l.69-2c.05-.2.24-.34.46-.34zM12 16c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm8 0c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><g><rect fill="none" height="24" width="24"/><path d="M7,19h10v1c0,1.1-0.9,2-2,2H9c-1.1,0-2-0.9-2-2V19z M7,18h10v-5H7V18z M17,4.23v3.54c0,0.63-0.58,1.11-1.21,0.98 l-1.94-0.41c0,0.02,0,0.01-0.01,0.03c1.54,0.62,2.71,1.98,3.06,3.63H7.1c0.34-1.66,1.52-3.02,3.07-3.64 c-0.33-0.26-0.6-0.58-0.8-0.95L5.49,6.6C5.2,6.54,5,6.29,5,6v0c0-0.29,0.2-0.54,0.49-0.6l3.88-0.81C9.87,3.65,10.86,3,12,3 c0.7,0,1.34,0.25,1.85,0.66l1.94-0.41C16.42,3.12,17,3.6,17,4.23z M13,6c-0.03-0.59-0.45-1-1-1s-1,0.45-1,1s0.45,1,1,1 S13,6.55,13,6z"/></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M20 3H6c-1.1 0-2 .9-2 2v8c0 2.21 1.79 4 4 4h6c2.21 0 4-1.79 4-4v-3h2c1.11 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 5h-2V5h2v3zM5 19h14c.55 0 1 .45 1 1s-.45 1-1 1H5c-.55 0-1-.45-1-1s.45-1 1-1z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 12.25c1.24 0 2.25-1.01 2.25-2.25S13.24 7.75 12 7.75 9.75 8.76 9.75 10s1.01 2.25 2.25 2.25zm4.5 4c0-1.5-3-2.25-4.5-2.25s-4.5.75-4.5 2.25V17h9v-.75zM19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-1 16H6c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h12c.55 0 1 .45 1 1v12c0 .55-.45 1-1 1z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><g><rect fill="none" height="24" width="24"/><rect fill="none" height="24" width="24"/></g><g><g/><g><path d="M21.9,8.89l-1.05-4.37c-0.22-0.9-1-1.52-1.91-1.52h-2.21h-2.01H13h-2H9.28H7.26H5.05C4.15,3,3.36,3.63,3.15,4.52L2.1,8.89 c-0.24,1.02-0.02,2.06,0.62,2.88C2.8,11.88,2.91,11.96,3,12.06V19c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2v-6.94 c0.09-0.09,0.2-0.18,0.28-0.28C21.92,10.96,22.15,9.91,21.9,8.89z M7.02,5L6.44,9.86C6.36,10.51,5.84,11,5.23,11 c-0.49,0-0.8-0.29-0.93-0.47c-0.26-0.33-0.35-0.76-0.25-1.17L5.05,5H7.02z M18.91,4.99l1.05,4.37c0.1,0.42,0.01,0.84-0.25,1.17 C19.57,10.71,19.27,11,18.77,11c-0.61,0-1.14-0.49-1.21-1.14L16.98,5L18.91,4.99z M15.51,9.52c0.05,0.39-0.07,0.78-0.33,1.07 C14.95,10.85,14.63,11,14.22,11C13.55,11,13,10.41,13,9.69V5h1.96L15.51,9.52z M11,9.69C11,10.41,10.45,11,9.71,11 c-0.34,0-0.65-0.15-0.89-0.41C8.57,10.3,8.45,9.91,8.49,9.52L9.04,5H11V9.69z M18,19H6c-0.55,0-1-0.45-1-1v-5.03 C5.08,12.98,5.15,13,5.23,13c0.87,0,1.66-0.36,2.24-0.95c0.6,0.6,1.4,0.95,2.31,0.95c0.87,0,1.65-0.36,2.23-0.93 c0.59,0.57,1.39,0.93,2.29,0.93c0.84,0,1.64-0.35,2.24-0.95c0.58,0.59,1.37,0.95,2.24,0.95c0.08,0,0.15-0.02,0.23-0.03V18 C19,18.55,18.55,19,18,19z"/></g></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12.01 2C6.49 2 2.02 6.48 2.02 12s4.47 10 9.99 10c5.53 0 10.01-4.48 10.01-10S17.54 2 12.01 2zm.01 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.35 8 15.52 8s-1.5.67-1.5 1.5.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.35 8 8.52 8s-1.5.67-1.5 1.5.67 1.5 1.5 1.5zm3.5 6.5c2.03 0 3.8-1.11 4.75-2.75.19-.33-.05-.75-.44-.75H7.71c-.38 0-.63.42-.44.75.95 1.64 2.72 2.75 4.75 2.75z"/></svg>
@@ -0,0 +1,36 @@
1
+ import TabbedCards from './index.vue'
2
+ import { tabbedCardsMockLinks } from '../../../mock/tabbed-cards'
3
+
4
+ export default {
5
+ title: 'Paragraphs/TabbedCards',
6
+ component: TabbedCards,
7
+ argTypes: {
8
+ description: {
9
+ control: 'text',
10
+ defaultValue: 'Tabbed cards h2 heading'
11
+ },
12
+ heading: {
13
+ control: 'text',
14
+ defaultValue: 'Tabbed cards h2 heading'
15
+ },
16
+ tabbedCards: {
17
+ control: 'object',
18
+ defaultValue: tabbedCardsMockLinks
19
+ },
20
+ workwell: {
21
+ control: 'boolean',
22
+ defaultValue: false
23
+ }
24
+ }
25
+ }
26
+
27
+ const Template = (args, { argTypes }) => ({
28
+ components: { TabbedCards },
29
+ props: Object.keys(argTypes),
30
+ template: `
31
+ <tabbed-cards
32
+ v-bind="$props"
33
+ /> `
34
+ })
35
+
36
+ export const Default = Template.bind({})
@@ -0,0 +1,393 @@
1
+ <template>
2
+ <div
3
+ v-if="tabbedCards.length > 0 && loaded"
4
+ :ref="`tabbedCards-${_uid}`"
5
+ class="tabbed-cards"
6
+ >
7
+ <div v-for="(r, rIndex) in rows" :key="rIndex">
8
+ <card-grid
9
+ ref="cardgrid"
10
+ :title="rIndex === 0 ? heading : undefined"
11
+ :sub-heading="rIndex === 0 ? description : undefined"
12
+ :cards="getItemsByRow(tabbedCards, rIndex)"
13
+ :card-id-prefix="getCardIdPrefix(rIndex)"
14
+ :force-lg-columns-per-row="getViewPortColumns()"
15
+ :force-md-columns-per-row="getViewPortColumns()"
16
+ :is-selectable="true"
17
+ :no-padding-top="rIndex !== 0"
18
+ :no-padding-bottom="rIndex !== 0 && rIndex >= rows"
19
+ :background-variant="'light'"
20
+ :content-class="`tabbed-cards-content`"
21
+ class="tabbed-cards__grid"
22
+ @selected="(card, cardIndex) => setCurrentRow(rIndex, card)"
23
+ @focussed="focussed($event)"
24
+ >
25
+ <template v-slot:cardItem="{ card }">
26
+ <card-grid-item
27
+ :glyph-src="card.icon"
28
+ :show-divider="false"
29
+ :header-size="'large'"
30
+ class="tabbed-card"
31
+ :class="card === selectedCard ? 'isSelected' : ''"
32
+ :card-padding="'small'"
33
+ :card-header-title="card.title"
34
+ :caret="card === selectedCard ? 'up' : 'down'"
35
+ :caret-position="'bottom'"
36
+ :rtl="rtl || card.rtl"
37
+ :description="card.text"
38
+ :button-role="'link'"
39
+ :is-selected="card === selectedCard"
40
+ :is-expandable="true"
41
+ />
42
+ </template>
43
+ <template
44
+ v-if="selectedRow === rIndex && selectedCard"
45
+ v-slot:cardGridFooter
46
+ >
47
+ <column class="listgroup-column">
48
+ <div ref="listgroup" class="tabbed-cards__listGroup">
49
+ <component
50
+ :is="ListGroupComponent"
51
+ :list="selectedCard.links"
52
+ :title="selectedCard.linksTitle"
53
+ :title-tag="selectedCard.linksTag"
54
+ :show-list-item-navigation-arrow="!selectedCard.isNavList"
55
+ :show-large-spacing="selectedCard.isNavList"
56
+ :rtl="rtl || selectedCard.rtl"
57
+ dark-background
58
+ />
59
+ </div>
60
+ </column>
61
+ </template>
62
+ </card-grid>
63
+ </div>
64
+ </div>
65
+ </template>
66
+
67
+ <script>
68
+ import CardGrid from './../../Common/CardGrid/index.vue'
69
+ import CardGridItem from './../../Common/CardGridItem/index.vue'
70
+ import Column from './../../Containers/Column/index.vue'
71
+ import Icon from './../../SubComponents/Icon/index.vue'
72
+
73
+ export default {
74
+ name: 'TabbedCards',
75
+ components: { CardGrid, CardGridItem, Icon, Column },
76
+ props: {
77
+ heading: {
78
+ type: String,
79
+ default: ''
80
+ },
81
+ description: {
82
+ type: String,
83
+ default: ''
84
+ },
85
+ tabbedCards: {
86
+ type: Array,
87
+ default: () => []
88
+ },
89
+ rtl: {
90
+ type: Boolean,
91
+ default: false
92
+ },
93
+ workwell: {
94
+ type: Boolean,
95
+ default: false
96
+ }
97
+ },
98
+ data() {
99
+ return {
100
+ selectedCard: undefined,
101
+ selectedRow: undefined,
102
+ screenWidth: 0,
103
+ loaded: false
104
+ }
105
+ },
106
+ computed: {
107
+ rows() {
108
+ let r = Math.floor(this.tabbedCards.length / this.cols)
109
+ if (r % 1 != 0) {
110
+ return r
111
+ } else {
112
+ return r + 1
113
+ }
114
+ },
115
+ cols() {
116
+ if (this.screenWidth < 575.98) {
117
+ return 1
118
+ } else if (this.screenWidth < 991.98) {
119
+ return 2
120
+ } else {
121
+ return 3
122
+ }
123
+ },
124
+ ListGroupComponent() {
125
+ //List group component import to fix storybook bug
126
+ return () => import('./../ListGroup/index.vue')
127
+ }
128
+ },
129
+ mounted() {
130
+ window.addEventListener('resize', this.updateScreenWidth)
131
+ this.screenWidth = document.documentElement.clientWidth
132
+ this.$root.$on('last-focus-out', () => {
133
+ this.selectedCard = null
134
+ this.selectedRow = null
135
+ })
136
+ this.loaded = true
137
+ },
138
+ beforeDestroy() {
139
+ window.removeEventListener('resize', this.updateScreenWidth)
140
+ },
141
+ methods: {
142
+ getCardIdPrefix(rIndex, cardIndex) {
143
+ const cardPrefix = `tabbedcards-${this._uid}-r-${rIndex}`
144
+ if (cardIndex !== null && cardIndex !== undefined) {
145
+ return `${cardPrefix}-${cardIndex}`
146
+ }
147
+ return cardPrefix
148
+ },
149
+ getItemsByRow(rows, index) {
150
+ let start = index * this.cols
151
+ let end = start + this.cols
152
+ return rows.slice(start, end)
153
+ },
154
+ setCurrentRow(rowIndex, card) {
155
+ const sameCardSelected =
156
+ card.selectedCard === this.selectedCard || !card.selectedCard
157
+ this.selectedCard = null
158
+ this.selectedRow = null
159
+ const cardGrids = this.$refs.cardgrid || []
160
+ cardGrids.forEach((cardGrid, index) => {
161
+ if (sameCardSelected || rowIndex !== index) {
162
+ cardGrid.clearCards()
163
+ }
164
+ })
165
+ setTimeout(() => {
166
+ if (window && !sameCardSelected) {
167
+ this.selectedCard = card.selectedCard
168
+ this.selectedRow = rowIndex
169
+ let VueScrollTo = require('vue-scrollto')
170
+ let options = {
171
+ container: 'body',
172
+ easing: 'ease-in',
173
+ offset: -100,
174
+ force: true,
175
+ cancelable: true
176
+ }
177
+ setTimeout(() => {
178
+ const listGroup = this.$refs.listgroup[0]
179
+ VueScrollTo.scrollTo(listGroup, 300, options)
180
+ })
181
+ }
182
+ }, 100)
183
+ },
184
+ updateScreenWidth() {
185
+ this.screenWidth = document.documentElement.clientWidth
186
+ },
187
+ getViewPortColumns() {
188
+ if (this.tabbedCards.length <= 3) {
189
+ return 3
190
+ }
191
+ const cols = this.getItemsByRow(this.tabbedCards, 0).length
192
+ return cols
193
+ },
194
+ focussed(ev) {
195
+ if (ev.shiftKey) {
196
+ let prevTabbedCard = ev.target?.parentElement?.parentElement?.previousSibling?.getElementsByTagName(
197
+ 'button'
198
+ )[0]
199
+ if (
200
+ prevTabbedCard &&
201
+ prevTabbedCard.getAttribute('aria-expanded') === 'true'
202
+ ) {
203
+ ev.preventDefault()
204
+ const lG = this.$refs.listgroup
205
+ let itemsOfLG = lG[0].getElementsByTagName('button')
206
+ itemsOfLG[itemsOfLG.length - 1].focus()
207
+ }
208
+ return
209
+ }
210
+ const lG = this.$refs.listgroup
211
+ const isListGroupOpen = Array.isArray(lG) && lG.length > 0
212
+ const cardIsSelected = ev.target.parentElement.classList.contains(
213
+ 'isSelected'
214
+ )
215
+ if (cardIsSelected && isListGroupOpen) {
216
+ ev.preventDefault()
217
+ lG[0].getElementsByTagName('button')[0].focus()
218
+ } else if (!cardIsSelected && isListGroupOpen) {
219
+ ev.preventDefault()
220
+ let nextTabbedCard = ev.target?.parentElement?.parentElement?.nextSibling?.getElementsByTagName(
221
+ 'button'
222
+ )[0]
223
+ if (nextTabbedCard) {
224
+ nextTabbedCard.focus()
225
+ } else {
226
+ let itemsOfLG = lG[0].getElementsByTagName('button')
227
+ let lastItemOfLG = itemsOfLG[itemsOfLG.length - 1]
228
+ let nextFocusElement = this.focusNextElement(false, lastItemOfLG)
229
+ nextFocusElement.focus()
230
+ }
231
+ }
232
+ // if its the next card from the selected
233
+ },
234
+ focusNextElement(reverse, activeElem) {
235
+ /*check if an element is defined or use activeElement*/
236
+ activeElem =
237
+ activeElem instanceof HTMLElement ? activeElem : document.activeElement
238
+
239
+ let queryString = [
240
+ 'a:not([disabled]):not([tabindex="-1"])',
241
+ 'button:not([disabled]):not([tabindex="-1"])',
242
+ 'input:not([disabled]):not([tabindex="-1"])',
243
+ 'select:not([disabled]):not([tabindex="-1"])',
244
+ '[tabindex]:not([disabled]):not([tabindex="-1"])'
245
+ /* add custom queries here */
246
+ ].join(','),
247
+ queryResult = Array.prototype.filter.call(
248
+ document.querySelectorAll(queryString),
249
+ (elem) => {
250
+ /*check for visibility while always include the current activeElement*/
251
+ return (
252
+ elem.offsetWidth > 0 ||
253
+ elem.offsetHeight > 0 ||
254
+ elem === activeElem
255
+ )
256
+ }
257
+ ),
258
+ indexedList = queryResult
259
+ .slice()
260
+ .filter((elem) => {
261
+ /* filter out all indexes not greater than 0 */
262
+ return elem.tabIndex == 0 || elem.tabIndex == -1 ? false : true
263
+ })
264
+ .sort((a, b) => {
265
+ /* sort the array by index from smallest to largest */
266
+ return a.tabIndex != 0 && b.tabIndex != 0
267
+ ? a.tabIndex < b.tabIndex
268
+ ? -1
269
+ : b.tabIndex < a.tabIndex
270
+ ? 1
271
+ : 0
272
+ : a.tabIndex != 0
273
+ ? -1
274
+ : b.tabIndex != 0
275
+ ? 1
276
+ : 0
277
+ }),
278
+ focusable = [].concat(
279
+ indexedList,
280
+ queryResult.filter((elem) => {
281
+ /* filter out all indexes above 0 */
282
+ return elem.tabIndex == 0 || elem.tabIndex == -1 ? true : false
283
+ })
284
+ )
285
+
286
+ /* if reverse is true return the previous focusable element
287
+ if reverse is false return the next focusable element */
288
+ return reverse
289
+ ? focusable[focusable.indexOf(activeElem) - 1] ||
290
+ focusable[focusable.length - 1]
291
+ : focusable[focusable.indexOf(activeElem) + 1] || focusable[0]
292
+ }
293
+ }
294
+ }
295
+ </script>
296
+ <style lang="scss" scoped>
297
+ @import '../../../includes/scss/all';
298
+ .tabbed-cards {
299
+ :deep(.section-group--size-content .section-group__block) {
300
+ max-width: 100%;
301
+ }
302
+
303
+ :deep(.section-group--size-content .section-group__block .col-md-12) {
304
+ flex: 0 0 50%;
305
+ max-width: 50%;
306
+ @include mq('sm') {
307
+ flex: 0 0 100%;
308
+ max-width: 100%;
309
+ }
310
+ }
311
+
312
+ :deep(.container.section-group__container.section-group__container--page) {
313
+ max-width: 100%;
314
+ }
315
+
316
+ :deep(.container.section-group__container .tabbed-cards-content) {
317
+ @include make-container();
318
+ @include make-max-widths-container-width(
319
+ $container-max-widths,
320
+ $grid-breakpoints
321
+ );
322
+ @include mq('mm') {
323
+ max-width: 100%;
324
+ }
325
+
326
+ .card-grid-item-icon {
327
+ padding-bottom: 16px;
328
+ }
329
+ }
330
+
331
+ :deep(.container.section-group__container .tabbed-cards-content-main) {
332
+ @include make-container();
333
+ @include make-max-widths-container-width(
334
+ $container-max-widths,
335
+ $grid-breakpoints
336
+ );
337
+ @include mq('mm') {
338
+ max-width: 100%;
339
+ }
340
+
341
+ .card-grid-item-icon {
342
+ padding-bottom: 16px;
343
+ }
344
+ }
345
+
346
+ :deep(.isSelected button) {
347
+ background: $black;
348
+ color: $white;
349
+ }
350
+
351
+ :deep(.isSelected .card-grid-item-icon) {
352
+ padding-bottom: 16px;
353
+ }
354
+
355
+ :deep(.isSelected .card-grid-item-icon span img) {
356
+ filter: invert(97%) sepia(79%) saturate(11%) hue-rotate(205deg)
357
+ brightness(103%) contrast(103%);
358
+ }
359
+
360
+ :deep(.isSelected .card-grid-item__caretContainer img) {
361
+ filter: invert(97%) sepia(79%) saturate(11%) hue-rotate(205deg)
362
+ brightness(103%) contrast(103%);
363
+ }
364
+
365
+ :deep(.tabbed-cards__listGroup .card-grid__row--small) {
366
+ grid-row-gap: 12px !important;
367
+ row-gap: 12px !important;
368
+ }
369
+
370
+ :deep(.tabbed-cards__listGroup section) {
371
+ background-color: $white !important;
372
+ margin-top: 0px;
373
+ margin-bottom: 0px;
374
+ padding-right: 0px;
375
+ padding-left: 0px;
376
+ margin-right: -15px;
377
+ margin-left: -15px;
378
+ }
379
+
380
+ :deep(.tabbed-cards__listGroup section .section-group__heading h2) {
381
+ color: $black;
382
+ }
383
+
384
+ :deep(.tabbed-cards__listGroup section .section-group__heading h3) {
385
+ color: $black;
386
+ }
387
+
388
+ :deep(.tabbed-cards__listGroup section .list_group__card button) {
389
+ border: 2px solid $lightgray;
390
+ border-left: thick solid $orange;
391
+ }
392
+ }
393
+ </style>