hmrc-frontend 6.85.0 → 6.87.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/govuk-prototype-kit.config.json +4 -0
- package/hmrc/VERSION.txt +1 -1
- package/hmrc/{accessible-autocomplete-6.85.0.css → accessible-autocomplete-6.87.0.css} +1 -1
- package/hmrc/components/_all.scss +1 -0
- package/hmrc/components/header/template.njk +11 -2
- package/hmrc/components/service-navigation-language-select/README.md +20 -0
- package/hmrc/components/service-navigation-language-select/_service-navigation-language-select.scss +77 -0
- package/hmrc/components/service-navigation-language-select/layout.njk +40 -0
- package/hmrc/components/service-navigation-language-select/macro.njk +3 -0
- package/hmrc/components/service-navigation-language-select/template.njk +39 -0
- package/hmrc/{hmrc-frontend-6.85.0.min.css → hmrc-frontend-6.87.0.min.css} +2 -2
- package/hmrc/{hmrc-frontend-6.85.0.min.js → hmrc-frontend-6.87.0.min.js} +1 -1
- package/hmrc/maps/{accessible-autocomplete-6.85.0.css.map → accessible-autocomplete-6.87.0.css.map} +1 -1
- package/hmrc/maps/hmrc-frontend-6.87.0.min.css.map +1 -0
- package/hmrc/maps/{hmrc-frontend-6.85.0.min.js.map → hmrc-frontend-6.87.0.min.js.map} +1 -1
- package/package.json +1 -1
- package/hmrc/maps/hmrc-frontend-6.85.0.min.css.map +0 -1
- /package/hmrc/{accessible-autocomplete-6.85.0.js → accessible-autocomplete-6.87.0.js} +0 -0
|
@@ -99,6 +99,10 @@
|
|
|
99
99
|
"macroName": "hmrcReportTechnicalIssue",
|
|
100
100
|
"importFrom": "hmrc/components/report-technical-issue/macro.njk"
|
|
101
101
|
},
|
|
102
|
+
{
|
|
103
|
+
"macroName": "hmrcServiceNavigationLanguageSelect",
|
|
104
|
+
"importFrom": "hmrc/components/service-navigation-language-select/macro.njk"
|
|
105
|
+
},
|
|
102
106
|
{
|
|
103
107
|
"macroName": "hmrcTimeline",
|
|
104
108
|
"importFrom": "hmrc/components/timeline/macro.njk"
|
package/hmrc/VERSION.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
6.
|
|
1
|
+
6.87.0
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
.autocomplete__wrapper{position:relative}.autocomplete__hint,.autocomplete__input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:2px solid #0b0c0c;border-radius:0;-webkit-box-sizing:border-box;box-sizing:border-box;height:2.5rem;line-height:1.25;margin-bottom:0;width:100%}.autocomplete__input{background-color:rgba(0,0,0,0);position:relative}.autocomplete__hint{color:#505a5f;position:absolute}.autocomplete__input--default{padding:5px}.autocomplete__input--focused{-webkit-box-shadow:inset 0 0 0 2px;box-shadow:inset 0 0 0 2px;outline:3px solid #fd0;outline-offset:0}.autocomplete__input--show-all-values{cursor:pointer;padding:5px 35px 5px 5px}.autocomplete__dropdown-arrow-down{display:inline-block;height:24px;position:absolute;right:8px;top:10px;width:24px;z-index:-1}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:100%;width:calc(100% - 4px)}.autocomplete__menu--visible{display:block}.autocomplete__menu--hidden{display:none}.autocomplete__menu--overlay{-webkit-box-shadow:0 2px 6px rgba(0,0,0,.257);box-shadow:0 2px 6px rgba(0,0,0,.257);left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline{position:relative}.autocomplete__option{border-bottom:1px solid #b1b4b6;border-left-width:0;border-right-width:0;border-top-width:1px;cursor:pointer;display:block;position:relative}.autocomplete__option>*{pointer-events:none}.autocomplete__option:first-of-type{border-top-width:0}.autocomplete__option:last-of-type{border-bottom-width:0}.autocomplete__option--odd{background-color:#f3f2f1}.autocomplete__option--focused,.autocomplete__option:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:none}@media (-ms-high-contrast:active),(forced-colors:active){.autocomplete__menu{border-color:FieldText}.autocomplete__option{background-color:Field;color:FieldText}.autocomplete__option--focused,.autocomplete__option:hover{background-color:Highlight;background-color:SelectedItem;border-color:SelectedItem;color:HighlightText;color:SelectedItemText;forced-color-adjust:none;outline-color:SelectedItemText}}.autocomplete__option--no-results{background-color:#f3f2f1;color:#505a5f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:1rem;font-weight:400}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width:641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:1.1875rem;line-height:1.3157894737}}.autocomplete__hint,.autocomplete__input,.autocomplete__option,.autocomplete__wrapper{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:1rem;line-height:1.25}@media print{.autocomplete__hint,.autocomplete__input,.autocomplete__option,.autocomplete__wrapper{font-family:sans-serif}}@media (min-width:40.0625em){.autocomplete__hint,.autocomplete__input,.autocomplete__option,.autocomplete__wrapper{font-size:1.1875rem;line-height:1.3157894737}}@media print{.autocomplete__hint,.autocomplete__input,.autocomplete__option,.autocomplete__wrapper{font-size:14pt;line-height:1.15}}.govuk-form-group--error div:has(+.govuk-select--error[data-module=hmrc-accessible-autocomplete])>.autocomplete__wrapper .autocomplete__input{border-color:#d4351c}.autocomplete__dropdown-arrow-down{z-index:0;pointer-events:none}
|
|
2
|
-
/*# sourceMappingURL=maps/accessible-autocomplete-6.
|
|
2
|
+
/*# sourceMappingURL=maps/accessible-autocomplete-6.87.0.css.map */
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
@import "add-to-a-list/add-to-a-list";
|
|
11
11
|
@import "list-with-actions/list-with-actions";
|
|
12
12
|
@import "timeout-dialog/timeout-dialog";
|
|
13
|
+
@import "service-navigation-language-select/service-navigation-language-select";
|
|
13
14
|
@import "status-tags-in-task-list-pages/status-tags-in-task-list-pages";
|
|
14
15
|
@import "user-research-banner/user-research-banner";
|
|
15
16
|
@import "timeline/timeline";
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
{% from "../banner/macro.njk" import hmrcBanner %}
|
|
3
3
|
{% from "../user-research-banner/macro.njk" import hmrcUserResearchBanner %}
|
|
4
4
|
{% from "govuk/components/phase-banner/macro.njk" import govukPhaseBanner %}
|
|
5
|
+
{% from "govuk/components/service-navigation/macro.njk" import govukServiceNavigation %}
|
|
5
6
|
|
|
6
7
|
{% from "govuk/macros/attributes.njk" import govukAttributes %}
|
|
7
8
|
{% from "govuk/macros/logo.njk" import govukLogo -%}
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
{%- set menuButtonText = params.menuButtonText if params.menuButtonText else ('Dewislen' if language == 'cy' else 'Menu') -%}
|
|
12
13
|
|
|
13
14
|
<header>
|
|
14
|
-
<div class="govuk-header hmrc-header {%- if params.classes %} {{ params.classes }}{% endif %}{{ ' hmrc-header--with-additional-navigation' if params.signOutHref or params.languageToggle }}" data-module="govuk-header"
|
|
15
|
+
<div class="govuk-header hmrc-header {%- if params.classes %} {{ params.classes }}{% endif %}{{ ' hmrc-header--with-additional-navigation' if params.signOutHref or params.languageToggle }}{{ ' govuk-header--full-width-border' if params.serviceNavigation }}" data-module="govuk-header"
|
|
15
16
|
{{- govukAttributes(params.attributes) }}>
|
|
16
17
|
<div class="govuk-header__container {{ params.containerClasses | default("govuk-width-container", true) }}">
|
|
17
18
|
<div class="govuk-header__logo">
|
|
@@ -88,6 +89,14 @@
|
|
|
88
89
|
{% endif %}
|
|
89
90
|
</div>
|
|
90
91
|
</div>
|
|
92
|
+
{% if params.displayHmrcBanner and not params.useDeprecatedPositionForHmrcBanner %}
|
|
93
|
+
<div class="govuk-width-container">
|
|
94
|
+
{{ hmrcBanner({language: params.language, useTudorCrown: params.useTudorCrown}) }}
|
|
95
|
+
</div>
|
|
96
|
+
{% endif %}
|
|
97
|
+
{% if params.serviceNavigation %}
|
|
98
|
+
{{ govukServiceNavigation(params.serviceNavigation) }}
|
|
99
|
+
{% endif %}
|
|
91
100
|
{%- if params.phaseBanner %}
|
|
92
101
|
<div class="govuk-width-container">
|
|
93
102
|
{{ govukPhaseBanner(params.phaseBanner) }}
|
|
@@ -96,7 +105,7 @@
|
|
|
96
105
|
{%- if params.userResearchBanner %}
|
|
97
106
|
{{ hmrcUserResearchBanner({language: params.language, url: params.userResearchBanner.url }) }}
|
|
98
107
|
{% endif %}
|
|
99
|
-
{
|
|
108
|
+
{% if params.displayHmrcBanner and params.useDeprecatedPositionForHmrcBanner %}
|
|
100
109
|
<div class="govuk-width-container">
|
|
101
110
|
{{ hmrcBanner({language: params.language, useTudorCrown: params.useTudorCrown}) }}
|
|
102
111
|
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Service Navigation Language Select
|
|
2
|
+
|
|
3
|
+
Choose between Welsh and English.
|
|
4
|
+
|
|
5
|
+
This component is intended to be passed into the end slot of a Service Navigation component.
|
|
6
|
+
|
|
7
|
+
A Service Navigation component containing this language select will need to have the class
|
|
8
|
+
`.hmrc-service-navigation--with-language-select` added for it to be displayed correctly, if it's not included then the
|
|
9
|
+
language select will appear on a separate line.
|
|
10
|
+
|
|
11
|
+
## Accessibility
|
|
12
|
+
|
|
13
|
+
This component should not be used at the same time in a user journey or on a page as the Language Select component which
|
|
14
|
+
is displayed in the main area of the page. A journey which contains the language select displayed in both positions,
|
|
15
|
+
even if only displayed on separate pages, the inconsistent placement of the language select controls will be an
|
|
16
|
+
accessibility failure, according to the WCAG 2.2 Consistent Navigation Success Criteria.
|
|
17
|
+
|
|
18
|
+
### License
|
|
19
|
+
|
|
20
|
+
This code is open source software licensed under the [Apache 2.0 License]("http://www.apache.org/licenses/LICENSE-2.0.html").
|
package/hmrc/components/service-navigation-language-select/_service-navigation-language-select.scss
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
.hmrc-service-navigation-language-select {
|
|
2
|
+
@include govuk-font($size: 16);
|
|
3
|
+
@include govuk-clearfix;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.hmrc-service-navigation-language-select__list {
|
|
7
|
+
margin-top: 1em;
|
|
8
|
+
float: right;
|
|
9
|
+
text-align: right;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.hmrc-service-navigation-language-select__list-item {
|
|
13
|
+
display: inline-block;
|
|
14
|
+
|
|
15
|
+
&:first-child::after {
|
|
16
|
+
content: "";
|
|
17
|
+
display: inline-block;
|
|
18
|
+
position: relative;
|
|
19
|
+
top: 0.1875em;
|
|
20
|
+
height: 1em;
|
|
21
|
+
// stylelint-disable-next-line number-max-precision -- gives a 1.5px border width
|
|
22
|
+
border-right: 0.09375em solid $govuk-text-colour;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
a,
|
|
26
|
+
[aria-current] {
|
|
27
|
+
padding: 0.3125em;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.hmrc-service-navigation--with-language-select {
|
|
32
|
+
.govuk-width-container {
|
|
33
|
+
display: -webkit-box;
|
|
34
|
+
display: -ms-flexbox;
|
|
35
|
+
display: flex;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.govuk-service-navigation .hmrc-service-navigation-language-select {
|
|
40
|
+
display: inline;
|
|
41
|
+
-webkit-box-flex: 0;
|
|
42
|
+
-ms-flex: 0 0 auto;
|
|
43
|
+
flex: 0 0 auto;
|
|
44
|
+
margin-top: auto;
|
|
45
|
+
margin-left: auto;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.govuk-service-navigation .hmrc-service-navigation-language-select .hmrc-service-navigation-language-select__list {
|
|
49
|
+
position: relative;
|
|
50
|
+
padding-left: 0;
|
|
51
|
+
|
|
52
|
+
@include govuk-responsive-margin(6, $direction: left);
|
|
53
|
+
|
|
54
|
+
@include govuk-media-query($from: tablet) {
|
|
55
|
+
margin-top: 0;
|
|
56
|
+
margin-bottom: 0;
|
|
57
|
+
padding: govuk-spacing(4) 0;
|
|
58
|
+
|
|
59
|
+
@include _govuk-rebrand {
|
|
60
|
+
padding: govuk-spacing(3) 0;
|
|
61
|
+
|
|
62
|
+
// some magic numbers from govuk-frontend service nav rebrand,
|
|
63
|
+
// adapted for the 16px font-size of the language switcher
|
|
64
|
+
line-height: (29 / 16);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.hmrc-service-navigation-language-select .govuk-service-navigation__item {
|
|
70
|
+
margin-bottom: govuk-spacing(3);
|
|
71
|
+
|
|
72
|
+
@include govuk-responsive-margin(6, $direction: left);
|
|
73
|
+
|
|
74
|
+
@include govuk-media-query($from: tablet) {
|
|
75
|
+
margin-bottom: 0;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{% extends "layout.njk" %}
|
|
2
|
+
|
|
3
|
+
{% from "../header/macro.njk" import hmrcHeader %}
|
|
4
|
+
|
|
5
|
+
{% block header %}
|
|
6
|
+
{{ hmrcHeader({
|
|
7
|
+
serviceNavigation: {
|
|
8
|
+
serviceName: "Example service",
|
|
9
|
+
classes: 'hmrc-service-navigation--with-language-select',
|
|
10
|
+
navigation: [
|
|
11
|
+
{
|
|
12
|
+
href: "#",
|
|
13
|
+
text: "Navigation item 1"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
href: "#",
|
|
17
|
+
text: "Navigation item 2",
|
|
18
|
+
active: true
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
href: "#",
|
|
22
|
+
text: "Navigation item 3"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
slots: {
|
|
26
|
+
end: componentView
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}) }}
|
|
30
|
+
{% endblock %}
|
|
31
|
+
|
|
32
|
+
{% block main %}
|
|
33
|
+
<div class="govuk-width-container">
|
|
34
|
+
<main class="govuk-main-wrapper" id="main-content">
|
|
35
|
+
|
|
36
|
+
<div style="height:300px;"></div>
|
|
37
|
+
|
|
38
|
+
</main>
|
|
39
|
+
</div>
|
|
40
|
+
{% endblock %}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{% if params.language === 'en' %}
|
|
2
|
+
<nav class="hmrc-service-navigation-language-select" aria-label="Language switcher">
|
|
3
|
+
<ul class="hmrc-service-navigation-language-select__list">
|
|
4
|
+
<li class="hmrc-service-navigation-language-select__list-item">
|
|
5
|
+
<span aria-current="true">ENG</span>
|
|
6
|
+
</li>
|
|
7
|
+
<li class="hmrc-service-navigation-language-select__list-item">
|
|
8
|
+
<a href="{{ params.cy.href }}"
|
|
9
|
+
hreflang="cy"
|
|
10
|
+
lang="cy"
|
|
11
|
+
rel="alternate"
|
|
12
|
+
class="govuk-link govuk-service-navigation__link"
|
|
13
|
+
data-journey-click="link - click:lang-select:Cymraeg">
|
|
14
|
+
CYM<span class="govuk-visually-hidden"> – Newid yr iaith ir Gymraeg</span>
|
|
15
|
+
</a>
|
|
16
|
+
</li>
|
|
17
|
+
</ul>
|
|
18
|
+
</nav>
|
|
19
|
+
{% endif %}
|
|
20
|
+
|
|
21
|
+
{% if params.language === 'cy' %}
|
|
22
|
+
<nav class="hmrc-service-navigation-language-select" aria-label="Switcher iaith">
|
|
23
|
+
<ul class="hmrc-service-navigation-language-select__list">
|
|
24
|
+
<li class="hmrc-service-navigation-language-select__list-item">
|
|
25
|
+
<a href="{{ params.en.href }}"
|
|
26
|
+
hreflang="en"
|
|
27
|
+
lang="en"
|
|
28
|
+
rel="alternate"
|
|
29
|
+
class="govuk-link govuk-service-navigation__link"
|
|
30
|
+
data-journey-click="link - click:lang-select:English">
|
|
31
|
+
ENG<span class="govuk-visually-hidden"> – Change the language to English</span>
|
|
32
|
+
</a>
|
|
33
|
+
</li>
|
|
34
|
+
<li class="hmrc-service-navigation-language-select__list-item">
|
|
35
|
+
<span aria-current="true">CYM</span>
|
|
36
|
+
</li>
|
|
37
|
+
</ul>
|
|
38
|
+
</nav>
|
|
39
|
+
{% endif %}
|