@ons/design-system 55.1.0 → 56.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/access-code/_macro.njk +3 -3
- package/components/accordion/_macro.njk +1 -1
- package/components/address-input/_macro.njk +7 -7
- package/components/address-output/_macro.njk +7 -7
- package/components/autosuggest/_macro.njk +19 -19
- package/components/breadcrumbs/_macro.njk +3 -3
- package/components/button/_button.scss +49 -51
- package/components/button/_macro.njk +61 -35
- package/components/button/_macro.spec.js +24 -24
- package/components/button/button.spec.js +11 -11
- package/components/call-to-action/_macro.njk +1 -1
- package/components/card/_macro.njk +10 -10
- package/components/checkboxes/_checkbox-macro.njk +9 -9
- package/components/checkboxes/_macro.njk +10 -10
- package/components/checkboxes/checkbox-with-fieldset.js +6 -5
- package/components/checkboxes/checkboxes.dom.js +6 -9
- package/components/code-highlight/_macro.njk +1 -1
- package/components/collapsible/_macro.njk +7 -7
- package/components/date-input/_macro.njk +5 -5
- package/components/document-list/_macro.njk +29 -29
- package/components/duration/_macro.njk +9 -9
- package/components/duration/_macro.spec.js +0 -3
- package/components/error/_macro.njk +1 -1
- package/components/external-link/_macro.njk +1 -1
- package/components/feedback/_macro.njk +2 -2
- package/components/field/_macro.njk +5 -5
- package/components/fieldset/_fieldset.scss +5 -0
- package/components/fieldset/_macro.njk +8 -8
- package/components/footer/_macro.njk +19 -23
- package/components/footer/_macro.spec.js +0 -6
- package/components/header/_macro.njk +39 -41
- package/components/header/_macro.spec.js +4 -8
- package/components/hero/_macro.njk +15 -15
- package/components/icons/_macro.njk +2 -2
- package/components/images/_macro.njk +3 -3
- package/components/input/_input-type.scss +4 -0
- package/components/input/_macro.njk +41 -34
- package/components/input/_macro.spec.js +66 -59
- package/components/label/_macro.njk +1 -1
- package/components/language-selector/_macro.njk +1 -1
- package/components/lists/_macro.njk +22 -22
- package/components/message/_macro.njk +6 -6
- package/components/message-list/_macro.njk +1 -1
- package/components/metadata/_macro.njk +2 -2
- package/components/modal/_macro.njk +4 -4
- package/components/mutually-exclusive/_macro.njk +1 -1
- package/components/mutually-exclusive/mutually-exclusive.js +3 -1
- package/components/navigation/_macro.njk +11 -10
- package/components/navigation/_macro.spec.js +3 -2
- package/components/pagination/_macro.njk +3 -3
- package/components/panel/_macro.njk +37 -39
- package/components/panel/_macro.spec.js +1 -13
- package/components/promotional-banner/_macro.njk +2 -2
- package/components/question/_macro.njk +20 -20
- package/components/question/_macro.spec.js +2 -2
- package/components/question/_question.scss +1 -1
- package/components/quote/_macro.njk +2 -2
- package/components/radios/_macro.njk +8 -8
- package/components/radios/check-radios.js +5 -1
- package/components/related-content/_macro.njk +2 -2
- package/components/relationships/_macro.njk +4 -3
- package/components/search/_macro.njk +12 -2
- package/components/search/_macro.spec.js +27 -2
- package/components/section-navigation/_macro.njk +2 -2
- package/components/select/_macro.njk +8 -8
- package/components/share-page/_macro.njk +2 -2
- package/components/status/_macro.njk +2 -2
- package/components/summary/_macro.njk +25 -25
- package/components/table/_macro.njk +10 -10
- package/components/table-of-contents/_macro.njk +4 -4
- package/components/textarea/_macro.njk +8 -8
- package/components/timeline/_macro.njk +1 -1
- package/components/video/_macro.njk +1 -1
- package/css/census.css +1 -1
- package/css/ids.css +1 -1
- package/css/main.css +1 -1
- package/layout/_template.njk +35 -35
- package/package.json +1 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/patternlib.scss +2 -2
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
{% set title_tag = "h1" if params.titleAsH1 else "div" %}
|
|
8
8
|
{% set currentLanguageISOCode = "en" %}
|
|
9
9
|
|
|
10
|
-
{% if params.language
|
|
10
|
+
{% if params.language and params.language.languages %}
|
|
11
11
|
{% set currentLanguage = params.language.languages | selectattr("current") | first %}
|
|
12
12
|
{% set currentLanguageISOCode = currentLanguage.ISOCode %}
|
|
13
13
|
{% endif %}
|
|
14
14
|
|
|
15
|
-
<header class="ons-header {% if params.classes
|
|
15
|
+
<header class="ons-header {% if 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">
|
|
16
16
|
{{
|
|
17
17
|
onsBrowserBanner({
|
|
18
18
|
"lang": currentLanguageISOCode,
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"fullWidth": params.fullWidth
|
|
21
21
|
})
|
|
22
22
|
}}
|
|
23
|
-
{% if params.phase
|
|
23
|
+
{% if params.phase %}
|
|
24
24
|
{% from "components/phase-banner/_macro.njk" import onsPhaseBanner %}
|
|
25
25
|
{{ onsPhaseBanner({
|
|
26
26
|
"fullWidth": params.fullWidth,
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
{% if params.noMasthead != true %}
|
|
34
34
|
<div class="ons-header__top">
|
|
35
35
|
<div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
|
|
36
|
-
<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
|
|
36
|
+
<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 }}">
|
|
37
37
|
<div class="ons-grid__col ons-col-auto">
|
|
38
|
-
{%-if params.orgLogoHref
|
|
38
|
+
{%-if params.orgLogoHref %}
|
|
39
39
|
<a class="ons-header__org-logo-link" href="{{ params.orgLogoHref }}">
|
|
40
40
|
{% endif -%}
|
|
41
41
|
<div class="ons-header__org-logo ons-header__org-logo--large">
|
|
@@ -55,20 +55,20 @@
|
|
|
55
55
|
})
|
|
56
56
|
}}
|
|
57
57
|
</div>
|
|
58
|
-
{% if params.orgLogoHref
|
|
58
|
+
{% if params.orgLogoHref %}
|
|
59
59
|
</a>
|
|
60
60
|
{% endif %}
|
|
61
61
|
</div>
|
|
62
|
-
{% if params.language
|
|
62
|
+
{% if params.language or params.serviceLinks %}
|
|
63
63
|
<div class="ons-header__links ons-grid__col ons-col-auto">
|
|
64
|
-
{% if params.language
|
|
65
|
-
<div class="ons-grid__col ons-col-auto {{ ' ons-u-mr-s ons-u-d-no@xxs@xs' if params.serviceLinks
|
|
64
|
+
{% if params.language %}
|
|
65
|
+
<div class="ons-grid__col ons-col-auto {{ ' ons-u-mr-s ons-u-d-no@xxs@xs' if params.serviceLinks else '' }}">
|
|
66
66
|
{% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
|
|
67
67
|
{{ onsLanguageSelector(params.language) }}
|
|
68
68
|
</div>
|
|
69
69
|
{% endif %}
|
|
70
|
-
{% if params.serviceLinks
|
|
71
|
-
{% if params.serviceLinks.itemsList | length == 1 and params.language
|
|
70
|
+
{% if params.serviceLinks %}
|
|
71
|
+
{% if params.serviceLinks.itemsList | length == 1 and params.language %}
|
|
72
72
|
{% set breakpoint = 'xs' %}
|
|
73
73
|
{% set controlVisibility = true %}
|
|
74
74
|
{% elif params.serviceLinks.itemsList | length > 1 %}
|
|
@@ -82,18 +82,18 @@
|
|
|
82
82
|
<ul class="ons-header-service-nav__list">
|
|
83
83
|
{% for item in (params.serviceLinks.itemsList if params.serviceLinks.itemsList is iterable else params.serviceLinks.itemsList.items()) %}
|
|
84
84
|
<li class="ons-header-service-nav__item">
|
|
85
|
-
{% if item.iconType
|
|
85
|
+
{% if item.iconType %}
|
|
86
86
|
{{
|
|
87
87
|
onsIcon({
|
|
88
88
|
"iconType": item.iconType
|
|
89
89
|
})
|
|
90
90
|
}}
|
|
91
91
|
{% endif %}
|
|
92
|
-
{% if item.url
|
|
92
|
+
{% if item.url %}
|
|
93
93
|
<a
|
|
94
94
|
href="{{ item.url }}"
|
|
95
95
|
class="ons-header-service-nav__link"
|
|
96
|
-
{% if item.id
|
|
96
|
+
{% if item.id %} id="{{ item.id }}"{% endif %}
|
|
97
97
|
>{{ item.title }}</a>
|
|
98
98
|
{% else %}
|
|
99
99
|
{{ item.title }}
|
|
@@ -103,18 +103,17 @@
|
|
|
103
103
|
</ul>
|
|
104
104
|
</nav>
|
|
105
105
|
</div>
|
|
106
|
-
{% if params.serviceLinks.itemsList | length > 1
|
|
106
|
+
{% if params.serviceLinks.itemsList | length > 1 or params.language %}
|
|
107
107
|
{% if params.variants == 'internal' or params.variants == 'neutral' %}
|
|
108
|
-
{% set buttonVariant = ["text-link", "text-link-inverse"] %}
|
|
108
|
+
{% set buttonVariant = ["mobile", "text-link", "text-link-inverse"] %}
|
|
109
109
|
{% else %}
|
|
110
|
-
{% set buttonVariant = "text-link" %}
|
|
110
|
+
{% set buttonVariant = ["mobile", "text-link"] %}
|
|
111
111
|
{% endif %}
|
|
112
112
|
<div class="ons-grid__col ons-col-auto ons-u-d-no@{{ breakpoint }}">
|
|
113
113
|
{{ onsButton({
|
|
114
114
|
"text": params.serviceLinks.toggleServicesButton.text | default("Account"),
|
|
115
115
|
"classes": "ons-u-d-no ons-js-toggle-services",
|
|
116
116
|
"type": "button",
|
|
117
|
-
"buttonStyle": "mobile",
|
|
118
117
|
"variants": buttonVariant,
|
|
119
118
|
"attributes": {
|
|
120
119
|
"aria-label": params.serviceLinks.toggleServicesButton.ariaLabel | default("Toggle menu"),
|
|
@@ -129,30 +128,30 @@
|
|
|
129
128
|
{% endif %}
|
|
130
129
|
</div>
|
|
131
130
|
</div>
|
|
132
|
-
{% if params.serviceLinks
|
|
131
|
+
{% if params.serviceLinks %}
|
|
133
132
|
<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") }}">
|
|
134
133
|
<ul class="ons-header-service-nav__list">
|
|
135
134
|
{% for item in (params.serviceLinks.itemsList if params.serviceLinks.itemsList is iterable else params.serviceLinks.itemsList.items()) %}
|
|
136
135
|
<li class="ons-header-service-nav__item ons-header-service-nav__item--mobile">
|
|
137
|
-
{% if item.iconType
|
|
136
|
+
{% if item.iconType %}
|
|
138
137
|
{{
|
|
139
138
|
onsIcon({
|
|
140
139
|
"iconType": item.iconType
|
|
141
140
|
})
|
|
142
141
|
}}
|
|
143
142
|
{% endif %}
|
|
144
|
-
{% if item.url
|
|
143
|
+
{% if item.url %}
|
|
145
144
|
<a
|
|
146
145
|
href="{{ item.url }}"
|
|
147
146
|
class="ons-header-service-nav__link"
|
|
148
|
-
{% if item.id
|
|
147
|
+
{% if item.id %} id="{{ item.id }}"{% endif %}
|
|
149
148
|
>{{ item.title }}</a>
|
|
150
149
|
{% else %}
|
|
151
150
|
{{ item.title }}
|
|
152
151
|
{% endif %}
|
|
153
152
|
</li>
|
|
154
153
|
{% endfor %}
|
|
155
|
-
{% if params.language
|
|
154
|
+
{% if params.language %}
|
|
156
155
|
<div class="ons-u-d-no@xs">
|
|
157
156
|
{% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
|
|
158
157
|
{{ onsLanguageSelector(params.language) }}
|
|
@@ -167,11 +166,11 @@
|
|
|
167
166
|
<div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
|
|
168
167
|
<div class="ons-grid ons-grid--gutterless ons-grid--flex ons-grid--between ons-grid--vertical-center ons-grid--no-wrap">
|
|
169
168
|
<div class="ons-grid__col ons-col-auto ons-u-flex-shrink">
|
|
170
|
-
{% if params.titleLogo
|
|
171
|
-
{% if params.titleLogoHref
|
|
169
|
+
{% if params.titleLogo and params.titleLogoAlt %}
|
|
170
|
+
{% if params.titleLogoHref %}
|
|
172
171
|
<a class="ons-header__title-logo-link" href="{{ params.titleLogoHref }}">
|
|
173
172
|
{% endif %}
|
|
174
|
-
<div class="ons-header__title-logo ons-header__title-logo--large {% if params.titleLogoClasses %} {{ params.titleLogoClasses }} {% endif %}{% if params.titleLogoMobile
|
|
173
|
+
<div class="ons-header__title-logo ons-header__title-logo--large {% if params.titleLogoClasses %} {{ params.titleLogoClasses }} {% endif %}{% if params.titleLogoMobile %}ons-u-d-no@xxs@s{% endif %}">
|
|
175
174
|
{% from "components/icons/_macro.njk" import onsIcon %}
|
|
176
175
|
{{
|
|
177
176
|
onsIcon({
|
|
@@ -180,7 +179,7 @@
|
|
|
180
179
|
})
|
|
181
180
|
}}
|
|
182
181
|
</div>
|
|
183
|
-
{% if params.titleLogoMobile
|
|
182
|
+
{% if params.titleLogoMobile %}
|
|
184
183
|
<div class="ons-header__title-logo ons-header__title-logo--mobile ons-u-d-no@s{% if params.titleLogoMobileClasses %} {{ params.titleLogoMobileClasses }}{% endif %}">
|
|
185
184
|
{% from "components/icons/_macro.njk" import onsIcon %}
|
|
186
185
|
{{
|
|
@@ -191,26 +190,26 @@
|
|
|
191
190
|
}}
|
|
192
191
|
</div>
|
|
193
192
|
{% endif %}
|
|
194
|
-
{% if params.titleLogoHref
|
|
193
|
+
{% if params.titleLogoHref %}
|
|
195
194
|
</a>
|
|
196
195
|
{% endif %}
|
|
197
196
|
{% else %}
|
|
198
|
-
{% if params.titleLogoHref
|
|
197
|
+
{% if params.titleLogoHref %}
|
|
199
198
|
<a class="ons-header__title-link" href="{{ params.titleLogoHref }}">
|
|
200
199
|
{% endif %}
|
|
201
200
|
<{{ title_tag }} class="ons-header__title">{{ params.title }}</{{ title_tag }}>
|
|
202
|
-
{% if params.titleLogoHref
|
|
201
|
+
{% if params.titleLogoHref %}
|
|
203
202
|
</a>
|
|
204
203
|
{% endif %}
|
|
205
204
|
{% endif %}
|
|
206
|
-
{% if params.description
|
|
205
|
+
{% if params.description %}
|
|
207
206
|
<p class="ons-header__description">{{ params.description }}</p>
|
|
208
207
|
{% endif %}
|
|
209
208
|
</div>
|
|
210
209
|
|
|
211
|
-
{% if params.button
|
|
210
|
+
{% if params.button %}
|
|
212
211
|
{% if params.variants == 'neutral' %}
|
|
213
|
-
{% set buttonVariant =
|
|
212
|
+
{% set buttonVariant = "ghost-dark" %}
|
|
214
213
|
{% else %}
|
|
215
214
|
{% set buttonVariant = "ghost" %}
|
|
216
215
|
{% endif %}
|
|
@@ -222,15 +221,15 @@
|
|
|
222
221
|
"name": params.button.name,
|
|
223
222
|
"attributes": params.button.attributes,
|
|
224
223
|
"url": params.button.url,
|
|
225
|
-
"iconType":
|
|
226
|
-
"iconPosition":
|
|
224
|
+
"iconType": "exit",
|
|
225
|
+
"iconPosition": "after"
|
|
227
226
|
}) }}
|
|
228
227
|
</div>
|
|
229
228
|
{% endif %}
|
|
230
|
-
{% if params.navigation
|
|
229
|
+
{% if params.navigation %}
|
|
231
230
|
<div class="ons-grid__col ons-col-auto ons-u-flex-no-shrink">
|
|
232
231
|
{% if params.noMasthead == true %}
|
|
233
|
-
{% if params.language
|
|
232
|
+
{% if params.language %}
|
|
234
233
|
<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 %}">
|
|
235
234
|
{% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
|
|
236
235
|
{{ onsLanguageSelector(params.language) }}
|
|
@@ -239,7 +238,7 @@
|
|
|
239
238
|
{% endif %}
|
|
240
239
|
{% if params.navigation.siteSearchAutosuggest %}
|
|
241
240
|
{% if params.variants == 'neutral' %}
|
|
242
|
-
{% set buttonVariant = ["small", "ghost
|
|
241
|
+
{% set buttonVariant = ["small", "ghost-dark"] %}
|
|
243
242
|
{% else %}
|
|
244
243
|
{% set buttonVariant = ["small", "ghost"] %}
|
|
245
244
|
{% endif %}
|
|
@@ -258,7 +257,7 @@
|
|
|
258
257
|
}) }}
|
|
259
258
|
</span>
|
|
260
259
|
{% endif %}
|
|
261
|
-
{% if params.navigation.toggleNavigationButton
|
|
260
|
+
{% if params.navigation.toggleNavigationButton %}
|
|
262
261
|
{% if params.variants == 'neutral' %}
|
|
263
262
|
{% set buttonVariant = ["mobile", "ghost-dark"] %}
|
|
264
263
|
{% else %}
|
|
@@ -267,7 +266,6 @@
|
|
|
267
266
|
{{ onsButton({
|
|
268
267
|
"text": params.navigation.toggleNavigationButton.text,
|
|
269
268
|
"classes": "ons-u-ml-xs ons-u-d-no ons-js-navigation-button ons-u-d-no@l",
|
|
270
|
-
"buttonStyle": "mobile",
|
|
271
269
|
"variants": buttonVariant,
|
|
272
270
|
"attributes": {
|
|
273
271
|
"aria-label": params.navigation.toggleNavigationButton.ariaLabel | default("Toggle main menu") ,
|
|
@@ -281,7 +279,7 @@
|
|
|
281
279
|
</div>
|
|
282
280
|
</div>
|
|
283
281
|
</div>
|
|
284
|
-
{% if params.navigation
|
|
282
|
+
{% if params.navigation %}
|
|
285
283
|
{{ onsNavigation(params) }}
|
|
286
284
|
{% endif %}
|
|
287
285
|
</header>
|
|
@@ -333,8 +333,6 @@ describe('macro: header', () => {
|
|
|
333
333
|
a: 'b',
|
|
334
334
|
},
|
|
335
335
|
url: '#0',
|
|
336
|
-
iconType: 'button-icon',
|
|
337
|
-
iconPosition: 'before',
|
|
338
336
|
},
|
|
339
337
|
});
|
|
340
338
|
|
|
@@ -347,8 +345,8 @@ describe('macro: header', () => {
|
|
|
347
345
|
a: 'b',
|
|
348
346
|
},
|
|
349
347
|
url: '#0',
|
|
350
|
-
iconType: '
|
|
351
|
-
iconPosition: '
|
|
348
|
+
iconType: 'exit',
|
|
349
|
+
iconPosition: 'after',
|
|
352
350
|
});
|
|
353
351
|
});
|
|
354
352
|
|
|
@@ -491,8 +489,7 @@ describe('macro: header', () => {
|
|
|
491
489
|
text: 'Menu',
|
|
492
490
|
classes: 'ons-u-d-no ons-js-toggle-services',
|
|
493
491
|
type: 'button',
|
|
494
|
-
|
|
495
|
-
variants: 'text-link',
|
|
492
|
+
variants: ['mobile', 'text-link'],
|
|
496
493
|
attributes: {
|
|
497
494
|
'aria-label': 'Toggle services menu',
|
|
498
495
|
'aria-controls': 'service-links',
|
|
@@ -523,7 +520,7 @@ describe('macro: header', () => {
|
|
|
523
520
|
},
|
|
524
521
|
});
|
|
525
522
|
|
|
526
|
-
expect(buttonSpy.occurrences[0]).toHaveProperty('variants', ['text-link', 'text-link-inverse']);
|
|
523
|
+
expect(buttonSpy.occurrences[0]).toHaveProperty('variants', ['mobile', 'text-link', 'text-link-inverse']);
|
|
527
524
|
});
|
|
528
525
|
|
|
529
526
|
it('does not render a button for a single services link', () => {
|
|
@@ -623,7 +620,6 @@ describe('macro: header', () => {
|
|
|
623
620
|
expect(buttonSpy.occurrences[0]).toEqual({
|
|
624
621
|
text: 'Menu',
|
|
625
622
|
classes: 'ons-u-ml-xs ons-u-d-no ons-js-navigation-button ons-u-d-no@l',
|
|
626
|
-
buttonStyle: 'mobile',
|
|
627
623
|
variants: ['mobile', 'ghost'],
|
|
628
624
|
attributes: {
|
|
629
625
|
'aria-label': 'Toggle main menu',
|
|
@@ -3,46 +3,46 @@
|
|
|
3
3
|
{% from "components/icons/_macro.njk" import onsIcon %}
|
|
4
4
|
|
|
5
5
|
{# style adjustments if dark or light skin #}
|
|
6
|
-
{% if params.variants
|
|
6
|
+
{% if params.variants and 'dark' in params.variants %}
|
|
7
7
|
{% set skinName = "dark" %}
|
|
8
8
|
{% else %}
|
|
9
9
|
{% set skinName = "light" %}
|
|
10
10
|
{% endif %}
|
|
11
11
|
|
|
12
12
|
{# If hero contains a collapsible, style it differently #}
|
|
13
|
-
{% if params.collapsible
|
|
13
|
+
{% if params.collapsible %}
|
|
14
14
|
{% set containerClasses = " ons-hero__container--has-collapsible" %}
|
|
15
15
|
{% endif %}
|
|
16
16
|
|
|
17
17
|
{# Set number of columns used for hero content after medium breakpoint #}
|
|
18
18
|
{% set detailsColumns = params.detailsColumns | default ('8') %}
|
|
19
19
|
|
|
20
|
-
<section class="ons-hero ons-grid--gutterless{% if params.variants
|
|
20
|
+
<section class="ons-hero ons-grid--gutterless{% if params.variants %}{% if params.variants is not string %}{% for variant in params.variants %} ons-hero--{{ variant }}{% endfor %}{% else %} ons-hero--{{ params.variants }}{% endif %}{% endif %}">
|
|
21
21
|
|
|
22
22
|
<div class="ons-hero__container ons-container{{ ' ons-container--wide' if params.wide }}{{ containerClasses }}">
|
|
23
23
|
|
|
24
24
|
<div class="ons-hero__details{{ detailsClasses }} ons-grid__col ons-col-{{ detailsColumns }}@m ons-col-10@s@m">
|
|
25
25
|
|
|
26
26
|
<header>
|
|
27
|
-
{% if params.preTitleImage
|
|
27
|
+
{% if params.preTitleImage %}
|
|
28
28
|
{% set preTitleImageWithModifier = params.preTitleImage.name ~ "--" ~ skinName ~ ".svg" %}
|
|
29
29
|
<img class="ons-hero__pre-title" src="{{ params.placeholderURL }}/img/{{ preTitleImageWithModifier }}" alt="{{ params.preTitleImage.alt }}">
|
|
30
30
|
{% endif %}
|
|
31
|
-
{% if params.title
|
|
31
|
+
{% if params.title %}
|
|
32
32
|
<h1 class="ons-hero__title ons-u-fs-xxxl">{{ params.title }}</h1>
|
|
33
33
|
{% endif %}
|
|
34
|
-
{% if params.subtitle
|
|
34
|
+
{% if params.subtitle %}
|
|
35
35
|
<h2 class="ons-hero__subtitle ons-u-fs-r--b">{{ params.subtitle }}</h2>
|
|
36
36
|
{% endif %}
|
|
37
37
|
</header>
|
|
38
38
|
|
|
39
|
-
{% if params.text
|
|
39
|
+
{% if params.text %}
|
|
40
40
|
<p class="ons-hero__text">{{ params.text | safe }}</p>
|
|
41
41
|
{% endif %}
|
|
42
42
|
|
|
43
|
-
{% if params.button
|
|
43
|
+
{% if params.button %}
|
|
44
44
|
{% from "components/button/_macro.njk" import onsButton %}
|
|
45
|
-
{% set btnClasses = params.button.classes if params.button.classes
|
|
45
|
+
{% set btnClasses = params.button.classes if params.button.classes else '' %}
|
|
46
46
|
{% if skinName == 'dark' %}
|
|
47
47
|
{% set btnClasses = btnClasses + ' ons-btn--ghost' %}
|
|
48
48
|
{% endif %}
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
}}
|
|
57
57
|
{% endif %}
|
|
58
58
|
|
|
59
|
-
{% if params.collapsible
|
|
59
|
+
{% if params.collapsible %}
|
|
60
60
|
{% from "components/collapsible/_macro.njk" import onsCollapsible %}
|
|
61
61
|
{{
|
|
62
62
|
onsCollapsible({
|
|
@@ -73,16 +73,16 @@
|
|
|
73
73
|
}}
|
|
74
74
|
{% endif %}
|
|
75
75
|
|
|
76
|
-
{% if params.suffixText
|
|
76
|
+
{% if params.suffixText %}
|
|
77
77
|
<p class="ons-hero__suffixText ons-u-fs-s ons-u-mt-m ons-u-mb-no">{{ params.suffixText | safe }}</p>
|
|
78
78
|
{% endif %}
|
|
79
79
|
|
|
80
80
|
</div>
|
|
81
|
-
{% if params.variants
|
|
81
|
+
{% if params.variants and 'census' in params.variants %}
|
|
82
82
|
|
|
83
|
-
{% if params.image
|
|
83
|
+
{% if params.image %}
|
|
84
84
|
<div class="ons-hero__circle-image">
|
|
85
|
-
<img height="558" width="558" {% if params.image.largeSrc
|
|
85
|
+
<img height="558" width="558" {% if params.image.largeSrc %}srcset="{{ params.image.smallSrc }} 1x, {{ params.image.largeSrc }} 2x" {% endif %}src="{{ params.image.smallSrc }}" alt="">
|
|
86
86
|
</div>
|
|
87
87
|
{% endif %}
|
|
88
88
|
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
|
|
95
95
|
<div class="ons-hero__circle-gradient"></div>
|
|
96
96
|
|
|
97
|
-
{% if (params.variants
|
|
97
|
+
{% if (params.variants and 'census' in params.variants) and ('dark' not in params.variants) %}
|
|
98
98
|
<div class="ons-hero__circle"></div>
|
|
99
99
|
{% endif %}
|
|
100
100
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{% macro onsIcon(params) %}
|
|
2
2
|
|
|
3
|
-
{% if params.classes
|
|
3
|
+
{% if params.classes %}
|
|
4
4
|
{% set iconClasses = ' ' + params.classes %}
|
|
5
5
|
{% endif %}
|
|
6
6
|
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
<path d="M11.86 10.23 8.62 6.99a4.63 4.63 0 1 0-6.34 1.64 4.55 4.55 0 0 0 2.36.64 4.65 4.65 0 0 0 2.33-.65l3.24 3.23a.46.46 0 0 0 .65 0l1-1a.48.48 0 0 0 0-.62Zm-5-3.32a3.28 3.28 0 0 1-2.31.93 3.22 3.22 0 1 1 2.35-.93Z"/>
|
|
63
63
|
</svg>
|
|
64
64
|
{% elif params.iconType == "sort-sprite" %}
|
|
65
|
-
<svg id="sort-sprite{% if params.id
|
|
65
|
+
<svg id="sort-sprite{% if params.id %}-{{ params.id | lower }}{% endif %}" class="ons-svg-icon{{ iconClasses }}" viewBox="0 0 12 19" xmlns="http://www.w3.org/2000/svg" focusable="false" fill="currentColor">
|
|
66
66
|
<path class="ons-topTriangle" d="M6 0l6 7.2H0L6 0zm0 18.6l6-7.2H0l6 7.2zm0 3.6l6 7.2H0l6-7.2z"/>
|
|
67
67
|
<path class="ons-bottomTriangle" d="M6 18.6l6-7.2H0l6 7.2zm0 3.6l6 7.2H0l6-7.2z"/>
|
|
68
68
|
</svg>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{%- macro onsImage(params) -%}
|
|
2
2
|
<figure class="ons-figure">
|
|
3
3
|
|
|
4
|
-
{% if params.image
|
|
5
|
-
<img class="ons-figure__image" {% if params.image.largeSrc
|
|
4
|
+
{% if params.image %}
|
|
5
|
+
<img class="ons-figure__image" {% if params.image.largeSrc %}srcset="{{ params.image.smallSrc }} 1x, {{ params.image.largeSrc }} 2x"{% endif %}src="{{ params.image.smallSrc }}" alt="{{ params.alt if params.alt else '' }}">
|
|
6
6
|
{% else %}
|
|
7
7
|
<img class="ons-figure__image" src="{{ params.url }}" alt="{{ params.alt }}">
|
|
8
8
|
{% endif %}
|
|
9
9
|
|
|
10
|
-
{% if params.caption
|
|
10
|
+
{% if params.caption %}
|
|
11
11
|
<figcaption class="ons-figure__caption">
|
|
12
12
|
{{ params.caption }}
|
|
13
13
|
</figcaption>
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
{% set type = "text" %}
|
|
12
12
|
{% set pattern = "[0-9]*" %}
|
|
13
13
|
{% set inputmode = "numeric" %}
|
|
14
|
-
{% elif params.type
|
|
14
|
+
{% elif params.type %}
|
|
15
15
|
{% set type = params.type %}
|
|
16
|
-
{% elif params.searchButton
|
|
16
|
+
{% elif params.searchButton %}
|
|
17
17
|
{% set type = "search" %}
|
|
18
18
|
{% else %}
|
|
19
19
|
{% set type = "text" %}
|
|
@@ -26,24 +26,24 @@
|
|
|
26
26
|
<input
|
|
27
27
|
type="{{ type }}"
|
|
28
28
|
id="{{ params.id }}"
|
|
29
|
-
class="ons-input ons-input--text ons-input-type__input{% if params.error
|
|
30
|
-
{% if params.prefix
|
|
31
|
-
{% if params.name
|
|
32
|
-
{% if params.value
|
|
33
|
-
{% if params.accept
|
|
34
|
-
{% if params.min
|
|
35
|
-
{% if params.max
|
|
36
|
-
{% if params.minLength
|
|
37
|
-
{% if params.maxLength
|
|
38
|
-
{% if pattern
|
|
39
|
-
{% if inputmode
|
|
40
|
-
{% if params.autocomplete
|
|
41
|
-
{% if params.accessiblePlaceholder
|
|
42
|
-
{% if params.charCheckLimit
|
|
43
|
-
{% if params.charCheckLimit
|
|
44
|
-
{% if params.attributes
|
|
45
|
-
{% if params.label
|
|
46
|
-
{% if params.required
|
|
29
|
+
class="ons-input ons-input--text ons-input-type__input{% if params.error %} ons-input--error{% endif %}{% if params.searchButton %} ons-search__input{% endif %}{% if params.classes %} {{ params.classes }}{% endif %}{% if params.width %} ons-input{% if params.type == 'number' or params.type == 'tel' %}-number{% endif %}--w-{{ params.width }}{% endif %}{{ exclusiveClass }}{{ inputPlaceholder }}"
|
|
30
|
+
{% if params.prefix and params.prefix.id %}aria-labelledby="{{ params.prefix.id }}"{% elif params.suffix and params.suffix.id %}aria-labelledby="{{ params.suffix.id }}"{% endif %}
|
|
31
|
+
{% if params.name %}name="{{ params.name }}"{% endif %}
|
|
32
|
+
{% if params.value %}value="{{ params.value }}"{% endif %}
|
|
33
|
+
{% if params.accept %}accept="{{ params.accept }}"{% endif %}
|
|
34
|
+
{% if params.min %}min="{{ params.min }}"{% endif %}
|
|
35
|
+
{% if params.max %}max="{{ params.max }}"{% endif %}
|
|
36
|
+
{% if params.minLength %}minlength="{{ params.minLength }}"{% endif %}
|
|
37
|
+
{% if params.maxLength %}maxlength="{{ params.maxLength }}"{% endif %}
|
|
38
|
+
{% if pattern %}pattern="{{ pattern }}"{% endif %}
|
|
39
|
+
{% if inputmode %}inputmode="{{ inputmode }}"{% endif %}
|
|
40
|
+
{% if params.autocomplete %}autocomplete="{{ params.autocomplete }}"{% endif %}
|
|
41
|
+
{% if params.accessiblePlaceholder %}placeholder="{{ params.label.text }}"{% endif %}
|
|
42
|
+
{% if params.charCheckLimit %}data-char-check-ref="{{ params.id }}-check-remaining" data-char-check-num="{{ params.charCheckLimit.limit }}" aria-describedby="{{ params.id }}-check-remaining"{% endif %}
|
|
43
|
+
{% if params.charCheckLimit and params.charCheckLimit.charcheckCountdown %}data-char-check-countdown="true"{% endif %}
|
|
44
|
+
{% if params.attributes %}{% for attribute, value in (params.attributes.items() if params.attributes is mapping and params.attributes.items else params.attributes) %}{{ attribute }}{% if value %}="{{ value }}"{% endif %} {% endfor %}{% endif %}
|
|
45
|
+
{% if params.label and params.label.description %}{% if params.label.id %}aria-describedby="{{ params.label.id }}-description-hint"{% else %}aria-describedby="description-hint"{% endif %}{% endif %}
|
|
46
|
+
{% if params.required == true %}required="required"{% endif %}
|
|
47
47
|
/>
|
|
48
48
|
{% if params.listeners %}
|
|
49
49
|
<script{% if csp_nonce %} nonce="{{ csp_nonce() }}"{% endif %}>
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
{% endfor %}
|
|
53
53
|
</script>
|
|
54
54
|
{% endif %}
|
|
55
|
-
{% if params.postTextboxLinkText
|
|
55
|
+
{% if params.postTextboxLinkText %}
|
|
56
56
|
<a class="ons-u-fs-s ons-input__post-link" href="{{ params.postTextboxLinkUrl }}">{{ params.postTextboxLinkText }}</a>
|
|
57
57
|
{% endif %}
|
|
58
58
|
{% endset %}
|
|
59
59
|
{% set field %}
|
|
60
|
-
{% if params.label
|
|
60
|
+
{% if params.label and params.label.text %}
|
|
61
61
|
{{ onsLabel({
|
|
62
62
|
"for": params.id,
|
|
63
63
|
"id": params.label.id,
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
}) }}
|
|
71
71
|
{% endif %}
|
|
72
72
|
|
|
73
|
-
{% if params.prefix
|
|
74
|
-
{% if (params.prefix
|
|
75
|
-
{% if params.prefix
|
|
73
|
+
{% if params.prefix or params.suffix %}
|
|
74
|
+
{% if (params.prefix and params.prefix.id) or (params.suffix and params.suffix.id) %}
|
|
75
|
+
{% if params.prefix %}
|
|
76
76
|
{% set prefixClass = " ons-input-type--prefix" %}
|
|
77
77
|
{% endif %}
|
|
78
78
|
|
|
@@ -81,21 +81,28 @@
|
|
|
81
81
|
{{ input | safe }}
|
|
82
82
|
|
|
83
83
|
{% set abbr = params.prefix or params.suffix %}
|
|
84
|
-
|
|
84
|
+
{% if params.prefix.title or params.suffix.title %}
|
|
85
|
+
{% set tag = 'abbr' %}
|
|
86
|
+
{% else %}
|
|
87
|
+
{% set tag = 'span' %}
|
|
88
|
+
{% endif %}
|
|
89
|
+
|
|
90
|
+
<{{ tag }}
|
|
85
91
|
id="{{ abbr.id }}"
|
|
86
92
|
class="ons-input-type__type ons-js-input-abbr"
|
|
87
|
-
title="{{ abbr.title }}"
|
|
88
|
-
>{{ abbr.text
|
|
93
|
+
{% if abbr.title %}title="{{ abbr.title }}"{% endif %}
|
|
94
|
+
>{{ abbr.text }}</{{ tag }}>
|
|
89
95
|
</span>
|
|
90
96
|
</span>
|
|
91
97
|
{% endif %}
|
|
92
|
-
{% elif params.searchButton
|
|
98
|
+
{% elif params.searchButton %}
|
|
93
99
|
<span class="ons-grid--flex ons-search">
|
|
94
100
|
{% call onsSearch({
|
|
95
101
|
"accessiblePlaceholder": params.accessiblePlaceholder,
|
|
96
102
|
"searchButton": {
|
|
97
103
|
"type": params.searchButton.type,
|
|
98
104
|
"text": params.searchButton.text,
|
|
105
|
+
"visuallyHideButtonText": params.searchButton.visuallyHideButtonText,
|
|
99
106
|
"id": params.searchButton.id,
|
|
100
107
|
"attributes": params.searchButton.attributes,
|
|
101
108
|
"classes": params.searchButton.classes,
|
|
@@ -110,7 +117,7 @@
|
|
|
110
117
|
{% endif %}
|
|
111
118
|
{% endset %}
|
|
112
119
|
|
|
113
|
-
{% if params.charCheckLimit
|
|
120
|
+
{% if params.charCheckLimit and params.charCheckLimit.limit %}
|
|
114
121
|
{% set charCheckField %}
|
|
115
122
|
{% call onsCharLimit({
|
|
116
123
|
"id": params.id ~ "-check",
|
|
@@ -126,7 +133,7 @@
|
|
|
126
133
|
{% endset %}
|
|
127
134
|
{% endif %}
|
|
128
135
|
|
|
129
|
-
{% if params.mutuallyExclusive
|
|
136
|
+
{% if params.mutuallyExclusive %}
|
|
130
137
|
{% call onsMutuallyExclusive({
|
|
131
138
|
"id": params.fieldId,
|
|
132
139
|
"legend": params.legend,
|
|
@@ -142,7 +149,7 @@
|
|
|
142
149
|
"error": params.error,
|
|
143
150
|
"autosuggestResults": params.autosuggestResults
|
|
144
151
|
}) %}
|
|
145
|
-
{% if charCheckField
|
|
152
|
+
{% if charCheckField %}
|
|
146
153
|
{{ charCheckField | safe }}
|
|
147
154
|
{% else %}
|
|
148
155
|
{{ field | safe }}
|
|
@@ -156,9 +163,9 @@
|
|
|
156
163
|
"classes": params.fieldClasses,
|
|
157
164
|
"dontWrap": params.dontWrap,
|
|
158
165
|
"error": params.error,
|
|
159
|
-
"inline": params.label.inline if params.label
|
|
166
|
+
"inline": params.label.inline if params.label else ''
|
|
160
167
|
}) %}
|
|
161
|
-
{% if charCheckField
|
|
168
|
+
{% if charCheckField %}
|
|
162
169
|
{{ charCheckField | safe }}
|
|
163
170
|
{% else %}
|
|
164
171
|
{{ field | safe }}
|