@qld-gov-au/qgds-bootstrap5 2.1.2 → 2.1.4

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 (72) hide show
  1. package/.storybook/main.mjs +1 -0
  2. package/.storybook/manager.js +31 -0
  3. package/dist/assets/components/bs5/globalAlert/globalAlert.hbs +2 -2
  4. package/dist/assets/components/bs5/head/head.hbs +1 -1
  5. package/dist/assets/components/bs5/navbar/navbar.hbs +1 -1
  6. package/dist/assets/css/qld.bootstrap.css +2 -2
  7. package/dist/assets/css/qld.bootstrap.css.map +2 -2
  8. package/dist/assets/css/qld.bootstrap.legacy.css +2 -2
  9. package/dist/assets/css/qld.bootstrap.legacy.css.map +2 -2
  10. package/dist/assets/js/handlebars.helpers.bundle.js +1 -1
  11. package/dist/assets/js/handlebars.init.min.js +5 -5
  12. package/dist/assets/js/handlebars.init.min.js.map +1 -1
  13. package/dist/assets/js/handlebars.partials.js +5 -5
  14. package/dist/assets/js/handlebars.partials.js.map +1 -1
  15. package/dist/assets/js/qld.bootstrap.min.js +6 -6
  16. package/dist/assets/js/qld.bootstrap.min.js.map +3 -3
  17. package/dist/assets/node/handlebars.init.min.js +4 -4
  18. package/dist/assets/node/handlebars.init.min.js.map +1 -1
  19. package/dist/components/bs5/globalAlert/globalAlert.hbs +2 -2
  20. package/dist/components/bs5/head/head.hbs +1 -1
  21. package/dist/components/bs5/navbar/navbar.hbs +1 -1
  22. package/dist/package.json +2 -1
  23. package/dist/sample-data/globalAlert/globalAlert.data.json +9 -9
  24. package/package.json +2 -1
  25. package/src/components/bs5/accordion/mdx/_designResources.mdx +0 -1
  26. package/src/components/bs5/backToTop/backToTop.mdx +0 -1
  27. package/src/components/bs5/banner/Banner.mdx +0 -1
  28. package/src/components/bs5/blockquote/Blockquote.mdx +0 -1
  29. package/src/components/bs5/breadcrumbs/Breadcrumbs.mdx +0 -1
  30. package/src/components/bs5/button/Button.mdx +0 -1
  31. package/src/components/bs5/callToAction/callToAction.mdx +0 -1
  32. package/src/components/bs5/callout/Callout.mdx +0 -1
  33. package/src/components/bs5/card/Card.mdx +0 -1
  34. package/src/components/bs5/directionLinks/DirectionLinks.mdx +0 -1
  35. package/src/components/bs5/footer/Footer.mdx +0 -1
  36. package/src/components/bs5/formcheck/stories/checkbox/Checkbox.mdx +1 -3
  37. package/src/components/bs5/formcheck/stories/radio/Radio.mdx +0 -1
  38. package/src/components/bs5/globalAlert/GlobalAlert.mdx +0 -1
  39. package/src/components/bs5/globalAlert/globalAlert.data.json +9 -9
  40. package/src/components/bs5/globalAlert/globalAlert.hbs +2 -2
  41. package/src/components/bs5/globalAlert/globalAlert.scss +24 -9
  42. package/src/components/bs5/globalAlert/globalAlert.stories.js +1 -1
  43. package/src/components/bs5/globalAlert/globalAlert.test.js +0 -14
  44. package/src/components/bs5/header/header.scss +1 -1
  45. package/src/components/bs5/image/Image.mdx +0 -1
  46. package/src/components/bs5/inpageAlert/InpageAlert.mdx +0 -1
  47. package/src/components/bs5/inpageAlert/inpageAlert.stories.js +1 -1
  48. package/src/components/bs5/inpagenav/Inpagenav.mdx +0 -1
  49. package/src/components/bs5/link/link.mdx +1 -3
  50. package/src/components/bs5/linkColumns/linkColumns.mdx +0 -1
  51. package/src/components/bs5/linkColumns/linkColumns.stories.js +11 -10
  52. package/src/components/bs5/navbar/navbar.functions.js +52 -67
  53. package/src/components/bs5/navbar/navbar.hbs +1 -1
  54. package/src/components/bs5/navbar/navbar.scss +119 -46
  55. package/src/components/bs5/pagination/Pagination.mdx +0 -1
  56. package/src/components/bs5/pagination/pagination.scss +14 -18
  57. package/src/components/bs5/promotionalPanel/PromotionalPanel.mdx +0 -1
  58. package/src/components/bs5/promotionalPanel/promotionalPanel.stories.js +17 -15
  59. package/src/components/bs5/quickexit/quickexit.stories.js +1 -1
  60. package/src/components/bs5/searchInput/SearchInput.mdx +1 -1
  61. package/src/components/bs5/searchInput/search.functions.js +48 -2
  62. package/src/components/bs5/searchInput/searchInput.stories.js +1 -1
  63. package/src/components/bs5/spinner/Spinner.stories.js +14 -19
  64. package/src/components/bs5/table/Table.mdx +0 -1
  65. package/src/components/bs5/table/table.stories.js +1 -1
  66. package/src/components/bs5/tabs/Tabs.mdx +0 -1
  67. package/src/components/bs5/tag/Tag.mdx +0 -1
  68. package/src/components/bs5/video/Video.mdx +0 -1
  69. package/src/components/bs5/video/video.scss +1 -1
  70. package/src/components/bs5/video/video.stories.js +1 -1
  71. package/src/css/mixins/focusable.scss +1 -1
  72. package/src/stories/Introduction.mdx +15 -6
