@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
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
{% from "components/question/_macro.njk" import onsQuestion %}
|
|
2
2
|
{% from "components/duration/_macro.njk" import onsDuration %}
|
|
3
3
|
|
|
4
|
-
{%
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"id": "address-duration-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
{%
|
|
5
|
+
call onsQuestion({
|
|
6
|
+
"title": "How many years have you lived at this address?",
|
|
7
|
+
"description": "<p>Enter “0” into the years field if you have lived at this address for less than a year</p>",
|
|
8
|
+
"legendIsQuestionTitle": true
|
|
9
|
+
})
|
|
10
|
+
%}
|
|
11
|
+
{{
|
|
12
|
+
onsDuration({
|
|
13
|
+
"id": "address-duration-example-single",
|
|
14
|
+
"dontWrap": true,
|
|
15
|
+
"field1": {
|
|
16
|
+
"id": "address-duration-years-example",
|
|
17
|
+
"name": "address-duration-years",
|
|
18
|
+
"suffix": {
|
|
19
|
+
"text": "Years",
|
|
20
|
+
"id": "address-duration-years-suffix-example"
|
|
21
|
+
},
|
|
22
|
+
"attributes": {
|
|
23
|
+
"autocomplete": "off"
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
26
|
+
})
|
|
27
|
+
}}
|
|
24
28
|
{% endcall %}
|
|
@@ -1,35 +1,39 @@
|
|
|
1
1
|
{% from "components/question/_macro.njk" import onsQuestion %}
|
|
2
2
|
{% from "components/duration/_macro.njk" import onsDuration %}
|
|
3
3
|
|
|
4
|
-
{%
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"id": "address-duration-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
4
|
+
{%
|
|
5
|
+
call onsQuestion({
|
|
6
|
+
"title": "How long have you lived at this address?",
|
|
7
|
+
"description": "<p>Enter “0” into the years field if you have lived at this address for less than a year</p>",
|
|
8
|
+
"legendIsQuestionTitle": true
|
|
9
|
+
})
|
|
10
|
+
%}
|
|
11
|
+
{{
|
|
12
|
+
onsDuration({
|
|
13
|
+
"id": "address-duration-example",
|
|
14
|
+
"dontWrap": true,
|
|
15
|
+
"field1": {
|
|
16
|
+
"id": "address-duration-years-example",
|
|
17
|
+
"name": "address-duration-years",
|
|
18
|
+
"suffix": {
|
|
19
|
+
"text": "Years",
|
|
20
|
+
"id": "address-duration-years-suffix-example"
|
|
21
|
+
},
|
|
22
|
+
"attributes": {
|
|
23
|
+
"autocomplete": "off"
|
|
24
|
+
}
|
|
18
25
|
},
|
|
19
|
-
"
|
|
20
|
-
"
|
|
26
|
+
"field2": {
|
|
27
|
+
"id": "address-duration-months-example",
|
|
28
|
+
"name": "address-duration-months",
|
|
29
|
+
"suffix": {
|
|
30
|
+
"text": "Months",
|
|
31
|
+
"id": "address-duration-months-suffix-example"
|
|
32
|
+
},
|
|
33
|
+
"attributes": {
|
|
34
|
+
"autocomplete": "off"
|
|
35
|
+
}
|
|
21
36
|
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
"id": "address-duration-months-example",
|
|
25
|
-
"name": "address-duration-months",
|
|
26
|
-
"suffix": {
|
|
27
|
-
"text": "Months",
|
|
28
|
-
"id": "address-duration-months-suffix-example"
|
|
29
|
-
},
|
|
30
|
-
"attributes": {
|
|
31
|
-
"autocomplete": "off"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}) }}
|
|
37
|
+
})
|
|
38
|
+
}}
|
|
35
39
|
{% endcall %}
|
|
@@ -4,17 +4,19 @@
|
|
|
4
4
|
{% set content %}
|
|
5
5
|
<p
|
|
6
6
|
class="ons-panel__error"
|
|
7
|
-
{% 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 %}
|
|
7
|
+
{% 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 %}
|
|
8
8
|
>
|
|
9
9
|
<strong>{{ params.text }}</strong>
|
|
10
10
|
</p>
|
|
11
11
|
{{ caller() }}
|
|
12
12
|
{% endset %}
|
|
13
13
|
|
|
14
|
-
{%
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
{%
|
|
15
|
+
call onsPanel({
|
|
16
|
+
"variant": "error",
|
|
17
|
+
"id": params.id
|
|
18
|
+
})
|
|
19
|
+
%}
|
|
20
|
+
{{ content | safe }}
|
|
19
21
|
{% endcall %}
|
|
20
22
|
{% endmacro %}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{% from "components/icon/_macro.njk" import onsIcon %}
|
|
2
2
|
|
|
3
3
|
{% macro onsExternalLink(params) %}
|
|
4
|
-
<a href="{{ params.url }}" class="ons-external-link{
|
|
5
|
-
<span class="ons-external-link__text">
|
|
6
|
-
{{-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
<a href="{{ params.url }}" class="ons-external-link{{ ' ' + params.classes if params.classes else '' }}" target="_blank" rel="noopener">
|
|
5
|
+
<span class="ons-external-link__text"> {{- params.linkText | safe -}} </span
|
|
6
|
+
><span class="ons-external-link__icon"> {{- onsIcon({"iconType": 'external-link'}) -}} </span
|
|
7
|
+
><span class="ons-external-link__new-window-description ons-u-vh"
|
|
8
|
+
>({{- params.newWindowDescription | default("opens in a new tab") -}})</span
|
|
9
|
+
></a
|
|
10
|
+
>
|
|
9
11
|
{% endmacro %}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{% from "components/external-link/_macro.njk" import onsExternalLink %}
|
|
2
2
|
|
|
3
|
-
<p>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
<p>
|
|
4
|
+
This is a paragraph of text with a
|
|
5
|
+
{{
|
|
6
|
+
onsExternalLink({
|
|
7
|
+
"url": "#0",
|
|
8
|
+
"linkText": "link to an external website"
|
|
9
|
+
})
|
|
10
|
+
}}
|
|
11
|
+
</p>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{% macro onsFeedback(params) %}
|
|
2
|
-
{% set headingLevel = params.headingLevel | default(2) %}
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
{% set headingLevel = params.headingLevel | default(2) | string %}
|
|
3
|
+
{% set openingHeadingTag = "<h" + headingLevel %}
|
|
4
|
+
{% set closingHeadingTag = "</h" + headingLevel + ">" %}
|
|
5
|
+
<div {% if params.id %}id="{{ params.id }}"{% endif %} class="ons-feedback{{ ' ' + params.classes if params.classes else '' }}">
|
|
6
|
+
{{ openingHeadingTag | safe }} class="ons-feedback__heading{{ ' ' + params.headingClasses if params.headingClasses else '' }}">
|
|
7
|
+
{{ params.heading }}
|
|
8
|
+
{{ closingHeadingTag | safe }}
|
|
7
9
|
<p class="ons-feedback__content">{{- params.content | safe -}}</p>
|
|
8
10
|
<a href="{{ params.url }}" class="ons-feedback__link">{{- params.linkText -}}</a>
|
|
9
11
|
</div>
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
{% else %}
|
|
12
12
|
<div
|
|
13
13
|
{% if params.id %}id="{{ params.id }}"{% endif %}
|
|
14
|
-
class="ons-field{
|
|
15
|
-
{% 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 %}
|
|
14
|
+
class="ons-field{{ ' ons-field--inline' if params.inline }}{{ ' ' + params.classes if params.classes else '' }}"
|
|
15
|
+
{% 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 %}
|
|
16
16
|
>
|
|
17
17
|
{{- caller() if caller -}}
|
|
18
18
|
</div>
|
|
@@ -1,42 +1,49 @@
|
|
|
1
1
|
{% from "components/error/_macro.njk" import onsError %}
|
|
2
2
|
|
|
3
3
|
{% macro onsFieldset(params) %}
|
|
4
|
-
{% set
|
|
5
|
-
{
|
|
6
|
-
{
|
|
7
|
-
<div class="ons-input-items">
|
|
8
|
-
{{- caller() if caller -}}
|
|
9
|
-
</div>
|
|
4
|
+
{% set descriptionId = (params.id ~ "-" if params.id) ~ "legend-description" %}
|
|
5
|
+
{%- set fieldset -%}
|
|
6
|
+
{%- if params.dontWrap -%}
|
|
7
|
+
<div class="ons-input-items">{{- caller() if caller -}}</div>
|
|
10
8
|
{%- elif params.legend or params.legendIsQuestionTitle -%}
|
|
11
9
|
<fieldset
|
|
12
10
|
{% if params.id %}id="{{ params.id }}"{% endif %}
|
|
13
|
-
class="ons-fieldset{
|
|
14
|
-
{% 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 %}
|
|
11
|
+
class="ons-fieldset{{ ' ' + params.classes if params.classes else '' }}"
|
|
12
|
+
{% 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 %}
|
|
15
13
|
>
|
|
16
|
-
<legend
|
|
14
|
+
<legend
|
|
15
|
+
{% if params.description %}aria-describedBy="{{ descriptionId }}"{% endif %}
|
|
16
|
+
class="ons-fieldset__legend{{ ' ons-u-mb-no' if params.legendIsQuestionTitle }}{{ ' ' + params.legendClasses if params.legendClasses else '' }}{{ ' ons-fieldset__legend--with-description' if params.description }}"
|
|
17
|
+
>
|
|
17
18
|
{%- if params.legendIsQuestionTitle -%}
|
|
18
|
-
<h1
|
|
19
|
+
<h1
|
|
20
|
+
id="fieldset-legend-title"
|
|
21
|
+
class="ons-fieldset__legend-title{{ ' ' + params.legendTitleClasses if params.legendTitleClasses else '' }}"
|
|
22
|
+
>
|
|
19
23
|
{{- params.legend | safe -}}
|
|
20
24
|
</h1>
|
|
21
25
|
{%- else -%}
|
|
22
|
-
<span class="ons-fieldset__legend-title ons-u-pb-no">{{- params.legend | safe -}}</span>
|
|
26
|
+
<span class="ons-fieldset__legend-title ons-u-pb-no"> {{- params.legend | safe -}} </span>
|
|
23
27
|
{%- endif -%}
|
|
24
28
|
</legend>
|
|
25
29
|
{%- if params.description -%}
|
|
26
|
-
<div
|
|
30
|
+
<div
|
|
31
|
+
id="{{ descriptionId }}"
|
|
32
|
+
class="ons-fieldset__description{{ ' ons-fieldset__description--title ons-u-mb-m' if params.legendIsQuestionTitle }}"
|
|
33
|
+
>
|
|
27
34
|
{{- params.description | safe -}}
|
|
28
35
|
</div>
|
|
29
36
|
{%- endif -%}
|
|
30
37
|
{{- caller() if caller -}}
|
|
31
38
|
</fieldset>
|
|
32
|
-
{%- endif
|
|
33
|
-
{%- endset
|
|
39
|
+
{%- endif -%}
|
|
40
|
+
{%- endset -%}
|
|
34
41
|
|
|
35
|
-
{
|
|
42
|
+
{%- if params.error -%}
|
|
36
43
|
{% call onsError(params.error) %}
|
|
37
44
|
{{- fieldset | safe -}}
|
|
38
45
|
{% endcall %}
|
|
39
46
|
{%- else -%}
|
|
40
47
|
{{- fieldset | safe -}}
|
|
41
|
-
{%- endif
|
|
48
|
+
{%- endif -%}
|
|
42
49
|
{% endmacro %}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
{% macro onsFooter(params) %}
|
|
2
|
-
|
|
3
2
|
{% from "components/list/_macro.njk" import onsList %}
|
|
4
3
|
{% from "components/icon/_macro.njk" import onsIcon %}
|
|
5
4
|
|
|
@@ -30,15 +29,16 @@
|
|
|
30
29
|
{% endset %}
|
|
31
30
|
|
|
32
31
|
<footer class="ons-footer">
|
|
33
|
-
|
|
34
32
|
{% if params.footerWarning %}
|
|
35
33
|
{% from "components/panel/_macro.njk" import onsPanel %}
|
|
36
34
|
<div class="ons-footer__warning">
|
|
37
35
|
<div class="ons-container">
|
|
38
|
-
{%
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
{%
|
|
37
|
+
call onsPanel({
|
|
38
|
+
"variant": "warn",
|
|
39
|
+
"classes": "ons-panel--warn--footer"
|
|
40
|
+
})
|
|
41
|
+
%}
|
|
42
42
|
{{ params.footerWarning | safe }}
|
|
43
43
|
{% endcall %}
|
|
44
44
|
</div>
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
{{
|
|
52
52
|
onsButton({
|
|
53
53
|
"id": params.button.id,
|
|
54
|
-
"classes": params.button.classes if params.button.classes
|
|
54
|
+
"classes": params.button.classes if params.button.classes,
|
|
55
55
|
"variants": "ghost",
|
|
56
56
|
"text": params.button.text,
|
|
57
57
|
"name": params.button.name,
|
|
@@ -64,7 +64,11 @@
|
|
|
64
64
|
</div>
|
|
65
65
|
{% endif %}
|
|
66
66
|
|
|
67
|
-
<div
|
|
67
|
+
<div
|
|
68
|
+
class="ons-footer__body{{ ' ' + params.classes if params.classes else '' }}"
|
|
69
|
+
data-analytics="footer"
|
|
70
|
+
{% if params.attributes %}{% for attribute, value in (params.attributes) %}{{ ' ' }}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}
|
|
71
|
+
>
|
|
68
72
|
<div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
|
|
69
73
|
<div class="ons-grid">
|
|
70
74
|
{% if params.newTabWarning %}
|
|
@@ -106,7 +110,7 @@
|
|
|
106
110
|
|
|
107
111
|
{% if (params.cols) or (params.rows) %}
|
|
108
112
|
<div class="ons-grid__col ons-u-mb-m">
|
|
109
|
-
<hr class="ons-footer__hr"
|
|
113
|
+
<hr class="ons-footer__hr" />
|
|
110
114
|
</div>
|
|
111
115
|
{% endif %}
|
|
112
116
|
</div>
|
|
@@ -139,14 +143,16 @@
|
|
|
139
143
|
{% elif params.OGLLink %}
|
|
140
144
|
{% from "components/external-link/_macro.njk" import onsExternalLink %}
|
|
141
145
|
{% if params.lang == 'cy' %}
|
|
142
|
-
{{ params.OGLLink.pre | default('Mae’r holl gynnwys ar gael o dan y') }}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
146
|
+
{{ params.OGLLink.pre | default('Mae’r holl gynnwys ar gael o dan y') }}
|
|
147
|
+
{{
|
|
148
|
+
onsExternalLink({
|
|
149
|
+
"url": params.OGLLink.url | default('https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'),
|
|
150
|
+
"linkText": params.OGLLink.link | default('Drwydded Llywodraeth Leol v3.0')
|
|
151
|
+
})
|
|
147
152
|
}}{{ params.OGLLink.post | default(', oni bai y nodir fel arall') }}
|
|
148
153
|
{% else %}
|
|
149
|
-
{{ params.OGLLink.pre | default('All content is available under the') }}
|
|
154
|
+
{{ params.OGLLink.pre | default('All content is available under the') }}
|
|
155
|
+
{{
|
|
150
156
|
onsExternalLink({
|
|
151
157
|
"url": params.OGLLink.url | default('https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'),
|
|
152
158
|
"linkText": params.OGLLink.link | default('Open Government Licence v3.0')
|
|
@@ -157,10 +163,11 @@
|
|
|
157
163
|
</div>
|
|
158
164
|
{% endif %}
|
|
159
165
|
{% if not params.poweredBy %}
|
|
160
|
-
<a
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
166
|
+
<a
|
|
167
|
+
class="ons-footer__poweredBy-link"
|
|
168
|
+
{% if lang == "cy" %}href="https://cy.ons.gov.uk/"{% else %}href="https://www.ons.gov.uk/"{% endif %}
|
|
169
|
+
>
|
|
170
|
+
<div class="ons-footer__poweredby-logo ons-u-mb-m">{{ onsLogo | safe }}</div>
|
|
164
171
|
</a>
|
|
165
172
|
{% endif %}
|
|
166
173
|
</div>
|
|
@@ -180,14 +187,14 @@
|
|
|
180
187
|
{% endif %}
|
|
181
188
|
{% if params.copyrightDeclaration %}
|
|
182
189
|
<!-- Copyright -->
|
|
190
|
+
{% set copyrightDeclaration = '© ' + params.copyrightDeclaration.copyright + '<br /> ' + params.copyrightDeclaration.text %}
|
|
183
191
|
<div class="ons-grid ons-grid--flex ons-grid--vertical-bottom ons-grid--between">
|
|
184
192
|
<div class="ons-grid__col">
|
|
185
|
-
<p class="ons-u-fs-s ons-u-mb-no ons-footer__copyright"
|
|
193
|
+
<p class="ons-u-fs-s ons-u-mb-no ons-footer__copyright">{{- copyrightDeclaration | safe -}}</p>
|
|
186
194
|
</div>
|
|
187
195
|
</div>
|
|
188
196
|
{% endif %}
|
|
189
197
|
</div>
|
|
190
198
|
</div>
|
|
191
199
|
</footer>
|
|
192
|
-
|
|
193
200
|
{% endmacro %}
|
|
@@ -252,7 +252,7 @@ describe('macro: footer', () => {
|
|
|
252
252
|
|
|
253
253
|
const text = $('.ons-footer__copyright').text();
|
|
254
254
|
expect(text).toBe(
|
|
255
|
-
'© Crown copyright and database rights 2020 OS 100019153.
|
|
255
|
+
'© Crown copyright and database rights 2020 OS 100019153. Use of address data is subject to the terms and conditions.',
|
|
256
256
|
);
|
|
257
257
|
});
|
|
258
258
|
|
|
@@ -76,8 +76,7 @@
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
&--internal
|
|
80
|
-
&--neutral & {
|
|
79
|
+
&--internal & {
|
|
81
80
|
&__top {
|
|
82
81
|
background: var(--ons-color-header-masthead-internal);
|
|
83
82
|
.ons-icon--logo {
|
|
@@ -88,14 +87,6 @@
|
|
|
88
87
|
}
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
|
-
&__org-logo-link:focus {
|
|
92
|
-
background-color: transparent;
|
|
93
|
-
box-shadow: none;
|
|
94
|
-
outline: 3px solid var(--ons-color-focus);
|
|
95
|
-
.ons-icon--logo {
|
|
96
|
-
fill: var(--ons-color-text-link-focus);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
90
|
&__grid-top {
|
|
100
91
|
color: var(--ons-color-text-inverse);
|
|
101
92
|
min-height: 36px;
|
|
@@ -104,35 +95,46 @@
|
|
|
104
95
|
&:hover {
|
|
105
96
|
text-decoration: underline solid var(--ons-color-text-inverse-link-hover) 3px;
|
|
106
97
|
}
|
|
98
|
+
&:focus {
|
|
99
|
+
color: var(--ons-color-text-link-focus);
|
|
100
|
+
&:hover {
|
|
101
|
+
text-decoration: none;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
107
104
|
}
|
|
108
105
|
}
|
|
109
106
|
}
|
|
110
107
|
|
|
111
108
|
&--neutral & {
|
|
112
109
|
&__top {
|
|
113
|
-
|
|
110
|
+
.ons-icon--logo {
|
|
111
|
+
display: block;
|
|
112
|
+
.ons-icon--logo__group--text,
|
|
113
|
+
.ons-icon--logo__group--primary,
|
|
114
|
+
.ons-icon--logo__group--secondary {
|
|
115
|
+
fill: var(--ons-color-black);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
114
118
|
}
|
|
115
119
|
|
|
116
120
|
&__grid-top {
|
|
117
121
|
a {
|
|
118
|
-
color: var(--ons-color-
|
|
122
|
+
color: var(--ons-color-black);
|
|
119
123
|
&:hover {
|
|
120
|
-
text-decoration: underline solid var(--ons-color-
|
|
124
|
+
text-decoration: underline solid var(--ons-color-header-masthead-neutral) 3px;
|
|
125
|
+
}
|
|
126
|
+
&:focus:hover {
|
|
127
|
+
text-decoration: none;
|
|
121
128
|
}
|
|
122
129
|
}
|
|
123
130
|
}
|
|
124
131
|
|
|
125
132
|
&__main {
|
|
126
133
|
background: var(--ons-color-header-neutral);
|
|
127
|
-
|
|
128
|
-
&--border {
|
|
129
|
-
border-bottom: 3px solid var(--ons-color-header-neutral);
|
|
130
|
-
border-top: 3px solid var(--ons-color-header-neutral);
|
|
131
|
-
}
|
|
132
134
|
}
|
|
133
135
|
|
|
134
136
|
&__title {
|
|
135
|
-
color: var(--ons-color-
|
|
137
|
+
color: var(--ons-color-white);
|
|
136
138
|
&-link {
|
|
137
139
|
&:hover {
|
|
138
140
|
text-decoration: underline solid var(--ons-color-branded-text) 2px;
|
|
@@ -196,6 +198,9 @@
|
|
|
196
198
|
.ons-header--neutral & {
|
|
197
199
|
&--mobile {
|
|
198
200
|
background: var(--ons-color-grey-5);
|
|
201
|
+
.ons-header-service-nav__link {
|
|
202
|
+
color: var(--ons-color-black);
|
|
203
|
+
}
|
|
199
204
|
}
|
|
200
205
|
}
|
|
201
206
|
|