@qld-gov-au/qgds-bootstrap5 2.0.12 → 2.1.1

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 (121) hide show
  1. package/.esbuild/plugins/qgds-plugin-generate-icon-assets.js +31 -24
  2. package/.storybook/preview.js +15 -6
  3. package/dist/assets/components/bs5/button/button.hbs +1 -1
  4. package/dist/assets/components/bs5/callToAction/callToAction.hbs +3 -3
  5. package/dist/assets/components/bs5/dateinput/dateinput.hbs +21 -27
  6. package/dist/assets/components/bs5/footer/customLinks.hbs +1 -1
  7. package/dist/assets/components/bs5/footer/followLinks.hbs +1 -1
  8. package/dist/assets/components/bs5/globalAlert/globalAlert.hbs +8 -1
  9. package/dist/assets/components/bs5/head/head.hbs +1 -1
  10. package/dist/assets/components/bs5/inpageAlert/inpageAlert.hbs +10 -2
  11. package/dist/assets/components/bs5/pagination/pagination.hbs +7 -2
  12. package/dist/assets/components/bs5/promotionalPanel/promotionalPanel.hbs +1 -1
  13. package/dist/assets/components/bs5/searchInput/searchInput.hbs +11 -9
  14. package/dist/assets/css/qld.bootstrap.css +2 -2
  15. package/dist/assets/css/qld.bootstrap.css.map +3 -3
  16. package/dist/assets/css/qld.bootstrap.legacy.css +2 -2
  17. package/dist/assets/css/qld.bootstrap.legacy.css.map +3 -3
  18. package/dist/assets/img/icons-sprite.svg +24 -24
  19. package/dist/assets/js/handlebars.helpers.bundle.js +1 -1
  20. package/dist/assets/js/handlebars.init.min.js +80 -64
  21. package/dist/assets/js/handlebars.init.min.js.map +2 -2
  22. package/dist/assets/js/handlebars.partials.js +80 -64
  23. package/dist/assets/js/handlebars.partials.js.map +2 -2
  24. package/dist/assets/js/qld.bootstrap.min.js +6 -6
  25. package/dist/assets/js/qld.bootstrap.min.js.map +4 -4
  26. package/dist/assets/node/handlebars.init.min.js +28 -19
  27. package/dist/assets/node/handlebars.init.min.js.map +2 -2
  28. package/dist/components/bs5/button/button.hbs +1 -1
  29. package/dist/components/bs5/callToAction/callToAction.hbs +3 -3
  30. package/dist/components/bs5/dateinput/dateinput.hbs +21 -27
  31. package/dist/components/bs5/footer/customLinks.hbs +1 -1
  32. package/dist/components/bs5/footer/followLinks.hbs +1 -1
  33. package/dist/components/bs5/globalAlert/globalAlert.hbs +8 -1
  34. package/dist/components/bs5/head/head.hbs +1 -1
  35. package/dist/components/bs5/inpageAlert/inpageAlert.hbs +10 -2
  36. package/dist/components/bs5/pagination/pagination.hbs +7 -2
  37. package/dist/components/bs5/promotionalPanel/promotionalPanel.hbs +1 -1
  38. package/dist/components/bs5/searchInput/searchInput.hbs +11 -9
  39. package/dist/package.json +33 -32
  40. package/dist/sample-data/callToAction/callToAction.data.json +2 -1
  41. package/dist/sample-data/dateinput/dateinput.data.json +3 -1
  42. package/dist/sample-data/footer/footer.data.json +3 -0
  43. package/dist/sample-data/inpageAlert/inpageAlert.data.json +1 -1
  44. package/dist/sample-data/pagination/pagination.data.json +4 -4
  45. package/dist/sample-data/promotionalPanel/promotionalPanel.data.json +45 -47
  46. package/dist/sample-data/searchInput/searchInput.data.json +1 -0
  47. package/package.json +33 -32
  48. package/src/components/bs5/breadcrumbs/breadcrumbs.scss +4 -4
  49. package/src/components/bs5/button/Button.js +32 -6
  50. package/src/components/bs5/button/button.hbs +1 -1
  51. package/src/components/bs5/button/button.scss +1 -5
  52. package/src/components/bs5/button/button.stories.js +16 -4
  53. package/src/components/bs5/callToAction/callToAction.data.json +2 -1
  54. package/src/components/bs5/callToAction/callToAction.hbs +3 -3
  55. package/src/components/bs5/callToAction/callToAction.stories.js +2 -2
  56. package/src/components/bs5/card/card.scss +4 -2
  57. package/src/components/bs5/dateinput/Dateinput.js +1 -38
  58. package/src/components/bs5/dateinput/Dateinput.mdx +27 -0
  59. package/src/components/bs5/dateinput/Dateinput.stories.js +48 -4
  60. package/src/components/bs5/dateinput/dateinput.data.json +3 -1
  61. package/src/components/bs5/dateinput/dateinput.functions.js +91 -0
  62. package/src/components/bs5/dateinput/dateinput.hbs +21 -27
  63. package/src/components/bs5/footer/customLinks.hbs +1 -1
  64. package/src/components/bs5/footer/followLinks.hbs +1 -1
  65. package/src/components/bs5/footer/footer.data.json +3 -0
  66. package/src/components/bs5/formcheck/_form-variables.scss +36 -0
  67. package/src/components/bs5/formcheck/formcheck.scss +59 -14
  68. package/src/components/bs5/globalAlert/globalAlert.hbs +8 -1
  69. package/src/components/bs5/globalAlert/globalAlert.scss +14 -19
  70. package/src/components/bs5/globalAlert/globalAlert.stories.js +1 -0
  71. package/src/components/bs5/globalAlert/globalAlert.test.js +10 -5
  72. package/src/components/bs5/header/header.scss +1 -2
  73. package/src/components/bs5/icons/_icons.list.js +7 -7
  74. package/src/components/bs5/icons/_icons.list.scss +113 -112
  75. package/src/components/bs5/icons/_icons.variables.scss +7 -6
  76. package/src/components/bs5/icons/icons.scss +2 -1
  77. package/src/components/bs5/inpageAlert/inpageAlert.data.json +1 -1
  78. package/src/components/bs5/inpageAlert/inpageAlert.hbs +10 -2
  79. package/src/components/bs5/inpageAlert/inpageAlert.scss +52 -55
  80. package/src/components/bs5/inpageAlert/inpageAlert.stories.js +54 -3
  81. package/src/components/bs5/inpagenav/inpagenav.scss +9 -1
  82. package/src/components/bs5/modal/modal.scss +1 -1
  83. package/src/components/bs5/navbar/navbar.functions.js +39 -28
  84. package/src/components/bs5/navbar/navbar.scss +43 -28
  85. package/src/components/bs5/navbar/navbar.stories.js +4 -3
  86. package/src/components/bs5/pageLayout/PaletteShowcase.stories.js +4 -3
  87. package/src/components/bs5/pagination/pagination.data.json +4 -4
  88. package/src/components/bs5/pagination/pagination.hbs +7 -2
  89. package/src/components/bs5/pagination/pagination.scss +1 -1
  90. package/src/components/bs5/promotionalPanel/promotionalPanel.data.json +45 -47
  91. package/src/components/bs5/promotionalPanel/promotionalPanel.hbs +1 -1
  92. package/src/components/bs5/quickexit/quickexit.scss +1 -1
  93. package/src/components/bs5/searchInput/__snapshots__/searchInput.test.js.snap +16 -16
  94. package/src/components/bs5/searchInput/search.functions.js +70 -71
  95. package/src/components/bs5/searchInput/searchInput.data.json +1 -0
  96. package/src/components/bs5/searchInput/searchInput.hbs +11 -9
  97. package/src/components/bs5/searchInput/searchInput.scss +92 -38
  98. package/src/components/bs5/searchInput/searchInput.test.js +91 -119
  99. package/src/components/bs5/sidenav/sidenav.scss +17 -19
  100. package/src/components/bs5/skiplinks/skipLinks.scss +12 -4
  101. package/src/components/bs5/table/table.scss +93 -83
  102. package/src/components/common/focus-styles/focusStyles.mdx +20 -0
  103. package/src/components/common/focus-styles/focusStyles.stories.js +58 -0
  104. package/src/css/functions/_index.scss +3 -0
  105. package/src/css/functions/color-icon.scss +31 -0
  106. package/src/css/functions/string-replace.scss +49 -0
  107. package/src/css/functions/svg-encode.scss +22 -0
  108. package/src/css/main.scss +3 -0
  109. package/src/css/mixins/focusable.scss +1 -1
  110. package/src/css/mixins/make-icon.scss +1 -1
  111. package/src/css/mixins/make-link.scss +13 -10
  112. package/src/css/qld-palettes.scss +20 -12
  113. package/src/css/qld-reduced-motion.scss +51 -0
  114. package/src/css/qld-tokens.scss +3 -3
  115. package/src/css/qld-type.scss +11 -13
  116. package/src/css/qld-utilities.scss +9 -1
  117. package/src/css/qld-variables.scss +1 -1
  118. package/src/img/icons-sprite.svg +24 -24
  119. package/src/js/constants.js +10 -0
  120. package/src/js/qld.bootstrap.js +99 -151
  121. package/src/js/utils.js +3 -1
