@ons/design-system 70.0.8 → 70.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) 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/section-navigation/example-section-navigation-single-vertical-with-title.njk +23 -0
  166. package/components/select/_macro.njk +21 -18
  167. package/components/share-page/_macro.njk +10 -5
  168. package/components/skip-to-content/_macro.njk +1 -1
  169. package/components/skip-to-content/example-skip-to-content.njk +1 -0
  170. package/components/status/_macro.njk +1 -1
  171. package/components/summary/_macro.njk +53 -23
  172. package/components/summary/example-summary-household-no-rows.njk +18 -16
  173. package/components/summary/example-summary-household.njk +75 -73
  174. package/components/summary/example-summary-hub-minimal.njk +74 -72
  175. package/components/summary/example-summary-hub.njk +169 -167
  176. package/components/table/_macro.njk +72 -45
  177. package/components/table-of-contents/_macro.njk +34 -32
  178. package/components/table-of-contents/example-table-of-contents-grouped.njk +1 -1
  179. package/components/table-of-contents/example-table-of-contents-single.njk +1 -1
  180. package/components/table-of-contents/example-table-of-contents-sticky-full-page.njk +79 -38
  181. package/components/table-of-contents/example-table-of-contents-sticky.njk +50 -13
  182. package/components/tabs/_macro.njk +12 -6
  183. package/components/tabs/example-tabs-details.njk +5 -6
  184. package/components/text-indent/_macro.njk +1 -3
  185. package/components/textarea/_macro.njk +49 -46
  186. package/components/textarea/_macro.spec.js +0 -11
  187. package/components/timeline/_macro.njk +4 -6
  188. package/components/timeout-modal/_macro.njk +21 -19
  189. package/components/timeout-modal/example-timeout-modal.njk +16 -14
  190. package/components/timeout-panel/_macro.njk +19 -17
  191. package/components/timeout-panel/example-panel-with-timeout-warning.njk +13 -11
  192. package/components/upload/_macro.njk +20 -16
  193. package/components/video/_macro.njk +16 -2
  194. package/components/video/example-video.njk +2 -2
  195. package/css/main.css +1 -1
  196. package/layout/_dsTemplate.njk +22 -20
  197. package/layout/_template.njk +63 -49
  198. package/package.json +4 -3
  199. package/scripts/main.es5.js +1 -1
  200. package/scripts/main.js +1 -1
  201. package/scss/overrides/hcm.scss +1 -1
  202. package/scss/vars/_colors.scss +1 -1
@@ -1,6 +1,7 @@
1
1
  ---
2
- "fullWidth": true
2
+ 'fullWidth': true
3
3
  ---
4
+
4
5
  {% from "components/phase-banner/_macro.njk" import onsPhaseBanner %}
5
6
  {% from "components/external-link/_macro.njk" import onsExternalLink %}
6
7
 
@@ -15,6 +16,6 @@
15
16
 
16
17
  {{
17
18
  onsPhaseBanner({
18
- "html": "This is a new service. To help us improve it, " + feedbackLink
19
- })
19
+ "html": "This is a new service. To help us improve it, " + feedbackLink
20
+ })
20
21
  }}
@@ -1,16 +1,26 @@
1
1
  {% macro onsQuestion(params) %}
2
2
 
3
- {%- set titleHtml -%}{% if params.readDescriptionFirst == true and params.description %}
4
- <div class="ons-question__description ons-u-vh">{{ params.description | safe }} </div>{% endif %}{{- params.title | safe -}}
3
+ {%- set titleHtml -%}
4
+ {%- if params.readDescriptionFirst == true and params.description -%}
5
+ <div class="ons-question__description ons-u-vh">{{- params.description | safe -}}</div>
6
+ {{- ' ' -}}
7
+ {%- endif -%}{{- params.title | safe -}}
5
8
  {%- endset -%}
6
9
 
7
- {%- set descHtml -%}{% if params.readDescriptionFirst == true %}
8
- <div aria-hidden="true" {% if params.legendIsQuestionTitle is not defined %}class="ons-question__description ons-question__description--aria-hidden"{% endif %}>{{- params.description | safe -}}</div>
10
+ {%- set descHtml -%}
11
+ {%- if params.readDescriptionFirst == true -%}
12
+ <div
13
+ aria-hidden="true"
14
+ {% if params.legendIsQuestionTitle is not defined %}class="ons-question__description ons-question__description--aria-hidden"{% endif %}
15
+ >
16
+ {{- params.description | safe -}}
17
+ </div>
9
18
  {% elif params.legendIsQuestionTitle is not defined %}
