@qld-gov-au/qgds-bootstrap5 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/preview.js +15 -6
- package/dist/assets/components/bs5/callToAction/callToAction.hbs +3 -3
- package/dist/assets/components/bs5/dateinput/dateinput.hbs +21 -27
- package/dist/assets/components/bs5/globalAlert/globalAlert.hbs +8 -1
- package/dist/assets/components/bs5/head/head.hbs +1 -1
- package/dist/assets/components/bs5/pagination/pagination.hbs +7 -2
- package/dist/assets/components/bs5/promotionalPanel/promotionalPanel.hbs +1 -1
- package/dist/assets/components/bs5/searchInput/searchInput.hbs +2 -2
- package/dist/assets/css/qld.bootstrap.css +2 -2
- package/dist/assets/css/qld.bootstrap.css.map +3 -3
- package/dist/assets/css/qld.bootstrap.legacy.css +2 -2
- package/dist/assets/css/qld.bootstrap.legacy.css.map +3 -3
- package/dist/assets/js/handlebars.helpers.bundle.js +1 -1
- package/dist/assets/js/handlebars.init.min.js +50 -44
- package/dist/assets/js/handlebars.init.min.js.map +2 -2
- package/dist/assets/js/handlebars.partials.js +50 -44
- package/dist/assets/js/handlebars.partials.js.map +2 -2
- package/dist/assets/js/qld.bootstrap.min.js +6 -6
- package/dist/assets/js/qld.bootstrap.min.js.map +4 -4
- package/dist/assets/node/handlebars.init.min.js +15 -8
- package/dist/assets/node/handlebars.init.min.js.map +2 -2
- package/dist/components/bs5/callToAction/callToAction.hbs +3 -3
- package/dist/components/bs5/dateinput/dateinput.hbs +21 -27
- package/dist/components/bs5/globalAlert/globalAlert.hbs +8 -1
- package/dist/components/bs5/head/head.hbs +1 -1
- package/dist/components/bs5/pagination/pagination.hbs +7 -2
- package/dist/components/bs5/promotionalPanel/promotionalPanel.hbs +1 -1
- package/dist/components/bs5/searchInput/searchInput.hbs +2 -2
- package/dist/package.json +33 -32
- package/dist/sample-data/callToAction/callToAction.data.json +2 -1
- package/dist/sample-data/dateinput/dateinput.data.json +3 -1
- package/dist/sample-data/pagination/pagination.data.json +4 -4
- package/dist/sample-data/promotionalPanel/promotionalPanel.data.json +45 -47
- package/package.json +33 -32
- package/src/components/bs5/breadcrumbs/breadcrumbs.scss +1 -0
- package/src/components/bs5/button/button.scss +1 -0
- package/src/components/bs5/button/button.stories.js +16 -4
- package/src/components/bs5/callToAction/callToAction.data.json +2 -1
- package/src/components/bs5/callToAction/callToAction.hbs +3 -3
- package/src/components/bs5/callToAction/callToAction.stories.js +2 -2
- package/src/components/bs5/card/card.scss +2 -2
- package/src/components/bs5/dateinput/Dateinput.js +1 -38
- package/src/components/bs5/dateinput/Dateinput.mdx +27 -0
- package/src/components/bs5/dateinput/Dateinput.stories.js +48 -4
- package/src/components/bs5/dateinput/dateinput.data.json +3 -1
- package/src/components/bs5/dateinput/dateinput.functions.js +91 -0
- package/src/components/bs5/dateinput/dateinput.hbs +21 -27
- package/src/components/bs5/formcheck/formcheck.scss +5 -0
- package/src/components/bs5/globalAlert/globalAlert.hbs +8 -1
- package/src/components/bs5/globalAlert/globalAlert.scss +14 -19
- package/src/components/bs5/globalAlert/globalAlert.stories.js +1 -0
- package/src/components/bs5/globalAlert/globalAlert.test.js +10 -5
- package/src/components/bs5/inpageAlert/inpageAlert.scss +3 -4
- package/src/components/bs5/inpagenav/inpagenav.scss +9 -1
- package/src/components/bs5/modal/modal.scss +1 -1
- package/src/components/bs5/navbar/navbar.functions.js +39 -28
- package/src/components/bs5/navbar/navbar.scss +43 -28
- package/src/components/bs5/navbar/navbar.stories.js +4 -3
- package/src/components/bs5/pagination/pagination.data.json +4 -4
- package/src/components/bs5/pagination/pagination.hbs +7 -2
- package/src/components/bs5/pagination/pagination.scss +1 -1
- package/src/components/bs5/promotionalPanel/promotionalPanel.data.json +45 -47
- package/src/components/bs5/promotionalPanel/promotionalPanel.hbs +1 -1
- package/src/components/bs5/quickexit/quickexit.scss +1 -1
- package/src/components/bs5/searchInput/__snapshots__/searchInput.test.js.snap +2 -2
- package/src/components/bs5/searchInput/search.functions.js +9 -5
- package/src/components/bs5/searchInput/searchInput.hbs +2 -2
- package/src/components/bs5/searchInput/searchInput.scss +1 -0
- package/src/components/bs5/sidenav/sidenav.scss +17 -19
- package/src/components/bs5/table/table.scss +93 -83
- package/src/css/main.scss +3 -0
- package/src/css/mixins/focusable.scss +1 -1
- package/src/css/qld-reduced-motion.scss +51 -0
- package/src/css/qld-tokens.scss +3 -3
- package/src/css/qld-type.scss +7 -13
- package/src/js/constants.js +10 -0
- package/src/js/qld.bootstrap.js +99 -99
- package/src/js/utils.js +3 -1
package/.storybook/preview.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "../node_modules/bootstrap/dist/js/bootstrap.bundle.min.js";
|
|
2
2
|
import "../src/css/main.scss";
|
|
3
3
|
import { withThemeByClassName } from "@storybook/addon-themes";
|
|
4
|
-
// import { allBackgrounds } from "./modes.js";
|
|
5
4
|
import {
|
|
6
5
|
withDynamicTheme,
|
|
7
6
|
dynamicThemeGlobalTypes,
|
|
8
7
|
} from "./dynamicThemeDecorator.js";
|
|
8
|
+
import { breakpoints } from "../src/js/constants.js";
|
|
9
9
|
|
|
10
10
|
// Check if dynamic theme should be enabled via environment variable
|
|
11
11
|
const ENABLE_DYNAMIC_THEME = import.meta.env.ENABLE_DYNAMIC_THEME;
|
|
@@ -48,12 +48,21 @@ const preview = {
|
|
|
48
48
|
viewport: {
|
|
49
49
|
options: {
|
|
50
50
|
//QLD-media Breakpoints
|
|
51
|
-
small: {
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
small: {
|
|
52
|
+
name: "Small",
|
|
53
|
+
styles: { width: `${breakpoints.sm}px`, height: "800px" },
|
|
54
|
+
},
|
|
55
|
+
medium: {
|
|
56
|
+
name: "Medium",
|
|
57
|
+
styles: { width: `${breakpoints.md}px`, height: "800px" },
|
|
58
|
+
},
|
|
59
|
+
large: {
|
|
60
|
+
name: "Large",
|
|
61
|
+
styles: { width: `${breakpoints.lg}px`, height: "800px" },
|
|
62
|
+
},
|
|
54
63
|
xlarge: {
|
|
55
64
|
name: "Extra Large",
|
|
56
|
-
styles: { width:
|
|
65
|
+
styles: { width: `${breakpoints.xl}px`, height: "1000px" },
|
|
57
66
|
},
|
|
58
67
|
xxlarge: {
|
|
59
68
|
name: "Extra Extra Large",
|
|
@@ -61,7 +70,7 @@ const preview = {
|
|
|
61
70
|
},
|
|
62
71
|
navbreakpoint: {
|
|
63
72
|
name: "Nave Breakpoint",
|
|
64
|
-
styles: { width:
|
|
73
|
+
styles: { width: `${breakpoints.lg}px`, height: "800px" },
|
|
65
74
|
},
|
|
66
75
|
...INITIAL_VIEWPORTS,
|
|
67
76
|
},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<a class="qld-cta-link {{getClassNames "small, view-all" class}}"
|
|
2
2
|
{{#if id}}id="{{id}}"{{/if}}
|
|
3
|
-
href="{{href}}"
|
|
4
|
-
target="{{target}}"
|
|
5
|
-
{{#if arialabel}}aria-label="{{arialabel}}"{{/if}}
|
|
3
|
+
href="{{href}}"
|
|
4
|
+
target="{{target}}"
|
|
5
|
+
{{#if arialabel}}aria-label="{{arialabel}}"{{/if}}
|
|
6
6
|
>
|
|
7
7
|
{{label}}
|
|
8
8
|
<span class="icon" aria-hidden="true"></span>
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
<!-- QGDS Component: Date input -->
|
|
2
2
|
|
|
3
|
-
<label id="{{id}}-label"
|
|
4
|
-
class="qld-text-input-label {{#if isRequired}}field-required{{/if}} {{#if isDisabled}}field-disabled{{/if}}"
|
|
5
|
-
for="{{id}}">
|
|
3
|
+
<label id="{{id}}-label" class="qld-text-input-label {{#if isRequired}}field-required{{/if}} {{#if isDisabled}}field-disabled{{/if}}" for="{{id}}">
|
|
6
4
|
{{label-text}}
|
|
7
5
|
{{#if optional-text}}
|
|
8
6
|
<span class="label-text-optional">({{optional-text}})</span>
|
|
@@ -12,53 +10,49 @@
|
|
|
12
10
|
{{#if hint-text}}
|
|
13
11
|
<span class="qld-hint-text" id="{{id}}-hint">{{hint-text}}</span>
|
|
14
12
|
{{/if}}
|
|
15
|
-
|
|
16
13
|
{{#contains "qld-input-success" customClass}}{{! legacy support for feedback classes `qld-input-success`}}
|
|
17
14
|
<span class="qld-input-success">{{successMessageText}}</span>
|
|
18
|
-
{{else}}
|
|
19
|
-
{{#if successMessageText}}{{! updated bootstrap style classes - `valid-feedback`}}
|
|
15
|
+
{{else if successMessageText}}{{! updated bootstrap style classes - `valid-feedback`}}
|
|
20
16
|
<div class="valid-feedback">{{successMessageText}}</div>
|
|
21
|
-
{{/
|
|
22
|
-
|
|
17
|
+
{{/contains}}
|
|
23
18
|
{{#contains "qld-input-error" customClass}}{{! legacy support for feedback classes `qld-input-error`}}
|
|
24
19
|
<span class="qld-input-error">{{errorMessageText}}</span>
|
|
25
|
-
{{else}}
|
|
26
|
-
{{#if errorMessageText}}{{! updated bootstrap style classes - `invalid-feedback`}}
|
|
20
|
+
{{else if errorMessageText}}{{! updated bootstrap style classes - `invalid-feedback`}}
|
|
27
21
|
<div class="invalid-feedback">{{errorMessageText}}</div>
|
|
28
|
-
{{/
|
|
22
|
+
{{/contains}}
|
|
29
23
|
|
|
30
24
|
<div aria-labelledby="{{id}}-label" role="group" class="row date-container {{customClass}}">
|
|
31
25
|
<!-- day group -->
|
|
32
26
|
<div class="day-group">
|
|
33
27
|
<label id="{{id}}-dayinput-label" for="{{id}}-dayinput" class="date-label qld-text-input-label">Day</label>
|
|
34
28
|
<div>
|
|
35
|
-
<input id="{{id}}-dayinput" aria-
|
|
36
|
-
inputmode="numeric" maxlength="2"
|
|
37
|
-
class="
|
|
38
|
-
|
|
39
|
-
{{/if}}>
|
|
29
|
+
<input id="{{id}}-dayinput" aria-labelledby="{{id}}-label {{id}}-dayinput-label" placeholder="{{day-placeholder}}" type="text"
|
|
30
|
+
inputmode="numeric" maxlength="2" minlength="2" min="1" max="31" pattern="^(0?[1-9]|[12][0-9]|3[01])$"
|
|
31
|
+
class="form-control dayinput {{customClass}} {{#if isFilled}}form-style-filled{{/if}}
|
|
32
|
+
{{#if isValid}}is-valid{{else}}{{#ifCond isValid "===" false}}is-invalid{{/ifCond}}{{/if}}" ref="day"
|
|
33
|
+
aria-invalid="false" {{#if isDisabled}}disabled{{/if}} {{#if isRequired}}required{{/if}}>
|
|
40
34
|
</div>
|
|
41
35
|
</div>
|
|
42
36
|
<!-- month group -->
|
|
43
37
|
<div class="date-group">
|
|
44
38
|
<label id="{{id}}-monthinput-label" for="{{id}}-monthinput" class="date-label qld-text-input-label">Month</label>
|
|
45
39
|
<div>
|
|
46
|
-
<input id="{{id}}-monthinput" aria-
|
|
47
|
-
type="text" inputmode="numeric" maxlength="2"
|
|
48
|
-
class="
|
|
49
|
-
|
|
50
|
-
{{/if}}>
|
|
40
|
+
<input id="{{id}}-monthinput" aria-labelledby="{{id}}-label {{id}}-monthinput-label" placeholder="{{month-placeholder}}"
|
|
41
|
+
type="text" inputmode="numeric" maxlength="2" minlength="2" min="1" max="12" pattern="^(0?[1-9]|[1][0-2])$"
|
|
42
|
+
class="form-control monthinput {{customClass}} {{#if isFilled}}form-style-filled{{/if}}
|
|
43
|
+
{{#if isValid}}is-valid{{else}}{{#ifCond isValid "===" false}}is-invalid{{/ifCond}}{{/if}}" ref="month"
|
|
44
|
+
aria-invalid="false" {{#if isDisabled}}disabled{{/if}} {{#if isRequired}}required{{/if}}>
|
|
51
45
|
</div>
|
|
52
46
|
</div>
|
|
53
47
|
<!-- year group -->
|
|
54
48
|
<div class="date-group">
|
|
55
|
-
<label id="{{id}}-yearinput-label" for="{{id}}-yearinput" class="date-label">Year</label>
|
|
49
|
+
<label id="{{id}}-yearinput-label" for="{{id}}-yearinput" class="date-label qld-text-input-label">Year</label>
|
|
56
50
|
<div class="year-label">
|
|
57
|
-
<input id="{{id}}-yearinput" aria-
|
|
58
|
-
placeholder="{{year-placeholder}}" type="text" inputmode="numeric" maxlength="4"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
isRequired}}required{{/if}}>
|
|
51
|
+
<input id="{{id}}-yearinput" aria-labelledby="{{id}}-label {{id}}-yearinput-label"
|
|
52
|
+
placeholder="{{year-placeholder}}" type="text" inputmode="numeric" maxlength="4" minlength="4" pattern="[0-9]*"
|
|
53
|
+
{{#if yearMin}}min="{{yearMin}}"{{/if}} {{#if yearMax}}max="{{yearMax}}"{{/if}}
|
|
54
|
+
class="form-control yearinput {{customClass}} {{#if isFilled}}form-style-filled{{/if}} {{#if isValid}}is-valid{{else}}{{#ifCond isValid "===" false}}is-invalid{{/ifCond}}{{/if}}"
|
|
55
|
+
ref="year" aria-invalid="false" {{#if isDisabled}}disabled{{/if}} {{#if isRequired}}required{{/if}}>
|
|
62
56
|
</div>
|
|
63
57
|
</div>
|
|
64
58
|
</div>
|
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
<div class="global-alert-include">
|
|
4
4
|
{{#each alertItems}}
|
|
5
5
|
<section role="region" class="global-alert alert container-full d-none {{variant}}" data-variant="{{variant}}"
|
|
6
|
-
|
|
6
|
+
{{#if ariaLabel}} aria-label="{{ ariaLabel }}"
|
|
7
|
+
{{~else ifCond variant "==" "global-alert-critical"}} aria-label="Critical alert"
|
|
8
|
+
{{~else ifCond variant "==" "global-alert-info"}} aria-label="Informational alert"
|
|
9
|
+
{{~else ifCond variant "==" "global-alert-warning"}} aria-label="Warning alert"
|
|
10
|
+
{{~else}} aria-label="Informational alert"
|
|
11
|
+
{{~/if}}
|
|
12
|
+
{{#if id}} data-id="{{id}}" {{/if}}{{#if dismissedExpiryDays}}
|
|
7
13
|
data-expiry-days="{{dismissedExpiryDays}}" {{/if}}>
|
|
8
14
|
<div class="qld-global-alert-main">
|
|
9
15
|
<div class="global-alert-icon">
|
|
@@ -13,6 +19,7 @@
|
|
|
13
19
|
<span class="qld-icon qld-icon-sm qld-icon-alert-information" aria-hidden="true"></span>
|
|
14
20
|
{{else ifCond variant '==' 'global-alert-warning'}}
|
|
15
21
|
<span class="qld-icon qld-icon-sm qld-icon-alert-warning" aria-hidden="true"></span>
|
|
22
|
+
{{else}}<span class="qld-icon qld-icon-sm qld-icon-alert-information" aria-hidden="true"></span>
|
|
16
23
|
{{/ifCond}}
|
|
17
24
|
</div>
|
|
18
25
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
<!-- VERSION_DETAILS={"project_id":"@qld-gov-au/qgds-bootstrap5","version":"2.1.
|
|
2
|
+
<!-- VERSION_DETAILS={"project_id":"@qld-gov-au/qgds-bootstrap5","version":"2.1.1","branch":"HEAD","tag":"v2.1.1","commit":"e9b014307ee0b957ab946f973a0bd735811415db","majorVersion":"v2"} -->
|
|
3
3
|
|
|
4
4
|
{{! Select environment, used verbatium if not using predefind key
|
|
5
5
|
cdn := PROD|STAGING|BETA|TEST|DEV|???
|
|
@@ -23,8 +23,13 @@ Reference: https://getbootstrap.com/docs/5.0/components/pagination/
|
|
|
23
23
|
{{! More button }}
|
|
24
24
|
<span></span>
|
|
25
25
|
{{else}}
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
{{#ifCond "active" "in" customClasses}}
|
|
27
|
+
{{! Active page - not a link }}
|
|
28
|
+
<span class="page-link" aria-current="page" aria-label="{{#if arialabel}}{{arialabel}}{{else}}Page {{linktext}}, current page{{/if}}">{{ linktext }}</span>
|
|
29
|
+
{{else}}
|
|
30
|
+
{{! Page button }}
|
|
31
|
+
<a class="page-link" href="{{href}}" aria-label="{{#if arialabel}}{{arialabel}}{{else}}Page {{linktext}}{{/if}}">{{ linktext }}</a>
|
|
32
|
+
{{/ifCond}}
|
|
28
33
|
{{/if}}
|
|
29
34
|
</li>
|
|
30
35
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
{{/ifCond}}>
|
|
6
6
|
<div class="image-panel">
|
|
7
7
|
{{#ifCond type '!=' 'promo'}}
|
|
8
|
-
<img class="promo-panel-image" src="{{promoImage}}" alt="Promotional
|
|
8
|
+
<img class="promo-panel-image" src="{{promoImage}}" alt="{{isdefined promoImageDescription "Promotional image"}}">
|
|
9
9
|
{{else}}
|
|
10
10
|
<div class="promo-panel-image"></div>
|
|
11
11
|
{{/ifCond}}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<div class="qld-search-input {{customClass}}">
|
|
5
5
|
<input id="{{ inputID }}" name="{{ inputName }}" class="form-control" type="text" autocomplete="off"
|
|
6
6
|
aria-label="{{ ariaLabel }}" {{#each tags}} data-{{@key}}="{{this}}" {{/each}} placeholder="{{placeholder}}" />
|
|
7
|
-
<button class="btn btn-primary" type="{{ buttonType }}" id="{{ buttonID }}">
|
|
8
|
-
<span class="btn-icon"></span>
|
|
7
|
+
<button class="btn btn-primary" type="{{ buttonType }}" id="{{ buttonID }}" aria-label="{{ buttonLabel }}">
|
|
8
|
+
<span class="btn-icon" aria-hidden="true"></span>
|
|
9
9
|
<span class="btn-label">{{ buttonLabel }}</span>
|
|
10
10
|
</button>
|
|
11
11
|
{{#ifCond hasDynamicSuggestions '||' hasDefaultSuggestions}}
|