@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.
Files changed (137) hide show
  1. package/.storybook/preview.js +4 -1
  2. package/dist/assets/components/bs5/accordion/accordion.hbs +3 -6
  3. package/dist/assets/components/bs5/directionLinks/directionLinks.hbs +2 -1
  4. package/dist/assets/components/bs5/head/head.hbs +1 -1
  5. package/dist/assets/components/bs5/header/header.hbs +6 -9
  6. package/dist/assets/components/bs5/navbar/navbar.hbs +21 -14
  7. package/dist/assets/components/bs5/pageLayout/templates/contentPageWithForm.hbs +1 -1
  8. package/dist/assets/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +140 -108
  9. package/dist/assets/components/bs5/pageLayout/templates/homePage.hbs +1 -1
  10. package/dist/assets/components/bs5/quickexit/quickexit.hbs +1 -1
  11. package/dist/assets/components/bs5/sidenav/sidenav.hbs +56 -37
  12. package/dist/assets/css/qld.bootstrap.css +1 -6
  13. package/dist/assets/css/qld.bootstrap.css.map +3 -3
  14. package/dist/assets/js/handlebars.init.min.js +232 -179
  15. package/dist/assets/js/handlebars.init.min.js.map +2 -2
  16. package/dist/assets/js/qld.bootstrap.min.js +5 -5
  17. package/dist/assets/js/qld.bootstrap.min.js.map +4 -4
  18. package/dist/assets/node/handlebars.init.min.js +55 -23
  19. package/dist/assets/node/handlebars.init.min.js.map +2 -2
  20. package/dist/components/bs5/accordion/accordion.hbs +3 -6
  21. package/dist/components/bs5/directionLinks/directionLinks.hbs +2 -1
  22. package/dist/components/bs5/head/head.hbs +1 -1
  23. package/dist/components/bs5/header/header.hbs +6 -9
  24. package/dist/components/bs5/navbar/navbar.hbs +21 -14
  25. package/dist/components/bs5/pageLayout/templates/contentPageWithForm.hbs +1 -1
  26. package/dist/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +140 -108
  27. package/dist/components/bs5/pageLayout/templates/homePage.hbs +1 -1
  28. package/dist/components/bs5/quickexit/quickexit.hbs +1 -1
  29. package/dist/components/bs5/sidenav/sidenav.hbs +56 -37
  30. package/dist/package.json +2 -4
  31. package/dist/sample-data/accordion/accordion.data.json +24 -23
  32. package/dist/sample-data/navbar/navbar.data.json +91 -25
  33. package/dist/sample-data/pagination/pagination.data.json +19 -19
  34. package/dist/sample-data/sidenav/sidenav.data.json +81 -80
  35. package/package.json +2 -4
  36. package/src/components/bs5/accordion/Accordion.mdx +34 -12
  37. package/src/components/bs5/accordion/__snapshots__/accordion.test.js.snap +3 -6
  38. package/src/components/bs5/accordion/accordion.data.json +24 -23
  39. package/src/components/bs5/accordion/accordion.hbs +3 -6
  40. package/src/components/bs5/accordion/accordion.scss +19 -9
  41. package/src/components/bs5/accordion/accordion.stories.js +8 -0
  42. package/src/components/bs5/accordion/accordion.test.js +5 -0
  43. package/src/components/bs5/accordion/mdx/_designResources.mdx +6 -0
  44. package/src/components/bs5/accordion/mdx/_usageInstructions.mdx +10 -0
  45. package/src/components/bs5/backToTop/backToTop.mdx +4 -5
  46. package/src/components/bs5/banner/Banner.mdx +1 -3
  47. package/src/components/bs5/blockquote/Blockquote.mdx +4 -5
  48. package/src/components/bs5/blockquote/blockquote.scss +47 -7
  49. package/src/components/bs5/breadcrumbs/Breadcrumbs.mdx +1 -3
  50. package/src/components/bs5/button/Button.mdx +4 -5
  51. package/src/components/bs5/button/button.scss +13 -1
  52. package/src/components/bs5/callToAction/callToAction.mdx +1 -3
  53. package/src/components/bs5/callout/Callout.mdx +4 -5
  54. package/src/components/bs5/card/Card.mdx +1 -3
  55. package/src/components/bs5/card/card.scss +1 -25
  56. package/src/components/bs5/directionLinks/DirectionLinks.mdx +4 -5
  57. package/src/components/bs5/directionLinks/directionLinks.hbs +2 -1
  58. package/src/components/bs5/directionLinks/directionLinks.scss +27 -80
  59. package/src/components/bs5/directionLinks/directionLinks.stories.js +7 -14
  60. package/src/components/bs5/footer/Footer.mdx +1 -3
  61. package/src/components/bs5/footer/footer.scss +4 -11
  62. package/src/components/bs5/formcheck/stories/checkbox/Checkbox.mdx +7 -6
  63. package/src/components/bs5/formcheck/stories/radio/Radio.mdx +7 -6
  64. package/src/components/bs5/globalAlert/GlobalAlert.mdx +1 -3
  65. package/src/components/bs5/globalAlert/globalAlert.scss +6 -0
  66. package/src/components/bs5/header/Header.mdx +1 -3
  67. package/src/components/bs5/header/header.hbs +6 -9
  68. package/src/components/bs5/header/header.scss +6 -2
  69. package/src/components/bs5/icons/Icons.mdx +167 -7
  70. package/src/components/bs5/icons/_icons.sizes.scss +9 -0
  71. package/src/components/bs5/icons/icons.scss +23 -71
  72. package/src/components/bs5/icons/icons.stories.js +34 -57
  73. package/src/components/bs5/icons/mdx/_IconsSizes.mdx +112 -0
  74. package/src/components/bs5/icons/stories/storyFlexContainer.html +18 -0
  75. package/src/components/bs5/icons/stories/storyInlineWithText.html +18 -0
  76. package/src/components/bs5/icons/stories/storySizes.html +89 -0
  77. package/src/components/bs5/image/Image.mdx +1 -4
  78. package/src/components/bs5/inpageAlert/InpageAlert.mdx +1 -3
  79. package/src/components/bs5/inpagenav/Inpagenav.mdx +4 -5
  80. package/src/components/bs5/inpagenav/inpagenav.scss +7 -3
  81. package/src/components/bs5/link/link.mdx +1 -3
  82. package/src/components/bs5/link/link.scss +2 -15
  83. package/src/components/bs5/linkColumns/linkColumns.mdx +1 -3
  84. package/src/components/bs5/logo/Logo.mdx +1 -3
  85. package/src/components/bs5/navbar/navbar.data.json +91 -25
  86. package/src/components/bs5/navbar/navbar.functions.js +4 -0
  87. package/src/components/bs5/navbar/navbar.hbs +21 -14
  88. package/src/components/bs5/navbar/navbar.scss +219 -166
  89. package/src/components/bs5/navbar/navbar.stories.js +31 -2
  90. package/src/components/bs5/pageLayout/ThemeShowcase.stories.js +249 -0
  91. package/src/components/bs5/pageLayout/pageLayout.stories.js +3 -1
  92. package/src/components/bs5/pageLayout/templates/contentPageWithForm.hbs +1 -1
  93. package/src/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +140 -108
  94. package/src/components/bs5/pageLayout/templates/homePage.hbs +1 -1
  95. package/src/components/bs5/pagination/Pagination.mdx +4 -5
  96. package/src/components/bs5/pagination/pagination.data.json +19 -19
  97. package/src/components/bs5/pagination/pagination.scss +37 -63
  98. package/src/components/bs5/promotionalPanel/PromotionalPanel.mdx +1 -3
  99. package/src/components/bs5/promotionalPanel/promotionalPanel.scss +23 -22
  100. package/src/components/bs5/quickexit/quickexit.functions.js +24 -37
  101. package/src/components/bs5/quickexit/quickexit.hbs +1 -1
  102. package/src/components/bs5/quickexit/quickexit.scss +27 -10
  103. package/src/components/bs5/searchInput/SearchInput.mdx +5 -5
  104. package/src/components/bs5/sidenav/Sidenav.mdx +4 -5
  105. package/src/components/bs5/sidenav/sidenav.data.json +81 -80
  106. package/src/components/bs5/sidenav/sidenav.hbs +56 -37
  107. package/src/components/bs5/sidenav/sidenav.scss +236 -151
  108. package/src/components/bs5/skiplinks/SkipLinks.mdx +1 -3
  109. package/src/components/bs5/skiplinks/skipLinks.functions.js +0 -9
  110. package/src/components/bs5/skiplinks/skipLinks.test.js +0 -1
  111. package/src/components/bs5/table/Table.mdx +4 -5
  112. package/src/components/bs5/tabs/Tabs.mdx +4 -5
  113. package/src/components/bs5/tabs/tabs.scss +22 -1
  114. package/src/components/bs5/tag/Tag.mdx +4 -5
  115. package/src/components/bs5/typography/Typography.mdx +4 -5
  116. package/src/components/bs5/video/Video.mdx +4 -5
  117. package/src/components/common/layout/container.scss +5 -0
  118. package/src/components/common/layout/content.scss +16 -8
  119. package/src/css/functions/_index.scss +1 -0
  120. package/src/css/functions/in-list.scss +5 -0
  121. package/src/css/main.scss +4 -10
  122. package/src/css/mixins/_index.scss +3 -0
  123. package/src/css/mixins/make-icon.scss +87 -0
  124. package/src/css/qld-theme.scss +74 -31
  125. package/src/css/qld-type.scss +26 -140
  126. package/src/css/qld-utilities.scss +29 -14
  127. package/src/css/qld-variables.scss +4 -4
  128. package/src/css/utilities/_index.scss +1 -0
  129. package/src/css/utilities/sr-only.scss +5 -0
  130. package/src/css/variables/_index.scss +1 -0
  131. package/src/css/variables/type.scss +58 -0
  132. package/src/js/qld.bootstrap.js +1 -9
  133. package/src/stories/documentation/_storybookDocsTabs.jsx +63 -0
  134. package/src/stories/documentation/storybook-documentation.scss +51 -0
  135. package/src/components/bs5/icons/story-icon-sizing.html +0 -131
  136. package/src/components/bs5/icons/story-icon-usage.html +0 -89
  137. 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