10
19
  <div class="ons-question__description ons-u-mb-m">{{- params.description | safe -}}</div>
11
20
  {% else %}
12
21
  {{- params.description | safe -}}
13
- {% endif %}{%- endset -%}
22
+ {%- endif -%}
23
+ {%- endset -%}
14
24
 
15
25
  {% set instHtml %}
16
26
  <div class="ons-question__instruction ons-u-mb-m">{{ params.instruction | safe }}</div>
@@ -19,13 +29,15 @@
19
29
  {% if params.definition %}
20
30
  {% set questionDefinition %}
21
31
  {% from "components/details/_macro.njk" import onsDetails %}
22
- {% call onsDetails({
23
- "id": params.definition.id,
24
- "classes": 'ons-u-mb-m',
25
- "title": params.definition.title,
26
- "headingAttributes": params.definition.headingAttributes,
27
- "contentAttributes": params.definition.contentAttributes
28
- }) %}
32
+ {%
33
+ call onsDetails({
34
+ "id": params.definition.id,
35
+ "classes": 'ons-u-mb-m',
36
+ "title": params.definition.title,
37
+ "headingAttributes": params.definition.headingAttributes,
38
+ "contentAttributes": params.definition.contentAttributes
39
+ })
40
+ %}
29
41
  {% if params.definition.content %}
30
42
  {{ params.definition.content | safe }}
31
43
  {% endif %}
@@ -36,11 +48,13 @@
36
48
  {% if params.guidance %}
37
49
  {% set questionGuidance %}
38
50
  {% from "components/panel/_macro.njk" import onsPanel %}
39
- {% call onsPanel({
40
- "id": params.guidance.id,
41
- "classes": "ons-question-guidance ons-u-mb-m",
42
- "attributes": params.guidance.attributes
43
- }) %}
51
+ {%
52
+ call onsPanel({
53
+ "id": params.guidance.id,
54
+ "classes": "ons-question-guidance ons-u-mb-m",
55
+ "attributes": params.guidance.attributes
56
+ })
57
+ %}
44
58
  {% if params.guidance.content %}
45
59
  {{ params.guidance.content | safe }}
46
60
  {% endif %}
@@ -58,24 +72,26 @@
58
72
  "itemsList": item.itemsList
59
73
  })
60
74
  }}
61
- {% endfor -%}
62
- {% endif -%}
75
+ {%- endfor -%}
76
+ {%- endif -%}
63
77
  {% endcall %}
64
78
  {% endset %}
65
79
  {% endif %}
66
80
 
67
81
  <div
68
- {% if params.id %} id="{{ params.id }}"{% endif %}
69
- class="ons-question ons-u-mb-l{% if params.classes %} {{ params.classes }}{% endif %}"
70
- {% 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 %}
82
+ {% if params.id %}id="{{ params.id }}"{% endif %}
83
+ class="ons-question ons-u-mb-l{{ ' ' + params.classes if params.classes else '' }}"
84
+ {% 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 %}
71
85
  >
72
86
  {% set additionalContent %}
73
87
  {% if params.warning %}
74
88
  {% from "components/panel/_macro.njk" import onsPanel %}
75
- {% call onsPanel({
76
- "id": params.warning.id,
77
- "variant": "warn"
78
- }) %}
89
+ {%
90
+ call onsPanel({
91
+ "id": params.warning.id,
92
+ "variant": "warn"
93
+ })
94
+ %}
79
95
  <p>{{ params.warning.body }}</p>
80
96
  {% endcall %}
81
97
  {% endif %}
