@qhealth-design-system/core 1.18.4 → 1.19.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/.storybook/assets/accordion-js.js +344 -0
- package/.storybook/assets/animate-js.js +247 -0
- package/.storybook/assets/index.js +15 -0
- package/.storybook/globals.js +39 -41
- package/.storybook/main.js +4 -3
- package/.storybook/preview.js +11 -13
- package/CHANGELOG.md +2 -0
- package/README.md +1 -1
- package/package.json +10 -15
- package/src/component-loader.js +23 -0
- package/src/components/_global/css/body/component.scss +3 -3
- package/src/components/_global/css/btn/component.scss +1 -1
- package/src/components/_global/css/cta_links/component.scss +2 -2
- package/src/components/_global/css/example/component.scss +11 -19
- package/src/components/_global/css/forms/control_inputs/component.scss +2 -2
- package/src/components/_global/css/forms/general/component.scss +5 -5
- package/src/components/_global/css/headings/component.scss +42 -44
- package/src/components/_global/css/img/images.scss +20 -36
- package/src/components/_global/css/link_columns/component.scss +2 -2
- package/src/components/_global/css/modal/component.scss +20 -26
- package/src/components/_global/css/table/component.scss +14 -21
- package/src/components/_global/css/tabs/component.scss +2 -2
- package/src/components/_global/css/tags/component.scss +1 -1
- package/src/components/_global/css/toggle_and_tool_tip/component.scss +3 -3
- package/src/components/_global/js/global.js +1 -1
- package/src/components/_global/js/select_boxes/global.js +26 -35
- package/src/components/accordion/css/component.scss +289 -326
- package/src/components/banner/css/component.scss +77 -173
- package/src/components/banner/html/component.hbs +2 -4
- package/src/components/banner_advanced/html/component.hbs +2 -2
- package/src/components/banner_advanced/js/manifest.json +1422 -1386
- package/src/components/basic_search/css/component.scss +13 -14
- package/src/components/basic_search/html/component.hbs +11 -20
- package/src/components/breadcrumbs/js/global.js +6 -1
- package/src/components/callout/css/component.scss +37 -40
- package/src/components/card_feature/css/component.scss +28 -167
- package/src/components/card_multi_action/css/component.scss +46 -58
- package/src/components/code/css/component.scss +3 -3
- package/src/components/code/html/component.hbs +12 -12
- package/src/components/code/js/global.js +6 -1
- package/src/components/file_upload/css/component.scss +5 -5
- package/src/components/file_upload/js/global.js +46 -43
- package/src/components/footer/css/component.scss +3 -3
- package/src/components/global_alert/css/component.scss +8 -14
- package/src/components/global_alert/html/component.hbs +3 -3
- package/src/components/header/css/component.scss +16 -4
- package/src/components/header/html/component.hbs +3 -2
- package/src/components/in_page_navigation/css/component.scss +14 -16
- package/src/components/in_page_navigation/js/global.js +48 -58
- package/src/components/internal_navigation/css/component.scss +3 -3
- package/src/components/internal_navigation/js/global.js +27 -35
- package/src/components/left_hand_navigation/css/component.scss +8 -2
- package/src/components/main_navigation/css/component.scss +16 -7
- package/src/components/main_navigation/html/component.hbs +1 -0
- package/src/components/mega_main_navigation/css/component.scss +5 -5
- package/src/components/mega_main_navigation/html/component.hbs +1 -0
- package/src/components/pagination/css/component.scss +32 -28
- package/src/components/pagination/html/component.hbs +37 -40
- package/src/components/promo_panel/css/component.scss +1 -4
- package/src/components/promo_panel/html/component.hbs +11 -5
- package/src/components/promo_panel/js/global.js +24 -39
- package/src/components/promo_panel/js/manifest.json +8 -0
- package/src/components/tab/css/component.scss +3 -3
- package/src/components/toggle_tip/css/component.scss +1 -1
- package/src/components/tool_tip/css/component.scss +1 -1
- package/src/components/video_player/js/global.js +16 -13
- package/src/data/current.json +33 -1
- package/src/helpers/global-helpers.js +56 -0
- package/src/html/component-in_page_navigation.html +2 -2
- package/src/index.js +4 -8
- package/src/stories/BackToTop/BackToTop.mdx +3 -21
- package/src/stories/CTALink/CTALink.mdx +1 -4
- package/src/stories/Checkboxes/Checkboxes.mdx +1 -4
- package/src/stories/DirectionLinks/DirectionLinks.mdx +1 -4
- package/src/stories/InPageAlert/InPageAlert.mdx +1 -4
- package/src/stories/Introduction.mdx +9 -5
- package/src/stories/LinkColumns/LinkColumns.mdx +1 -4
- package/src/stories/Pagination/Pagination.mdx +26 -0
- package/src/stories/Pagination/Pagination.stories.js +257 -0
- package/src/stories/PromoPanel/PromoPanel.mdx +26 -0
- package/src/stories/PromoPanel/PromoPanel.stories.js +219 -0
- package/src/stories/RadioButtons/RadioButtons.mdx +1 -4
- package/src/stories/SelectBox/SelectBox.mdx +1 -4
- package/src/stories/Tags/Tags.js +3 -3
- package/src/stories/Tags/Tags.mdx +1 -4
- package/src/stories/VideoPlayer/VideoPlayer.mdx +3 -28
- package/src/stories/VideoPlayer/VideoPlayer.stories.js +19 -46
- package/src/styles/imports/utilities.scss +3 -3
- package/src/styles/imports/variables.scss +5 -0
- package/src/stories/VideoPlayer/VideoPlayer.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
2
|
-
//
|
|
2
|
+
// File Upload
|
|
3
3
|
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
4
4
|
|
|
5
5
|
.qld__form-file-wrapper {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
p {
|
|
18
|
-
font-weight:
|
|
18
|
+
font-weight: $QLD-font-weight-semibold;
|
|
19
19
|
font-size: pxToRem(14);
|
|
20
20
|
line-height: pxToRem(16);
|
|
21
21
|
max-width: none;
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
p.qld__file-input-title {
|
|
33
33
|
color: var(--QLD-color-light__heading);
|
|
34
|
-
font-weight:
|
|
34
|
+
font-weight: $QLD-font-weight-semibold;
|
|
35
35
|
font-size: pxToRem(20);
|
|
36
36
|
line-height: pxToRem(24);
|
|
37
37
|
margin: 0 auto pxToRem(24);
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
.qld__file-input-label {
|
|
74
|
-
font-weight:
|
|
74
|
+
font-weight: $QLD-font-weight-regular;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
.qld__form-file-dropzone {
|
|
@@ -426,7 +426,7 @@
|
|
|
426
426
|
align-content: center;
|
|
427
427
|
color: var(--QLD-color-light__text--lighter);
|
|
428
428
|
display: flex;
|
|
429
|
-
font-weight:
|
|
429
|
+
font-weight: $QLD-font-weight-regular;
|
|
430
430
|
font-size: pxToRem(14);
|
|
431
431
|
line-height: pxToRem(20);
|
|
432
432
|
|
|
@@ -19,16 +19,17 @@
|
|
|
19
19
|
|
|
20
20
|
fileTemplate.classList.add("qld__form-file");
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
// TODO: Do not build html elements using innerHTML, build properly to prevent XSS
|
|
23
|
+
// fileTemplate.innerHTML = `<div class="qld__form-file-info-wrapper"><div class="qld__form-file-loader">
|
|
24
|
+
// <div class="qld__loading_spinner qld__loading_spinner--landscape" role="status">
|
|
25
|
+
// <span class="qld__loading_spinner-wheel"></span>
|
|
26
|
+
// </div>
|
|
27
|
+
// </div>
|
|
28
|
+
// <div class="qld__form-file-info">
|
|
29
|
+
// <p class="qld__display-xs qld__form-file-info-name">${fileName}</p>
|
|
30
|
+
// <span class="qld__form-file-info-status">Uploading...</span>
|
|
31
|
+
// </div></div>
|
|
32
|
+
// <div class="qld__form-file-actions"></div>`;
|
|
32
33
|
return fileTemplate;
|
|
33
34
|
};
|
|
34
35
|
|
|
@@ -50,22 +51,23 @@
|
|
|
50
51
|
|
|
51
52
|
fileTemplate.classList.add("qld__form-file", "qld__form-file--success");
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
54
|
+
// TODO: Do not build html elements using innerHTML, build properly to prevent XSS
|
|
55
|
+
// fileTemplate.innerHTML = `<div class="qld__form-file-info-wrapper"><div class="qld__form-file-loader">
|
|
56
|
+
// <svg class="qld__icon qld__icon--lg" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="${fileUploads.iconDataPath}#${fileType !== "" ? fileType.iconClass : ""}"></use></svg>
|
|
57
|
+
// </div>
|
|
58
|
+
// <div class="qld__form-file-info">
|
|
59
|
+
// <p class="qld__display-xs qld__form-file-info-name">${fileName}</p>
|
|
60
|
+
// <span class="qld__form-file-info-status">
|
|
61
|
+
// <svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="${fileUploads.iconDataPath}#status-success"></use></svg>
|
|
62
|
+
// Upload successful${fileSize !== null ? `, ${fileSize}KB` : ""}
|
|
63
|
+
// </span>
|
|
64
|
+
// </div></div>
|
|
65
|
+
// <div class="qld__form-file-actions">
|
|
66
|
+
// <button class="qld__btn qld__btn--tertiary qld__btn--icon-lead qld__form-file-delete-btn" data-file-id="${fileId}">
|
|
67
|
+
// <svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="${fileUploads.iconDataPath}#delete"></use></svg>
|
|
68
|
+
// <span class="qld__form-file-delete-btn-remove">Remove</span>
|
|
69
|
+
// </button>
|
|
70
|
+
// </div>`;
|
|
69
71
|
|
|
70
72
|
return fileTemplate;
|
|
71
73
|
};
|
|
@@ -82,22 +84,23 @@
|
|
|
82
84
|
console.log("error:", file.name);
|
|
83
85
|
fileTemplate.classList.add("qld__form-file", "qld__form-file--error");
|
|
84
86
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
87
|
+
// TODO: Do not build html elements using innerHTML, build properly to prevent XSS
|
|
88
|
+
// fileTemplate.innerHTML = `<div class="qld__form-file-info-wrapper"><div class="qld__form-file-loader">
|
|
89
|
+
// <svg class="qld__icon qld__icon--lg" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="${fileUploads.iconDataPath}#document-error"></use></svg>
|
|
90
|
+
// </div>
|
|
91
|
+
// <div class="qld__form-file-info">
|
|
92
|
+
// <p class="qld__display-xs qld__form-file-info-name">${fileName}</p>
|
|
93
|
+
// <span class="qld__form-file-info-status">
|
|
94
|
+
// <svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="${fileUploads.iconDataPath}#status-error"></use></svg>
|
|
95
|
+
// ${error}
|
|
96
|
+
// </span>
|
|
97
|
+
// </div></div>
|
|
98
|
+
// <div class="qld__form-file-actions">
|
|
99
|
+
// <button class="qld__btn qld__btn--tertiary qld__btn--icon-lead qld__form-file-delete-btn" data-file-id="${fileId}">
|
|
100
|
+
// <svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="${fileUploads.iconDataPath}#delete"></use></svg>
|
|
101
|
+
// <span class="qld__form-file-delete-btn-remove">Remove</span>
|
|
102
|
+
// </button>
|
|
103
|
+
// </div>`;
|
|
101
104
|
|
|
102
105
|
return fileTemplate;
|
|
103
106
|
};
|
|
@@ -269,7 +272,7 @@
|
|
|
269
272
|
return value.trim() !== "";
|
|
270
273
|
}
|
|
271
274
|
},
|
|
272
|
-
"This field is required."
|
|
275
|
+
"This field is required.",
|
|
273
276
|
);
|
|
274
277
|
}
|
|
275
278
|
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
// double & & to increase specificity because of clash
|
|
64
64
|
color: var(--QLD-color-light__heading);
|
|
65
65
|
@include QLD-fontgrid(sm, heading);
|
|
66
|
-
font-weight:
|
|
66
|
+
font-weight: $QLD-font-weight-semibold;
|
|
67
67
|
|
|
68
68
|
@include QLD-media(md) {
|
|
69
69
|
@include QLD-fontgrid(md, heading);
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
display: inline-block;
|
|
220
220
|
font-size: 0.875rem;
|
|
221
221
|
line-height: 1.4;
|
|
222
|
-
font-weight:
|
|
222
|
+
font-weight: $QLD-font-weight-regular;
|
|
223
223
|
|
|
224
224
|
&:hover {
|
|
225
225
|
svg {
|
|
@@ -429,7 +429,7 @@
|
|
|
429
429
|
|
|
430
430
|
a.qld__footer__copyright-link {
|
|
431
431
|
display: block;
|
|
432
|
-
font-weight:
|
|
432
|
+
font-weight: $QLD-font-weight-semibold;
|
|
433
433
|
@include QLD-space(margin-top, 1.25unit);
|
|
434
434
|
|
|
435
435
|
@include QLD-media(md) {
|
|
@@ -60,10 +60,6 @@
|
|
|
60
60
|
.qld__icon,
|
|
61
61
|
.qld__icon:hover {
|
|
62
62
|
color: $QLD-color-neutral--white;
|
|
63
|
-
|
|
64
|
-
@media (prefers-contrast: more) {
|
|
65
|
-
color: revert;
|
|
66
|
-
}
|
|
67
63
|
}
|
|
68
64
|
}
|
|
69
65
|
|
|
@@ -100,10 +96,6 @@
|
|
|
100
96
|
.qld__icon,
|
|
101
97
|
.qld__icon:hover {
|
|
102
98
|
color: $QLD-color-neutral--darkest;
|
|
103
|
-
|
|
104
|
-
@media (prefers-contrast: more) {
|
|
105
|
-
color: revert;
|
|
106
|
-
}
|
|
107
99
|
}
|
|
108
100
|
}
|
|
109
101
|
|
|
@@ -143,10 +135,13 @@
|
|
|
143
135
|
.qld__icon,
|
|
144
136
|
.qld__icon:hover {
|
|
145
137
|
color: $QLD-color-neutral--darkest;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
146
140
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
141
|
+
// Situation where vertical navigation is enabled
|
|
142
|
+
&.qld__global-alert-with-vertical-nav {
|
|
143
|
+
div.container-fluid {
|
|
144
|
+
max-width: 100%;
|
|
150
145
|
}
|
|
151
146
|
}
|
|
152
147
|
|
|
@@ -170,7 +165,7 @@
|
|
|
170
165
|
|
|
171
166
|
.qld__global-alert__message {
|
|
172
167
|
strong {
|
|
173
|
-
font-weight:
|
|
168
|
+
font-weight: $QLD-font-weight-semibold;
|
|
174
169
|
}
|
|
175
170
|
}
|
|
176
171
|
|
|
@@ -187,7 +182,7 @@
|
|
|
187
182
|
|
|
188
183
|
.qld__global-alert__action {
|
|
189
184
|
flex-shrink: 0;
|
|
190
|
-
font-weight:
|
|
185
|
+
font-weight: $QLD-font-weight-semibold;
|
|
191
186
|
margin-top: 0.75rem;
|
|
192
187
|
&:first-child {
|
|
193
188
|
margin: 0;
|
|
@@ -226,7 +221,6 @@
|
|
|
226
221
|
position: relative;
|
|
227
222
|
line-height: 1;
|
|
228
223
|
display: flex;
|
|
229
|
-
// align-items: center;
|
|
230
224
|
text-align: center;
|
|
231
225
|
justify-content: center;
|
|
232
226
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div
|
|
3
3
|
role="region"
|
|
4
4
|
aria-label="{{#ifCond site.metadata.alertLevel.value '==' 'default'}}Warning{{/ifCond}}{{#ifCond site.metadata.alertLevel.value '==' 'critical'}}Alert{{/ifCond}}{{#ifCond site.metadata.alertLevel.value '==' 'general'}}Information{{/ifCond}}"
|
|
5
|
-
class="qld__global-alert qld__global-alert--{{site.metadata.alertLevel.value}}">
|
|
5
|
+
class="qld__global-alert qld__global-alert--{{site.metadata.alertLevel.value}}{{#ifCond @root.site.metadata.mainNavVerticalNav.value '==' 'vertical-nav'}} qld__global-alert-with-vertical-nav{{/ifCond}}">
|
|
6
6
|
|
|
7
7
|
<div class="container-fluid">
|
|
8
8
|
<div class="qld__global-alert__main">
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
<div
|
|
49
49
|
role="region"
|
|
50
50
|
aria-label="{{#ifCond site.metadata.secondAlertLevel.value '==' 'default'}}Warning{{/ifCond}}{{#ifCond site.metadata.secondAlertLevel.value '==' 'critical'}}Alert{{/ifCond}}{{#ifCond site.metadata.secondAlertLevel.value '==' 'general'}}Information{{/ifCond}}"
|
|
51
|
-
class="qld__global-alert qld__global-alert--{{site.metadata.secondAlertLevel.value}}">
|
|
51
|
+
class="qld__global-alert qld__global-alert--{{site.metadata.secondAlertLevel.value}}{{#ifCond @root.site.metadata.mainNavVerticalNav.value '==' 'vertical-nav'}} qld__global-alert-with-vertical-nav{{/ifCond}}">
|
|
52
52
|
<div class="container-fluid">
|
|
53
53
|
<div class="qld__global-alert__main">
|
|
54
54
|
<div class="qld__global-alert__icon">
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
<div
|
|
94
94
|
role="region"
|
|
95
95
|
aria-label="{{#ifCond site.metadata.thirdAlertLevel.value '==' 'default'}}Warning{{/ifCond}}{{#ifCond site.metadata.thirdAlertLevel.value '==' 'critical'}}Alert{{/ifCond}}{{#ifCond site.metadata.thirdAlertLevel.value '==' 'general'}}Information{{/ifCond}}"
|
|
96
|
-
class="qld__global-alert qld__global-alert--{{site.metadata.thirdAlertLevel.value}}">
|
|
96
|
+
class="qld__global-alert qld__global-alert--{{site.metadata.thirdAlertLevel.value}}{{#ifCond @root.site.metadata.mainNavVerticalNav.value '==' 'vertical-nav'}} qld__global-alert-with-vertical-nav{{/ifCond}}">
|
|
97
97
|
<div class="container-fluid">
|
|
98
98
|
<div class="qld__global-alert__main">
|
|
99
99
|
<div class="qld__global-alert__icon">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
//
|
|
3
|
-
|
|
1
|
+
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
2
|
+
// Header
|
|
3
|
+
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
4
4
|
|
|
5
5
|
.qld__header {
|
|
6
6
|
@include QLD-fontgrid(sm);
|
|
@@ -43,6 +43,18 @@
|
|
|
43
43
|
z-index: 600;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
+
|
|
47
|
+
&__link-mobile {
|
|
48
|
+
@include QLD-media(md) {
|
|
49
|
+
display: none;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&__link-desktop {
|
|
54
|
+
@include QLD-media(md, "down") {
|
|
55
|
+
display: none;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
46
58
|
}
|
|
47
59
|
|
|
48
60
|
/**
|
|
@@ -395,7 +407,7 @@
|
|
|
395
407
|
@include QLD-fontgrid(sm, heading);
|
|
396
408
|
font-family: $QLD-font-sitename;
|
|
397
409
|
color: var(--QLD-color-light__site-title);
|
|
398
|
-
font-weight:
|
|
410
|
+
font-weight: $QLD-font-weight-bold;
|
|
399
411
|
margin: 0;
|
|
400
412
|
padding: 0;
|
|
401
413
|
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
<header class="qld__header" role="banner">
|
|
7
7
|
<nav class="qld__skip-link" aria-label="skip links" tabindex="-1">
|
|
8
8
|
<a class="qld__skip-link__link" href="#content">Skip to main content</a>
|
|
9
|
-
<a class="qld__skip-link__link" href="#main-nav">Skip to main navigation</a>
|
|
9
|
+
<a class="qld__skip-link__link qld__skip-link__link-desktop" href="#main-nav">Skip to main navigation</a>
|
|
10
|
+
<a class="qld__skip-link__link qld__skip-link__link-mobile" href="#main-nav-mobile">Skip to main navigation</a>
|
|
10
11
|
</nav>
|
|
11
12
|
<div class="qld__header__pre-header {{site.metadata.sitePreHeaderTheme.value}}">
|
|
12
13
|
<div class="container-fluid">
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
<span class="qld__main-nav__toggle-text">Search</span>
|
|
56
57
|
</button>
|
|
57
58
|
{{/if}}
|
|
58
|
-
<button aria-controls="main-nav" class="qld__header__toggle-main-nav qld__main-nav__toggle--open">
|
|
59
|
+
<button id="main-nav-mobile" aria-controls="main-nav" class="qld__header__toggle-main-nav qld__main-nav__toggle--open">
|
|
59
60
|
<svg class="qld__icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#menu"></use></svg>
|
|
60
61
|
<span class="qld__main-nav__toggle-text">Menu</span>
|
|
61
62
|
</button>
|
|
@@ -7,46 +7,44 @@
|
|
|
7
7
|
@include QLD-space(padding-left, 1.5unit);
|
|
8
8
|
border-left: $QLD-border-width-thick solid var(--QLD-color-light__link);
|
|
9
9
|
|
|
10
|
-
& &__heading{
|
|
10
|
+
& &__heading {
|
|
11
11
|
@include QLD-fontgrid(sm, heading);
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
* + & {
|
|
15
15
|
@include QLD-space(margin-top, 2.3125unit);
|
|
16
16
|
}
|
|
17
|
-
a{
|
|
18
|
-
@include QLD-underline(
|
|
17
|
+
a {
|
|
18
|
+
@include QLD-underline("light", "underline", "default", "noVisited");
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
.qld__body & > ul,
|
|
22
22
|
.qld__body & > ol {
|
|
23
23
|
@include QLD-space(margin-top, 0.75unit);
|
|
24
24
|
list-style-type: none;
|
|
25
25
|
padding: 0;
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
li {
|
|
28
28
|
margin: 0;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
* + li {
|
|
32
32
|
margin-left: 0;
|
|
33
33
|
}
|
|
34
|
-
li + li{
|
|
34
|
+
li + li {
|
|
35
35
|
@include QLD-space(margin-top, 0.5unit);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
.qld__body--dark &,
|
|
40
|
-
.qld__body--dark-alt &{
|
|
40
|
+
.qld__body--dark-alt & {
|
|
41
41
|
border-color: var(--QLD-color-dark__action--primary);
|
|
42
|
-
a{
|
|
43
|
-
@include QLD-underline(
|
|
42
|
+
a {
|
|
43
|
+
@include QLD-underline("dark", "underline", "default", "noVisited");
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
|
|
50
48
|
.qld__inpage-nav-section {
|
|
51
49
|
position: relative;
|
|
52
50
|
@include QLD-space(padding-right, 8unit);
|
|
@@ -57,7 +55,7 @@
|
|
|
57
55
|
@include QLD-space(top, 0.25unit);
|
|
58
56
|
position: absolute;
|
|
59
57
|
right: 0;
|
|
60
|
-
font-weight:
|
|
58
|
+
font-weight: $QLD-font-weight-regular;
|
|
61
59
|
}
|
|
62
60
|
|
|
63
61
|
// Print styles
|
|
@@ -65,4 +63,4 @@
|
|
|
65
63
|
.qld__inpage-nav-links {
|
|
66
64
|
display: none !important;
|
|
67
65
|
}
|
|
68
|
-
}
|
|
66
|
+
}
|
|
@@ -1,60 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import { normaliseIdentifier } from "../../../helpers/global-helpers.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @module inPageNavigation
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export default function initInPageNavigation(document = document) {
|
|
8
|
+
const navs = document.querySelectorAll(".qld__inpage-nav-links");
|
|
9
|
+
const mainEl = document.querySelector("main.main");
|
|
10
|
+
const isLandingPage = mainEl && mainEl.classList.contains("landing");
|
|
11
|
+
|
|
12
|
+
// For all In-Page Nav components
|
|
13
|
+
navs.forEach((nav) => {
|
|
14
|
+
const headingSelector = nav.getAttribute("data-headingType") ? nav.getAttribute("data-headingType") : "h2";
|
|
15
|
+
const pageContent = isLandingPage ? mainEl : document.getElementById("content");
|
|
16
|
+
// Exclude Code CT, and accordion h3, h4, h5, h6
|
|
17
|
+
const headings = pageContent.querySelectorAll(
|
|
18
|
+
headingSelector + ":not(.qld__inpage-nav-links__heading):not(.banner__heading):not(.qld__code *):not(.qld__accordion h3):not(.qld__accordion h4):not(.qld__accordion h5):not(.qld__accordion h6)",
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
// Get list element and clear existing children
|
|
22
|
+
const list = nav.querySelector(".qld__link-list");
|
|
23
|
+
list.replaceChildren();
|
|
24
|
+
|
|
25
|
+
if (headings.length === 0) {
|
|
26
|
+
nav.style.display = "none";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// For all headings (with matching data-headingType) in page content
|
|
30
|
+
headings.forEach((heading) => {
|
|
31
|
+
const title = heading.innerText;
|
|
32
|
+
// Create sanitized ID from heading text
|
|
33
|
+
const id = "section__" + normaliseIdentifier(title.toLowerCase());
|
|
34
|
+
heading.setAttribute("id", id);
|
|
35
|
+
heading.setAttribute("tabindex", -1);
|
|
36
|
+
|
|
37
|
+
// Create link and anchor items to be added to the list
|
|
38
|
+
const link = document.createElement("li");
|
|
39
|
+
const anchor = document.createElement("a");
|
|
40
|
+
anchor.setAttribute("href", `#${id}`);
|
|
41
|
+
anchor.textContent = title;
|
|
42
|
+
link.appendChild(anchor);
|
|
43
|
+
|
|
44
|
+
// Append link item if it doesn't already exist in the list
|
|
45
|
+
if (list.querySelector(`a[href="#${id}"]`) === null) {
|
|
46
|
+
list.appendChild(link);
|
|
32
47
|
}
|
|
33
|
-
|
|
34
|
-
// For all headings (with matching data-headingType) in page content
|
|
35
|
-
headings.forEach(function (heading) {
|
|
36
|
-
var title = heading.innerText;
|
|
37
|
-
var id = "section__" + title.toLowerCase().replace(/\s+/g, "-");
|
|
38
|
-
heading.setAttribute("id", id);
|
|
39
|
-
heading.setAttribute("tabindex", -1);
|
|
40
|
-
|
|
41
|
-
// Create link and anchor items to be added to the list
|
|
42
|
-
var link = document.createElement("li");
|
|
43
|
-
var anchor = document.createElement("a");
|
|
44
|
-
anchor.setAttribute("href", `#${id}`);
|
|
45
|
-
anchor.textContent = title;
|
|
46
|
-
link.appendChild(anchor);
|
|
47
|
-
|
|
48
|
-
// Append link item if it doesn't already exist in the list
|
|
49
|
-
if (list.querySelector(`a[href="#${id}"]`) === null) {
|
|
50
|
-
list.appendChild(link);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
48
|
});
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
QLD.inPageNav = inPageNav;
|
|
57
|
-
|
|
58
|
-
// Init In Page Nav on document load
|
|
59
|
-
document.addEventListener("DOMContentLoaded", QLD.inPageNav.init);
|
|
60
|
-
})();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
@@ -147,7 +147,7 @@ $QLD-side-nav-breakpoint: lg !default;
|
|
|
147
147
|
.qld__accordion__title {
|
|
148
148
|
@include QLD-fontgrid(md, heading);
|
|
149
149
|
color: var(--QLD-color-light__link);
|
|
150
|
-
font-weight:
|
|
150
|
+
font-weight: $QLD-font-weight-regular;
|
|
151
151
|
background-color: inherit;
|
|
152
152
|
|
|
153
153
|
&.qld__side-nav__toggle {
|
|
@@ -227,7 +227,7 @@ $QLD-side-nav-breakpoint: lg !default;
|
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
.active > span {
|
|
230
|
-
font-weight:
|
|
230
|
+
font-weight: $QLD-font-weight-semibold;
|
|
231
231
|
color: var(--QLD-color-light__heading);
|
|
232
232
|
}
|
|
233
233
|
|
|
@@ -253,7 +253,7 @@ $QLD-side-nav-breakpoint: lg !default;
|
|
|
253
253
|
@include QLD-underline("light", "noUnderline", "default", "noVisited");
|
|
254
254
|
|
|
255
255
|
@include QLD-media(md) {
|
|
256
|
-
font-weight:
|
|
256
|
+
font-weight: $QLD-font-weight-semibold;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
259
|
&:hover,
|
|
@@ -1,46 +1,38 @@
|
|
|
1
|
+
import { validateInternalSvgPath, buildIconPath } from "../../../helpers/global-helpers.js";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
|
-
* The internal navigation module
|
|
3
|
-
*
|
|
4
4
|
* @module internalNavigation
|
|
5
5
|
*/
|
|
6
|
-
(function () {
|
|
7
|
-
"use strict";
|
|
8
|
-
|
|
9
|
-
let internalNavigation = {};
|
|
10
|
-
window.addEventListener("DOMContentLoaded", function () {
|
|
11
|
-
const svgSelector = document.querySelector(".qld__side-nav.qld__accordion");
|
|
12
6
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const thirdLevelLinks = document.querySelectorAll("ul ul ul a, ul ul ul span");
|
|
7
|
+
export default function initInternalNavigation(document = document) {
|
|
8
|
+
const svgSelector = document.querySelector(".qld__side-nav.qld__accordion");
|
|
16
9
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
// Create <svg>
|
|
21
|
-
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
22
|
-
svg.setAttribute("class", "qld__icon");
|
|
23
|
-
svg.setAttribute("aria-hidden", "true");
|
|
24
|
-
svg.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
10
|
+
if (svgSelector) {
|
|
11
|
+
const svgPath = svgSelector.getAttribute("data-path");
|
|
12
|
+
const thirdLevelLinks = document.querySelectorAll("ul ul ul a, ul ul ul span");
|
|
25
13
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
14
|
+
// Loop through each matching element and apply the style
|
|
15
|
+
thirdLevelLinks.forEach((link) => {
|
|
16
|
+
if (!link.querySelector("svg")) {
|
|
17
|
+
// Create <svg>
|
|
18
|
+
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
19
|
+
svg.setAttribute("class", "qld__icon");
|
|
20
|
+
svg.setAttribute("aria-hidden", "true");
|
|
21
|
+
svg.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
29
22
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
// Create <use>
|
|
24
|
+
const use = document.createElementNS("http://www.w3.org/2000/svg", "use");
|
|
25
|
+
// Attempt to validate SVG path before using it
|
|
26
|
+
if (validateInternalSvgPath(svgPath)) {
|
|
27
|
+
use.setAttributeNS(null, "href", buildIconPath(svgPath, "tick").toString());
|
|
33
28
|
}
|
|
34
|
-
link.parentElement.style.borderTopColor = "transparent";
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
29
|
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
// Append <use> to <svg>
|
|
31
|
+
svg.appendChild(use);
|
|
32
|
+
link.insertBefore(svg, link.firstChild);
|
|
33
|
+
}
|
|
41
34
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
QLD.internalNavigation.init();
|
|
35
|
+
link.parentElement.style.borderTopColor = "transparent";
|
|
36
|
+
});
|
|
45
37
|
}
|
|
46
|
-
}
|
|
38
|
+
}
|