@ons/design-system 70.0.8 → 70.0.9
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/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,5 +1,5 @@
|
|
|
1
1
|
{% macro onsList(params) %}
|
|
2
|
-
{% set variants = params.variants if params.variants
|
|
2
|
+
{% set variants = params.variants if params.variants %}
|
|
3
3
|
{% set listLength = params.itemsList | length %}
|
|
4
4
|
|
|
5
5
|
{% if params.itemsList[0].prefix %}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
{% set otherClasses = 'ons-list--bare ons-list--suffix' %}
|
|
9
9
|
{% elif params.iconPosition %}
|
|
10
10
|
{% set otherClasses = 'ons-list--bare ons-list--icons' %}
|
|
11
|
-
{% set iconType = params.iconType if params.iconType
|
|
11
|
+
{% set iconType = params.iconType if params.iconType %}
|
|
12
12
|
{% else %}
|
|
13
13
|
{% set otherClasses = '' %}
|
|
14
14
|
{% endif %}
|
|
@@ -20,85 +20,105 @@
|
|
|
20
20
|
{% else %}
|
|
21
21
|
{% set listEl = 'ul' %}
|
|
22
22
|
{% endif %}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
{% set openingTag = "<" + listEl %}
|
|
24
|
+
{% set closingTag = "</" + listEl + ">" %}
|
|
25
|
+
|
|
26
|
+
{{ openingTag | safe }}{% if params.id %}{{ ' ' }}id="{{ params.id }}"{% endif %}
|
|
27
|
+
class="ons-list{{ ' ons-list--p' if listEl == 'p' }}{{ ' ' + params.classes if params.classes else '' }}{% if params.variants %}{% if params.variants is not string %}{% for variant in variants %}{{ ' ' }}ons-list--{{ variant }}{% endfor %}{% else %}{{ ' ' }}ons-list--{{ variants }}{% endif %}{% endif %}{{ ' ' + otherClasses if otherClasses else '' }}"{% 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 %}>
|
|
28
|
+
{%- for item in params.itemsList -%}
|
|
29
|
+
{% set sublistClasses = item.listClasses if item.listClasses %}
|
|
30
|
+
{%
|
|
31
|
+
set sublistParams = {
|
|
27
32
|
'variants': variants,
|
|
28
33
|
'itemsList': item.itemsList,
|
|
29
34
|
'classes': sublistClasses
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
}
|
|
36
|
+
%}
|
|
37
|
+
{% set listItem %}
|
|
38
|
+
{% set itemText = item.text %}
|
|
39
|
+
{% if item.text %}
|
|
40
|
+
{% set itemIconType = item.iconType if item.iconType else iconType %}
|
|
33
41
|
{% endif %}
|
|
34
|
-
{% set itemText = item.text %}
|
|
35
|
-
{% if item.text %}
|
|
36
|
-
{% set itemIconType = item.iconType if item.iconType else iconType %} {% endif %}
|
|
37
42
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
{# For Craft support we also support title and navigation title #}
|
|
44
|
+
{% if item.navigationTitle %}
|
|
45
|
+
{% set itemText = item.navigationTitle %}
|
|
46
|
+
{% elif item.title %}
|
|
47
|
+
{% set itemText = item.title %}
|
|
48
|
+
{% endif %}
|
|
44
49
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
{%- endif -%}
|
|
58
|
-
</span>
|
|
50
|
+
{%- if item.prefix or (params.iconPosition == 'before') -%}
|
|
51
|
+
<span class="ons-list__prefix" {% if listEl != 'ol' %}aria-hidden="true"{% endif %}>
|
|
52
|
+
{%- if item.prefix -%}
|
|
53
|
+
{{- item.prefix -}}.
|
|
54
|
+
{% elif params.iconPosition == 'before' %}
|
|
55
|
+
{% from "components/icon/_macro.njk" import onsIcon %}
|
|
56
|
+
{{-
|
|
57
|
+
onsIcon({
|
|
58
|
+
"iconType": itemIconType,
|
|
59
|
+
"iconSize": params.iconSize
|
|
60
|
+
})
|
|
61
|
+
-}}
|
|
59
62
|
{%- endif -%}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
63
|
+
</span>
|
|
64
|
+
{%- endif -%}
|
|
65
|
+
{%- if item.url and item.current != true -%}
|
|
66
|
+
{%- if item.external -%}
|
|
67
|
+
{% from "components/external-link/_macro.njk" import onsExternalLink %}
|
|
68
|
+
{{
|
|
69
|
+
onsExternalLink({
|
|
70
|
+
"url": item.url,
|
|
71
|
+
"linkText": itemText
|
|
72
|
+
})
|
|
73
|
+
}}
|
|
74
|
+
{%- else -%}
|
|
75
|
+
<a
|
|
76
|
+
href="{{ item.url }}"
|
|
77
|
+
class="ons-list__link{{ ' ons-js-inpagelink' if item.variants == 'inPageLink' }}{{ ' ' + item.classes if item.classes else '' }}"
|
|
78
|
+
{% if item.target %}target="{{ item.target }}"{% endif %}{% if item.attributes %}{% for attribute, value in (item.attributes.items() if item.attributes is mapping and item.attributes.items else item.attributes) %}{{ ' ' }}{{ attribute }}{% if value %}="{{ value }}"{% endif %}{% endfor %}{% endif %}
|
|
79
|
+
>
|
|
80
|
+
{%- if item.prefix -%}<span class="ons-u-vh">{{- item.prefix -}}</span>{%- endif -%} {{- itemText | safe -}}
|
|
81
|
+
{%- if item.target == "_blank" -%}
|
|
82
|
+
<span class="ons-u-vh"> ({{- item.screenreaderMessage | default("opens in a new tab") -}})</span>
|
|
74
83
|
{%- endif -%}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
84
|
+
</a>
|
|
85
|
+
{%- endif -%}
|
|
86
|
+
{%- else -%}
|
|
87
|
+
{{- itemText | safe -}}
|
|
88
|
+
{%- endif -%}
|
|
89
|
+
{%- if item.suffix or (params.iconPosition == 'after') -%}
|
|
90
|
+
<span class="ons-list__suffix" {% if listEl != 'ol' %}aria-hidden="true"{% endif %}>
|
|
91
|
+
{%- if item.suffix -%}
|
|
92
|
+
{{- item.suffix -}}
|
|
93
|
+
{%- elif (item.index and listEl != 'ol') or (item.index and listEl == 'ol' and 'bare' in variants) -%}
|
|
94
|
+
{{- loop.index -}}
|
|
95
|
+
{% elif params.iconPosition == 'after' %}
|
|
96
|
+
{% from "components/icon/_macro.njk" import onsIcon %}
|
|
97
|
+
{{-
|
|
98
|
+
onsIcon({
|
|
99
|
+
"iconType": itemIconType,
|
|
100
|
+
"iconSize": params.iconSize
|
|
101
|
+
})
|
|
102
|
+
-}}
|
|
103
|
+
{%- endif -%}</span
|
|
104
|
+
>
|
|
105
|
+
{%- endif -%}
|
|
106
|
+
{% if item.itemsList %}
|
|
107
|
+
{# Handle nested lists with recursive call for sub layer #}
|
|
108
|
+
{{ onsList(sublistParams) }}
|
|
100
109
|
{% endif %}
|
|
101
|
-
{
|
|
102
|
-
</{{ listEl }}>
|
|
110
|
+
{% endset %}
|
|
103
111
|
|
|
112
|
+
{% if listLength > 1 or listEl == 'ul' %}
|
|
113
|
+
<li
|
|
114
|
+
class="ons-list__item{{ ' ' + item.listClasses if item.listClasses else '' }}"
|
|
115
|
+
{% if item.current %}aria-current="true"{% endif %}
|
|
116
|
+
>
|
|
117
|
+
{{- listItem | safe -}}
|
|
118
|
+
</li>
|
|
119
|
+
{% else %}
|
|
120
|
+
{{- listItem | safe -}}
|
|
121
|
+
{% endif %}
|
|
122
|
+
{%- endfor -%}
|
|
123
|
+
{{ closingTag | safe }}
|
|
104
124
|
{% endmacro %}
|
|
@@ -1,22 +1,35 @@
|
|
|
1
1
|
{%- macro onsMessage(params) -%}
|
|
2
2
|
<div class="ons-message ons-message--{{ params.variant }}">
|
|
3
3
|
<div class="ons-message__head">
|
|
4
|
-
<dl class="ons-message__metadata"{% if params.id %}
|
|
4
|
+
<dl class="ons-message__metadata" {% if params.id %}id="{{ params.id }}"{% endif %}>
|
|
5
5
|
<div class="ons-message__sender">
|
|
6
6
|
<dt class="ons-message__term ons-u-fw-b">{{ params.fromLabel }}:</dt>
|
|
7
|
-
<dd
|
|
7
|
+
<dd
|
|
8
|
+
class="ons-message__value ons-u-fw-b"
|
|
9
|
+
{% if params.fromId %}id="{{ params.fromId }}"{% endif %}{% if params.fromName %}{{ ' ' }}name="{{ params.fromName }}"{% endif %}
|
|
10
|
+
>
|
|
11
|
+
{{ params.fromValue }}
|
|
12
|
+
</dd>
|
|
8
13
|
</div>
|
|
9
14
|
<div class="ons-message__timestamp">
|
|
10
15
|
<dt class="ons-message__term ons-u-fs-s">{{ params.sentLabel }}:</dt>
|
|
11
|
-
<dd
|
|
16
|
+
<dd
|
|
17
|
+
class="ons-message__value ons-u-fs-s"
|
|
18
|
+
{% if params.sentId %}id="{{ params.sentId }}"{% endif %}{% if params.sentName %}{{ ' ' }}name="{{ params.sentName }}"{% endif %}
|
|
19
|
+
>
|
|
20
|
+
{{ params.sentValue }}
|
|
21
|
+
</dd>
|
|
12
22
|
</div>
|
|
13
23
|
</dl>
|
|
14
24
|
{% if params.unreadLink %}
|
|
15
|
-
<a
|
|
25
|
+
<a
|
|
26
|
+
class="ons-message__unread-link"
|
|
27
|
+
{% if params.unreadLinkId %}id="{{ params.unreadLinkId }}"{% endif %}
|
|
28
|
+
href="{{ params.unreadLink }}"
|
|
29
|
+
>{{ params.unreadLinkText }}</a
|
|
30
|
+
>
|
|
16
31
|
{% endif %}
|
|
17
32
|
</div>
|
|
18
|
-
<div class="ons-message__body"{% if params.messageID %}
|
|
19
|
-
{{ caller() }}
|
|
20
|
-
</div>
|
|
33
|
+
<div class="ons-message__body" {% if params.messageID %}id="{{ params.messageID }}"{% endif %}>{{ caller() }}</div>
|
|
21
34
|
</div>
|
|
22
35
|
{%- endmacro -%}
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
{%- macro onsMessageList(params) -%}
|
|
2
|
-
<ul class="ons-message-list" aria-label="{{ params.ariaLabel | default("Message List") }}">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</
|
|
2
|
+
<ul class="ons-message-list" aria-label="{{ params.ariaLabel | default("Message List") }}">
|
|
3
|
+
{% for message in params.messages %}
|
|
4
|
+
<li class="ons-message-item" aria-labelledby="{{ message.id }}">
|
|
5
|
+
<h3 class="ons-message-item__subject" id="{{ message.id }}">
|
|
6
|
+
<a href="{{ message.url }}" class="ons-u-fs-r--b">{{ message.subject }}</a>
|
|
7
|
+
{% if message.unread %}<span class="ons-message-item__unread ons-u-fs-s">({{ params.unreadText }})</span>{% endif %}
|
|
8
|
+
</h3>
|
|
9
|
+
<dl class="ons-message-item__metadata" aria-label="{{ params.ariaLabelMetaData | default("Message metadata") }}">
|
|
10
|
+
<dt class="ons-message-item__metadata-term ons-message-item__metadata-term--from ons-u-vh">{{ params.fromLabel }}:</dt>
|
|
11
|
+
<dd class="ons-message-item__metadata-value ons-message-item__metadata-value--from ons-u-fs-r--b">
|
|
12
|
+
{{ message.fromText }}
|
|
13
|
+
</dd>
|
|
14
|
+
<dt class="ons-message-item__metadata-term ons-message-item__metadata-term--date ons-u-vh">{{ params.dateLabel }}:</dt>
|
|
15
|
+
<dd class="ons-message-item__metadata-value ons-message-item__metadata-value--date ons-u-fs-s">
|
|
16
|
+
{{ message.dateText }}
|
|
17
|
+
</dd>
|
|
18
|
+
</dl>
|
|
19
|
+
<div class="ons-message-item__body" aria-label="{{ params.ariaLabelMsg | default("Message text") }}">
|
|
20
|
+
{{ message.body | safe }}
|
|
21
|
+
</div>
|
|
22
|
+
<div class="ons-message-item__link ons-u-vh">
|
|
23
|
+
<a href="{{ message.url }}">{{ params.hiddenReadLabel }}: {{ message.subject }}</a>
|
|
24
|
+
</div>
|
|
25
|
+
</li>
|
|
26
|
+
{% endfor %}
|
|
27
|
+
</ul>
|
|
22
28
|
{%- endmacro -%}
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
{% macro onsModal(params) %}
|
|
2
2
|
{% set modalId = params.id | default('dialog') %}
|
|
3
|
-
<dialog
|
|
3
|
+
<dialog
|
|
4
|
+
class="ons-modal ons-js-modal {{ params.classes if params.classes }}"
|
|
4
5
|
id="{{ modalId }}"
|
|
5
6
|
role="dialog"
|
|
6
7
|
aria-labelledby="ons-modal-title"
|
|
7
|
-
{% 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 %}
|
|
8
|
+
{% 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 %}
|
|
8
9
|
>
|
|
9
10
|
<div class="ons-modal__content">
|
|
10
|
-
<h2 id="ons-modal-title" class="ons-modal__title">
|
|
11
|
-
|
|
12
|
-
</h2>
|
|
13
|
-
<div class="ons-modal__body">
|
|
14
|
-
{{ (params.body if params.body else "") | safe }}{{ caller() if caller }}
|
|
15
|
-
</div>
|
|
11
|
+
<h2 id="ons-modal-title" class="ons-modal__title">{{ params.title }}</h2>
|
|
12
|
+
<div class="ons-modal__body">{{ (params.body if params.body) | safe }}{{ caller() if caller }}</div>
|
|
16
13
|
{% if params.btnText %}
|
|
17
14
|
{% from "components/button/_macro.njk" import onsButton %}
|
|
18
|
-
{{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
{{
|
|
16
|
+
onsButton({
|
|
17
|
+
"text": params.btnText,
|
|
18
|
+
"classes": "ons-js-modal-btn ons-u-mt-s"
|
|
19
|
+
})
|
|
20
|
+
}}
|
|
22
21
|
{% endif %}
|
|
23
22
|
</div>
|
|
24
23
|
</dialog>
|
|
@@ -4,43 +4,45 @@
|
|
|
4
4
|
{% macro onsMultipleInputFields(params) %}
|
|
5
5
|
{% set fields %}
|
|
6
6
|
{% if params.numberOfFields > 1 %}
|
|
7
|
-
<div class="ons-field-group">
|
|
8
|
-
{{ params.fields | safe }}
|
|
9
|
-
</div>
|
|
7
|
+
<div class="ons-field-group">{{ params.fields | safe }}</div>
|
|
10
8
|
{% else %}
|
|
11
9
|
{{ params.fields | safe }}
|
|
12
10
|
{% endif %}
|
|
13
11
|
{% endset %}
|
|
14
12
|
|
|
15
13
|
{% if params.mutuallyExclusive %}
|
|
16
|
-
{%
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
14
|
+
{%
|
|
15
|
+
call onsMutuallyExclusive({
|
|
16
|
+
"id": params.id,
|
|
17
|
+
"legend": params.legendOrLabel,
|
|
18
|
+
"legendClasses": params.legendClasses,
|
|
19
|
+
"description": params.description,
|
|
20
|
+
"classes": params.classes,
|
|
21
|
+
"dontWrap": params.dontWrap if params.numberOfFields > 1 else true,
|
|
22
|
+
"legendIsQuestionTitle": params.legendIsQuestionTitle,
|
|
23
|
+
"exclusiveOptions": params.mutuallyExclusive.exclusiveOptions,
|
|
24
|
+
"or": params.mutuallyExclusive.or,
|
|
25
|
+
"deselectMessage": params.mutuallyExclusive.deselectMessage,
|
|
26
|
+
"deselectGroupAdjective": params.mutuallyExclusive.deselectGroupAdjective,
|
|
27
|
+
"deselectExclusiveOptionAdjective": params.mutuallyExclusive.deselectExclusiveOptionAdjective,
|
|
28
|
+
"error": params.error
|
|
29
|
+
})
|
|
30
|
+
%}
|
|
31
31
|
{{ fields | safe }}
|
|
32
32
|
{% endcall %}
|
|
33
33
|
{% elif params.numberOfFields > 1 %}
|
|
34
|
-
{%
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
{%
|
|
35
|
+
call onsFieldset({
|
|
36
|
+
"id": params.id,
|
|
37
|
+
"legend": params.legendOrLabel,
|
|
38
|
+
"legendClasses": params.legendClasses,
|
|
39
|
+
"description": params.description,
|
|
40
|
+
"classes": params.classes,
|
|
41
|
+
"dontWrap": params.dontWrap,
|
|
42
|
+
"legendIsQuestionTitle": params.legendIsQuestionTitle,
|
|
43
|
+
"error": params.error
|
|
44
|
+
})
|
|
45
|
+
%}
|
|
44
46
|
{{ fields | safe }}
|
|
45
47
|
{% endcall %}
|
|
46
48
|
{% else %}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
{% macro onsMutuallyExclusive(params) %}
|
|
3
2
|
{% from "components/fieldset/_macro.njk" import onsFieldset %}
|
|
4
3
|
{% from "components/checkboxes/_checkbox-macro.njk" import onsCheckbox %}
|
|
@@ -9,17 +8,19 @@
|
|
|
9
8
|
{% set exclusiveOptionsLength = params.exclusiveOptions | length %}
|
|
10
9
|
{% set or = params.or | default("Or") %}
|
|
11
10
|
|
|
12
|
-
{%
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
{%
|
|
12
|
+
call onsFieldset({
|
|
13
|
+
"id": params.id,
|
|
14
|
+
"classes": params.classes,
|
|
15
|
+
"legend": params.legend,
|
|
16
|
+
"legendClasses": params.legendClasses,
|
|
17
|
+
"description": params.description,
|
|
18
|
+
"attributes": params.attributes,
|
|
19
|
+
"dontWrap": params.dontWrap,
|
|
20
|
+
"legendIsQuestionTitle": params.legendIsQuestionTitle,
|
|
21
|
+
"error": params.error
|
|
22
|
+
})
|
|
23
|
+
%}
|
|
23
24
|
<div class="ons-js-mutually-exclusive ons-mutually-exclusive">
|
|
24
25
|
{{ content | safe }}
|
|
25
26
|
{% if params.autosuggestResults %}
|
|
@@ -59,7 +60,13 @@
|
|
|
59
60
|
}}
|
|
60
61
|
</p>
|
|
61
62
|
{% endif %}
|
|
62
|
-
<span
|
|
63
|
+
<span
|
|
64
|
+
class="ons-js-exclusive-alert ons-u-vh"
|
|
65
|
+
role="alert"
|
|
66
|
+
aria-live="polite"
|
|
67
|
+
data-group-adjective="{{ params.deselectGroupAdjective }}"
|
|
68
|
+
data-option-adjective="{{ params.deselectExclusiveOptionAdjective }}"
|
|
69
|
+
></span>
|
|
63
70
|
</div>
|
|
64
71
|
{% endcall %}
|
|
65
72
|
{% endmacro %}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
|
|
2
2
|
{% from "components/question/_macro.njk" import onsQuestion %}
|
|
3
3
|
|
|
4
|
-
{%
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
{%
|
|
5
|
+
call onsQuestion({
|
|
6
|
+
"title": "What type of central heating do you have?",
|
|
7
|
+
"legendIsQuestionTitle": true
|
|
8
|
+
})
|
|
9
|
+
%}
|
|
8
10
|
{{
|
|
9
11
|
onsCheckboxes({
|
|
10
12
|
"id": "central-heating-answers",
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{% from "components/date-input/_macro.njk" import onsDateInput %}
|
|
2
2
|
{% from "components/question/_macro.njk" import onsQuestion %}
|
|
3
3
|
|
|
4
|
-
{%
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
{%
|
|
5
|
+
call onsQuestion({
|
|
6
|
+
"title": "When did you leave your last paid job?",
|
|
7
|
+
"description": "<p>For example, 31 3 2018</p>",
|
|
8
|
+
"legendIsQuestionTitle": true
|
|
9
|
+
})
|
|
10
|
+
%}
|
|
9
11
|
{{
|
|
10
12
|
onsDateInput({
|
|
11
13
|
"id": "date-mutually-exclusive",
|
|
@@ -1,45 +1,49 @@
|
|
|
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
|
-
|
|
21
|
-
"id": "address-duration-months",
|
|
22
|
-
"name": "address-duration-months",
|
|
23
|
-
"suffix": {
|
|
24
|
-
"text": "Months",
|
|
25
|
-
"id": "address-duration-months-suffix"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
"mutuallyExclusive": {
|
|
29
|
-
"or": "Or",
|
|
30
|
-
"deselectMessage": "Selecting this will clear the date if one has been inputted",
|
|
31
|
-
"deselectGroupAdjective": "cleared",
|
|
32
|
-
"deselectExclusiveOptionAdjective": "deselected",
|
|
33
|
-
"exclusiveOptions": [
|
|
34
|
-
{
|
|
35
|
-
"id": "duration-exclusive-checkbox",
|
|
36
|
-
"name": "no-duration",
|
|
37
|
-
"value": "no-duration",
|
|
38
|
-
"label": {
|
|
39
|
-
"text": "I have not moved in to this address yet"
|
|
40
|
-
}
|
|
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",
|
|
14
|
+
"dontWrap": true,
|
|
15
|
+
"field1": {
|
|
16
|
+
"id": "address-duration-years",
|
|
17
|
+
"name": "address-duration-years",
|
|
18
|
+
"suffix": {
|
|
19
|
+
"text": "Years",
|
|
20
|
+
"id": "address-duration-years-suffix"
|
|
41
21
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
22
|
+
},
|
|
23
|
+
"field2": {
|
|
24
|
+
"id": "address-duration-months",
|
|
25
|
+
"name": "address-duration-months",
|
|
26
|
+
"suffix": {
|
|
27
|
+
"text": "Months",
|
|
28
|
+
"id": "address-duration-months-suffix"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"mutuallyExclusive": {
|
|
32
|
+
"or": "Or",
|
|
33
|
+
"deselectMessage": "Selecting this will clear the date if one has been inputted",
|
|
34
|
+
"deselectGroupAdjective": "cleared",
|
|
35
|
+
"deselectExclusiveOptionAdjective": "deselected",
|
|
36
|
+
"exclusiveOptions": [
|
|
37
|
+
{
|
|
38
|
+
"id": "duration-exclusive-checkbox",
|
|
39
|
+
"name": "no-duration",
|
|
40
|
+
"value": "no-duration",
|
|
41
|
+
"label": {
|
|
42
|
+
"text": "I have not moved in to this address yet"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
}}
|
|
45
49
|
{% endcall %}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{% from "components/input/_macro.njk" import onsInput %}
|
|
2
2
|
{% from "components/question/_macro.njk" import onsQuestion %}
|
|
3
3
|
|
|
4
|
-
{%
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
{%
|
|
5
|
+
call onsQuestion({
|
|
6
|
+
"title": "Get a confirmation email",
|
|
7
|
+
"description": "<p>Enter your email address if you would like to be sent confirmation that you have completed your survey</p>",
|
|
8
|
+
"legendIsQuestionTitle": true
|
|
9
|
+
})
|
|
10
|
+
%}
|
|
9
11
|
{{
|
|
10
12
|
onsInput({
|
|
11
13
|
"id": "email-example-mutually-exclusive",
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
|
|
2
2
|
{% from "components/question/_macro.njk" import onsQuestion %}
|
|
3
3
|
|
|
4
|
-
{%
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
{%
|
|
5
|
+
call onsQuestion({
|
|
6
|
+
"title": "What type of central heating do you have?",
|
|
7
|
+
"legendIsQuestionTitle": true
|
|
8
|
+
})
|
|
9
|
+
%}
|
|
8
10
|
{{
|
|
9
11
|
onsCheckboxes({
|
|
10
12
|
"id": "central-heating-answers",
|