@ons/design-system 49.2.0 → 51.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -13
- package/components/access-code/_macro.njk +1 -1
- package/components/access-code/_macro.spec.js +162 -0
- package/components/access-code/uac.spec.js +26 -0
- package/components/accordion/_macro.spec.js +224 -0
- package/components/accordion/accordion.spec.js +134 -0
- package/components/address-input/_macro.njk +1 -1
- package/components/address-input/_macro.spec.js +465 -0
- package/components/address-input/autosuggest.address.js +5 -4
- package/components/address-input/autosuggest.address.setter.js +3 -1
- package/components/address-input/autosuggest.address.spec.js +733 -0
- package/components/address-output/_macro.njk +6 -6
- package/components/address-output/_macro.spec.js +122 -0
- package/components/autosuggest/_macro.njk +1 -1
- package/components/autosuggest/_macro.spec.js +229 -0
- package/components/autosuggest/autosuggest.helpers.js +2 -3
- package/components/autosuggest/autosuggest.helpers.spec.js +85 -0
- package/components/autosuggest/autosuggest.js +4 -2
- package/components/autosuggest/autosuggest.spec.js +625 -0
- package/components/autosuggest/autosuggest.ui.js +6 -2
- package/components/breadcrumbs/_macro.spec.js +129 -0
- package/components/button/_macro.njk +5 -5
- package/components/button/_macro.spec.js +446 -0
- package/components/button/button.spec.js +290 -0
- package/components/call-to-action/_macro.njk +3 -1
- package/components/call-to-action/_macro.spec.js +52 -0
- package/components/card/_macro.njk +26 -19
- package/components/card/_macro.spec.js +261 -0
- package/components/char-check-limit/_macro.spec.js +73 -0
- package/components/char-check-limit/character-check.spec.js +196 -0
- package/components/char-check-limit/character-limit.js +1 -1
- package/components/checkboxes/_checkbox-macro.njk +2 -2
- package/components/checkboxes/_checkbox-macro.spec.js +419 -0
- package/components/checkboxes/_macro.njk +3 -5
- package/components/checkboxes/_macro.spec.js +306 -0
- package/components/checkboxes/checkboxes.spec.js +208 -0
- package/components/code-highlight/_macro.spec.js +56 -0
- package/components/code-highlight/code-highlight.spec.js +18 -0
- package/components/collapsible/_macro.spec.js +204 -0
- package/components/collapsible/collapsible.js +2 -1
- package/components/collapsible/collapsible.spec.js +236 -0
- package/components/content-pagination/_macro.spec.js +199 -0
- package/components/cookies-banner/_macro.njk +1 -1
- package/components/cookies-banner/_macro.spec.js +171 -0
- package/components/cookies-banner/cookies-banner.spec.js +90 -0
- package/components/date-input/_macro.njk +8 -5
- package/components/date-input/_macro.spec.js +286 -0
- package/components/document-list/_macro.njk +3 -5
- package/components/document-list/_macro.spec.js +491 -0
- package/components/download-resources/download-resources.spec.js +540 -0
- package/components/duration/_macro.njk +7 -6
- package/components/duration/_macro.spec.js +251 -0
- package/components/error/_macro.spec.js +97 -0
- package/components/external-link/_macro.spec.js +60 -0
- package/components/feedback/_macro.njk +5 -3
- package/components/feedback/_macro.spec.js +122 -0
- package/components/field/_macro.njk +2 -2
- package/components/field/_macro.spec.js +97 -0
- package/components/fieldset/_macro.njk +3 -3
- package/components/fieldset/_macro.spec.js +173 -0
- package/components/footer/_macro.njk +11 -48
- package/components/footer/_macro.spec.js +549 -0
- package/components/header/_macro.njk +2 -2
- package/components/header/_macro.spec.js +562 -0
- package/components/hero/_hero.scss +0 -3
- package/components/hero/_macro.njk +4 -4
- package/components/hero/_macro.spec.js +224 -0
- package/components/icons/_macro.njk +15 -15
- package/components/icons/_macro.spec.js +140 -0
- package/components/images/_macro.njk +1 -1
- package/components/images/_macro.spec.js +121 -0
- package/components/input/_input-type.scss +12 -5
- package/components/input/_macro.njk +6 -7
- package/components/input/_macro.spec.js +658 -0
- package/components/label/_macro.spec.js +189 -0
- package/components/language-selector/_macro.spec.js +129 -0
- package/components/lists/_list.scss +4 -0
- package/components/lists/_macro.njk +4 -7
- package/components/lists/_macro.spec.js +618 -0
- package/components/message/_macro.spec.js +137 -0
- package/components/message-list/_macro.njk +7 -7
- package/components/message-list/_macro.spec.js +159 -0
- package/components/metadata/_macro.spec.js +167 -0
- package/components/modal/_macro.njk +6 -6
- package/components/modal/_macro.spec.js +87 -0
- package/components/modal/modal.js +0 -16
- package/components/modal/modal.spec.js +59 -0
- package/components/mutually-exclusive/_macro.njk +38 -21
- package/components/mutually-exclusive/_macro.spec.js +182 -0
- package/components/mutually-exclusive/mutually-exclusive.checkboxes.spec.js +203 -0
- package/components/mutually-exclusive/mutually-exclusive.date.spec.js +142 -0
- package/components/mutually-exclusive/mutually-exclusive.duration.spec.js +141 -0
- package/components/mutually-exclusive/mutually-exclusive.email.spec.js +117 -0
- package/components/mutually-exclusive/mutually-exclusive.js +32 -23
- package/components/mutually-exclusive/mutually-exclusive.multiple-options.checkboxes.spec.js +213 -0
- package/components/mutually-exclusive/mutually-exclusive.number.spec.js +125 -0
- package/components/mutually-exclusive/mutually-exclusive.textarea.spec.js +131 -0
- package/components/navigation/_macro.njk +6 -6
- package/components/navigation/_macro.spec.js +327 -0
- package/components/navigation/navigation.dom.js +1 -1
- package/components/navigation/navigation.spec.js +232 -0
- package/components/pagination/_macro.njk +1 -1
- package/components/pagination/_macro.spec.js +411 -0
- package/components/panel/_macro.njk +6 -6
- package/components/panel/_macro.spec.js +423 -0
- package/components/password/_macro.spec.js +137 -0
- package/components/password/password.spec.js +40 -0
- package/components/phase-banner/_macro.spec.js +73 -0
- package/components/promotional-banner/_macro.spec.js +97 -0
- package/components/question/_macro.njk +25 -33
- package/components/question/_macro.spec.js +309 -0
- package/components/quote/_macro.spec.js +81 -0
- package/components/radios/_macro.njk +98 -102
- package/components/radios/_macro.spec.js +575 -0
- package/components/radios/radios.spec.js +180 -0
- package/components/related-content/_macro.njk +1 -0
- package/components/related-content/_macro.spec.js +142 -0
- package/components/relationships/_macro.spec.js +108 -0
- package/components/relationships/relationships.spec.js +84 -0
- package/components/reply/_macro.njk +2 -2
- package/components/reply/_macro.spec.js +69 -0
- package/components/reply/reply.spec.js +78 -0
- package/components/search/_macro.njk +14 -12
- package/components/search/_macro.spec.js +44 -0
- package/components/search/_search.scss +7 -7
- package/components/section-navigation/_macro.njk +7 -2
- package/components/section-navigation/_macro.spec.js +206 -0
- package/components/select/_macro.njk +3 -3
- package/components/select/_macro.spec.js +203 -0
- package/components/select/select.spec.js +56 -0
- package/components/share-page/_macro.njk +2 -2
- package/components/share-page/_macro.spec.js +110 -0
- package/components/skip-to-content/_macro.spec.js +57 -0
- package/components/skip-to-content/skip-to-content.spec.js +44 -0
- package/components/status/_macro.spec.js +77 -0
- package/components/summary/_macro.njk +5 -5
- package/components/summary/_macro.spec.js +472 -0
- package/components/table/_macro.njk +2 -2
- package/components/table/_macro.spec.js +557 -0
- package/components/table/table.spec.js +155 -0
- package/components/table-of-contents/_macro.njk +35 -35
- package/components/table-of-contents/_macro.spec.js +178 -0
- package/components/table-of-contents/toc.js +29 -25
- package/components/table-of-contents/toc.spec.js +61 -0
- package/components/tabs/_macro.njk +1 -1
- package/components/tabs/_macro.spec.js +79 -0
- package/components/tabs/tabs.spec.js +162 -0
- package/components/text-indent/_macro.spec.js +52 -0
- package/components/textarea/_macro.njk +7 -5
- package/components/textarea/_macro.spec.js +300 -0
- package/components/textarea/textarea.spec.js +98 -0
- package/components/timeline/_macro.njk +3 -3
- package/components/timeline/_macro.spec.js +81 -0
- package/components/timeout-modal/_macro.spec.js +68 -0
- package/components/timeout-modal/timeout-modal.spec.js +226 -0
- package/components/timeout-panel/_macro.njk +0 -1
- package/components/timeout-panel/_macro.spec.js +54 -0
- package/components/timeout-panel/timeout-panel.dom.js +1 -2
- package/components/timeout-panel/timeout-panel.spec.js +161 -0
- package/components/upload/_macro.spec.js +75 -0
- package/components/video/_macro.spec.js +34 -0
- package/css/census.css +1 -1
- package/css/main.css +1 -1
- package/js/cookies-settings.spec.js +154 -0
- package/package.json +10 -23
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +2 -2
|
@@ -13,30 +13,29 @@
|
|
|
13
13
|
"legendIsQuestionTitle": params.legendIsQuestionTitle,
|
|
14
14
|
"error": params.error
|
|
15
15
|
}) %}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
</span>
|
|
21
|
-
{% endif %}
|
|
22
|
-
<span class="ons-radios__item{{ " ons-radios__item--no-border" if params.borderless }}">
|
|
23
|
-
<span class="ons-radio{{ " ons-radio--no-border" if params.borderless }}">
|
|
24
|
-
{% if radio.other is defined and radio.other and radio.other.selectAllChildren is defined and radio.other.selectAllChildren == true %}
|
|
25
|
-
{% set selectAllClass = ' ons-js-select-all-children' %}
|
|
26
|
-
{% else %}
|
|
27
|
-
{% set selectAllClass = '' %}
|
|
16
|
+
<div class="ons-radios__items">
|
|
17
|
+
{% for radio in params.radios %}
|
|
18
|
+
{% if params.or is defined and params.or and loop.revindex0 == 0 %}
|
|
19
|
+
<span class="ons-radios__label ons-u-mt-s ons-u-fs-r--b" aria-hidden="true">{{ params.or }}</span>
|
|
28
20
|
{% endif %}
|
|
29
|
-
|
|
21
|
+
<span class="ons-radios__item{{ " ons-radios__item--no-border" if params.borderless }}">
|
|
22
|
+
<span class="ons-radio{{ " ons-radio--no-border" if params.borderless }}">
|
|
23
|
+
{% if radio.other is defined and radio.other and radio.other.selectAllChildren is defined and radio.other.selectAllChildren == true %}
|
|
24
|
+
{% set selectAllClass = ' ons-js-select-all-children' %}
|
|
25
|
+
{% else %}
|
|
26
|
+
{% set selectAllClass = '' %}
|
|
27
|
+
{% endif %}
|
|
28
|
+
<input
|
|
30
29
|
type="radio"
|
|
31
30
|
id="{{ radio.id }}"
|
|
32
|
-
class="ons-radio__input ons-js-radio{{ ' ' + radio.classes if radio.classes else '' }}{{ ' ons-js-other' if radio.other else '' }}{{ selectAllClass }}"
|
|
31
|
+
class="ons-radio__input ons-js-radio{{ ' ' + params.inputClasses if params.inputClasses and params.inputClasses is defined else '' }}{{ ' ' + radio.classes if radio.classes else '' }}{{ ' ons-js-other' if radio.other else '' }}{{ selectAllClass }}"
|
|
33
32
|
value="{{ radio.value }}"
|
|
34
33
|
name="{{ params.name }}"
|
|
35
34
|
{% if (radio.checked is defined and radio.checked) or (params.value is defined and params.value == radio.value) %} checked {% endif %}
|
|
36
35
|
{% if radio.other is defined and radio.other and not radio.other.open %} aria-controls="{{ radio.id }}-other-wrap" aria-haspopup="true"{% endif %}
|
|
37
36
|
{% if radio.attributes is defined and radio.attributes %}{% for attribute, value in (radio.attributes.items() if radio.attributes is mapping and radio.attributes.items else radio.attributes) %}{{ attribute }}{% if value is defined and value %}="{{ value }}"{% endif %} {% endfor %}{% endif %}
|
|
38
37
|
>
|
|
39
|
-
|
|
38
|
+
{{ onsLabel({
|
|
40
39
|
"id": radio.id + "-label",
|
|
41
40
|
"for": radio.id,
|
|
42
41
|
"inputType": "radio",
|
|
@@ -44,100 +43,97 @@
|
|
|
44
43
|
"classes": "ons-radio__label " + radio.label.classes | default(''),
|
|
45
44
|
"description": radio.label.description
|
|
46
45
|
}) }}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
</span>
|
|
123
|
-
{% endif %}
|
|
46
|
+
{% if radio.other is defined and radio.other %}
|
|
47
|
+
{% set otherType = radio.other.otherType | default('input') %}
|
|
48
|
+
<span class="ons-radio__other{{ " " + 'ons-radio__other--open' if radio.other.open else "" }}" id="{{ radio.id }}-other-wrap">
|
|
49
|
+
{% if otherType == "input" %}
|
|
50
|
+
{% from "components/input/_macro.njk" import onsInput %}
|
|
51
|
+
{{
|
|
52
|
+
onsInput({
|
|
53
|
+
"id": radio.other.id,
|
|
54
|
+
"name": radio.other.name,
|
|
55
|
+
"type": radio.other.type,
|
|
56
|
+
"required": radio.other.required,
|
|
57
|
+
"classes": ("ons-input--error " if params.error else "") + radio.other.classes | default(''),
|
|
58
|
+
"width": radio.other.width | default('auto'),
|
|
59
|
+
"attributes": radio.other.attributes,
|
|
60
|
+
"label": {
|
|
61
|
+
"id": radio.other.id + "-label",
|
|
62
|
+
"text": radio.other.label.text,
|
|
63
|
+
"classes": 'ons-u-fw-n'
|
|
64
|
+
},
|
|
65
|
+
"dontWrap": true,
|
|
66
|
+
"value": radio.other.value
|
|
67
|
+
})
|
|
68
|
+
}}
|
|
69
|
+
{% elif otherType == "select" %}
|
|
70
|
+
{% from "components/select/_macro.njk" import onsSelect %}
|
|
71
|
+
{{
|
|
72
|
+
onsSelect({
|
|
73
|
+
"id": radio.other.id,
|
|
74
|
+
"name": radio.other.name,
|
|
75
|
+
"options": radio.other.options,
|
|
76
|
+
"classes": ("ons-input--error " if params.error else "") + radio.other.classes | default(''),
|
|
77
|
+
"label": {
|
|
78
|
+
"id": radio.other.id + "-label",
|
|
79
|
+
"text": radio.other.label.text,
|
|
80
|
+
"classes": 'ons-u-fw-n'
|
|
81
|
+
},
|
|
82
|
+
"dontWrap": true,
|
|
83
|
+
"value": radio.other.value
|
|
84
|
+
})
|
|
85
|
+
}}
|
|
86
|
+
{% elif otherType == "checkboxes" %}
|
|
87
|
+
{% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
|
|
88
|
+
{{
|
|
89
|
+
onsCheckboxes({
|
|
90
|
+
"id": radio.other.id,
|
|
91
|
+
"name": radio.other.name,
|
|
92
|
+
"checked": radio.other.checked,
|
|
93
|
+
"borderless": true,
|
|
94
|
+
"legend": radio.other.legend,
|
|
95
|
+
"legendClasses": radio.other.legendClasses,
|
|
96
|
+
"attributes": radio.other.attributes,
|
|
97
|
+
"classes": "ons-js-other-fieldset",
|
|
98
|
+
"checkboxes": radio.other.checkboxes,
|
|
99
|
+
"autoSelect": radio.other.autoSelect,
|
|
100
|
+
"selectAllChildren": radio.other.selectAllChildren
|
|
101
|
+
})
|
|
102
|
+
}}
|
|
103
|
+
{% elif otherType == "radios" %}
|
|
104
|
+
{% from "components/radios/_macro.njk" import onsRadios %}
|
|
105
|
+
{{
|
|
106
|
+
onsRadios({
|
|
107
|
+
"id": radio.other.id,
|
|
108
|
+
"name": radio.other.name,
|
|
109
|
+
"borderless": true,
|
|
110
|
+
"legend": radio.other.legend,
|
|
111
|
+
"legendClasses": radio.other.legendClasses | default('') + ' ons-u-mb-xs',
|
|
112
|
+
"attributes": radio.other.attributes,
|
|
113
|
+
"classes": "ons-js-other-fieldset",
|
|
114
|
+
"radios": radio.other.radios
|
|
115
|
+
})
|
|
116
|
+
}}
|
|
117
|
+
{% endif %}
|
|
118
|
+
</span>
|
|
119
|
+
{% endif %}
|
|
120
|
+
</span>
|
|
124
121
|
</span>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
{%
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
{{ onsButton({
|
|
122
|
+
{% if not loop.last %}
|
|
123
|
+
<br>
|
|
124
|
+
{% endif %}
|
|
125
|
+
{% endfor %}
|
|
126
|
+
</div>
|
|
127
|
+
{% if params.clearRadios is defined and params.clearRadios %}
|
|
128
|
+
{{ onsButton({
|
|
133
129
|
"text": params.clearRadios.text,
|
|
134
130
|
"name": params.clearRadios.name,
|
|
135
131
|
"type": "submit",
|
|
136
132
|
"classes": "ons-js-clear-btn ons-u-mt-s ons-u-db-no-js_enabled",
|
|
137
133
|
"variants": ["secondary", "small"]
|
|
138
134
|
}) }}
|
|
139
|
-
|
|
140
|
-
|
|
135
|
+
<span class="ons-js-clear-radio-alert ons-u-vh" role="alert" aria-live="polite" data-clear="{{ params.clearRadios.ariaClearText }}" data-cleared="{{ params.clearRadios.ariaClearedText }}"></span>
|
|
136
|
+
{% endif %}
|
|
141
137
|
{% endcall %}
|
|
142
138
|
|
|
143
139
|
{% endmacro %}
|