@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.
Files changed (201) hide show
  1. package/components/access-code/_macro.njk +31 -25
  2. package/components/access-code/example-access-code-error.njk +49 -37
  3. package/components/access-code/example-access-code.njk +40 -30
  4. package/components/accordion/_macro.njk +7 -6
  5. package/components/accordion/example-accordion-open.njk +0 -1
  6. package/components/address-input/_macro.njk +23 -11
  7. package/components/address-input/autosuggest.address.js +0 -5
  8. package/components/address-input/example-address-input-editable.njk +52 -50
  9. package/components/address-input/example-address-input-manual.njk +23 -21
  10. package/components/address-input/example-address-input.njk +40 -38
  11. package/components/address-output/_macro.njk +6 -6
  12. package/components/autosuggest/_macro.njk +57 -37
  13. package/components/autosuggest/example-autosuggest-country-multiple.njk +26 -26
  14. package/components/autosuggest/example-autosuggest-country.njk +24 -24
  15. package/components/back-to-top/example-back-to-top.njk +183 -6
  16. package/components/back-to-top/example-full-page-back-to-top.njk +135 -123
  17. package/components/breadcrumbs/_macro.njk +12 -4
  18. package/components/browser-banner/_macro.njk +6 -3
  19. package/components/button/_button.scss +36 -1
  20. package/components/button/_macro.njk +63 -62
  21. package/components/button/example-button-ghost.njk +1 -0
  22. package/components/call-to-action/_macro.njk +7 -5
  23. package/components/call-to-action/example-call-to-action-default.njk +3 -2
  24. package/components/card/_macro.njk +26 -10
  25. package/components/card/example-card-set-with-images.njk +31 -29
  26. package/components/card/example-card-set-with-lists.njk +58 -56
  27. package/components/card/example-card-set.njk +28 -26
  28. package/components/card/example-card.njk +9 -7
  29. package/components/char-check-limit/_macro.njk +1 -3
  30. package/components/checkboxes/_checkbox-macro.njk +19 -15
  31. package/components/checkboxes/_macro.njk +81 -72
  32. package/components/checkboxes/example-checkboxes-disabled.njk +30 -30
  33. package/components/checkboxes/example-checkboxes-error.njk +0 -1
  34. package/components/checkboxes/example-checkboxes-with-descriptions.njk +7 -5
  35. package/components/checkboxes/example-checkboxes-with-hidden-label.njk +162 -170
  36. package/components/checkboxes/example-checkboxes-with-revealed-checkboxes-expanded.njk +81 -81
  37. package/components/checkboxes/example-checkboxes-with-revealed-checkboxes.njk +79 -79
  38. package/components/checkboxes/example-checkboxes-with-revealed-select-expanded.njk +7 -5
  39. package/components/checkboxes/example-checkboxes-with-revealed-select.njk +7 -5
  40. package/components/checkboxes/example-checkboxes-with-revealed-text-input-expanded.njk +7 -5
  41. package/components/checkboxes/example-checkboxes-with-revealed-text-input.njk +7 -5
  42. package/components/checkboxes/example-checkboxes-with-select-all-button.njk +7 -5
  43. package/components/checkboxes/example-checkboxes-with-visible-text-input.njk +7 -5
  44. package/components/checkboxes/example-checkboxes.njk +7 -5
  45. package/components/content-pagination/_macro.njk +34 -32
  46. package/components/content-pagination/example-content-pagination.njk +17 -17
  47. package/components/cookies-banner/_macro.njk +19 -6
  48. package/components/cookies-banner/example-cookies-banner-cymraeg.njk +2 -1
  49. package/components/cookies-banner/example-cookies-banner.njk +3 -4
  50. package/components/date-input/_macro.njk +71 -63
  51. package/components/date-input/example-date-input-error-for-single-field.njk +0 -1
  52. package/components/date-input/example-date-input-error.njk +0 -1
  53. package/components/description-list/_macro.njk +20 -11
  54. package/components/details/_macro.njk +18 -11
  55. package/components/details/example-details-with-warning.njk +15 -10
  56. package/components/document-list/_macro.njk +102 -93
  57. package/components/document-list/example-document-list-article-featured.njk +27 -25
  58. package/components/document-list/example-document-list-articles.njk +55 -53
  59. package/components/document-list/example-document-list-downloads.njk +49 -47
  60. package/components/document-list/example-document-list-search-result-featured.njk +19 -17
  61. package/components/document-list/example-document-list-search-results.njk +60 -58
  62. package/components/duration/_macro.njk +61 -55
  63. package/components/duration/example-duration-error-for-single-field.njk +28 -26
  64. package/components/duration/example-duration-single-field.njk +23 -19
  65. package/components/duration/example-duration.njk +33 -29
  66. package/components/error/_macro.njk +8 -6
  67. package/components/external-link/_macro.njk +7 -5
  68. package/components/external-link/example-external-link.njk +9 -6
  69. package/components/feedback/_macro.njk +7 -5
  70. package/components/field/_macro.njk +2 -2
  71. package/components/fieldset/_macro.njk +23 -16
  72. package/components/footer/_macro.njk +28 -21
  73. package/components/footer/_macro.spec.js +1 -1
  74. package/components/footer/example-footer-cymraeg.njk +2 -1
  75. package/components/footer/example-footer-default.njk +3 -4
  76. package/components/footer/example-footer-transactional.njk +2 -1
  77. package/components/footer/example-footer-warning.njk +2 -1
  78. package/components/footer/example-footer-with-alternative-organisation.njk +2 -1
  79. package/components/footer/example-footer-with-coat-of-arms.njk +2 -1
  80. package/components/footer/example-footer-with-copyright.njk +2 -1
  81. package/components/footer/example-footer.njk +2 -1
  82. package/components/header/_header.scss +24 -19
  83. package/components/header/_macro.njk +183 -141
  84. package/components/header/example-header-default.njk +2 -1
  85. package/components/header/example-header-external-for-survey-with-description.njk +2 -1
  86. package/components/header/example-header-external-for-surveys.njk +2 -1
  87. package/components/header/example-header-external-welsh.njk +7 -7
  88. package/components/header/example-header-external-with-navigation-and-search.njk +3 -2
  89. package/components/header/example-header-external-with-navigation.njk +2 -1
  90. package/components/header/example-header-external-with-service-links.njk +2 -1
  91. package/components/header/example-header-external-with-sub-navigation-removed.njk +2 -1
  92. package/components/header/example-header-external-with-sub-navigation.njk +3 -2
  93. package/components/header/example-header-internal.njk +2 -1
  94. package/components/header/example-header-multiple-logos.njk +2 -1
  95. package/components/header/{example-header-neutral-for-multicoloured-logo.njk → example-header-neutral.njk} +2 -1
  96. package/components/helpers/grid.njk +17 -16
  97. package/components/hero/_macro.njk +6 -11
  98. package/components/hero/example-hero-dark.njk +2 -1
  99. package/components/hero/example-hero-default.njk +2 -1
  100. package/components/icon/_macro.njk +601 -168
  101. package/components/image/_macro.njk +7 -5
  102. package/components/input/_macro.njk +114 -95
  103. package/components/input/example-input-search-with-character-check.njk +1 -1
  104. package/components/input/example-input-search-with-placeholder.njk +1 -1
  105. package/components/input/example-input-search.njk +1 -1
  106. package/components/label/_macro.njk +32 -26
  107. package/components/language-selector/_macro.njk +11 -2
  108. package/components/list/_list.scss +13 -0
  109. package/components/list/_macro.njk +93 -73
  110. package/components/message/_macro.njk +20 -7
  111. package/components/message-list/_macro.njk +26 -20
  112. package/components/modal/_macro.njk +11 -12
  113. package/components/multiple-input-fields/_macro.njk +30 -28
  114. package/components/mutually-exclusive/_macro.njk +20 -13
  115. package/components/mutually-exclusive/example-mutually-exclusive-checkboxes.njk +6 -4
  116. package/components/mutually-exclusive/example-mutually-exclusive-date.njk +7 -5
  117. package/components/mutually-exclusive/example-mutually-exclusive-duration.njk +44 -40
  118. package/components/mutually-exclusive/example-mutually-exclusive-email.njk +7 -5
  119. package/components/mutually-exclusive/example-mutually-exclusive-multiple-options.njk +6 -4
  120. package/components/mutually-exclusive/example-mutually-exclusive-number.njk +6 -4
  121. package/components/mutually-exclusive/example-mutually-exclusive-textarea.njk +6 -4
  122. package/components/navigation/_macro.njk +133 -67
  123. package/components/navigation/_navigation.scss +0 -9
  124. package/components/pagination/_macro.njk +42 -20
  125. package/components/panel/_macro.njk +27 -16
  126. package/components/panel/example-panel-bare.njk +6 -4
  127. package/components/panel/example-panel-with-announcement.njk +7 -4
  128. package/components/panel/example-panel-with-error-summary.njk +6 -4
  129. package/components/panel/example-panel-with-warning.njk +5 -3
  130. package/components/password/_macro.njk +7 -5
  131. package/components/phase-banner/_macro.njk +3 -3
  132. package/components/phase-banner/example-phase-banner-alpha.njk +2 -1
  133. package/components/phase-banner/example-phase-banner-beta.njk +4 -3
  134. package/components/question/_macro.njk +62 -47
  135. package/components/question/example-question-ccs.njk +40 -35
  136. package/components/question/example-question-fieldset.njk +84 -80
  137. package/components/question/example-question-interviewer-note.njk +27 -24
  138. package/components/question/example-question-no-fieldset.njk +39 -33
  139. package/components/quote/_macro.njk +3 -1
  140. package/components/radios/_macro.njk +54 -36
  141. package/components/radios/_macro.spec.js +21 -0
  142. package/components/radios/example-radios-with-clear-button-expanded.njk +6 -4
  143. package/components/radios/example-radios-with-clear-button.njk +6 -4
  144. package/components/radios/example-radios-with-descriptions.njk +7 -5
  145. package/components/radios/example-radios-with-revealed-select-expanded.njk +6 -4
  146. package/components/radios/example-radios-with-revealed-select.njk +6 -4
  147. package/components/radios/example-radios-with-revealed-text-area-expanded.njk +7 -5
  148. package/components/radios/example-radios-with-revealed-text-area.njk +7 -5
  149. package/components/radios/example-radios-with-revealed-text-input-expanded.njk +7 -5
  150. package/components/radios/example-radios-with-revealed-text-input.njk +7 -5
  151. package/components/radios/example-radios-with-separator.njk +6 -4
  152. package/components/radios/example-radios-with-visible-text-input.njk +7 -5
  153. package/components/radios/example-radios-without-border.njk +0 -1
  154. package/components/radios/example-radios.njk +7 -5
  155. package/components/related-content/_macro.njk +10 -11
  156. package/components/related-content/_section-macro.njk +7 -7
  157. package/components/related-content/example-related-content-general.njk +5 -3
  158. package/components/related-content/example-related-content-multiple-rows-of-links.njk +51 -49
  159. package/components/related-content/example-related-content-social-media.njk +40 -38
  160. package/components/relationships/_macro.njk +10 -8
  161. package/components/relationships/example-relationships-error.njk +176 -168
  162. package/components/relationships/example-relationships-you.njk +169 -163
  163. package/components/relationships/example-relationships.njk +167 -161
  164. package/components/section-navigation/_macro.njk +34 -12
  165. package/components/select/_macro.njk +21 -18
  166. package/components/share-page/_macro.njk +10 -5
  167. package/components/skip-to-content/_macro.njk +1 -1
  168. package/components/skip-to-content/example-skip-to-content.njk +1 -0
  169. package/components/status/_macro.njk +1 -1
  170. package/components/summary/_macro.njk +53 -23
  171. package/components/summary/example-summary-household-no-rows.njk +18 -16
  172. package/components/summary/example-summary-household.njk +75 -73
  173. package/components/summary/example-summary-hub-minimal.njk +74 -72
  174. package/components/summary/example-summary-hub.njk +169 -167
  175. package/components/table/_macro.njk +72 -45
  176. package/components/table-of-contents/_macro.njk +34 -32
  177. package/components/table-of-contents/example-table-of-contents-grouped.njk +1 -1
  178. package/components/table-of-contents/example-table-of-contents-single.njk +1 -1
  179. package/components/table-of-contents/example-table-of-contents-sticky-full-page.njk +79 -38
  180. package/components/table-of-contents/example-table-of-contents-sticky.njk +50 -13
  181. package/components/tabs/_macro.njk +12 -6
  182. package/components/tabs/example-tabs-details.njk +5 -6
  183. package/components/text-indent/_macro.njk +1 -3
  184. package/components/textarea/_macro.njk +49 -46
  185. package/components/textarea/_macro.spec.js +0 -11
  186. package/components/timeline/_macro.njk +4 -6
  187. package/components/timeout-modal/_macro.njk +21 -19
  188. package/components/timeout-modal/example-timeout-modal.njk +16 -14
  189. package/components/timeout-panel/_macro.njk +19 -17
  190. package/components/timeout-panel/example-panel-with-timeout-warning.njk +13 -11
  191. package/components/upload/_macro.njk +20 -16
  192. package/components/video/_macro.njk +16 -2
  193. package/components/video/example-video.njk +2 -2
  194. package/css/main.css +1 -1
  195. package/layout/_dsTemplate.njk +22 -20
  196. package/layout/_template.njk +63 -49
  197. package/package.json +4 -3
  198. package/scripts/main.es5.js +1 -1
  199. package/scripts/main.js +1 -1
  200. package/scss/overrides/hcm.scss +1 -1
  201. package/scss/vars/_colors.scss +1 -1
