@qhealth-design-system/core 1.21.0 → 1.22.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 (359) hide show
  1. package/.prettierignore +14 -0
  2. package/.storybook/assets/storybook.scss +39 -39
  3. package/.storybook/decorators.js +36 -0
  4. package/.storybook/globals.js +196 -128
  5. package/.storybook/helper-functions.js +48 -9
  6. package/.storybook/main.js +20 -13
  7. package/.storybook/prepare-storybook.js +14 -14
  8. package/.storybook/preview-head.html +4 -1
  9. package/.storybook/preview.js +84 -98
  10. package/.storybook/vite-plugin-hbs.js +13 -13
  11. package/.stylelintrc.json +23 -23
  12. package/CHANGELOG.md +4 -0
  13. package/README.md +56 -520
  14. package/chromatic.config.json +5 -0
  15. package/eslint.config.mjs +72 -47
  16. package/package.json +95 -87
  17. package/prettier.config.js +10 -14
  18. package/src/component-loader.js +39 -15
  19. package/src/components/_global/css/admin/component.scss +112 -112
  20. package/src/components/_global/css/body/component.scss +944 -924
  21. package/src/components/_global/css/btn/component.scss +518 -512
  22. package/src/components/_global/css/cta_links/component.scss +192 -192
  23. package/src/components/_global/css/direction_links/component.scss +98 -98
  24. package/src/components/_global/css/example/component.scss +43 -37
  25. package/src/components/_global/css/flex/flexbox-utility-classes.scss +586 -594
  26. package/src/components/_global/css/forms/control_inputs/component.scss +269 -266
  27. package/src/components/_global/css/forms/general/component.scss +210 -210
  28. package/src/components/_global/css/forms/select/component.scss +324 -312
  29. package/src/components/_global/css/forms/text/component.scss +358 -348
  30. package/src/components/_global/css/global.scss +14 -15
  31. package/src/components/_global/css/grid-12/component.scss +254 -260
  32. package/src/components/_global/css/headings/component.scss +153 -153
  33. package/src/components/_global/css/icons/component.scss +115 -115
  34. package/src/components/_global/css/img/images.scss +64 -62
  35. package/src/components/_global/css/link_columns/component.scss +199 -199
  36. package/src/components/_global/css/link_list/component.scss +33 -33
  37. package/src/components/_global/css/links/components.scss +61 -57
  38. package/src/components/_global/css/modal/component.scss +162 -162
  39. package/src/components/_global/css/table/component.scss +274 -272
  40. package/src/components/_global/css/tabs/component.scss +26 -26
  41. package/src/components/_global/css/tags/component.scss +307 -307
  42. package/src/components/_global/css/toggle_and_tool_tip/component.scss +199 -195
  43. package/src/components/_global/css/user_location/component.scss +35 -33
  44. package/src/components/_global/css/version/component.scss +37 -37
  45. package/src/components/_global/html/component.hbs +130 -77
  46. package/src/components/_global/html/ds_component.hbs +21 -24
  47. package/src/components/_global/html/head.html +16 -5
  48. package/src/components/_global/html/scripts.html +15 -15
  49. package/src/components/_global/js/_polyfills/global.js +12 -11
  50. package/src/components/_global/js/animate/global.js +303 -319
  51. package/src/components/_global/js/collapsible.js +203 -0
  52. package/src/components/_global/js/cta_links/global.js +19 -14
  53. package/src/components/_global/js/global.js +316 -309
  54. package/src/components/_global/js/manifest.json +9 -10
  55. package/src/components/_global/js/modal/global.js +241 -224
  56. package/src/components/_global/js/popover/controller.js +168 -0
  57. package/src/components/_global/js/popover/position.js +372 -0
  58. package/src/components/_global/js/select_boxes/global.js +21 -18
  59. package/src/components/_global/js/tabs/global.js +305 -301
  60. package/src/components/_template/css/component.scss +10 -15
  61. package/src/components/_template/html/component-page.html +57 -61
  62. package/src/components/_template/html/component.hbs +3 -3
  63. package/src/components/_template/js/global.js +2 -5
  64. package/src/components/_template/js/manifest.json +39 -39
  65. package/src/components/a-z_listing/css/component.scss +124 -127
  66. package/src/components/a-z_listing/html/component.hbs +15 -13
  67. package/src/components/a-z_listing/js/global.js +93 -75
  68. package/src/components/a-z_listing/js/manifest.json +13594 -13553
  69. package/src/components/abstract/css/component.scss +63 -65
  70. package/src/components/abstract/html/component.hbs +8 -7
  71. package/src/components/abstract/js/manifest.json +28 -28
  72. package/src/components/accordion/css/component.scss +253 -247
  73. package/src/components/accordion/html/accordion-group.html +158 -152
  74. package/src/components/accordion/html/component.hbs +43 -30
  75. package/src/components/accordion/html/default.html +94 -87
  76. package/src/components/accordion/js/global.js +171 -449
  77. package/src/components/accordion/js/manifest.json +475 -440
  78. package/src/components/banner/css/component.scss +450 -434
  79. package/src/components/banner/html/component.hbs +148 -97
  80. package/src/components/banner/js/manifest.json +9 -10
  81. package/src/components/banner_advanced/css/component.scss +210 -226
  82. package/src/components/banner_advanced/html/component.hbs +425 -233
  83. package/src/components/banner_advanced/js/global.js +13 -4
  84. package/src/components/banner_advanced/js/manifest.json +1502 -1502
  85. package/src/components/banner_basic/css/component.scss +34 -40
  86. package/src/components/banner_basic/html/component.hbs +214 -132
  87. package/src/components/banner_basic/js/global.js +2 -5
  88. package/src/components/banner_basic/js/manifest.json +92 -92
  89. package/src/components/basic_search/css/component.scss +208 -202
  90. package/src/components/basic_search/html/component.hbs +724 -366
  91. package/src/components/basic_search/js/global.js +80 -63
  92. package/src/components/basic_search/js/manifest.json +771 -797
  93. package/src/components/body/css/component.scss +7 -8
  94. package/src/components/body/html/component.hbs +13 -4
  95. package/src/components/body/js/manifest.json +47 -47
  96. package/src/components/breadcrumbs/css/component.scss +176 -171
  97. package/src/components/breadcrumbs/html/component.hbs +82 -50
  98. package/src/components/breadcrumbs/js/global.js +279 -219
  99. package/src/components/breadcrumbs/js/manifest.json +8 -8
  100. package/src/components/callout/css/component.scss +124 -120
  101. package/src/components/callout/html/component.hbs +36 -25
  102. package/src/components/callout/js/manifest.json +126 -126
  103. package/src/components/card_feature/css/component.scss +66 -66
  104. package/src/components/card_feature/html/component.hbs +179 -104
  105. package/src/components/card_feature/js/manifest.json +1487 -1456
  106. package/src/components/card_multi_action/css/component.scss +234 -208
  107. package/src/components/card_multi_action/html/component.hbs +315 -177
  108. package/src/components/card_multi_action/js/manifest.json +1372 -1312
  109. package/src/components/card_no_action/css/component.scss +536 -524
  110. package/src/components/card_no_action/html/component.hbs +134 -114
  111. package/src/components/card_no_action/js/global.js +15 -0
  112. package/src/components/card_no_action/js/manifest.json +1314 -1277
  113. package/src/components/card_single_action/css/component.scss +111 -104
  114. package/src/components/card_single_action/html/component.hbs +285 -139
  115. package/src/components/card_single_action/js/manifest.json +1317 -1284
  116. package/src/components/code/css/component.scss +365 -353
  117. package/src/components/code/html/component.hbs +430 -157
  118. package/src/components/code/js/global.js +243 -180
  119. package/src/components/code/js/manifest.json +189 -177
  120. package/src/components/file_upload/css/component.scss +387 -387
  121. package/src/components/file_upload/html/component.hbs +86 -41
  122. package/src/components/file_upload/js/global.js +960 -813
  123. package/src/components/file_upload/js/manifest.json +61 -61
  124. package/src/components/footer/css/component.scss +428 -420
  125. package/src/components/footer/html/component.hbs +314 -191
  126. package/src/components/footer/js/manifest.json +8 -8
  127. package/src/components/global_alert/css/component.scss +210 -210
  128. package/src/components/global_alert/html/component.hbs +278 -125
  129. package/src/components/global_alert/js/global.js +32 -27
  130. package/src/components/global_alert/js/manifest.json +8 -8
  131. package/src/components/header/css/component.scss +518 -516
  132. package/src/components/header/html/component.hbs +281 -132
  133. package/src/components/header/js/global.js +157 -141
  134. package/src/components/header/js/manifest.json +8 -9
  135. package/src/components/horizontal_rule/css/component.scss +52 -52
  136. package/src/components/horizontal_rule/html/component.hbs +21 -5
  137. package/src/components/horizontal_rule/js/manifest.json +69 -69
  138. package/src/components/in_page_navigation/css/component.scss +42 -42
  139. package/src/components/in_page_navigation/html/component.hbs +13 -9
  140. package/src/components/in_page_navigation/js/global.js +78 -57
  141. package/src/components/in_page_navigation/js/manifest.json +34 -34
  142. package/src/components/internal_navigation/css/component.scss +294 -286
  143. package/src/components/internal_navigation/html/component.hbs +70 -51
  144. package/src/components/internal_navigation/js/global.js +36 -27
  145. package/src/components/internal_navigation/js/manifest.json +9 -10
  146. package/src/components/left_hand_navigation/css/component.scss +322 -309
  147. package/src/components/left_hand_navigation/html/component.hbs +136 -81
  148. package/src/components/left_hand_navigation/js/global.js +44 -30
  149. package/src/components/left_hand_navigation/js/manifest.json +39 -39
  150. package/src/components/loading_spinner/css/component.scss +57 -66
  151. package/src/components/loading_spinner/html/component.hbs +20 -4
  152. package/src/components/loading_spinner/js/global.js +2 -5
  153. package/src/components/loading_spinner/js/manifest.json +48 -48
  154. package/src/components/main_navigation/css/component.scss +713 -675
  155. package/src/components/main_navigation/html/component.hbs +222 -85
  156. package/src/components/main_navigation/js/global.js +355 -372
  157. package/src/components/main_navigation/js/manifest.json +9 -10
  158. package/src/components/mega_main_navigation/css/component.scss +504 -485
  159. package/src/components/mega_main_navigation/html/component.hbs +337 -145
  160. package/src/components/mega_main_navigation/js/global.js +133 -113
  161. package/src/components/mega_main_navigation/js/manifest.json +8 -8
  162. package/src/components/multi_column/css/component.scss +5 -5
  163. package/src/components/multi_column/html/component.hbs +404 -399
  164. package/src/components/multi_column/js/manifest.json +1203 -1203
  165. package/src/components/overflow_menu/css/component.scss +153 -152
  166. package/src/components/overflow_menu/html/component.hbs +82 -39
  167. package/src/components/overflow_menu/js/global.js +90 -5
  168. package/src/components/overflow_menu/js/manifest.json +39 -39
  169. package/src/components/page_alert/css/component.scss +127 -127
  170. package/src/components/page_alert/html/component.hbs +78 -32
  171. package/src/components/page_alert/js/manifest.json +77 -77
  172. package/src/components/pagination/css/component.scss +261 -250
  173. package/src/components/pagination/html/component.hbs +79 -38
  174. package/src/components/pagination/html/default.html +31 -22
  175. package/src/components/pagination/js/manifest.json +51 -51
  176. package/src/components/prefooter/css/component.scss +52 -45
  177. package/src/components/prefooter/html/component.hbs +97 -90
  178. package/src/components/prefooter/js/manifest.json +7 -7
  179. package/src/components/promo_panel/css/component.scss +810 -754
  180. package/src/components/promo_panel/html/component.hbs +173 -101
  181. package/src/components/promo_panel/js/global.js +23 -20
  182. package/src/components/promo_panel/js/manifest.json +223 -223
  183. package/src/components/search_box/css/component.scss +80 -79
  184. package/src/components/search_box/html/component.html +24 -12
  185. package/src/components/search_box/js/manifest.json +72 -72
  186. package/src/components/tab/css/component.scss +924 -814
  187. package/src/components/tab/html/component.hbs +576 -153
  188. package/src/components/tab/js/global.js +203 -297
  189. package/src/components/tab/js/manifest.json +917 -892
  190. package/src/components/toggle_tip/css/component.scss +3 -3
  191. package/src/components/toggle_tip/js/global.js +136 -137
  192. package/src/components/tool_tip/css/component.scss +3 -3
  193. package/src/components/tool_tip/js/global.js +95 -98
  194. package/src/components/video_player/css/component.scss +204 -211
  195. package/src/components/video_player/html/component.hbs +250 -138
  196. package/src/components/video_player/js/global.js +31 -14
  197. package/src/components/video_player/js/manifest.json +207 -207
  198. package/src/data/current.json +385 -433
  199. package/src/data/current_admin.json +13 -13
  200. package/src/data/model_component.js +13 -13
  201. package/src/data/site.json +967 -967
  202. package/src/helpers/Handlebars/appendIf.js +5 -5
  203. package/src/helpers/Handlebars/arrayLength.js +2 -2
  204. package/src/helpers/Handlebars/arrayWith.js +9 -11
  205. package/src/helpers/Handlebars/capitaliseFirst.js +8 -8
  206. package/src/helpers/Handlebars/charMax.js +6 -7
  207. package/src/helpers/Handlebars/checkIf.js +38 -18
  208. package/src/helpers/Handlebars/columnWidth.js +32 -35
  209. package/src/helpers/Handlebars/contains.js +4 -4
  210. package/src/helpers/Handlebars/createMap.js +15 -15
  211. package/src/helpers/Handlebars/dsMapFromID.js +8 -8
  212. package/src/helpers/Handlebars/dsMapFromProp.js +8 -8
  213. package/src/helpers/Handlebars/eachByName.js +19 -15
  214. package/src/helpers/Handlebars/eachDS.js +7 -7
  215. package/src/helpers/Handlebars/eachFrom.js +12 -12
  216. package/src/helpers/Handlebars/eachUpTo.js +7 -7
  217. package/src/helpers/Handlebars/eachWhen.js +30 -29
  218. package/src/helpers/Handlebars/formatDate.js +53 -53
  219. package/src/helpers/Handlebars/generateDates.js +75 -61
  220. package/src/helpers/Handlebars/getDistance.js +33 -32
  221. package/src/helpers/Handlebars/getObject.js +2 -2
  222. package/src/helpers/Handlebars/getParamaterByName.js +11 -11
  223. package/src/helpers/Handlebars/getPossibleValues.js +11 -11
  224. package/src/helpers/Handlebars/getProp.js +2 -2
  225. package/src/helpers/Handlebars/getTags.js +15 -16
  226. package/src/helpers/Handlebars/getThumbnailAlt.js +6 -4
  227. package/src/helpers/Handlebars/getTitle.js +3 -3
  228. package/src/helpers/Handlebars/iconSwitch.js +17 -0
  229. package/src/helpers/Handlebars/ifAny.js +6 -6
  230. package/src/helpers/Handlebars/ifArray.js +2 -2
  231. package/src/helpers/Handlebars/ifCond.js +30 -29
  232. package/src/helpers/Handlebars/ifEqualsOrChained.js +10 -10
  233. package/src/helpers/Handlebars/ifProp.js +2 -2
  234. package/src/helpers/Handlebars/if_eq.js +7 -7
  235. package/src/helpers/Handlebars/inArray.js +7 -7
  236. package/src/helpers/Handlebars/isPage.js +12 -7
  237. package/src/helpers/Handlebars/itemAt.js +8 -8
  238. package/src/helpers/Handlebars/jsonParse.js +7 -8
  239. package/src/helpers/Handlebars/jsonStringify.js +3 -3
  240. package/src/helpers/Handlebars/listAZ.js +74 -50
  241. package/src/helpers/Handlebars/listAZOptions.js +36 -29
  242. package/src/helpers/Handlebars/listByClosest.js +59 -53
  243. package/src/helpers/Handlebars/listByClosestWithOffset.js +58 -52
  244. package/src/helpers/Handlebars/math.js +11 -11
  245. package/src/helpers/Handlebars/newLineToBreak.js +3 -4
  246. package/src/helpers/Handlebars/nonBreakingSpaces.js +5 -6
  247. package/src/helpers/Handlebars/objectFromSelect.js +23 -16
  248. package/src/helpers/Handlebars/partialReplace.js +5 -6
  249. package/src/helpers/Handlebars/printAccordion.js +20 -20
  250. package/src/helpers/Handlebars/renderEncoded.js +14 -6
  251. package/src/helpers/Handlebars/renderSpecialChar.js +13 -11
  252. package/src/helpers/Handlebars/replace.js +5 -6
  253. package/src/helpers/Handlebars/replaceMany.js +3 -3
  254. package/src/helpers/Handlebars/sizeFormat.js +3 -3
  255. package/src/helpers/Handlebars/split.js +5 -6
  256. package/src/helpers/Handlebars/toUpperCase.js +4 -4
  257. package/src/helpers/Handlebars/urldecode.js +1 -1
  258. package/src/helpers/Handlebars/urlencode.js +1 -1
  259. package/src/helpers/Handlebars/withinObject.js +4 -4
  260. package/src/helpers/global-helpers.js +74 -48
  261. package/src/stories/AZListing/a-z_listing.stories.js +53 -53
  262. package/src/stories/Abstract/abstract.stories.js +48 -47
  263. package/src/stories/Accordion/accordion.stories.js +191 -0
  264. package/src/stories/BackToTop/BackToTop.stories.js +6 -6
  265. package/src/stories/Banner/banner.stories.js +68 -53
  266. package/src/stories/Banner/bannerAdvanced.stories.js +255 -190
  267. package/src/stories/Banner/bannerBasic.stories.js +105 -80
  268. package/src/stories/BasicSearch/BasicSearch.stories.js +160 -0
  269. package/src/stories/BlockQuote/BlockQuote.stories.js +72 -0
  270. package/src/stories/Body/body.stories.js +73 -66
  271. package/src/stories/Breadcrumbs/Breadcrumbs.stories.js +116 -93
  272. package/src/stories/Button/Button.stories.js +54 -45
  273. package/src/stories/CTALink/CTALink.stories.js +113 -159
  274. package/src/stories/Callout/Callout.stories.js +144 -110
  275. package/src/stories/Cards/CardFeature.stories.js +190 -120
  276. package/src/stories/Cards/CardMultiAction.stories.js +280 -152
  277. package/src/stories/Cards/CardNoAction.stories.js +262 -144
  278. package/src/stories/Cards/CardSingleAction.stories.js +245 -140
  279. package/src/stories/Code/Code.stories.js +239 -0
  280. package/src/stories/Colours/Colours.stories.js +98 -0
  281. package/src/stories/Colours/colours.js +135 -0
  282. package/src/stories/DirectionLinks/DirectionLinks.js +1 -1
  283. package/src/stories/DirectionLinks/DirectionLinks.stories.js +51 -44
  284. package/src/stories/Footer/Footer.stories.js +181 -159
  285. package/src/stories/Forms/Checkboxes/Checkboxes.js +41 -26
  286. package/src/stories/Forms/Checkboxes/Checkboxes.stories.js +245 -123
  287. package/src/stories/Forms/FileUpload/FileUpload.stories.js +214 -0
  288. package/src/stories/Forms/RadioButtons/RadioButtons.js +41 -26
  289. package/src/stories/Forms/RadioButtons/RadioButtons.stories.js +245 -123
  290. package/src/stories/Forms/SelectBox/SelectBox.js +45 -29
  291. package/src/stories/Forms/SelectBox/SelectBox.stories.js +253 -139
  292. package/src/stories/Forms/forms.stories.js +195 -158
  293. package/src/stories/Forms/numberInput.stories.js +55 -53
  294. package/src/stories/Forms/textInput.stories.js +135 -109
  295. package/src/stories/Forms/textarea.stories.js +136 -109
  296. package/src/stories/GlobalAlert/GlobalAlert.stories.js +115 -106
  297. package/src/stories/GlobalNavigation/LeftHandNavigation/LeftHandNavigation.stories.js +206 -0
  298. package/src/stories/GlobalNavigation/MegaMainNavigation/mega_main_navigation.a11y.stories.js +154 -0
  299. package/src/stories/GlobalNavigation/MegaMainNavigation/mega_main_navigation.stories.js +428 -0
  300. package/src/stories/Header/Header.js +83 -67
  301. package/src/stories/Header/Header.stories.js +389 -377
  302. package/src/stories/Horizontal/Horizontal.stories.js +185 -0
  303. package/src/stories/Iconography/Iconography.js +1 -1
  304. package/src/stories/Iconography/Iconography.stories.js +90 -74
  305. package/src/stories/Image/Image.stories.js +102 -0
  306. package/src/stories/InPageAlert/InPageAlert.stories.js +73 -65
  307. package/src/stories/Link/Link.stories.js +136 -0
  308. package/src/stories/LinkColumns/LinkColumns.js +21 -13
  309. package/src/stories/LinkColumns/LinkColumns.stories.js +97 -87
  310. package/src/stories/LoadingSpinner/LoadingSpinner.stories.js +47 -44
  311. package/src/stories/MultiColumn/MultiColumn.stories.js +320 -0
  312. package/src/stories/Navigation/InPageNavigation/InPageNavigation.stories.js +212 -0
  313. package/src/stories/Navigation/InternalNavigation/InternalNavigation.stories.js +158 -0
  314. package/src/stories/Pagination/Pagination.stories.js +195 -195
  315. package/src/stories/Prefooter/Prefooter.stories.js +107 -0
  316. package/src/stories/PromoPanel/PromoPanel.stories.js +193 -144
  317. package/src/stories/SearchInput/SearchInput.stories.js +176 -0
  318. package/src/stories/SkipLinks/SkipLinks.stories.js +106 -0
  319. package/src/stories/Table/table.stories.js +68 -50
  320. package/src/stories/Tabs/Tabs.stories.js +319 -0
  321. package/src/stories/Tags/Tags.js +24 -22
  322. package/src/stories/Tags/Tags.stories.js +83 -73
  323. package/src/stories/ToggleTip/ToggleTip.a11y.stories.js +130 -0
  324. package/src/stories/ToggleTip/ToggleTip.stories.js +213 -0
  325. package/src/stories/ToolTip/ToolTip.a11y.stories.js +85 -0
  326. package/src/stories/ToolTip/ToolTip.stories.js +187 -0
  327. package/src/stories/Typography/Typography.stories.js +218 -0
  328. package/src/stories/Typography/typography.js +94 -0
  329. package/src/stories/VideoPlayer/VideoPlayer.stories.js +246 -131
  330. package/src/styles/banner_contained/globals.scss +228 -232
  331. package/src/styles/core-styles.scss +32 -32
  332. package/src/styles/imports/cssbackup.css +498 -577
  333. package/src/styles/imports/functions.scss +348 -343
  334. package/src/styles/imports/mixins.scss +639 -565
  335. package/src/styles/imports/placeholders.scss +41 -39
  336. package/src/styles/imports/utilities.scss +376 -374
  337. package/src/styles/imports/variables.scss +178 -134
  338. package/src/styles/postcss.config.js +1 -2
  339. package/thankyou.md +26 -0
  340. package/vitest.config.js +34 -0
  341. package/.storybook/assets/accordion-js.js +0 -344
  342. package/.storybook/assets/animate-js.js +0 -247
  343. package/.storybook/assets/breadcrumbs-js.js +0 -216
  344. package/.storybook/assets/index.js +0 -23
  345. package/src/components/_global/js/toggle_and_tool_tip/global.js +0 -319
  346. package/src/html/component-accordion.html +0 -583
  347. package/src/html/component-basic_search.html +0 -42
  348. package/src/html/component-code.html +0 -57
  349. package/src/html/component-file_upload.html +0 -57
  350. package/src/html/component-mega_main_navigation.html +0 -583
  351. package/src/html/component-tab.html +0 -57
  352. package/src/html/component-toggle_tip.html +0 -569
  353. package/src/html/component-tool_tip.html +0 -294
  354. package/src/stories/CTALink/CTALink.js +0 -5
  355. package/src/stories/InPageNavigation/InPageNavigation.stories.js +0 -89
  356. package/src/stories/MegaMainNavigation/mega_main_navigation.a11y.stories.js +0 -138
  357. package/src/stories/MegaMainNavigation/mega_main_navigation.stories.js +0 -245
  358. package/src/stories/Navbar/Navbar.js +0 -117
  359. package/src/stories/Navbar/Navbar.stories.js +0 -80
