@qld-gov-au/qgds-bootstrap5 1.1.40 → 2.0.0
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/.eslintrc.cjs +27 -27
- package/.vscode/settings.json +5 -5
- package/dist/assets/components/bs5/button/button.hbs +48 -30
- package/dist/assets/components/bs5/card/card.hbs +3 -17
- package/dist/assets/components/bs5/containerLayout/containerLayout.hbs +100 -0
- package/dist/assets/components/bs5/footer/customLinks.hbs +7 -0
- package/dist/assets/components/bs5/footer/feedbackForm.hbs +25 -0
- package/dist/assets/components/bs5/footer/followLinks.hbs +14 -0
- package/dist/assets/components/bs5/footer/footer.hbs +229 -346
- package/dist/assets/components/bs5/formcheck/formcheck.hbs +1 -1
- package/dist/assets/components/bs5/head/head.hbs +4 -4
- package/dist/assets/components/bs5/header/header.hbs +124 -878
- package/dist/assets/components/bs5/header/headerBrand.hbs +35 -0
- package/dist/assets/components/bs5/link/link.hbs +41 -0
- package/dist/assets/components/bs5/logo/logoCOALandscape.hbs +110 -55
- package/dist/assets/components/bs5/logo/logoCOALandscape2Lines.hbs +2 -1
- package/dist/assets/components/bs5/navbar/navbar.hbs +65 -245
- package/dist/assets/components/bs5/pageLayout/templates/contentPageWithForm.hbs +53 -22
- package/dist/assets/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +79 -59
- package/dist/assets/components/bs5/pageLayout/templates/homePage.hbs +111 -0
- package/dist/assets/components/bs5/searchInput/searchInput.hbs +9 -11
- package/dist/assets/css/qld.bootstrap.css +1 -1
- package/dist/assets/css/qld.bootstrap.css.map +3 -3
- package/dist/assets/js/bootstrap.bundle.js +3 -6
- package/dist/assets/js/bootstrap.bundle.js.map +1 -1
- package/dist/assets/js/bootstrap.bundle.min.js +2 -2
- package/dist/assets/js/bootstrap.bundle.min.js.map +1 -1
- package/dist/assets/js/bootstrap.js +3 -6
- package/dist/assets/js/bootstrap.min.js +2 -2
- package/dist/assets/js/bootstrap.min.js.map +1 -1
- package/dist/assets/js/handlebars.helpers.bundle.js.map +2 -2
- package/dist/assets/js/handlebars.helpers.js +34 -34
- package/dist/assets/js/handlebars.init.min.js +1055 -2041
- package/dist/assets/js/handlebars.init.min.js.map +4 -4
- package/dist/assets/js/handlebars.partials.js +14 -6
- package/dist/assets/js/qld.bootstrap.min.js +9 -9
- package/dist/assets/js/qld.bootstrap.min.js.map +4 -4
- package/dist/assets/node/handlebars.init.min.js +538 -108
- package/dist/assets/node/handlebars.init.min.js.map +3 -3
- package/dist/components/bs5/button/button.hbs +48 -30
- package/dist/components/bs5/card/card.hbs +3 -17
- package/dist/components/bs5/containerLayout/containerLayout.hbs +100 -0
- package/dist/components/bs5/footer/customLinks.hbs +7 -0
- package/dist/components/bs5/footer/feedbackForm.hbs +25 -0
- package/dist/components/bs5/footer/followLinks.hbs +14 -0
- package/dist/components/bs5/footer/footer.hbs +229 -346
- package/dist/components/bs5/formcheck/formcheck.hbs +1 -1
- package/dist/components/bs5/head/head.hbs +4 -4
- package/dist/components/bs5/header/header.hbs +124 -878
- package/dist/components/bs5/header/headerBrand.hbs +35 -0
- package/dist/components/bs5/link/link.hbs +41 -0
- package/dist/components/bs5/logo/logoCOALandscape.hbs +110 -55
- package/dist/components/bs5/logo/logoCOALandscape2Lines.hbs +2 -1
- package/dist/components/bs5/navbar/navbar.hbs +65 -245
- package/dist/components/bs5/pageLayout/templates/contentPageWithForm.hbs +53 -22
- package/dist/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +79 -59
- package/dist/components/bs5/pageLayout/templates/homePage.hbs +111 -0
- package/dist/components/bs5/searchInput/searchInput.hbs +9 -11
- package/dist/components/handlebars.helpers.js +34 -34
- package/dist/components/handlebars.partials.js +14 -6
- package/dist/package.json +2 -2
- package/dist/sample-data/button/button.data.json +10 -8
- package/dist/sample-data/footer/footer.data.json +128 -84
- package/dist/sample-data/formcheck/stories/checkbox/checkbox.data.json +51 -46
- package/dist/sample-data/formcheck/stories/radio/radio.data.json +51 -46
- package/dist/sample-data/header/header.variant.coBrand.data.json +28 -40
- package/dist/sample-data/header/header.variant.endorsed.data.json +116 -150
- package/dist/sample-data/header/header.variant.masterBrand.data.json +116 -152
- package/dist/sample-data/header/header.variant.standAlone.data.json +118 -150
- package/dist/sample-data/header/header.variant.subBrand.data.json +32 -159
- package/dist/sample-data/inpageAlert/inpageAlert.data.json +6 -6
- package/dist/sample-data/link/link.data.json +77 -0
- package/dist/sample-data/logo/logo.data.json +1 -0
- package/dist/sample-data/navbar/navbar.data.json +191 -0
- package/dist/sample-data/searchInput/searchInput.data.json +2 -3
- package/dist/sample-data/tabs/tabs.data.json +45 -44
- package/package.json +2 -2
- package/src/components/bs5/accordion/Accordion.mdx +8 -2
- package/src/components/bs5/banner/Banner.mdx +6 -1
- package/src/components/bs5/banner/banner.scss +16 -9
- package/src/components/bs5/banner/banner.stories.js +17 -17
- package/src/components/bs5/breadcrumbs/Breadcrumbs.mdx +8 -2
- package/src/components/bs5/breadcrumbs/breadcrumbs.functions.js +2 -0
- package/src/components/bs5/breadcrumbs/breadcrumbs.scss +1 -1
- package/src/components/bs5/button/button.data.json +10 -8
- package/src/components/bs5/button/button.hbs +48 -30
- package/src/components/bs5/button/button.scss +61 -0
- package/src/components/bs5/button/button.stories.js +29 -10
- package/src/components/bs5/callToAction/callToAction.mdx +8 -3
- package/src/components/bs5/card/Card.mdx +8 -2
- package/src/components/bs5/card/card.hbs +3 -17
- package/src/components/bs5/card/card.scss +103 -103
- package/src/components/bs5/containerLayout/containerLayout.hbs +100 -0
- package/src/components/bs5/containerLayout/containerLayout.stories.js +83 -0
- package/src/components/bs5/footer/Footer.js +3 -3
- package/src/components/bs5/footer/Footer.mdx +8 -2
- package/src/components/bs5/footer/customLinks.hbs +7 -0
- package/src/components/bs5/footer/feedbackForm.hbs +25 -0
- package/src/components/bs5/footer/followLinks.hbs +14 -0
- package/src/components/bs5/footer/footer.data.json +128 -84
- package/src/components/bs5/footer/footer.functions.js +2 -1
- package/src/components/bs5/footer/footer.hbs +229 -346
- package/src/components/bs5/footer/footer.scss +262 -272
- package/src/components/bs5/footer/footer.stories.js +4 -92
- package/src/components/bs5/footer/footer_formio.scss +219 -0
- package/src/components/bs5/formcheck/formcheck.hbs +1 -1
- package/src/components/bs5/formcheck/formcheck.scss +161 -139
- package/src/components/bs5/formcheck/stories/checkbox/checkbox.data.json +51 -46
- package/src/components/bs5/formcheck/stories/radio/radio.data.json +51 -46
- package/src/components/bs5/globalAlert/GlobalAlert.mdx +8 -2
- package/src/components/bs5/globalAlert/globalAlert.test.js +3 -11
- package/src/components/bs5/header/_header-variables.scss +272 -0
- package/src/components/bs5/header/header.functions.js +9 -9
- package/src/components/bs5/header/header.hbs +124 -878
- package/src/components/bs5/header/header.scss +279 -411
- package/src/components/bs5/header/header.stories.js +8 -28
- package/src/components/bs5/header/header.variant.coBrand.data.json +28 -40
- package/src/components/bs5/header/header.variant.endorsed.data.json +116 -150
- package/src/components/bs5/header/header.variant.masterBrand.data.json +116 -152
- package/src/components/bs5/header/header.variant.standAlone.data.json +118 -150
- package/src/components/bs5/header/header.variant.subBrand.data.json +32 -159
- package/src/components/bs5/header/headerBrand.hbs +35 -0
- package/src/components/bs5/icons/icons.scss +79 -72
- package/src/components/bs5/inpageAlert/InpageAlert.mdx +8 -2
- package/src/components/bs5/inpageAlert/inpageAlert.data.json +6 -6
- package/src/components/bs5/inpagenav/inpagenav.scss +37 -37
- package/src/components/bs5/link/link.data.json +77 -0
- package/src/components/bs5/link/link.hbs +41 -0
- package/src/components/bs5/{pageLayout/pageLayout.js → link/link.js} +4 -5
- package/src/components/bs5/link/link.mdx +16 -0
- package/src/components/bs5/link/link.scss +81 -0
- package/src/components/bs5/link/link.stories.js +126 -0
- package/src/components/bs5/linkColumns/linkColumns.mdx +8 -3
- package/src/components/bs5/logo/logo.data.json +1 -0
- package/src/components/bs5/logo/logoCOALandscape.hbs +110 -55
- package/src/components/bs5/logo/logoCOALandscape2Lines.hbs +2 -1
- package/src/components/bs5/navbar/Navbar.js +2 -9
- package/src/components/bs5/navbar/navbar.data.json +191 -0
- package/src/components/bs5/navbar/navbar.functions.js +48 -196
- package/src/components/bs5/navbar/navbar.hbs +65 -245
- package/src/components/bs5/navbar/navbar.scss +684 -562
- package/src/components/bs5/navbar/navbar.stories.js +533 -0
- package/src/components/bs5/pageLayout/{FullWidthLandingPage.js → HomePage.js} +2 -2
- package/src/components/bs5/pageLayout/pageLayout.stories.js +242 -98
- package/src/components/bs5/pageLayout/templates/contentPageWithForm.hbs +53 -22
- package/src/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +79 -59
- package/src/components/bs5/pageLayout/templates/homePage.hbs +111 -0
- package/src/components/bs5/promotionalPanel/PromotionalPanel.mdx +8 -3
- package/src/components/bs5/searchInput/__snapshots__/searchInput.test.js.snap +10 -9
- package/src/components/bs5/searchInput/search.functions.js +94 -63
- package/src/components/bs5/searchInput/searchInput.data.json +2 -3
- package/src/components/bs5/searchInput/searchInput.hbs +9 -11
- package/src/components/bs5/searchInput/searchInput.scss +297 -255
- package/src/components/bs5/searchInput/searchInput.test.js +98 -90
- package/src/components/bs5/tabs/tabs.data.json +45 -44
- package/src/components/bs5/tabs/tabs.scss +544 -500
- package/src/components/bs5/tabs/tabs.stories.js +81 -51
- package/src/components/common/layout/container.scss +22 -0
- package/src/components/common/layout/content.scss +11 -4
- package/src/components/common/layout/grid.scss +26 -0
- package/src/css/main.scss +7 -2
- package/src/css/mixins/_index.scss +2 -1
- package/src/css/mixins/register-vars.scss +23 -0
- package/src/css/qld-variables.scss +106 -83
- package/src/css/utilities/_index.scss +1 -0
- package/src/css/utilities/responsive-visually-hidden.scss +10 -0
- package/src/js/handlebars.helpers.js +34 -34
- package/src/js/handlebars.partials.js +14 -6
- package/src/js/qld.bootstrap.js +10 -11
- package/dist/assets/components/bs5/footer/footerForgov.hbs +0 -279
- package/dist/assets/components/bs5/pageLayout/pageLayout.hbs +0 -34
- package/dist/assets/components/bs5/pageLayout/templates/fullWidthLandingPage.hbs +0 -61
- package/dist/components/bs5/footer/footerForgov.hbs +0 -279
- package/dist/components/bs5/pageLayout/pageLayout.hbs +0 -34
- package/dist/components/bs5/pageLayout/templates/fullWidthLandingPage.hbs +0 -61
- package/src/components/bs5/footer/_colours.scss +0 -149
- package/src/components/bs5/footer/_measurements.scss +0 -32
- package/src/components/bs5/footer/footerForgov.hbs +0 -279
- package/src/components/bs5/header/_colours.scss +0 -271
- package/src/components/bs5/header/_icons.scss +0 -10
- package/src/components/bs5/navbar/_colours.scss +0 -85
- package/src/components/bs5/navbar/_icons.scss +0 -64
- package/src/components/bs5/pageLayout/pageLayout.hbs +0 -34
- package/src/components/bs5/pageLayout/templates/fullWidthLandingPage.hbs +0 -61
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Canvas, Meta, Story } from "@storybook/blocks";
|
|
1
|
+
import { Canvas, Meta, Story, Source } from "@storybook/blocks";
|
|
2
2
|
import * as BannerStories from "./banner.stories";
|
|
3
|
+
import defaultdata from "./banner.data.json";
|
|
3
4
|
|
|
4
5
|
<Meta of={BannerStories} />
|
|
5
6
|
|
|
@@ -14,3 +15,7 @@ import * as BannerStories from "./banner.stories";
|
|
|
14
15
|
- [Component library (Figma)](https://www.figma.com/file/qKsxl3ogIlBp7dafgxXuCA/QLD-GOV-DDS?type=design&node-id=10861-449385&mode=design&t=NREcuP5UOBB2Y6G4-4)
|
|
15
16
|
- [Master component file (Figma)](https://www.figma.com/file/qKsxl3ogIlBp7dafgxXuCA/QLD-GOV-DDS?type=design&node-id=6037-22593&mode=design&t=YLfxdziHdqD2Ty0o-0)
|
|
16
17
|
- [Design System website](https://www.designsystem.qld.gov.au/components/banners)
|
|
18
|
+
|
|
19
|
+
## Example JSON data
|
|
20
|
+
|
|
21
|
+
<Source language="json" code={JSON.stringify(defaultdata, null, 2)} />
|
|
@@ -148,8 +148,8 @@
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
&.banner-basic {
|
|
151
|
-
--#{$prefix}banner-padding-top:
|
|
152
|
-
--#{$prefix}banner-padding-bottom:
|
|
151
|
+
--#{$prefix}banner-padding-top: 3rem;
|
|
152
|
+
--#{$prefix}banner-padding-bottom: 4rem;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
// Same as default banner
|
|
@@ -478,16 +478,23 @@
|
|
|
478
478
|
}
|
|
479
479
|
|
|
480
480
|
.banner-abstract {
|
|
481
|
-
|
|
482
|
-
line-height: 2rem;
|
|
483
|
-
margin: 1.5rem 0 0 0;
|
|
481
|
+
margin: 1rem 0 0 0;
|
|
484
482
|
max-width: 50rem; //To make readable. Clips line length for very wide viewports.
|
|
485
483
|
color: var(--#{$prefix}banner-abstract-color);
|
|
486
484
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
485
|
+
//Mobile typography
|
|
486
|
+
font-size: 1.25rem;
|
|
487
|
+
line-height: 1.75rem;
|
|
488
|
+
|
|
489
|
+
//Medium and up typography
|
|
490
|
+
@include media-breakpoint-up(md) {
|
|
491
|
+
font-size: 1.5rem; //24
|
|
492
|
+
line-height: 2rem; //32
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
// XL viewports
|
|
496
|
+
@include media-breakpoint-up(xl) {
|
|
497
|
+
margin-top: 1.5rem;
|
|
491
498
|
}
|
|
492
499
|
}
|
|
493
500
|
|
|
@@ -97,23 +97,23 @@ export default {
|
|
|
97
97
|
|
|
98
98
|
// Provide cards or buttons if callToAction is set to true
|
|
99
99
|
switch (args.callToAction) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
100
|
+
case "buttons":
|
|
101
|
+
args.buttons = exampleButtonData;
|
|
102
|
+
args.cards = false;
|
|
103
|
+
break;
|
|
104
|
+
case "cards":
|
|
105
|
+
args.cards = exampleCardData;
|
|
106
|
+
args.buttons = false;
|
|
107
|
+
break;
|
|
108
|
+
case "cardsMixed":
|
|
109
|
+
args.cards = exampleMixedCardData;
|
|
110
|
+
args.buttons = false;
|
|
111
|
+
break;
|
|
112
|
+
case "none":
|
|
113
|
+
default:
|
|
114
|
+
args.cards = false;
|
|
115
|
+
args.buttons = false;
|
|
116
|
+
break;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
// Return the updated story
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { Canvas, Meta, Story } from "@storybook/blocks"
|
|
2
|
-
import * as BreadcrumbsStories from "./breadcrumbs.stories"
|
|
1
|
+
import { Canvas, Meta, Story, Source } from "@storybook/blocks";
|
|
2
|
+
import * as BreadcrumbsStories from "./breadcrumbs.stories";
|
|
3
|
+
import defaultdata from "./breadcrumbs.data.json";
|
|
3
4
|
|
|
4
5
|
<Meta of={BreadcrumbsStories} />
|
|
5
6
|
|
|
6
7
|
# Breadcrumbs
|
|
8
|
+
|
|
7
9
|
<Canvas>
|
|
8
10
|
<Story of={BreadcrumbsStories.Default} />
|
|
9
11
|
</Canvas>
|
|
@@ -14,3 +16,7 @@ import * as BreadcrumbsStories from "./breadcrumbs.stories"
|
|
|
14
16
|
- [Master component file (Figma)](https://www.figma.com/file/qKsxl3ogIlBp7dafgxXuCA/QLD-GOV-DDS?type=design&node-id=5990-98076&mode=design&t=YLfxdziHdqD2Ty0o-0)
|
|
15
17
|
- [Design System website](https://www.designsystem.qld.gov.au/components/breadcrumbs)
|
|
16
18
|
- [Bootstrap component](https://getbootstrap.com/docs/5.3/components/breadcrumb/)
|
|
19
|
+
|
|
20
|
+
## Example JSON data
|
|
21
|
+
|
|
22
|
+
<Source language="json" code={JSON.stringify(defaultdata, null, 2)} />
|
|
@@ -133,12 +133,14 @@ export function expandMenu(event) {
|
|
|
133
133
|
const expandButton = document.querySelector(".breadcrumb-toggle-link");
|
|
134
134
|
expandButton && document.addEventListener("click", collapseMenu);
|
|
135
135
|
}
|
|
136
|
+
|
|
136
137
|
/**
|
|
137
138
|
* event listener for document click event used to collapse menu on clicking elsewhere
|
|
138
139
|
* and also remove the event listener to prevent multiple listeners from being attached
|
|
139
140
|
* @memberof module:Breadcrumb
|
|
140
141
|
*
|
|
141
142
|
* @param {Event} event - The event that triggered this function.
|
|
143
|
+
* @returns {void} Returns nothing.
|
|
142
144
|
*/
|
|
143
145
|
function collapseMenu(event) {
|
|
144
146
|
event.stopPropagation();
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
"variantClass": "btn-primary",
|
|
3
|
+
"islink": true,
|
|
4
|
+
"isdisabled": false,
|
|
5
|
+
"isprogress": false,
|
|
6
|
+
"progressLabel": "Loading",
|
|
7
|
+
"iconClass": "qld-icon-external-link",
|
|
8
|
+
"iconPosition": "leading",
|
|
9
|
+
"label": "Call to action",
|
|
10
|
+
"href": "https://google.com",
|
|
11
|
+
"target": "_blank"
|
|
10
12
|
}
|
|
@@ -3,40 +3,58 @@
|
|
|
3
3
|
<span class="qld-icon qld-icon-md {{iconClass}} {{iconPosition}}" aria-hidden="true"></span>
|
|
4
4
|
{{~/inline}}
|
|
5
5
|
|
|
6
|
+
{{!-- Progress spinner partial --}}
|
|
7
|
+
{{#*inline "progressSpinner"~}}
|
|
8
|
+
<div class="spinner-border"></div>
|
|
9
|
+
{{~/inline}}
|
|
10
|
+
|
|
6
11
|
{{#unless islink}}
|
|
7
12
|
|
|
8
|
-
<button class="btn {{variantClass}} {{label}}" onclick="{{{onclick}}}" {{#if isdisabled}}disabled{{/if}} {{#if arialabel}}aria-label="{{arialabel}}"{{/if}} {{{dataatts}}}>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
{{
|
|
21
|
-
|
|
13
|
+
<button class="btn {{variantClass}} {{#if isprogress}}btn-progress{{/if}} {{label}}" onclick="{{{onclick}}}" {{#if isdisabled}}disabled{{/if}} {{#if isprogress}}disabled aria-live="polite"{{/if}} {{#if arialabel}}aria-label="{{arialabel}}"{{/if}} {{{dataatts}}} {{#if progressLabel}}data-progress-label="{{progressLabel}}"{{/if}}>
|
|
14
|
+
{{#if isprogress}}
|
|
15
|
+
{{~>progressSpinner~}}
|
|
16
|
+
{{else}}
|
|
17
|
+
{{#if iconClass~}}
|
|
18
|
+
{{#ifCond iconPosition '==' 'leading'}}
|
|
19
|
+
{{~>buttonIcon~}}
|
|
20
|
+
{{/ifCond}}
|
|
21
|
+
{{/if}}
|
|
22
|
+
{{/if}}
|
|
23
|
+
|
|
24
|
+
<span class="btn-label-default">{{~label~}}</span>
|
|
25
|
+
{{#if isprogress}}
|
|
26
|
+
<span class="btn-label-progress">{{~progressLabel~}}</span>
|
|
27
|
+
{{/if}}
|
|
28
|
+
{{#unless isprogress}}
|
|
29
|
+
{{#if iconClass~}}
|
|
30
|
+
{{#ifCond iconPosition '==' 'trailing'}}
|
|
31
|
+
{{~>buttonIcon~}}
|
|
32
|
+
{{/ifCond}}
|
|
33
|
+
{{/if}}
|
|
34
|
+
{{/unless}}
|
|
22
35
|
</button>
|
|
23
36
|
|
|
24
37
|
{{else}}
|
|
38
|
+
<a class="btn {{variantClass}} {{#if isdisabled}}disabled {{/if}}{{#if isprogress}}disabled btn-progress{{/if}}" {{#if isdisabled}}aria-disabled="true"{{/if}} {{#if isprogress}}aria-live="polite"{{/if}} href="{{href}}" target="{{target}}" {{#if arialabel}}aria-label="{{arialabel}}"{{/if}} {{#if progressLabel}}data-progress-label="{{progressLabel}}"{{/if}} {{{dataatts}}}>
|
|
39
|
+
{{#if isprogress}}
|
|
40
|
+
{{~>progressSpinner~}}
|
|
41
|
+
{{else}}
|
|
42
|
+
{{#if iconClass~}}
|
|
43
|
+
{{#ifCond iconPosition '==' 'leading'}}
|
|
44
|
+
{{~> buttonIcon~}}
|
|
45
|
+
{{/ifCond}}
|
|
46
|
+
{{/if}}
|
|
47
|
+
{{/if}}
|
|
48
|
+
|
|
49
|
+
<span class="btn-label-default">{{~label~}}</span>
|
|
50
|
+
<span class="btn-label-progress">{{~progressLabel~}}</span>
|
|
25
51
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{{#if iconClass~}}
|
|
36
|
-
{{#ifCond iconPosition '==' 'trailing'}}
|
|
37
|
-
{{~> buttonIcon~}}
|
|
38
|
-
{{/ifCond}}
|
|
39
|
-
{{/if}}
|
|
40
|
-
</a>
|
|
41
|
-
|
|
52
|
+
{{#unless isprogress}}
|
|
53
|
+
{{#if iconClass~}}
|
|
54
|
+
{{#ifCond iconPosition '==' 'trailing'}}
|
|
55
|
+
{{~> buttonIcon~}}
|
|
56
|
+
{{/ifCond}}
|
|
57
|
+
{{/if}}
|
|
58
|
+
{{/unless}}
|
|
59
|
+
</a>
|
|
42
60
|
{{/unless}}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
--#{$prefix}btn-border-radius: 0.25rem;
|
|
12
12
|
--#{$prefix}btn-focus-box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
|
|
13
13
|
--#{$prefix}btn-disabled-opacity: 0.5;
|
|
14
|
+
--#{$prefix}btn-spinner-icon-size__md: 1.5rem;
|
|
14
15
|
|
|
15
16
|
//Primary button variant
|
|
16
17
|
&-primary {
|
|
@@ -196,6 +197,10 @@ a.btn,
|
|
|
196
197
|
&.disabled {
|
|
197
198
|
--qld-body-color: var(--#{$prefix}btn-disabled-color);
|
|
198
199
|
|
|
200
|
+
&:visited {
|
|
201
|
+
color: var(--#{$prefix}btn-disabled-color);
|
|
202
|
+
}
|
|
203
|
+
|
|
199
204
|
&:focus {
|
|
200
205
|
background-color: var(--#{$prefix}btn-disabled-bg) !important;
|
|
201
206
|
border-color: var(--#{$prefix}btn-disabled-border-color) !important;
|
|
@@ -205,6 +210,46 @@ a.btn,
|
|
|
205
210
|
}
|
|
206
211
|
}
|
|
207
212
|
|
|
213
|
+
// Progress state styles
|
|
214
|
+
&.btn-progress {
|
|
215
|
+
cursor: not-allowed;
|
|
216
|
+
pointer-events: none;
|
|
217
|
+
|
|
218
|
+
.spinner-border {
|
|
219
|
+
width: var(--#{$prefix}btn-spinner-icon-size__md);
|
|
220
|
+
height: var(--#{$prefix}btn-spinner-icon-size__md);
|
|
221
|
+
--qld-spinner-border-width: 0.094rem;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.btn-label-default {
|
|
225
|
+
display: none;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.btn-label-progress {
|
|
229
|
+
display: inline;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// Maintain focus styles for screen readers
|
|
233
|
+
&:focus {
|
|
234
|
+
outline: var(--#{$prefix}light-blue) solid 3px;
|
|
235
|
+
outline-offset: 2px;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Remove hover effects
|
|
239
|
+
&:hover {
|
|
240
|
+
text-decoration: none;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Default state - hide progress label
|
|
245
|
+
.btn-label-progress {
|
|
246
|
+
display: none;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.btn-label-default {
|
|
250
|
+
display: inline;
|
|
251
|
+
}
|
|
252
|
+
|
|
208
253
|
//Primary button variant
|
|
209
254
|
&-primary {
|
|
210
255
|
box-shadow:
|
|
@@ -315,6 +360,12 @@ a.btn,
|
|
|
315
360
|
outline-offset: 2px;
|
|
316
361
|
}
|
|
317
362
|
|
|
363
|
+
// Progress state focus for dark mode
|
|
364
|
+
&.btn-progress:focus {
|
|
365
|
+
outline: var(--#{$prefix}dark-focus) solid 3px;
|
|
366
|
+
outline-offset: 2px;
|
|
367
|
+
}
|
|
368
|
+
|
|
318
369
|
&-primary {
|
|
319
370
|
&:focus {
|
|
320
371
|
background-color: var(--#{$prefix}btn-focus-bg);
|
|
@@ -362,3 +413,13 @@ a.btn,
|
|
|
362
413
|
}
|
|
363
414
|
}
|
|
364
415
|
}
|
|
416
|
+
|
|
417
|
+
// Spinner animation
|
|
418
|
+
@keyframes btn-spin {
|
|
419
|
+
0% {
|
|
420
|
+
transform: rotate(0deg);
|
|
421
|
+
}
|
|
422
|
+
100% {
|
|
423
|
+
transform: rotate(360deg);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
@@ -17,8 +17,14 @@ const buttonVariants = {
|
|
|
17
17
|
* Define different status of button
|
|
18
18
|
*/
|
|
19
19
|
const statuses = [
|
|
20
|
-
{ isdisabled: false, label: "Enabled" },
|
|
21
|
-
{ isdisabled: true, label: "Disabled" },
|
|
20
|
+
{ isdisabled: false, isprogress: false, label: "Enabled" },
|
|
21
|
+
{ isdisabled: true, isprogress: false, label: "Disabled" },
|
|
22
|
+
{
|
|
23
|
+
isdisabled: false,
|
|
24
|
+
isprogress: true,
|
|
25
|
+
progressLabel: "Loading",
|
|
26
|
+
label: "Progress",
|
|
27
|
+
},
|
|
22
28
|
];
|
|
23
29
|
|
|
24
30
|
/**
|
|
@@ -58,6 +64,7 @@ export default {
|
|
|
58
64
|
<div class="d-flex gap-3">
|
|
59
65
|
${new Button(args).html}
|
|
60
66
|
${new Button({ ...args, isdisabled: true }).html}
|
|
67
|
+
${new Button({ ...args, isprogress: true, iconClass: "", label: "Loading button", progressLabel: "Loading...", islink: false, dataatts: 'data-loading-btn="true"' }).html}
|
|
61
68
|
</div>
|
|
62
69
|
`; //expand arguments, specifically turn isdisabled into true
|
|
63
70
|
},
|
|
@@ -68,6 +75,18 @@ export default {
|
|
|
68
75
|
disable: true,
|
|
69
76
|
},
|
|
70
77
|
},
|
|
78
|
+
isprogress: {
|
|
79
|
+
name: "Progress State",
|
|
80
|
+
description: "Show loading spinner and progress label",
|
|
81
|
+
control: "boolean",
|
|
82
|
+
},
|
|
83
|
+
progressLabel: {
|
|
84
|
+
name: "Progress Label",
|
|
85
|
+
description:
|
|
86
|
+
"Text to show when in progress state (e.g., 'Loading', 'Saving', 'Please wait')",
|
|
87
|
+
control: "text",
|
|
88
|
+
if: { arg: "isprogress", truthy: true },
|
|
89
|
+
},
|
|
71
90
|
variantClass: {
|
|
72
91
|
name: "Variants",
|
|
73
92
|
description: "Settable variant type for Button component",
|
|
@@ -210,14 +229,14 @@ export const LongLabelsWrapping = {
|
|
|
210
229
|
<div style="max-width: 200px;">
|
|
211
230
|
<h5 class="mb-3">Even Narrower Container (200px)</h5>
|
|
212
231
|
${
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
232
|
+
new Button({
|
|
233
|
+
...defaultdata,
|
|
234
|
+
iconClass: "", // no icon for this demo
|
|
235
|
+
variantClass: "btn-primary",
|
|
236
|
+
label: "Long button text in a narrow container",
|
|
237
|
+
isdisabled: false,
|
|
238
|
+
}).html
|
|
239
|
+
}
|
|
221
240
|
</div>
|
|
222
241
|
</div>
|
|
223
242
|
`;
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import { Canvas, Meta, Story } from "@storybook/blocks"
|
|
2
|
-
import * as CallToActionStories from "./callToAction.stories"
|
|
1
|
+
import { Canvas, Meta, Story, Source } from "@storybook/blocks";
|
|
2
|
+
import * as CallToActionStories from "./callToAction.stories";
|
|
3
|
+
import defaultdata from "./callToAction.data.json";
|
|
3
4
|
|
|
4
5
|
<Meta of={CallToActionStories} />
|
|
5
6
|
|
|
6
7
|
# CallToAction
|
|
8
|
+
|
|
7
9
|
<Canvas>
|
|
8
10
|
<Story of={CallToActionStories.Default} />
|
|
9
11
|
</Canvas>
|
|
10
12
|
|
|
11
13
|
## Design resources
|
|
12
14
|
|
|
13
|
-
|
|
14
15
|
- [Component library (Figma)](https://www.figma.com/design/qKsxl3ogIlBp7dafgxXuCA/QGDS-UI-kit?node-id=23167-395565&t=TIV8Ku0uZZw4wtEa-0)
|
|
15
16
|
- [Master component file (Figma)](https://www.figma.com/design/qKsxl3ogIlBp7dafgxXuCA/QGDS-UI-kit?node-id=11056-321367&p=f&t=PtLTzZO7iSzsq4Qn-0)
|
|
16
17
|
- [Design System website](https://www.designsystem.qld.gov.au/components/call-to-action-cta)
|
|
18
|
+
|
|
19
|
+
## Example JSON data
|
|
20
|
+
|
|
21
|
+
<Source language="json" code={JSON.stringify(defaultdata, null, 2)} />
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { Canvas, Meta, Story } from "@storybook/blocks"
|
|
2
|
-
import * as CardStories from "./card--no-action.stories"
|
|
1
|
+
import { Canvas, Meta, Story, Source } from "@storybook/blocks";
|
|
2
|
+
import * as CardStories from "./card--no-action.stories";
|
|
3
|
+
import defaultdata from "./card.data.json";
|
|
3
4
|
|
|
4
5
|
<Meta of={CardStories} />
|
|
5
6
|
|
|
6
7
|
# Cards
|
|
8
|
+
|
|
7
9
|
<Canvas>
|
|
8
10
|
<Story of={CardStories.Default} />
|
|
9
11
|
</Canvas>
|
|
@@ -14,3 +16,7 @@ import * as CardStories from "./card--no-action.stories"
|
|
|
14
16
|
- [Master component file (Figma)](https://www.figma.com/file/qKsxl3ogIlBp7dafgxXuCA/QLD-GOV-DDS?type=design&node-id=5990-98141&mode=design&t=d1ly5fkj79b8cqJ6-0)
|
|
15
17
|
- [Design System website](https://www.design-system.health.qld.gov.au/components/cards)
|
|
16
18
|
- [Bootstrap component](https://getbootstrap.com/docs/5.3/components/card/)
|
|
19
|
+
|
|
20
|
+
## Example Component data
|
|
21
|
+
|
|
22
|
+
<Source language="json" code={JSON.stringify(defaultdata, null, 2)} />
|
|
@@ -1,28 +1,23 @@
|
|
|
1
1
|
<!-- QGDS Partial: card -->
|
|
2
2
|
|
|
3
3
|
<div class="col{{#if feature}}-md-12 col-lg-12{{/if}}">
|
|
4
|
-
|
|
5
4
|
<div class="card card-{{variantClass}} {{variantClass}} {{iconPosition}} card-{{action}}-action{{#if arrow}} card-arrow{{/if}}{{#if equalHeight}} h-100{{/if}}{{#if feature}} card-feature card-feature-{{featureImagePosition}}{{/if}}{{#if video}} card-video{{/if}}">
|
|
6
|
-
|
|
7
5
|
{{#if image}}
|
|
8
6
|
<div class="card-img ratio ratio-16x9">
|
|
9
7
|
<div class="{{#if feature}}card-img-{{featureImagePosition}}{{else}}card-img-top{{/if}}"
|
|
10
8
|
style="--card-image:url({{image}})" alt="{{imageAlt}}"></div>
|
|
11
|
-
|
|
12
9
|
{{#if video}}
|
|
13
10
|
<div class="video-overlay">
|
|
14
11
|
<div class="video-nav">
|
|
15
|
-
<div class="video-watch"><span class="icon"></span><span>Watch</span></div>
|
|
16
|
-
|
|
12
|
+
<div class="video-watch"><span class="qld-icon qld-icon-lg qld-icon-video" aria-hidden="true"></span><span>Watch</span></div>
|
|
17
13
|
{{#if videoDuration}}
|
|
18
|
-
<div title="Video duration" class="video-duration"><span class="icon"></span><span>{{videoDuration}}</span></div>
|
|
14
|
+
<div title="Video duration" class="video-duration"><span class="qld-icon qld-icon-sm qld-icon-clock" aria-hidden="true"></span><span>{{videoDuration}}</span></div>
|
|
19
15
|
{{/if}}
|
|
20
16
|
</div>
|
|
21
17
|
</div>
|
|
22
18
|
{{/if}}
|
|
23
19
|
</div>
|
|
24
20
|
{{/if}}
|
|
25
|
-
|
|
26
21
|
{{#if iconClasses}}
|
|
27
22
|
{{#ifCond iconPosition '==' 'icon-top'}}
|
|
28
23
|
<div class="card-icon-background">
|
|
@@ -35,14 +30,11 @@
|
|
|
35
30
|
</div>
|
|
36
31
|
{{/ifCond}}
|
|
37
32
|
{{/if}}
|
|
38
|
-
|
|
39
33
|
{{#if feature}}<div class="card-inner">{{/if}}
|
|
40
|
-
|
|
41
34
|
<div class="card-body">
|
|
42
35
|
{{#if date}}
|
|
43
36
|
<div class="card-date">{{date}}</div>
|
|
44
37
|
{{/if}}
|
|
45
|
-
|
|
46
38
|
<h3 class="card-title">
|
|
47
39
|
{{#if link}}
|
|
48
40
|
<a href="{{link}}" {{#ifCond action '===' 'single'}}class="stretched-link"{{/ifCond}}>{{title}}</a>
|
|
@@ -50,26 +42,20 @@
|
|
|
50
42
|
{{ title }}
|
|
51
43
|
{{/if }}
|
|
52
44
|
</h3>
|
|
53
|
-
|
|
54
45
|
{{#if description}}
|
|
55
46
|
<div class="card-text">
|
|
56
47
|
{{{description}}}
|
|
57
48
|
</div>
|
|
58
49
|
{{/if}}
|
|
59
|
-
|
|
60
50
|
{{#if arrow}}
|
|
61
|
-
|
|
51
|
+
<div class="qld-icon qld-icon-md qld-icon-arrow-right"></div>
|
|
62
52
|
{{/if}}
|
|
63
53
|
</div>
|
|
64
|
-
|
|
65
54
|
{{#if footer}}
|
|
66
55
|
<div class="card-footer">
|
|
67
56
|
{{{footer}}}
|
|
68
57
|
</div>
|
|
69
58
|
{{/if }}
|
|
70
|
-
|
|
71
59
|
{{#if feature}}</div>{{/if}}
|
|
72
|
-
|
|
73
60
|
</div>
|
|
74
|
-
|
|
75
61
|
</div>
|