@@ -1,28 +1,4 @@
1
1
  <svg xmlns="http://www.w3.org/2000/svg" role="img">
2
- <symbol id="qgds-icon-spinner-step-1" viewBox="0 0 32 32">
3
- <path fill="currentColor" d="M29.988 8.231A16 16 0 1 1 16.928.027l-.17 2.93a13.064 13.064 0 1 0 10.663 6.7l2.567-1.426Z"></path>
4
- </symbol>
5
-
6
- <symbol id="qgds-icon-spinner-step-2" viewBox="0 0 32 32">
7
- <path fill="currentColor" d="M23.768 29.988a16 16 0 1 1 8.205-13.06l-2.93-.17a13.064 13.064 0 1 0-6.7 10.663l1.425 2.567Z"></path>
8
- </symbol>
9
-
10
- <symbol id="qgds-icon-spinner-step-3" viewBox="0 0 32 32">
11
- <path fill="currentColor" d="M2.013 23.768a16 16 0 1 1 13.059 8.205l.17-2.93a13.064 13.064 0 1 0-10.663-6.7l-2.566 1.425Z"></path>
12
- </symbol>
13
-
14
- <symbol id="qgds-icon-spinner-step-4" viewBox="0 0 32 32">
15
- <path fill="currentColor" d="M8.231 2.012a16 16 0 1 1-8.204 13.06l2.93.17a13.064 13.064 0 1 0 6.7-10.663L8.23 2.012Z"></path>
16
- </symbol>
17
-
18
- <symbol id="qgds-icon-x" viewBox="0 0 32 32">
19
- <path fill="currentColor" d="M22.21 6.25h3.282l-7.219 8.297 8.532 11.203h-6.657l-5.25-6.797-5.953 6.797H5.617l7.735-8.813L5.195 6.25h6.844l4.688 6.234L22.21 6.25Zm-1.17 17.531h1.827L11.055 8.125h-1.97L21.04 23.781Z"></path>
20
- </symbol>
21
-
22
- <symbol id="qgds-icon-youtube" viewBox="0 0 32 32">
23
- <path fill="currentColor" d="M28.258 9.86c.562 1.968.562 6.187.562 6.187s0 4.172-.562 6.187a3.127 3.127 0 0 1-2.25 2.25C23.992 25 16.023 25 16.023 25s-8.015 0-10.03-.516a3.127 3.127 0 0 1-2.25-2.25c-.563-2.015-.563-6.187-.563-6.187s0-4.219.562-6.188c.281-1.125 1.172-2.015 2.25-2.296C8.008 7 16.023 7 16.023 7s7.97 0 9.985.563c1.078.28 1.969 1.171 2.25 2.296Zm-14.86 9.984 6.657-3.797-6.657-3.797v7.594Z"></path>
24
- </symbol>
25
-
26
2
  <symbol id="qgds-icon-accessibility" viewBox="0 0 32 32">
