@qld-gov-au/qgds-bootstrap5 2.0.2 → 2.0.3

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 (73) hide show
  1. package/.storybook/preview.js +4 -1
  2. package/dist/assets/components/bs5/accordion/accordion.hbs +0 -3
  3. package/dist/assets/components/bs5/directionLinks/directionLinks.hbs +2 -1
  4. package/dist/assets/components/bs5/head/head.hbs +1 -1
  5. package/dist/assets/components/bs5/header/header.hbs +6 -9
  6. package/dist/assets/components/bs5/navbar/navbar.hbs +21 -14
  7. package/dist/assets/components/bs5/pageLayout/templates/contentPageWithForm.hbs +1 -1
  8. package/dist/assets/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +140 -108
  9. package/dist/assets/components/bs5/pageLayout/templates/homePage.hbs +1 -1
  10. package/dist/assets/components/bs5/sidenav/sidenav.hbs +56 -37
  11. package/dist/assets/css/qld.bootstrap.css +1 -6
  12. package/dist/assets/css/qld.bootstrap.css.map +3 -3
  13. package/dist/assets/js/handlebars.init.min.js +228 -175
  14. package/dist/assets/js/handlebars.init.min.js.map +2 -2
  15. package/dist/assets/js/qld.bootstrap.min.js +5 -5
  16. package/dist/assets/js/qld.bootstrap.min.js.map +4 -4
  17. package/dist/assets/node/handlebars.init.min.js +28 -24
  18. package/dist/assets/node/handlebars.init.min.js.map +2 -2
  19. package/dist/components/bs5/accordion/accordion.hbs +0 -3
  20. package/dist/components/bs5/directionLinks/directionLinks.hbs +2 -1
  21. package/dist/components/bs5/head/head.hbs +1 -1
  22. package/dist/components/bs5/header/header.hbs +6 -9
  23. package/dist/components/bs5/navbar/navbar.hbs +21 -14
  24. package/dist/components/bs5/pageLayout/templates/contentPageWithForm.hbs +1 -1
  25. package/dist/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +140 -108
  26. package/dist/components/bs5/pageLayout/templates/homePage.hbs +1 -1
  27. package/dist/components/bs5/sidenav/sidenav.hbs +56 -37
  28. package/dist/package.json +2 -4
  29. package/dist/sample-data/navbar/navbar.data.json +91 -25
  30. package/dist/sample-data/pagination/pagination.data.json +19 -19
  31. package/dist/sample-data/sidenav/sidenav.data.json +81 -80
  32. package/package.json +2 -4
  33. package/src/components/bs5/accordion/Accordion.mdx +34 -10
  34. package/src/components/bs5/accordion/__snapshots__/accordion.test.js.snap +0 -3
  35. package/src/components/bs5/accordion/accordion.hbs +0 -3
  36. package/src/components/bs5/accordion/mdx/_designResources.mdx +6 -0
  37. package/src/components/bs5/accordion/mdx/_usageInstructions.mdx +10 -0
  38. package/src/components/bs5/blockquote/blockquote.scss +47 -7
  39. package/src/components/bs5/button/button.scss +4 -0
  40. package/src/components/bs5/directionLinks/directionLinks.hbs +2 -1
  41. package/src/components/bs5/directionLinks/directionLinks.scss +27 -80
  42. package/src/components/bs5/directionLinks/directionLinks.stories.js +7 -14
  43. package/src/components/bs5/header/header.hbs +6 -9
  44. package/src/components/bs5/inpagenav/inpagenav.scss +7 -3
  45. package/src/components/bs5/navbar/navbar.data.json +91 -25
  46. package/src/components/bs5/navbar/navbar.functions.js +4 -0
  47. package/src/components/bs5/navbar/navbar.hbs +21 -14
  48. package/src/components/bs5/navbar/navbar.scss +219 -166
  49. package/src/components/bs5/navbar/navbar.stories.js +31 -2
  50. package/src/components/bs5/pageLayout/pageLayout.stories.js +3 -1
  51. package/src/components/bs5/pageLayout/templates/contentPageWithForm.hbs +1 -1
  52. package/src/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +140 -108
  53. package/src/components/bs5/pageLayout/templates/homePage.hbs +1 -1
  54. package/src/components/bs5/pagination/pagination.data.json +19 -19
  55. package/src/components/bs5/pagination/pagination.scss +37 -63
  56. package/src/components/bs5/promotionalPanel/promotionalPanel.scss +23 -22
  57. package/src/components/bs5/quickexit/quickexit.functions.js +24 -37
  58. package/src/components/bs5/quickexit/quickexit.scss +4 -0
  59. package/src/components/bs5/sidenav/sidenav.data.json +81 -80
  60. package/src/components/bs5/sidenav/sidenav.hbs +56 -37
  61. package/src/components/bs5/sidenav/sidenav.scss +236 -151
  62. package/src/components/bs5/skiplinks/skipLinks.functions.js +0 -9
  63. package/src/components/bs5/skiplinks/skipLinks.test.js +0 -1
  64. package/src/components/common/layout/container.scss +5 -0
  65. package/src/components/common/layout/content.scss +16 -8
  66. package/src/css/main.scss +0 -7
  67. package/src/css/qld-theme.scss +1 -0
  68. package/src/css/utilities/_index.scss +1 -0
  69. package/src/css/utilities/sr-only.scss +5 -0
  70. package/src/js/qld.bootstrap.js +1 -9
  71. package/src/stories/documentation/_storybookDocsTabs.jsx +63 -0
  72. package/src/stories/documentation/storybook-documentation.scss +51 -0
  73. package/src/components/bs5/pagination/health-icon-sprite.svg +0 -156
