@qld-gov-au/qgds-bootstrap5 2.1.0 → 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 (78) hide show
  1. package/.storybook/preview.js +15 -6
  2. package/dist/assets/components/bs5/callToAction/callToAction.hbs +3 -3
  3. package/dist/assets/components/bs5/dateinput/dateinput.hbs +21 -27
  4. package/dist/assets/components/bs5/globalAlert/globalAlert.hbs +8 -1
  5. package/dist/assets/components/bs5/head/head.hbs +1 -1
  6. package/dist/assets/components/bs5/pagination/pagination.hbs +7 -2
  7. package/dist/assets/components/bs5/promotionalPanel/promotionalPanel.hbs +1 -1
  8. package/dist/assets/components/bs5/searchInput/searchInput.hbs +2 -2
  9. package/dist/assets/css/qld.bootstrap.css +2 -2
  10. package/dist/assets/css/qld.bootstrap.css.map +3 -3
  11. package/dist/assets/css/qld.bootstrap.legacy.css +2 -2
  12. package/dist/assets/css/qld.bootstrap.legacy.css.map +3 -3
  13. package/dist/assets/js/handlebars.helpers.bundle.js +1 -1
  14. package/dist/assets/js/handlebars.init.min.js +50 -44
  15. package/dist/assets/js/handlebars.init.min.js.map +2 -2
  16. package/dist/assets/js/handlebars.partials.js +50 -44
  17. package/dist/assets/js/handlebars.partials.js.map +2 -2
  18. package/dist/assets/js/qld.bootstrap.min.js +6 -6
  19. package/dist/assets/js/qld.bootstrap.min.js.map +4 -4
  20. package/dist/assets/node/handlebars.init.min.js +15 -8
  21. package/dist/assets/node/handlebars.init.min.js.map +2 -2
  22. package/dist/components/bs5/callToAction/callToAction.hbs +3 -3
  23. package/dist/components/bs5/dateinput/dateinput.hbs +21 -27
  24. package/dist/components/bs5/globalAlert/globalAlert.hbs +8 -1
  25. package/dist/components/bs5/head/head.hbs +1 -1
  26. package/dist/components/bs5/pagination/pagination.hbs +7 -2
  27. package/dist/components/bs5/promotionalPanel/promotionalPanel.hbs +1 -1
  28. package/dist/components/bs5/searchInput/searchInput.hbs +2 -2
  29. package/dist/package.json +33 -32
  30. package/dist/sample-data/callToAction/callToAction.data.json +2 -1
  31. package/dist/sample-data/dateinput/dateinput.data.json +3 -1
  32. package/dist/sample-data/pagination/pagination.data.json +4 -4
  33. package/dist/sample-data/promotionalPanel/promotionalPanel.data.json +45 -47
  34. package/package.json +33 -32
  35. package/src/components/bs5/breadcrumbs/breadcrumbs.scss +1 -0
  36. package/src/components/bs5/button/button.scss +1 -0
  37. package/src/components/bs5/button/button.stories.js +16 -4
  38. package/src/components/bs5/callToAction/callToAction.data.json +2 -1
  39. package/src/components/bs5/callToAction/callToAction.hbs +3 -3
  40. package/src/components/bs5/callToAction/callToAction.stories.js +2 -2
  41. package/src/components/bs5/card/card.scss +2 -2
  42. package/src/components/bs5/dateinput/Dateinput.js +1 -38
  43. package/src/components/bs5/dateinput/Dateinput.mdx +27 -0
  44. package/src/components/bs5/dateinput/Dateinput.stories.js +48 -4
  45. package/src/components/bs5/dateinput/dateinput.data.json +3 -1
  46. package/src/components/bs5/dateinput/dateinput.functions.js +91 -0
  47. package/src/components/bs5/dateinput/dateinput.hbs +21 -27
  48. package/src/components/bs5/formcheck/formcheck.scss +5 -0
  49. package/src/components/bs5/globalAlert/globalAlert.hbs +8 -1
  50. package/src/components/bs5/globalAlert/globalAlert.scss +14 -19
  51. package/src/components/bs5/globalAlert/globalAlert.stories.js +1 -0
  52. package/src/components/bs5/globalAlert/globalAlert.test.js +10 -5
  53. package/src/components/bs5/inpageAlert/inpageAlert.scss +3 -4
  54. package/src/components/bs5/inpagenav/inpagenav.scss +9 -1
  55. package/src/components/bs5/modal/modal.scss +1 -1
  56. package/src/components/bs5/navbar/navbar.functions.js +39 -28
  57. package/src/components/bs5/navbar/navbar.scss +43 -28
  58. package/src/components/bs5/navbar/navbar.stories.js +4 -3
  59. package/src/components/bs5/pagination/pagination.data.json +4 -4
  60. package/src/components/bs5/pagination/pagination.hbs +7 -2
  61. package/src/components/bs5/pagination/pagination.scss +1 -1
  62. package/src/components/bs5/promotionalPanel/promotionalPanel.data.json +45 -47
  63. package/src/components/bs5/promotionalPanel/promotionalPanel.hbs +1 -1
  64. package/src/components/bs5/quickexit/quickexit.scss +1 -1
  65. package/src/components/bs5/searchInput/__snapshots__/searchInput.test.js.snap +2 -2
  66. package/src/components/bs5/searchInput/search.functions.js +9 -5
  67. package/src/components/bs5/searchInput/searchInput.hbs +2 -2
  68. package/src/components/bs5/searchInput/searchInput.scss +1 -0
  69. package/src/components/bs5/sidenav/sidenav.scss +17 -19
  70. package/src/components/bs5/table/table.scss +93 -83
  71. package/src/css/main.scss +3 -0
  72. package/src/css/mixins/focusable.scss +1 -1
  73. package/src/css/qld-reduced-motion.scss +51 -0
  74. package/src/css/qld-tokens.scss +3 -3
  75. package/src/css/qld-type.scss +7 -13
  76. package/src/js/constants.js +10 -0
  77. package/src/js/qld.bootstrap.js +99 -99
  78. package/src/js/utils.js +3 -1