27
3
  <path fill="currentColor" d="M15.933 7.738c-.793 0-1.457-.267-1.992-.802-.535-.535-.803-1.2-.803-1.992 0-.793.268-1.458.803-1.993.535-.535 1.2-.802 1.992-.802.793 0 1.457.267 1.993.802.535.535.802 1.2.802 1.993 0 .793-.267 1.457-.802 1.992-.535.535-1.2.802-1.993.802ZM11.805 28.1V12.215a53.57 53.57 0 0 1-3.343-.396 43.696 43.696 0 0 1-3.262-.616 1.505 1.505 0 0 1-.978-.663 1.48 1.48 0 0 1-.212-1.148 1.24 1.24 0 0 1 .7-.918 1.77 1.77 0 0 1 1.198-.138c1.608.342 3.263.596 4.963.763a51.862 51.862 0 0 0 10.175 0 46.103 46.103 0 0 0 5.046-.763 1.767 1.767 0 0 1 1.198.138c.38.187.614.493.7.918.085.417.015.8-.212 1.148a1.506 1.506 0 0 1-.978.663c-1.067.244-2.154.45-3.262.616a53.564 53.564 0 0 1-3.343.396V28.1c0 .395-.14.732-.42 1.013-.281.28-.619.42-1.013.42a1.38 1.38 0 0 1-1.013-.42 1.38 1.38 0 0 1-.42-1.013v-6.72h-2.657v6.72c0 .395-.14.732-.42 1.013-.281.28-.619.42-1.014.42a1.38 1.38 0 0 1-1.012-.42 1.38 1.38 0 0 1-.42-1.013Z"></path>