@@ -1,5 +1,5 @@
1
1
  {% macro onsList(params) %}
2
- {% set variants = params.variants if params.variants else '' %}
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 else '' %}
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
- <{{ listEl }} {% if params.id %}id="{{ params.id }}"{% endif %} class="ons-list{% if listEl == 'p' %} ons-list--p{% endif %}{% if params.classes %} {{ params.classes -}}{% endif %}{% if params.variants %}{% if params.variants is not string %}{% for variant in params.variants %} ons-list--{{ variant }}{% endfor %}{% else %} ons-list--{{ params.variants }}{% endif %}{% endif %}{% if otherClasses %} {{ otherClasses -}}{% endif %}"{% 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 %}>
24
- {%- for item in params.itemsList -%}
25
- {% set sublistClasses = item.listClasses if item.listClasses else '' %}
26
- {% set sublistParams = {
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
- {% if listLength > 1 or listEl == 'ul' %}
32
- <li class="ons-list__item{% if item.listClasses %} {{ item.listClasses }}{% endif %}"{% if item.current %} aria-current="true"{% endif %}>
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
- {# For Craft support we also support title and navigation title #}
39
- {% if item.navigationTitle %}
40
- {% set itemText = item.navigationTitle %}
41
- {% elif item.title %}
42
- {% set itemText = item.title %}
43
- {% endif %}
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
- {%- if item.prefix or (params.iconPosition == 'before') -%}
46
- <span class="ons-list__prefix"{% if listEl != 'ol' %} aria-hidden="true"{% endif %}>
47
- {%- if item.prefix -%}
48
- {{- item.prefix -}}.
49
- {% elif params.iconPosition == 'before' %}
50
- {% from "components/icon/_macro.njk" import onsIcon %}
51
- {{-
52
- onsIcon({
53
- "iconType": itemIconType,
54
- "iconSize": params.iconSize
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
- {%- if item.url and item.current != true -%}
61
- {%- if item.external -%}
62
- {% from "components/external-link/_macro.njk" import onsExternalLink %}
63
- {{
64
- onsExternalLink({
65
- "url": item.url,
66
- "linkText": itemText
67
- })
68
- }}
69
- {%- else -%}
70
- <a href="{{ item.url }}" class="ons-list__link{% if item.variants == 'inPageLink' %} ons-js-inpagelink{% endif %}{% if item.classes %} {{ item.classes }}{% endif %}"{% 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 %}>
71
- {%- if item.prefix -%}<span class="ons-u-vh">{{- item.prefix -}}</span>{%- endif -%} {{- itemText | safe -}}
72
- {%- if item.target == "_blank" -%}<span class="ons-u-vh"> ({{- item.screenreaderMessage | default("opens in a new tab") -}})</span>{%- endif -%}
73
- </a>
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
- {%- else -%}
76
- {{- itemText | safe -}}
77
- {%- endif -%}
78
- {%- if item.suffix or (params.iconPosition == 'after') -%}
79
- <span class="ons-list__suffix"{% if listEl != 'ol' %} aria-hidden="true"{% endif %}>
80
- {%- if item.suffix -%}
81
- {{- item.suffix -}}
82
- {%- elif (item.index and listEl != 'ol') or (item.index and listEl == 'ol' and 'bare' in variants) -%}
83
- {{- loop.index -}}
84
- {% elif params.iconPosition == 'after' %}
85
- {% from "components/icon/_macro.njk" import onsIcon %}
86
- {{-
87
- onsIcon({
88
- "iconType": itemIconType,
89
- "iconSize": params.iconSize
90
- })
91
- -}}
92
- {%- endif -%}</span>
93
- {%- endif -%}
94
- {% if item.itemsList %}
95
- {# Handle nested lists with recursive call for sub layer #}
96
- {{ onsList(sublistParams) }}
97
- {% endif %}
98
- {% if listLength > 1 or listEl == 'ul' %}
99
- </li>
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
- {%- endfor -%}
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 %} id="{{ params.id }}"{% endif %}>
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 class="ons-message__value ons-u-fw-b"{% if params.fromId %} id="{{ params.fromId }}"{% endif %}{% if params.fromName %} name="{{ params.fromName }}"{% endif %}>{{ params.fromValue }}</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 class="ons-message__value ons-u-fs-s"{% if params.sentId %} id="{{ params.sentId }}"{% endif %}{% if params.sentName %} name="{{ params.sentName }}"{% endif %}>{{ params.sentValue }}</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 class="ons-message__unread-link"{% if params.unreadLinkId %} id="{{ params.unreadLinkId }}"{% endif %} href="{{ params.unreadLink }}">{{ params.unreadLinkText }}</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 %} id="{{ params.messageID }}"{% endif %}>
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
- {% 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">{{ message.fromText }}</dd>
12
- <dt class="ons-message-item__metadata-term ons-message-item__metadata-term--date ons-u-vh">{{ params.dateLabel }}:</dt>
13
- <dd class="ons-message-item__metadata-value ons-message-item__metadata-value--date ons-u-fs-s">{{ message.dateText }}</dd>
14
- </dl>
15
- <div class="ons-message-item__body" aria-label="{{ params.ariaLabelMsg | default("Message text") }}">
16
- {{ message.body | safe }}
17
- </div>
18
- <div class="ons-message-item__link ons-u-vh"><a href="{{ message.url }}">{{ params.hiddenReadLabel }}: {{ message.subject }}</a></div>
19
- </li>
20
- {% endfor %}
21
- </ul>
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 class="ons-modal ons-js-modal {{ params.classes if params.classes else '' }}"
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
- {{ params.title }}
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
- {{ onsButton({
19
- "text": params.btnText,
20
- "classes": "ons-js-modal-btn ons-u-mt-s"
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
- {% call onsMutuallyExclusive({
17
- "id": params.id,
18
- "legend": params.legendOrLabel,
19
- "legendClasses": params.legendClasses,
20
- "description": params.description,
21
- "classes": params.classes,
22
- "dontWrap": params.dontWrap if params.numberOfFields > 1 else true,
23
- "legendIsQuestionTitle": params.legendIsQuestionTitle,
24
- "exclusiveOptions": params.mutuallyExclusive.exclusiveOptions,
25
- "or": params.mutuallyExclusive.or,
26
- "deselectMessage": params.mutuallyExclusive.deselectMessage,
27
- "deselectGroupAdjective": params.mutuallyExclusive.deselectGroupAdjective,
28
- "deselectExclusiveOptionAdjective": params.mutuallyExclusive.deselectExclusiveOptionAdjective,
29
- "error": params.error
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
- {% call onsFieldset({
35
- "id": params.id,
36
- "legend": params.legendOrLabel,
37
- "legendClasses": params.legendClasses,
38
- "description": params.description,
39
- "classes": params.classes,
40
- "dontWrap": params.dontWrap,
41
- "legendIsQuestionTitle": params.legendIsQuestionTitle,
42
- "error": params.error
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
- {% 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
- }) %}
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 class="ons-js-exclusive-alert ons-u-vh" role="alert" aria-live="polite" data-group-adjective="{{ params.deselectGroupAdjective }}" data-option-adjective="{{ params.deselectExclusiveOptionAdjective }}"></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
- {% call onsQuestion({
5
- "title": "What type of central heating do you have?",
6
- "legendIsQuestionTitle": true
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
- {% call onsQuestion({
5
- "title": "When did you leave your last paid job?",
6
- "description": "<p>For example, 31 3 2018</p>",
7
- "legendIsQuestionTitle": true
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
- {% call onsQuestion({
5
- "title": "How long have you lived at this address?",
6
- "description": "<p>Enter “0” into the years field if you have lived at this address for less than a year</p>",
7
- "legendIsQuestionTitle": true
8
- }) %}
9
- {{ onsDuration({
10
- "id": "address-duration",
11
- "dontWrap": true,
12
- "field1": {
13
- "id": "address-duration-years",
14
- "name": "address-duration-years",
15
- "suffix": {
16
- "text": "Years",
17
- "id": "address-duration-years-suffix"
18
- }
19
- },
20
- "field2": {
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
- {% call onsQuestion({
5
- "title": "Get a confirmation email",
6
- "description": "<p>Enter your email address if you would like to be sent confirmation that you have completed your survey</p>",
7
- "legendIsQuestionTitle": true
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
- {% call onsQuestion({
5
- "title": "What type of central heating do you have?",
6
- "legendIsQuestionTitle": true
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",