@@ -14,8 +14,8 @@
14
14
  --sidenav-level-three-padding: 3.5rem;
15
15
  --sidenav-navlink-padding: 1rem;
16
16
 
17
- --sidenav-hover-bg: var(--#{$prefix}extra-light-grey);
18
- --sidenav-hover-color: var(--#{$prefix}brand-primary);
17
+ --sidenav-hover-bg: var(--#{$prefix}neutral-lightest);
18
+ --sidenav-hover-color: var(--#{$prefix}light-action-primary);
19
19
  --sidenav-hover-underline-color: var(
20
20
  --#{$prefix}color-default-color-light-underline-hover
21
21
  );
@@ -24,9 +24,9 @@
24
24
  --#{$prefix}color-default-color-light-text-heading
25
25
  );
26
26
 
27
- --sidenav-heading-border-color: #{$qld-brand-secondary};
28
- --sidenav-item-border-color: #{$qld-soft-grey};
29
- --sidenav-subitem-border-color: #{$qld-light-grey};
27
+ --sidenav-heading-border-color: var(--#{$prefix}light-accent);
28
+ --sidenav-item-border-color: var(--#{$prefix}light-border-alt);
29
+ --sidenav-subitem-border-color: var(--#{$prefix}neutral-lighter);
30
30
 
31
31
  --sidenav-submenu-divider: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='var(--#{$prefix}color-light-border)' d='M2 10h12v1H2zM2 5h1v5H2z'/%3E%3C/svg%3E");
32
32
 
@@ -43,7 +43,7 @@
43
43
  --#{$prefix}accordion-btn-padding-x: 1rem;
44
44
  --#{$prefix}accordion-btn-padding-y: 1rem;
45
45
  --#{$prefix}accordion-btn-color: var(--#{$prefix}link-color);
46
- --#{$prefix}accordion-btn-bg: var(--#{$prefix}extra-light-grey);
46
+ --#{$prefix}accordion-btn-bg: var(--#{$prefix}neutral-lightest);
47
47
  --#{$prefix}accordion-btn-icon: #{escape-svg($accordion-button-icon)};
48
48
  --#{$prefix}accordion-btn-active-icon: #{escape-svg(
49
49
  $accordion-button-active-icon
@@ -59,15 +59,13 @@
59
59
  .light & {
60
60
  --#{$prefix}accordion-bg: var(--#{$prefix}light-background);
61
61
  --#{$prefix}accordion-btn-bg: var(--#{$prefix}light-background-shade);
62
- --#{$prefix}accordion-border-color: var(
63
- --#{$prefix}color-default-color-light-border-light
64
- );
62
+ --#{$prefix}accordion-border-color: var(--#{$prefix}light-border);
65
63
  }
66
64
 
67
65
  .alt & {
68
- --#{$prefix}accordion-bg: var(--#{$prefix}light-grey-alt);
69
- --#{$prefix}accordion-btn-bg: var(--#{$prefix}grey);
70
- --#{$prefix}accordion-border-color: var(--#{$prefix}soft-grey);
66
+ --#{$prefix}accordion-bg: var(--#{$prefix}light-alt-background);
67
+ --#{$prefix}accordion-btn-bg: var(--#{$prefix}neutral-light);
68
+ --#{$prefix}accordion-border-color: var(--#{$prefix}light-border-alt);
71
69
  }
72
70
 
73
71
  // Shared 'Dark' theme variables
@@ -85,14 +83,14 @@
85
83
 
86
84
  // Theme specific variables
87
85
  .dark & {
88
- --#{$prefix}accordion-bg: var(--#{$prefix}brand-primary);
86
+ --#{$prefix}accordion-bg: var(--#{$prefix}dark-background);
89
87
  --#{$prefix}accordion-btn-bg: var(--#{$prefix}dark-background-shade);
90
88
  --#{$prefix}accordion-border-color: var(--#{$prefix}dark-border);
91
89
  }
92
90
 
93
91
  .dark-alt & {
94
- --#{$prefix}accordion-bg: var(--#{$prefix}dark-blue);
95
- --#{$prefix}accordion-btn-bg: var(--#{$prefix}dark-blue-shade);
92
+ --#{$prefix}accordion-bg: var(--#{$prefix}dark-alt-background);
93
+ --#{$prefix}accordion-btn-bg: var(--#{$prefix}dark-alt-background-shade);
96
94
  --#{$prefix}accordion-border-color: var(--#{$prefix}dark-alt-border);
97
95
  }
98
96
  }
@@ -114,10 +112,10 @@
114
112
  --#{$prefix}color-default-color-dark-text-heading
115
113
  );
116
114
 
117
- --sidenav-heading-border-color: var(--#{$prefix}brand-secondary);
118
- --sidenav-item-border-color: var(--#{$prefix}brand-primary-light);
119
- --sidenav-subitem-border-color: var(--#{$prefix}brand-primary-light);
120
- --sidenav-active-item-color: var(--#{$prefix}white);
115
+ --sidenav-heading-border-color: var(--#{$prefix}dark-accent);
116
+ --sidenav-item-border-color: var(--#{$prefix}dark-alt-border);
117
+ --sidenav-subitem-border-color: var(--#{$prefix}dark-border);
118
+ --sidenav-active-item-color: var(--#{$prefix}neutral-white);
121
119
  }
122
120
  }
123
121
 
@@ -1,93 +1,103 @@
1
1
  .qld-table {
2
-
3
- border: 1px solid var(--qld-light-grey);
2
+ border: 1px solid var(--qld-neutral-lighter);
3
+ border-radius: 0.75rem;
4
+ margin-bottom: 1rem;
5
+
6
+ // DS includes a version of the table without borders ("quiet table").
7
+ // This is achieved by setting the border on a wrapping .qld-table--borderless class
8
+ &--borderless {
9
+ border: 1px solid transparent;
10
+ }
11
+
12
+ .table {
13
+ --qld-table-border-color: var(--qld-neutral-lighter);
14
+ --qld-table-header-color: var(--qld-light-text-heading);
15
+ --qld-table-cell-color: var(--qld-light-text-text);
16
+ --qld-table-striped-bg: var(--qld-neutral-lightest);
17
+
18
+ margin-bottom: 0;
4
19
  border-radius: 0.75rem;
5
- margin-bottom: 1rem;
6
20
 
7
- // DS includes a version of the table without borders ("quiet table").
8
- // This is achieved by setting the border on a wrapping .qld-table--borderless class
9
- &--borderless {
10
- border: 1px solid transparent;
21
+ //required to maintain effective border-radius on the table
22
+ overflow: hidden;
23
+
24
+ // Override Bootstrap's default odd-row striping to use even rows
25
+ &.table-striped {
26
+ > tbody > tr:nth-of-type(odd) > * {
27
+ --qld-table-accent-bg: transparent;
28
+ --qld-table-bg-type: transparent;
29
+ }
30
+
31
+ > tbody > tr:nth-of-type(even) > * {
32
+ --qld-table-accent-bg: var(--qld-table-striped-bg);
33
+ --qld-table-bg-type: var(--qld-table-striped-bg);
34
+ }
35
+ }
36
+
37
+ caption {
38
+ caption-side: top;
39
+ color: var(--qld-headings-color);
40
+ padding: 0.75rem;
41
+ line-height: 2rem;
42
+ font-weight: 600;
43
+ font-size: 1.25rem;
44
+ border-bottom: 1px solid var(--qld-table-border-color);
45
+ }
46
+
47
+ .sub-caption {
48
+ color: var(--qld-light-text-lighter);
49
+ font-size: 0.875rem;
50
+ font-weight: 400;
51
+ line-height: 1.25rem;
52
+ display: table-row;
11
53
  }
12
54
 
13
- .table {
14
- --qld-table-border-color: var(--qld-light-grey);
15
- --qld-table-header-color: var(--qld-light-text-heading);
16
- --qld-table-cell-color: var(--qld-light-text-text);
17
- --qld-table-striped-bg: var(--qld-extra-light-grey);
18
-
19
- margin-bottom: 0;
20
- border-radius: 0.75rem;
21
-
22
- //required to maintain effective border-radius on the table
23
- overflow: hidden;
24
-
25
- caption {
26
- caption-side: top;
27
- color: var(--qld-headings-color);
28
- padding: 0.75rem;
29
- line-height: 2rem;
30
- font-weight: 600;
31
- font-size: 1.25rem;
32
- border-bottom: 1px solid var(--qld-table-border-color);
33
- }
34
-
35
- .sub-caption {
36
- color: var(--qld-dark-grey-muted);
37
- font-size: 0.875rem;
38
- font-weight: 400;
39
- line-height: 1.25rem;
40
- display: table-row;
41
- }
42
-
43
- thead th,
44
- thead td {
45
- border-bottom: 2px solid var(--qld-brand-secondary);
46
- }
47
-
48
- th {
49
- color: var(--qld-table-header-color);
50
- padding: 1.25rem 0.75rem;
51
- }
52
-
53
- td {
54
- color: var(--qld-table-cell-color);
55
- padding: 0.75rem;
56
- }
57
-
58
- tbody tr {
59
- border-bottom: 1px solid var(--qld-table-border-color);
60
- }
61
-
62
- tfoot th,
63
- tfoot td {
64
- border-top: 2px solid $qld-brand-secondary;
65
- border-bottom: 0;
66
- font-weight: 600;
67
- padding: 0.75rem;
68
- }
55
+ thead th,
56
+ thead td {
57
+ border-bottom: 2px solid var(--qld-light-accent);
58
+ }
59
+
60
+ th {
61
+ color: var(--qld-table-header-color);
62
+ padding: 1.25rem 0.75rem;
63
+ }
69
64
 
65
+ td {
66
+ color: var(--qld-table-cell-color);
67
+ padding: 0.75rem;
70
68
  }
71
69
 
70
+ tbody tr {
71
+ border-bottom: 1px solid var(--qld-table-border-color);
72
+ }
73
+
74
+ tfoot th,
75
+ tfoot td {
76
+ border-top: 2px solid var(--qld-light-accent);
77
+ border-bottom: 0;
78
+ font-weight: 600;
79
+ padding: 0.75rem;
80
+ }
81
+ }
82
+
83
+ //Build a bootstrap ".table-dark" class dynamically, passing in a background colour
84
+ @include table-variant("dark", $color-default-color-dark-background-default);
85
+
86
+ //Then, we extend .table-dark with some additional rules
87
+ .table-dark {
88
+ --qld-table-border-color: var(--qld-dark-border);
89
+ --qld-table-header-color: var(--qld-dark-text-heading);
90
+ --qld-table-cell-color: var(--qld-dark-text-text);
91
+ --qld-table-striped-bg: var(--qld-dark-background-shade);
92
+
93
+ caption,
94
+ .sub-caption {
95
+ background-color: var(--qld-dark-background);
96
+ color: var(--qld-dark-text-text);
97
+ }
72
98
 
73
- //Build a bootstrap ".table-dark" class dynamically, passing in a background colour
74
- @include table-variant("dark", #09549F);
75
-
76
- //Then, we extend .table-dark with some additional rules
77
- .table-dark {
78
- --qld-table-border-color: var(--qld-dark-border);
79
- --qld-table-header-color: var(--qld-white);
80
- --qld-table-cell-color: var(--qld-white);
81
- --qld-table-striped-bg: var(--qld-extra-light-grey);
82
-
83
- caption,
84
- .sub-caption {
85
- background-color: #09549F;
86
- color: #FFF;
87
- }
88
-
89
- thead th {
90
- background-color: #04498F;
91
- }
99
+ thead th {
100
+ background-color: var(--qld-dark-background-shade);
92
101
  }
93
- }
102
+ }
103
+ }
package/src/css/main.scss CHANGED
@@ -152,3 +152,6 @@ $enable-dark-mode: true;
152
152
 
153
153
  // Print
154
154
  @import "qld-print";
155
+
156
+ // Reduced motion
157
+ @import "qld-reduced-motion";
@@ -1,6 +1,6 @@
1
1
  ///
2
2
  /// Default focus styles for use in buttons etc. Resets :focus and uses :focus-visible instead which only appears on keyboard interaction.
3
- /// @param {Boolean} $offsetOutline [true] - Offset the focus ring by 2px.
3
+ /// @param {Boolean|number} $offsetOutline [true] - Offset the focus ring by 2px.
4
4
  /// @param {Boolean} $isFocusWithin [false] - Optionally apply styles via :focus-within rather than :focus-visible
5
5
  /// @param {String} $outlineWidth: [3px] The width of the outline.
6
6
  /// @param {String} $customSelector [null] - If passed, will override $isFocusWithin and apply focus styles instead to a custom selector string. @see SearchInput
@@ -0,0 +1,51 @@
1
+ @media (prefers-reduced-motion: reduce) {
2
+ .show,
3
+ .show:after,
4
+ .show:before,
5
+ a::after,
6
+ a::before,
7
+ a.dropdown-item,
8
+ .collapsed,
9
+ .accordion-toggle-btn--closed::after,
10
+ .accordion-toggle-btn--open::after,
11
+ .video-thumbnail .video-thumbnail-image:before,
12
+ * {
13
+ transition-duration: 0.001ms !important;
14
+ animation-duration: 0.001ms !important;
15
+ transition: none !important;
16
+ animation: none !important;
17
+ }
18
+ a.dropdown-item,
19
+ a.dropdown-item:hover {
20
+ gap: 1rem !important;
21
+ }
22
+ a.dropdown-item,
23
+ a.dropdown-item:hover,
24
+ a.dropdown-item:hover::after {
25
+ padding-inline-end: 0.5rem !important;
26
+ transform: none !important;
27
+ top: unset;
28
+ }
29
+ .qld-cta-link:hover {
30
+ gap: 0.5rem !important;
31
+ }
32
+ .link-column .nav-item .nav-link::after,
33
+ .link-column .nav-item .nav-link:hover::after {
34
+ margin-inline-end: 0.5rem;
35
+ }
36
+ .link-column .all-link .qld-cta-link:hover {
37
+ padding-inline-end: 0.5rem;
38
+ }
39
+ .qld-tabs .nav-tabs {
40
+ scroll-behavior: unset !important;
41
+ }
42
+ .card.card-arrow:hover .qld-icon {
43
+ transform: translateX(0rem);
44
+ }
45
+ @media (max-width: 991.98px) {
46
+ .navbar.show > .container,
47
+ .navbar.vertical.show > .container {
48
+ transform: translateX(0);
49
+ }
50
+ }
51
+ }
@@ -16,15 +16,15 @@ $color-default-color-dark-crest-fill: #ffffff !default;
16
16
  $color-default-color-dark-focus-default: #c6ffff !default;
17
17
  $color-default-color-dark-link-default: #ffffff !default;
18
18
  $color-default-color-dark-link-on-action: #001c37 !default;
19
- $color-default-color-dark-link-visited: #e1bbee !default;
19
+ $color-default-color-dark-link-visited: #F2CDFF !default;
20
20
  $color-default-color-dark-site-title: #ffffff !default;
21
21
  $color-default-color-dark-text-default: #ffffff !default;
22
22
  $color-default-color-dark-text-heading: #ffffff !default;
23
23
  $color-default-color-dark-text-lighter: #deebf9 !default;
24
24
  $color-default-color-dark-underline-default-hover: #ffffff !default;
25
25
  $color-default-color-dark-underline-default: #b5cce2 !default;
26
- $color-default-color-dark-underline-visited-hover: #e1bbee !default;
27
- $color-default-color-dark-underline-visited: #e1c2ff !default;
26
+ $color-default-color-dark-underline-visited-hover: #F2CDFF !default;
27
+ $color-default-color-dark-underline-visited: #C6AED9 !default;
28
28
 
29
29
  /* Light palettes */
30
30
  $color-default-color-light-accent-design-accent: #84d3ff !default;
@@ -6,12 +6,11 @@ body {
6
6
 
7
7
  .qld-content-body {
8
8
  p {
9
- margin-bottom: 1.25rem;
9
+ margin-bottom: 1rem;
10
+ line-height: 1.5;
10
11
  }
11
-
12
12
  ul,
13
- ol,
14
- p {
13
+ ol{
15
14
  line-height: 1.75;
16
15
  }
17
16
 
@@ -77,12 +76,6 @@ a.nav-link {
77
76
  border-radius: 0;
78
77
  }
79
78
 
80
- figure > figcaption {
81
- font-size: 14px;
82
- font-weight: 400;
83
- line-height: 20px;
84
- }
85
-
86
79
  a.nostyle {
87
80
  text-decoration: unset;
88
81
  text-underline-offset: unset;
@@ -93,9 +86,10 @@ a.nostyle {
93
86
  }
94
87
  }
95
88
 
96
- ::-moz-selection {
97
- background: var(--qld-selection-bg);
98
- text-shadow: none;
89
+ figure > figcaption {
90
+ font-size: 14px;
91
+ font-weight: 400;
92
+ line-height: 20px;
99
93
  }
100
94
 
101
95
  ::selection {
@@ -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,122 +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
-
55
- forms.forEach((form) => {
56
- // Get the search input within the current form
57
- let searchInput = form.querySelector(".qld-search-input input");
58
-
59
- if (searchInput) {
60
- let timeout;
61
-
62
- // Add keyup event listener to the search input
63
- searchInput.addEventListener("input", function (e) {
64
- clearTimeout(timeout);
65
- timeout = setTimeout(() => {
66
- const value = e.target.value.trim();
67
- showSuggestions(value, value === "", form);
68
- }, 300);
69
- });
70
-
71
- // Attach event listener to form submit
72
- form.addEventListener("submit", function (event) {
73
- event.preventDefault();
74
- const query = searchInput.value.trim();
75
- submitSearchForm(query, form);
76
- });
77
- }
78
- });
79
-
80
- //Header - get the <header> element
81
- let header = document.querySelector("header");
82
-
83
- if (header) {
84
- // Get the current page URL without query string parameters
85
- let url = window.location.origin + window.location.pathname;
86
- // Set the data-page-url attribute on the <header> element
87
- header.setAttribute("data-page-url", url);
88
- }
89
-
90
- // Navbar
91
- initializeNavbar();
92
-
93
- // Breadcrumb
94
- initBreadcrumb();
95
-
96
- // Quick exit
97
- window.addEventListener("click", initQuickexit, true);
98
- window.addEventListener("keydown", initQuickexit, true);
99
- initQuickexit();
100
-
101
- // Accordion
102
- let accordionToggleButton = document.querySelectorAll(
103
- ".accordion-toggle-btn",
104
- );
105
-
106
- accordionToggleButton.forEach(function (toggleButton) {
107
- toggleButton.addEventListener("click", accordionToggleAll);
108
-
109
- let accordionButtons = toggleButton
110
- .closest(".accordion-group")
111
- .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
+ });
112
69
 
113
- accordionButtons.forEach(function (button) {
114
- 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);
115
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);
116
114
  });
115
+ });
117
116
 
118
- let inPageLinks = document.querySelectorAll('a[href^="#"]');
117
+ let inPageLinks = document.querySelectorAll('a[href^="#"]');
119
118
 
120
- accordionHashLinks();
121
- window.onhashchange = accordionHashLinks;
122
- inPageLinks.forEach(function (link) {
123
- link.addEventListener("click", accordionHashLinks);
124
- });
119
+ accordionHashLinks();
120
+ window.onhashchange = accordionHashLinks;
121
+ inPageLinks.forEach(function (link) {
122
+ link.addEventListener("click", accordionHashLinks);
123
+ });
125
124
 
126
- // Video
127
- let videoThumbnails = document.querySelectorAll(".video-thumbnail");
125
+ // Video
126
+ let videoThumbnails = document.querySelectorAll(".video-thumbnail");
128
127
 
129
- videoThumbnails.forEach(function (thumbnail) {
130
- thumbnail.addEventListener("click", videoEmbedPlay);
131
- });
128
+ videoThumbnails.forEach(function (thumbnail) {
129
+ thumbnail.addEventListener("click", videoEmbedPlay);
130
+ });
132
131
 
133
- let videoTranscripts = document.querySelectorAll(
134
- ".video .accordion .accordion-button",
135
- );
132
+ let videoTranscripts = document.querySelectorAll(
133
+ ".video .accordion .accordion-button",
134
+ );
136
135
 
137
- videoTranscripts.forEach(function (transcript) {
138
- transcript.addEventListener("click", videoTranscriptTitle);
139
- });
136
+ videoTranscripts.forEach(function (transcript) {
137
+ transcript.addEventListener("click", videoTranscriptTitle);
138
+ });
139
+
140
+ initDateInput();
140
141
 
141
- // Skip Links
142
- validateSkipLinks();
143
- })();
142
+ // Skip Links
143
+ validateSkipLinks();
144
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
  }