@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.
Files changed (167) hide show
  1. package/README.md +35 -13
  2. package/components/access-code/_macro.njk +1 -1
  3. package/components/access-code/_macro.spec.js +162 -0
  4. package/components/access-code/uac.spec.js +26 -0
  5. package/components/accordion/_macro.spec.js +224 -0
  6. package/components/accordion/accordion.spec.js +134 -0
  7. package/components/address-input/_macro.njk +1 -1
  8. package/components/address-input/_macro.spec.js +465 -0
  9. package/components/address-input/autosuggest.address.js +5 -4
  10. package/components/address-input/autosuggest.address.setter.js +3 -1
  11. package/components/address-input/autosuggest.address.spec.js +733 -0
  12. package/components/address-output/_macro.njk +6 -6
  13. package/components/address-output/_macro.spec.js +122 -0
  14. package/components/autosuggest/_macro.njk +1 -1
  15. package/components/autosuggest/_macro.spec.js +229 -0
  16. package/components/autosuggest/autosuggest.helpers.js +2 -3
  17. package/components/autosuggest/autosuggest.helpers.spec.js +85 -0
  18. package/components/autosuggest/autosuggest.js +4 -2
  19. package/components/autosuggest/autosuggest.spec.js +625 -0
  20. package/components/autosuggest/autosuggest.ui.js +6 -2
  21. package/components/breadcrumbs/_macro.spec.js +129 -0
  22. package/components/button/_macro.njk +5 -5
  23. package/components/button/_macro.spec.js +446 -0
  24. package/components/button/button.spec.js +290 -0
  25. package/components/call-to-action/_macro.njk +3 -1
  26. package/components/call-to-action/_macro.spec.js +52 -0
  27. package/components/card/_macro.njk +26 -19
  28. package/components/card/_macro.spec.js +261 -0
  29. package/components/char-check-limit/_macro.spec.js +73 -0
  30. package/components/char-check-limit/character-check.spec.js +196 -0
  31. package/components/char-check-limit/character-limit.js +1 -1
  32. package/components/checkboxes/_checkbox-macro.njk +2 -2
  33. package/components/checkboxes/_checkbox-macro.spec.js +419 -0
  34. package/components/checkboxes/_macro.njk +3 -5
  35. package/components/checkboxes/_macro.spec.js +306 -0
  36. package/components/checkboxes/checkboxes.spec.js +208 -0
  37. package/components/code-highlight/_macro.spec.js +56 -0
  38. package/components/code-highlight/code-highlight.spec.js +18 -0
  39. package/components/collapsible/_macro.spec.js +204 -0
  40. package/components/collapsible/collapsible.js +2 -1
  41. package/components/collapsible/collapsible.spec.js +236 -0
  42. package/components/content-pagination/_macro.spec.js +199 -0
  43. package/components/cookies-banner/_macro.njk +1 -1
  44. package/components/cookies-banner/_macro.spec.js +171 -0
  45. package/components/cookies-banner/cookies-banner.spec.js +90 -0
  46. package/components/date-input/_macro.njk +8 -5
  47. package/components/date-input/_macro.spec.js +286 -0
  48. package/components/document-list/_macro.njk +3 -5
  49. package/components/document-list/_macro.spec.js +491 -0
  50. package/components/download-resources/download-resources.spec.js +540 -0
  51. package/components/duration/_macro.njk +7 -6
  52. package/components/duration/_macro.spec.js +251 -0
  53. package/components/error/_macro.spec.js +97 -0
  54. package/components/external-link/_macro.spec.js +60 -0
  55. package/components/feedback/_macro.njk +5 -3
  56. package/components/feedback/_macro.spec.js +122 -0
  57. package/components/field/_macro.njk +2 -2
  58. package/components/field/_macro.spec.js +97 -0
  59. package/components/fieldset/_macro.njk +3 -3
  60. package/components/fieldset/_macro.spec.js +173 -0
  61. package/components/footer/_macro.njk +11 -48
  62. package/components/footer/_macro.spec.js +549 -0
  63. package/components/header/_macro.njk +2 -2
  64. package/components/header/_macro.spec.js +562 -0
  65. package/components/hero/_hero.scss +0 -3
  66. package/components/hero/_macro.njk +4 -4
  67. package/components/hero/_macro.spec.js +224 -0
  68. package/components/icons/_macro.njk +15 -15
  69. package/components/icons/_macro.spec.js +140 -0
  70. package/components/images/_macro.njk +1 -1
  71. package/components/images/_macro.spec.js +121 -0
  72. package/components/input/_input-type.scss +12 -5
  73. package/components/input/_macro.njk +6 -7
  74. package/components/input/_macro.spec.js +658 -0
  75. package/components/label/_macro.spec.js +189 -0
  76. package/components/language-selector/_macro.spec.js +129 -0
  77. package/components/lists/_list.scss +4 -0
  78. package/components/lists/_macro.njk +4 -7
  79. package/components/lists/_macro.spec.js +618 -0
  80. package/components/message/_macro.spec.js +137 -0
  81. package/components/message-list/_macro.njk +7 -7
  82. package/components/message-list/_macro.spec.js +159 -0
  83. package/components/metadata/_macro.spec.js +167 -0
  84. package/components/modal/_macro.njk +6 -6
  85. package/components/modal/_macro.spec.js +87 -0
  86. package/components/modal/modal.js +0 -16
  87. package/components/modal/modal.spec.js +59 -0
  88. package/components/mutually-exclusive/_macro.njk +38 -21
  89. package/components/mutually-exclusive/_macro.spec.js +182 -0
  90. package/components/mutually-exclusive/mutually-exclusive.checkboxes.spec.js +203 -0
  91. package/components/mutually-exclusive/mutually-exclusive.date.spec.js +142 -0
  92. package/components/mutually-exclusive/mutually-exclusive.duration.spec.js +141 -0
  93. package/components/mutually-exclusive/mutually-exclusive.email.spec.js +117 -0
  94. package/components/mutually-exclusive/mutually-exclusive.js +32 -23
  95. package/components/mutually-exclusive/mutually-exclusive.multiple-options.checkboxes.spec.js +213 -0
  96. package/components/mutually-exclusive/mutually-exclusive.number.spec.js +125 -0
  97. package/components/mutually-exclusive/mutually-exclusive.textarea.spec.js +131 -0
  98. package/components/navigation/_macro.njk +6 -6
  99. package/components/navigation/_macro.spec.js +327 -0
  100. package/components/navigation/navigation.dom.js +1 -1
  101. package/components/navigation/navigation.spec.js +232 -0
  102. package/components/pagination/_macro.njk +1 -1
  103. package/components/pagination/_macro.spec.js +411 -0
  104. package/components/panel/_macro.njk +6 -6
  105. package/components/panel/_macro.spec.js +423 -0
  106. package/components/password/_macro.spec.js +137 -0
  107. package/components/password/password.spec.js +40 -0
  108. package/components/phase-banner/_macro.spec.js +73 -0
  109. package/components/promotional-banner/_macro.spec.js +97 -0
  110. package/components/question/_macro.njk +25 -33
  111. package/components/question/_macro.spec.js +309 -0
  112. package/components/quote/_macro.spec.js +81 -0
  113. package/components/radios/_macro.njk +98 -102
  114. package/components/radios/_macro.spec.js +575 -0
  115. package/components/radios/radios.spec.js +180 -0
  116. package/components/related-content/_macro.njk +1 -0
  117. package/components/related-content/_macro.spec.js +142 -0
  118. package/components/relationships/_macro.spec.js +108 -0
  119. package/components/relationships/relationships.spec.js +84 -0
  120. package/components/reply/_macro.njk +2 -2
  121. package/components/reply/_macro.spec.js +69 -0
  122. package/components/reply/reply.spec.js +78 -0
  123. package/components/search/_macro.njk +14 -12
  124. package/components/search/_macro.spec.js +44 -0
  125. package/components/search/_search.scss +7 -7
  126. package/components/section-navigation/_macro.njk +7 -2
  127. package/components/section-navigation/_macro.spec.js +206 -0
  128. package/components/select/_macro.njk +3 -3
  129. package/components/select/_macro.spec.js +203 -0
  130. package/components/select/select.spec.js +56 -0
  131. package/components/share-page/_macro.njk +2 -2
  132. package/components/share-page/_macro.spec.js +110 -0
  133. package/components/skip-to-content/_macro.spec.js +57 -0
  134. package/components/skip-to-content/skip-to-content.spec.js +44 -0
  135. package/components/status/_macro.spec.js +77 -0
  136. package/components/summary/_macro.njk +5 -5
  137. package/components/summary/_macro.spec.js +472 -0
  138. package/components/table/_macro.njk +2 -2
  139. package/components/table/_macro.spec.js +557 -0
  140. package/components/table/table.spec.js +155 -0
  141. package/components/table-of-contents/_macro.njk +35 -35
  142. package/components/table-of-contents/_macro.spec.js +178 -0
  143. package/components/table-of-contents/toc.js +29 -25
  144. package/components/table-of-contents/toc.spec.js +61 -0
  145. package/components/tabs/_macro.njk +1 -1
  146. package/components/tabs/_macro.spec.js +79 -0
  147. package/components/tabs/tabs.spec.js +162 -0
  148. package/components/text-indent/_macro.spec.js +52 -0
  149. package/components/textarea/_macro.njk +7 -5
  150. package/components/textarea/_macro.spec.js +300 -0
  151. package/components/textarea/textarea.spec.js +98 -0
  152. package/components/timeline/_macro.njk +3 -3
  153. package/components/timeline/_macro.spec.js +81 -0
  154. package/components/timeout-modal/_macro.spec.js +68 -0
  155. package/components/timeout-modal/timeout-modal.spec.js +226 -0
  156. package/components/timeout-panel/_macro.njk +0 -1
  157. package/components/timeout-panel/_macro.spec.js +54 -0
  158. package/components/timeout-panel/timeout-panel.dom.js +1 -2
  159. package/components/timeout-panel/timeout-panel.spec.js +161 -0
  160. package/components/upload/_macro.spec.js +75 -0
  161. package/components/video/_macro.spec.js +34 -0
  162. package/css/census.css +1 -1
  163. package/css/main.css +1 -1
  164. package/js/cookies-settings.spec.js +154 -0
  165. package/package.json +10 -23
  166. package/scripts/main.es5.js +1 -1
  167. package/scripts/main.js +2 -2