28
4
  </symbol>
@@ -400,6 +376,22 @@
400
376
  <path fill="currentColor" d="M7.842 23.526 4.82 26.548c-.337.337-.724.414-1.162.231-.439-.182-.658-.512-.658-.988V5.141c0-.589.21-1.092.63-1.512A2.056 2.056 0 0 1 5.14 3h21.72c.588 0 1.091.21 1.51.63.42.419.63.922.63 1.51v16.246a2.06 2.06 0 0 1-.63 1.511c-.419.42-.922.63-1.51.63H7.842Zm-.744-1.72H26.86a.403.403 0 0 0 .29-.13.403.403 0 0 0 .13-.29V5.14a.403.403 0 0 0-.13-.29.403.403 0 0 0-.29-.13H5.14a.403.403 0 0 0-.29.13.403.403 0 0 0-.13.29v19.14l2.378-2.473Zm3.197-7.383c.335 0 .62-.118.856-.354s.354-.522.354-.857c0-.335-.118-.62-.354-.856a1.167 1.167 0 0 0-.856-.354c-.341 0-.628.118-.861.354-.233.236-.35.521-.35.856 0 .335.117.62.35.857.233.236.52.354.86.354Zm5.756 0c.335 0 .62-.118.857-.354a1.17 1.17 0 0 0 .353-.857c0-.335-.118-.62-.353-.856a1.167 1.167 0 0 0-.857-.354c-.335 0-.62.118-.857.354a1.167 1.167 0 0 0-.354.856c0 .335.118.62.354.857.236.236.522.354.857.354Zm5.64 0c.335 0 .62-.118.857-.354.236-.236.354-.522.354-.857 0-.335-.118-.62-.354-.856a1.167 1.167 0 0 0-.857-.354c-.335 0-.62.118-.856.354a1.167 1.167 0 0 0-.354.856c0 .335.118.62.354.857.236.236.521.354.856.354Z"></path>
401
377
  </symbol>
402
378
 
379
+ <symbol id="qgds-icon-spinner-step-1" viewBox="0 0 32 32">
380
+ <path fill="currentColor" d="M29.988 8.231A16 16 0 1 1 16.928.027l-.17 2.93a13.064 13.064 0 1 0 10.663 6.7l2.567-1.426Z"></path>
381
+ </symbol>
382
+
383
+ <symbol id="qgds-icon-spinner-step-2" viewBox="0 0 32 32">
384
+ <path fill="currentColor" d="M23.768 29.988a16 16 0 1 1 8.205-13.06l-2.93-.17a13.064 13.064 0 1 0-6.7 10.663l1.425 2.567Z"></path>
385
+ </symbol>
386
+
387
+ <symbol id="qgds-icon-spinner-step-3" viewBox="0 0 32 32">
388
+ <path fill="currentColor" d="M2.013 23.768a16 16 0 1 1 13.059 8.205l.17-2.93a13.064 13.064 0 1 0-10.663-6.7l-2.566 1.425Z"></path>
389
+ </symbol>
390
+
391
+ <symbol id="qgds-icon-spinner-step-4" viewBox="0 0 32 32">
392
+ <path fill="currentColor" d="M8.231 2.012a16 16 0 1 1-8.204 13.06l2.93.17a13.064 13.064 0 1 0 6.7-10.663L8.23 2.012Z"></path>
393
+ </symbol>
394
+
403
395
  <symbol id="qgds-icon-spreadsheet" viewBox="0 0 32 32">