@@ -99,22 +115,21 @@
99
115
  {# Resolves caller issue in Jinja: https://github.com/pallets/jinja/issues/371 #}
100
116
  {% set content = caller() if caller %}
101
117
  <div class="ons-question__answer ons-u-mb-m">
102
- {% call onsFieldset({
103
- "legendIsQuestionTitle": params.legendIsQuestionTitle,
104
- "legend": titleHtml,
105
- "description": descHtml if params.description else '',
106
- "legendClasses": params.legendClasses,
107
- "legendTitleClasses": params.legendTitleClasses
108
- }) %}
118
+ {%
119
+ call onsFieldset({
120
+ "legendIsQuestionTitle": params.legendIsQuestionTitle,
121
+ "legend": titleHtml,
122
+ "description": descHtml if params.description,
123
+ "legendClasses": params.legendClasses,
124
+ "legendTitleClasses": params.legendTitleClasses
125
+ })
126
+ %}
109
127
  {{- additionalContent | safe -}}
110
128
  {{ content }}
111
129
  {% endcall %}
112
130
  </div>
113
-
114
131
  {% else %}
115
- <h1 id="question-title" class="ons-question__title">
116
- {{- titleHtml | safe -}}
117
- </h1>
132
+ <h1 id="question-title" class="ons-question__title">{{- titleHtml | safe -}}</h1>
118
133
 
119
134
  {% if params.description %}
120
135
  {{- descHtml | safe -}}
@@ -122,20 +137,20 @@
122
137
 
123
138
  {{- additionalContent | safe -}}
124
139
 
125
- <div class="ons-question__answer ons-u-mb-m">
126
- {{ caller() if caller }}
127
- </div>
140
+ <div class="ons-question__answer ons-u-mb-m">{{ caller() if caller }}</div>
128
141
  {% endif %}
129
142
 
130
143
  {% if params.justification %}
131
144
  {% from "components/details/_macro.njk" import onsDetails %}
132
- {% call onsDetails({
133
- "id": params.justification.id,
134
- "classes": 'ons-u-mb-m',
135
- "title": params.justification.title | default('Why we ask this question'),
136
- "headingAttributes": params.justification.headingAttributes,
137
- "contentAttributes": params.justification.contentAttributes
138
- }) %}
145
+ {%
146
+ call onsDetails({
147
+ "id": params.justification.id,
148
+ "classes": 'ons-u-mb-m',
149
+ "title": params.justification.title | default('Why we ask this question'),
150
+ "headingAttributes": params.justification.headingAttributes,
151
+ "contentAttributes": params.justification.contentAttributes
152
+ })
153
+ %}
139
154
  {{ params.justification.content | safe }}
140
155
  {% endcall %}
141
156
  {% endif %}
@@ -1,47 +1,52 @@
1
1
  ---
2
- title: "Example: Question with an interviewer instruction"
2
+ title: 'Example: Question with an interviewer instruction'
3
3
  layout: ~
4
4
  ---
5
+
5
6
  {% extends "layout/_template.njk" %}
6
7
  {% from "components/question/_macro.njk" import onsQuestion %}
7
8
  {% from "components/input/_macro.njk" import onsInput %}
8
-
9
- {% set pageConfig = {
10
- "header": {
11
- "title": "Interviewer led question example"
12
- },
13
- "breadcrumbs": {
14
- "ariaLabel": 'Breadcrumbs',
15
- "itemsList": [
16
- {
17
- "url": '#0',
18
- "text": 'Previous'
19
- }
20
- ]
9
+ {%
10
+ set pageConfig = {
11
+ "header": {
12
+ "title": "Interviewer led question example"
13
+ },
14
+ "breadcrumbs": {
15
+ "ariaLabel": 'Breadcrumbs',
16
+ "itemsList": [
17
+ {
18
+ "url": '#0',
19
+ "text": 'Previous'
20
+ }
21
+ ]
22
+ }
21
23
  }
22
- } %}
24
+ %}
23
25
 
24
26
  {% block main %}
25
- {% call onsQuestion({
26
- "title": "How many visitors do you have staying overnight at 3 Severn Road on Sunday 21 March 2021?",
27
- "description": "<p>A visitor is anyone aged <strong>16 years or over</strong> who usually lives at another address. Enter “0” if there are no visitors staying overnight.</p>",
28
- "instruction": "<p>Tell respondent to turn to <strong>Showcard 2</strong> or show them the following Electronic Showcard</p>",
29
- "definition": {
30
- "title": "Electronic Showcard",
31
- "content": "<p>Visitor information is collected to ensure that everyone is counted, in order to produce accurate estimates of the population, to facilitate effective planning and funding decisions</p>"
32
- },
33
- "submitButton": true
34
- }) %}
35
-
36
- {{ onsInput({
37
- "id": "number-of-visitors",
38
- "name": "number-of-visitors",
39
- "type": "number",
40
- "width": "2",
41
- "label": {
42
- "text": "Number of visitors"
43
- }
44
- }) }}
27
+ {%
28
+ call onsQuestion({
29
+ "title": "How many visitors do you have staying overnight at 3 Severn Road on Sunday 21 March 2021?",
30
+ "description": "<p>A visitor is anyone aged <strong>16 years or over</strong> who usually lives at another address. Enter “0” if there are no visitors staying overnight.</p>",
31
+ "instruction": "<p>Tell respondent to turn to <strong>Showcard 2</strong> or show them the following Electronic Showcard</p>",
32
+ "definition": {
33
+ "title": "Electronic Showcard",
34
+ "content": "<p>Visitor information is collected to ensure that everyone is counted, in order to produce accurate estimates of the population, to facilitate effective planning and funding decisions</p>"
35
+ },
36
+ "submitButton": true
37
+ })
38
+ %}
45
39
 
40
+ {{
41
+ onsInput({
42
+ "id": "number-of-visitors",
43
+ "name": "number-of-visitors",
44
+ "type": "number",
45
+ "width": "2",
46
+ "label": {
47
+ "text": "Number of visitors"
48
+ }
49
+ })
50
+ }}
46
51
  {% endcall %}
47
52
  {% endblock %}
@@ -1,96 +1,100 @@
1
1
  ---
2
- title: "Example: Question as a fieldset"
2
+ title: 'Example: Question as a fieldset'
3
3
  layout: ~
4
4
  ---
5
+
5
6
  {% extends "layout/_template.njk" %}
6
7
  {% from "components/question/_macro.njk" import onsQuestion %}
7
8
  {% from "components/radios/_macro.njk" import onsRadios %}
8
-
9
- {% set pageConfig = {
10
- "header": {
11
- "title": "Question example"
12
- },
13
- "breadcrumbs": {
14
- "ariaLabel": 'Breadcrumbs',
15
- "itemsList": [
16
- {
17
- "url": '#0',
18
- "text": 'Previous'
19
- }
20
- ]
21
- }
22
- } %}
23
-
24
- {% set questionTitle = "On 1 May 2016, what was the number of employees for Bolt and Ratchet?" %}
25
-
26
- {% block main %}
27
- {% call onsQuestion({
28
- "title": questionTitle,
29
- "description": "<p>This is all employees aged 16 years or over that your organisation employs</p>",
30
- "definition": {
31
- "title": "What we mean by “employee”",
32
- "content": "<p>An employee is a person that your organisation directly pays from its payroll(s), in return for carrying out a full-time or part-time job</p>"
9
+ {%
10
+ set pageConfig = {
11
+ "header": {
12
+ "title": "Question example"
33
13
  },
34
- "guidance": {
35
- "lists": [
36
- {
37
- "listHeading": "Include:",
38
- "itemsList": [
39
- {
40
- "text": "all employees in Great Britain (England, Scotland and Wales), both full and part-time, who received pay in the relevant period"
41
- }
42
- ]
43
- },
14
+ "breadcrumbs": {
15
+ "ariaLabel": 'Breadcrumbs',
16
+ "itemsList": [
44
17
  {
45
- "listHeading": "Exclude:",
46
- "itemsList": [
47
- {
48
- "text": "trainees on government schemes"
49
- },
50
- {
51
- "text": "employees working abroad unless paid directly from this business’s GB payroll"
52
- }
53
- ]
18
+ "url": '#0',
19
+ "text": 'Previous'
54
20
  }
55
21
  ]
56
- },
57
- "justification": {
58
- "title": "Why we ask this question",
59
- "content": "<p>We ask this question in order to understand the size of organisations in the UK</p>"
60
- },
61
- "submitButton": true
62
- }) %}
22
+ }
23
+ }
24
+ %}
25
+ {% set questionTitle = "On 1 May 2016, what was the number of employees for Bolt and Ratchet?" %}
63
26
 
64
- {{ onsRadios({
65
- "id": "number-of-employees",
66
- "name": "number-of-employees",
67
- "legend": questionTitle,
68
- "legendClasses": "ons-u-vh",
69
- "radios": [
70
- {
71
- "id": "number-of-employees-1-9",
72
- "label": {
73
- "text": "1 – 9 employees"
27
+ {% block main %}
28
+ {%
29
+ call onsQuestion({
30
+ "title": questionTitle,
31
+ "description": "<p>This is all employees aged 16 years or over that your organisation employs</p>",
32
+ "definition": {
33
+ "title": "What we mean by “employee”",
34
+ "content": "<p>An employee is a person that your organisation directly pays from its payroll(s), in return for carrying out a full-time or part-time job</p>"
35
+ },
36
+ "guidance": {
37
+ "lists": [
38
+ {
39
+ "listHeading": "Include:",
40
+ "itemsList": [
41
+ {
42
+ "text": "all employees in Great Britain (England, Scotland and Wales), both full and part-time, who received pay in the relevant period"
43
+ }
44
+ ]
74
45
  },
75
- "value": "1-9"
76
- },
77
- {
78
- "id": "number-of-employees-10-49",
79
- "label": {
80
- "text": "10 – 49 employees"
46
+ {
47
+ "listHeading": "Exclude:",
48
+ "itemsList": [
49
+ {
50
+ "text": "trainees on government schemes"
51
+ },
52
+ {
53
+ "text": "employees working abroad unless paid directly from this business’s GB payroll"
54
+ }
55
+ ]
56
+ }
57
+ ]
58
+ },
59
+ "justification": {
60
+ "title": "Why we ask this question",
61
+ "content": "<p>We ask this question in order to understand the size of organisations in the UK</p>"
62
+ },
63
+ "submitButton": true
64
+ })
65
+ %}
66
+
67
+ {{
68
+ onsRadios({
69
+ "id": "number-of-employees",
70
+ "name": "number-of-employees",
71
+ "legend": questionTitle,
72
+ "legendClasses": "ons-u-vh",
73
+ "radios": [
74
+ {
75
+ "id": "number-of-employees-1-9",
76
+ "label": {
77
+ "text": "1 – 9 employees"
78
+ },
79
+ "value": "1-9"
81
80
  },
82
- "value": "10-49"
83
- },
84
- {
85
- "id": "number-of-employees-50-100",
86
- "label": {
87
- "text": "50 – 100+ employees",
88
- "description": "Include multi-corporations"
81
+ {
82
+ "id": "number-of-employees-10-49",
83
+ "label": {
84
+ "text": "10 – 49 employees"
85
+ },
86
+ "value": "10-49"
89
87
  },
90
- "value": "50-100"
91
- }
92
- ]
93
- }) }}
94
-
88
+ {
89
+ "id": "number-of-employees-50-100",
90
+ "label": {
91
+ "text": "50 – 100+ employees",
92
+ "description": "Include multi-corporations"
93
+ },
94
+ "value": "50-100"
95
+ }
96
+ ]
97
+ })
98
+ }}
95
99
  {% endcall %}
96
100
  {% endblock %}
@@ -1,35 +1,38 @@
1
1
  ---
2
- title: "Example: Interstitial page with interviewer note"
2
+ title: 'Example: Interstitial page with interviewer note'
3
3
  layout: ~
4
4
  ---
5
- {# TO DO: To be used in a new 'Interstitial' page pattern #}
6
5
 
6
+ {# TO DO: To be used in a new 'Interstitial' page pattern #}
7
7
  {% extends "layout/_template.njk" %}
8
8
  {% from "components/question/_macro.njk" import onsQuestion %}
9
-
10
- {% set pageConfig = {
11
- "header": {
12
- "title": "Interviewer led interstitial"
13
- },
14
- "breadcrumbs": {
15
- "ariaLabel": 'Breadcrumbs',
16
- "itemsList": [
17
- {
18
- "url": '#0',
19
- "text": 'Previous'
20
- }
21
- ]
9
+ {%
10
+ set pageConfig = {
11
+ "header": {
12
+ "title": "Interviewer led interstitial"
13
+ },
14
+ "breadcrumbs": {
15
+ "ariaLabel": 'Breadcrumbs',
16
+ "itemsList": [
17
+ {
18
+ "url": '#0',
19
+ "text": 'Previous'
20
+ }
21
+ ]
22
+ }
22
23
  }
23
- } %}
24
+ %}
24
25
 
25
26
  {% block main %}
26
- {% call onsQuestion({
27
- "title": "<mark>Interviewer note:</mark>Who to interview",
28
- "instruction": "<p>Only interview a person who was usually living at the property on <strong>Sunday 21 March 2021</strong>.</p><p>If none of those house members are available, you must save and sign out and return to the address to interview one of them at a later date.</p>",
29
- "submitButton": {
30
- "variants": "timer",
31
- "text": "Continue"
32
- }
33
- }) %}
27
+ {%
28
+ call onsQuestion({
29
+ "title": "<mark>Interviewer note:</mark>Who to interview",
30
+ "instruction": "<p>Only interview a person who was usually living at the property on <strong>Sunday 21 March 2021</strong>.</p><p>If none of those house members are available, you must save and sign out and return to the address to interview one of them at a later date.</p>",
31
+ "submitButton": {
32
+ "variants": "timer",
33
+ "text": "Continue"
34
+ }
35
+ })
36
+ %}
34
37
  {% endcall %}
35
38
  {% endblock %}
@@ -1,44 +1,50 @@
1
1
  ---
2
- title: "Example: Question without a fieldset"
2
+ title: 'Example: Question without a fieldset'
3
3
  layout: ~
4
4
  ---
5
+
5
6
  {% extends "layout/_template.njk" %}
6
7
  {% from "components/question/_macro.njk" import onsQuestion %}
7
8
  {% from "components/input/_macro.njk" import onsInput %}
8
-
9
- {% set pageConfig = {
10
- "header": {
11
- "title": "Question example"
12
- },
13
- "breadcrumbs": {
14
- "ariaLabel": 'Breadcrumbs',
15
- "itemsList": [
16
- {
17
- "url": '#0',
18
- "text": 'Previous'
19
- }
20
- ]
9
+ {%
10
+ set pageConfig = {
11
+ "header": {
12
+ "title": "Question example"
13
+ },
14
+ "breadcrumbs": {
15
+ "ariaLabel": 'Breadcrumbs',
16
+ "itemsList": [
17
+ {
18
+ "url": '#0',
19
+ "text": 'Previous'
20
+ }
21
+ ]
22
+ }
21
23
  }
22
- } %}
24
+ %}
23
25
 
24
26
  {% block main %}
25
- {% call onsQuestion({
26
- "title": "How many visitors are staying overnight at 3 Severn Road on 13 May 2019?",
27
- "description": "<p>Enter “0” if there are no visitors staying overnight</p>",
28
- "justification": {
29
- "title": "Why we ask this question",
30
- "content": "<p>Visitor information is collected to ensure that everyone is counted, in order to produce accurate estimates of the population, to facilitate effective planning and funding decisions.</p>"
31
- },
32
- "submitButton": true
33
- }) %}
34
- {{ onsInput({
35
- "id": "number-of-visitors",
36
- "name": "number-of-visitors",
37
- "type": "number",
38
- "width": "2",
39
- "label": {
40
- "text": "Number of visitors"
41
- }
42
- }) }}
27
+ {%
28
+ call onsQuestion({
29
+ "title": "How many visitors are staying overnight at 3 Severn Road on 13 May 2019?",
30
+ "description": "<p>Enter “0” if there are no visitors staying overnight</p>",
31
+ "justification": {
32
+ "title": "Why we ask this question",
33
+ "content": "<p>Visitor information is collected to ensure that everyone is counted, in order to produce accurate estimates of the population, to facilitate effective planning and funding decisions.</p>"
34
+ },
35
+ "submitButton": true
36
+ })
37
+ %}
38
+ {{
39
+ onsInput({
40
+ "id": "number-of-visitors",
41
+ "name": "number-of-visitors",
42
+ "type": "number",
43
+ "width": "2",
44
+ "label": {
45
+ "text": "Number of visitors"
46
+ }
47
+ })
48
+ }}
43
49
  {% endcall %}
44
50
  {% endblock %}
@@ -6,7 +6,9 @@
6
6
  "iconType": 'quote'
7
7
  })
8
8
  -}}
9
- <span class="ons-quote__text ons-u-fs-{{ params.textFontSize if params.textFontSize else 'l' }}">{{ caller() if caller else params.text | safe }}</span>
9
+ <span class="ons-quote__text ons-u-fs-{{ params.textFontSize if params.textFontSize else 'l' }}"
10
+ >{{ caller() if caller else params.text | safe }}</span
11
+ >
10
12
  {% if params.ref %}<span class="ons-quote__ref">&mdash; {{ params.ref | safe }}</span>{% endif %}
11
13
  </blockquote>
12
14
  {% endmacro %}