@@ -13,30 +13,29 @@
13
13
  "legendIsQuestionTitle": params.legendIsQuestionTitle,
14
14
  "error": params.error
15
15
  }) %}
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 }}
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
- <input
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
- {{ onsLabel({
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
- {% if radio.other is defined and radio.other %}
48
- {% set otherType = radio.other.otherType | default('input') %}
49
- <span class="ons-radio__other{{ " " + 'ons-radio__other--open' if radio.other.open else "" }}" id="{{ radio.id }}-other-wrap">
50
- {% if otherType == "input" %}
51
- {% from "components/input/_macro.njk" import onsInput %}
52
- {{
53
- onsInput({
54
- "id": radio.other.id,
55
- "name": radio.other.name,
56
- "type": radio.other.type,
57
- "required": radio.other.required,
58
- "classes": ("ons-input--error" if params.error else "") + radio.other.classes | default(''),
59
- "width": radio.other.width | default('auto'),
60
- "attributes": radio.other.attributes,
61
- "label": {
62
- "id": radio.other.id + "-label",
63
- "text": radio.other.label.text,
64
- "classes": 'ons-u-fw-n'
65
- },
66
- "dontWrap": true,
67
- "value": radio.other.value
68
- })
69
- }}
70
- {% elif otherType == "select" %}
71
- {% from "components/select/_macro.njk" import onsSelect %}
72
- {{
73
- onsSelect({
74
- "id": radio.other.id,
75
- "name": radio.other.name,
76
- "options": radio.other.options,
77
- "classes": ("ons-input--error" if params.error else "") + radio.other.classes | default(''),
78
- "label": {
79
- "id": radio.other.id + "-label",
80
- "text": radio.other.label.text,
81
- "classes": 'ons-u-fw-n'
82
- },
83
- "dontWrap": true,
84
- "value": radio.other.value,
85
- "select": {
86
- "error": params.error
87
- }
88
- })
89
- }}
90
- {% elif otherType == "checkboxes" %}
91
- {% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
92
- {{
93
- onsCheckboxes({
94
- "id": radio.other.id,
95
- "name": radio.other.name,
96
- "checked": radio.other.checked,
97
- "borderless": true,
98
- "legend": radio.other.legend,
99
- "legendClasses": radio.other.legendClasses,
100
- "attributes": radio.other.attributes,
101
- "classes": "ons-js-other-fieldset",
102
- "checkboxes": radio.other.checkboxes,
103
- "autoSelect": radio.other.autoSelect,
104
- "selectAllChildren": radio.other.selectAllChildren
105
- })
106
- }}
107
- {% elif otherType == "radios" %}
108
- {% from "components/radios/_macro.njk" import onsRadios %}
109
- {{
110
- onsRadios({
111
- "id": radio.other.id,
112
- "name": radio.other.name,
113
- "borderless": true,
114
- "legend": radio.other.legend,
115
- "legendClasses": radio.other.legendClasses | default('') + ' ons-u-mb-xs',
116
- "attributes": radio.other.attributes,
117
- "classes": "ons-js-other-fieldset",
118
- "radios": radio.other.radios
119
- })
120
- }}
121
- {% endif %}
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
- </span>
126
- {% if not loop.last %}
127
- <br>
128
- {% endif %}
129
- {% endfor %}
130
- </div>
131
- {% if params.clearRadios is defined and params.clearRadios %}
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
- <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>
140
- {% endif %}
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 %}