404
396
  <path fill="currentColor" d="M4 25.347V6.63c0-.72.258-1.338.774-1.854A2.557 2.557 0 0 1 6.653 4H25.37c.72 0 1.338.258 1.854.775A2.53 2.53 0 0 1 28 6.629v18.706c0 .714-.258 1.336-.775 1.868-.516.531-1.134.797-1.854.797H6.653a2.558 2.558 0 0 1-1.879-.774A2.558 2.558 0 0 1 4 25.347Zm1.8-14.644h20.4V6.665a.842.842 0 0 0-.243-.622.842.842 0 0 0-.622-.244H6.665a.842.842 0 0 0-.622.244.842.842 0 0 0-.244.622v4.038Zm7.383 7.749h5.634v-5.95h-5.634v5.95Zm0 7.749h5.634v-5.95h-5.634v5.95Zm-7.384-7.75h5.62v-5.949h-5.62v5.95Zm14.806 0H26.2v-5.949h-5.596v5.95Zm-13.94 7.75h4.754v-5.95h-5.62v5.084c0 .253.081.46.244.622a.84.84 0 0 0 .622.244Zm13.94 0h4.73c.253 0 .46-.081.622-.244a.842.842 0 0 0 .244-.622v-5.084h-5.596v5.95Z"></path>
405
397
  </symbol>
@@ -472,6 +464,14 @@
472
464
  <path fill="currentColor" d="M11.627 29.59c-1.837 0-3.401-.652-4.692-1.956C5.645 26.33 5 24.759 5 22.922c0-1.594.512-3.002 1.536-4.226a6.506 6.506 0 0 1 3.882-2.282c.292-.068.562-.02.81.142.25.162.408.39.476.682a.986.986 0 0 1-.14.804c-.164.244-.391.4-.683.468a4.345 4.345 0 0 0-2.668 1.525 4.349 4.349 0 0 0-1.05 2.887c0 1.238.436 2.294 1.31 3.167.873.874 1.934 1.31 3.182 1.31 1.05 0 1.98-.323 2.79-.97a4.438 4.438 0 0 0 1.585-2.473c.092-.292.26-.517.504-.675a.907.907 0 0 1 .805-.099c.292.093.517.263.675.512.158.248.19.519.098.81a6.503 6.503 0 0 1-2.37 3.664 6.503 6.503 0 0 1-4.115 1.422ZM22.135 8.185a2.5 2.5 0 0 1-1.835-.757 2.5 2.5 0 0 1-.757-1.836 2.5 2.5 0 0 1 .757-1.835A2.5 2.5 0 0 1 22.135 3c.72 0 1.329.252 1.829.757s.75 1.116.75 1.835c0 .72-.25 1.331-.75 1.836a2.48 2.48 0 0 1-1.829.757Zm-6.322 13.35c-1.01 0-1.798-.434-2.36-1.303-.563-.869-.633-1.773-.21-2.712l2.806-6.188h-3.46l-.577 1.508a1.046 1.046 0 0 1-.525.581.963.963 0 0 1-.789.062 1.063 1.063 0 0 1-.659-.558.998.998 0 0 1-.029-.867l.558-1.505c.188-.488.482-.86.883-1.114a2.5 2.5 0 0 1 1.368-.38h6.54c.962 0 1.692.373 2.192 1.12.5.749.548 1.578.143 2.49l-2.78 6.08h4.885c.691 0 1.28.245 1.766.736.486.49.73 1.082.73 1.773v5.809c0 .307-.104.564-.311.77-.207.208-.464.311-.771.311s-.564-.103-.771-.31a1.046 1.046 0 0 1-.31-.771V21.84a.314.314 0 0 0-.077-.221c-.05-.056-.127-.084-.228-.084h-8.014Z"></path>
473
465
  </symbol>
474
466
 
467
+ <symbol id="qgds-icon-x" viewBox="0 0 32 32">
468
+ <path fill="currentColor" d="M22.21 6.25h3.282l-7.219 8.297 8.532 11.203h-6.657l-5.25-6.797-5.953 6.797H5.617l7.735-8.813L5.195 6.25h6.844l4.688 6.234L22.21 6.25Zm-1.17 17.531h1.827L11.055 8.125h-1.97L21.04 23.781Z"></path>
469
+ </symbol>
470
+
471
+ <symbol id="qgds-icon-youtube" viewBox="0 0 32 32">
472
+ <path fill="currentColor" d="M28.258 9.86c.562 1.968.562 6.187.562 6.187s0 4.172-.562 6.187a3.127 3.127 0 0 1-2.25 2.25C23.992 25 16.023 25 16.023 25s-8.015 0-10.03-.516a3.127 3.127 0 0 1-2.25-2.25c-.563-2.015-.563-6.187-.563-6.187s0-4.219.562-6.188c.281-1.125 1.172-2.015 2.25-2.296C8.008 7 16.023 7 16.023 7s7.97 0 9.985.563c1.078.28 1.969 1.171 2.25 2.296Zm-14.86 9.984 6.657-3.797-6.657-3.797v7.594Z"></path>
473
+ </symbol>
474
+
475
475
  <symbol id="qgds-icon-zoom" viewBox="0 0 32 32">