@@ -1,37 +1,27 @@
1
1
  import { createFocusTrap } from "../../../js/utils.js";
2
2
  import { breakpoints } from "../../../js/constants.js";
3
+ import { getFocusableElements } from "../../../js/utils.js";
4
+
5
+ const getIsMobile = () => window.innerWidth < breakpoints.lg;
3
6
 
4
7
  export function initializeNavbar() {
5
8
  const navbar = document.getElementById("main-nav");
6
9
  const overlay = document.getElementById("overlay");
7
10
  const burgerBtn = document.getElementById("burgerBtn");
8
11
  const burgerCloseBtn = document.getElementById("burgerCloseBtn");
9
- const addHideTo = ["head", "main", "footer"];
10
- const hideTargets = addHideTo
11
- .map((id) => document.getElementById(id))
12
- .filter(Boolean);
13
-
14
- // Helper to set aria-hidden
15
- const setAriaHidden = (hidden) => {
16
- hideTargets.forEach((el) => {
17
- if (hidden) {
18
- el.setAttribute("aria-hidden", "true");
19
- } else {
20
- el.removeAttribute("aria-hidden");
21
- }
22
- });
23
- };
12
+
13
+ /** @type {HTMLElement[]} */
14
+ let inertTargets = [];
24
15
 
25
16
  // Focus trap instances (created on-demand)
26
17
  let mobileFocusTrap = null;
27
- const dropdownFocusTraps = new Map();
28
18
 
29
19
  function closeNavbar() {
30
20
  // Do not call static method bootstrap.Collapse.getInstance(navbar).hide()
31
21
  // because storybook has a problem with referencing global bootstrap object in production build.
32
22
  // Instead simulate the close button click - same thing.
33
23
  // Do not put side effects of closing menu here (eg clearing menu focus trap), instead use "hidden.bs.collapse" or "hide.bs.collapse" event handlers declared below.
34
- // Need to check if menu is actually set to show, otherwise cick will open instead.
24
+ // Need to check if menu is actually set to show, otherwise click will open instead.
35
25
  if (navbar?.classList.contains("show")) {
36
26
  burgerCloseBtn?.click();
37
27
  }
@@ -50,25 +40,7 @@ export function initializeNavbar() {
50
40
  return mobileFocusTrap;
51
41
  }
52
42
 
53
- // Create dropdown focus trap on-demand (when dropdown opens)
54
- function getOrCreateDropdownFocusTrap(dropdown, toggle) {
55
- if (!dropdownFocusTraps.has(dropdown)) {
56
- const dropdownTrap = createFocusTrap(dropdown, {
57
- returnFocusElement: toggle,
58
- onEscape: () => {
59
- // Close the dropdown using Bootstrap's API
60
- const bsDropdown = bootstrap.Dropdown.getInstance(toggle);
61
- if (bsDropdown) {
62
- bsDropdown.hide();
63
- }
64
- },
65
- });
66
- dropdownFocusTraps.set(dropdown, dropdownTrap);
67
- }
68
- return dropdownFocusTraps.get(dropdown);
69
- }
70
-
71
- // Setup dropdown event listeners
43
+ // Setup dropdown event listeners.
72
44
  function setupDropdownListeners() {
73
45
  // Find all dropdown toggles (elements with data-bs-toggle="dropdown")
74
46
  const dropdownToggles = navbar?.querySelectorAll(
@@ -84,21 +56,29 @@ export function initializeNavbar() {
84
56
  const dropdown = parentItem.querySelector(".dropdown-menu");
85
57
  if (!dropdown) return;
86
58
 
87
- // Listen for dropdown show event (desktop only)
88
- toggle.addEventListener("shown.bs.dropdown", () => {
89
- const isMobile = window.innerWidth < breakpoints.lg;
90
- if (!isMobile) {
91
- // Create and activate focus trap on-demand
92
- const dropdownTrap = getOrCreateDropdownFocusTrap(dropdown, toggle);
93
- setTimeout(() => dropdownTrap.activate(), 0);
94
- }
95
- });
59
+ // Add spacebar click for <a> tags, <buttons> already have this.
60
+ if (toggle?.tagName === "A") {
61
+ toggle.addEventListener("keydown", (/** @type KeyboardEvent*/ e) => {
62
+ if (e.key === " ") {
63
+ e.preventDefault();
64
+ toggle.click();
65
+ }
66
+ });
67
+ }
96
68
 
97
- // Listen for dropdown hide event
98
- toggle.addEventListener("hidden.bs.dropdown", () => {
99
- const dropdownTrap = dropdownFocusTraps.get(dropdown);
100
- if (dropdownTrap && dropdownTrap.isActive) {
101
- dropdownTrap.deactivate();
69
+ // There are two separate toggle elements for desktop and mobile. Bootstrap only keeps one registered for these events,
70
+ // which is the mobile button, hidden on desktop. Therefore, we need to handle any `a.dropdown-toggle` updates manually. The event is caught on the
71
+ // mobile toggle, so traverse back up find the desktop toggle.
72
+ toggle.addEventListener("hidden.bs.dropdown", (e) => {
73
+ const _toggle = parentItem.querySelector(
74
+ 'a[data-bs-toggle="dropdown"]',
75
+ );
76
+ _toggle?.classList.remove("show");
77
+ if (
78
+ dropdown?.contains(document.activeElement) &&
79
+ !(getIsMobile() || navbar.classList.contains("vertical"))
80
+ ) {
81
+ _toggle?.focus();
102
82
  }
103
83
  });
104
84
  });
@@ -115,13 +95,13 @@ export function initializeNavbar() {
115
95
  });
116
96
 
117
97
  const resetNavbarState = () => {
118
- const isMobile = window.innerWidth < breakpoints.lg;
119
- const dropdownToggles = document.querySelectorAll(
120
- ".navbar a.dropdown-toggle, .navbar a.no-dropdown-toggle",
98
+ const isMobile = getIsMobile();
99
+ const dropdownToggles = navbar?.querySelectorAll(
100
+ "a.dropdown-toggle, a.no-dropdown-toggle",
121
101
  );
122
102
 
123
103
  // Toggle dropdown functionality based on screen size
124
- dropdownToggles.forEach((toggle) => {
104
+ dropdownToggles?.forEach((toggle) => {
125
105
  if (isMobile) {
126
106
  // Skip toggle items with hasNoLink class
127
107
  if (toggle.classList.contains("hasNoLink")) {
@@ -150,8 +130,9 @@ export function initializeNavbar() {
150
130
 
151
131
  // All associated side effects of navbar collapse completion belong here.
152
132
  navbar?.addEventListener("hidden.bs.collapse", () => {
153
- setAriaHidden(false);
154
-
133
+ inertTargets.forEach((target) => {
134
+ target.inert = false;
135
+ });
155
136
  // Deactivate and destroy mobile focus trap
156
137
  if (mobileFocusTrap) {
157
138
  mobileFocusTrap.deactivate();
@@ -159,20 +140,24 @@ export function initializeNavbar() {
159
140
  }
160
141
  });
161
142
 
162
- // Burger buttons - handle open (mobile only)
143
+ // All associated side effects of navbar opening belong here.
163
144
  navbar?.addEventListener("shown.bs.collapse", () => {
164
- // Check if navbar is opening
165
- setTimeout(() => {
166
- if (navbar?.classList.contains("show")) {
167
- setAriaHidden(true);
168
-
169
- // Create and activate focus trap when navbar opens (mobile only - whole navbar)
170
- const isMobile = window.innerWidth < breakpoints.lg;
171
- if (isMobile) {
145
+ if (getIsMobile) {
146
+ // Check if navbar is opening
147
+ setTimeout(() => {
148
+ if (navbar?.classList.contains("show")) {
149
+ // set all siblings to inert
150
+ inertTargets = Array.from(navbar.parentElement.children).filter(
151
+ (child) => child !== navbar,
152
+ );
153
+ inertTargets.forEach((target) => {
154
+ target.inert = true;
155
+ });
156
+
172
157
  const trap = createMobileFocusTrap();
173
158
  trap.activate();
174
159
  }
175
- }
176
- }, 0);
160
+ }, 0);
161
+ }
177
162
  });
178
163
  }
@@ -26,7 +26,7 @@
26
26
  {{text}}
27
27
  {{/if}}
28
28
  </a>
29
- <button class="nav-link dropdown-toggle"{{#if currentPage}} aria-current="page"{{/if}} data-bs-toggle="dropdown" aria-expanded="false" aria-selected="false" aria-label="Toggle navigation">
29
+ <button class="nav-link dropdown-toggle"{{#if currentPage}} aria-current="page"{{/if}} data-bs-toggle="dropdown" data-bs-auto-close="false" aria-expanded="false" aria-selected="false" aria-label="Toggle navigation">
30
30
  <span class="visually-hidden">Expand</span>
31
31
  </button>
32
32
  <ul class="dropdown-menu">
@@ -1,3 +1,6 @@
1
+ @use "../../../css/mixins" as m;
2
+ @use "../../../css/functions" as f;
3
+
1
4
  @mixin repeatedVerticalStyles {
2
5
  .nav-header {
3
6
  min-height: var(--qld-header-preheader-height, 4rem);
@@ -18,6 +21,8 @@
18
21
  border-radius: 0;
19
22
  display: block;
20
23
  padding-inline: 1.5rem;
24
+
25
+ @include m.focusable($offsetOutline: -3px);
21
26
  }
22
27
  }
23
28
  > .container {
@@ -82,6 +87,9 @@
82
87
  box-shadow:
83
88
  0px 1px 2px rgba(0, 0, 0, 0.2),
84
89
  0px 1px 3px rgba(0, 0, 0, 0.1);
90
+
91
+ @include m.focusable();
92
+
85
93
  &:hover {
86
94
  box-shadow:
87
95
  0px 4px 8px 3px rgba(0, 0, 0, 0.1),
@@ -100,9 +108,6 @@
100
108
  transform: rotate(0deg);
101
109
  transition: transform var(--animation-time) ease-in;
102
110
  }
103
- &:focus {
104
- outline: 2px solid var(--qld-focus-color);
105
- }
106
111
  }
107
112
  .nav-link {
108
113
  border-block-end: 0;
@@ -124,6 +129,7 @@
124
129
  display: block;
125
130
  padding: 0;
126
131
  box-shadow: none;
132
+ columns: unset;
127
133
  &::before {
128
134
  display: none;
129
135
  }
@@ -140,12 +146,15 @@
140
146
  border-inline-start-color: var(--dropdown-show-bg);
141
147
  gap: 0;
142
148
  &::after {
143
- content: "";
144
149
  content: none;
145
150
  }
146
151
  &:hover {
147
152
  transition: none;
148
153
  }
154
+
155
+ &:focus {
156
+ outline-offset: -3px;
157
+ }
149
158
  }
150
159
  p {
151
160
  position: absolute;
@@ -172,7 +181,6 @@
172
181
  text-decoration-color: inherit;
173
182
  padding: 0;
174
183
  &:after {
175
- content: "";
176
184
  content: none;
177
185
  }
178
186
  }
@@ -205,6 +213,7 @@
205
213
  }
206
214
  a.dropdown-item {
207
215
  background-color: transparent;
216
+ border-radius: 0;
208
217
  &:hover {
209
218
  background-color: transparent;
210
219
  }
@@ -214,6 +223,8 @@
214
223
  border-block-end: 0;
215
224
  margin-block-end: 0;
216
225
  position: relative;
226
+ outline-offset: -3px;
227
+
217
228
  &::before {
218
229
  content: "";
219
230
  position: absolute;
@@ -248,8 +259,9 @@
248
259
  background-color: transparent;
249
260
  }
250
261
  }
251
- &:focus {
252
- outline-offset: 0;
262
+
263
+ &:focus::before {
264
+ z-index: -1;
253
265
  }
254
266
  }
255
267
  }
@@ -336,6 +348,7 @@
336
348
  --mobile-only-display: block;
337
349
  --visibility-display: visible;
338
350
  --nav-header-border-color: var(--#{$prefix}dark-border);
351
+
339
352
  .qld-header:has(.qld-header-pre-header.dark) ~ & {
340
353
  --vert-background-color: var(--#{$prefix}dark-background);
341
354
  --background-color: var(--#{$prefix}default-background-shade);
@@ -355,6 +368,15 @@
355
368
  --nav-header-icon-color: var(--#{$prefix}brand-accent);
356
369
  --navbar-collapse-bg: var(--#{$prefix}dark-background-shade);
357
370
  --action-icon-color_active: var(--text-color);
371
+
372
+ > :where(*) {
373
+ --qld-focus-color: var(--qld-light-focus);
374
+ }
375
+
376
+ .nav-header {
377
+ --qld-focus-color: var(--qld-dark-focus);
378
+ }
379
+
358
380
  .alt {
359
381
  --vert-background-color: var(--#{$prefix}default-background);
360
382
  --background-color: var(--#{$prefix}sapphire-blue);
@@ -369,6 +391,11 @@
369
391
  --dropdown-bg-color: var(--#{$prefix}dark-background);
370
392
  --action-icon-color: var(--#{$prefix}brand-accent);
371
393
  --action-icon-color_active: var(--text-color);
394
+
395
+ > :where(*) {
396
+ --qld-focus-color: var(--qld-dark-focus);
397
+ }
398
+
372
399
  .nav-link {
373
400
  border-inline-start: 0;
374
401
  }
@@ -393,6 +420,14 @@
393
420
  --navbar-collapse-bg: var(--#{$prefix}default-background-shade);
394
421
  --action-icon-color_active: var(--text-color);
395
422
 
423
+ > :where(*) {
424
+ --qld-focus-color: var(--qld-dark-focus);
425
+ }
426
+
427
+ .nav-header {
428
+ --qld-focus-color: var(--qld-light-focus);
429
+ }
430
+
396
431
  .alt {
397
432
  --vert-background-color: var(--#{$prefix}dark-background);
398
433
  --background-color: var(--#{$prefix}default-background);
@@ -406,11 +441,13 @@
406
441
  --header-color: var(--#{$prefix}default-background);
407
442
  --action-icon-color: var(--#{$prefix}alt-button-hover);
408
443
  --action-icon-color_active: var(--text-color);
444
+
409
445
  .nav-link {
410
446
  border-inline-start: 0;
411
447
  }
412
448
  }
413
449
  }
450
+
414
451
  .qld-header:has(.qld-header-pre-header.dark-alt) ~ & {
415
452
  --background-color: var(--#{$prefix}dark-background-shade);
416
453
  --background-color-hover: var(--#{$prefix}dark-alt-background);
@@ -429,6 +466,15 @@
429
466
  --nav-header-border-color: var(--#{$prefix}dark-border);
430
467
  --nav-header-icon-color: var(--#{$prefix}dark-action-secondary);
431
468
  --action-icon-color_active: var(--text-color);
469
+
470
+ > :where(*) {
471
+ --qld-focus-color: var(--qld-dark-focus);
472
+ }
473
+
474
+ .nav-header {
475
+ --qld-focus-color: var(--qld-dark-focus);
476
+ }
477
+
432
478
  .alt {
433
479
  --background-color: var(--#{$prefix}dark-alt-background-shade);
434
480
  --background-color-hover: var(--#{$prefix}dark-alt-background-shade);
@@ -438,6 +484,11 @@
438
484
  --action-icon-color: var(--#{$prefix}brand-accent);
439
485
  --link-border-color-hover: var(--#{$prefix}dark-action-secondary-hover);
440
486
  --action-icon-color_active: var(--text-color);
487
+
488
+ > :where(*) {
489
+ --qld-focus-color: var(--qld-dark-focus);
490
+ }
491
+
441
492
  .nav-link {
442
493
  border-inline-start: 0;
443
494
  }
@@ -500,24 +551,43 @@
500
551
  background-color: var(--action-icon-color);
501
552
  }
502
553
  }
503
- .navbar-nav a.nav-link,
504
- a.dropdown-item {
554
+
555
+ .navbar-nav a.nav-link {
505
556
  color: var(--text-color);
506
557
  padding-block: var(--nav-link-padding-block);
507
558
  padding-inline: 0.75rem;
508
559
  display: flex;
509
- line-height: 2rem;
560
+ line-height: f.snap-line-height(1.4);
510
561
  gap: 0.5rem;
511
562
  align-items: center;
512
563
  &:hover {
513
564
  color: var(--link-color);
514
- text-decoration: underline;
515
- text-underline-offset: 0.3rem;
516
- text-decoration-thickness: 0.125rem;
565
+ text-decoration-line: underline;
566
+ text-decoration-color: currentColor;
517
567
  }
518
568
  &:focus {
519
- outline-offset: -2px;
569
+ z-index: 1;
570
+ outline-offset: -3px;
571
+ }
572
+ }
573
+
574
+ a.dropdown-item {
575
+ color: var(--link-color);
576
+ padding-block: var(--nav-link-padding-block);
577
+ padding-inline: 0.75rem;
578
+ display: flex;
579
+ line-height: f.snap-line-height(1.4);
580
+ gap: 0.5rem;
581
+ align-items: flex-start;
582
+ border-radius: 0.25rem;
583
+ &:hover {
584
+ color: var(--link-color);
585
+ text-decoration-line: underline;
586
+ text-decoration-color: currentColor;
587
+ }
588
+ @include m.focusable($offsetOutline: -3px) {
520
589
  box-shadow: none;
590
+ background-color: transparent;
521
591
  }
522
592
  }
523
593
  a.dropdown-toggle {
@@ -546,6 +616,8 @@
546
616
  }
547
617
  }
548
618
  .dropdown-menu.show {
619
+ display: block;
620
+ columns: 3;
549
621
  margin-block-start: calc(
550
622
  var(--horizontal-bar-border-width) - var(--border-width)
551
623
  );
@@ -555,21 +627,20 @@
555
627
  border-radius: 0.75rem;
556
628
  border-start-start-radius: 0;
557
629
  border-start-end-radius: 0;
630
+ border-width: 0;
558
631
  color: var(--text-color);
559
632
  box-shadow: var(--shadow-dropdown);
560
- display: grid;
561
- grid-template-columns: repeat(3, 1fr);
562
633
  column-gap: 2rem;
563
- row-gap: 0;
564
634
  z-index: 999;
565
- border-width: 0;
566
- @include media-breakpoint-up(xl) {
567
- column-gap: 4rem;
568
- row-gap: 0;
569
- }
635
+
570
636
  @include media-breakpoint-up(md) {
571
637
  padding-block: 3rem;
572
638
  }
639
+
640
+ @include media-breakpoint-up(xl) {
641
+ column-gap: 4rem;
642
+ }
643
+
573
644
  &::before {
574
645
  content: "";
575
646
  position: absolute;
@@ -578,21 +649,26 @@
578
649
  inset-block-start: 0;
579
650
  background-color: var(--dropdown-bg-color);
580
651
  }
652
+
581
653
  li {
582
- display: flex;
654
+ break-inside: avoid-column;
655
+
583
656
  &.mobile-only {
584
657
  display: var(--mobile-only-display);
585
658
  }
586
- &:has(p) {
587
- flex-direction: column;
588
- row-gap: 20px;
589
- p {
590
- font-size: 0.875rem;
659
+
660
+ p {
661
+ font-size: 0.875rem;
662
+ margin-block: f.remify(16px);
663
+
664
+ &:first-of-type {
665
+ margin-block-start: f.remify(20px);
591
666
  }
592
667
  }
668
+
593
669
  a {
594
670
  display: flex;
595
- align-items: center;
671
+ align-items: flex-start;
596
672
  padding-inline-start: 0;
597
673
  padding-inline-end: 0.5rem;
598
674
  white-space: normal;
@@ -610,7 +686,7 @@
610
686
  mask-repeat: no-repeat;
611
687
  mask-position: 0;
612
688
  background-color: var(--action-icon-color);
613
- height: 1.25rem;
689
+ height: 1lh;
614
690
  width: 1.25rem;
615
691
  min-width: 1.25rem;
616
692
  margin-inline-start: auto;
@@ -624,29 +700,22 @@
624
700
  padding-inline-end var(--animation-time) ease-in-out,
625
701
  gap var(--animation-time) ease-in-out;
626
702
  }
627
- &:focus {
628
- outline-offset: 2px;
703
+ @include m.focusable() {
629
704
  box-shadow: none;
630
705
  }
631
706
  }
632
- p {
633
- text-align: start;
634
- margin-block-start: 1rem;
635
- }
636
- p:first-of-type {
637
- margin-block-start: 0;
638
- }
639
- p:last-of-type {
640
- margin-block-end: 0;
641
- }
642
707
  }
708
+
643
709
  li:has(.parent-link) {
644
710
  border-block-end: 2px solid var(--border-color);
645
711
  padding-block-end: 2rem;
646
712
  margin-block-end: 2rem;
647
713
  gap: 1rem;
648
- grid-column: 1 / -1;
714
+ column-span: all;
715
+
649
716
  .dropdown-item {
717
+ width: auto;
718
+ display: inline-flex;
650
719
  border-block-end: 0;
651
720
  padding-block: 0;
652
721
  gap: 1rem;
@@ -672,11 +741,15 @@
672
741
  border-block-start: 2px solid var(--border-color);
673
742
  padding-block-start: 2rem;
674
743
  margin-block-start: 2rem;
675
- grid-column: 1 / -1;
744
+ text-align: end;
745
+ column-span: all;
746
+
676
747
  .dropdown-item {
677
748
  border-block-end: 0;
678
- display: flex;
749
+ display: inline-flex;
750
+ width: auto;
679
751
  flex-direction: row-reverse;
752
+ align-items: center;
680
753
  padding-inline-end: 0.5rem;
681
754
  gap: 0.5rem;
682
755
  font-size: 1.25rem;
@@ -694,7 +767,6 @@
694
767
  transform: scaleX(var(--icon-dir));
695
768
  }
696
769
  &::after {
697
- content: "";
698
770
  content: none;
699
771
  }
700
772
  &:hover {
@@ -753,6 +825,7 @@
753
825
  .nav-header .navbar-brand {
754
826
  color: var(--nav-header-color);
755
827
  }
828
+
756
829
  #burgerCloseBtn {
757
830
  --qld-btn-close-bg: none;
758
831
  --qld-btn-close-opacity: 1;
@@ -9,7 +9,6 @@ import * as PaginationStories from "./pagination.stories";
9
9
 
10
10
  ## Design resources
11
11
 
12
- - [Component library (Figma)](https://www.figma.com/file/qKsxl3ogIlBp7dafgxXuCA/QLD-GOV-DDS?type=design&node-id=23167-395566&mode=design&t=NREcuP5UOBB2Y6G4-4)
13
12
  - [Master component file (Figma)](https://www.figma.com/file/qKsxl3ogIlBp7dafgxXuCA/QLD-GOV-DDS?type=design&node-id=11056-321779&mode=design&t=YLfxdziHdqD2Ty0o-0)
14
13
  - [Design System website](https://www.designsystem.qld.gov.au/components/pagination)
15
14
  - [Bootstrap component](https://getbootstrap.com/docs/5.3/components/pagination/)
@@ -1,6 +1,8 @@
1
1
  // QGDS QOL Pagination
2
2
  // extends https://getbootstrap.com/docs/5.3/components/pagination/#variables
3
3
 
4
+ @use "../../../css/mixins" as m;
5
+
4
6
  //PREV NEXT ARROW on default background
5
7
  $pagination-icon-prevnext-color: var(--#{$prefix}light-action-secondary);
6
8
  $pagination-icon-prevnext-hover-color: var(
@@ -45,7 +47,7 @@ $pagination-icon-more-dark-hover-color: var(--#{$prefix}dark-action-secondary);
45
47
  --#{$prefix}pagination-focus-border-color: var(
46
48
  --#{$prefix}dark-action-secondary
47
49
  );
48
- --#{$prefix}pagination-focus-outline-color: var(--#{$prefix}light-link);
50
+ --#{$prefix}focus-color: var(--#{$prefix}light-focus);
49
51
  --#{$prefix}pagination-focus-bg: transparent;
50
52
 
51
53
  //Hover
@@ -99,7 +101,7 @@ $pagination-icon-more-dark-hover-color: var(--#{$prefix}dark-action-secondary);
99
101
  --#{$prefix}pagination-focus-border-color: var(
100
102
  --#{$prefix}dark-action-secondary
101
103
  );
102
- --#{$prefix}pagination-focus-outline-color: var(--#{$prefix}dark-focus);
104
+ --#{$prefix}focus-color: var(--#{$prefix}dark-focus);
103
105
  --#{$prefix}pagination-focus-bg: transparent;
104
106
 
105
107
  //Hover
@@ -171,9 +173,7 @@ $pagination-icon-more-dark-hover-color: var(--#{$prefix}dark-action-secondary);
171
173
  background-color: var(--#{$prefix}pagination-hover-bg);
172
174
  }
173
175
 
174
- &:focus {
175
- outline: 2px solid var(--#{$prefix}pagination-focus-outline-color);
176
- outline-offset: 2px;
176
+ @include m.focusable($offsetOutline: 2px) {
177
177
  border-color: var(--#{$prefix}pagination-hover-border-color);
178
178
  box-shadow: inset 0 0 0 1px
179
179
  var(--#{$prefix}pagination-hover-border-color);
@@ -245,9 +245,7 @@ $pagination-icon-more-dark-hover-color: var(--#{$prefix}dark-action-secondary);
245
245
  box-shadow: none;
246
246
  }
247
247
 
248
- &:focus {
249
- outline: 2px solid var(--#{$prefix}pagination-focus-outline-color);
250
- outline-offset: 2px;
248
+ @include m.focusable($offsetOutline: 2px) {
251
249
  border: none;
252
250
  box-shadow: none;
253
251
  }
@@ -260,18 +258,16 @@ $pagination-icon-more-dark-hover-color: var(--#{$prefix}dark-action-secondary);
260
258
  background-color: var(--#{$prefix}pagination-active-bg);
261
259
  border-color: var(--#{$prefix}pagination-active-border-color);
262
260
 
263
- &:hover {
264
- border-color: var(--#{$prefix}pagination-active-bg);
265
- box-shadow: var(--#{$prefix}pagination-active-dropshadow);
266
- background-color: var(--#{$prefix}pagination-active-hover-bg);
261
+ @include m.focusable($offsetOutline: 2px) {
262
+ box-shadow: none;
263
+ border-color: var(--#{$prefix}pagination-active-focus-bg);
264
+ background-color: var(--#{$prefix}pagination-active-focus-bg);
267
265
  }
268
266
 
269
- &:focus {
270
- outline: 2px solid var(--#{$prefix}pagination-focus-outline-color);
271
- outline-offset: 2px;
272
- border-color: var(--#{$prefix}pagination-active-bg);
273
- box-shadow: var(--#{$prefix}pagination-active-dropshadow);
274
- background-color: var(--#{$prefix}pagination-active-focus-bg);
267
+ &:hover {
268
+ box-shadow: none;
269
+ border-color: var(--#{$prefix}pagination-active-hover-bg);
270
+ background-color: var(--#{$prefix}pagination-active-hover-bg);
275
271
  }
276
272
  }
277
273
 
@@ -10,7 +10,6 @@ import defaultdata from "./promotionalPanel.data.json";
10
10
 
11
11
  ## Design resources
12
12
 
13
- - [Component library (Figma)](https://www.figma.com/design/qKsxl3ogIlBp7dafgxXuCA/QGDS-UI-kit?node-id=23269-286312&p=f&t=SY0WW7uiwAl3ioEj-0)
14
13
  - [Master component file (Figma)](https://www.figma.com/design/qKsxl3ogIlBp7dafgxXuCA/QGDS-UI-kit?node-id=23269-286312&p=f&t=nVLTSHpRu8jvVSar-0)
15
14
  - [Design System website](https://www.designsystem.qld.gov.au/components/promotional-panel)
16
15