@qhealth-design-system/core 1.18.2 → 1.18.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -41,11 +41,11 @@ export default function initHeader(document = document) {
|
|
|
41
41
|
// We want to ensure the search input is visible on desktop at all times
|
|
42
42
|
window.addEventListener("resize", () => {
|
|
43
43
|
if (window.innerWidth >= mobileBreakpoint && !isHeaderOpen) {
|
|
44
|
-
openHeader();
|
|
44
|
+
openHeader(false);
|
|
45
45
|
// Disable focus trap as it's not needed on desktop
|
|
46
46
|
disableFocusTrap();
|
|
47
47
|
} else if (window.innerWidth < mobileBreakpoint && isHeaderOpen) {
|
|
48
|
-
closeHeader();
|
|
48
|
+
closeHeader(false);
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
}
|
|
@@ -88,7 +88,7 @@ function toggleHeaderSearch() {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
function openHeader() {
|
|
91
|
+
function openHeader(requireFocusChange = true) {
|
|
92
92
|
isHeaderOpen = true;
|
|
93
93
|
searchToggle.setAttribute("aria-expanded", true);
|
|
94
94
|
searchToggle.classList.remove("qld__main-nav__toggle-search--open");
|
|
@@ -99,7 +99,9 @@ function openHeader() {
|
|
|
99
99
|
// Wait for display: block, and then add class to open smoothly
|
|
100
100
|
setTimeout(function () {
|
|
101
101
|
target.classList.add("qld__main-nav__search--open");
|
|
102
|
-
|
|
102
|
+
if (requireFocusChange) {
|
|
103
|
+
target.querySelector(".qld__text-input").focus();
|
|
104
|
+
}
|
|
103
105
|
|
|
104
106
|
// Close header search on click outside
|
|
105
107
|
headerSearchEvents.background = addEvent(document, "click", function () {
|
|
@@ -128,13 +130,15 @@ function openHeader() {
|
|
|
128
130
|
});
|
|
129
131
|
}
|
|
130
132
|
|
|
131
|
-
function closeHeader() {
|
|
133
|
+
function closeHeader(requireFocusChange = true) {
|
|
132
134
|
isHeaderOpen = false;
|
|
133
135
|
searchToggle.setAttribute("aria-expanded", false);
|
|
134
136
|
searchToggle.classList.remove("qld__main-nav__toggle-search--close");
|
|
135
137
|
searchToggle.classList.add("qld__main-nav__toggle-search--open");
|
|
136
138
|
searchToggleText.textContent = "Search";
|
|
137
|
-
|
|
139
|
+
if (requireFocusChange) {
|
|
140
|
+
searchToggle.focus();
|
|
141
|
+
}
|
|
138
142
|
target.classList.remove("qld__main-nav__search--open");
|
|
139
143
|
target.style.display = "none";
|
|
140
144
|
|
|
@@ -388,7 +388,7 @@ $QLD-color-dark__heading: #ffffff !default;
|
|
|
388
388
|
$QLD-color-dark__text: #ffffff !default;
|
|
389
389
|
$QLD-color-dark__text--lighter: #deebf9 !default;
|
|
390
390
|
$QLD-color-dark__link: #ffffff !default;
|
|
391
|
-
$QLD-color-dark__link--visited: #
|
|
391
|
+
$QLD-color-dark__link--visited: #f2cdff !default;
|
|
392
392
|
$QLD-color-dark__link--on-action: #001c37 !default;
|
|
393
393
|
$QLD-color-dark__action--primary: #84d3ff !default;
|
|
394
394
|
$QLD-color-dark__action--primary-hover: #a6f7ff !default;
|
|
@@ -422,7 +422,7 @@ $QLD-color-light__underline--hover-visited: #{$QLD-color-light__link--visited} !
|
|
|
422
422
|
$QLD-color-status__dark-underline: rgba(3, 33, 63, 0.72) !default;
|
|
423
423
|
$QLD-color-dark__underline: #b5cce2 !default;
|
|
424
424
|
$QLD-color-dark__underline--hover: #{$QLD-color-dark__link} !default;
|
|
425
|
-
$QLD-color-dark__underline--visited: #
|
|
425
|
+
$QLD-color-dark__underline--visited: #c6aed9 !default;
|
|
426
426
|
$QLD-color-dark__underline--hover-visited: #{$QLD-color-dark__link--visited} !default;
|
|
427
427
|
|
|
428
428
|
/**
|