- --dir-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M443.7 266.8l-165.9 176C274.5 446.3 269.1 448 265.5 448c-3.986 0-7.988-1.375-11.16-4.156c-6.773-5.938-7.275-16.06-1.118-22.59L393.9 272H16.59c-9.171 0-16.59-7.155-16.59-15.1S7.421 240 16.59 240h377.3l-140.7-149.3c-6.157-6.531-5.655-16.66 1.118-22.59c6.789-5.906 17.27-5.469 23.45 1.094l165.9 176C449.4 251.3 449.4 260.7 443.7 266.8z'/%3E%3C/svg%3E");
6
- --link-colour: var(--qld-light-action-primary);
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(--qld-focus-color);
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
- .icon {
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
- &.up {
59
- .icon {
60
- transform: rotate(270deg);
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(--qld-light-action-primary);
89
- --icon-colour: var(--qld-light-action-secondary);
90
- --icon-colour-hover: var(--qld-light-action-secondary-hover);
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(--qld-dark-text);
98
- --icon-colour: var(--qld-dark-action-secondary);
99
- --icon-colour-hover: var(--qld-dark-action-secondary-hover);
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
- ${new DirectionLinks({ ...args, class: "down", label: "Down" }).html}
28
-
24
+ ${new DirectionLinks({ ...args, class: "down", label: "Down" }).html}
29
25
  </div>
30
26
  <div class="col">
31
-
32
27
  <!-- Component HTML -->
33
- ${new DirectionLinks({ ...args, class: "left", label: "Left" }).html}
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
- ${new DirectionLinks({ ...args, class: "right", label: "Right" }).html}
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",
@@ -6,9 +6,7 @@ import defaultdata from "./footer.data.json";
6
6
 
7
7
  # Footer
8
8
 
9
- <Canvas>
10
- <Story of={FooterStories.Default} />
11
- </Canvas>
9
+ <Canvas of={FooterStories.Default} />
12
10
 
13
11
  ## Design resources
14
12
 
@@ -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
- <Canvas>
8
- <Story of={FormCheckCheckboxStories.Default} />
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
- <Canvas>
8
- <Story of={FormCheckRadioStories.Default} />
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)
@@ -6,9 +6,7 @@ import defaultdata from "./globalAlert.data.json";
6
6
 
7
7
  # Global alert
8
8
 
9
- <Canvas>
10
- <Story of={GlobalAlertStories.Critical} />
11
- </Canvas>
9
+ <Canvas of={GlobalAlertStories.Critical} />
12
10
 
13
11
  ## Design resources
14
12
 
@@ -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;
@@ -5,9 +5,7 @@ import * as HeaderStories from "./header.stories";
5
5
 
6
6
  # Header
7
7
 
8
- <Canvas>
9
- <Story of={HeaderStories.MasterBrand} />
10
- </Canvas>
8
+ <Canvas of={HeaderStories.MasterBrand} />
11
9
 
12
10
  ## Design resources
13
11
 
@@ -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="{{@root.assets.SVGSpritePath}}#qgds-icon-chevron-down"
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="{{@root.assets.SVGSpritePath}}#qgds-icon-arrow-right"
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="{{@root.assets.SVGSpritePath}}#qgds-icon-{{icon}}" aria-hidden="true"></use>
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
- href="{{@root.assets.SVGSpritePath}}#qgds-icon-search" aria-hidden="true"
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="{{@root.assets.SVGSpritePath}}#qgds-icon-menu" aria-hidden="true">
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
- color: var(--#{$prefix}header-color-text);
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, Title, Subtitle, Description, Heading, Source } from "@storybook/blocks";
2
- import * as IconsStories from "./icons.stories.js";
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={IconsStories} />
5
+ <Meta of={IconStories} />
5
6
 
6
- {/* Show Overview Story only - text returned by export default render function */}
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
 
@@ -0,0 +1,9 @@
1
+ // List of icon sizes
2
+ $icon-sizes: (
3
+ "xs": 1rem,
4
+ "sm": 1.25rem,
5
+ "md": 1.5rem,
6
+ "lg": 2rem,
7
+ "xl": 2.5rem,
8
+ "xxl": 3rem,
9
+ );