@ons/design-system 47.0.0 → 48.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/components/button/_button.scss +76 -2
- package/components/error/_macro.njk +0 -1
- package/components/header/_header-nav.scss +22 -1
- package/components/header/_header.scss +12 -20
- package/components/header/_macro.njk +65 -16
- package/components/header/header-nav.dom.js +9 -0
- package/components/header/header-nav.js +5 -2
- package/components/lists/_macro.njk +13 -15
- package/components/panel/_macro.njk +3 -8
- package/components/panel/_panel.scss +5 -3
- package/css/census.css +1 -1
- package/css/main.css +1 -1
- package/package.json +1 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/objects/_spacing.scss +1 -0
|
@@ -209,6 +209,76 @@ $button-shadow-size: 3px;
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
+
&--text-link {
|
|
213
|
+
vertical-align: baseline;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
&--text-link & {
|
|
217
|
+
&__inner {
|
|
218
|
+
background: transparent;
|
|
219
|
+
border: none;
|
|
220
|
+
border-radius: 0;
|
|
221
|
+
box-shadow: none;
|
|
222
|
+
color: $color-text-link;
|
|
223
|
+
font-weight: normal;
|
|
224
|
+
padding: 0;
|
|
225
|
+
.ons-svg-icon {
|
|
226
|
+
fill: $color-text-link;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
&--text-link-inverse & {
|
|
232
|
+
&__inner {
|
|
233
|
+
color: $color-white;
|
|
234
|
+
.ons-svg-icon {
|
|
235
|
+
fill: $color-white;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
&--text-link:hover &,
|
|
241
|
+
&--text-link:active &,
|
|
242
|
+
&--text-link.active & {
|
|
243
|
+
&__inner {
|
|
244
|
+
background: none;
|
|
245
|
+
color: $color-text-link-hover;
|
|
246
|
+
.ons-svg-icon {
|
|
247
|
+
fill: $color-text-link-hover;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
&--text-link-inverse:hover &,
|
|
253
|
+
&--text-link-inverse:active &,
|
|
254
|
+
&--text-link-inverse.active & {
|
|
255
|
+
&__inner {
|
|
256
|
+
color: $color-branded-tint;
|
|
257
|
+
.ons-svg-icon {
|
|
258
|
+
fill: $color-branded-tint;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
&--text-link:focus:hover & {
|
|
264
|
+
&__inner {
|
|
265
|
+
color: $color-black;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
&--text-link:focus &,
|
|
270
|
+
&--text-link.active:focus &,
|
|
271
|
+
&--text-link:active:focus & {
|
|
272
|
+
&__inner {
|
|
273
|
+
background-color: $color-focus;
|
|
274
|
+
box-shadow: 0 -2px $color-focus, 0 4px $color-text-link-focus !important;
|
|
275
|
+
color: $color-text-link-focus;
|
|
276
|
+
.ons-svg-icon {
|
|
277
|
+
fill: $color-text-link-focus;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
212
282
|
&--ghost &,
|
|
213
283
|
&--mobile & {
|
|
214
284
|
&__inner {
|
|
@@ -232,6 +302,7 @@ $button-shadow-size: 3px;
|
|
|
232
302
|
}
|
|
233
303
|
|
|
234
304
|
&--ghost,
|
|
305
|
+
&--text-link,
|
|
235
306
|
&--mobile {
|
|
236
307
|
&:active,
|
|
237
308
|
.active {
|
|
@@ -245,6 +316,7 @@ $button-shadow-size: 3px;
|
|
|
245
316
|
}
|
|
246
317
|
|
|
247
318
|
&--ghost:focus:hover,
|
|
319
|
+
&--text-link:focus:hover,
|
|
248
320
|
&--mobile:focus:hover {
|
|
249
321
|
outline: none;
|
|
250
322
|
}
|
|
@@ -294,13 +366,15 @@ $button-shadow-size: 3px;
|
|
|
294
366
|
}
|
|
295
367
|
}
|
|
296
368
|
|
|
297
|
-
&--mobile[aria-expanded='true']
|
|
369
|
+
&--mobile[aria-expanded='true'],
|
|
370
|
+
&--text-link[aria-expanded='true'] {
|
|
298
371
|
.ons-svg-icon {
|
|
299
372
|
transform: rotate(270deg);
|
|
300
373
|
}
|
|
301
374
|
}
|
|
302
375
|
|
|
303
|
-
&--mobile
|
|
376
|
+
&--mobile,
|
|
377
|
+
&--text-link {
|
|
304
378
|
.ons-svg-icon {
|
|
305
379
|
transform: rotate(90deg);
|
|
306
380
|
}
|
|
@@ -70,6 +70,14 @@
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
.ons-header-service-nav {
|
|
73
|
+
display: inline-block;
|
|
74
|
+
|
|
75
|
+
&--mobile {
|
|
76
|
+
background: $color-branded-tint;
|
|
77
|
+
padding: 1rem;
|
|
78
|
+
width: 100%;
|
|
79
|
+
}
|
|
80
|
+
|
|
73
81
|
&__list {
|
|
74
82
|
list-style: none;
|
|
75
83
|
margin: 0;
|
|
@@ -79,9 +87,22 @@
|
|
|
79
87
|
&__item {
|
|
80
88
|
display: inline-block;
|
|
81
89
|
margin: 0 0 0 1rem;
|
|
82
|
-
|
|
90
|
+
&--mobile {
|
|
91
|
+
display: block;
|
|
92
|
+
margin: 0 0 0.5rem;
|
|
93
|
+
}
|
|
83
94
|
&:first-child {
|
|
84
95
|
margin-left: 0;
|
|
85
96
|
}
|
|
86
97
|
}
|
|
98
|
+
|
|
99
|
+
.ons-language-links {
|
|
100
|
+
border-top: 1px solid $color-branded;
|
|
101
|
+
margin: 1.5rem 0 0;
|
|
102
|
+
padding: 1rem 0 0;
|
|
103
|
+
|
|
104
|
+
&__item {
|
|
105
|
+
margin: 0 0 0.5rem;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
87
108
|
}
|
|
@@ -44,9 +44,6 @@
|
|
|
44
44
|
border-top: 3px solid $color-header;
|
|
45
45
|
padding: 0.934rem 0;
|
|
46
46
|
}
|
|
47
|
-
&--with-description {
|
|
48
|
-
height: auto;
|
|
49
|
-
}
|
|
50
47
|
}
|
|
51
48
|
&__title {
|
|
52
49
|
@extend .ons-u-fs-r--b;
|
|
@@ -59,13 +56,6 @@
|
|
|
59
56
|
margin-top: 0.8rem;
|
|
60
57
|
}
|
|
61
58
|
|
|
62
|
-
&--with-description {
|
|
63
|
-
@include mq(m) {
|
|
64
|
-
margin-bottom: 0;
|
|
65
|
-
margin-top: 0.5rem;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
59
|
//to allow for differences in size between welsh and english logos
|
|
70
60
|
&-census-logo-en {
|
|
71
61
|
@include mq(xxs) {
|
|
@@ -94,7 +84,7 @@
|
|
|
94
84
|
}
|
|
95
85
|
}
|
|
96
86
|
}
|
|
97
|
-
&
|
|
87
|
+
&__description {
|
|
98
88
|
@extend .ons-u-fs-s;
|
|
99
89
|
@extend .ons-u-fs-r\@s;
|
|
100
90
|
|
|
@@ -105,12 +95,14 @@
|
|
|
105
95
|
margin: 0 0 1.1rem;
|
|
106
96
|
}
|
|
107
97
|
}
|
|
108
|
-
// Modifier -
|
|
109
|
-
&--
|
|
98
|
+
// Modifier - variants
|
|
99
|
+
&--description {
|
|
110
100
|
.ons-header {
|
|
111
101
|
&__title {
|
|
112
102
|
@extend .ons-u-fs-m;
|
|
113
103
|
@extend .ons-u-fs-xxl\@m;
|
|
104
|
+
|
|
105
|
+
margin-bottom: 0;
|
|
114
106
|
}
|
|
115
107
|
}
|
|
116
108
|
}
|
|
@@ -135,11 +127,11 @@
|
|
|
135
127
|
}
|
|
136
128
|
&__grid-top {
|
|
137
129
|
min-height: 36px;
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
130
|
+
a {
|
|
131
|
+
color: $color-white;
|
|
132
|
+
&:hover {
|
|
133
|
+
text-decoration: underline solid $color-white 3px;
|
|
134
|
+
}
|
|
143
135
|
}
|
|
144
136
|
}
|
|
145
137
|
}
|
|
@@ -157,13 +149,13 @@
|
|
|
157
149
|
}
|
|
158
150
|
|
|
159
151
|
.ons-header__logo--large {
|
|
160
|
-
@include mq(xxs,
|
|
152
|
+
@include mq(xxs, 454px) {
|
|
161
153
|
display: none;
|
|
162
154
|
}
|
|
163
155
|
}
|
|
164
156
|
|
|
165
157
|
.ons-header__logo--small {
|
|
166
|
-
@include mq(
|
|
158
|
+
@include mq(455px) {
|
|
167
159
|
display: none;
|
|
168
160
|
}
|
|
169
161
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
{% set currentLanguageISOCode = currentLanguage.ISOCode %}
|
|
12
12
|
{% endif %}
|
|
13
13
|
|
|
14
|
-
<header class="ons-header {{ params.
|
|
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">
|
|
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) }}
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
<div class="ons-header__top">
|
|
20
20
|
<div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
|
|
21
21
|
<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 }}">
|
|
22
|
-
|
|
23
22
|
<div class="ons-grid__col ons-col-auto">
|
|
24
23
|
<div class="ons-header__logo--large">
|
|
25
24
|
{%-if params.logoHref is defined and params.logoHref %}<a class="ons-header__logo-link" href="{{ params.logoHref }}">{% endif -%}
|
|
@@ -42,20 +41,28 @@
|
|
|
42
41
|
{% if params.logoHref is defined and params.logoHref %}</a>{% endif %}
|
|
43
42
|
</div>
|
|
44
43
|
</div>
|
|
45
|
-
|
|
46
44
|
{% if params.language is defined and params.language or params.serviceLinks is defined and params.serviceLinks %}
|
|
47
45
|
<div class="ons-header__links ons-grid__col ons-col-auto">
|
|
48
46
|
{% if params.language is defined and params.language %}
|
|
49
|
-
<div class="ons-grid__col ons-col-auto">
|
|
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 '' }}">
|
|
50
48
|
{% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
|
|
51
49
|
{{ onsLanguageSelector(params.language) }}
|
|
52
50
|
</div>
|
|
53
51
|
{% endif %}
|
|
54
52
|
{% if params.serviceLinks is defined and params.serviceLinks %}
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
{% if params.serviceLinks.itemsList | length == 1 and params.language is defined and params.language %}
|
|
54
|
+
{% set breakpoint = 'xs' %}
|
|
55
|
+
{% set controlVisibility = true %}
|
|
56
|
+
{% elif params.serviceLinks.itemsList | length > 1 %}
|
|
57
|
+
{% set breakpoint = 'm' %}
|
|
58
|
+
{% set controlVisibility = true %}
|
|
59
|
+
{% else %}
|
|
60
|
+
{% set controlVisibility = false %}
|
|
61
|
+
{% endif %}
|
|
62
|
+
<div class="ons-grid__col ons-col-auto{% if controlVisibility == true %} ons-u-d-no@xxs@{{ breakpoint }}{% endif %}">
|
|
63
|
+
<nav class="ons-header-service-nav ons{{ params.serviceLinks.classes }}" aria-label="{{ params.serviceLinks.ariaLabel | default("Service links navigation") }}">
|
|
57
64
|
<ul class="ons-header-service-nav__list" aria-label="{{ params.serviceLinks.ariaListLabel | default("Service Links") }}">
|
|
58
|
-
{% for item in (params.serviceLinks.itemsList if params.serviceLinks.itemsList is iterable else params.serviceLinks.itemsList.items()) %}
|
|
65
|
+
{% for item in (params.serviceLinks.itemsList if params.serviceLinks.itemsList is iterable else params.serviceLinks.itemsList.items()) %}
|
|
59
66
|
<li class="ons-header-service-nav__item">
|
|
60
67
|
<a
|
|
61
68
|
href="{{ item.url }}"
|
|
@@ -67,13 +74,55 @@
|
|
|
67
74
|
</ul>
|
|
68
75
|
</nav>
|
|
69
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"] %}
|
|
80
|
+
{% else %}
|
|
81
|
+
{% set buttonVariant = "text-link" %}
|
|
82
|
+
{% endif %}
|
|
83
|
+
<div class="ons-grid__col ons-col-auto ons-u-d-no@{{ breakpoint }}">
|
|
84
|
+
{{ onsButton({
|
|
85
|
+
"text": params.serviceLinks.toggleServicesButton.text | default("Menu") ,
|
|
86
|
+
"classes": "ons-u-d-no ons-js-toggle-services",
|
|
87
|
+
"buttonStyle": "mobile",
|
|
88
|
+
"variants": buttonVariant,
|
|
89
|
+
"attributes": {
|
|
90
|
+
"aria-label": params.serviceLinks.toggleServicesButton.ariaLabel | default("Toggle menu") ,
|
|
91
|
+
"aria-controls": params.serviceLinks.id,
|
|
92
|
+
"aria-haspopup": "true",
|
|
93
|
+
"aria-expanded": "false"
|
|
94
|
+
}
|
|
95
|
+
}) }}
|
|
96
|
+
</div>
|
|
97
|
+
{% endif %}
|
|
70
98
|
{% endif %}
|
|
71
99
|
</div>
|
|
72
100
|
{% endif %}
|
|
73
101
|
</div>
|
|
74
102
|
</div>
|
|
103
|
+
{% if params.serviceLinks is defined and params.serviceLinks %}
|
|
104
|
+
<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") }}">
|
|
105
|
+
<ul class="ons-header-service-nav__list" aria-label="{{ params.serviceLinks.ariaListLabel | default("Service Links") }}">
|
|
106
|
+
{% for item in (params.serviceLinks.itemsList if params.serviceLinks.itemsList is iterable else params.serviceLinks.itemsList.items()) %}
|
|
107
|
+
<li class="ons-header-service-nav__item ons-header-service-nav__item--mobile">
|
|
108
|
+
<a
|
|
109
|
+
href="{{ item.url }}"
|
|
110
|
+
class="ons-header-service-nav__link"
|
|
111
|
+
{% if item.id is defined and item.id %} id="{{ item.id }}"{% endif %}
|
|
112
|
+
>{{ item.title }}</a>
|
|
113
|
+
</li>
|
|
114
|
+
{% endfor %}
|
|
115
|
+
{% if params.language is defined and params.language %}
|
|
116
|
+
<div class="ons-u-d-no@xs">
|
|
117
|
+
{% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
|
|
118
|
+
{{ onsLanguageSelector(params.language) }}
|
|
119
|
+
</div>
|
|
120
|
+
{% endif %}
|
|
121
|
+
</ul>
|
|
122
|
+
</nav>
|
|
123
|
+
{% endif %}
|
|
75
124
|
</div>
|
|
76
|
-
<div class="ons-header__main
|
|
125
|
+
<div class="ons-header__main">
|
|
77
126
|
<div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
|
|
78
127
|
<div class="ons-grid ons-grid--gutterless ons-grid--flex ons-grid--between ons-grid--vertical-center ons-grid--no-wrap">
|
|
79
128
|
<div class="ons-grid__col ons-col-auto ons-u-flex-shrink{% if params.titleLogo == 'census-logo-en' %} ons-header__title-census-logo-en{% endif %}">
|
|
@@ -87,9 +136,12 @@
|
|
|
87
136
|
})
|
|
88
137
|
}}
|
|
89
138
|
{% else %}
|
|
90
|
-
<{{ title_tag }} class="ons-header__title
|
|
139
|
+
<{{ title_tag }} class="ons-header__title">{{ params.title }}</{{ title_tag }}>
|
|
91
140
|
{% endif %}
|
|
92
141
|
{% if params.titleLogoHref is defined and params.titleLogoHref %}</a>{% endif %}
|
|
142
|
+
{% if params.description is defined and params.description %}
|
|
143
|
+
<p class="ons-header__description">{{ params.description }}</p>
|
|
144
|
+
{% endif %}
|
|
93
145
|
</div>
|
|
94
146
|
{% if params.button is defined and params.button %}
|
|
95
147
|
<div class="ons-grid__col ons-col-auto ons-u-flex-no-shrink ons-u-d-no@xxs@m">
|
|
@@ -105,7 +157,7 @@
|
|
|
105
157
|
}) }}
|
|
106
158
|
</div>
|
|
107
159
|
{% endif %}
|
|
108
|
-
{% if params.toggleButton is defined and params.toggleButton or params.autosuggest is defined and params.autosuggest %}
|
|
160
|
+
{% if params.navigation.toggleButton is defined and params.navigation.toggleButton or params.autosuggest is defined and params.autosuggest %}
|
|
109
161
|
<div class="ons-grid__col ons-col-auto ons-u-flex-no-shrink ons-u-d-no@m">
|
|
110
162
|
{% if params.autosuggest is defined and params.autosuggest and isPatternLib is defined and isPatternLib %}
|
|
111
163
|
<span class="ons-grid ons-u-d-no@xxs@xs">
|
|
@@ -124,14 +176,14 @@
|
|
|
124
176
|
}) }}
|
|
125
177
|
</span>
|
|
126
178
|
{% endif %}
|
|
127
|
-
{% if params.toggleButton is defined and params.toggleButton %}
|
|
179
|
+
{% if params.navigation.toggleButton is defined and params.navigation.toggleButton %}
|
|
128
180
|
{{ onsButton({
|
|
129
|
-
"text": params.toggleButton.text,
|
|
181
|
+
"text": params.navigation.toggleButton.text | default("Menu"),
|
|
130
182
|
"classes": "ons-u-ml-xs ons-u-d-no ons-js-toggle-main",
|
|
131
183
|
"buttonStyle": "mobile",
|
|
132
184
|
"variants": ["mobile", "ghost"],
|
|
133
185
|
"attributes": {
|
|
134
|
-
"aria-label": params.toggleButton.ariaLabel | default("Toggle
|
|
186
|
+
"aria-label": params.navigation.toggleButton.ariaLabel | default("Toggle menu") ,
|
|
135
187
|
"aria-controls": params.navigation.id,
|
|
136
188
|
"aria-haspopup": "true",
|
|
137
189
|
"aria-expanded": "false"
|
|
@@ -141,9 +193,6 @@
|
|
|
141
193
|
</div>
|
|
142
194
|
{% endif %}
|
|
143
195
|
</div>
|
|
144
|
-
{% if params.desc is defined and params.desc %}
|
|
145
|
-
<p class="ons-header__desc">{{ params.desc }}</p>
|
|
146
|
-
{% endif %}
|
|
147
196
|
</div>
|
|
148
197
|
</div>
|
|
149
198
|
{% if params.navigation is defined and params.navigation %}
|
|
@@ -4,6 +4,9 @@ domready(async () => {
|
|
|
4
4
|
const toggleMainBtn = document.querySelector('.ons-js-toggle-main');
|
|
5
5
|
const navEl = document.querySelector('.ons-js-header-nav');
|
|
6
6
|
const navHideClass = 'ons-u-d-no@xxs@m';
|
|
7
|
+
const toggleServicesBtn = document.querySelector('.ons-js-toggle-services');
|
|
8
|
+
const servicesEl = document.querySelector('.ons-js-services-mobile-nav');
|
|
9
|
+
const servicesHideClass = 'ons-u-d-no';
|
|
7
10
|
const toggleSearchBtn = document.querySelector('.ons-js-toggle-search');
|
|
8
11
|
const searchEl = document.querySelector('.ons-js-header-search');
|
|
9
12
|
const searchHideClass = 'ons-u-d-no@xs@m';
|
|
@@ -19,4 +22,10 @@ domready(async () => {
|
|
|
19
22
|
|
|
20
23
|
new searchToggle(toggleSearchBtn, searchEl, searchHideClass).registerEvents();
|
|
21
24
|
}
|
|
25
|
+
|
|
26
|
+
if (toggleServicesBtn) {
|
|
27
|
+
const servicesToggle = (await import('./header-nav')).default;
|
|
28
|
+
|
|
29
|
+
new servicesToggle(toggleServicesBtn, servicesEl, servicesHideClass).registerEvents();
|
|
30
|
+
}
|
|
22
31
|
});
|
|
@@ -11,7 +11,6 @@ export default class NavToggle {
|
|
|
11
11
|
this.nav = nav;
|
|
12
12
|
this.hideClass = hideClass;
|
|
13
13
|
this.toggle.classList.remove('ons-u-d-no');
|
|
14
|
-
|
|
15
14
|
this.setAria();
|
|
16
15
|
onViewportChange(this.setAria.bind(this));
|
|
17
16
|
}
|
|
@@ -56,7 +55,11 @@ export default class NavToggle {
|
|
|
56
55
|
} else if (hasAria) {
|
|
57
56
|
this.toggle.removeAttribute(attrExpanded);
|
|
58
57
|
this.nav.removeAttribute(attrHidden);
|
|
59
|
-
|
|
58
|
+
if (this.hideClass !== 'ons-u-d-no') {
|
|
59
|
+
this.nav.classList.remove(this.hideClass);
|
|
60
|
+
} else {
|
|
61
|
+
this.closeNav();
|
|
62
|
+
}
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
65
|
}
|
|
@@ -38,21 +38,19 @@
|
|
|
38
38
|
{% set itemText = item.title %}
|
|
39
39
|
{% endif %}
|
|
40
40
|
|
|
41
|
-
{%- if item.
|
|
41
|
+
{%- if item.prefix is defined and item.prefix or (params.iconPosition is defined and params.iconPosition == 'before') -%}
|
|
42
42
|
<span class="ons-list__prefix"{% if listEl != 'ol' %} aria-hidden="true"{% endif %}>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}}
|
|
55
|
-
{%- endif -%}
|
|
43
|
+
{%- if item.prefix is defined and item.prefix -%}
|
|
44
|
+
{{- item.prefix -}}.
|
|
45
|
+
{% elif params.iconPosition is defined and params.iconPosition == 'before' %}
|
|
46
|
+
{% from "components/icons/_macro.njk" import onsIcon %}
|
|
47
|
+
{{
|
|
48
|
+
onsIcon({
|
|
49
|
+
"iconType": iconType,
|
|
50
|
+
"iconSize": params.iconSize
|
|
51
|
+
})
|
|
52
|
+
}}
|
|
53
|
+
{%- endif -%}
|
|
56
54
|
</span>
|
|
57
55
|
{%- endif -%}
|
|
58
56
|
{%- if item.url is defined and item.url and item.current != true -%}
|
|
@@ -65,7 +63,7 @@
|
|
|
65
63
|
})
|
|
66
64
|
}}
|
|
67
65
|
{%- else -%}
|
|
68
|
-
<a href="{{ item.url }}" class="ons-list__link
|
|
66
|
+
<a href="{{ item.url }}" class="ons-list__link{% if item.variants == 'inPageLink' %} ons-js-inpagelink{% endif %}{% if item.classes is defined and item.classes %} {{ item.classes }}{% endif %}"{% if item.target is defined and item.target %} target="{{ item.target }}"{% endif %}{% if item.attributes is defined and item.attributes %}{% for attribute, value in (item.attributes.items() if item.attributes is mapping and item.attributes.items else item.attributes) %} {{ attribute }}{% if value is defined and value %}="{{ value }}"{% endif %}{% endfor %}{% endif %}>
|
|
69
67
|
{%- if item.prefix is defined and item.prefix -%}<span class="ons-u-vh">{{- item.prefix -}}</span>{%- endif -%} {{- itemText | safe -}}
|
|
70
68
|
{%- if item.target is defined and item.target == "_blank" -%}<span class="ons-u-vh">{{- item.screenreaderMessage | default("this link will open in a new tab") -}}</span>{%- endif -%}
|
|
71
69
|
</a>
|
|
@@ -27,10 +27,8 @@
|
|
|
27
27
|
{% endif %}
|
|
28
28
|
|
|
29
29
|
{% if params is defined and params and params.type == "warn-branded" or params.type == "announcement" %}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{% elif params.type is defined and params.type == "warn" %}
|
|
33
|
-
<div class="ons-container">
|
|
30
|
+
<div class="{{containerClass}}">
|
|
31
|
+
<div class="ons-container">
|
|
34
32
|
{% endif %}
|
|
35
33
|
|
|
36
34
|
<div {% if params is defined and params and params.type == 'error' and params.title is defined and params.title %}aria-labelledby="error-summary-title" role="alert" tabindex="-1" {% if params.dsExample != true %}autofocus="autofocus" {% endif %}{% endif %}class="ons-panel{{ typeClass }}{{ iconClass }}{{ noTitleClass }}{{ spaciousClass }}{{ classes }}"{% if params is defined and params and params.attributes is defined and params.attributes %}{% for attribute, value in (params.attributes.items() if params is defined and params and params.attributes is mapping and params.attributes.items is defined and params.attributes.items else params.attributes) %}{{attribute}}="{{value}}" {% endfor %}{% endif %}{% if params is defined and params and params.id is defined and params.id %} id="{{params.id}}"{% endif %}>
|
|
@@ -91,14 +89,11 @@
|
|
|
91
89
|
<div class="ons-panel__body{% if params is defined and params and params.iconSize is defined and params.iconSize %} ons-svg-icon-margin--{{ params.iconSize }}{% endif %}">{{ (params.body if params else "") | safe }}
|
|
92
90
|
{{ caller() if caller }}
|
|
93
91
|
</div>
|
|
94
|
-
|
|
95
92
|
</div>
|
|
96
93
|
|
|
97
94
|
{% if params is defined and params and params.type == "warn-branded" or params.type == "announcement" %}
|
|
95
|
+
</div>
|
|
98
96
|
</div>
|
|
99
|
-
</div>
|
|
100
|
-
{% elif params.type is defined and params.type == "warn" %}
|
|
101
|
-
</div>
|
|
102
97
|
{% endif %}
|
|
103
98
|
|
|
104
99
|
{% endmacro %}
|
|
@@ -213,9 +213,10 @@
|
|
|
213
213
|
margin-top: -15% !important;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
&__icon + &__body {
|
|
219
|
+
padding-left: 2rem;
|
|
219
220
|
}
|
|
220
221
|
|
|
221
222
|
&--bare & {
|
|
@@ -228,6 +229,7 @@
|
|
|
228
229
|
}
|
|
229
230
|
}
|
|
230
231
|
|
|
232
|
+
&--info,
|
|
231
233
|
&--bare,
|
|
232
234
|
&--success,
|
|
233
235
|
&--warn,
|