@@ -1,18 +1,18 @@
1
1
  import { storyParams } from "../../../.storybook/globals";
2
2
 
3
3
  export default {
4
- title: "3. Components/Back to Top",
5
- render: ({ text }) => `
4
+ title: "3. Components/Back to Top",
5
+ render: ({ text }) => `
6
6
  <div class="qld__widgets__back_to_top">
7
7
  <a href="#content" class="qld__direction-link qld__direction-link--up" aria-label="Back to top">
8
8
  ${text}
9
9
  </a>
10
10
  </div>
11
11
  `,
12
- args: {
13
- text: "Back to top",
14
- },
15
- parameters: storyParams("backToTop"),
12
+ args: {
13
+ text: "Back to top",
14
+ },
15
+ parameters: storyParams("backToTop"),
16
16
  };
17
17
 
18
18
  export const Default = {};
@@ -2,69 +2,84 @@ import Template from "../../components/banner/html/component.hbs";
2
2
  import { storyParams } from "../../../.storybook/globals";
3
3
 
4
4
  const mockLineage = [
5
- { asset_url: "#", asset_short_name: "Home", asset_type_code: "page", asset_is_site_asset: "1" },
6
- { asset_url: "#", asset_short_name: "Section", asset_type_code: "page", asset_is_site_asset: "0" },
7
- { asset_url: "#", asset_short_name: "Current page", asset_type_code: "page", asset_is_site_asset: "0" },
5
+ {
6
+ asset_url: "#",
7
+ asset_short_name: "Home",
8
+ asset_type_code: "page",
9
+ asset_is_site_asset: "1",
10
+ },
11
+ {
12
+ asset_url: "#",
13
+ asset_short_name: "Section",
14
+ asset_type_code: "page",
15
+ asset_is_site_asset: "0",
16
+ },
17
+ {
18
+ asset_url: "#",
19
+ asset_short_name: "Current page",
20
+ asset_type_code: "page",
21
+ asset_is_site_asset: "0",
22
+ },
8
23
  ];
9
24
 
10
25
  function render(args) {
11
- const { pageTitle, bannerColour, showBreadcrumbs } = args;
12
- return Template({
13
- site: {
14
- metadata: {
15
- ...args.site.metadata,
16
- defaultBannerColour: { value: bannerColour },
17
- },
18
- },
19
- current: {
20
- data: {
21
- name: pageTitle,
22
- metadata: {
23
- displayBreadcrumbs: { value: showBreadcrumbs ? "true" : "false" },
24
- },
25
- },
26
- lineage: showBreadcrumbs ? mockLineage : [],
27
- },
26
+ const { pageTitle, bannerColour, showBreadcrumbs } = args;
27
+ return Template({
28
+ site: {
29
+ metadata: {
30
+ ...args.site.metadata,
31
+ defaultBannerColour: { value: bannerColour },
32
+ },
33
+ },
34
+ current: {
35
+ data: {
36
+ name: pageTitle,
28
37
  metadata: {
29
- breadcrumbs_display: { value: showBreadcrumbs ? "yes" : "" },
30
- background_colour: { value: bannerColour },
38
+ displayBreadcrumbs: { value: showBreadcrumbs ? "true" : "false" },
31
39
  },
32
- });
40
+ },
41
+ lineage: showBreadcrumbs ? mockLineage : [],
42
+ },
43
+ metadata: {
44
+ breadcrumbs_display: { value: showBreadcrumbs ? "yes" : "" },
45
+ background_colour: { value: bannerColour },
46
+ },
47
+ });
33
48
  }
34
49
 
35
50
  const meta = {
36
- title: "3. Components/Banner",
37
- render,
38
- argTypes: {
39
- pageTitle: {
40
- description: "The page title displayed in the banner.",
41
- control: { type: "text" },
42
- },
43
- bannerColour: {
44
- description: "Background colour theme of the banner.",
45
- control: {
46
- type: "select",
47
- labels: {
48
- "": "White (default)",
49
- light: "Light",
50
- alternate: "Alternate",
51
- dark: "Dark",
52
- "dark-alternate": "Dark Alternate",
53
- },
54
- },
55
- options: ["", "light", "alternate", "dark", "dark-alternate"],
56
- },
57
- showBreadcrumbs: {
58
- description: "Display breadcrumb navigation in the banner.",
59
- control: { type: "boolean" },
51
+ title: "3. Components/Banner",
52
+ render,
53
+ argTypes: {
54
+ pageTitle: {
55
+ description: "The page title displayed in the banner.",
56
+ control: { type: "text" },
57
+ },
58
+ bannerColour: {
59
+ description: "Background colour theme of the banner.",
60
+ control: {
61
+ type: "select",
62
+ labels: {
63
+ "": "White (default)",
64
+ light: "Light",
65
+ alternate: "Alternate",
66
+ dark: "Dark",
67
+ "dark-alternate": "Dark Alternate",
60
68
  },
69
+ },
70
+ options: ["", "light", "alternate", "dark", "dark-alternate"],
61
71
  },
62
- args: {
63
- pageTitle: "Default Banner",
64
- bannerColour: "alternate",
65
- showBreadcrumbs: true,
72
+ showBreadcrumbs: {
73
+ description: "Display breadcrumb navigation in the banner.",
74
+ control: { type: "boolean" },
66
75
  },
67
- parameters: storyParams("banner"),
76
+ },
77
+ args: {
78
+ pageTitle: "Default Banner",
79
+ bannerColour: "alternate",
80
+ showBreadcrumbs: true,
81
+ },
82
+ parameters: storyParams("banner"),
68
83
  };
69
84
 
70
85
  export default meta;
@@ -72,5 +87,5 @@ export default meta;
72
87
  export const Default = {};
73
88
 
74
89
  export const WithoutBreadcrumbs = {
75
- args: { showBreadcrumbs: false },
90
+ args: { showBreadcrumbs: false },
76
91
  };
@@ -1,234 +1,299 @@
1
1
  import Template from "../../components/banner_advanced/html/component.hbs";
2
- import { storyParams } from "../../../.storybook/globals";
2
+ import { storyParams, iconSpritePath } from "../../../.storybook/globals";
3
+ import initBannerAdvanced from "../../components/banner_advanced/js/global";
4
+ import { initComponents } from "../../../.storybook/decorators";
3
5
  import ToowoombaImage from "../Cards/Toowoomba-web.jpeg";
4
6
 
5
7
  const mockLineage = [
6
- { asset_url: "#", asset_short_name: "Home", asset_type_code: "page", asset_is_site_asset: "1" },
7
- { asset_url: "#", asset_short_name: "Section", asset_type_code: "page", asset_is_site_asset: "0" },
8
- { asset_url: "#", asset_short_name: "Current page", asset_type_code: "page", asset_is_site_asset: "0" },
8
+ {
9
+ asset_url: "#",
10
+ asset_short_name: "Home",
11
+ asset_type_code: "page",
12
+ asset_is_site_asset: "1",
13
+ },
14
+ {
15
+ asset_url: "#",
16
+ asset_short_name: "Section",
17
+ asset_type_code: "page",
18
+ asset_is_site_asset: "0",
19
+ },
20
+ {
21
+ asset_url: "#",
22
+ asset_short_name: "Current page",
23
+ asset_type_code: "page",
24
+ asset_is_site_asset: "0",
25
+ },
9
26
  ];
10
27
 
11
28
  const mockSite = {
12
- metadata: {
13
- coreSiteIcons: { value: "/QLD-icons.svg" },
14
- defaultBannerTexture: { value: "" },
15
- defaultBannerTextureDark: { value: "" },
16
- },
29
+ metadata: {
30
+ coreSiteIcons: { value: iconSpritePath },
31
+ defaultBannerTexture: { value: "" },
32
+ defaultBannerTextureDark: { value: "" },
33
+ },
17
34
  };
18
35
 
19
36
  const mockChildren = [
20
- { assetid: "1", name: "Brand", metadata: { redirect_url: { value: "#" }, cardIcon: { value: "fal fa-question-circle" } } },
21
- { assetid: "2", name: "Content", metadata: { redirect_url: { value: "#" }, cardIcon: { value: "fal fa-stethoscope" } } },
22
- { assetid: "3", name: "Components", metadata: { redirect_url: { value: "#" }, cardIcon: { value: "fal fa-heart" } } },
37
+ {
38
+ assetid: "1",
39
+ name: "Brand",
40
+ metadata: {
41
+ redirect_url: { value: "#" },
42
+ cardIcon: { value: "cancel" },
43
+ },
44
+ },
45
+ {
46
+ assetid: "2",
47
+ name: "Content",
48
+ metadata: {
49
+ redirect_url: { value: "#" },
50
+ cardIcon: { value: "eda" },
51
+ },
52
+ },
53
+ {
54
+ assetid: "3",
55
+ name: "Components",
56
+ metadata: {
57
+ redirect_url: { value: "#" },
58
+ cardIcon: { value: "ent" },
59
+ },
60
+ },
61
+ {
62
+ assetid: "4",
63
+ name: "Contact us",
64
+ metadata: {
65
+ redirect_url: { value: "#" },
66
+ cardIcon: { value: "phone_enabled" },
67
+ },
68
+ },
23
69
  ];
24
70
 
25
71
  function buildData(args) {
26
- return {
27
- component: {
28
- data: {
29
- assetid: "123",
30
- background_image_alt: args.heroImageAlt,
31
- metadata: {
32
- id_field: { value: "" },
33
- heading_primary: { value: args.headingPrimary },
34
- heading_secondary: { value: args.headingSecondary },
35
- heading_background_display: { value: args.showHeadingBackground ? "yes" : "" },
36
- abstract: { value: args.abstract },
37
- breadcrumbs_display: { value: args.showBreadcrumbs ? "yes" : "" },
38
- background_colour: { value: args.backgroundColour },
39
- background_type: { value: args.backgroundType },
40
- background_image_sm: { value: args.backgroundType === "image" ? "/mysource_files/banner-background--mobile.png" : "" },
41
- background_image_lg: { value: args.backgroundType === "image" ? "/mysource_files/banner-background--desktop.png" : "" },
42
- background_image_alignment: { value: "center" },
43
- background_min_height: { value: "" },
44
- hero_image: { value: args.heroImage },
45
- hero_image_responsive_treatment: { value: args.heroImageTreatment },
46
- hero_image_padding: { value: "yes" },
47
- hero_image_alignment: { value: args.heroImageAlignment },
48
- cta_type: { value: args.ctaType },
49
- cta_button_primary_text: { value: args.ctaPrimaryText },
50
- cta_button_primary_link: { value: "#" },
51
- cta_button_secondary_text: { value: args.ctaSecondaryText },
52
- cta_button_secondary_link: { value: "#" },
53
- cta_link_list_card_background: { value: "" },
54
- cta_icon_tile_background: { value: args.ctaIconTileBackground },
55
- cta_icon_tiles_label: { value: args.ctaIconTilesLabel },
56
- root_node: { value: args.ctaType !== "buttons" ? "123" : "" },
57
- },
58
- },
59
- children: mockChildren,
60
- },
61
- current: {
62
- lineage: args.showBreadcrumbs ? mockLineage : [],
72
+ return {
73
+ component: {
74
+ data: {
75
+ assetid: "123",
76
+ background_image_alt: args.heroImageAlt,
77
+ metadata: {
78
+ id_field: { value: "" },
79
+ heading_primary: { value: args.headingPrimary },
80
+ heading_secondary: { value: args.headingSecondary },
81
+ heading_background_display: {
82
+ value: args.showHeadingBackground ? "yes" : "",
83
+ },
84
+ abstract: { value: args.abstract },
85
+ breadcrumbs_display: { value: args.showBreadcrumbs ? "yes" : "" },
86
+ background_colour: { value: args.backgroundColour },
87
+ background_type: { value: args.backgroundType },
88
+ background_image_sm: {
89
+ value:
90
+ args.backgroundType === "image"
91
+ ? "/mysource_files/banner-background--mobile.png"
92
+ : "",
93
+ },
94
+ background_image_lg: {
95
+ value:
96
+ args.backgroundType === "image"
97
+ ? "/mysource_files/banner-background--desktop.png"
98
+ : "",
99
+ },
100
+ background_image_alignment: { value: "center" },
101
+ background_min_height: { value: "" },
102
+ hero_image: { value: args.heroImage },
103
+ hero_image_responsive_treatment: { value: args.heroImageTreatment },
104
+ hero_image_padding: { value: "yes" },
105
+ hero_image_alignment: { value: args.heroImageAlignment },
106
+ cta_type: { value: args.ctaType },
107
+ cta_button_primary_text: { value: args.ctaPrimaryText },
108
+ cta_button_primary_link: { value: "#" },
109
+ cta_button_secondary_text: { value: args.ctaSecondaryText },
110
+ cta_button_secondary_link: { value: "#" },
111
+ cta_link_list_card_background: { value: "" },
112
+ cta_icon_tile_background: { value: args.ctaIconTileBackground },
113
+ cta_icon_tiles_label: { value: args.ctaIconTilesLabel },
114
+ root_node: { value: args.ctaType !== "buttons" ? "123" : "" },
63
115
  },
64
- site: mockSite,
65
- };
116
+ },
117
+ children: mockChildren,
118
+ },
119
+ current: {
120
+ lineage: args.showBreadcrumbs ? mockLineage : [],
121
+ },
122
+ site: mockSite,
123
+ };
66
124
  }
67
125
 
68
126
  function render(args) {
69
- const container = document.createElement("div");
70
- container.innerHTML = Template(buildData(args));
127
+ const container = document.createElement("div");
128
+ container.innerHTML = Template(buildData(args));
71
129
 
72
- // The template hardcodes a './?a=' hero image URL that won't resolve in
73
- // Storybook, so swap in the bundled image directly on the hero element.
74
- // (The '--background' image is the mobile background for image-type banners.)
75
- if (args.heroImage) {
76
- const hero = container.querySelector(".qld__banner__image:not(.qld__banner__image--background)");
77
- if (hero) {
78
- hero.style.backgroundImage = `url(${ToowoombaImage})`;
79
- }
130
+ // The template hardcodes a './?a=' hero image URL that won't resolve in
131
+ // Storybook, so swap in the bundled image directly on the hero element.
132
+ // (The '--background' image is the mobile background for image-type banners.)
133
+ if (args.heroImage) {
134
+ const hero = container.querySelector(
135
+ ".qld__banner__image:not(.qld__banner__image--background)",
136
+ );
137
+ if (hero) {
138
+ hero.style.backgroundImage = `url(${ToowoombaImage})`;
80
139
  }
140
+ }
81
141
 
82
- return container;
142
+ return container;
83
143
  }
84
144
 
85
145
  const meta = {
86
- title: "3. Components/Banner/Advanced",
87
- render,
88
- argTypes: {
89
- headingPrimary: {
90
- description: "Primary heading text.",
91
- control: { type: "text" },
92
- },
93
- headingSecondary: {
94
- description: "Secondary heading displayed alongside the primary when block background is enabled.",
95
- control: { type: "text" },
96
- },
97
- showHeadingBackground: {
98
- description: "Wraps the heading in a block background.",
99
- control: { type: "boolean" },
100
- },
101
- abstract: {
102
- description: "Short descriptive text displayed below the heading.",
103
- control: { type: "text" },
104
- },
105
- backgroundColour: {
106
- description: "Background colour theme.",
107
- control: {
108
- type: "select",
109
- labels: {
110
- "": "White (default)",
111
- light: "Light",
112
- alternate: "Alternate",
113
- dark: "Dark",
114
- "dark-alternate": "Dark Alternate",
115
- },
116
- },
117
- options: ["", "light", "alternate", "dark", "dark-alternate"],
118
- },
119
- backgroundType: {
120
- description: "How the background is filled.",
121
- control: { type: "radio" },
122
- options: ["colour", "texture", "image"],
123
- },
124
- showBreadcrumbs: {
125
- description: "Display breadcrumb navigation.",
126
- control: { type: "boolean" },
127
- },
128
- heroImage: {
129
- description: "URL of the hero image displayed alongside the content.",
130
- control: { type: "text" },
131
- },
132
- heroImageAlt: {
133
- description: "Alt text for the hero image.",
134
- control: { type: "text" },
135
- },
136
- heroImageTreatment: {
137
- description: "How the hero image responds at smaller breakpoints.",
138
- control: { type: "radio" },
139
- options: ["crop", "scale"],
140
- },
141
- heroImageAlignment: {
142
- description: "Aligns the hero image to the content grid or the full page edge.",
143
- control: { type: "radio" },
144
- options: ["grid", "page"],
145
- },
146
- ctaType: {
147
- description: "The type of call-to-action displayed below the abstract.",
148
- control: { type: "radio" },
149
- options: ["buttons", "link-list", "icon-tiles"],
150
- },
151
- ctaPrimaryText: {
152
- description: "Primary button label (buttons CTA only).",
153
- control: { type: "text" },
154
- },
155
- ctaSecondaryText: {
156
- description: "Secondary button label (buttons CTA only).",
157
- control: { type: "text" },
158
- },
159
- ctaIconTilesLabel: {
160
- description: "Accessible label for the icon tile nav (icon-tiles CTA only).",
161
- control: { type: "text" },
146
+ title: "3. Components/Banner/Advanced",
147
+ render,
148
+ decorators: [initComponents([initBannerAdvanced])],
149
+ argTypes: {
150
+ headingPrimary: {
151
+ description: "Primary heading text.",
152
+ control: { type: "text" },
153
+ },
154
+ headingSecondary: {
155
+ description:
156
+ "Secondary heading displayed alongside the primary when block background is enabled.",
157
+ control: { type: "text" },
158
+ },
159
+ showHeadingBackground: {
160
+ description: "Wraps the heading in a block background.",
161
+ control: { type: "boolean" },
162
+ },
163
+ abstract: {
164
+ description: "Short descriptive text displayed below the heading.",
165
+ control: { type: "text" },
166
+ },
167
+ backgroundColour: {
168
+ description: "Background colour theme.",
169
+ control: {
170
+ type: "select",
171
+ labels: {
172
+ "": "White (default)",
173
+ light: "Light",
174
+ alternate: "Alternate",
175
+ dark: "Dark",
176
+ "dark-alternate": "Dark Alternate",
162
177
  },
163
- ctaIconTileBackground: {
164
- description: "Background colour of the icon tiles (icon-tiles CTA only).",
165
- control: {
166
- type: "select",
167
- labels: {
168
- "": "White",
169
- alternate: "Alternate",
170
- dark: "Dark",
171
- "dark-alternate": "Dark Alternate",
172
- },
173
- },
174
- options: ["", "alternate", "dark", "dark-alternate"],
178
+ },
179
+ options: ["", "light", "alternate", "dark", "dark-alternate"],
180
+ },
181
+ backgroundType: {
182
+ description: "How the background is filled.",
183
+ control: { type: "radio" },
184
+ options: ["colour", "texture", "image"],
185
+ },
186
+ showBreadcrumbs: {
187
+ description: "Display breadcrumb navigation.",
188
+ control: { type: "boolean" },
189
+ },
190
+ heroImage: {
191
+ description: "URL of the hero image displayed alongside the content.",
192
+ control: { type: "text" },
193
+ },
194
+ heroImageAlt: {
195
+ description: "Alt text for the hero image.",
196
+ control: { type: "text" },
197
+ },
198
+ heroImageTreatment: {
199
+ description: "How the hero image responds at smaller breakpoints.",
200
+ control: { type: "radio" },
201
+ options: ["crop", "scale"],
202
+ },
203
+ heroImageAlignment: {
204
+ description:
205
+ "Aligns the hero image to the content grid or the full page edge.",
206
+ control: { type: "radio" },
207
+ options: ["grid", "page"],
208
+ },
209
+ ctaType: {
210
+ description: "The type of call-to-action displayed below the abstract.",
211
+ control: { type: "radio" },
212
+ options: ["buttons", "link-list", "icon-tiles"],
213
+ },
214
+ ctaPrimaryText: {
215
+ description: "Primary button label (buttons CTA only).",
216
+ control: { type: "text" },
217
+ },
218
+ ctaSecondaryText: {
219
+ description: "Secondary button label (buttons CTA only).",
220
+ control: { type: "text" },
221
+ },
222
+ ctaIconTilesLabel: {
223
+ description:
224
+ "Accessible label for the icon tile nav (icon-tiles CTA only).",
225
+ control: { type: "text" },
226
+ },
227
+ ctaIconTileBackground: {
228
+ description: "Background colour of the icon tiles (icon-tiles CTA only).",
229
+ control: {
230
+ type: "select",
231
+ labels: {
232
+ "": "White",
233
+ alternate: "Alternate",
234
+ dark: "Dark",
235
+ "dark-alternate": "Dark Alternate",
175
236
  },
237
+ },
238
+ options: ["", "alternate", "dark", "dark-alternate"],
176
239
  },
177
- args: {
178
- headingPrimary: "Banner Advanced",
179
- showHeadingBackground: true,
180
- abstract: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
181
- backgroundColour: "dark",
182
- backgroundType: "colour",
183
- showBreadcrumbs: false,
184
- heroImage: "https://placehold.co/782x520",
185
- heroImageAlt: "",
186
- heroImageTreatment: "crop",
187
- heroImageAlignment: "grid",
188
- ctaType: "buttons",
189
- ctaPrimaryText: "Primary action",
190
- ctaSecondaryText: "Secondary action",
191
- ctaIconTilesLabel: "Quick links",
192
- ctaIconTileBackground: "dark-alternate",
193
- },
194
- parameters: storyParams("banner"),
240
+ },
241
+ args: {
242
+ headingPrimary: "Banner Advanced",
243
+ showHeadingBackground: true,
244
+ abstract:
245
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
246
+ backgroundColour: "dark",
247
+ backgroundType: "colour",
248
+ showBreadcrumbs: false,
249
+ heroImage: "https://placehold.co/782x520",
250
+ heroImageAlt: "",
251
+ heroImageTreatment: "crop",
252
+ heroImageAlignment: "grid",
253
+ ctaType: "buttons",
254
+ ctaPrimaryText: "Primary action",
255
+ ctaSecondaryText: "Secondary action",
256
+ ctaIconTilesLabel: "Quick links",
257
+ ctaIconTileBackground: "dark-alternate",
258
+ },
259
+ parameters: storyParams("banner"),
195
260
  };
196
261
 
197
262
  export default meta;
198
263
 
199
264
  export const Default = {
200
- args: {
201
- showBreadcrumbs: true,
202
- }
265
+ args: {
266
+ showBreadcrumbs: true,
267
+ },
203
268
  };
204
269
 
205
270
  export const WithHeroImage = {
206
- args: {
207
- heroImage: "https://placehold.co/782x520",
208
- heroImageTreatment: "crop",
209
- heroImageAlignment: "grid",
210
- },
271
+ args: {
272
+ heroImage: "https://placehold.co/782x520",
273
+ heroImageTreatment: "crop",
274
+ heroImageAlignment: "grid",
275
+ },
211
276
  };
212
277
 
213
278
  export const WithHeroImageToPage = {
214
- args: {
215
- heroImage: "https://placehold.co/782x520",
216
- heroImageTreatment: "crop",
217
- heroImageAlignment: "page",
218
- },
279
+ args: {
280
+ heroImage: "https://placehold.co/782x520",
281
+ heroImageTreatment: "crop",
282
+ heroImageAlignment: "page",
283
+ },
219
284
  };
220
285
 
221
286
  export const WithLinkList = {
222
- args: {
223
- ctaType: "link-list",
224
- heroImage: "",
225
- },
287
+ args: {
288
+ ctaType: "link-list",
289
+ heroImage: "",
290
+ },
226
291
  };
227
292
 
228
293
  export const WithIconTiles = {
229
- args: {
230
- ctaType: "icon-tiles",
231
- ctaIconTilesLabel: "Services",
232
- heroImage: "",
233
- },
294
+ args: {
295
+ ctaType: "icon-tiles",
296
+ ctaIconTilesLabel: "Services",
297
+ heroImage: "",
298
+ },
234
299
  };