@qld-gov-au/qgds-bootstrap5 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/preview.js +4 -1
- package/dist/assets/components/bs5/accordion/accordion.hbs +3 -6
- package/dist/assets/components/bs5/directionLinks/directionLinks.hbs +2 -1
- package/dist/assets/components/bs5/head/head.hbs +1 -1
- package/dist/assets/components/bs5/header/header.hbs +6 -9
- package/dist/assets/components/bs5/navbar/navbar.hbs +21 -14
- package/dist/assets/components/bs5/pageLayout/templates/contentPageWithForm.hbs +1 -1
- package/dist/assets/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +140 -108
- package/dist/assets/components/bs5/pageLayout/templates/homePage.hbs +1 -1
- package/dist/assets/components/bs5/quickexit/quickexit.hbs +1 -1
- package/dist/assets/components/bs5/sidenav/sidenav.hbs +56 -37
- package/dist/assets/css/qld.bootstrap.css +1 -6
- package/dist/assets/css/qld.bootstrap.css.map +3 -3
- package/dist/assets/js/handlebars.init.min.js +232 -179
- package/dist/assets/js/handlebars.init.min.js.map +2 -2
- package/dist/assets/js/qld.bootstrap.min.js +5 -5
- package/dist/assets/js/qld.bootstrap.min.js.map +4 -4
- package/dist/assets/node/handlebars.init.min.js +55 -23
- package/dist/assets/node/handlebars.init.min.js.map +2 -2
- package/dist/components/bs5/accordion/accordion.hbs +3 -6
- package/dist/components/bs5/directionLinks/directionLinks.hbs +2 -1
- package/dist/components/bs5/head/head.hbs +1 -1
- package/dist/components/bs5/header/header.hbs +6 -9
- package/dist/components/bs5/navbar/navbar.hbs +21 -14
- package/dist/components/bs5/pageLayout/templates/contentPageWithForm.hbs +1 -1
- package/dist/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +140 -108
- package/dist/components/bs5/pageLayout/templates/homePage.hbs +1 -1
- package/dist/components/bs5/quickexit/quickexit.hbs +1 -1
- package/dist/components/bs5/sidenav/sidenav.hbs +56 -37
- package/dist/package.json +2 -4
- package/dist/sample-data/accordion/accordion.data.json +24 -23
- package/dist/sample-data/navbar/navbar.data.json +91 -25
- package/dist/sample-data/pagination/pagination.data.json +19 -19
- package/dist/sample-data/sidenav/sidenav.data.json +81 -80
- package/package.json +2 -4
- package/src/components/bs5/accordion/Accordion.mdx +34 -12
- package/src/components/bs5/accordion/__snapshots__/accordion.test.js.snap +3 -6
- package/src/components/bs5/accordion/accordion.data.json +24 -23
- package/src/components/bs5/accordion/accordion.hbs +3 -6
- package/src/components/bs5/accordion/accordion.scss +19 -9
- package/src/components/bs5/accordion/accordion.stories.js +8 -0
- package/src/components/bs5/accordion/accordion.test.js +5 -0
- package/src/components/bs5/accordion/mdx/_designResources.mdx +6 -0
- package/src/components/bs5/accordion/mdx/_usageInstructions.mdx +10 -0
- package/src/components/bs5/backToTop/backToTop.mdx +4 -5
- package/src/components/bs5/banner/Banner.mdx +1 -3
- package/src/components/bs5/blockquote/Blockquote.mdx +4 -5
- package/src/components/bs5/blockquote/blockquote.scss +47 -7
- package/src/components/bs5/breadcrumbs/Breadcrumbs.mdx +1 -3
- package/src/components/bs5/button/Button.mdx +4 -5
- package/src/components/bs5/button/button.scss +13 -1
- package/src/components/bs5/callToAction/callToAction.mdx +1 -3
- package/src/components/bs5/callout/Callout.mdx +4 -5
- package/src/components/bs5/card/Card.mdx +1 -3
- package/src/components/bs5/card/card.scss +1 -25
- package/src/components/bs5/directionLinks/DirectionLinks.mdx +4 -5
- package/src/components/bs5/directionLinks/directionLinks.hbs +2 -1
- package/src/components/bs5/directionLinks/directionLinks.scss +27 -80
- package/src/components/bs5/directionLinks/directionLinks.stories.js +7 -14
- package/src/components/bs5/footer/Footer.mdx +1 -3
- package/src/components/bs5/footer/footer.scss +4 -11
- package/src/components/bs5/formcheck/stories/checkbox/Checkbox.mdx +7 -6
- package/src/components/bs5/formcheck/stories/radio/Radio.mdx +7 -6
- package/src/components/bs5/globalAlert/GlobalAlert.mdx +1 -3
- package/src/components/bs5/globalAlert/globalAlert.scss +6 -0
- package/src/components/bs5/header/Header.mdx +1 -3
- package/src/components/bs5/header/header.hbs +6 -9
- package/src/components/bs5/header/header.scss +6 -2
- package/src/components/bs5/icons/Icons.mdx +167 -7
- package/src/components/bs5/icons/_icons.sizes.scss +9 -0
- package/src/components/bs5/icons/icons.scss +23 -71
- package/src/components/bs5/icons/icons.stories.js +34 -57
- package/src/components/bs5/icons/mdx/_IconsSizes.mdx +112 -0
- package/src/components/bs5/icons/stories/storyFlexContainer.html +18 -0
- package/src/components/bs5/icons/stories/storyInlineWithText.html +18 -0
- package/src/components/bs5/icons/stories/storySizes.html +89 -0
- package/src/components/bs5/image/Image.mdx +1 -4
- package/src/components/bs5/inpageAlert/InpageAlert.mdx +1 -3
- package/src/components/bs5/inpagenav/Inpagenav.mdx +4 -5
- package/src/components/bs5/inpagenav/inpagenav.scss +7 -3
- package/src/components/bs5/link/link.mdx +1 -3
- package/src/components/bs5/link/link.scss +2 -15
- package/src/components/bs5/linkColumns/linkColumns.mdx +1 -3
- package/src/components/bs5/logo/Logo.mdx +1 -3
- package/src/components/bs5/navbar/navbar.data.json +91 -25
- package/src/components/bs5/navbar/navbar.functions.js +4 -0
- package/src/components/bs5/navbar/navbar.hbs +21 -14
- package/src/components/bs5/navbar/navbar.scss +219 -166
- package/src/components/bs5/navbar/navbar.stories.js +31 -2
- package/src/components/bs5/pageLayout/ThemeShowcase.stories.js +249 -0
- package/src/components/bs5/pageLayout/pageLayout.stories.js +3 -1
- package/src/components/bs5/pageLayout/templates/contentPageWithForm.hbs +1 -1
- package/src/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +140 -108
- package/src/components/bs5/pageLayout/templates/homePage.hbs +1 -1
- package/src/components/bs5/pagination/Pagination.mdx +4 -5
- package/src/components/bs5/pagination/pagination.data.json +19 -19
- package/src/components/bs5/pagination/pagination.scss +37 -63
- package/src/components/bs5/promotionalPanel/PromotionalPanel.mdx +1 -3
- package/src/components/bs5/promotionalPanel/promotionalPanel.scss +23 -22
- package/src/components/bs5/quickexit/quickexit.functions.js +24 -37
- package/src/components/bs5/quickexit/quickexit.hbs +1 -1
- package/src/components/bs5/quickexit/quickexit.scss +27 -10
- package/src/components/bs5/searchInput/SearchInput.mdx +5 -5
- package/src/components/bs5/sidenav/Sidenav.mdx +4 -5
- package/src/components/bs5/sidenav/sidenav.data.json +81 -80
- package/src/components/bs5/sidenav/sidenav.hbs +56 -37
- package/src/components/bs5/sidenav/sidenav.scss +236 -151
- package/src/components/bs5/skiplinks/SkipLinks.mdx +1 -3
- package/src/components/bs5/skiplinks/skipLinks.functions.js +0 -9
- package/src/components/bs5/skiplinks/skipLinks.test.js +0 -1
- package/src/components/bs5/table/Table.mdx +4 -5
- package/src/components/bs5/tabs/Tabs.mdx +4 -5
- package/src/components/bs5/tabs/tabs.scss +22 -1
- package/src/components/bs5/tag/Tag.mdx +4 -5
- package/src/components/bs5/typography/Typography.mdx +4 -5
- package/src/components/bs5/video/Video.mdx +4 -5
- package/src/components/common/layout/container.scss +5 -0
- package/src/components/common/layout/content.scss +16 -8
- package/src/css/functions/_index.scss +1 -0
- package/src/css/functions/in-list.scss +5 -0
- package/src/css/main.scss +4 -10
- package/src/css/mixins/_index.scss +3 -0
- package/src/css/mixins/make-icon.scss +87 -0
- package/src/css/qld-theme.scss +74 -31
- package/src/css/qld-type.scss +26 -140
- package/src/css/qld-utilities.scss +29 -14
- package/src/css/qld-variables.scss +4 -4
- package/src/css/utilities/_index.scss +1 -0
- package/src/css/utilities/sr-only.scss +5 -0
- package/src/css/variables/_index.scss +1 -0
- package/src/css/variables/type.scss +58 -0
- package/src/js/qld.bootstrap.js +1 -9
- package/src/stories/documentation/_storybookDocsTabs.jsx +63 -0
- package/src/stories/documentation/storybook-documentation.scss +51 -0
- package/src/components/bs5/icons/story-icon-sizing.html +0 -131
- package/src/components/bs5/icons/story-icon-usage.html +0 -89
- package/src/components/bs5/pagination/health-icon-sprite.svg +0 -156
|
@@ -1,116 +1,63 @@
|
|
|
1
1
|
// QGDS QOL Direction Links
|
|
2
2
|
|
|
3
3
|
a.qld-dir-link {
|
|
4
|
-
|
|
5
|
-
--
|
|
6
|
-
--
|
|
7
|
-
--icon-colour: var(--qld-light-action-secondary);
|
|
8
|
-
--icon-colour-hover: var(--qld-light-action-secondary-hover);
|
|
4
|
+
--link-colour: var(--#{$prefix}light-action-primary);
|
|
5
|
+
--icon-colour: var(--#{$prefix}light-action-secondary);
|
|
6
|
+
--icon-colour-hover: var(--#{$prefix}light-action-secondary-hover);
|
|
9
7
|
|
|
10
8
|
color: var(--link-colour);
|
|
11
9
|
text-decoration-color: var(--link-colour);
|
|
12
10
|
display: flex;
|
|
11
|
+
gap: 0.5rem;
|
|
13
12
|
width: fit-content;
|
|
14
13
|
justify-content: space-between;
|
|
15
14
|
align-self: flex-start;
|
|
16
15
|
|
|
17
16
|
&:focus {
|
|
18
17
|
border-radius: 4px;
|
|
19
|
-
outline: 3px solid var(
|
|
18
|
+
outline: 3px solid var(--#{$prefix}focus-color);
|
|
20
19
|
outline-offset: 2px;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
&.small {
|
|
24
|
-
font-size: 0.875rem;
|
|
25
|
-
line-height: 1rem;
|
|
26
|
-
|
|
27
|
-
.icon {
|
|
28
|
-
&::after {
|
|
29
|
-
zoom: 0.7;
|
|
30
|
-
mask-position: 0;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.icon {
|
|
36
|
-
&::after {
|
|
37
|
-
content: "";
|
|
38
|
-
display: inline-block;
|
|
39
|
-
width: 1rem;
|
|
40
|
-
height: 1.25rem;
|
|
41
|
-
mask-image: var(--dir-icon);
|
|
42
|
-
mask-repeat: no-repeat;
|
|
43
|
-
mask-position: 0 0.25rem;
|
|
44
|
-
background-color: var(--icon-colour);
|
|
45
|
-
margin-inline: 0.5rem;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
22
|
&:hover {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
&::after {
|
|
53
|
-
background-color: var(--icon-colour-hover);
|
|
54
|
-
}
|
|
23
|
+
.qld-icon {
|
|
24
|
+
background-color: var(--icon-colour-hover);
|
|
55
25
|
}
|
|
56
26
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
&.down {
|
|
65
|
-
.icon {
|
|
66
|
-
transform: rotate(90deg);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
&.left {
|
|
71
|
-
flex-direction: row-reverse;
|
|
72
|
-
|
|
73
|
-
.icon {
|
|
74
|
-
transform: rotate(180deg);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
&.right {
|
|
79
|
-
.icon {
|
|
80
|
-
transform: rotate(0deg);
|
|
81
|
-
}
|
|
27
|
+
}
|
|
28
|
+
a[aria-disabled="true"] {
|
|
29
|
+
pointer-events: none;
|
|
30
|
+
color: var(--#{$prefix}hint-text-color-muted);
|
|
31
|
+
text-decoration-color: var(--#{$prefix}dark-grey-muted);
|
|
32
|
+
.qld-icon {
|
|
33
|
+
background-color: var(--#{$prefix}dark-grey-muted);
|
|
82
34
|
}
|
|
83
35
|
}
|
|
84
|
-
|
|
85
36
|
.light,
|
|
86
37
|
.alt {
|
|
87
38
|
.qld-dir-link {
|
|
88
|
-
--link-colour: var(
|
|
89
|
-
--icon-colour: var(
|
|
90
|
-
--icon-colour-hover: var(
|
|
39
|
+
--link-colour: var(--#{$prefix}light-action-primary);
|
|
40
|
+
--icon-colour: var(--#{$prefix}light-action-secondary);
|
|
41
|
+
--icon-colour-hover: var(--#{$prefix}light-action-secondary-hover);
|
|
91
42
|
}
|
|
92
43
|
}
|
|
93
44
|
|
|
94
45
|
.dark,
|
|
95
46
|
.dark-alt {
|
|
96
47
|
.qld-dir-link {
|
|
97
|
-
--link-colour: var(
|
|
98
|
-
--icon-colour: var(
|
|
99
|
-
--icon-colour-hover: var(
|
|
48
|
+
--link-colour: var(--#{$prefix}dark-text);
|
|
49
|
+
--icon-colour: var(--#{$prefix}dark-action-secondary);
|
|
50
|
+
--icon-colour-hover: var(--#{$prefix}dark-action-secondary-hover);
|
|
51
|
+
}
|
|
52
|
+
a[aria-disabled="true"] {
|
|
53
|
+
color: var(--#{$prefix}dark-text-lighter);
|
|
54
|
+
text-decoration-color: var(--#{$prefix}dark-text-lighter);
|
|
55
|
+
.qld-icon {
|
|
56
|
+
background-color: var(--#{$prefix}dark-text-lighter);
|
|
57
|
+
}
|
|
100
58
|
}
|
|
101
59
|
}
|
|
102
60
|
|
|
103
61
|
li .qld-dir-link {
|
|
104
62
|
width: auto;
|
|
105
63
|
}
|
|
106
|
-
|
|
107
|
-
a[aria-disabled="true"] {
|
|
108
|
-
pointer-events: none;
|
|
109
|
-
color: var(--qld-dark-grey-muted);
|
|
110
|
-
|
|
111
|
-
.icon {
|
|
112
|
-
&::after {
|
|
113
|
-
background-color: var(--qld-dark-grey-muted);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
@@ -15,29 +15,21 @@ export default {
|
|
|
15
15
|
<!-- Grid container -->
|
|
16
16
|
<div class="container">
|
|
17
17
|
<div class="row">
|
|
18
|
-
<div class="col">
|
|
19
|
-
|
|
18
|
+
<div class="col">
|
|
20
19
|
<!-- Component HTML -->
|
|
21
|
-
${new DirectionLinks({ ...args, class: "up", label: "Up" }).html}
|
|
22
|
-
|
|
20
|
+
${new DirectionLinks({ ...args, class: "up", label: "Up" }).html}
|
|
23
21
|
</div>
|
|
24
22
|
<div class="col">
|
|
25
|
-
|
|
26
23
|
<!-- Component HTML -->
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
${new DirectionLinks({ ...args, class: "down", label: "Down" }).html}
|
|
29
25
|
</div>
|
|
30
26
|
<div class="col">
|
|
31
|
-
|
|
32
27
|
<!-- Component HTML -->
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
${new DirectionLinks({ ...args, class: "left", label: "Left" }).html}
|
|
35
29
|
</div>
|
|
36
|
-
<div class="col">
|
|
37
|
-
|
|
30
|
+
<div class="col">
|
|
38
31
|
<!-- Component HTML -->
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
${new DirectionLinks({ ...args, class: "right", label: "Right" }).html}
|
|
41
33
|
</div>
|
|
42
34
|
</div>
|
|
43
35
|
</div>
|
|
@@ -59,6 +51,7 @@ export default {
|
|
|
59
51
|
label: { control: "text" },
|
|
60
52
|
},
|
|
61
53
|
parameters: {
|
|
54
|
+
controls: { disable: true },
|
|
62
55
|
design: {
|
|
63
56
|
name: "QGDS Figma Reference",
|
|
64
57
|
type: "figma",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
--#{$prefix}footer-color-alt-button__hover: var(
|
|
42
42
|
--#{$prefix}core-default-color-brand-primary-light-green
|
|
43
43
|
);
|
|
44
|
+
--#{$prefix}footer-color-social-icon: #{$core-default-color-neutral-black};
|
|
44
45
|
|
|
45
46
|
// ------------------------------------------------------------------------------------------------------------------
|
|
46
47
|
// 2. Colours
|
|
@@ -85,6 +86,7 @@
|
|
|
85
86
|
--#{$prefix}footer-color-focus: var(
|
|
86
87
|
--#{$prefix}color-default-color-dark-underline-default
|
|
87
88
|
);
|
|
89
|
+
--#{$prefix}footer-color-social-icon: #{$core-default-color-neutral-white};
|
|
88
90
|
}
|
|
89
91
|
&.dark-alt {
|
|
90
92
|
--#{$prefix}footer-color-background: var(
|
|
@@ -216,17 +218,6 @@
|
|
|
216
218
|
&:last-child {
|
|
217
219
|
margin-block-end: 0;
|
|
218
220
|
}
|
|
219
|
-
|
|
220
|
-
.qld-icon {
|
|
221
|
-
--#{$prefix}icon-color: var(--#{$prefix}brand-accent);
|
|
222
|
-
--qld-brand-accent: var(--#{$prefix}footer-color-alt-button);
|
|
223
|
-
display: block;
|
|
224
|
-
background-color: var(--#{$prefix}icon-color);
|
|
225
|
-
|
|
226
|
-
&:hover {
|
|
227
|
-
--qld-brand-accent: var(--#{$prefix}footer-color-alt-button__hover);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
221
|
}
|
|
231
222
|
|
|
232
223
|
//Crest Logo
|
|
@@ -280,6 +271,8 @@
|
|
|
280
271
|
}
|
|
281
272
|
|
|
282
273
|
.qld-icon {
|
|
274
|
+
--#{$prefix}icon-color: var(--#{$prefix}footer-color-social-icon);
|
|
275
|
+
|
|
283
276
|
// max-height: unset;
|
|
284
277
|
margin-block-end: 0;
|
|
285
278
|
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { Canvas, Meta, Story } from "@storybook/blocks"
|
|
2
|
-
import * as FormCheckCheckboxStories from "./checkbox.stories"
|
|
1
|
+
import { Canvas, Meta, Story } from "@storybook/blocks";
|
|
2
|
+
import * as FormCheckCheckboxStories from "./checkbox.stories";
|
|
3
3
|
|
|
4
4
|
<Meta of={FormCheckCheckboxStories} />
|
|
5
5
|
|
|
6
6
|
# Form check (Checkbox)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
</Canvas>
|
|
7
|
+
|
|
8
|
+
<Canvas of={FormCheckCheckboxStories.Default} />
|
|
10
9
|
|
|
11
10
|
## Design resources
|
|
11
|
+
|
|
12
12
|
- [Bootstrap component](https://getbootstrap.com/docs/5.3/forms/checks-radios/)
|
|
13
13
|
|
|
14
14
|
### Checkbox
|
|
15
|
+
|
|
15
16
|
- [Component library (Figma)](https://www.figma.com/file/qKsxl3ogIlBp7dafgxXuCA/QLD-GOV-DDS?type=design&node-id=11185-257399&mode=design&t=9b0T06NG5P47amzB-4)
|
|
16
17
|
- [Master component file (Figma)](https://www.figma.com/file/qKsxl3ogIlBp7dafgxXuCA/QLD-GOV-DDS?type=design&node-id=11056-321348&mode=design&t=9b0T06NG5P47amzB-0)
|
|
17
18
|
- [Design System website](https://www.design-system.health.qld.gov.au/components/checkboxes)./formcheckRadio.stories
|
|
18
|
-
../../formcheckCheckbox.stories./checkbox.stories
|
|
19
|
+
../../formcheckCheckbox.stories./checkbox.stories
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { Canvas, Meta, Story } from "@storybook/blocks"
|
|
2
|
-
import * as FormCheckRadioStories from "./radio.stories"
|
|
1
|
+
import { Canvas, Meta, Story } from "@storybook/blocks";
|
|
2
|
+
import * as FormCheckRadioStories from "./radio.stories";
|
|
3
3
|
|
|
4
4
|
<Meta of={FormCheckRadioStories} />
|
|
5
5
|
|
|
6
6
|
# Form check (Radio)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
</Canvas>
|
|
7
|
+
|
|
8
|
+
<Canvas of={FormCheckRadioStories.Default} />
|
|
10
9
|
|
|
11
10
|
## Design resources
|
|
11
|
+
|
|
12
12
|
- [Bootstrap component](https://getbootstrap.com/docs/5.3/forms/checks-radios/)
|
|
13
13
|
|
|
14
14
|
### Radio
|
|
15
|
+
|
|
15
16
|
- [Component library (Figma)](https://www.figma.com/file/qKsxl3ogIlBp7dafgxXuCA/QLD-GOV-DDS?type=design&node-id=6274-42582&mode=design&t=sWeMBpAnKzpGzmWI-4)
|
|
16
17
|
- [Master component file (Figma)](https://www.figma.com/file/qKsxl3ogIlBp7dafgxXuCA/QLD-GOV-DDS?type=design&node-id=11056-321347&mode=design&t=9b0T06NG5P47amzB-0)
|
|
17
|
-
- [Design System website](https://www.design-system.health.qld.gov.au/components/radio-buttons)
|
|
18
|
+
- [Design System website](https://www.design-system.health.qld.gov.au/components/radio-buttons)
|
|
@@ -118,6 +118,8 @@
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
&.global-alert-critical {
|
|
121
|
+
--#{$prefix}icon-color: #{$core-default-color-neutral-white};
|
|
122
|
+
//
|
|
121
123
|
background-color: $qld-notify-warning;
|
|
122
124
|
color: var(--#{$prefix}white);
|
|
123
125
|
font-size: 0.875em;
|
|
@@ -153,6 +155,8 @@
|
|
|
153
155
|
}
|
|
154
156
|
|
|
155
157
|
&.global-alert-warning {
|
|
158
|
+
--#{$prefix}icon-color: #{$core-default-color-neutral-black};
|
|
159
|
+
//
|
|
156
160
|
background-color: $qld-notify-alert;
|
|
157
161
|
color: var(--#{$prefix}body-color);
|
|
158
162
|
font-size: 0.875em;
|
|
@@ -165,6 +169,8 @@
|
|
|
165
169
|
}
|
|
166
170
|
|
|
167
171
|
&.global-alert-info {
|
|
172
|
+
--#{$prefix}icon-color: #{$core-default-color-neutral-black};
|
|
173
|
+
//
|
|
168
174
|
background-color: $qld-general-info-alert;
|
|
169
175
|
color: var(--#{$prefix}body-color);
|
|
170
176
|
font-size: 0.875em;
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg"
|
|
24
24
|
class="qld-header-dropdown-icon ">
|
|
25
|
-
<use href="{{
|
|
25
|
+
<use href="{{../assets.SVGSpritePath}}#qgds-icon-chevron-down"
|
|
26
26
|
aria-hidden="true"></use>
|
|
27
27
|
</svg>
|
|
28
28
|
</a>
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
<a class="qld-header-link dropdown-item " href="{{url}}" {{#if target}}target="{{target}}"{{/if}}>
|
|
36
36
|
{{text}}
|
|
37
37
|
<svg width="24" height="24" class="qld-header-icon qld-header-dropdown-item-icon">
|
|
38
|
-
<use href="{{
|
|
38
|
+
<use href="{{ ../../assets.SVGSpritePath }}#qgds-icon-arrow-right"
|
|
39
39
|
aria-hidden="true"></use>
|
|
40
40
|
</svg>
|
|
41
41
|
</a>
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
<a class="qld-header-link" href="{{url}}">
|
|
67
67
|
{{#if icon}}
|
|
68
68
|
<svg class="qld-header-link-icon">
|
|
69
|
-
<use href="{{
|
|
69
|
+
<use href="{{ ../assets.SVGSpritePath }}#qgds-icon-{{icon}}" aria-hidden="true"></use>
|
|
70
70
|
</svg>{{/if}}{{{text}}}
|
|
71
71
|
</a>
|
|
72
72
|
{{/if}}
|
|
@@ -80,11 +80,8 @@
|
|
|
80
80
|
<button id="qld-header-toggle-search-button" aria-controls="qld-header-search"
|
|
81
81
|
class="qld-header-toggle-main-nav" aria-expanded="false">
|
|
82
82
|
<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg">
|
|
83
|
-
<use class="icon-search"
|
|
84
|
-
|
|
85
|
-
style="display: block;"></use>
|
|
86
|
-
<use class="icon-close" href="{{@root.assets.SVGSpritePath}}#qgds-icon-close"
|
|
87
|
-
style="display: none;"></use>
|
|
83
|
+
<use class="icon-search" href="{{ assets.SVGSpritePath }}#qgds-icon-search" aria-hidden="true" style="display: block;"></use>
|
|
84
|
+
<use class="icon-close" href="{{ assets.SVGSpritePath}}#qgds-icon-close" style="display: none;"></use>
|
|
88
85
|
</svg>
|
|
89
86
|
<span class="qld-header-toggle-main-nav-text">Search</span>
|
|
90
87
|
</button>
|
|
@@ -94,7 +91,7 @@
|
|
|
94
91
|
data-bs-toggle="collapse" data-bs-target="#main-nav" aria-controls="main-nav" aria-expanded="false"
|
|
95
92
|
aria-label="Open menu">
|
|
96
93
|
<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg">
|
|
97
|
-
<use href="{{
|
|
94
|
+
<use href="{{assets.SVGSpritePath}}#qgds-icon-menu" aria-hidden="true">
|
|
98
95
|
</use>
|
|
99
96
|
</svg>
|
|
100
97
|
<span class="qld-header-toggle-main-nav-text">Menu</span>
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
.qld-header {
|
|
19
19
|
@extend %header-variables;
|
|
20
|
-
|
|
21
|
-
background: var(--#{$prefix}header-color-bg);
|
|
20
|
+
|
|
22
21
|
font-size: 1rem;
|
|
23
22
|
|
|
24
23
|
@include media-breakpoint-up(sm) {
|
|
@@ -262,6 +261,7 @@
|
|
|
262
261
|
border-bottom: solid 1px var(--#{$prefix}header__CTA_border_color);
|
|
263
262
|
padding: 1rem 1.75rem 1rem 0;
|
|
264
263
|
line-height: 1.5;
|
|
264
|
+
white-space: normal; // allow text to wrap
|
|
265
265
|
|
|
266
266
|
&:visited {
|
|
267
267
|
color: var(--#{$prefix}header__CTA_text_color);
|
|
@@ -285,10 +285,14 @@
|
|
|
285
285
|
color: var(--#{$prefix}header__cta-wrapper__cta-link-icon_color);
|
|
286
286
|
position: absolute;
|
|
287
287
|
right: 0;
|
|
288
|
+
top: 50%;
|
|
289
|
+
transform: translateY(-50%);
|
|
288
290
|
}
|
|
289
291
|
|
|
290
292
|
&-main {
|
|
291
293
|
position: relative;
|
|
294
|
+
color: var(--#{$prefix}header-color-text);
|
|
295
|
+
background: var(--#{$prefix}header-color-bg);
|
|
292
296
|
}
|
|
293
297
|
|
|
294
298
|
&-brand {
|
|
@@ -1,13 +1,173 @@
|
|
|
1
|
-
import { Canvas, Meta, Story,
|
|
2
|
-
import * as
|
|
1
|
+
import { Canvas, Meta, Story, Markdown } from "@storybook/blocks";
|
|
2
|
+
import * as IconStories from "./icons.stories.js";
|
|
3
|
+
import IconsSizes from "./mdx/_IconsSizes.mdx";
|
|
3
4
|
|
|
4
|
-
<Meta of={
|
|
5
|
+
<Meta of={IconStories} />
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
<Canvas>
|
|
8
|
-
<Story of={IconsStories.Overview} />
|
|
9
|
-
</Canvas>
|
|
7
|
+
# Iconography
|
|
10
8
|
|
|
9
|
+
The icons in QGDS can be used in multiple ways depending on your needs and environment. This guide covers the 4 primary methods as well as the sizing utilities:
|
|
10
|
+
|
|
11
|
+
- **Inline SVG**
|
|
12
|
+
- **CSS utility class**
|
|
13
|
+
- **SCSS mixin**
|
|
14
|
+
- **CSS variables**
|
|
15
|
+
|
|
16
|
+
## Inline SVG (HTML Embed)
|
|
17
|
+
|
|
18
|
+
This method allows for full control over the icon's appearance, eg: colour,
|
|
19
|
+
size, stroke, etc. Recommended for developers and content editors embedding
|
|
20
|
+
icons directly in HTML.
|
|
21
|
+
|
|
22
|
+
Place the Symbol ID on to the `<use>` element within an `<svg>` tag. Example:
|
|
23
|
+
|
|
24
|
+
<svg
|
|
25
|
+
className="qld-icon qld-icon-lg"
|
|
26
|
+
style={{ color: "#dd0000" }}
|
|
27
|
+
aria-label="Cancel alert"
|
|
28
|
+
role="img"
|
|
29
|
+
>
|
|
30
|
+
<use href="./assets/img/icons-sprite.svg#qgds-icon-alert-cancel"></use>
|
|
31
|
+
</svg>
|
|
32
|
+
<svg
|
|
33
|
+
className="qld-icon qld-icon-lg"
|
|
34
|
+
style={{ color: "#ffa500" }}
|
|
35
|
+
aria-label="Warning alert"
|
|
36
|
+
role="img"
|
|
37
|
+
>
|
|
38
|
+
<use href="./assets/img/icons-sprite.svg#qgds-icon-alert-warning"></use>
|
|
39
|
+
</svg>
|
|
40
|
+
<svg
|
|
41
|
+
className="qld-icon qld-icon-lg"
|
|
42
|
+
style={{ color: "#00dd00" }}
|
|
43
|
+
aria-label="Success alert"
|
|
44
|
+
role="img"
|
|
45
|
+
>
|
|
46
|
+
<use href="./assets/img/icons-sprite.svg#qgds-icon-alert-success"></use>
|
|
47
|
+
</svg>
|
|
48
|
+
|
|
49
|
+
```html
|
|
50
|
+
<svg className="qld-icon qld-icon-lg" aria-label="Cancel alert">
|
|
51
|
+
<use href="./assets/img/icons-sprite.svg#qgds-icon-alert-cancel"></use>
|
|
52
|
+
</svg>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Accessibility
|
|
56
|
+
|
|
57
|
+
- Always include `role="img"` and `aria-label`
|
|
58
|
+
attributes to provide context for screen readers.
|
|
59
|
+
|
|
60
|
+
- Use `aria-hidden="true"` when the icon is decorative
|
|
61
|
+
|
|
62
|
+
## CSS Class
|
|
63
|
+
|
|
64
|
+
This method is suitable for developers who want to apply icons in their stylesheets.
|
|
65
|
+
|
|
66
|
+
Use the `qld-icon` + `qld-icon-{iconName}` utility class to render icons as CSS masked elements.
|
|
67
|
+
Example:
|
|
68
|
+
|
|
69
|
+
<div>
|
|
70
|
+
<span class="qld-icon qld-icon-lg qld-icon-home" aria-hidden="true"></span>
|
|
71
|
+
<span class="qld-icon qld-icon-lg qld-icon-search" aria-hidden="true"></span>
|
|
72
|
+
<span class="qld-icon qld-icon-lg qld-icon-menu" aria-hidden="true"></span>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
{/* prettier-ignore-start */}
|
|
76
|
+
```html
|
|
77
|
+
<span class="qld-icon qld-icon-lg qld-icon-home" aria-hidden="true"></span>
|
|
78
|
+
<span class="qld-icon qld-icon-lg qld-icon-search" aria-hidden="true"></span>
|
|
79
|
+
<span class="qld-icon qld-icon-lg qld-icon-menu" aria-hidden="true"></span>
|
|
80
|
+
```
|
|
81
|
+
{/* prettier-ignore-end */}
|
|
82
|
+
|
|
83
|
+
### Accessibility
|
|
84
|
+
|
|
85
|
+
- This method is for decorative only. Use `aria-hidden="true"` to hide the icon from screen readers.
|
|
86
|
+
- Ensure to use it alongside text or other elements that provide context for screen readers users.
|
|
87
|
+
|
|
88
|
+
## SCSS mixin
|
|
89
|
+
|
|
90
|
+
For developers with access to scss source code, and when it is not feasible to alter existing html markup, you can apply the `make-icon` mixin to any existing class.
|
|
91
|
+
Using the mixin ensures consistent implementation and API with standard icon classes.
|
|
92
|
+
|
|
93
|
+
```css
|
|
94
|
+
/* @use - sass module system. Make sure the path is correct for your particular implementation. */
|
|
95
|
+
@use "/../../css/mixins";
|
|
96
|
+
|
|
97
|
+
.my-custom-class {
|
|
98
|
+
@include mixins.make-icon($name: "alert-cancel");
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Mixin API
|
|
103
|
+
|
|
104
|
+
<Markdown>
|
|
105
|
+
{`
|
|
106
|
+
| Parameter | Type | Description |
|
|
107
|
+
| ----------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
108
|
+
| \`$name\` | String | The name of icon. eg "alert-cancel". Optional but recoommended. |
|
|
109
|
+
| \`$size\` | String | The icon size, valid values are \`"xs"\`, \`"sm"\`(default), \`"md"\`, \`"lg"\`, \`"xl"\`, \`"xxl"\`. |
|
|
110
|
+
| \`$pseudo\` | String | Optionally apply styles as a pseudo-element. Valid string values are \`"before"\`, \`"after"\`, \`null\`(default) |
|
|
111
|
+
| \`$is-inline\` | Boolean | Applies extra styles to assist with vertical alignent when used inline with text. Default:\`false\` |
|
|
112
|
+
| \`$include-base\` | Boolean | Apply all base styles. Set to false when creating modifier classes where base styles are already applied. Default:\`true\`|
|
|
113
|
+
`}
|
|
114
|
+
|
|
115
|
+
</Markdown>
|
|
116
|
+
|
|
117
|
+
## CSS Variables
|
|
118
|
+
|
|
119
|
+
As a last resort this method allows developers to create custom styles with any CSS property that accepts a URL, such as <code>mask-image</code> and <code>background-image</code>.
|
|
120
|
+
Only use this method in custom CSS where you don't have access to precompiled scss.
|
|
121
|
+
Example:
|
|
122
|
+
|
|
123
|
+
```css
|
|
124
|
+
.mysite-icon-cancel-payment {
|
|
125
|
+
mask-image: var(--qgds-icon-alert-cancel);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.abc-icon-login {
|
|
129
|
+
background-image: var(--qgds-icon-identity);
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Accessibility
|
|
134
|
+
|
|
135
|
+
- This method is for decorative only. Use `aria-hidden="true"` to hide the icon from screen readers.
|
|
136
|
+
- Ensure to use it alongside text or other elements that provide context for screen readers users.
|
|
137
|
+
|
|
138
|
+
<IconsSizes />
|
|
139
|
+
|
|
140
|
+
## Working with color
|
|
141
|
+
|
|
142
|
+
Assigning a value to the custom property `--qld-icon-color` to alter an icon's color.
|
|
143
|
+
This ensures the same API between inline SVGs, CSS classes and SCSS mixin. An extra benefit is that custom property cascades, meaning icons will inherit whatever value is set on its ancestors.
|
|
144
|
+
|
|
145
|
+
<span className="my-link-with-icon" style={{ "--qld-icon-color": "red" }}>
|
|
146
|
+
<span class="qld-icon qld-icon-alert-danger"></span> Custom properties rock!
|
|
147
|
+
</span>
|
|
148
|
+
|
|
149
|
+
{/* prettier-ignore-start */}
|
|
150
|
+
```html
|
|
151
|
+
<span class="my-link-with-icon" style="--qld-icon-color: red">
|
|
152
|
+
<span class="qld-icon qld-icon-alert-danger"></span>
|
|
153
|
+
Custom properties rock!
|
|
154
|
+
</span>
|
|
155
|
+
```
|
|
156
|
+
{/* prettier-ignore-end */}
|
|
157
|
+
|
|
158
|
+
## Vertical Alignment
|
|
159
|
+
|
|
160
|
+
### Inline with text
|
|
161
|
+
|
|
162
|
+
When using icons inline with text, add additional class `is-inline` to the icon to assist with vertical alignment.
|
|
163
|
+
|
|
164
|
+
<Canvas of={IconStories.InlineWithText} />
|
|
165
|
+
|
|
166
|
+
### Within a flex container
|
|
167
|
+
|
|
168
|
+
Use flex utility classes when within a flex container, either `align-items-center` on the parent, or `align-self-center` on the icon itself.
|
|
169
|
+
|
|
170
|
+
<Canvas of={IconStories.FlexContainer} />
|
|
11
171
|
|
|
12
172
|
## Design resources
|
|
13
173
|
|