@@ -9,7 +9,7 @@
9
9
  display: grid;
10
10
  grid-template-columns: repeat(2, 1fr);
11
11
  grid-template-areas: "content graphic";
12
- &>* {
12
+ & > * {
13
13
  padding: 0;
14
14
  }
15
15
  &.content-right {
@@ -18,8 +18,8 @@
18
18
  align-items: start;
19
19
  }
20
20
  }
21
- &.bg-img {
22
- background-repeat: no-repeat;
21
+ &.bg-img {
22
+ background-repeat: no-repeat;
23
23
  background-size: cover;
24
24
  .content-panel {
25
25
  padding: 4rem;
@@ -48,7 +48,7 @@
48
48
  flex-direction: column;
49
49
  gap: 2rem;
50
50
  align-items: end;
51
- &>* {
51
+ & > * {
52
52
  max-width: 65ch;
53
53
  padding: 0;
54
54
  margin: 0;
@@ -64,7 +64,7 @@
64
64
  justify-content: center;
65
65
  }
66
66
  .qld-icon {
67
- --#{$prefix}icon-color: var(--icon-colour);
67
+ --#{$prefix}icon-color: var(--icon-colour);
68
68
  width: 2rem;
69
69
  height: 2rem;
70
70
  mask-size: 100%;
@@ -79,7 +79,7 @@
79
79
  gap: 1.5rem;
80
80
  }
81
81
  h2 {
82
- margin:0;
82
+ margin: 0;
83
83
  line-height: 1.25;
84
84
  }
85
85
  .btn-container {
@@ -87,7 +87,7 @@
87
87
  gap: 1rem;
88
88
  flex-direction: row;
89
89
  justify-content: start;
90
- flex-wrap:wrap;
90
+ flex-wrap: wrap;
91
91
  }
92
92
  .cta-container {
93
93
  .qld-cta-link {
@@ -121,7 +121,7 @@
121
121
  }
122
122
  @include media-breakpoint-down(xl) {
123
123
  .row {
124
- border-radius: 0;
124
+ border-radius: 0;
125
125
  }
126
126
  }
127
127
  }
@@ -130,12 +130,12 @@
130
130
  border-radius: 0;
131
131
  padding: 0;
132
132
  background-color: transparent;
133
- gap:0;
133
+ gap: 0;
134
134
  .content-panel {
135
135
  border-radius: 3rem;
136
136
  border-start-end-radius: 0;
137
137
  padding: 4rem;
138
- }
138
+ }
139
139
  .image-panel {
140
140
  .promo-panel-image {
141
141
  border-radius: 0;
@@ -183,7 +183,7 @@
183
183
  &.content-right {
184
184
  .content-panel {
185
185
  border-radius: 0;
186
- border-start-end-radius: 3rem;
186
+ border-start-end-radius: 3rem;
187
187
  border-end-end-radius: 3rem;
188
188
  }
189
189
  .image-panel {
@@ -209,14 +209,14 @@
209
209
  &.indent .row {
210
210
  .content-panel {
211
211
  border-radius: 0;
212
- border-end-end-radius: 3rem ;
212
+ border-end-end-radius: 3rem;
213
213
  padding-inline: 3rem;
214
214
  padding-block: 2.5rem;
215
215
  gap: 1.5rem;
216
216
  }
217
217
  &.content-right {
218
218
  .content-panel {
219
- border-radius: 0 ;
219
+ border-radius: 0;
220
220
  border-end-start-radius: 3rem;
221
221
  }
222
222
  .image-panel {
@@ -236,10 +236,10 @@
236
236
  &.indent-img .row {
237
237
  .image-panel {
238
238
  margin-block-end: -2.75rem;
239
- .promo-panel-image {
240
- border-radius: 0;
241
- border-end-start-radius: 2.5rem;
242
- }
239
+ .promo-panel-image {
240
+ border-radius: 0;
241
+ border-end-start-radius: 2.5rem;
242
+ }
243
243
  }
244
244
  .content-panel {
245
245
  border-radius: 0;
@@ -253,7 +253,7 @@
253
253
  }
254
254
  }
255
255
  .content-panel {
256
- border-radius: 0 ;
256
+ border-radius: 0;
257
257
  }
258
258
  }
259
259
  }
@@ -267,7 +267,8 @@
267
267
  }
268
268
  }
269
269
  }
270
- a.btn,.btn {
270
+ a.btn,
271
+ .btn {
271
272
  white-space: normal;
272
273
  }
273
274
  @include media-breakpoint-down(md) {
@@ -297,7 +298,7 @@
297
298
  }
298
299
  &.bg-img {
299
300
  border-radius: 3rem;
300
- gap:0;
301
+ gap: 0;
301
302
  .content-panel {
302
303
  border-radius: 2rem;
303
304
  }
@@ -324,7 +325,7 @@
324
325
  margin-block-end: 0;
325
326
  .promo-panel-image {
326
327
  border-radius: 0;
327
- border-end-end-radius: 2.75rem;
328
+ border-end-end-radius: 2rem;
328
329
  }
329
330
  }
330
331
  .content-panel {
@@ -333,4 +334,4 @@
333
334
  }
334
335
  }
335
336
  }
336
- }
337
+ }
@@ -1,49 +1,36 @@
1
- export function positionQuickExit() {
2
- let quickexitInstances = document.getElementsByClassName('qld-quick-exit');
3
- if (quickexitInstances.length > 0) {
4
- const el = document.getElementsByClassName('qld-quick-exit')[0];
5
- if (document.documentElement.clientWidth > 992) {
6
- if (window.pageYOffset > 200) {
7
- el.setAttribute("style", "position: 'fixed', top: '0px'");
8
- }
9
- if (window.pageYOffset < 200) {
10
- el.setAttribute("style", "position: 'sticky', top: '0px'");
11
- }
12
- } else {
13
- el.setAttribute("style", "position: 'fixed', top: 'auto'");
14
- }
15
- }
16
- }
17
-
18
1
  export function initQuickexit() {
19
- var quickExitElement = document.getElementsByClassName('qld-quick-exit');
20
- var quickExitButton = document.querySelector('.qld-quick-exit-button');
2
+ var quickExitElement = document.getElementsByClassName("qld-quick-exit");
3
+ var quickExitButton = document.querySelector(".qld-quick-exit-button");
21
4
 
22
- if (quickExitElement.length > 0 && typeof (quickExitButton) !== 'undefined' && quickExitButton != null) {
5
+ if (
6
+ quickExitElement.length > 0 &&
7
+ typeof quickExitButton !== "undefined" &&
8
+ quickExitButton != null
9
+ ) {
23
10
  onbtnClick();
24
11
  onKeyDown();
25
12
  }
26
13
  }
27
14
  /**
28
- * onbtnClick -> clicking quick exit button a page
29
- * @return {undefined}
30
- **/
15
+ * onbtnClick -> clicking quick exit button a page
16
+ * @return {undefined}
17
+ **/
31
18
  function onbtnClick() {
32
- const escapeSite = 'https://www.google.com.au/';
33
- var quickExitButton = document.querySelector('.qld-quick-exit-button');
19
+ const escapeSite = "https://www.google.com.au/";
20
+ var quickExitButton = document.querySelector(".qld-quick-exit-button");
34
21
  quickExitButton.onclick = function () {
35
22
  return quickExit(escapeSite);
36
- }
23
+ };
37
24
  }
38
25
 
39
26
  /**
40
- * onKeyDown -> escape keydown event
41
- * @return {undefined}
42
- **/
27
+ * onKeyDown -> escape keydown event
28
+ * @return {undefined}
29
+ **/
43
30
  function onKeyDown() {
44
- const escapeSite = 'https://www.google.com.au/';
31
+ const escapeSite = "https://www.google.com.au/";
45
32
  // add hotkey trigger
46
- document.addEventListener('keydown', function (e) {
33
+ document.addEventListener("keydown", function (e) {
47
34
  if (e.keyCode === 27) {
48
35
  quickExit(escapeSite);
49
36
  if (e) {
@@ -58,18 +45,18 @@ function onKeyDown() {
58
45
  }
59
46
 
60
47
  /**
61
- * quickExit function redirects a user on click and Esc key down
62
- * @param {string} site - site to replace on initiating the 'quick exit' ('Esc' key or clicking 'Close this site' button) function
63
- * @return {undefined}
64
- **/
48
+ * quickExit function redirects a user on click and Esc key down
49
+ * @param {string} site - site to replace on initiating the 'quick exit' ('Esc' key or clicking 'Close this site' button) function
50
+ * @return {undefined}
51
+ **/
65
52
  function quickExit(site) {
66
53
  // then redirect to a non-sensitive site
67
- window.open(site, '_blank');
54
+ window.open(site, "_blank");
68
55
  window.location.replace(site);
69
56
  // remove as much info from URL as possible
70
57
  if (window.history) {
71
58
  try {
72
- window.history.replaceState({}, '', '/');
59
+ window.history.replaceState({}, "", "/");
73
60
  } catch (e) {
74
61
  e.printStackTrace();
75
62
  }
@@ -264,3 +264,7 @@
264
264
  }
265
265
  }
266
266
  }
267
+
268
+ body:has(.qld-quick-exit) {
269
+ height: auto;
270
+ }
@@ -1,88 +1,89 @@
1
1
  {
2
- "navtitle": "In this section",
3
- "navtitlelink": "#optionallink",
4
- "navlist": [
2
+ "collapseTitle": "In this section",
3
+ "navtitle": "Parent page",
4
+ "navtitlelink": "#optionallink",
5
+ "navlist": [
6
+ {
7
+ "link": "https://www.qld.gov.au/transport/registration/register/heavy",
8
+ "label": "Sibling page",
9
+ "class": "",
10
+ "target": "",
11
+ "children": [
5
12
  {
6
- "link": "https://www.qld.gov.au/transport/registration/register/heavy",
7
- "label": "Heavy vehicles",
8
- "class": "",
9
- "target": "",
10
- "children": [
11
- {
12
- "link": "#",
13
- "class": "",
14
- "label": "Level two item",
15
- "children": []
16
- },
17
- {
18
- "link": "#",
19
- "class": "active",
20
- "label": "Level two item",
21
- "children": []
22
- },
23
- {
24
- "link": "#",
25
- "class": "",
26
-
27
- "label": "Level two item",
28
- "children": [
29
- {
30
- "link": "#",
31
- "class": "",
32
- "label": "Level three item",
33
- "children": []
34
- },
35
- {
36
- "link": "#",
37
- "class": "active",
38
- "label": "Level three item that wraps to another line",
39
- "children": []
40
- }
41
- ]
42
- }
43
- ]
44
- },
45
- {
46
- "link": "#",
47
- "label": "Renew registration",
48
- "class": "",
49
- "children": []
50
- },
51
- {
52
- "link": "#",
53
- "label": "Register a motorised mobility device",
54
- "class": "active",
55
- "children": []
56
- },
57
- {
58
- "link": "#",
59
- "label": "Register a boat",
60
- "class": "",
61
- "children": []
62
- },
63
- {
64
- "link": "#",
65
- "label": "Conditional registration",
66
- "class": "",
67
- "children": []
13
+ "link": "#",
14
+ "class": "",
15
+ "label": "Child page",
16
+ "children": []
68
17
  },
69
18
  {
70
- "link": "#",
71
- "label": "Vehicles registered overseas temporarily being used in Queensland",
72
- "class": "",
73
- "children": []
19
+ "link": "#",
20
+ "class": "active",
21
+ "label": "Child page",
22
+ "children": []
74
23
  },
75
24
  {
76
- "link": "#",
77
- "label": "Left hand drive vehicles",
78
- "class": "",
79
- "children": []
80
- },
81
- {
82
- "link": "#",
83
- "label": "Registration Help Tool—how to register a used motor vehicle or motorcycle",
84
- "class": "",
85
- "children": []
25
+ "link": "#",
26
+ "class": "",
27
+
28
+ "label": "Child page",
29
+ "children": [
30
+ {
31
+ "link": "#",
32
+ "class": "",
33
+ "label": "Grandchild page",
34
+ "children": []
35
+ },
36
+ {
37
+ "link": "#",
38
+ "class": "active",
39
+ "label": "Grandchild page",
40
+ "children": []
41
+ }
42
+ ]
86
43
  }
87
- ]
44
+ ]
45
+ },
46
+ {
47
+ "link": "#",
48
+ "label": "Sibling page",
49
+ "class": "",
50
+ "children": []
51
+ },
52
+ {
53
+ "link": "#",
54
+ "label": "Sibling page",
55
+ "class": "active",
56
+ "children": []
57
+ },
58
+ {
59
+ "link": "#",
60
+ "label": "Sibling page",
61
+ "class": "",
62
+ "children": []
63
+ },
64
+ {
65
+ "link": "#",
66
+ "label": "Sibling page",
67
+ "class": "",
68
+ "children": []
69
+ },
70
+ {
71
+ "link": "#",
72
+ "label": "Sibling page",
73
+ "class": "",
74
+ "children": []
75
+ },
76
+ {
77
+ "link": "#",
78
+ "label": "Sibling page",
79
+ "class": "",
80
+ "children": []
81
+ },
82
+ {
83
+ "link": "#",
84
+ "label": "Sibling page",
85
+ "class": "",
86
+ "children": []
87
+ }
88
+ ]
88
89
  }
@@ -1,66 +1,85 @@
1
- <div class="qld-side-navigation">
2
-
1
+ <nav class="qld-side-navigation" aria-label="Side Navigation">
2
+ <button
3
+ class="accordion-button collapsed d-lg-none"
4
+ type="button"
5
+ data-bs-toggle="collapse"
6
+ data-bs-target="#sideNavCollapse"
7
+ aria-expanded="false"
8
+ aria-controls="sideNavCollapse"
9
+ >
10
+ {{isdefined collapseTitle "In this section"}}
11
+ </button>
12
+ <div class="nav-wrapper collapse d-lg-block" id="sideNavCollapse">
3
13
  <h2 class="nav-title">
4
- {{#if navtitlelink }}
14
+ {{#if navtitlelink}}
5
15
  <a class="nav-link" href="{{navtitlelink}}">{{navtitle}}</a>
6
- {{else}}
16
+ {{else}}
7
17
  {{navtitle}}
8
- {{/if}}
18
+ {{/if}}
9
19
  </h2>
10
20
 
11
21
  <!-- Level One -->
12
22
  <ul class="nav" aria-label="section navigation">
13
23
 
14
- {{#each navlist}}
24
+ {{#each navlist}}
15
25
  <li class="nav-item {{class}}">
16
-
17
- {{#contains "active" class }}
26
+
27
+ {{#contains "active" class}}
18
28
  <span class="nav-link">{{label}}</span>
19
- {{else}}
29
+ {{else}}
20
30
  <a class="nav-link" href="{{link}}" target="{{target}}">
21
- {{label}} {{class}}
31
+ {{label}}
32
+ {{class}}
22
33
  </a>
23
- {{/contains}}
34
+ {{/contains}}
24
35
 
25
- {{#if children}}
36
+ {{#if children}}
26
37
  <!-- Level Two -->
27
38
  <ul>
28
- {{#each children}}
39
+ {{#each children}}
29
40
  <li class="nav-item {{class}}">
30
-
31
- {{#contains "active" class }}
32
- <span class="nav-link">{{label}}</span>
33
- {{else}}
34
- <a class="nav-link" href="{{link}}" target="{{target}}">
35
- {{label}} {{class}}
36
- </a>
37
- {{/contains}}
38
41
 
39
- {{#if children}}
42
+ {{#contains "active" class}}
43
+ <span class="nav-link">{{label}}</span>
44
+ {{else}}
45
+ <a class="nav-link" href="{{link}}" target="{{target}}">
46
+ {{label}}
47
+ {{class}}
48
+ </a>
49
+ {{/contains}}
50
+
51
+ {{#if children}}
40
52
  <!-- Level Three -->
41
53
  <ul class="with-stalks">
42
- {{#each children}}
54
+ {{#each children}}
43
55
  <li class="nav-item {{class}}">
44
-
45
- {{#contains "active" class }}
46
- <span class="nav-link">{{label}}</span>
47
- {{else}}
48
- <a class="nav-link" href="{{link}}" target="{{target}}">
49
- {{label}} {{class}}
50
- </a>
51
- {{/contains}}
56
+
57
+ {{#contains "active" class}}
58
+ <span class="nav-link">{{label}}</span>
59
+ {{else}}
60
+ <a
61
+ class="nav-link"
62
+ href="{{link}}"
63
+ target="{{target}}"
64
+ >
65
+ {{label}}
66
+ {{class}}
67
+ </a>
68
+ {{/contains}}
52
69
 
53
70
  </li>
54
- {{/each}}
71
+ {{/each}}
55
72
  </ul>
56
- {{/if}}
73
+ {{/if}}
57
74
 
58
75
  </li>
59
- {{/each}}
76
+ {{/each}}
60
77
  </ul>
61
- {{/if}}
78
+ {{/if}}
62
79
 
63
80
  </li>
64
- {{/each}}
81
+ {{/each}}
65
82
  </ul>
66
- </div>
83
+ </div>
84
+
85
+ </nav>