@ons/design-system 50.0.1 → 53.0.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/README.md +35 -15
- package/components/access-code/_macro.njk +1 -1
- package/components/access-code/_macro.spec.js +162 -0
- package/components/access-code/uac.spec.js +26 -0
- package/components/accordion/_macro.spec.js +224 -0
- package/components/accordion/accordion.spec.js +134 -0
- package/components/address-input/_macro.njk +1 -1
- package/components/address-input/_macro.spec.js +465 -0
- package/components/address-input/autosuggest.address.js +5 -4
- package/components/address-input/autosuggest.address.setter.js +9 -3
- package/components/address-input/autosuggest.address.spec.js +733 -0
- package/components/address-output/_macro.njk +6 -6
- package/components/address-output/_macro.spec.js +122 -0
- package/components/autosuggest/_macro.njk +1 -1
- package/components/autosuggest/_macro.spec.js +229 -0
- package/components/autosuggest/autosuggest.helpers.js +2 -3
- package/components/autosuggest/autosuggest.helpers.spec.js +85 -0
- package/components/autosuggest/autosuggest.js +4 -2
- package/components/autosuggest/autosuggest.spec.js +625 -0
- package/components/autosuggest/autosuggest.ui.js +6 -2
- package/components/breadcrumbs/_macro.spec.js +129 -0
- package/components/button/_button.scss +75 -33
- package/components/button/_macro.njk +6 -6
- package/components/button/_macro.spec.js +446 -0
- package/components/button/button.spec.js +290 -0
- package/components/call-to-action/_macro.njk +3 -1
- package/components/call-to-action/_macro.spec.js +52 -0
- package/components/card/_macro.njk +26 -19
- package/components/card/_macro.spec.js +261 -0
- package/components/char-check-limit/_macro.spec.js +73 -0
- package/components/char-check-limit/character-check.spec.js +196 -0
- package/components/char-check-limit/character-limit.js +1 -1
- package/components/checkboxes/_checkbox-macro.spec.js +419 -0
- package/components/checkboxes/_macro.njk +1 -3
- package/components/checkboxes/_macro.spec.js +306 -0
- package/components/checkboxes/checkbox-with-autoselect.js +2 -1
- package/components/checkboxes/checkboxes.spec.js +208 -0
- package/components/code-highlight/_macro.spec.js +56 -0
- package/components/code-highlight/code-highlight.spec.js +18 -0
- package/components/collapsible/_macro.spec.js +204 -0
- package/components/collapsible/collapsible.js +2 -1
- package/components/collapsible/collapsible.spec.js +236 -0
- package/components/content-pagination/_macro.spec.js +199 -0
- package/components/cookies-banner/_macro.njk +1 -1
- package/components/cookies-banner/_macro.spec.js +171 -0
- package/components/cookies-banner/cookies-banner.spec.js +90 -0
- package/components/date-input/_macro.njk +6 -3
- package/components/date-input/_macro.spec.js +286 -0
- package/components/document-list/_macro.njk +3 -5
- package/components/document-list/_macro.spec.js +491 -0
- package/components/download-resources/download-resources.spec.js +540 -0
- package/components/duration/_macro.njk +7 -6
- package/components/duration/_macro.spec.js +251 -0
- package/components/error/_macro.spec.js +97 -0
- package/components/external-link/_macro.njk +5 -2
- package/components/external-link/_macro.spec.js +77 -0
- package/components/feedback/_macro.njk +5 -3
- package/components/feedback/_macro.spec.js +122 -0
- package/components/field/_macro.njk +2 -2
- package/components/field/_macro.spec.js +97 -0
- package/components/fieldset/_macro.njk +3 -3
- package/components/fieldset/_macro.spec.js +173 -0
- package/components/footer/_footer.scss +19 -4
- package/components/footer/_macro.njk +106 -137
- package/components/footer/_macro.spec.js +678 -0
- package/components/header/_header.scss +65 -46
- package/components/header/_macro.njk +173 -121
- package/components/header/_macro.spec.js +618 -0
- package/components/hero/_hero.scss +30 -143
- package/components/hero/_macro.njk +12 -23
- package/components/hero/_macro.spec.js +218 -0
- package/components/icons/_macro.njk +258 -30
- package/components/icons/_macro.spec.js +140 -0
- package/components/images/_macro.njk +1 -1
- package/components/images/_macro.spec.js +121 -0
- package/components/input/_input-type.scss +12 -5
- package/components/input/_input.scss +8 -0
- package/components/input/_macro.njk +4 -5
- package/components/input/_macro.spec.js +658 -0
- package/components/label/_macro.spec.js +189 -0
- package/components/language-selector/_macro.njk +1 -1
- package/components/language-selector/_macro.spec.js +137 -0
- package/components/lists/_list.scss +4 -0
- package/components/lists/_macro.njk +4 -7
- package/components/lists/_macro.spec.js +618 -0
- package/components/message/_macro.spec.js +137 -0
- package/components/message-list/_macro.njk +7 -7
- package/components/message-list/_macro.spec.js +159 -0
- package/components/metadata/_macro.spec.js +167 -0
- package/components/modal/_macro.njk +6 -6
- package/components/modal/_macro.spec.js +87 -0
- package/components/modal/modal.spec.js +59 -0
- package/components/mutually-exclusive/_macro.njk +2 -2
- package/components/mutually-exclusive/_macro.spec.js +184 -0
- package/components/mutually-exclusive/mutually-exclusive.checkboxes.spec.js +203 -0
- package/components/mutually-exclusive/mutually-exclusive.date.spec.js +142 -0
- package/components/mutually-exclusive/mutually-exclusive.duration.spec.js +141 -0
- package/components/mutually-exclusive/mutually-exclusive.email.spec.js +117 -0
- package/components/mutually-exclusive/mutually-exclusive.multiple-options.checkboxes.spec.js +213 -0
- package/components/mutually-exclusive/mutually-exclusive.number.spec.js +125 -0
- package/components/mutually-exclusive/mutually-exclusive.textarea.spec.js +131 -0
- package/components/navigation/_macro.njk +45 -38
- package/components/navigation/_macro.spec.js +329 -0
- package/components/navigation/_navigation.scss +20 -4
- package/components/navigation/navigation.dom.js +1 -1
- package/components/navigation/navigation.spec.js +232 -0
- package/components/pagination/_macro.njk +1 -1
- package/components/pagination/_macro.spec.js +411 -0
- package/components/panel/_macro.njk +6 -6
- package/components/panel/_macro.spec.js +423 -0
- package/components/password/_macro.spec.js +137 -0
- package/components/password/password.spec.js +40 -0
- package/components/phase-banner/_macro.spec.js +73 -0
- package/components/promotional-banner/_macro.spec.js +97 -0
- package/components/question/_macro.njk +16 -22
- package/components/question/_macro.spec.js +309 -0
- package/components/quote/_macro.spec.js +81 -0
- package/components/radios/_macro.njk +3 -6
- package/components/radios/_macro.spec.js +575 -0
- package/components/radios/radios.spec.js +180 -0
- package/components/related-content/_macro.njk +14 -21
- package/components/related-content/_macro.spec.js +133 -0
- package/components/related-content/_section-macro.njk +10 -0
- package/components/related-content/_section-macro.spec.js +43 -0
- package/components/relationships/_macro.spec.js +108 -0
- package/components/relationships/relationships.spec.js +84 -0
- package/components/reply/_macro.njk +2 -2
- package/components/reply/_macro.spec.js +69 -0
- package/components/reply/reply.spec.js +78 -0
- package/components/search/_macro.njk +14 -12
- package/components/search/_macro.spec.js +44 -0
- package/components/search/_search.scss +7 -7
- package/components/section-navigation/_macro.njk +7 -2
- package/components/section-navigation/_macro.spec.js +206 -0
- package/components/select/_macro.njk +3 -3
- package/components/select/_macro.spec.js +203 -0
- package/components/select/select.spec.js +56 -0
- package/components/share-page/_macro.njk +6 -4
- package/components/share-page/_macro.spec.js +110 -0
- package/components/skip-to-content/_macro.spec.js +57 -0
- package/components/skip-to-content/skip-to-content.spec.js +44 -0
- package/components/status/_macro.spec.js +77 -0
- package/components/summary/_macro.njk +5 -5
- package/components/summary/_macro.spec.js +472 -0
- package/components/table/_macro.njk +2 -2
- package/components/table/_macro.spec.js +557 -0
- package/components/table/table.spec.js +155 -0
- package/components/table-of-contents/_macro.njk +35 -35
- package/components/table-of-contents/_macro.spec.js +178 -0
- package/components/table-of-contents/toc.js +29 -25
- package/components/table-of-contents/toc.spec.js +61 -0
- package/components/tabs/_macro.njk +1 -1
- package/components/tabs/_macro.spec.js +79 -0
- package/components/tabs/tabs.spec.js +162 -0
- package/components/text-indent/_macro.spec.js +52 -0
- package/components/textarea/_macro.njk +5 -3
- package/components/textarea/_macro.spec.js +300 -0
- package/components/textarea/textarea.spec.js +98 -0
- package/components/timeline/_macro.njk +3 -3
- package/components/timeline/_macro.spec.js +81 -0
- package/components/timeout-modal/_macro.spec.js +68 -0
- package/components/timeout-modal/timeout-modal.spec.js +226 -0
- package/components/timeout-panel/_macro.njk +0 -1
- package/components/timeout-panel/_macro.spec.js +54 -0
- package/components/timeout-panel/timeout-panel.dom.js +1 -2
- package/components/timeout-panel/timeout-panel.spec.js +161 -0
- package/components/upload/_macro.spec.js +75 -0
- package/components/video/_macro.spec.js +34 -0
- package/css/census.css +3 -1
- package/css/ids.css +2 -0
- package/css/main.css +1 -1
- package/img/dummy-brand-logo.svg +1 -0
- package/js/cookies-settings.spec.js +154 -0
- package/layout/_template.njk +7 -4
- package/package.json +10 -23
- package/scripts/main.es5.js +2 -2
- package/scripts/main.js +1 -1
- package/scss/ids.scss +2 -0
- package/scss/settings/_census.scss +141 -0
- package/scss/settings/_ids.scss +48 -0
- package/scss/utilities/_margin.scss +1 -0
- package/scss/vars/_colors.scss +5 -2
|
@@ -6,21 +6,9 @@
|
|
|
6
6
|
margin: 0;
|
|
7
7
|
position: relative;
|
|
8
8
|
|
|
9
|
-
& &__title--svg-logo {
|
|
10
|
-
display: block;
|
|
11
|
-
fill: $color-white;
|
|
12
|
-
|
|
13
|
-
@include mq(m) {
|
|
14
|
-
margin: 0.84rem 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
@include mq(xxs, 399px) {
|
|
18
|
-
max-width: 160px;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
9
|
// Elements
|
|
22
10
|
&__top {
|
|
23
|
-
background: $color-header-
|
|
11
|
+
background: $color-header-masthead;
|
|
24
12
|
width: 100%;
|
|
25
13
|
}
|
|
26
14
|
&__grid-top {
|
|
@@ -56,20 +44,10 @@
|
|
|
56
44
|
margin-top: 0.8rem;
|
|
57
45
|
}
|
|
58
46
|
|
|
59
|
-
//to allow for differences in size between welsh and english logos
|
|
60
|
-
&-census-logo-en {
|
|
61
|
-
@include mq(xxs) {
|
|
62
|
-
margin: 0.19rem 0 0.2rem;
|
|
63
|
-
padding: 0.25rem 0;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
47
|
&-link {
|
|
67
48
|
display: block;
|
|
68
49
|
text-decoration: none;
|
|
69
50
|
&:focus {
|
|
70
|
-
.ons-header__title--svg-logo {
|
|
71
|
-
fill: $color-text-link-focus;
|
|
72
|
-
}
|
|
73
51
|
.ons-header__title {
|
|
74
52
|
color: $color-text-link-focus;
|
|
75
53
|
}
|
|
@@ -78,11 +56,6 @@
|
|
|
78
56
|
text-decoration: underline solid $color-text-inverse-link 2px;
|
|
79
57
|
}
|
|
80
58
|
}
|
|
81
|
-
&--nav-adj {
|
|
82
|
-
@include mq(399px) {
|
|
83
|
-
padding-top: 0.2rem;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
59
|
}
|
|
87
60
|
&__description {
|
|
88
61
|
@extend .ons-u-fs-s;
|
|
@@ -106,9 +79,11 @@
|
|
|
106
79
|
}
|
|
107
80
|
}
|
|
108
81
|
}
|
|
109
|
-
|
|
82
|
+
|
|
83
|
+
&--internal &,
|
|
84
|
+
&--neutral & {
|
|
110
85
|
&__top {
|
|
111
|
-
background: $color-header-
|
|
86
|
+
background: $color-header-masthead-internal;
|
|
112
87
|
.ons-svg-logo {
|
|
113
88
|
display: block;
|
|
114
89
|
.ons-svg-logo__group--text,
|
|
@@ -117,7 +92,7 @@
|
|
|
117
92
|
}
|
|
118
93
|
}
|
|
119
94
|
}
|
|
120
|
-
&
|
|
95
|
+
&__org-logo-link:focus {
|
|
121
96
|
background-color: transparent;
|
|
122
97
|
box-shadow: none;
|
|
123
98
|
outline: 3px solid $color-focus;
|
|
@@ -136,40 +111,72 @@
|
|
|
136
111
|
}
|
|
137
112
|
}
|
|
138
113
|
|
|
114
|
+
&--neutral & {
|
|
115
|
+
&__top {
|
|
116
|
+
background: $color-header-masthead-dark;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&__main {
|
|
120
|
+
background: $color-header-light;
|
|
121
|
+
|
|
122
|
+
&--border {
|
|
123
|
+
border-bottom: 3px solid $color-header-light;
|
|
124
|
+
border-top: 3px solid $color-header-light;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&__title {
|
|
129
|
+
color: $color-branded-text;
|
|
130
|
+
&-link {
|
|
131
|
+
&:hover {
|
|
132
|
+
text-decoration: underline solid $color-branded-text 2px;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
139
138
|
.ons-svg-logo {
|
|
140
139
|
display: block;
|
|
141
140
|
}
|
|
142
141
|
|
|
143
|
-
&
|
|
144
|
-
|
|
145
|
-
|
|
142
|
+
&__org-logo-link,
|
|
143
|
+
&__title-logo-link {
|
|
144
|
+
display: block;
|
|
145
|
+
&:focus {
|
|
146
|
+
.ons-svg-logo {
|
|
146
147
|
fill: $color-black !important;
|
|
148
|
+
.ons-svg-logo__group {
|
|
149
|
+
fill: $color-black !important;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
&:hover {
|
|
154
|
+
font-size: 0;
|
|
155
|
+
text-decoration: none;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&__title-logo--large {
|
|
160
|
+
.ons-svg-logo {
|
|
161
|
+
@include mq(xxs, 399px) {
|
|
162
|
+
height: auto;
|
|
163
|
+
max-width: 160px;
|
|
147
164
|
}
|
|
148
165
|
}
|
|
149
166
|
}
|
|
150
167
|
|
|
151
|
-
|
|
168
|
+
&__org-logo--large {
|
|
152
169
|
@include mq(xxs, 454px) {
|
|
153
170
|
display: none;
|
|
154
171
|
}
|
|
155
172
|
}
|
|
156
173
|
|
|
157
|
-
|
|
174
|
+
&__org-logo--small {
|
|
158
175
|
@include mq(455px) {
|
|
159
176
|
display: none;
|
|
160
177
|
}
|
|
161
178
|
}
|
|
162
179
|
|
|
163
|
-
&__logo-link,
|
|
164
|
-
&__logo-link:hover {
|
|
165
|
-
font-size: 0;
|
|
166
|
-
text-decoration: none;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
&__logo-link {
|
|
170
|
-
display: block;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
180
|
&-service-nav {
|
|
174
181
|
display: inline-block;
|
|
175
182
|
|
|
@@ -179,6 +186,12 @@
|
|
|
179
186
|
width: 100%;
|
|
180
187
|
}
|
|
181
188
|
|
|
189
|
+
.ons-header--neutral & {
|
|
190
|
+
&--mobile {
|
|
191
|
+
background: $color-grey-5;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
182
195
|
&__list {
|
|
183
196
|
list-style: none;
|
|
184
197
|
margin: 0;
|
|
@@ -207,4 +220,10 @@
|
|
|
207
220
|
}
|
|
208
221
|
}
|
|
209
222
|
}
|
|
223
|
+
&__lang-adjustment {
|
|
224
|
+
@include mq(l) {
|
|
225
|
+
margin-right: 21rem;
|
|
226
|
+
margin-top: -5px !important;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
210
229
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
{% from "components/icons/_macro.njk" import onsIcon %}
|
|
4
4
|
{% from "components/navigation/_macro.njk" import onsNavigation %}
|
|
5
5
|
|
|
6
|
-
{% set title_tag = "h1" if params.
|
|
6
|
+
{% set title_tag = "h1" if params.titleAsH1 else "div" %}
|
|
7
7
|
{% set currentLanguageISOCode = "en" %}
|
|
8
8
|
|
|
9
9
|
{% if params.language is defined and params.language and params.language.languages is defined and params.language.languages %}
|
|
@@ -11,145 +11,179 @@
|
|
|
11
11
|
{% set currentLanguageISOCode = currentLanguage.ISOCode %}
|
|
12
12
|
{% endif %}
|
|
13
13
|
|
|
14
|
-
<header class="ons-header {% if params.variants is not string %}{% for variant in params.variants %} ons-header--{{ variant }}{% endfor %}{% else %} ons-header--{{ params.variants }}{% endif %}" role="banner">
|
|
14
|
+
<header class="ons-header {% if params.classes is defined and params.classes %} {{ params.classes }}{% endif %}{% if params.variants is not string %}{% for variant in params.variants %} ons-header--{{ variant }}{% endfor %}{% else %} ons-header--{{ params.variants }}{% endif %}" role="banner">
|
|
15
15
|
{% if params.phase is defined and params.phase %}
|
|
16
16
|
{% from "components/phase-banner/_macro.njk" import onsPhaseBanner %}
|
|
17
17
|
{{ onsPhaseBanner(params.phase) }}
|
|
18
18
|
{% endif %}
|
|
19
|
-
|
|
20
|
-
<div class="ons-
|
|
21
|
-
<div class="ons-
|
|
22
|
-
<div class="ons-
|
|
23
|
-
<div class="ons-
|
|
24
|
-
{%-if params.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
{% if params.language is defined and params.language %}
|
|
47
|
-
<div class="ons-grid__col ons-col-auto {{ ' ons-u-mr-s ons-u-d-no@xxs@xs' if params.serviceLinks is defined and params.serviceLinks else '' }}">
|
|
48
|
-
{% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
|
|
49
|
-
{{ onsLanguageSelector(params.language) }}
|
|
50
|
-
</div>
|
|
19
|
+
{% if params.noMasthead != true %}
|
|
20
|
+
<div class="ons-header__top">
|
|
21
|
+
<div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
|
|
22
|
+
<div class="ons-header__grid-top ons-grid ons-grid--gutterless ons-grid--flex ons-grid--between ons-grid--vertical-center ons-grid--no-wrap{{ ' ons-header__grid-top-tall' if params.customHeaderLogo is defined and params.customHeaderLogo }}">
|
|
23
|
+
<div class="ons-grid__col ons-col-auto">
|
|
24
|
+
{%-if params.orgLogoHref is defined and params.orgLogoHref %}
|
|
25
|
+
<a class="ons-header__org-logo-link" href="{{ params.orgLogoHref }}">
|
|
26
|
+
{% endif -%}
|
|
27
|
+
<div class="ons-header__org-logo ons-header__org-logo--large">
|
|
28
|
+
|
|
29
|
+
{{
|
|
30
|
+
onsIcon({
|
|
31
|
+
"iconType": params.orgLogo | default('ons-logo-' + currentLanguageISOCode),
|
|
32
|
+
"altText": params.orgLogoAlt | default('Office for National Statistics logo')
|
|
33
|
+
})
|
|
34
|
+
}}
|
|
35
|
+
</div>
|
|
36
|
+
<div class="ons-header__org-logo ons-header__org-logo--small">
|
|
37
|
+
{{
|
|
38
|
+
onsIcon({
|
|
39
|
+
"iconType": params.orgMobileLogo | default('ons-logo-stacked-' + currentLanguageISOCode),
|
|
40
|
+
"altText": params.orgLogoAlt | default('Office for National Statistics logo')
|
|
41
|
+
})
|
|
42
|
+
}}
|
|
43
|
+
</div>
|
|
44
|
+
{% if params.orgLogoHref is defined and params.orgLogoHref %}
|
|
45
|
+
</a>
|
|
51
46
|
{% endif %}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{% set controlVisibility = false %}
|
|
47
|
+
</div>
|
|
48
|
+
{% if params.language is defined and params.language or params.serviceLinks is defined and params.serviceLinks %}
|
|
49
|
+
<div class="ons-header__links ons-grid__col ons-col-auto">
|
|
50
|
+
{% if params.language is defined and params.language %}
|
|
51
|
+
<div class="ons-grid__col ons-col-auto {{ ' ons-u-mr-s ons-u-d-no@xxs@xs' if params.serviceLinks is defined and params.serviceLinks else '' }}">
|
|
52
|
+
{% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
|
|
53
|
+
{{ onsLanguageSelector(params.language) }}
|
|
54
|
+
</div>
|
|
61
55
|
{% endif %}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
class="ons-header-service-nav__link"
|
|
70
|
-
{% if item.id is defined and item.id %} id="{{ item.id }}"{% endif %}
|
|
71
|
-
>{{ item.title }}</a>
|
|
72
|
-
</li>
|
|
73
|
-
{% endfor %}
|
|
74
|
-
</ul>
|
|
75
|
-
</nav>
|
|
76
|
-
</div>
|
|
77
|
-
{% if params.serviceLinks.itemsList | length > 1 or params.language is defined and params.language %}
|
|
78
|
-
{% if params.variants == 'internal' %}
|
|
79
|
-
{% set buttonVariant = ["text-link", "text-link-inverse"] %}
|
|
56
|
+
{% if params.serviceLinks is defined and params.serviceLinks %}
|
|
57
|
+
{% if params.serviceLinks.itemsList | length == 1 and params.language is defined and params.language %}
|
|
58
|
+
{% set breakpoint = 'xs' %}
|
|
59
|
+
{% set controlVisibility = true %}
|
|
60
|
+
{% elif params.serviceLinks.itemsList | length > 1 %}
|
|
61
|
+
{% set breakpoint = 'm' %}
|
|
62
|
+
{% set controlVisibility = true %}
|
|
80
63
|
{% else %}
|
|
81
|
-
{% set
|
|
64
|
+
{% set controlVisibility = false %}
|
|
82
65
|
{% endif %}
|
|
83
|
-
<div class="ons-grid__col ons-col-auto ons-u-d-no@{{ breakpoint }}">
|
|
84
|
-
{{
|
|
85
|
-
"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
66
|
+
<div class="ons-grid__col ons-col-auto{% if controlVisibility == true %} ons-u-d-no@xxs@{{ breakpoint }}{% endif %}">
|
|
67
|
+
<nav class="ons-header-service-nav ons-header-service-nav--main {{ params.serviceLinks.classes }}" aria-label="{{ params.serviceLinks.ariaLabel | default("Service links navigation") }}">
|
|
68
|
+
<ul class="ons-header-service-nav__list" aria-label="{{ params.serviceLinks.ariaListLabel | default("Service Links") }}">
|
|
69
|
+
{% for item in (params.serviceLinks.itemsList if params.serviceLinks.itemsList is iterable else params.serviceLinks.itemsList.items()) %}
|
|
70
|
+
<li class="ons-header-service-nav__item">
|
|
71
|
+
<a
|
|
72
|
+
href="{{ item.url }}"
|
|
73
|
+
class="ons-header-service-nav__link"
|
|
74
|
+
{% if item.id is defined and item.id %} id="{{ item.id }}"{% endif %}
|
|
75
|
+
>{{ item.title }}</a>
|
|
76
|
+
</li>
|
|
77
|
+
{% endfor %}
|
|
78
|
+
</ul>
|
|
79
|
+
</nav>
|
|
97
80
|
</div>
|
|
81
|
+
{% if params.serviceLinks.itemsList | length > 1 or params.language is defined and params.language %}
|
|
82
|
+
{% if params.variants == 'internal' or params.variants == 'neutral' %}
|
|
83
|
+
{% set buttonVariant = ["text-link", "text-link-inverse"] %}
|
|
84
|
+
{% else %}
|
|
85
|
+
{% set buttonVariant = "text-link" %}
|
|
86
|
+
{% endif %}
|
|
87
|
+
<div class="ons-grid__col ons-col-auto ons-u-d-no@{{ breakpoint }}">
|
|
88
|
+
{{ onsButton({
|
|
89
|
+
"text": params.serviceLinks.toggleServicesButton.text | default("Account"),
|
|
90
|
+
"classes": "ons-u-d-no ons-js-toggle-services",
|
|
91
|
+
"type": "button",
|
|
92
|
+
"buttonStyle": "mobile",
|
|
93
|
+
"variants": buttonVariant,
|
|
94
|
+
"attributes": {
|
|
95
|
+
"aria-label": params.serviceLinks.toggleServicesButton.ariaLabel | default("Toggle menu"),
|
|
96
|
+
"aria-controls": params.serviceLinks.id,
|
|
97
|
+
"aria-haspopup": "true",
|
|
98
|
+
"aria-expanded": "false"
|
|
99
|
+
}
|
|
100
|
+
}) }}
|
|
101
|
+
</div>
|
|
102
|
+
{% endif %}
|
|
98
103
|
{% endif %}
|
|
99
|
-
{% endif %}
|
|
100
|
-
</div>
|
|
101
|
-
{% endif %}
|
|
102
|
-
</div>
|
|
103
|
-
</div>
|
|
104
|
-
{% if params.serviceLinks is defined and params.serviceLinks %}
|
|
105
|
-
<nav class="ons-header-service-nav ons-header-service-nav--mobile ons-u-d-no ons-js-services-mobile-nav" id="{{ params.serviceLinks.id }}" aria-label="{{ params.serviceLinks.ariaLabel | default("Service links navigation") }}">
|
|
106
|
-
<ul class="ons-header-service-nav__list" aria-label="{{ params.serviceLinks.ariaListLabel | default("Service Links") }}">
|
|
107
|
-
{% for item in (params.serviceLinks.itemsList if params.serviceLinks.itemsList is iterable else params.serviceLinks.itemsList.items()) %}
|
|
108
|
-
<li class="ons-header-service-nav__item ons-header-service-nav__item--mobile">
|
|
109
|
-
<a
|
|
110
|
-
href="{{ item.url }}"
|
|
111
|
-
class="ons-header-service-nav__link"
|
|
112
|
-
{% if item.id is defined and item.id %} id="{{ item.id }}"{% endif %}
|
|
113
|
-
>{{ item.title }}</a>
|
|
114
|
-
</li>
|
|
115
|
-
{% endfor %}
|
|
116
|
-
{% if params.language is defined and params.language %}
|
|
117
|
-
<div class="ons-u-d-no@xs">
|
|
118
|
-
{% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
|
|
119
|
-
{{ onsLanguageSelector(params.language) }}
|
|
120
104
|
</div>
|
|
121
105
|
{% endif %}
|
|
122
|
-
</
|
|
123
|
-
</
|
|
124
|
-
|
|
125
|
-
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
{% if params.serviceLinks is defined and params.serviceLinks %}
|
|
109
|
+
<nav class="ons-header-service-nav ons-header-service-nav--mobile ons-u-d-no ons-js-services-mobile-nav" id="{{ params.serviceLinks.id }}" aria-label="{{ params.serviceLinks.ariaLabel | default("Service links navigation") }}">
|
|
110
|
+
<ul class="ons-header-service-nav__list" aria-label="{{ params.serviceLinks.ariaListLabel | default("Service Links") }}">
|
|
111
|
+
{% for item in (params.serviceLinks.itemsList if params.serviceLinks.itemsList is iterable else params.serviceLinks.itemsList.items()) %}
|
|
112
|
+
<li class="ons-header-service-nav__item ons-header-service-nav__item--mobile">
|
|
113
|
+
<a
|
|
114
|
+
href="{{ item.url }}"
|
|
115
|
+
class="ons-header-service-nav__link"
|
|
116
|
+
{% if item.id is defined and item.id %} id="{{ item.id }}"{% endif %}
|
|
117
|
+
>{{ item.title }}</a>
|
|
118
|
+
</li>
|
|
119
|
+
{% endfor %}
|
|
120
|
+
{% if params.language is defined and params.language %}
|
|
121
|
+
<div class="ons-u-d-no@xs">
|
|
122
|
+
{% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
|
|
123
|
+
{{ onsLanguageSelector(params.language) }}
|
|
124
|
+
</div>
|
|
125
|
+
{% endif %}
|
|
126
|
+
</ul>
|
|
127
|
+
</nav>
|
|
128
|
+
{% endif %}
|
|
129
|
+
</div>
|
|
130
|
+
{% endif %}
|
|
126
131
|
<div class="ons-header__main">
|
|
127
132
|
<div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
|
|
128
133
|
<div class="ons-grid ons-grid--gutterless ons-grid--flex ons-grid--between ons-grid--vertical-center ons-grid--no-wrap">
|
|
129
|
-
<div class="ons-grid__col ons-col-auto ons-u-flex-shrink
|
|
130
|
-
{% if params.titleLogoHref is defined and params.titleLogoHref %}<a class="ons-header__title-link" href="{{ params.titleLogoHref }}">{% endif %}
|
|
134
|
+
<div class="ons-grid__col ons-col-auto ons-u-flex-shrink">
|
|
131
135
|
{% if params.titleLogo is defined and params.titleLogo and params.titleLogoAlt is defined and params.titleLogoAlt %}
|
|
132
|
-
{%
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
{% if params.titleLogoHref is defined and params.titleLogoHref %}
|
|
137
|
+
<a class="ons-header__title-logo-link" href="{{ params.titleLogoHref }}">
|
|
138
|
+
{% endif %}
|
|
139
|
+
<div class="ons-header__title-logo ons-header__title-logo--large {% if params.titleLogoClasses %} {{ params.titleLogoClasses }} {% endif %}{% if params.titleLogoMobile is defined and params.titleLogoMobile %}ons-u-d-no@xxs@s{% endif %}">
|
|
140
|
+
{% from "components/icons/_macro.njk" import onsIcon %}
|
|
141
|
+
{{
|
|
142
|
+
onsIcon({
|
|
143
|
+
"iconType": params.titleLogo,
|
|
144
|
+
"altText": params.titleLogoAlt
|
|
145
|
+
})
|
|
146
|
+
}}
|
|
147
|
+
</div>
|
|
148
|
+
{% if params.titleLogoMobile is defined and params.titleLogoMobile %}
|
|
149
|
+
<div class="ons-header__title-logo ons-header__title-logo--mobile ons-u-d-no@s{% if params.titleLogoMobileClasses %} {{ params.titleLogoMobileClasses }}{% endif %}">
|
|
150
|
+
{% from "components/icons/_macro.njk" import onsIcon %}
|
|
151
|
+
{{
|
|
152
|
+
onsIcon({
|
|
153
|
+
"iconType": params.titleLogoMobile,
|
|
154
|
+
"altText": params.titleLogoAlt
|
|
155
|
+
})
|
|
156
|
+
}}
|
|
157
|
+
</div>
|
|
158
|
+
{% endif %}
|
|
159
|
+
{% if params.titleLogoHref is defined and params.titleLogoHref %}
|
|
160
|
+
</a>
|
|
161
|
+
{% endif %}
|
|
139
162
|
{% else %}
|
|
140
|
-
|
|
163
|
+
{% if params.titleLogoHref is defined and params.titleLogoHref %}
|
|
164
|
+
<a class="ons-header__title-link" href="{{ params.titleLogoHref }}">
|
|
165
|
+
{% endif %}
|
|
166
|
+
<{{ title_tag }} class="ons-header__title">{{ params.title }}</{{ title_tag }}>
|
|
167
|
+
{% if params.titleLogoHref is defined and params.titleLogoHref %}
|
|
168
|
+
</a>
|
|
169
|
+
{% endif %}
|
|
141
170
|
{% endif %}
|
|
142
|
-
{% if params.titleLogoHref is defined and params.titleLogoHref %}</a>{% endif %}
|
|
143
171
|
{% if params.description is defined and params.description %}
|
|
144
172
|
<p class="ons-header__description">{{ params.description }}</p>
|
|
145
173
|
{% endif %}
|
|
146
174
|
</div>
|
|
175
|
+
|
|
147
176
|
{% if params.button is defined and params.button %}
|
|
177
|
+
{% if params.variants == 'neutral' %}
|
|
178
|
+
{% set buttonVariant = ["ghost", "ghost-dark"] %}
|
|
179
|
+
{% else %}
|
|
180
|
+
{% set buttonVariant = "ghost" %}
|
|
181
|
+
{% endif %}
|
|
148
182
|
<div class="ons-grid__col ons-col-auto ons-u-flex-no-shrink">
|
|
149
183
|
{{ onsButton({
|
|
150
184
|
"text": params.button.text,
|
|
151
|
-
"classes": "ons-u-d-no@xxs@m",
|
|
152
|
-
"variants":
|
|
185
|
+
"classes": "ons-u-d-no@xxs@l" if params.navigation else "ons-u-d-no@xxs@m",
|
|
186
|
+
"variants": buttonVariant,
|
|
153
187
|
"name": params.button.name,
|
|
154
188
|
"attributes": params.button.attributes,
|
|
155
189
|
"url": params.button.url,
|
|
@@ -159,13 +193,26 @@
|
|
|
159
193
|
</div>
|
|
160
194
|
{% endif %}
|
|
161
195
|
{% if params.navigation is defined %}
|
|
162
|
-
<div class="ons-grid__col ons-col-auto ons-u-flex-no-shrink
|
|
163
|
-
{% if
|
|
164
|
-
|
|
196
|
+
<div class="ons-grid__col ons-col-auto ons-u-flex-no-shrink">
|
|
197
|
+
{% if params.noMasthead == true %}
|
|
198
|
+
{% if params.language is defined and params.language %}
|
|
199
|
+
<div class="ons-grid__col ons-col-auto ons-u-mt-xxs@xxs@l ons-u-mr-xs@xxs@s {% if params.navigation.siteSearchAutosuggest %}ons-header__lang-adjustment{% endif %}">
|
|
200
|
+
{% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
|
|
201
|
+
{{ onsLanguageSelector(params.language) }}
|
|
202
|
+
</div>
|
|
203
|
+
{% endif %}
|
|
204
|
+
{% endif %}
|
|
205
|
+
{% if params.navigation.siteSearchAutosuggest %}
|
|
206
|
+
{% if params.variants == 'neutral' %}
|
|
207
|
+
{% set buttonVariant = ["small", "ghost", "ghost-dark"] %}
|
|
208
|
+
{% else %}
|
|
209
|
+
{% set buttonVariant = ["small", "ghost"] %}
|
|
210
|
+
{% endif %}
|
|
211
|
+
<span class="ons-grid ons-u-d-no@xxs@xs ons-u-ml-no ons-u-d-no@l">
|
|
165
212
|
{{ onsButton({
|
|
166
213
|
"text": "Search",
|
|
167
214
|
"classes": "ons-btn--search ons-u-ml-xs ons-u-d-no ons-js-toggle-search",
|
|
168
|
-
"variants":
|
|
215
|
+
"variants": buttonVariant,
|
|
169
216
|
"iconType": "search",
|
|
170
217
|
"iconPosition": "only",
|
|
171
218
|
"attributes": {
|
|
@@ -178,11 +225,16 @@
|
|
|
178
225
|
</span>
|
|
179
226
|
{% endif %}
|
|
180
227
|
{% if params.navigation.toggleNavigationButton is defined and params.navigation.toggleNavigationButton %}
|
|
228
|
+
{% if params.variants == 'neutral' %}
|
|
229
|
+
{% set buttonVariant = ["mobile", "ghost-dark"] %}
|
|
230
|
+
{% else %}
|
|
231
|
+
{% set buttonVariant = ["mobile", "ghost"] %}
|
|
232
|
+
{% endif %}
|
|
181
233
|
{{ onsButton({
|
|
182
234
|
"text": params.navigation.toggleNavigationButton.text,
|
|
183
|
-
"classes": "ons-u-ml-xs ons-u-d-no ons-js-navigation-button",
|
|
235
|
+
"classes": "ons-u-ml-xs ons-u-d-no ons-js-navigation-button ons-u-d-no@l",
|
|
184
236
|
"buttonStyle": "mobile",
|
|
185
|
-
"variants":
|
|
237
|
+
"variants": buttonVariant,
|
|
186
238
|
"attributes": {
|
|
187
239
|
"aria-label": params.navigation.toggleNavigationButton.ariaLabel | default("Toggle main menu") ,
|
|
188
240
|
"aria-controls": params.navigation.id,
|
|
@@ -197,7 +249,7 @@
|
|
|
197
249
|
</div>
|
|
198
250
|
</div>
|
|
199
251
|
{% if params.navigation is defined and params.navigation %}
|
|
200
|
-
{{ onsNavigation(params
|
|
252
|
+
{{ onsNavigation(params) }}
|
|
201
253
|
{% endif %}
|
|
202
254
|
</header>
|
|
203
255
|
{% endmacro %}
|