@ons/design-system 70.0.8 → 70.0.10
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 +31 -25
- package/components/access-code/example-access-code-error.njk +49 -37
- package/components/access-code/example-access-code.njk +40 -30
- package/components/accordion/_macro.njk +7 -6
- package/components/accordion/example-accordion-open.njk +0 -1
- package/components/address-input/_macro.njk +23 -11
- package/components/address-input/autosuggest.address.js +0 -5
- package/components/address-input/example-address-input-editable.njk +52 -50
- package/components/address-input/example-address-input-manual.njk +23 -21
- package/components/address-input/example-address-input.njk +40 -38
- package/components/address-output/_macro.njk +6 -6
- package/components/autosuggest/_macro.njk +57 -37
- package/components/autosuggest/example-autosuggest-country-multiple.njk +26 -26
- package/components/autosuggest/example-autosuggest-country.njk +24 -24
- package/components/back-to-top/example-back-to-top.njk +183 -6
- package/components/back-to-top/example-full-page-back-to-top.njk +135 -123
- package/components/breadcrumbs/_macro.njk +12 -4
- package/components/browser-banner/_macro.njk +6 -3
- package/components/button/_button.scss +36 -1
- package/components/button/_macro.njk +63 -62
- package/components/button/example-button-ghost.njk +1 -0
- package/components/call-to-action/_macro.njk +7 -5
- package/components/call-to-action/example-call-to-action-default.njk +3 -2
- package/components/card/_macro.njk +26 -10
- package/components/card/example-card-set-with-images.njk +31 -29
- package/components/card/example-card-set-with-lists.njk +58 -56
- package/components/card/example-card-set.njk +28 -26
- package/components/card/example-card.njk +9 -7
- package/components/char-check-limit/_macro.njk +1 -3
- package/components/checkboxes/_checkbox-macro.njk +19 -15
- package/components/checkboxes/_macro.njk +81 -72
- package/components/checkboxes/example-checkboxes-disabled.njk +30 -30
- package/components/checkboxes/example-checkboxes-error.njk +0 -1
- package/components/checkboxes/example-checkboxes-with-descriptions.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-hidden-label.njk +162 -170
- package/components/checkboxes/example-checkboxes-with-revealed-checkboxes-expanded.njk +81 -81
- package/components/checkboxes/example-checkboxes-with-revealed-checkboxes.njk +79 -79
- package/components/checkboxes/example-checkboxes-with-revealed-select-expanded.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-revealed-select.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-revealed-text-input-expanded.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-revealed-text-input.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-select-all-button.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-visible-text-input.njk +7 -5
- package/components/checkboxes/example-checkboxes.njk +7 -5
- package/components/content-pagination/_macro.njk +34 -32
- package/components/content-pagination/example-content-pagination.njk +17 -17
- package/components/cookies-banner/_macro.njk +19 -6
- package/components/cookies-banner/example-cookies-banner-cymraeg.njk +2 -1
- package/components/cookies-banner/example-cookies-banner.njk +3 -4
- package/components/date-input/_macro.njk +71 -63
- package/components/date-input/example-date-input-error-for-single-field.njk +0 -1
- package/components/date-input/example-date-input-error.njk +0 -1
- package/components/description-list/_macro.njk +20 -11
- package/components/details/_macro.njk +18 -11
- package/components/details/example-details-with-warning.njk +15 -10
- package/components/document-list/_macro.njk +102 -93
- package/components/document-list/example-document-list-article-featured.njk +27 -25
- package/components/document-list/example-document-list-articles.njk +55 -53
- package/components/document-list/example-document-list-downloads.njk +49 -47
- package/components/document-list/example-document-list-search-result-featured.njk +19 -17
- package/components/document-list/example-document-list-search-results.njk +60 -58
- package/components/duration/_macro.njk +61 -55
- package/components/duration/example-duration-error-for-single-field.njk +28 -26
- package/components/duration/example-duration-single-field.njk +23 -19
- package/components/duration/example-duration.njk +33 -29
- package/components/error/_macro.njk +8 -6
- package/components/external-link/_macro.njk +7 -5
- package/components/external-link/example-external-link.njk +9 -6
- package/components/feedback/_macro.njk +7 -5
- package/components/field/_macro.njk +2 -2
- package/components/fieldset/_macro.njk +23 -16
- package/components/footer/_macro.njk +28 -21
- package/components/footer/_macro.spec.js +1 -1
- package/components/footer/example-footer-cymraeg.njk +2 -1
- package/components/footer/example-footer-default.njk +3 -4
- package/components/footer/example-footer-transactional.njk +2 -1
- package/components/footer/example-footer-warning.njk +2 -1
- package/components/footer/example-footer-with-alternative-organisation.njk +2 -1
- package/components/footer/example-footer-with-coat-of-arms.njk +2 -1
- package/components/footer/example-footer-with-copyright.njk +2 -1
- package/components/footer/example-footer.njk +2 -1
- package/components/header/_header.scss +24 -19
- package/components/header/_macro.njk +183 -141
- package/components/header/example-header-default.njk +2 -1
- package/components/header/example-header-external-for-survey-with-description.njk +2 -1
- package/components/header/example-header-external-for-surveys.njk +2 -1
- package/components/header/example-header-external-welsh.njk +7 -7
- package/components/header/example-header-external-with-navigation-and-search.njk +3 -2
- package/components/header/example-header-external-with-navigation.njk +2 -1
- package/components/header/example-header-external-with-service-links.njk +2 -1
- package/components/header/example-header-external-with-sub-navigation-removed.njk +2 -1
- package/components/header/example-header-external-with-sub-navigation.njk +3 -2
- package/components/header/example-header-internal.njk +2 -1
- package/components/header/example-header-multiple-logos.njk +2 -1
- package/components/header/{example-header-neutral-for-multicoloured-logo.njk → example-header-neutral.njk} +2 -1
- package/components/helpers/grid.njk +17 -16
- package/components/hero/_macro.njk +6 -11
- package/components/hero/example-hero-dark.njk +2 -1
- package/components/hero/example-hero-default.njk +2 -1
- package/components/icon/_macro.njk +601 -168
- package/components/image/_macro.njk +7 -5
- package/components/input/_macro.njk +114 -95
- package/components/input/example-input-search-with-character-check.njk +1 -1
- package/components/input/example-input-search-with-placeholder.njk +1 -1
- package/components/input/example-input-search.njk +1 -1
- package/components/label/_macro.njk +32 -26
- package/components/language-selector/_macro.njk +11 -2
- package/components/list/_list.scss +13 -0
- package/components/list/_macro.njk +93 -73
- package/components/message/_macro.njk +20 -7
- package/components/message-list/_macro.njk +26 -20
- package/components/modal/_macro.njk +11 -12
- package/components/multiple-input-fields/_macro.njk +30 -28
- package/components/mutually-exclusive/_macro.njk +20 -13
- package/components/mutually-exclusive/example-mutually-exclusive-checkboxes.njk +6 -4
- package/components/mutually-exclusive/example-mutually-exclusive-date.njk +7 -5
- package/components/mutually-exclusive/example-mutually-exclusive-duration.njk +44 -40
- package/components/mutually-exclusive/example-mutually-exclusive-email.njk +7 -5
- package/components/mutually-exclusive/example-mutually-exclusive-multiple-options.njk +6 -4
- package/components/mutually-exclusive/example-mutually-exclusive-number.njk +6 -4
- package/components/mutually-exclusive/example-mutually-exclusive-textarea.njk +6 -4
- package/components/navigation/_macro.njk +133 -67
- package/components/navigation/_navigation.scss +0 -9
- package/components/pagination/_macro.njk +42 -20
- package/components/panel/_macro.njk +27 -16
- package/components/panel/example-panel-bare.njk +6 -4
- package/components/panel/example-panel-with-announcement.njk +7 -4
- package/components/panel/example-panel-with-error-summary.njk +6 -4
- package/components/panel/example-panel-with-warning.njk +5 -3
- package/components/password/_macro.njk +7 -5
- package/components/phase-banner/_macro.njk +3 -3
- package/components/phase-banner/example-phase-banner-alpha.njk +2 -1
- package/components/phase-banner/example-phase-banner-beta.njk +4 -3
- package/components/question/_macro.njk +62 -47
- package/components/question/example-question-ccs.njk +40 -35
- package/components/question/example-question-fieldset.njk +84 -80
- package/components/question/example-question-interviewer-note.njk +27 -24
- package/components/question/example-question-no-fieldset.njk +39 -33
- package/components/quote/_macro.njk +3 -1
- package/components/radios/_macro.njk +54 -36
- package/components/radios/_macro.spec.js +21 -0
- package/components/radios/example-radios-with-clear-button-expanded.njk +6 -4
- package/components/radios/example-radios-with-clear-button.njk +6 -4
- package/components/radios/example-radios-with-descriptions.njk +7 -5
- package/components/radios/example-radios-with-revealed-select-expanded.njk +6 -4
- package/components/radios/example-radios-with-revealed-select.njk +6 -4
- package/components/radios/example-radios-with-revealed-text-area-expanded.njk +7 -5
- package/components/radios/example-radios-with-revealed-text-area.njk +7 -5
- package/components/radios/example-radios-with-revealed-text-input-expanded.njk +7 -5
- package/components/radios/example-radios-with-revealed-text-input.njk +7 -5
- package/components/radios/example-radios-with-separator.njk +6 -4
- package/components/radios/example-radios-with-visible-text-input.njk +7 -5
- package/components/radios/example-radios-without-border.njk +0 -1
- package/components/radios/example-radios.njk +7 -5
- package/components/related-content/_macro.njk +10 -11
- package/components/related-content/_section-macro.njk +7 -7
- package/components/related-content/example-related-content-general.njk +5 -3
- package/components/related-content/example-related-content-multiple-rows-of-links.njk +51 -49
- package/components/related-content/example-related-content-social-media.njk +40 -38
- package/components/relationships/_macro.njk +10 -8
- package/components/relationships/example-relationships-error.njk +176 -168
- package/components/relationships/example-relationships-you.njk +169 -163
- package/components/relationships/example-relationships.njk +167 -161
- package/components/section-navigation/_macro.njk +34 -12
- package/components/section-navigation/example-section-navigation-single-vertical-with-title.njk +23 -0
- package/components/select/_macro.njk +21 -18
- package/components/share-page/_macro.njk +10 -5
- package/components/skip-to-content/_macro.njk +1 -1
- package/components/skip-to-content/example-skip-to-content.njk +1 -0
- package/components/status/_macro.njk +1 -1
- package/components/summary/_macro.njk +53 -23
- package/components/summary/example-summary-household-no-rows.njk +18 -16
- package/components/summary/example-summary-household.njk +75 -73
- package/components/summary/example-summary-hub-minimal.njk +74 -72
- package/components/summary/example-summary-hub.njk +169 -167
- package/components/table/_macro.njk +72 -45
- package/components/table-of-contents/_macro.njk +34 -32
- package/components/table-of-contents/example-table-of-contents-grouped.njk +1 -1
- package/components/table-of-contents/example-table-of-contents-single.njk +1 -1
- package/components/table-of-contents/example-table-of-contents-sticky-full-page.njk +79 -38
- package/components/table-of-contents/example-table-of-contents-sticky.njk +50 -13
- package/components/tabs/_macro.njk +12 -6
- package/components/tabs/example-tabs-details.njk +5 -6
- package/components/text-indent/_macro.njk +1 -3
- package/components/textarea/_macro.njk +49 -46
- package/components/textarea/_macro.spec.js +0 -11
- package/components/timeline/_macro.njk +4 -6
- package/components/timeout-modal/_macro.njk +21 -19
- package/components/timeout-modal/example-timeout-modal.njk +16 -14
- package/components/timeout-panel/_macro.njk +19 -17
- package/components/timeout-panel/example-panel-with-timeout-warning.njk +13 -11
- package/components/upload/_macro.njk +20 -16
- package/components/video/_macro.njk +16 -2
- package/components/video/example-video.njk +2 -2
- package/css/main.css +1 -1
- package/layout/_dsTemplate.njk +22 -20
- package/layout/_template.njk +63 -49
- package/package.json +4 -3
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/overrides/hcm.scss +1 -1
- package/scss/vars/_colors.scss +1 -1
|
@@ -2,16 +2,19 @@
|
|
|
2
2
|
{% if params.lang == "cy" %}
|
|
3
3
|
{% set bannerLeadingText = 'Nid yw’r wefan hon yn cefnogi eich porwr mwyach.' %}
|
|
4
4
|
{% set bannerLinkUrl = 'https://cy.ons.gov.uk/help/browsers' %}
|
|
5
|
-
{% set
|
|
5
|
+
{% set bannerCta = 'Gallwch <a class="ons-browser-banner__link" href="' + bannerLinkUrl + '">ddiweddaru eich porwr i’r fersiwn ddiweddaraf</a>.' %}
|
|
6
6
|
{% else %}
|
|
7
7
|
{% set bannerLeadingText = 'This website no longer supports your browser.' %}
|
|
8
8
|
{% set bannerLinkUrl = 'https://www.ons.gov.uk/help/browsers' %}
|
|
9
|
-
{% set
|
|
9
|
+
{% set bannerCta = 'You can <a class="ons-browser-banner__link" href="' + bannerLinkUrl + '">upgrade your browser to the latest version</a>.' %}
|
|
10
10
|
{% endif %}
|
|
11
11
|
|
|
12
12
|
<div class="ons-browser-banner">
|
|
13
13
|
<div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
|
|
14
|
-
<p class="ons-browser-banner__content"
|
|
14
|
+
<p class="ons-browser-banner__content">
|
|
15
|
+
<span class="ons-browser-banner__lead">{{ bannerLeadingText }}</span
|
|
16
|
+
><span class="ons-browser-banner__cta"> {{ bannerCta | safe }}</span>
|
|
17
|
+
</p>
|
|
15
18
|
</div>
|
|
16
19
|
</div>
|
|
17
20
|
{% endmacro %}
|
|
@@ -285,6 +285,7 @@ $button-shadow-size: 3px;
|
|
|
285
285
|
&--ghost-dark,
|
|
286
286
|
&--dropdown,
|
|
287
287
|
&--text-link,
|
|
288
|
+
&--neutral,
|
|
288
289
|
&--disabled,
|
|
289
290
|
&--loader.ons-is-loading {
|
|
290
291
|
&:active,
|
|
@@ -302,7 +303,8 @@ $button-shadow-size: 3px;
|
|
|
302
303
|
&--ghost:focus:hover,
|
|
303
304
|
&--ghost-dark:focus:hover,
|
|
304
305
|
&--dropdown:focus:hover,
|
|
305
|
-
&--text-link:focus:hover
|
|
306
|
+
&--text-link:focus:hover,
|
|
307
|
+
&--neutral:focus:hover {
|
|
306
308
|
outline: none;
|
|
307
309
|
}
|
|
308
310
|
|
|
@@ -515,6 +517,39 @@ $button-shadow-size: 3px;
|
|
|
515
517
|
}
|
|
516
518
|
}
|
|
517
519
|
}
|
|
520
|
+
|
|
521
|
+
&--neutral &,
|
|
522
|
+
&--neutral:hover &,
|
|
523
|
+
&--neutral:active &,
|
|
524
|
+
&--neutral.active & {
|
|
525
|
+
&__inner {
|
|
526
|
+
background: transparent;
|
|
527
|
+
border: 0;
|
|
528
|
+
border-radius: 0;
|
|
529
|
+
box-shadow: none;
|
|
530
|
+
color: var(--ons-color-black);
|
|
531
|
+
font-weight: $font-weight-regular;
|
|
532
|
+
padding: 2px;
|
|
533
|
+
.ons-icon {
|
|
534
|
+
fill: var(--ons-color-black);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
&--neutral:focus &,
|
|
540
|
+
&--neutral:active:focus &,
|
|
541
|
+
&--neutral.active:focus & {
|
|
542
|
+
&__inner {
|
|
543
|
+
background-color: var(--ons-color-focus);
|
|
544
|
+
box-shadow:
|
|
545
|
+
0 -2px var(--ons-color-focus),
|
|
546
|
+
0 4px var(--ons-color-text-link-focus) !important;
|
|
547
|
+
color: var(--ons-color-text-link-focus);
|
|
548
|
+
.ons-icon {
|
|
549
|
+
fill: var(--ons-color-text-link-focus);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
518
553
|
}
|
|
519
554
|
|
|
520
555
|
.ons-btn-group {
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
{% endif %}
|
|
14
14
|
{% elif params.iconType is not defined and params.noIcon is not defined %}
|
|
15
15
|
{% if params.url and params.newWindow %}
|
|
16
|
-
|
|
16
|
+
{# CTA link opening in new tab #}
|
|
17
17
|
{% set iconType = "external-link" %}
|
|
18
18
|
{% set iconPosition = "after" %}
|
|
19
19
|
{% elif params.url %}
|
|
20
|
-
|
|
20
|
+
{# CTA link #}
|
|
21
21
|
{% set iconType = "arrow-next" %}
|
|
22
22
|
{% set iconPosition = "after" %}
|
|
23
23
|
{% endif %}
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
{% endif %}
|
|
40
40
|
{% set iconType = "print" %}
|
|
41
41
|
{% set iconPosition = "before" %}
|
|
42
|
-
{% set variantClasses = "ons-u-d-no ons-js-print-btn" %}
|
|
42
|
+
{% set variantClasses = " ons-u-d-no ons-js-print-btn" %}
|
|
43
43
|
{% elif 'download' in params.variants %}
|
|
44
44
|
{# Download #}
|
|
45
45
|
{% set iconType = "download" %}
|
|
@@ -55,74 +55,75 @@
|
|
|
55
55
|
{% set variantAttributes = "disabled" %}
|
|
56
56
|
{% elif 'timer' in params.variants %}
|
|
57
57
|
{# Timer #}
|
|
58
|
-
{% set variantClasses = "ons-js-timer ons-js-submit-btn" %}
|
|
58
|
+
{% set variantClasses = " ons-js-timer ons-js-submit-btn" %}
|
|
59
59
|
{% elif 'loader' in params.variants %}
|
|
60
60
|
{# Loader #}
|
|
61
61
|
{% set iconType = "loader" %}
|
|
62
62
|
{% set iconPosition = "after" %}
|
|
63
|
-
{% set variantClasses = "ons-btn--loader ons-js-loader ons-js-submit-btn" %}
|
|
63
|
+
{% set variantClasses = " ons-btn--loader ons-js-loader ons-js-submit-btn" %}
|
|
64
64
|
{% endif %}
|
|
65
65
|
{% endif %}
|
|
66
|
-
|
|
67
66
|
{% set tag = "a" if params.url else "button" %}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
{{-
|
|
88
|
-
onsIcon({
|
|
89
|
-
"iconType": iconType,
|
|
90
|
-
"classes": 'ons-u-mr-xs'
|
|
91
|
-
})
|
|
92
|
-
-}}
|
|
93
|
-
{% endif -%}
|
|
94
|
-
<span class="ons-btn__text">{{- params.html | safe if params.html else params.text -}}</span>
|
|
95
|
-
{%- if iconPosition == "after" %}
|
|
96
|
-
{{-
|
|
97
|
-
onsIcon({
|
|
98
|
-
"iconType": iconType,
|
|
99
|
-
"classes": 'ons-u-ml-xs'
|
|
100
|
-
})
|
|
101
|
-
-}}
|
|
102
|
-
{% endif -%}
|
|
103
|
-
{% elif iconPosition == "only" -%}
|
|
67
|
+
{% set openingTag = "<" + tag %}
|
|
68
|
+
{% set closingTag = "</" + tag + ">" %}
|
|
69
|
+
{{ openingTag | safe }}
|
|
70
|
+
{% if params.url %}
|
|
71
|
+
href="{{ params.url }}" role="button"
|
|
72
|
+
{% else %}
|
|
73
|
+
type="{{ buttonType }}"
|
|
74
|
+
{% endif %}
|
|
75
|
+
class="ons-btn{{ ' ' + params.classes if params.classes else '' }}{% if params.variants and params.variants is not string %}{% for variant in params.variants %}{{ ' ' }}ons-btn--{{ variant }}{% endfor %}{% else %}{{ ' ' }}ons-btn--{{ params.variants }}{% endif %}{{ ' ons-btn--link ons-js-submit-btn' if params.url }}{{ variantClasses }}"
|
|
76
|
+
{% if params.id %}id="{{ params.id }}"{% endif %}
|
|
77
|
+
{% if params.value and tag != "a" %}value="{{ params.value }}"{% endif %}
|
|
78
|
+
{% if params.name and tag != "a" %}name="{{ params.name }}"{% endif %}
|
|
79
|
+
{% if params.url and params.newWindow %}target="_blank" rel="noopener"{% endif %}
|
|
80
|
+
{{ variantAttributes }}
|
|
81
|
+
{% if params.attributes %}{% for attribute, value in (params.attributes.items() if params.attributes is mapping and params.attributes.items else params.attributes) %}{{ ' ' }}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}
|
|
82
|
+
>
|
|
83
|
+
<span class="ons-btn__inner{{ ' ' + params.innerClasses if params.innerClasses else '' }}">
|
|
84
|
+
{%- if iconPosition == "before" or iconPosition == "after" -%}
|
|
85
|
+
{%- if iconPosition == "before" -%}
|
|
104
86
|
{{-
|
|
105
87
|
onsIcon({
|
|
106
|
-
"iconType": iconType
|
|
88
|
+
"iconType": iconType,
|
|
89
|
+
"classes": 'ons-u-mr-xs'
|
|
107
90
|
})
|
|
108
91
|
-}}
|
|
109
|
-
|
|
110
|
-
{
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
{
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
</
|
|
126
|
-
{
|
|
127
|
-
|
|
92
|
+
{%- endif -%}
|
|
93
|
+
<span class="ons-btn__text">{{- params.html | safe if params.html else params.text -}}</span>
|
|
94
|
+
{%- if iconPosition == "after" -%}
|
|
95
|
+
{{-
|
|
96
|
+
onsIcon({
|
|
97
|
+
"iconType": iconType,
|
|
98
|
+
"classes": 'ons-u-ml-xs'
|
|
99
|
+
})
|
|
100
|
+
-}}
|
|
101
|
+
{%- endif -%}
|
|
102
|
+
{%- elif iconPosition == "only" -%}
|
|
103
|
+
{{-
|
|
104
|
+
onsIcon({
|
|
105
|
+
"iconType": iconType
|
|
106
|
+
})
|
|
107
|
+
-}}
|
|
108
|
+
<span class="ons-btn__text ons-u-vh@xxs@s">{{- params.html | safe if params.html else params.text -}}</span>
|
|
109
|
+
{%- else -%}
|
|
110
|
+
<span class="ons-btn__text">{{- params.html | safe if params.html else params.text -}}</span>
|
|
111
|
+
{%- endif -%}
|
|
112
|
+
</span>
|
|
113
|
+
{% if params.url and params.newWindow %}
|
|
114
|
+
<span class="ons-btn__new-window-description ons-u-vh"> ({{ params.newWindowDescription | default("opens in a new tab") }})</span>
|
|
115
|
+
{% endif %}
|
|
116
|
+
{% if params.buttonContext %}
|
|
117
|
+
<span class="ons-btn__context ons-u-vh">{{ params.buttonContext }}</span>
|
|
118
|
+
{% endif %}
|
|
119
|
+
{% if params.listeners %}
|
|
120
|
+
<!-- prettier-ignore-start -->
|
|
121
|
+
<script{% if csp_nonce %} nonce="{{ csp_nonce() }}"{% endif %}>
|
|
122
|
+
{% for listener, value in (params.listeners.items() if params.listeners is mapping and params.listeners.items else params.listeners) %}
|
|
123
|
+
document.getElementById("{{ params.id }}").addEventListener('{{ listener }}', function(){ {{ value }} });
|
|
124
|
+
{% endfor %}
|
|
125
|
+
</script>
|
|
126
|
+
<!-- prettier-ignore-end -->
|
|
127
|
+
{% endif %}
|
|
128
|
+
{{ closingTag | safe }}
|
|
128
129
|
{% endmacro %}
|
|
@@ -10,11 +10,13 @@
|
|
|
10
10
|
{% endif %}
|
|
11
11
|
</div>
|
|
12
12
|
<div class="ons-grid__col ons-col-auto ons-u-flex-no-grow ons-u-mt-xs@xxs@s">
|
|
13
|
-
{{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
{{
|
|
14
|
+
onsButton({
|
|
15
|
+
"text": params.button.text,
|
|
16
|
+
"url": params.button.url,
|
|
17
|
+
"variants": "small"
|
|
18
|
+
})
|
|
19
|
+
}}
|
|
18
20
|
</div>
|
|
19
21
|
</div>
|
|
20
22
|
</div>
|
|
@@ -1,24 +1,42 @@
|
|
|
1
1
|
{%- macro onsCard(params) -%}
|
|
2
|
-
|
|
3
|
-
{% set
|
|
2
|
+
{% set headingLevel = params.headingLevel | default(2) | string %}
|
|
3
|
+
{% set openingHeadingTag = "<h" + headingLevel %}
|
|
4
|
+
{% set closingHeadingTag = "</h" + headingLevel + ">" %}
|
|
5
|
+
{% set placeholderSrcset = (params.image.placeholderURL if params.image.placeholderURL) + "/img/small/placeholder-card.png 1x, " + (params.image.placeholderURL if params.image.placeholderURL else "") + "/img/large/placeholder-card.png 2x" %}
|
|
4
6
|
|
|
5
7
|
<div class="ons-card">
|
|
6
8
|
<a href="{{ params.url }}" class="ons-card__link">
|
|
7
9
|
{%- if params.image -%}
|
|
8
10
|
{% if params.image.smallSrc %}
|
|
9
|
-
<img
|
|
11
|
+
<img
|
|
12
|
+
class="ons-card__image ons-u-mb-s"
|
|
13
|
+
height="200"
|
|
14
|
+
width="303"
|
|
15
|
+
{% if params.image.largeSrc %}srcset="{{ params.image.smallSrc }} 1x, {{ params.image.largeSrc }} 2x"{% endif %}
|
|
16
|
+
src="{{ params.image.smallSrc }}"
|
|
17
|
+
alt="{{ params.image.alt }}"
|
|
18
|
+
loading="lazy"
|
|
19
|
+
/>
|
|
10
20
|
{% elif params.image == true or params.image.placeholderURL %}
|
|
11
|
-
<img
|
|
21
|
+
<img
|
|
22
|
+
class="ons-card__image ons-u-mb-s "
|
|
23
|
+
height="100"
|
|
24
|
+
width="303"
|
|
25
|
+
srcset="{{ placeholderSrcset }}"
|
|
26
|
+
src="{{- params.image.placeholderURL if params.image.placeholderURL -}}/img/small/placeholder-card.png"
|
|
27
|
+
alt=""
|
|
28
|
+
loading="lazy"
|
|
29
|
+
/>
|
|
12
30
|
{% endif %}
|
|
13
31
|
{%- endif -%}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
32
|
+
{{ openingHeadingTag | safe }}
|
|
33
|
+
class="ons-card__title {{ params.titleClasses | default('ons-u-fs-m') }}" id="{{ params.id }}"> {{ params.title }}
|
|
34
|
+
{{ closingHeadingTag | safe }}
|
|
17
35
|
</a>
|
|
18
36
|
|
|
19
37
|
<p id="{{ params.textId }}">{{ params.text }}</p>
|
|
20
38
|
|
|
21
|
-
{
|
|
39
|
+
{%- if params.itemsList -%}
|
|
22
40
|
{% from "components/list/_macro.njk" import onsList %}
|
|
23
41
|
{{
|
|
24
42
|
onsList({
|
|
@@ -27,7 +45,5 @@
|
|
|
27
45
|
})
|
|
28
46
|
}}
|
|
29
47
|
{% endif %}
|
|
30
|
-
|
|
31
48
|
</div>
|
|
32
|
-
|
|
33
49
|
{%- endmacro -%}
|
|
@@ -1,41 +1,43 @@
|
|
|
1
1
|
{% from "components/card/_macro.njk" import onsCard %}
|
|
2
2
|
<div class="ons-container">
|
|
3
|
-
|
|
4
|
-
<div class="ons-grid ons-grid--column@xxs@s">
|
|
5
|
-
|
|
3
|
+
<div class="ons-grid">
|
|
6
4
|
<div class="ons-grid__col ons-col-4@m">
|
|
7
|
-
{{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
{{
|
|
6
|
+
onsCard({
|
|
7
|
+
"id": 'card-with-image-1',
|
|
8
|
+
"textId": 'text1',
|
|
9
|
+
"title": 'About the census',
|
|
10
|
+
"url": '#0',
|
|
11
|
+
"text": 'The census is a survey that gives us information about all the households in England and Wales.',
|
|
12
|
+
"image": true
|
|
13
|
+
})
|
|
14
|
+
}}
|
|
15
15
|
</div>
|
|
16
16
|
|
|
17
17
|
<div class="ons-grid__col ons-col-4@m">
|
|
18
|
-
{{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
{{
|
|
19
|
+
onsCard({
|
|
20
|
+
"id": 'card-with-image-2',
|
|
21
|
+
"textId": 'text2',
|
|
22
|
+
"title": 'Working on the census',
|
|
23
|
+
"url": '#0',
|
|
24
|
+
"text": 'For Census 2021, we’ll be hiring at least 30,000 field staff across England and Wales.',
|
|
25
|
+
"image": true
|
|
26
|
+
})
|
|
27
|
+
}}
|
|
26
28
|
</div>
|
|
27
29
|
|
|
28
30
|
<div class="ons-grid__col ons-col-4@m">
|
|
29
|
-
{{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
{{
|
|
32
|
+
onsCard({
|
|
33
|
+
"id": 'card-with-image-3',
|
|
34
|
+
"textId": 'text3',
|
|
35
|
+
"title": 'Your data and security',
|
|
36
|
+
"url": '#0',
|
|
37
|
+
"text": 'How we keep your data safe and what happens to your personal information.',
|
|
38
|
+
"image": true
|
|
39
|
+
})
|
|
40
|
+
}}
|
|
37
41
|
</div>
|
|
38
|
-
|
|
39
42
|
</div>
|
|
40
|
-
|
|
41
43
|
</div>
|
|
@@ -1,68 +1,70 @@
|
|
|
1
1
|
{% from "components/card/_macro.njk" import onsCard %}
|
|
2
2
|
<div class="ons-container">
|
|
3
|
-
|
|
4
|
-
<div class="ons-grid ons-grid--column@xxs@s">
|
|
5
|
-
|
|
3
|
+
<div class="ons-grid">
|
|
6
4
|
<div class="ons-grid__col ons-col-4@m">
|
|
7
|
-
{{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
{{
|
|
6
|
+
onsCard({
|
|
7
|
+
"id": 'card-with-list-1',
|
|
8
|
+
"textId": 'text1',
|
|
9
|
+
"title": 'About the census',
|
|
10
|
+
"url": '#0',
|
|
11
|
+
"text": 'The census is a survey that gives us information about all the households in England and Wales.',
|
|
12
|
+
"itemsList": [
|
|
13
|
+
{
|
|
14
|
+
"url": '#0',
|
|
15
|
+
"text": 'List item 1 about the census'
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"url": '#0',
|
|
19
|
+
"text": 'List item 2 about the census'
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
})
|
|
23
|
+
}}
|
|
24
24
|
</div>
|
|
25
25
|
|
|
26
26
|
<div class="ons-grid__col ons-col-4@m">
|
|
27
|
-
{{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
27
|
+
{{
|
|
28
|
+
onsCard({
|
|
29
|
+
"id": 'card-with-list-2',
|
|
30
|
+
"textId": 'text2',
|
|
31
|
+
"title": 'Working on the census',
|
|
32
|
+
"url": '#0',
|
|
33
|
+
"text": 'For Census 2021, we’ll be hiring at least 30,000 field staff across England and Wales.',
|
|
34
|
+
"itemsList": [
|
|
35
|
+
{
|
|
36
|
+
"url": '#0',
|
|
37
|
+
"text": 'List item 1 about working on the census'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"url": '#0',
|
|
41
|
+
"text": 'List item 2 about working on the census'
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
})
|
|
45
|
+
}}
|
|
44
46
|
</div>
|
|
45
47
|
|
|
46
48
|
<div class="ons-grid__col ons-col-4@m">
|
|
47
|
-
{{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
49
|
+
{{
|
|
50
|
+
onsCard({
|
|
51
|
+
"id": 'card-with-list-3',
|
|
52
|
+
"textId": 'text3',
|
|
53
|
+
"title": 'Your data and security',
|
|
54
|
+
"url": '#0',
|
|
55
|
+
"text": 'How we keep your data safe and what happens to your personal information.',
|
|
56
|
+
"itemsList": [
|
|
57
|
+
{
|
|
58
|
+
"url": '#0',
|
|
59
|
+
"text": 'List item 1 about your data and security'
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"url": '#0',
|
|
63
|
+
"text": 'List item 2 about your data and security'
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
})
|
|
67
|
+
}}
|
|
64
68
|
</div>
|
|
65
|
-
|
|
66
69
|
</div>
|
|
67
|
-
|
|
68
70
|
</div>
|
|
@@ -1,38 +1,40 @@
|
|
|
1
1
|
{% from "components/card/_macro.njk" import onsCard %}
|
|
2
2
|
<div class="ons-container">
|
|
3
|
-
|
|
4
|
-
<div class="ons-grid ons-grid--column@xxs@s">
|
|
5
|
-
|
|
3
|
+
<div class="ons-grid">
|
|
6
4
|
<div class="ons-grid__col ons-col-4@m">
|
|
7
|
-
{{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
{{
|
|
6
|
+
onsCard({
|
|
7
|
+
"id": 'card-set-1',
|
|
8
|
+
"textId": 'text1',
|
|
9
|
+
"title": 'About the census',
|
|
10
|
+
"url": '#0',
|
|
11
|
+
"text": 'The census is a survey that gives us information about all the households in England and Wales.'
|
|
12
|
+
})
|
|
13
|
+
}}
|
|
14
14
|
</div>
|
|
15
15
|
|
|
16
16
|
<div class="ons-grid__col ons-col-4@m">
|
|
17
|
-
{{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
{{
|
|
18
|
+
onsCard({
|
|
19
|
+
"id": 'card-set-2',
|
|
20
|
+
"textId": 'text2',
|
|
21
|
+
"title": 'Working on the census',
|
|
22
|
+
"url": '#0',
|
|
23
|
+
"text": 'For Census 2021, we’ll be hiring at least 30,000 field staff across England and Wales.'
|
|
24
|
+
})
|
|
25
|
+
}}
|
|
24
26
|
</div>
|
|
25
27
|
|
|
26
28
|
<div class="ons-grid__col ons-col-4@m">
|
|
27
|
-
{{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
{{
|
|
30
|
+
onsCard({
|
|
31
|
+
"id": 'card-set-3',
|
|
32
|
+
"textId": 'text3',
|
|
33
|
+
"title": 'Your data and security',
|
|
34
|
+
"url": '#0',
|
|
35
|
+
"text": 'How we keep your data safe and what happens to your personal information.'
|
|
36
|
+
})
|
|
37
|
+
}}
|
|
34
38
|
</div>
|
|
35
|
-
|
|
36
39
|
</div>
|
|
37
|
-
|
|
38
40
|
</div>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{% from "components/card/_macro.njk" import onsCard %}
|
|
2
2
|
|
|
3
|
-
{{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
{{
|
|
4
|
+
onsCard({
|
|
5
|
+
"id": 'card-example',
|
|
6
|
+
"textId": 'text',
|
|
7
|
+
"title": 'Your data and security',
|
|
8
|
+
"url": '#0',
|
|
9
|
+
"text": 'How we keep your data safe and what happens to your personal information.'
|
|
10
|
+
})
|
|
11
|
+
}}
|