476
476
  <path fill="currentColor" d="M11 13.05H8.78c-.295 0-.541-.1-.74-.3-.2-.2-.299-.448-.299-.744s.1-.542.299-.739c.199-.196.445-.295.74-.295H11V8.781c0-.295.1-.541.3-.74.2-.2.449-.299.745-.299s.542.1.739.299c.196.199.295.445.295.74v2.191h2.19c.295 0 .542.1.741.3.2.2.299.449.299.745s-.1.543-.299.74a1.013 1.013 0 0 1-.74.294h-2.191v2.219c0 .294-.1.541-.3.74-.201.2-.45.299-.745.299A1.013 1.013 0 0 1 11 15.269v-2.218Zm1.073 9.018c-2.815 0-5.198-.975-7.148-2.924C2.975 17.195 2 14.826 2 12.037c0-2.79.974-5.16 2.924-7.111C6.873 2.976 9.244 2 12.037 2c2.794 0 5.166.975 7.116 2.924 1.95 1.95 2.926 4.32 2.926 7.11a9.823 9.823 0 0 1-.596 3.385 9.62 9.62 0 0 1-1.676 2.924l9.889 9.845c.199.19.301.438.307.74.005.302-.097.556-.307.763-.21.206-.464.309-.76.309a.996.996 0 0 1-.748-.315l-9.862-9.861a8.99 8.99 0 0 1-2.87 1.657 9.935 9.935 0 0 1-3.383.587Zm-.017-2.079c2.217 0 4.096-.771 5.635-2.314C19.23 16.13 20 14.25 20 12.034c0-2.218-.77-4.098-2.31-5.64-1.538-1.544-3.417-2.316-5.634-2.316-2.227 0-4.113.772-5.659 2.315-1.546 1.543-2.319 3.423-2.319 5.64 0 2.218.773 4.098 2.32 5.642 1.545 1.543 3.431 2.314 5.658 2.314Z"></path>
477
477
  </symbol>
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Media query breakpoints. These must be kept in sync with breakpoints defined in sass variables.
3
+ */
4
+ export const breakpoints = {
5
+ xs: 0,
6
+ sm: 400,
7
+ md: 700,
8
+ lg: 992,
9
+ xl: 1312,
10
+ };
@@ -9,6 +9,7 @@ import {
9
9
  } from "./../components/bs5/video/video.functions";
10
10
  import { initializeNavbar } from "./../components/bs5/navbar/navbar.functions";
11
11
  import { initBreadcrumb } from "./../components/bs5/breadcrumbs/breadcrumbs.functions";
12
+ import { initDateInput } from "../components/bs5/dateinput/dateinput.functions";
12
13
  import { initQuickexit } from "./../components/bs5/quickexit/quickexit.functions";
13
14
  //import { displayFeedbackForm } from "./../components/bs5/footer/footer.functions";
14
15
  import { toggleSearch } from "./../components/bs5/header/header.functions";
@@ -23,174 +24,121 @@ import { validateSkipLinks } from "./../components/bs5/skiplinks/skipLinks.funct
23
24
 
24
25
  window.addEventListener("click", initQuickexit, true);
25
26
  window.addEventListener("keydown", initQuickexit, true);
