@qhealth-design-system/core 1.16.5 → 1.17.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/storybook.css +1 -1
- package/.storybook/globals.js +10 -0
- package/CHANGELOG.md +2 -0
- package/package.json +1 -1
- package/src/components/_global/css/cta_links/component.scss +107 -14
- package/src/components/_global/css/forms/control_inputs/component.scss +65 -77
- package/src/components/_global/css/link_columns/component.scss +2 -2
- package/src/components/_global/html/scripts.html +0 -2
- package/src/components/_global/js/cta_links/global.js +33 -0
- package/src/components/_global/js/global.js +175 -138
- package/src/components/_global/js/tabs/global.js +6 -2
- package/src/components/banner_advanced/html/component.hbs +1 -1
- package/src/components/breadcrumbs/js/global.js +17 -4
- package/src/components/card_feature/html/component.hbs +1 -1
- package/src/components/card_multi_action/html/component.hbs +1 -1
- package/src/components/card_single_action/css/component.scss +38 -47
- package/src/components/card_single_action/html/component.hbs +1 -1
- package/src/components/code/css/component.scss +72 -73
- package/src/components/code/html/component.hbs +62 -19
- package/src/components/code/js/global.js +102 -86
- package/src/components/footer/css/component.scss +2 -4
- package/src/components/footer/html/component.hbs +11 -8
- package/src/components/header/css/component.scss +11 -11
- package/src/components/header/html/component.hbs +3 -3
- package/src/components/header/js/global.js +58 -65
- package/src/components/in_page_navigation/js/global.js +34 -31
- package/src/components/internal_navigation/js/global.js +13 -3
- package/src/components/main_navigation/css/component.scss +79 -13
- package/src/components/main_navigation/html/component.hbs +5 -5
- package/src/components/main_navigation/js/global.js +94 -115
- package/src/components/mega_main_navigation/css/component.scss +27 -14
- package/src/components/mega_main_navigation/html/component.hbs +5 -5
- package/src/components/mega_main_navigation/js/global.js +50 -55
- package/src/components/page_alert/css/component.scss +141 -179
- package/src/data/site.json +3 -3
- package/src/html/component-card_feature.html +74 -487
- package/src/html/component-card_single_action.html +219 -1175
- package/src/html/component-forms.html +202 -67
- package/src/stories/Checkboxes/Checkboxes.js +41 -0
- package/src/stories/Checkboxes/Checkboxes.mdx +45 -0
- package/src/stories/Checkboxes/Checkboxes.stories.js +209 -0
- package/src/stories/RadioButtons/RadioButtons.js +41 -0
- package/src/stories/RadioButtons/RadioButtons.mdx +45 -0
- package/src/stories/RadioButtons/RadioButtons.stories.js +209 -0
- package/src/styles/imports/mixins.scss +5 -43
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
{{#with component.data.metadata}}
|
|
3
3
|
{{#if code.value}}
|
|
4
|
-
<section class="qld__body">
|
|
4
|
+
<section class="qld__body" data-path="{{@root.site.metadata.coreSiteIcons.value}}">
|
|
5
5
|
<div class="container-fluid">
|
|
6
6
|
{{#ifCond code_snippet_type.value '==' 'singleline'}}
|
|
7
7
|
{{#ifCond show_code.value '==' 'true'}}
|
|
@@ -16,10 +16,12 @@
|
|
|
16
16
|
<code class="qld__code-body">{{code.value}}</code>
|
|
17
17
|
<button class="qld__btn qld__code-copy--button" type="button">
|
|
18
18
|
<div class="clean">
|
|
19
|
-
<
|
|
19
|
+
<svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#copy"></use></svg>
|
|
20
|
+
<span class="qld__code-copy--button-text">Copy</span>
|
|
20
21
|
</div>
|
|
21
22
|
<div class="dirty">
|
|
22
|
-
<
|
|
23
|
+
<svg class="qld__icon qld__icon--md" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#status-success"></use></svg>
|
|
24
|
+
<span class="qld__code-copy--button-text">Copied</span>
|
|
23
25
|
</div>
|
|
24
26
|
<div class="qld__code-tooltip">
|
|
25
27
|
<span class="clean">Copy</span>
|
|
@@ -77,7 +79,10 @@
|
|
|
77
79
|
{{#ifCond show_code.value '==' 'true'}}
|
|
78
80
|
{{#ifCond show_more_button.value '==' 'true'}}
|
|
79
81
|
<div class="qld__code-toggle">
|
|
80
|
-
<button class="qld__code-toggle-button" type="button">
|
|
82
|
+
<button class="qld__code-toggle-button" type="button">
|
|
83
|
+
Show more
|
|
84
|
+
<svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#chevron-up"></use></svg>
|
|
85
|
+
</button>
|
|
81
86
|
</div>
|
|
82
87
|
{{/ifCond}}
|
|
83
88
|
{{/ifCond}}
|
|
@@ -86,13 +91,22 @@
|
|
|
86
91
|
<div class="qld__code-header">
|
|
87
92
|
<div class="qld__code-header-left">
|
|
88
93
|
{{#if github_link.value}}
|
|
89
|
-
<a href="{{github_link.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit Github, opens in new tab">
|
|
94
|
+
<a href="{{github_link.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit Github, opens in new tab">
|
|
95
|
+
<span>Github</span>
|
|
96
|
+
<svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#external-link"></use></svg>
|
|
97
|
+
</a>
|
|
90
98
|
{{/if}}
|
|
91
99
|
{{#if figma_link.value}}
|
|
92
|
-
<a href="{{figma_link.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit Figma, opens in new tab">
|
|
100
|
+
<a href="{{figma_link.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit Figma, opens in new tab">
|
|
101
|
+
<span>Figma</span>
|
|
102
|
+
<svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#external-link"></use></svg>
|
|
103
|
+
</a>
|
|
93
104
|
{{/if}}
|
|
94
105
|
{{#if action_link_title.value}}
|
|
95
|
-
<a href="{{action_link_address.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit {{action_link_title.value}}, opens in new tab">
|
|
106
|
+
<a href="{{action_link_address.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit {{action_link_title.value}}, opens in new tab">
|
|
107
|
+
<span>{{action_link_title.value}}</span>
|
|
108
|
+
<svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#external-link"></use></svg>
|
|
109
|
+
</a>
|
|
96
110
|
{{/if}}
|
|
97
111
|
</div>
|
|
98
112
|
</div>
|
|
@@ -100,27 +114,45 @@
|
|
|
100
114
|
<div class="qld__code-header">
|
|
101
115
|
<div class="qld__code-header-left">
|
|
102
116
|
{{#if github_link.value}}
|
|
103
|
-
<a href="{{github_link.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit Github, opens in new tab">
|
|
117
|
+
<a href="{{github_link.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit Github, opens in new tab">
|
|
118
|
+
<span>Github</span>
|
|
119
|
+
<svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#external-link"></use></svg>
|
|
120
|
+
</a>
|
|
104
121
|
{{/if}}
|
|
105
122
|
{{#if figma_link.value}}
|
|
106
|
-
<a href="{{figma_link.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit Figma, opens in new tab">
|
|
123
|
+
<a href="{{figma_link.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit Figma, opens in new tab">
|
|
124
|
+
<span>Figma</span>
|
|
125
|
+
<svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#external-link"></use></svg>
|
|
126
|
+
</a>
|
|
107
127
|
{{/if}}
|
|
108
128
|
{{#if action_link_title.value}}
|
|
109
|
-
<a href="{{action_link_address.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit {{action_link_title.value}}, opens in new tab">
|
|
129
|
+
<a href="{{action_link_address.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit {{action_link_title.value}}, opens in new tab">
|
|
130
|
+
<span>{{action_link_title.value}}</span>
|
|
131
|
+
<svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#external-link"></use></svg>
|
|
132
|
+
</a>
|
|
110
133
|
{{/if}}
|
|
111
134
|
</div>
|
|
112
135
|
</div>
|
|
113
|
-
{{else if
|
|
136
|
+
{{else if action_link_title.value}}
|
|
114
137
|
<div class="qld__code-header">
|
|
115
138
|
<div class="qld__code-header-left">
|
|
116
139
|
{{#if github_link.value}}
|
|
117
|
-
<a href="{{github_link.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit Github, opens in new tab">
|
|
140
|
+
<a href="{{github_link.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit Github, opens in new tab">
|
|
141
|
+
<span>Github</span>
|
|
142
|
+
<svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#external-link"></use></svg>
|
|
143
|
+
</a>
|
|
118
144
|
{{/if}}
|
|
119
145
|
{{#if figma_link.value}}
|
|
120
|
-
<a href="{{figma_link.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit Figma, opens in new tab">
|
|
146
|
+
<a href="{{figma_link.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit Figma, opens in new tab">
|
|
147
|
+
<span>Figma</span>
|
|
148
|
+
<svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#external-link"></use></svg>
|
|
149
|
+
</a>
|
|
121
150
|
{{/if}}
|
|
122
151
|
{{#if action_link_title.value}}
|
|
123
|
-
<a href="{{action_link_address.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit {{action_link_title.value}}, opens in new tab">
|
|
152
|
+
<a href="{{action_link_address.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit {{action_link_title.value}}, opens in new tab">
|
|
153
|
+
<span>{{action_link_title.value}}</span>
|
|
154
|
+
<svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#external-link"></use></svg>
|
|
155
|
+
</a>
|
|
124
156
|
{{/if}}
|
|
125
157
|
</div>
|
|
126
158
|
</div>
|
|
@@ -129,23 +161,34 @@
|
|
|
129
161
|
<div class="qld__code-header">
|
|
130
162
|
<div class="qld__code-header-left">
|
|
131
163
|
{{#if github_link.value}}
|
|
132
|
-
<a href="{{github_link.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit Github, opens in new tab">
|
|
164
|
+
<a href="{{github_link.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit Github, opens in new tab">
|
|
165
|
+
<span>Github</span>
|
|
166
|
+
<svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#external-link"></use></svg>
|
|
167
|
+
</a>
|
|
133
168
|
{{/if}}
|
|
134
169
|
{{#if figma_link.value}}
|
|
135
|
-
<a href="{{figma_link.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit Figma, opens in new tab">
|
|
170
|
+
<a href="{{figma_link.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit Figma, opens in new tab">
|
|
171
|
+
<span>Figma</span>
|
|
172
|
+
<svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#external-link"></use></svg>
|
|
173
|
+
</a>
|
|
136
174
|
{{/if}}
|
|
137
175
|
{{#if action_link_title.value}}
|
|
138
|
-
<a href="{{action_link_address.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit {{action_link_title.value}}, opens in new tab">
|
|
176
|
+
<a href="{{action_link_address.value}}" class="qld__code-header-link" target="_blank" aria-label="Visit {{action_link_title.value}}, opens in new tab">
|
|
177
|
+
<span>{{action_link_title.value}}</span>
|
|
178
|
+
<svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#external-link"></use></svg>
|
|
179
|
+
</a>
|
|
139
180
|
{{/if}}
|
|
140
181
|
</div>
|
|
141
182
|
{{#ifCond show_code.value '==' 'true'}}
|
|
142
183
|
<div class="qld__code-header-right">
|
|
143
184
|
<button class="qld__btn qld__code-copy--button" type="button">
|
|
144
185
|
<div class="clean">
|
|
145
|
-
<
|
|
186
|
+
<svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#copy"></use></svg>
|
|
187
|
+
<span class="qld__code-copy--button-text">Copy</span>
|
|
146
188
|
</div>
|
|
147
189
|
<div class="dirty">
|
|
148
|
-
<
|
|
190
|
+
<svg class="qld__icon qld__icon--md" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#status-success"></use></svg>
|
|
191
|
+
<span class="qld__code-copy--button-text">Copied</span>
|
|
149
192
|
</div>
|
|
150
193
|
<div class="qld__code-tooltip">
|
|
151
194
|
<span class="clean">Copy</span>
|
|
@@ -4,23 +4,23 @@
|
|
|
4
4
|
*/
|
|
5
5
|
var code = {};
|
|
6
6
|
|
|
7
|
-
code.init = function() {
|
|
8
|
-
const codes = document.querySelectorAll(
|
|
9
|
-
const inlinecodes = document.querySelectorAll(
|
|
10
|
-
const copyButtons = document.querySelectorAll(
|
|
11
|
-
const showToggle = document.querySelectorAll(
|
|
12
|
-
const colorButtons = document.querySelectorAll(
|
|
7
|
+
code.init = function () {
|
|
8
|
+
const codes = document.querySelectorAll("code");
|
|
9
|
+
const inlinecodes = document.querySelectorAll("code:not(.qld__code-body)");
|
|
10
|
+
const copyButtons = document.querySelectorAll(".qld__code-copy--button");
|
|
11
|
+
const showToggle = document.querySelectorAll(".qld__code-toggle-button");
|
|
12
|
+
const colorButtons = document.querySelectorAll(".qld__code-preview-colours input[type=radio]");
|
|
13
13
|
|
|
14
14
|
if (codes.length) {
|
|
15
|
-
codes.forEach(function(code) {
|
|
16
|
-
code.innerHTML = Prism.highlight(code.innerText, Prism.languages.html,
|
|
17
|
-
})
|
|
15
|
+
codes.forEach(function (code) {
|
|
16
|
+
code.innerHTML = Prism.highlight(code.innerText, Prism.languages.html, "html");
|
|
17
|
+
});
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
if (inlinecodes.length) {
|
|
21
|
-
inlinecodes.forEach(function(inlinecode){
|
|
21
|
+
inlinecodes.forEach(function (inlinecode) {
|
|
22
22
|
const codeWrap = document.createElement("div");
|
|
23
|
-
codeWrap.classList.add(
|
|
23
|
+
codeWrap.classList.add("qld__code--inline");
|
|
24
24
|
|
|
25
25
|
inlinecode.replaceWith(codeWrap);
|
|
26
26
|
codeWrap.appendChild(inlinecode);
|
|
@@ -28,133 +28,149 @@
|
|
|
28
28
|
const tooltip = document.createElement("span");
|
|
29
29
|
const tooltipText = document.createTextNode("Copy");
|
|
30
30
|
tooltip.appendChild(tooltipText);
|
|
31
|
-
tooltip.classList.add(
|
|
31
|
+
tooltip.classList.add("qld__code-tooltip");
|
|
32
32
|
inlinecode.after(tooltip);
|
|
33
|
-
inlinecode.setAttribute(
|
|
33
|
+
inlinecode.setAttribute("tabindex", 0);
|
|
34
34
|
|
|
35
|
-
inlinecode.addEventListener(
|
|
35
|
+
inlinecode.addEventListener("click", function () {
|
|
36
36
|
copyButtonAction(this);
|
|
37
|
-
})
|
|
37
|
+
});
|
|
38
38
|
|
|
39
|
-
inlinecode.addEventListener("keypress", function(event) {
|
|
39
|
+
inlinecode.addEventListener("keypress", function (event) {
|
|
40
40
|
if (event.key === "Enter") {
|
|
41
41
|
event.preventDefault();
|
|
42
42
|
copyButtonAction(this);
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
|
-
})
|
|
45
|
+
});
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
|
|
48
48
|
if (copyButtons.length) {
|
|
49
|
-
copyButtons.forEach(function(copyButton){
|
|
50
|
-
copyButton.addEventListener(
|
|
49
|
+
copyButtons.forEach(function (copyButton) {
|
|
50
|
+
copyButton.addEventListener("click", function () {
|
|
51
51
|
copyButtonAction(this);
|
|
52
|
-
})
|
|
53
|
-
})
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
if (showToggle.length) {
|
|
57
|
-
showToggle.forEach(function(showToggleButton){
|
|
58
|
-
const parent = showToggleButton.closest(
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
57
|
+
showToggle.forEach(function (showToggleButton) {
|
|
58
|
+
const parent = showToggleButton.closest(".qld__code");
|
|
59
|
+
const grandParent = parent.closest("section");
|
|
60
|
+
const svgPath = grandParent.getAttribute("data-path");
|
|
61
|
+
const target = parent.querySelector("code");
|
|
62
|
+
target.style.height = "120px";
|
|
63
|
+
|
|
64
|
+
// Create <svg>
|
|
65
|
+
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
66
|
+
svg.setAttribute("class", "qld__icon qld__icon--sm");
|
|
67
|
+
svg.setAttribute("aria-hidden", "true");
|
|
68
|
+
svg.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
69
|
+
|
|
70
|
+
// Create <use>
|
|
71
|
+
const use = document.createElementNS("http://www.w3.org/2000/svg", "use");
|
|
72
|
+
use.setAttributeNS(null, "href", `${svgPath}#chevron-up`);
|
|
73
|
+
|
|
74
|
+
showToggleButton.addEventListener("click", function () {
|
|
75
|
+
// Update button text
|
|
76
|
+
showToggleButton.innerText = this.innerText.indexOf("more") > -1 ? "Show less" : "Show more";
|
|
77
|
+
|
|
78
|
+
// Append <use> to <svg>
|
|
79
|
+
svg.appendChild(use);
|
|
80
|
+
showToggleButton.appendChild(svg);
|
|
68
81
|
|
|
69
82
|
QLD.animate.Toggle({
|
|
70
83
|
element: target,
|
|
71
|
-
property:
|
|
84
|
+
property: "height",
|
|
72
85
|
speed: 250,
|
|
73
86
|
closeSize: 120,
|
|
74
87
|
prefunction: function () {
|
|
75
|
-
parent.classList.toggle(
|
|
76
|
-
}
|
|
77
|
-
})
|
|
78
|
-
})
|
|
79
|
-
})
|
|
88
|
+
parent.classList.toggle("show_less");
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
});
|
|
80
93
|
}
|
|
81
94
|
|
|
82
95
|
if (colorButtons.length) {
|
|
83
|
-
colorButtons.forEach(function(colorButton){
|
|
84
|
-
colorButton.addEventListener(
|
|
85
|
-
const body = colorButton.closest(
|
|
86
|
-
body.classList.remove(
|
|
87
|
-
if (this.value){
|
|
88
|
-
body.classList.add(this.value)
|
|
96
|
+
colorButtons.forEach(function (colorButton) {
|
|
97
|
+
colorButton.addEventListener("change", function () {
|
|
98
|
+
const body = colorButton.closest(".qld__code").querySelector(".qld__code-preview-body");
|
|
99
|
+
body.classList.remove("qld__body--light", "qld__body--alt", "qld__body--dark", "qld__body--dark-alt");
|
|
100
|
+
if (this.value) {
|
|
101
|
+
body.classList.add(this.value);
|
|
89
102
|
}
|
|
90
|
-
const toggle = colorButton.closest(
|
|
91
|
-
if (typeof
|
|
92
|
-
toggle.classList.remove(
|
|
93
|
-
if (this.value){
|
|
94
|
-
toggle.classList.add(this.value)
|
|
103
|
+
const toggle = colorButton.closest(".qld__code").querySelector(".qld__code-toggle");
|
|
104
|
+
if (typeof toggle !== "undefined") {
|
|
105
|
+
toggle.classList.remove("qld__body--light", "qld__body--alt", "qld__body--dark", "qld__body--dark-alt");
|
|
106
|
+
if (this.value) {
|
|
107
|
+
toggle.classList.add(this.value);
|
|
95
108
|
}
|
|
96
109
|
}
|
|
97
|
-
})
|
|
98
|
-
})
|
|
110
|
+
});
|
|
111
|
+
});
|
|
99
112
|
}
|
|
100
|
-
}
|
|
113
|
+
};
|
|
101
114
|
|
|
102
115
|
function copyButtonAction(button) {
|
|
103
|
-
if (button.classList.contains(
|
|
104
|
-
const parent = button.closest(
|
|
105
|
-
copyTextToClipboard(parent.querySelector(
|
|
106
|
-
button.classList.add(
|
|
116
|
+
if (button.classList.contains("qld__code-copy--button")) {
|
|
117
|
+
const parent = button.closest(".qld__code");
|
|
118
|
+
copyTextToClipboard(parent.querySelector("code").innerText);
|
|
119
|
+
button.classList.add("copied");
|
|
107
120
|
|
|
108
121
|
setTimeout(() => {
|
|
109
|
-
button.classList.remove(
|
|
110
|
-
}, "1500")
|
|
122
|
+
button.classList.remove("copied");
|
|
123
|
+
}, "1500");
|
|
111
124
|
} else {
|
|
112
125
|
copyTextToClipboard(button.innerText);
|
|
113
|
-
button.nextElementSibling.innerText = "Copied"
|
|
114
|
-
button.addEventListener(
|
|
115
|
-
button.nextElementSibling.innerText = "Copy"
|
|
126
|
+
button.nextElementSibling.innerText = "Copied";
|
|
127
|
+
button.addEventListener("blur", function () {
|
|
128
|
+
button.nextElementSibling.innerText = "Copy";
|
|
116
129
|
});
|
|
117
130
|
}
|
|
118
131
|
}
|
|
119
132
|
|
|
120
133
|
function fallbackCopyTextToClipboard(text) {
|
|
121
|
-
const textArea = document.createElement("textarea")
|
|
134
|
+
const textArea = document.createElement("textarea");
|
|
122
135
|
textArea.value = text;
|
|
123
|
-
|
|
136
|
+
|
|
124
137
|
// Avoid scrolling to bottom
|
|
125
|
-
textArea.style.top = "0"
|
|
126
|
-
textArea.style.left = "0"
|
|
127
|
-
textArea.style.position = "fixed"
|
|
128
|
-
|
|
129
|
-
document.body.appendChild(textArea)
|
|
130
|
-
textArea.focus()
|
|
131
|
-
textArea.select()
|
|
132
|
-
|
|
138
|
+
textArea.style.top = "0";
|
|
139
|
+
textArea.style.left = "0";
|
|
140
|
+
textArea.style.position = "fixed";
|
|
141
|
+
|
|
142
|
+
document.body.appendChild(textArea);
|
|
143
|
+
textArea.focus();
|
|
144
|
+
textArea.select();
|
|
145
|
+
|
|
133
146
|
try {
|
|
134
|
-
const successful = document.execCommand(
|
|
135
|
-
const msg = successful ?
|
|
136
|
-
console.log(
|
|
147
|
+
const successful = document.execCommand("copy");
|
|
148
|
+
const msg = successful ? "successful" : "unsuccessful";
|
|
149
|
+
console.log("Fallback: Copying text command was " + msg);
|
|
137
150
|
} catch (err) {
|
|
138
|
-
console.error(
|
|
151
|
+
console.error("Fallback: Oops, unable to copy", err);
|
|
139
152
|
}
|
|
140
|
-
|
|
141
|
-
document.body.removeChild(textArea)
|
|
153
|
+
|
|
154
|
+
document.body.removeChild(textArea);
|
|
142
155
|
}
|
|
143
156
|
|
|
144
157
|
function copyTextToClipboard(text) {
|
|
145
158
|
if (!navigator.clipboard) {
|
|
146
|
-
fallbackCopyTextToClipboard(text)
|
|
159
|
+
fallbackCopyTextToClipboard(text);
|
|
147
160
|
return;
|
|
148
161
|
}
|
|
149
|
-
navigator.clipboard.writeText(text).then(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
162
|
+
navigator.clipboard.writeText(text).then(
|
|
163
|
+
function () {
|
|
164
|
+
console.log("Async: Copying to clipboard was successful!");
|
|
165
|
+
},
|
|
166
|
+
function (err) {
|
|
167
|
+
console.error("Async: Could not copy text: ", err);
|
|
168
|
+
},
|
|
169
|
+
);
|
|
154
170
|
}
|
|
155
171
|
|
|
156
172
|
QLD.code = code;
|
|
157
173
|
|
|
158
174
|
// Init In Page Nav on document load
|
|
159
|
-
document.addEventListener(
|
|
160
|
-
}()
|
|
175
|
+
document.addEventListener("DOMContentLoaded", QLD.code.init);
|
|
176
|
+
})();
|
|
@@ -407,11 +407,9 @@
|
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
|
|
410
|
-
.
|
|
410
|
+
svg.qld__icon {
|
|
411
411
|
color: var(--QLD-color-dark__action--secondary);
|
|
412
|
-
|
|
413
|
-
line-height: 1;
|
|
414
|
-
height: 0.875rem;
|
|
412
|
+
font-size: 1.25rem;
|
|
415
413
|
}
|
|
416
414
|
|
|
417
415
|
a.qld__footer__clickable__link {
|
|
@@ -30,9 +30,12 @@
|
|
|
30
30
|
{{/if}}
|
|
31
31
|
{{#if footerCTAContact.value}}
|
|
32
32
|
<p class="qld__footer__cta-content">
|
|
33
|
-
{{#
|
|
34
|
-
<
|
|
35
|
-
{{/
|
|
33
|
+
{{#ifCond footerCTAContactIcon.value '==' 'phone'}}
|
|
34
|
+
<svg class="qld__icon qld__icon--lead" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#phone"></use></svg>
|
|
35
|
+
{{/ifCond}}
|
|
36
|
+
{{#ifCond footerCTAContactIcon.value '==' 'email'}}
|
|
37
|
+
<svg class="qld__icon qld__icon--lead" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#Email"></use></svg>
|
|
38
|
+
{{/ifCond}}
|
|
36
39
|
{{{footerCTAContact.value}}}
|
|
37
40
|
</p>
|
|
38
41
|
{{/if}}
|
|
@@ -113,19 +116,19 @@
|
|
|
113
116
|
<a class="qld__footer__clickable__link" href="{{urldecode (lookup this 'asset_url^urlencode')}}">
|
|
114
117
|
{{/ifCond}}
|
|
115
118
|
{{#ifCond (lookup this 'asset_short_name^escapequotes') 'contains' 'facebook'}}
|
|
116
|
-
<svg class="qld__icon qld__icon--md" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
|
119
|
+
<svg class="qld__icon qld__icon--md" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#Facebook"></use></svg>
|
|
117
120
|
{{/ifCond}}
|
|
118
121
|
{{#ifCond (lookup this 'asset_short_name^escapequotes') 'contains' 'linkedin'}}
|
|
119
|
-
<svg class="qld__icon qld__icon--md" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
|
122
|
+
<svg class="qld__icon qld__icon--md" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#LinkedIn"></use></svg>
|
|
120
123
|
{{/ifCond}}
|
|
121
124
|
{{#ifCond (lookup this 'asset_short_name^escapequotes') 'contains' 'youtube'}}
|
|
122
|
-
<svg class="qld__icon qld__icon--md" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
|
125
|
+
<svg class="qld__icon qld__icon--md" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#YouTube"></use></svg>
|
|
123
126
|
{{/ifCond}}
|
|
124
127
|
{{#ifCond (lookup this 'asset_short_name^escapequotes') 'contains' 'instagram'}}
|
|
125
|
-
<svg class="qld__icon qld__icon--md" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
|
128
|
+
<svg class="qld__icon qld__icon--md" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#Instagram"></use></svg>
|
|
126
129
|
{{/ifCond}}
|
|
127
130
|
{{#ifCond (lookup this 'asset_short_name^escapequotes') 'contains' 'twitter'}}
|
|
128
|
-
<svg class="qld__icon qld__icon--md" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
|
131
|
+
<svg class="qld__icon qld__icon--md" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#X"></use></svg>
|
|
129
132
|
{{/ifCond}}
|
|
130
133
|
<span class="qld__footer__social__label">{{lookup this 'asset_short_name^escapequotes'}}</span>
|
|
131
134
|
</a>
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
.qld__header__cta-link {
|
|
135
135
|
@include QLD-fontgrid(xs);
|
|
136
136
|
color: var(--QLD-color-light__link);
|
|
137
|
-
@include QLD-space(
|
|
137
|
+
@include QLD-space(margin-left, 0.75unit);
|
|
138
138
|
align-items: center;
|
|
139
139
|
|
|
140
140
|
&:hover {
|
|
@@ -152,8 +152,7 @@
|
|
|
152
152
|
color: var(--QLD-color-light__action--secondary);
|
|
153
153
|
text-align: center;
|
|
154
154
|
|
|
155
|
-
svg
|
|
156
|
-
i {
|
|
155
|
+
svg {
|
|
157
156
|
height: 100%;
|
|
158
157
|
width: 100%;
|
|
159
158
|
}
|
|
@@ -163,8 +162,6 @@
|
|
|
163
162
|
a {
|
|
164
163
|
color: var(--QLD-color-dark__text);
|
|
165
164
|
display: flex;
|
|
166
|
-
|
|
167
|
-
@include QLD-focus();
|
|
168
165
|
}
|
|
169
166
|
|
|
170
167
|
.qld__header__main-nav-controls {
|
|
@@ -192,7 +189,7 @@
|
|
|
192
189
|
cursor: pointer;
|
|
193
190
|
align-items: center;
|
|
194
191
|
color: var(--QLD-color-light__link);
|
|
195
|
-
@include QLD-focus();
|
|
192
|
+
@include QLD-focus("light", false, -3px);
|
|
196
193
|
border-left: solid $QLD-border-width-thin $QLD-color-neutral--lighter;
|
|
197
194
|
|
|
198
195
|
&:hover {
|
|
@@ -238,9 +235,11 @@
|
|
|
238
235
|
}
|
|
239
236
|
|
|
240
237
|
//Dark theme
|
|
241
|
-
&.qld__header__pre-header--dark
|
|
238
|
+
&.qld__header__pre-header--dark,
|
|
239
|
+
&.qld__header__pre-header--dark-alt {
|
|
242
240
|
background-color: var(--QLD-color-dark__background);
|
|
243
241
|
color: var(--QLD-color-dark__text);
|
|
242
|
+
@include QLD-focus("dark");
|
|
244
243
|
|
|
245
244
|
.qld__header__pre-header-url {
|
|
246
245
|
color: var(--QLD-color-dark__link);
|
|
@@ -269,11 +268,12 @@
|
|
|
269
268
|
}
|
|
270
269
|
|
|
271
270
|
.qld__header__toggle-main-nav {
|
|
271
|
+
@include QLD-focus("dark", false, -3px);
|
|
272
272
|
color: var(--QLD-color-dark__link);
|
|
273
273
|
border-color: var(--QLD-color-dark__border);
|
|
274
|
+
@include QLD-focus("dark");
|
|
274
275
|
|
|
275
|
-
svg
|
|
276
|
-
i {
|
|
276
|
+
svg {
|
|
277
277
|
color: var(--QLD-color-dark__action--secondary);
|
|
278
278
|
}
|
|
279
279
|
|
|
@@ -319,11 +319,11 @@
|
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
.qld__header__toggle-main-nav {
|
|
322
|
+
@include QLD-focus("dark", false, -3px);
|
|
322
323
|
color: var(--QLD-color-dark__link);
|
|
323
324
|
border-color: var(--QLD-color-dark__border);
|
|
324
325
|
|
|
325
|
-
svg
|
|
326
|
-
i {
|
|
326
|
+
svg {
|
|
327
327
|
color: var(--QLD-color-dark__action--secondary);
|
|
328
328
|
}
|
|
329
329
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
</nav>
|
|
11
11
|
<div class="qld__header__pre-header {{site.metadata.sitePreHeaderTheme.value}}">
|
|
12
12
|
<div class="container-fluid">
|
|
13
|
-
<a href="{{#if site.metadata.sitePreHeaderURL.value}}{{site.metadata.sitePreHeaderURL.value}}{{else}}./?a={{site.data.assetid}}{{/if}}"
|
|
13
|
+
<a href="{{#if site.metadata.sitePreHeaderURL.value}}{{site.metadata.sitePreHeaderURL.value}}{{else}}./?a={{site.data.assetid}}{{/if}}">
|
|
14
14
|
<span class="qld__header__pre-header-url">{{site.metadata.sitePreHeaderText.value}}</span>
|
|
15
15
|
{{#if site.metadata.sitePreHeaderLogo.value}}
|
|
16
16
|
<img
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<a class="qld__header__cta-link" href="./?a={{site.metadata.mainNavCtaOne.value}}">
|
|
30
30
|
{{#if site.metadata.mainNavCtaOneIcon.value}}
|
|
31
31
|
<span class="qld__header__cta-link-icon">
|
|
32
|
-
|
|
32
|
+
<svg class="qld__icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#{{site.metadata.mainNavCtaOneIcon.value}}"></use></svg>
|
|
33
33
|
</span>
|
|
34
34
|
{{/if}}
|
|
35
35
|
<span class="qld__header__cta-link-text">{{site.metadata.mainNavCtaOneText.value}}</span>
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
<a class="qld__header__cta-link" href="./?a={{site.metadata.mainNavCtaTwo.value}}">
|
|
40
40
|
{{#if site.metadata.mainNavCtaTwoIcon.value}}
|
|
41
41
|
<span class="qld__header__cta-link-icon">
|
|
42
|
-
<
|
|
42
|
+
<svg class="qld__icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="{{@root.site.metadata.coreSiteIcons.value}}#{{site.metadata.mainNavCtaTwoIcon.value}}"></use></svg>
|
|
43
43
|
</span>
|
|
44
44
|
{{/if}}
|
|
45
45
|
<span class="qld__header__cta-link-text">{{site.metadata.mainNavCtaTwoText.value}}</span>
|