@qld-gov-au/qgds-bootstrap5 2.1.3 → 2.1.5
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.
- package/.storybook/main.mjs +1 -0
- package/.storybook/manager.js +31 -0
- package/dist/assets/components/bs5/globalAlert/globalAlert.hbs +2 -2
- package/dist/assets/components/bs5/head/head.hbs +1 -1
- package/dist/assets/components/bs5/inpagenav/inpagenav.hbs +10 -10
- package/dist/assets/components/bs5/navbar/navbar.hbs +1 -1
- package/dist/assets/css/qld.bootstrap.css +2 -2
- package/dist/assets/css/qld.bootstrap.css.map +2 -2
- package/dist/assets/css/qld.bootstrap.legacy.css +2 -2
- package/dist/assets/css/qld.bootstrap.legacy.css.map +2 -2
- package/dist/assets/js/handlebars.helpers.bundle.js +1 -1
- package/dist/assets/js/handlebars.init.min.js +15 -15
- package/dist/assets/js/handlebars.init.min.js.map +1 -1
- package/dist/assets/js/handlebars.partials.js +15 -15
- package/dist/assets/js/handlebars.partials.js.map +1 -1
- package/dist/assets/js/qld.bootstrap.min.js +6 -6
- package/dist/assets/js/qld.bootstrap.min.js.map +3 -3
- package/dist/assets/node/handlebars.init.min.js +5 -5
- package/dist/assets/node/handlebars.init.min.js.map +1 -1
- package/dist/components/bs5/globalAlert/globalAlert.hbs +2 -2
- package/dist/components/bs5/head/head.hbs +1 -1
- package/dist/components/bs5/inpagenav/inpagenav.hbs +10 -10
- package/dist/components/bs5/navbar/navbar.hbs +1 -1
- package/dist/package.json +2 -1
- package/dist/sample-data/globalAlert/globalAlert.data.json +9 -9
- package/package.json +2 -1
- package/src/components/bs5/globalAlert/globalAlert.data.json +9 -9
- package/src/components/bs5/globalAlert/globalAlert.hbs +2 -2
- package/src/components/bs5/globalAlert/globalAlert.scss +24 -9
- package/src/components/bs5/globalAlert/globalAlert.stories.js +1 -1
- package/src/components/bs5/globalAlert/globalAlert.test.js +0 -14
- package/src/components/bs5/inpageAlert/inpageAlert.stories.js +1 -1
- package/src/components/bs5/inpagenav/inpagenav.hbs +10 -10
- package/src/components/bs5/linkColumns/linkColumns.scss +24 -5
- package/src/components/bs5/linkColumns/linkColumns.stories.js +11 -10
- package/src/components/bs5/navbar/navbar.functions.js +52 -67
- package/src/components/bs5/navbar/navbar.hbs +1 -1
- package/src/components/bs5/navbar/navbar.scss +50 -39
- package/src/components/bs5/promotionalPanel/promotionalPanel.stories.js +17 -15
- package/src/components/bs5/quickexit/quickexit.stories.js +1 -1
- package/src/components/bs5/searchInput/searchInput.stories.js +1 -1
- package/src/components/bs5/spinner/Spinner.stories.js +14 -19
- package/src/components/bs5/table/table.stories.js +1 -1
- package/src/components/bs5/video/video.stories.js +1 -1
- 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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
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
|
-
//
|
|
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
|
-
//
|
|
88
|
-
toggle
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
//
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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 =
|
|
119
|
-
const dropdownToggles =
|
|
120
|
-
"
|
|
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
|
|
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
|
-
|
|
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
|
-
//
|
|
143
|
+
// All associated side effects of navbar opening belong here.
|
|
163
144
|
navbar?.addEventListener("shown.bs.collapse", () => {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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
|
-
}
|
|
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,4 +1,5 @@
|
|
|
1
1
|
@use "../../../css/mixins" as m;
|
|
2
|
+
@use "../../../css/functions" as f;
|
|
2
3
|
|
|
3
4
|
@mixin repeatedVerticalStyles {
|
|
4
5
|
.nav-header {
|
|
@@ -128,6 +129,7 @@
|
|
|
128
129
|
display: block;
|
|
129
130
|
padding: 0;
|
|
130
131
|
box-shadow: none;
|
|
132
|
+
columns: unset;
|
|
131
133
|
&::before {
|
|
132
134
|
display: none;
|
|
133
135
|
}
|
|
@@ -211,6 +213,7 @@
|
|
|
211
213
|
}
|
|
212
214
|
a.dropdown-item {
|
|
213
215
|
background-color: transparent;
|
|
216
|
+
border-radius: 0;
|
|
214
217
|
&:hover {
|
|
215
218
|
background-color: transparent;
|
|
216
219
|
}
|
|
@@ -548,19 +551,23 @@
|
|
|
548
551
|
background-color: var(--action-icon-color);
|
|
549
552
|
}
|
|
550
553
|
}
|
|
554
|
+
|
|
551
555
|
.navbar-nav a.nav-link {
|
|
552
556
|
color: var(--text-color);
|
|
553
557
|
padding-block: var(--nav-link-padding-block);
|
|
554
558
|
padding-inline: 0.75rem;
|
|
555
559
|
display: flex;
|
|
556
|
-
line-height:
|
|
560
|
+
line-height: f.snap-line-height(1.4);
|
|
557
561
|
gap: 0.5rem;
|
|
558
562
|
align-items: center;
|
|
559
563
|
&:hover {
|
|
560
564
|
color: var(--link-color);
|
|
561
|
-
text-decoration: underline;
|
|
562
|
-
text-
|
|
563
|
-
|
|
565
|
+
text-decoration-line: underline;
|
|
566
|
+
text-decoration-color: currentColor;
|
|
567
|
+
}
|
|
568
|
+
&:focus {
|
|
569
|
+
z-index: 1;
|
|
570
|
+
outline-offset: -3px;
|
|
564
571
|
}
|
|
565
572
|
}
|
|
566
573
|
|
|
@@ -569,17 +576,18 @@
|
|
|
569
576
|
padding-block: var(--nav-link-padding-block);
|
|
570
577
|
padding-inline: 0.75rem;
|
|
571
578
|
display: flex;
|
|
572
|
-
line-height:
|
|
579
|
+
line-height: f.snap-line-height(1.4);
|
|
573
580
|
gap: 0.5rem;
|
|
574
|
-
align-items:
|
|
581
|
+
align-items: flex-start;
|
|
582
|
+
border-radius: 0.25rem;
|
|
575
583
|
&:hover {
|
|
576
584
|
color: var(--link-color);
|
|
577
|
-
text-decoration: underline;
|
|
578
|
-
text-
|
|
579
|
-
text-decoration-thickness: 0.125rem;
|
|
585
|
+
text-decoration-line: underline;
|
|
586
|
+
text-decoration-color: currentColor;
|
|
580
587
|
}
|
|
581
588
|
@include m.focusable($offsetOutline: -3px) {
|
|
582
589
|
box-shadow: none;
|
|
590
|
+
background-color: transparent;
|
|
583
591
|
}
|
|
584
592
|
}
|
|
585
593
|
a.dropdown-toggle {
|
|
@@ -608,6 +616,8 @@
|
|
|
608
616
|
}
|
|
609
617
|
}
|
|
610
618
|
.dropdown-menu.show {
|
|
619
|
+
display: block;
|
|
620
|
+
columns: 3;
|
|
611
621
|
margin-block-start: calc(
|
|
612
622
|
var(--horizontal-bar-border-width) - var(--border-width)
|
|
613
623
|
);
|
|
@@ -617,21 +627,20 @@
|
|
|
617
627
|
border-radius: 0.75rem;
|
|
618
628
|
border-start-start-radius: 0;
|
|
619
629
|
border-start-end-radius: 0;
|
|
630
|
+
border-width: 0;
|
|
620
631
|
color: var(--text-color);
|
|
621
632
|
box-shadow: var(--shadow-dropdown);
|
|
622
|
-
display: grid;
|
|
623
|
-
grid-template-columns: repeat(3, 1fr);
|
|
624
633
|
column-gap: 2rem;
|
|
625
|
-
row-gap: 0;
|
|
626
634
|
z-index: 999;
|
|
627
|
-
|
|
628
|
-
@include media-breakpoint-up(xl) {
|
|
629
|
-
column-gap: 4rem;
|
|
630
|
-
row-gap: 0;
|
|
631
|
-
}
|
|
635
|
+
|
|
632
636
|
@include media-breakpoint-up(md) {
|
|
633
637
|
padding-block: 3rem;
|
|
634
638
|
}
|
|
639
|
+
|
|
640
|
+
@include media-breakpoint-up(xl) {
|
|
641
|
+
column-gap: 4rem;
|
|
642
|
+
}
|
|
643
|
+
|
|
635
644
|
&::before {
|
|
636
645
|
content: "";
|
|
637
646
|
position: absolute;
|
|
@@ -640,21 +649,26 @@
|
|
|
640
649
|
inset-block-start: 0;
|
|
641
650
|
background-color: var(--dropdown-bg-color);
|
|
642
651
|
}
|
|
652
|
+
|
|
643
653
|
li {
|
|
644
|
-
|
|
654
|
+
break-inside: avoid-column;
|
|
655
|
+
|
|
645
656
|
&.mobile-only {
|
|
646
657
|
display: var(--mobile-only-display);
|
|
647
658
|
}
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
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);
|
|
653
666
|
}
|
|
654
667
|
}
|
|
668
|
+
|
|
655
669
|
a {
|
|
656
670
|
display: flex;
|
|
657
|
-
align-items:
|
|
671
|
+
align-items: flex-start;
|
|
658
672
|
padding-inline-start: 0;
|
|
659
673
|
padding-inline-end: 0.5rem;
|
|
660
674
|
white-space: normal;
|
|
@@ -672,7 +686,7 @@
|
|
|
672
686
|
mask-repeat: no-repeat;
|
|
673
687
|
mask-position: 0;
|
|
674
688
|
background-color: var(--action-icon-color);
|
|
675
|
-
height:
|
|
689
|
+
height: 1lh;
|
|
676
690
|
width: 1.25rem;
|
|
677
691
|
min-width: 1.25rem;
|
|
678
692
|
margin-inline-start: auto;
|
|
@@ -690,24 +704,18 @@
|
|
|
690
704
|
box-shadow: none;
|
|
691
705
|
}
|
|
692
706
|
}
|
|
693
|
-
p {
|
|
694
|
-
text-align: start;
|
|
695
|
-
margin-block-start: 1rem;
|
|
696
|
-
}
|
|
697
|
-
p:first-of-type {
|
|
698
|
-
margin-block-start: 0;
|
|
699
|
-
}
|
|
700
|
-
p:last-of-type {
|
|
701
|
-
margin-block-end: 0;
|
|
702
|
-
}
|
|
703
707
|
}
|
|
708
|
+
|
|
704
709
|
li:has(.parent-link) {
|
|
705
710
|
border-block-end: 2px solid var(--border-color);
|
|
706
711
|
padding-block-end: 2rem;
|
|
707
712
|
margin-block-end: 2rem;
|
|
708
713
|
gap: 1rem;
|
|
709
|
-
|
|
714
|
+
column-span: all;
|
|
715
|
+
|
|
710
716
|
.dropdown-item {
|
|
717
|
+
width: auto;
|
|
718
|
+
display: inline-flex;
|
|
711
719
|
border-block-end: 0;
|
|
712
720
|
padding-block: 0;
|
|
713
721
|
gap: 1rem;
|
|
@@ -733,11 +741,15 @@
|
|
|
733
741
|
border-block-start: 2px solid var(--border-color);
|
|
734
742
|
padding-block-start: 2rem;
|
|
735
743
|
margin-block-start: 2rem;
|
|
736
|
-
|
|
744
|
+
text-align: end;
|
|
745
|
+
column-span: all;
|
|
746
|
+
|
|
737
747
|
.dropdown-item {
|
|
738
748
|
border-block-end: 0;
|
|
739
|
-
display: flex;
|
|
749
|
+
display: inline-flex;
|
|
750
|
+
width: auto;
|
|
740
751
|
flex-direction: row-reverse;
|
|
752
|
+
align-items: center;
|
|
741
753
|
padding-inline-end: 0.5rem;
|
|
742
754
|
gap: 0.5rem;
|
|
743
755
|
font-size: 1.25rem;
|
|
@@ -755,7 +767,6 @@
|
|
|
755
767
|
transform: scaleX(var(--icon-dir));
|
|
756
768
|
}
|
|
757
769
|
&::after {
|
|
758
|
-
content: "";
|
|
759
770
|
content: none;
|
|
760
771
|
}
|
|
761
772
|
&:hover {
|
|
@@ -11,33 +11,34 @@ import defaultdata from "./promotionalPanel.data.json";
|
|
|
11
11
|
export default {
|
|
12
12
|
tags: ["autodocs"],
|
|
13
13
|
title: "3. Components/Promotional Panel",
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
render: (args) => new PromotionalPanel(args).html,
|
|
16
16
|
args: defaultdata,
|
|
17
17
|
argTypes: {
|
|
18
18
|
type: {
|
|
19
|
-
description:
|
|
19
|
+
description: "The types of layouts that this component supports",
|
|
20
20
|
control: "select",
|
|
21
21
|
options: ["promo", "contained", "indent-text", "indent-img"],
|
|
22
22
|
},
|
|
23
23
|
variantClass: {
|
|
24
|
-
description:
|
|
24
|
+
description: "The types of themes that this component supports",
|
|
25
25
|
control: "select",
|
|
26
26
|
options: ["light", "alt", "dark", "dark-alt"],
|
|
27
|
-
},
|
|
27
|
+
},
|
|
28
28
|
promoImage: {
|
|
29
29
|
control: "text",
|
|
30
30
|
description: "The image to be displayed in the promotional panel.",
|
|
31
|
-
defaultValue:"./assets/img/banner-example-3-to-2.jpg",
|
|
31
|
+
defaultValue: "./assets/img/banner-example-3-to-2.jpg",
|
|
32
32
|
},
|
|
33
33
|
contentAlignment: {
|
|
34
|
-
description:
|
|
34
|
+
description: "Position of the content in the panel within this component",
|
|
35
35
|
control: "select",
|
|
36
|
-
options: ["content-left","content-right"],
|
|
36
|
+
options: ["content-left", "content-right"],
|
|
37
37
|
},
|
|
38
38
|
icon: {
|
|
39
39
|
control: "select",
|
|
40
|
-
description:
|
|
40
|
+
description:
|
|
41
|
+
"Current list of usable icons available in the icon component.",
|
|
41
42
|
options: ["icon-dot-grid", "icon-phone", "icon-email", "icon-search"],
|
|
42
43
|
},
|
|
43
44
|
title: {
|
|
@@ -48,20 +49,22 @@ export default {
|
|
|
48
49
|
abstract: {
|
|
49
50
|
control: "text",
|
|
50
51
|
description: "The abstract of the promotional panel.",
|
|
51
|
-
defaultValue:
|
|
52
|
+
defaultValue:
|
|
53
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tortor, leo vulputate ut odio mattis.",
|
|
52
54
|
},
|
|
53
55
|
body: {
|
|
54
56
|
control: "text",
|
|
55
57
|
description: "The body of the promotional panel.",
|
|
56
|
-
defaultValue:
|
|
58
|
+
defaultValue:
|
|
59
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tortor, leo vulputate ut odio mattis. Vel suspendisse mi quisque consequat aliquet egestas.",
|
|
57
60
|
},
|
|
58
61
|
cta: {
|
|
59
|
-
description:
|
|
60
|
-
control:
|
|
62
|
+
description: "The call to action objects for the promotional panel.",
|
|
63
|
+
control: "object",
|
|
61
64
|
},
|
|
62
65
|
btn: {
|
|
63
|
-
description:
|
|
64
|
-
control:
|
|
66
|
+
description: "The button objects for the promotional panel.",
|
|
67
|
+
control: "object",
|
|
65
68
|
},
|
|
66
69
|
},
|
|
67
70
|
|
|
@@ -120,4 +123,3 @@ export const DarkAlternative = {
|
|
|
120
123
|
variantClass: "dark-alt",
|
|
121
124
|
},
|
|
122
125
|
};
|
|
123
|
-
|
|
@@ -3,7 +3,7 @@ import { Quickexit } from "./Quickexit.js";
|
|
|
3
3
|
import defaultdata from "./quickexit.data.json";
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
|
-
tags: ["autodocs"],
|
|
6
|
+
tags: ["autodocs", "extended"],
|
|
7
7
|
title: "3. Components/Quickexit",
|
|
8
8
|
render: (args) => {
|
|
9
9
|
//Storybook produces a comma delimited string when using the check control type (table-striped, table-bordered) etc.
|
|
@@ -6,7 +6,7 @@ import defaultdata from "./searchInput.data.json";
|
|
|
6
6
|
const initData = defaultdata.defaultSuggestions || null;
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
|
-
tags: ["autodocs"],
|
|
9
|
+
tags: ["autodocs", "extended"],
|
|
10
10
|
title: "3. Components/Search Input",
|
|
11
11
|
render: (args) => {
|
|
12
12
|
return `<form action="https://uat.forgov.qld.gov.au/search" class="site-search p-3">${new SearchInput(args).html}</form>`;
|
|
@@ -6,18 +6,16 @@ export default {
|
|
|
6
6
|
tags: ["autodocs"],
|
|
7
7
|
title: "3. Components/Spinner",
|
|
8
8
|
render: (args) => {
|
|
9
|
-
|
|
10
|
-
//Storybook produces a comma delimited string when using the check control type (table-striped, table-bordered) etc.
|
|
9
|
+
//Storybook produces a comma delimited string when using the check control type (table-striped, table-bordered) etc.
|
|
11
10
|
//We can't use commas on our class="..." attribute, so we need to replace the commas with spaces.
|
|
12
11
|
|
|
13
|
-
if(
|
|
14
|
-
args.customClass = args.customClass.replaceAll(","," ");
|
|
15
|
-
} else if (
|
|
12
|
+
if (typeof args.customClass === "string") {
|
|
13
|
+
args.customClass = args.customClass.replaceAll(",", " ");
|
|
14
|
+
} else if (typeof args.customClass === "object") {
|
|
16
15
|
args.customClass = args.customClass.join(" ");
|
|
17
16
|
}
|
|
18
|
-
|
|
17
|
+
|
|
19
18
|
return new Spinner(args).html;
|
|
20
|
-
|
|
21
19
|
},
|
|
22
20
|
};
|
|
23
21
|
|
|
@@ -32,15 +30,13 @@ export const Default = {
|
|
|
32
30
|
* Dark themed Loading Spinner
|
|
33
31
|
*/
|
|
34
32
|
export const Dark = {
|
|
35
|
-
args: {
|
|
36
|
-
|
|
33
|
+
args: {
|
|
34
|
+
...defaultdata,
|
|
37
35
|
},
|
|
38
36
|
parameters: {
|
|
39
37
|
backgrounds: {
|
|
40
|
-
default:
|
|
41
|
-
values: [
|
|
42
|
-
{ name: 'Dark', value: 'var(--qld-brand-primary)' },
|
|
43
|
-
],
|
|
38
|
+
default: "Dark",
|
|
39
|
+
values: [{ name: "Dark", value: "var(--qld-brand-primary)" }],
|
|
44
40
|
},
|
|
45
41
|
},
|
|
46
42
|
decorators: [
|
|
@@ -59,8 +55,8 @@ export const Dark = {
|
|
|
59
55
|
*/
|
|
60
56
|
export const Minimal = {
|
|
61
57
|
args: {
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
...defaultdata,
|
|
59
|
+
...{ minimal: true },
|
|
64
60
|
},
|
|
65
61
|
};
|
|
66
62
|
|
|
@@ -68,9 +64,8 @@ export const Minimal = {
|
|
|
68
64
|
* Stacked Loading Spinner
|
|
69
65
|
*/
|
|
70
66
|
export const Stacked = {
|
|
71
|
-
args: {
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
args: {
|
|
68
|
+
...defaultdata,
|
|
69
|
+
...{ stacked: true },
|
|
74
70
|
},
|
|
75
71
|
};
|
|
76
|
-
|
|
@@ -10,7 +10,7 @@ import { Accordion } from "../accordion/Accordion.js";
|
|
|
10
10
|
* which is based on YouTube arguments.
|
|
11
11
|
*/
|
|
12
12
|
export default {
|
|
13
|
-
tags: ["autodocs"],
|
|
13
|
+
tags: ["autodocs", "extended"],
|
|
14
14
|
title: "3. Components/Video",
|
|
15
15
|
args: defaultdata.youtube,
|
|
16
16
|
render: (args) => {
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import { Meta, Markdown } from "@storybook/addon-docs/blocks";
|
|
2
2
|
|
|
3
|
-
import Readme from "../../README.md?raw"
|
|
3
|
+
import Readme from "../../README.md?raw";
|
|
4
4
|
|
|
5
5
|
<Meta title="Welcome" />
|
|
6
6
|
|
|
7
|
-
[//]: #
|
|
7
|
+
[//]: # "# Welcome to QGDS QOL BS MVP Storybook"
|
|
8
|
+
[//]: #
|
|
9
|
+
[//]: # "Welcome to Queensland Government Design System Qld Online Mvp Storybook, this documentation is mainly for development and testing purposes."
|
|
10
|
+
[//]: # "For user orientated documentation, please visit https://www.forgov.qld.gov.au/swe."
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
[//]: # (Welcome to Queensland Government Design System Qld Online Mvp Storybook, this documentation is mainly for development and testing purposes.)
|
|
12
|
+
<Markdown>{Readme}</Markdown>
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
---
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
## Component Badges
|
|
17
|
+
|
|
18
|
+
Components are labelled as:
|
|
19
|
+
|
|
20
|
+
- **Core** — Essential, broadly applicable components that serve as the single source of truth for the Queensland Government design system.
|
|
21
|
+
- **Extended** — Specialised components for needs not covered by the core set.
|
|
22
|
+
|
|
23
|
+
Further information is available in the [QGDS UI Kit](https://www.figma.com/design/qKsxl3ogIlBp7dafgxXuCA/QGDS-UI-kit?node-id=8701-244248&m=dev).
|