26
-
27
27
  window.addEventListener("DOMContentLoaded", () => {
28
- (() => {
29
- backToTop();
28
+ backToTop();
30
29
 
31
- initTabsScroll();
30
+ initTabsScroll();
32
31
 
33
- initGlobalAlerts();
32
+ initGlobalAlerts();
34
33
 
35
- // Footer FormIO Action
36
- // Note: This is added here, as there is an issue with breadcrumbShorten() function.
37
- // Will move this once that issue is fixed.
38
- /*
34
+ // Footer FormIO Action
35
+ // Note: This is added here, as there is an issue with breadcrumbShorten() function.
36
+ // Will move this once that issue is fixed.
37
+ /*
39
38
  const footerFormio = document.getElementById("qg-feedback-toggle");
40
39
  if (footerFormio) {
41
40
  displayFeedbackForm();
42
41
  }
43
42
  */
44
- //Header search
45
- let headerSearchButton = document.getElementById(
46
- "qld-header-toggle-search-button",
47
- );
48
- if (headerSearchButton) {
49
- headerSearchButton.addEventListener("click", toggleSearch);
50
- }
51
-
52
- // Get all forms with the class 'site-search'
53
- let forms = document.querySelectorAll(".site-search");
54
- forms.forEach((form) => {
55
- // Get the search input within the current form
56
- let searchInput = form.querySelector(".qld-search-input input");
57
-
58
- if (searchInput) {
59
- let timeout;
60
-
61
- // Add keyup event listener to the search input
62
- searchInput.addEventListener("input", function (e) {
63
- clearTimeout(timeout);
64
- timeout = setTimeout(() => {
65
- const value = e.target.value.trim();
66
- showSuggestions(value, value === "", form);
67
- }, 300);
68
- });
69
-
70
- // Add focus event listener to the search input
71
- searchInput.addEventListener("focus", function () {
72
- const suggestions = form.querySelector(".suggestions");
73
- const dynamicSuggestionsContainer = form.querySelector(
74
- ".dynamic-suggestions",
75
- );
76
-
77
- if (this.value.trim() === "") {
78
- showSuggestions("", true, form);
79
- } else if (
80
- suggestions &&
81
- dynamicSuggestionsContainer &&
82
- dynamicSuggestionsContainer.innerHTML.trim() !== ""
83
- ) {
84
- // Only show existing suggestions if there are actual dynamic suggestions populated
85
- suggestions.classList.remove("d-none");
86
- }
87
- });
88
-
89
- const suggestions = form.querySelector(".suggestions");
90
- // If there is no suggestions renderred, do not add event listener to the document
91
- if (suggestions) {
92
- // Helper function to determine if suggestions should be hidden on focus change
93
- const shouldHideSuggestions = (newFocusTarget) => {
94
- if (!newFocusTarget) return true;
95
-
96
- const isFocusInsideInput =
97
- searchInput.contains(newFocusTarget) ||
98
- searchInput === newFocusTarget;
99
- const isFocusInsideSuggestions =
100
- suggestions.contains(newFocusTarget);
101
-
102
- return !isFocusInsideInput && !isFocusInsideSuggestions;
103
- };
104
-
105
- // Handle focusout event for keyboard accessibility
106
- const handleFocusOut = (event) => {
107
- const newFocusTarget = event.relatedTarget;
108
-
109
- if (shouldHideSuggestions(newFocusTarget)) {
110
- suggestions.classList.add("d-none");
111
- }
112
- };
113
-
114
- // Attach focusout event listener to search input
115
- searchInput.addEventListener("focusout", handleFocusOut);
116
-
117
- // Attach focusout event listener to suggestions container
118
- suggestions.addEventListener("focusout", handleFocusOut);
119
- } else {
120
- console.warn("Required suggestions elements not found.");
121
- }
122
-
123
- // Attach event listener to form submit
124
- form.addEventListener("submit", function (event) {
125
- event.preventDefault();
126
- const query = searchInput.value.trim();
127
- submitSearchForm(query, form);
128
- });
129
- }
130
- });
131
-
132
- //Header
133
- // Get the <header> element
134
- let header = document.querySelector("header");
135
- if (header) {
136
- // Get the current page URL without query string parameters
137
- let url = window.location.origin + window.location.pathname;
138
- // Set the data-page-url attribute on the <header> element
139
- header.setAttribute("data-page-url", url);
140
- }
141
-
142
- // Navbar
143
- initializeNavbar();
144
-
145
- // Breadcrumb
146
- initBreadcrumb();
147
-
148
- // Quick exit
149
- window.addEventListener("click", initQuickexit, true);
150
- window.addEventListener("keydown", initQuickexit, true);
151
- initQuickexit();
152
-
153
- // Accordion
154
- let accordionToggleButton = document.querySelectorAll(
155
- ".accordion-toggle-btn",
156
- );
157
-
158
- accordionToggleButton.forEach(function (toggleButton) {
159
- toggleButton.addEventListener("click", accordionToggleAll);
160
-
161
- let accordionButtons = toggleButton
162
- .closest(".accordion-group")
163
- .querySelectorAll(".accordion-button");
43
+ //Header search
44
+ let headerSearchButton = document.getElementById(
45
+ "qld-header-toggle-search-button",
46
+ );
47
+ if (headerSearchButton) {
48
+ headerSearchButton.addEventListener("click", toggleSearch);
49
+ }
50
+
51
+ // Get all forms with the class 'site-search'
52
+ let forms = document.querySelectorAll(".site-search");
53
+
54
+ forms.forEach((form) => {
55
+ // Get the search input within the current form
56
+ let searchInput = form.querySelector(".qld-search-input input");
57
+
58
+ if (searchInput) {
59
+ let timeout;
60
+
61
+ // Add keyup event listener to the search input
62
+ searchInput.addEventListener("input", function (e) {
63
+ clearTimeout(timeout);
64
+ timeout = setTimeout(() => {
65
+ const value = e.target.value.trim();
66
+ showSuggestions(value, value === "", form);
67
+ }, 300);
68
+ });
164
69
 
165
- accordionButtons.forEach(function (button) {
166
- button.addEventListener("click", accordionToggleAllButtonState);
70
+ // Attach event listener to form submit
71
+ form.addEventListener("submit", function (event) {
72
+ event.preventDefault();
73
+ const query = searchInput.value.trim();
74
+ submitSearchForm(query, form);
167
75
  });
76
+ }
77
+ });
78
+
79
+ //Header
80
+ // Get the <header> element
81
+ let header = document.querySelector("header");
82
+ if (header) {
83
+ // Get the current page URL without query string parameters
84
+ let url = window.location.origin + window.location.pathname;
85
+ // Set the data-page-url attribute on the <header> element
86
+ header.setAttribute("data-page-url", url);
87
+ }
88
+
89
+ // Navbar
90
+ initializeNavbar();
91
+
92
+ // Breadcrumb
93
+ initBreadcrumb();
94
+
95
+ // Quick exit
96
+ window.addEventListener("click", initQuickexit, true);
97
+ window.addEventListener("keydown", initQuickexit, true);
98
+ initQuickexit();
99
+
100
+ // Accordion
101
+ let accordionToggleButton = document.querySelectorAll(
102
+ ".accordion-toggle-btn",
103
+ );
104
+
105
+ accordionToggleButton.forEach(function (toggleButton) {
106
+ toggleButton.addEventListener("click", accordionToggleAll);
107
+
108
+ let accordionButtons = toggleButton
109
+ .closest(".accordion-group")
110
+ .querySelectorAll(".accordion-button");
111
+
112
+ accordionButtons.forEach(function (button) {
113
+ button.addEventListener("click", accordionToggleAllButtonState);
168
114
  });
115
+ });
169
116
 
170
- let inPageLinks = document.querySelectorAll('a[href^="#"]');
117
+ let inPageLinks = document.querySelectorAll('a[href^="#"]');
171
118
 
172
- accordionHashLinks();
173
- window.onhashchange = accordionHashLinks;
174
- inPageLinks.forEach(function (link) {
175
- link.addEventListener("click", accordionHashLinks);
176
- });
119
+ accordionHashLinks();
120
+ window.onhashchange = accordionHashLinks;
121
+ inPageLinks.forEach(function (link) {
122
+ link.addEventListener("click", accordionHashLinks);
123
+ });
177
124
 
178
- // Video
179
- let videoThumbnails = document.querySelectorAll(".video-thumbnail");
125
+ // Video
126
+ let videoThumbnails = document.querySelectorAll(".video-thumbnail");
180
127
 
181
- videoThumbnails.forEach(function (thumbnail) {
182
- thumbnail.addEventListener("click", videoEmbedPlay);
183
- });
128
+ videoThumbnails.forEach(function (thumbnail) {
129
+ thumbnail.addEventListener("click", videoEmbedPlay);
130
+ });
184
131
 
185
- let videoTranscripts = document.querySelectorAll(
186
- ".video .accordion .accordion-button",
187
- );
132
+ let videoTranscripts = document.querySelectorAll(
133
+ ".video .accordion .accordion-button",
134
+ );
188
135
 
189
- videoTranscripts.forEach(function (transcript) {
190
- transcript.addEventListener("click", videoTranscriptTitle);
191
- });
136
+ videoTranscripts.forEach(function (transcript) {
137
+ transcript.addEventListener("click", videoTranscriptTitle);
138
+ });
139
+
140
+ initDateInput();
192
141
 
193
- // Skip Links
194
- validateSkipLinks();
195
- })();
142
+ // Skip Links
143
+ validateSkipLinks();
196
144
  });
package/src/js/utils.js CHANGED
@@ -186,6 +186,8 @@ export function createFocusTrap(container, options = {}) {
186
186
  activate,
187
187
  deactivate,
188
188
  update: updateFocusableElements,
189
- isActive: () => isActive,
189
+ get isActive() {
190
+ return isActive;
191
+ },
190
192
  };
191
193
  }