@qld-gov-au/qgds-bootstrap5 1.0.13 → 1.0.15
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/main.js +1 -1
- package/.storybook/preview.js +8 -0
- package/README.md +96 -46
- package/dist/assets/css/qld.bootstrap.css +1 -1
- package/dist/assets/css/qld.bootstrap.css.map +3 -3
- package/dist/assets/js/handlebars.helpers.bundle.js +1 -1
- package/dist/assets/js/handlebars.helpers.bundle.js.map +3 -3
- package/dist/assets/js/handlebars.helpers.js +4 -8
- package/dist/assets/js/qld.bootstrap.min.js +9 -9
- package/dist/assets/js/qld.bootstrap.min.js.map +4 -4
- package/dist/components/bs5/breadcrumbs/breadcrumbs.hbs +1 -1
- package/dist/components/bs5/button/button.hbs +30 -9
- package/dist/components/bs5/footer/footer.hbs +98 -112
- package/dist/components/bs5/footer/footerForgov.hbs +86 -59
- package/dist/components/bs5/header/header.hbs +15 -17
- package/dist/components/bs5/navbar/navbar.hbs +1 -1
- package/dist/components/bs5/quickexit/quickexit.hbs +28 -20
- package/dist/components/bs5/searchInput/searchInput.hbs +9 -3
- package/dist/components/handlebars.helpers.js +4 -8
- package/dist/components/handlebars.init.bundle.js +1 -1
- package/dist/components/handlebars.init.bundle.js.map +3 -3
- package/dist/index.html +2 -1
- package/dist/sample-data/button/button.data.json +2 -1
- package/dist/sample-data/footer/footer.data.json +93 -45
- package/dist/sample-data/header/header.data.json +134 -75
- package/dist/sample-data/navbar/navbar.data.json +8 -8
- package/dist/sample-data/quickexit/quickexit.data.json +8 -1
- package/dist/sample-data/searchInput/searchInput.data.json +10 -1
- package/package.json +20 -19
- package/src/components/bs5/breadcrumbs/breadcrumb.functions.js +71 -32
- package/src/components/bs5/breadcrumbs/breadcrumbs.hbs +1 -1
- package/src/components/bs5/button/button.data.json +2 -1
- package/src/components/bs5/button/button.hbs +30 -9
- package/src/components/bs5/button/button.scss +87 -44
- package/src/components/bs5/button/button.stories.js +121 -27
- package/src/components/bs5/callout/callout.scss +1 -1
- package/src/components/bs5/footer/_colours.scss +74 -0
- package/src/components/bs5/footer/_measurements.scss +30 -0
- package/src/components/bs5/footer/footer.data.json +93 -45
- package/src/components/bs5/footer/footer.functions.js +36 -0
- package/src/components/bs5/footer/footer.hbs +98 -112
- package/src/components/bs5/footer/footer.scss +445 -199
- package/src/components/bs5/footer/footer.stories.js +17 -6
- package/src/components/bs5/footer/footerForgov.hbs +86 -59
- package/src/components/bs5/header/_colours.scss +0 -52
- package/src/components/bs5/header/header.data.json +134 -75
- package/src/components/bs5/header/header.functions.js +1 -180
- package/src/components/bs5/header/header.hbs +15 -17
- package/src/components/bs5/header/header.scss +7 -156
- package/src/components/bs5/header/header.stories.js +10 -50
- package/src/components/bs5/modal/modal.scss +54 -35
- package/src/components/bs5/modal/modal.stories.js +2 -2
- package/src/components/bs5/navbar/_colours.scss +46 -82
- package/src/components/bs5/navbar/navbar.data.json +8 -8
- package/src/components/bs5/navbar/navbar.hbs +1 -1
- package/src/components/bs5/navbar/navbar.scss +15 -6
- package/src/components/bs5/quickexit/_colours.scss +28 -0
- package/src/components/bs5/quickexit/quickexit.data.json +8 -1
- package/src/components/bs5/quickexit/quickexit.hbs +28 -20
- package/src/components/bs5/quickexit/quickexit.scss +236 -156
- package/src/components/bs5/quickexit/quickexit.stories.js +35 -13
- package/src/components/bs5/searchInput/_colours.scss +63 -0
- package/src/components/bs5/searchInput/search.functions.js +170 -0
- package/src/components/bs5/searchInput/searchInput.data.json +10 -1
- package/src/components/bs5/searchInput/searchInput.hbs +9 -3
- package/src/components/bs5/searchInput/searchInput.scss +122 -21
- package/src/components/bs5/searchInput/searchInput.stories.js +1 -1
- package/src/components/bs5/tag/tag.scss +4 -2
- package/src/js/handlebars.helpers.js +4 -8
- package/src/main.js +63 -39
- package/src/main.scss +6 -3
- package/src/scss/qld-print.scss +365 -0
- package/src/scss/qld-type.scss +94 -85
- package/src/scss/qld-variables.scss +87 -101
- package/src/templates/compiled/index.html +2 -1
- package/src/templates/index.html +31 -46
- package/src/components/common/header/Header.js +0 -11
- package/src/components/common/header/header.html +0 -259
- package/src/components/common/header/header.scss +0 -118
- /package/src/components/bs5/{header/_search.json → searchInput/search.json} +0 -0
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { createPopper } from '@popperjs/core';
|
|
2
|
-
import { defaultSuggestions } from './_search.json';
|
|
3
|
-
|
|
4
1
|
/**
|
|
5
2
|
* Toggles the class on a search div based on button click.
|
|
6
3
|
*
|
|
@@ -49,180 +46,4 @@ export function toggleSearch(event) {
|
|
|
49
46
|
const isExpanded = searchDiv.classList.contains('qld__header__site-search--open');
|
|
50
47
|
event.currentTarget.setAttribute('aria-expanded', isExpanded);
|
|
51
48
|
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Fetches suggestions from the provided URL.
|
|
56
|
-
*
|
|
57
|
-
* @param {string} url - The URL to fetch suggestions from.
|
|
58
|
-
* @returns {Promise<Object>} - A promise that resolves to the fetched suggestions.
|
|
59
|
-
*/
|
|
60
|
-
async function fetchSuggestions(url) {
|
|
61
|
-
try {
|
|
62
|
-
const response = await fetch(url);
|
|
63
|
-
if (!response.ok) {
|
|
64
|
-
throw new Error('Network response was not ok');
|
|
65
|
-
}
|
|
66
|
-
const data = await response.json();
|
|
67
|
-
return data;
|
|
68
|
-
} catch (error) {
|
|
69
|
-
console.error("Error fetching suggestions:", error);
|
|
70
|
-
return {};
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Fetches related services from the provided URL.
|
|
76
|
-
*
|
|
77
|
-
* @param {string} url - The URL to fetch related services from.
|
|
78
|
-
* @returns {Promise<Object>} - A promise that resolves to the fetched services.
|
|
79
|
-
*/
|
|
80
|
-
async function fetchServices(url) {
|
|
81
|
-
try {
|
|
82
|
-
const response = await fetch(url);
|
|
83
|
-
if (!response.ok) {
|
|
84
|
-
throw new Error('Network response was not ok');
|
|
85
|
-
}
|
|
86
|
-
const data = await response.json();
|
|
87
|
-
return data;
|
|
88
|
-
} catch (error) {
|
|
89
|
-
console.error("Error fetching services:", error);
|
|
90
|
-
return {};
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Sets the selected suggestion into the input field and submits the form.
|
|
96
|
-
*
|
|
97
|
-
* @param {string} value - The selected suggestion.
|
|
98
|
-
* @returns {void}
|
|
99
|
-
*/
|
|
100
|
-
export function selectSuggestion(value) {
|
|
101
|
-
const searchInput = document.getElementById('search-input');
|
|
102
|
-
const suggestions = document.getElementById('suggestions');
|
|
103
|
-
const form = document.getElementById('site-search');
|
|
104
|
-
|
|
105
|
-
if (searchInput && suggestions && form) {
|
|
106
|
-
searchInput.value = value;
|
|
107
|
-
suggestions.style.display = 'none';
|
|
108
|
-
|
|
109
|
-
// Construct the action URL with query and other parameters
|
|
110
|
-
const baseUrl = form.getAttribute('action');
|
|
111
|
-
const collection = 'qgov~sp-search';
|
|
112
|
-
const profile = 'qld';
|
|
113
|
-
const query = encodeURIComponent(value);
|
|
114
|
-
const actionUrl = `${baseUrl}?query=${query}&collection=${collection}&profile=${profile}`;
|
|
115
|
-
|
|
116
|
-
// Update the form's action attribute
|
|
117
|
-
form.setAttribute('action', actionUrl);
|
|
118
|
-
|
|
119
|
-
// Submit the form
|
|
120
|
-
form.submit();
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Shows suggestions based on the user's input.
|
|
126
|
-
*
|
|
127
|
-
* @param {string} value - The current input value.
|
|
128
|
-
* @param {boolean} isDefault - Whether to show default suggestions or not.
|
|
129
|
-
* @returns {void}
|
|
130
|
-
**/
|
|
131
|
-
export async function showSuggestions(value = '', isDefault = false) {
|
|
132
|
-
const suggestions = document.getElementById('suggestions');
|
|
133
|
-
const searchInput = document.getElementById('search-input');
|
|
134
|
-
|
|
135
|
-
if (!suggestions || !searchInput) {
|
|
136
|
-
console.error("Required elements not found.");
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// Clear previous suggestions and services
|
|
141
|
-
suggestions.innerHTML = '';
|
|
142
|
-
|
|
143
|
-
const loadedSuggestions = defaultSuggestions;
|
|
144
|
-
|
|
145
|
-
if (isDefault) {
|
|
146
|
-
suggestions.innerHTML = `
|
|
147
|
-
<div class="suggestions-category mt-2">
|
|
148
|
-
<strong>Popular services</strong>
|
|
149
|
-
<ul class="mt-2">${loadedSuggestions.popular_services.slice(0, 4).map(item => `<li onclick="window.selectSuggestion('${item.title}')"><a href="${item.href}">${item.title}</a></li>`).join('')}</ul>
|
|
150
|
-
</div>
|
|
151
|
-
<hr>
|
|
152
|
-
<div class="suggestions-category mt-2">
|
|
153
|
-
<strong>Browse by category</strong>
|
|
154
|
-
<ul class="mt-2">${loadedSuggestions.categories.slice(0, 4).map(item => `<li onclick="window.selectSuggestion('${item.title}')"><a href="${item.href}">${item.title}</a></li>`).join('')}</ul>
|
|
155
|
-
</div>
|
|
156
|
-
<!--${loadedSuggestions.options.view_more ? `<div class="suggestions-category mt-4 mb-4"><a href="${loadedSuggestions.options.href}">${loadedSuggestions.options.label}</a></div>-->` : ''}
|
|
157
|
-
`;
|
|
158
|
-
suggestions.classList.add('show');
|
|
159
|
-
createPopper(searchInput, suggestions, {
|
|
160
|
-
placement: 'bottom-start',
|
|
161
|
-
});
|
|
162
|
-
suggestions.style.display = 'block';
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (value.length === 0) {
|
|
167
|
-
suggestions.innerHTML = '';
|
|
168
|
-
suggestions.style.display = 'none';
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// Fetch suggestions from the provided URL
|
|
173
|
-
const form = document.getElementById('site-search');
|
|
174
|
-
const suggestUrl = form.getAttribute('data-suggestions');
|
|
175
|
-
const resultsUrl = form.getAttribute('data-results-url');
|
|
176
|
-
|
|
177
|
-
if (suggestUrl) {
|
|
178
|
-
const fetchedSuggestions = await fetchSuggestions(`${suggestUrl}?collection=qgov~sp-search&fmt=json%2B%2B&alpha=0.5&profile=qld&partial_query=${encodeURIComponent(value)}`);
|
|
179
|
-
|
|
180
|
-
// Use the fetched suggestions to populate the suggestions dropdown
|
|
181
|
-
if (fetchedSuggestions.length > 0) {
|
|
182
|
-
suggestions.innerHTML = `
|
|
183
|
-
<div class="suggestions-category mt-2">
|
|
184
|
-
<strong>Suggestions</strong>
|
|
185
|
-
<ul class="mt-2">${fetchedSuggestions.slice(0, 4).map(item => {
|
|
186
|
-
if (!item.disp) return ''; // Check if item.disp is defined
|
|
187
|
-
const highlightedText = item.disp.replace(new RegExp(`(${value})`, 'gi'), '<strong>$1</strong>');
|
|
188
|
-
return `<li onclick="window.selectSuggestion('${item.disp}')"><a href="#">${highlightedText}</a></li>`;
|
|
189
|
-
}).join('')}</ul>
|
|
190
|
-
</div>
|
|
191
|
-
`;
|
|
192
|
-
suggestions.classList.add('show');
|
|
193
|
-
|
|
194
|
-
// Initialize Popper.js to manage the dropdown position
|
|
195
|
-
createPopper(searchInput, suggestions, {
|
|
196
|
-
placement: 'bottom-start',
|
|
197
|
-
});
|
|
198
|
-
suggestions.style.display = 'block';
|
|
199
|
-
} else {
|
|
200
|
-
suggestions.innerHTML = '';
|
|
201
|
-
suggestions.style.display = 'none';
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
if (resultsUrl) {
|
|
206
|
-
const fetchedServices = await fetchServices(`${resultsUrl}?collection=qgov~sp-search&profile=qld&smeta_sfinder_sand=yes&query=${encodeURIComponent(value)}`);
|
|
207
|
-
|
|
208
|
-
// Use the fetched services to populate the services dropdown
|
|
209
|
-
if (fetchedServices.response.resultPacket && fetchedServices.response.resultPacket.results.length > 0) {
|
|
210
|
-
suggestions.innerHTML += `
|
|
211
|
-
<div class="suggestions-category feature pt-2">
|
|
212
|
-
<strong>Services</strong>
|
|
213
|
-
<ul class="mt-2">${fetchedServices.response.resultPacket.results.slice(0, 4).map(item => `<li class="pb-2" onclick="window.selectSuggestion('${item.title}')"><a href="${item.liveUrl}">${item.title}</a></li>`).join('')}</ul>
|
|
214
|
-
</div>
|
|
215
|
-
`;
|
|
216
|
-
suggestions.classList.add('show');
|
|
217
|
-
|
|
218
|
-
// Initialize Popper.js to manage the dropdown position
|
|
219
|
-
createPopper(searchInput, suggestions, {
|
|
220
|
-
placement: 'bottom-start',
|
|
221
|
-
});
|
|
222
|
-
suggestions.style.display = 'block';
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// Attach the function to the window object to make it globally accessible
|
|
228
|
-
window.selectSuggestion = selectSuggestion;
|
|
49
|
+
}
|
|
@@ -189,12 +189,12 @@
|
|
|
189
189
|
href="{{url.value}}"
|
|
190
190
|
class="qld__header__cta-link"
|
|
191
191
|
{{/if}}>
|
|
192
|
-
{{#if icon.value}}
|
|
193
|
-
<span class="qld__header__cta-link-icon">
|
|
194
|
-
<i class="{{icon-root}}#{{icon.value}}"></i>
|
|
195
|
-
</span>
|
|
196
|
-
{{/if}}
|
|
197
192
|
<span class="qld__header__cta-link-text">{{text.value}}</span>
|
|
193
|
+
{{#if dropdown_enabled}}
|
|
194
|
+
<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" class="qld__header__cta-link-icon">
|
|
195
|
+
<use href="{{@root.icon-root}}#{{@root.icons.chevron_down}}"></use>
|
|
196
|
+
</svg>
|
|
197
|
+
{{/if}}
|
|
198
198
|
</a>
|
|
199
199
|
|
|
200
200
|
{{#if dropdown_enabled}}
|
|
@@ -242,15 +242,15 @@
|
|
|
242
242
|
{{#if siteSearchAsset.value}}
|
|
243
243
|
<button aria-controls="qld-header-search" class="qld__header__toggle-main-nav qld__main-nav__toggle-search" aria-expanded="false">
|
|
244
244
|
<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" class="qld__icon qld__icon--lg">
|
|
245
|
-
<use class="icon-search" href="{{icon-root}}#{{icons.search-icon}}" style="display: block;"></use>
|
|
246
|
-
<use class="icon-close" href="{{icon-root}}#{{icons.close-icon}}" style="display: none;"></use>
|
|
245
|
+
<use class="icon-search" href="{{@root.icon-root}}#{{@root.icons.search-icon}}" style="display: block;"></use>
|
|
246
|
+
<use class="icon-close" href="{{@root.icon-root}}#{{@root.icons.close-icon}}" style="display: none;"></use>
|
|
247
247
|
</svg>
|
|
248
248
|
<span class="qld__main-nav__toggle-text">Search</span>
|
|
249
249
|
</button>
|
|
250
250
|
{{/if}}
|
|
251
251
|
<button aria-controls="main-nav" class="qld__header__toggle-main-nav qld__main-nav__toggle--open" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
|
252
252
|
<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" class="qld__icon qld__icon--lg">
|
|
253
|
-
<use href="{{icon-root}}#{{icons.menu-icon}}"></use>
|
|
253
|
+
<use href="{{@root.icon-root}}#{{@root.icons.menu-icon}}"></use>
|
|
254
254
|
</svg>
|
|
255
255
|
<span class="qld__main-nav__toggle-text">Menu</span>
|
|
256
256
|
</button>
|
|
@@ -880,15 +880,13 @@
|
|
|
880
880
|
{{/if}}
|
|
881
881
|
{{#if siteSearchAsset.value}}
|
|
882
882
|
<div id="qld-header-search" class="qld__header__site-search qld__header__site-search--closed">
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
<ul id="suggestions" class="suggestions-dropdown suggestions-dropdown__group"></ul>
|
|
891
|
-
<input type="submit" class="btn btn-primary" value="{{#if siteSearchAsset.label}}{{siteSearchAsset.label}}{{else}}Search{{/if}}">
|
|
883
|
+
<form class="site-search" role="search"
|
|
884
|
+
{{#if siteSearchAsset.formAction.url}}
|
|
885
|
+
action="{{siteSearchAsset.formAction.url}}"
|
|
886
|
+
{{else}}
|
|
887
|
+
action="https://www.qld.gov.au/search"
|
|
888
|
+
{{/if}}>
|
|
889
|
+
{{{ searchInput }}}
|
|
892
890
|
</form>
|
|
893
891
|
</div>
|
|
894
892
|
{{/if}}
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
color: var(--#{$prefix}header_skip-link_focus_text_color);
|
|
47
47
|
background-color: var(--#{$prefix}header_skip-link_focus_bg_color);
|
|
48
48
|
outline: 3px solid var(--#{$prefix}header_skip-link_focus_outline_color);
|
|
49
|
-
z-index:
|
|
49
|
+
z-index: 999;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -207,20 +207,15 @@
|
|
|
207
207
|
font-size: .875rem;
|
|
208
208
|
line-height: 1.42;
|
|
209
209
|
padding-left: .75rem;
|
|
210
|
+
margin: 0 .5rem;
|
|
210
211
|
align-items: center;
|
|
211
212
|
color: var(--#{$prefix}header__cta-wrapper__cta-link_text_color);
|
|
212
|
-
|
|
213
|
-
&:hover {
|
|
214
|
-
.qld__header__cta-link-icon {
|
|
215
|
-
color: var(--#{$prefix}header__cta-wrapper__cta-link-icon_hover_color);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
213
|
}
|
|
219
214
|
|
|
220
215
|
.qld__header__cta-link-icon {
|
|
221
|
-
height:
|
|
222
|
-
width:
|
|
223
|
-
margin-
|
|
216
|
+
height: 1rem;
|
|
217
|
+
width: 1rem;
|
|
218
|
+
margin-left: .5rem;
|
|
224
219
|
text-align: center;
|
|
225
220
|
display: inline-block;
|
|
226
221
|
color: var(--#{$prefix}header__cta-wrapper__cta-link-icon_color);
|
|
@@ -475,153 +470,9 @@
|
|
|
475
470
|
form {
|
|
476
471
|
display: flex;
|
|
477
472
|
position: relative;
|
|
478
|
-
|
|
479
|
-
::placeholder {
|
|
480
|
-
color: var(--site-search-input-color);
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
//Search dropdown
|
|
484
|
-
.suggestions-dropdown {
|
|
485
|
-
position: absolute;
|
|
486
|
-
display: none;
|
|
487
|
-
left: 0;
|
|
488
|
-
top: 100%;
|
|
489
|
-
width: 100%;
|
|
490
|
-
z-index: 99;
|
|
491
|
-
border-radius: .5rem;
|
|
492
|
-
background: var(--#{$prefix}header_site-search-suggestions-bg);
|
|
493
|
-
box-shadow: var(--#{$prefix}header__pre-header_boxshadow);
|
|
494
|
-
border-bottom: solid .25rem var(--#{$prefix}header_site-search-suggestions-hover__border_color);
|
|
495
|
-
|
|
496
|
-
.suggestions-category {
|
|
497
|
-
padding: 0 1rem;
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
hr {
|
|
501
|
-
margin: 0;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
// Featured search result styles
|
|
505
|
-
.feature {
|
|
506
|
-
background-color: var(--#{$prefix}header_site-search-suggestions-feature_bg);
|
|
507
|
-
strong {
|
|
508
|
-
color: var(--#{$prefix}header_site-search-suggestions-feature_text-color);
|
|
509
|
-
}
|
|
510
|
-
ul {
|
|
511
|
-
li {
|
|
512
|
-
&:hover {
|
|
513
|
-
background-color: var(--#{$prefix}header_site-search-suggestions-feature_hover);
|
|
514
|
-
}
|
|
515
|
-
a {
|
|
516
|
-
color: var(--#{$prefix}header_site-search-suggestions-feature_text-color);
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
// Show when active
|
|
523
|
-
&.show {
|
|
524
|
-
display: block;
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
&__group {
|
|
528
|
-
padding: 0;
|
|
529
|
-
|
|
530
|
-
a, strong {
|
|
531
|
-
color: var(--site-search-input-color);
|
|
532
|
-
font-weight: 400;
|
|
533
|
-
font-size: 1rem;
|
|
534
|
-
text-decoration: none;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
strong {
|
|
538
|
-
font-weight: 600;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
ul {
|
|
542
|
-
padding: 0;
|
|
543
|
-
|
|
544
|
-
li {
|
|
545
|
-
min-height: 3rem;
|
|
546
|
-
list-style: none;
|
|
547
|
-
cursor: pointer;
|
|
548
|
-
|
|
549
|
-
a {
|
|
550
|
-
vertical-align: middle;
|
|
551
|
-
vertical-align: -webkit-baseline-middle;
|
|
552
|
-
&:hover {
|
|
553
|
-
text-decoration: underline;
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
&:hover {
|
|
558
|
-
background-color: var(--#{$prefix}header_site-search-suggestions-hover);
|
|
559
|
-
margin: 0 -1rem;
|
|
560
|
-
padding: 0 1rem;
|
|
561
|
-
|
|
562
|
-
a {
|
|
563
|
-
text-decoration: underline;
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
input[type="text"] {
|
|
573
|
-
box-shadow: none;
|
|
574
|
-
border: none;
|
|
575
|
-
padding-left: 3rem;
|
|
576
|
-
width: 20.62rem;
|
|
577
|
-
color: var(--site-search-input-color);
|
|
578
|
-
background: var(--site-search-bg);
|
|
579
|
-
border-radius: 0.25rem 0 0 0;
|
|
580
|
-
border-bottom: 2px solid var(--site-search-border-color);
|
|
581
|
-
|
|
582
|
-
@include media-breakpoint-down(lg) {
|
|
583
|
-
border: 2px solid var(--site-search-border-color);
|
|
584
|
-
width: 100%;
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
&:focus {
|
|
588
|
-
outline: 2px solid var(--site-search-input-focus-color);
|
|
589
|
-
outline-offset: 2px;
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
&.border-full {
|
|
593
|
-
border: 2px solid var(--site-search-border-color);
|
|
594
|
-
border-right: 0;
|
|
595
|
-
border-radius: 0.25rem 0 0 0.25rem;
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
input[type="submit"] {
|
|
601
|
-
border: none;
|
|
602
|
-
box-shadow: none;
|
|
603
|
-
border-radius: 0 0.25rem 0.25rem 0;
|
|
604
|
-
background: var(--site-search-btn-bg);
|
|
605
|
-
color: var(--site-search-btn-color);
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
//Icon
|
|
609
|
-
&:before {
|
|
610
|
-
content: "";
|
|
611
|
-
position: absolute;
|
|
612
|
-
top: 0;
|
|
613
|
-
left: 0;
|
|
614
|
-
bottom: 2px;
|
|
615
|
-
width: 3rem;
|
|
616
|
-
mask-position: center center;
|
|
617
|
-
mask-repeat: no-repeat;
|
|
618
|
-
mask-image: var(--icon-search);
|
|
619
|
-
background-color: var(--site-search-icon-color);
|
|
620
|
-
}
|
|
621
473
|
}
|
|
622
|
-
|
|
474
|
+
|
|
623
475
|
@include media-breakpoint-down(lg) {
|
|
624
|
-
|
|
625
476
|
// Mobile search open class
|
|
626
477
|
&--open {
|
|
627
478
|
z-index: 1;
|
|
@@ -633,10 +484,10 @@
|
|
|
633
484
|
margin-top: 1rem;
|
|
634
485
|
background-color: var(--#{$prefix}header_bg);
|
|
635
486
|
}
|
|
636
|
-
|
|
637
487
|
&--closed {
|
|
638
488
|
display: none;
|
|
639
489
|
}
|
|
640
490
|
}
|
|
641
491
|
}
|
|
492
|
+
|
|
642
493
|
}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
// Navbar.stories.js
|
|
2
2
|
import { Header } from './Header.js';
|
|
3
3
|
import { Navbar } from '../navbar/Navbar.js';
|
|
4
|
+
import { SearchInput } from "../searchInput/SearchInput.js";
|
|
5
|
+
|
|
4
6
|
import { menu_state } from '../navbar/navbar.data.json';
|
|
7
|
+
import defaultdata from '../searchInput/searchInput.data.json';
|
|
8
|
+
|
|
5
9
|
import {
|
|
6
10
|
masterbrand_variant,
|
|
7
11
|
subbrand_variant,
|
|
8
12
|
endorsed_variant,
|
|
9
13
|
standalone_variant } from './header.data.json';
|
|
10
|
-
|
|
14
|
+
|
|
11
15
|
export default {
|
|
12
16
|
tags: ['autodocs'],
|
|
13
17
|
title: 'Components/Header',
|
|
14
18
|
render: (args) => {
|
|
15
19
|
return `
|
|
16
|
-
${new Header(args).html}
|
|
20
|
+
${new Header({...args, searchInput: new SearchInput(defaultdata).html}).html}
|
|
17
21
|
${new Navbar(args).html}
|
|
18
22
|
`//expand arguments, specifically turn isdisabled into true
|
|
19
23
|
},
|
|
@@ -28,7 +32,7 @@ export default {
|
|
|
28
32
|
export const MasterBrand = {
|
|
29
33
|
args: {
|
|
30
34
|
...masterbrand_variant,
|
|
31
|
-
...menu_state
|
|
35
|
+
...menu_state
|
|
32
36
|
},
|
|
33
37
|
parameters: {
|
|
34
38
|
backgrounds: {
|
|
@@ -51,7 +55,7 @@ export const MasterBrand = {
|
|
|
51
55
|
export const Subbrand = {
|
|
52
56
|
args: {
|
|
53
57
|
...subbrand_variant,
|
|
54
|
-
...menu_state
|
|
58
|
+
...menu_state
|
|
55
59
|
},
|
|
56
60
|
parameters: {
|
|
57
61
|
backgrounds: {
|
|
@@ -74,7 +78,7 @@ export const Subbrand = {
|
|
|
74
78
|
export const EndorsedBrand = {
|
|
75
79
|
args: {
|
|
76
80
|
...endorsed_variant,
|
|
77
|
-
...menu_state
|
|
81
|
+
...menu_state
|
|
78
82
|
},
|
|
79
83
|
parameters: {
|
|
80
84
|
backgrounds: {
|
|
@@ -112,51 +116,7 @@ export const StandaloneBrand = {
|
|
|
112
116
|
return `
|
|
113
117
|
<style>
|
|
114
118
|
:root {
|
|
115
|
-
|
|
116
|
-
--qld-color-light__design-accent: #FF0084;
|
|
117
|
-
--qld-color-light__heading: #1C0A20;
|
|
118
|
-
--qld-color-light__text: #414141;
|
|
119
|
-
--qld-color-light__text--lighter: #333333;
|
|
120
|
-
--qld-color-light__link: #710074;
|
|
121
|
-
--qld-color-light__link--visited: #810036;
|
|
122
|
-
--qld-color-light__link--on-action: #FFFFFF;
|
|
123
|
-
--qld-color-light__action--primary: #420725;
|
|
124
|
-
--qld-color-light__action--primary-hover: #000000;
|
|
125
|
-
--qld-color-light__focus: #9C008D;
|
|
126
|
-
--qld-color-light__border: #A5A5A5;
|
|
127
|
-
--qld-color-light__background: #FFFFFF;
|
|
128
|
-
--qld-color-light__background--shade: #F6F6F6;
|
|
129
|
-
--qld-color-light__underline: #97009b;
|
|
130
|
-
--qld-color-light__underline--hover: #710074;
|
|
131
|
-
--qld-color-light__underline--visited: #94003e;
|
|
132
|
-
--qld-color-light__underline--hover-visited: #810036;
|
|
133
|
-
--qld-color-light__action--secondary: #59449A;
|
|
134
|
-
--qld-color-light__action--secondary-hover: #810036;
|
|
135
|
-
--qld-color-light__border--alt: #595959;
|
|
136
|
-
--qld-color-light__background--alt: #FFEAF5;
|
|
137
|
-
--qld-color-light__background--alt-shade: #F8E1ED;
|
|
138
|
-
--qld-color-dark__design-accent: #FF0084;
|
|
139
|
-
--qld-color-dark__heading: #FFFFFF;
|
|
140
|
-
--qld-color-dark__text: #FFFFFF;
|
|
141
|
-
--qld-color-dark__text--lighter: #FECBE5;
|
|
142
|
-
--qld-color-dark__link: #faddec;
|
|
143
|
-
--qld-color-dark__link--visited: #faddec;
|
|
144
|
-
--qld-color-dark__link--on-action: #000000;
|
|
145
|
-
--qld-color-dark__action--primary: #FC5CAF;
|
|
146
|
-
--qld-color-dark__action--primary-hover: #FFC85E;
|
|
147
|
-
--qld-color-dark__focus: #FFCAE5;
|
|
148
|
-
--qld-color-dark__border: #FFA3D2;
|
|
149
|
-
--qld-color-dark__background: #000000;
|
|
150
|
-
--qld-color-dark__background--shade: #141414;
|
|
151
|
-
--qld-color-dark__underline: #5d2158;
|
|
152
|
-
--qld-color-dark__underline--hover: #faddec;
|
|
153
|
-
--qld-color-dark__underline--visited: #5d2158;
|
|
154
|
-
--qld-color-dark__underline--hover-visited: #faddec;
|
|
155
|
-
--qld-color-dark__action--secondary: #FFFFFF;
|
|
156
|
-
--qld-color-dark__action--secondary-hover: #FFEF60;
|
|
157
|
-
--qld-color-dark__border--alt: #ffd1e8;
|
|
158
|
-
--qld-color-dark__background--alt: #34001B;
|
|
159
|
-
--qld-color-dark__background--alt-shade: #210011;
|
|
119
|
+
//Override example
|
|
160
120
|
}
|
|
161
121
|
</style>
|
|
162
122
|
${Story()}
|