@ons/design-system 62.0.2 → 62.1.1

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 (203) hide show
  1. package/README.md +10 -63
  2. package/components/access-code/example-access-code-error.njk +87 -0
  3. package/components/access-code/example-access-code.njk +63 -0
  4. package/components/accordion/example-accordion-open.njk +126 -0
  5. package/components/accordion/example-accordion.njk +25 -0
  6. package/components/address-input/example-address-input-editable.njk +52 -0
  7. package/components/address-input/example-address-input-manual.njk +23 -0
  8. package/components/address-input/example-address-input.njk +40 -0
  9. package/components/autosuggest/example-autosuggest-country-multiple.njk +30 -0
  10. package/components/autosuggest/example-autosuggest-country.njk +29 -0
  11. package/components/back-link/example-back-link.njk +17 -0
  12. package/components/breadcrumbs/example-breadcrumbs-single.njk +13 -0
  13. package/components/breadcrumbs/example-breadcrumbs.njk +17 -0
  14. package/components/button/example-button-custom.njk +20 -0
  15. package/components/button/example-button-disabled.njk +7 -0
  16. package/components/button/example-button-download.njk +9 -0
  17. package/components/button/example-button-ghost.njk +15 -0
  18. package/components/button/example-button-group.njk +16 -0
  19. package/components/button/example-button-link.njk +7 -0
  20. package/components/button/example-button-loader.njk +9 -0
  21. package/components/button/example-button-new-window.njk +12 -0
  22. package/components/button/example-button-print.njk +8 -0
  23. package/components/button/example-button-secondary-small.njk +8 -0
  24. package/components/button/example-button-secondary.njk +8 -0
  25. package/components/button/example-button-small.njk +8 -0
  26. package/components/button/example-button-timer.njk +9 -0
  27. package/components/button/example-button.njk +6 -0
  28. package/components/call-to-action/example-call-to-action-default.njk +14 -0
  29. package/components/card/example-card-set-with-images.njk +41 -0
  30. package/components/card/example-card-set-with-lists.njk +68 -0
  31. package/components/card/example-card-set.njk +38 -0
  32. package/components/card/example-card.njk +9 -0
  33. package/components/checkboxes/example-checkboxes-disabled.njk +34 -0
  34. package/components/checkboxes/example-checkboxes-error.njk +60 -0
  35. package/components/checkboxes/example-checkboxes-with-descriptions.njk +71 -0
  36. package/components/checkboxes/example-checkboxes-with-hidden-label.njk +177 -0
  37. package/components/checkboxes/example-checkboxes-with-revealed-checkboxes.njk +86 -0
  38. package/components/checkboxes/example-checkboxes-with-revealed-radios.njk +69 -0
  39. package/components/checkboxes/example-checkboxes-with-revealed-select.njk +71 -0
  40. package/components/checkboxes/example-checkboxes-with-revealed-text-input.njk +59 -0
  41. package/components/checkboxes/example-checkboxes-with-select-all-button.njk +51 -0
  42. package/components/checkboxes/example-checkboxes-with-visible-text-input.njk +61 -0
  43. package/components/checkboxes/example-checkboxes-without-border.njk +33 -0
  44. package/components/checkboxes/example-checkboxes.njk +46 -0
  45. package/components/content-pagination/example-content-pagination.njk +20 -0
  46. package/components/cookies-banner/_macro.njk +2 -2
  47. package/components/cookies-banner/_macro.spec.js +1 -1
  48. package/components/cookies-banner/example-cookies-banner-cymraeg.njk +9 -0
  49. package/components/cookies-banner/example-cookies-banner.njk +7 -0
  50. package/components/date-input/example-date-input-error.njk +62 -0
  51. package/components/date-input/example-date-input.njk +36 -0
  52. package/components/details/example-details-with-saved-state.njk +10 -0
  53. package/components/details/example-details-with-warning.njk +19 -0
  54. package/components/details/example-details.njk +9 -0
  55. package/components/document-list/example-document-list-article-featured.njk +31 -0
  56. package/components/document-list/example-document-list-articles.njk +60 -0
  57. package/components/document-list/example-document-list-downloads.njk +59 -0
  58. package/components/document-list/example-document-list-search-result-featured.njk +19 -0
  59. package/components/document-list/example-document-list-search-results.njk +67 -0
  60. package/components/duration/example-duration-error-for-single-field.njk +31 -0
  61. package/components/duration/example-duration-error.njk +30 -0
  62. package/components/duration/example-duration.njk +35 -0
  63. package/components/external-link/example-external-link.njk +8 -0
  64. package/components/feedback/example-feedback-call-to-action.njk +14 -0
  65. package/components/footer/example-footer-cymraeg.njk +54 -0
  66. package/components/footer/example-footer-default.njk +7 -0
  67. package/components/footer/example-footer-transactional.njk +62 -0
  68. package/components/footer/example-footer-warning.njk +32 -0
  69. package/components/footer/example-footer-with-alternative-organisation.njk +124 -0
  70. package/components/footer/example-footer-with-coat-of-arms.njk +32 -0
  71. package/components/footer/example-footer-with-copyright.njk +35 -0
  72. package/components/footer/example-footer.njk +85 -0
  73. package/components/header/_header.scss +2 -2
  74. package/components/header/example-header-default.njk +12 -0
  75. package/components/header/example-header-external-for-survey-with-description.njk +20 -0
  76. package/components/header/example-header-external-for-surveys.njk +33 -0
  77. package/components/header/example-header-external-welsh.njk +29 -0
  78. package/components/header/example-header-external-with-navigation.njk +42 -0
  79. package/components/header/example-header-external-with-service-links.njk +35 -0
  80. package/components/header/example-header-external-with-sub-navigation.njk +132 -0
  81. package/components/header/example-header-internal.njk +32 -0
  82. package/components/header/example-header-neutral-for-multicoloured-logo.njk +59 -0
  83. package/components/hero/example-hero-dark.njk +15 -0
  84. package/components/hero/example-hero-default.njk +14 -0
  85. package/components/images/example-images-for-regular-screens.njk +8 -0
  86. package/components/images/example-images-for-retina-screens.njk +10 -0
  87. package/components/input/example-input-email.njk +12 -0
  88. package/components/input/example-input-number-prefixed.njk +17 -0
  89. package/components/input/example-input-number-suffixed.njk +34 -0
  90. package/components/input/example-input-number.njk +15 -0
  91. package/components/input/example-input-numeric-values.njk +64 -0
  92. package/components/input/example-input-telephone.njk +13 -0
  93. package/components/input/example-input-text-width-constrained.njk +11 -0
  94. package/components/input/example-input-text-with-character-limit-checker.njk +17 -0
  95. package/components/input/example-input-text-with-description.njk +10 -0
  96. package/components/input/example-input-text.njk +9 -0
  97. package/components/label/example-label-with-description.njk +8 -0
  98. package/components/label/example-label.njk +8 -0
  99. package/components/metadata/example-metadata.njk +57 -0
  100. package/components/mutually-exclusive/example-mutually-exclusive-checkboxes.njk +71 -0
  101. package/components/mutually-exclusive/example-mutually-exclusive-date-with-error.njk +47 -0
  102. package/components/mutually-exclusive/example-mutually-exclusive-date.njk +49 -0
  103. package/components/mutually-exclusive/example-mutually-exclusive-duration.njk +45 -0
  104. package/components/mutually-exclusive/example-mutually-exclusive-email.njk +36 -0
  105. package/components/mutually-exclusive/example-mutually-exclusive-multiple-options.njk +63 -0
  106. package/components/mutually-exclusive/example-mutually-exclusive-number.njk +43 -0
  107. package/components/mutually-exclusive/example-mutually-exclusive-textarea.njk +40 -0
  108. package/components/pagination/example-pagination-first.njk +24 -0
  109. package/components/pagination/example-pagination-last.njk +24 -0
  110. package/components/pagination/example-pagination-with-no-range-indicator.njk +42 -0
  111. package/components/pagination/example-pagination.njk +116 -0
  112. package/components/panel/example-panel-bare.njk +9 -0
  113. package/components/panel/example-panel-with-announcement.njk +18 -0
  114. package/components/panel/example-panel-with-error-details.njk +18 -0
  115. package/components/panel/example-panel-with-error-summary.njk +25 -0
  116. package/components/panel/example-panel-with-information.njk +7 -0
  117. package/components/panel/example-panel-with-spacious-information.njk +7 -0
  118. package/components/panel/example-panel-with-success-message.njk +10 -0
  119. package/components/panel/example-panel-with-warning.njk +8 -0
  120. package/components/password/example-password.njk +11 -0
  121. package/components/phase-banner/example-phase-banner-alpha.njk +10 -0
  122. package/components/phase-banner/example-phase-banner-beta.njk +9 -0
  123. package/components/question/example-question-ccs.njk +49 -0
  124. package/components/question/example-question-fieldset.njk +99 -0
  125. package/components/question/example-question-interviewer-note.njk +38 -0
  126. package/components/question/example-question-no-fieldset.njk +46 -0
  127. package/components/radios/example-radios-with-clear-button.njk +97 -0
  128. package/components/radios/example-radios-with-descriptions.njk +57 -0
  129. package/components/radios/example-radios-with-error.njk +38 -0
  130. package/components/radios/example-radios-with-revealed-checkboxes.njk +69 -0
  131. package/components/radios/example-radios-with-revealed-radios.njk +68 -0
  132. package/components/radios/example-radios-with-revealed-select.njk +69 -0
  133. package/components/radios/example-radios-with-revealed-text-input.njk +80 -0
  134. package/components/radios/example-radios-with-separator.njk +59 -0
  135. package/components/radios/example-radios-with-visible-text-input.njk +40 -0
  136. package/components/radios/example-radios-without-border.njk +48 -0
  137. package/components/radios/example-radios.njk +38 -0
  138. package/components/related-content/example-related-content-general.njk +44 -0
  139. package/components/related-content/example-related-content-multiple-rows-of-links.njk +51 -0
  140. package/components/related-content/example-related-content-social-media.njk +40 -0
  141. package/components/relationships/example-relationships-error.njk +211 -0
  142. package/components/relationships/example-relationships-you.njk +187 -0
  143. package/components/relationships/example-relationships.njk +185 -0
  144. package/components/search/example-search-with-character-check.njk +23 -0
  145. package/components/search/example-search-with-placeholder.njk +16 -0
  146. package/components/search/example-search.njk +16 -0
  147. package/components/section-navigation/example-section-navigation-vertical.njk +40 -0
  148. package/components/section-navigation/example-section-navigation.njk +21 -0
  149. package/components/select/example-select-wide.njk +55 -0
  150. package/components/select/example-select-with-error.njk +58 -0
  151. package/components/select/example-select-with-inline-label.njk +23 -0
  152. package/components/select/example-select.njk +50 -0
  153. package/components/share-page/example-share-page.njk +11 -0
  154. package/components/skip-to-content/example-skip-to-content.njk +10 -0
  155. package/components/status/example-status-dead.njk +7 -0
  156. package/components/status/example-status-error.njk +7 -0
  157. package/components/status/example-status-neutral-information.njk +6 -0
  158. package/components/status/example-status-pending.njk +7 -0
  159. package/components/status/example-status-small.njk +8 -0
  160. package/components/status/example-status-success.njk +7 -0
  161. package/components/summary/example-summary-grouped-total.njk +67 -0
  162. package/components/summary/example-summary-grouped-with-errors.njk +96 -0
  163. package/components/summary/example-summary-grouped.njk +353 -0
  164. package/components/summary/example-summary-household-no-rows.njk +20 -0
  165. package/components/summary/example-summary-household.njk +77 -0
  166. package/components/summary/example-summary-hub.njk +170 -0
  167. package/components/summary/example-summary-multiple.njk +81 -0
  168. package/components/summary/example-summary-no-action.njk +40 -0
  169. package/components/summary/example-summary.njk +107 -0
  170. package/components/table/example-table-basic.njk +47 -0
  171. package/components/table/example-table-compact.njk +73 -0
  172. package/components/table/example-table-footer.njk +56 -0
  173. package/components/table/example-table-numeric.njk +81 -0
  174. package/components/table/example-table-responsive.njk +89 -0
  175. package/components/table/example-table-scrollable.njk +158 -0
  176. package/components/table/example-table-sortable.njk +236 -0
  177. package/components/table-of-contents/example-table-of-contents-grouped.njk +50 -0
  178. package/components/table-of-contents/example-table-of-contents-single.njk +39 -0
  179. package/components/table-of-contents/example-table-of-contents-sticky.njk +78 -0
  180. package/components/tabs/example-tabs-details.njk +59 -0
  181. package/components/tabs/example-tabs.njk +39 -0
  182. package/components/textarea/example-textarea-error.njk +16 -0
  183. package/components/textarea/example-textarea-with-character-limit.njk +18 -0
  184. package/components/textarea/example-textarea.njk +12 -0
  185. package/components/timeline/example-timeline.njk +35 -0
  186. package/components/timeout-modal/example-timeout-modal.njk +16 -0
  187. package/components/timeout-panel/example-panel-with-timeout-warning.njk +13 -0
  188. package/components/upload/example-upload-error.njk +16 -0
  189. package/components/upload/example-upload.njk +12 -0
  190. package/components/video/example-video.njk +14 -0
  191. package/css/main.css +3 -3
  192. package/css/print.css +1 -1
  193. package/layout/_template.njk +1 -12
  194. package/package.json +3 -8
  195. package/scss/base/_typography.scss +2 -2
  196. package/scss/main.scss +0 -1
  197. package/scss/print.scss +13 -5
  198. package/scss/utilities/_highlight.scss +6 -0
  199. package/scss/utilities/_index.scss +1 -0
  200. package/components/code-highlight/_macro.njk +0 -5
  201. package/components/code-highlight/_macro.spec.js +0 -56
  202. package/components/code-highlight/code-highlight.spec.js +0 -18
  203. package/scss/patternlib.scss +0 -148
@@ -0,0 +1,38 @@
1
+ ---
2
+ title: "Example: Interstitial page with interviewer note"
3
+ layout: ~
4
+ ---
5
+ {# TO DO: To be used in a new 'Interstitial' page pattern #}
6
+
7
+ {% extends "layout/_template.njk" %}
8
+ {% from "components/question/_macro.njk" import onsQuestion %}
9
+ {% from "components/details/_macro.njk" import onsDetails %}
10
+ {% from "components/input/_macro.njk" import onsInput %}
11
+ {% from "components/button/_macro.njk" import onsButton %}
12
+
13
+ {% set pageConfig = {
14
+ "header": {
15
+ "title": "Interviewer led interstitial"
16
+ },
17
+ "breadcrumbs": {
18
+ "ariaLabel": 'Breadcrumbs',
19
+ "itemsList": [
20
+ {
21
+ "url": '#0',
22
+ "text": 'Previous'
23
+ }
24
+ ]
25
+ }
26
+ } %}
27
+
28
+ {% block main %}
29
+ {% call onsQuestion({
30
+ "title": "<mark class=\"ons-instruction\">Interviewer note:</mark>Who to interview",
31
+ "instruction": "<p>Only interview a person who was usually living at the property on <em>Sunday 21 March 2021</em>.</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>",
32
+ "submitButton": {
33
+ "variants": "timer",
34
+ "text": "Continue"
35
+ }
36
+ }) %}
37
+ {% endcall %}
38
+ {% endblock %}
@@ -0,0 +1,46 @@
1
+ ---
2
+ title: "Example: Question without a fieldset"
3
+ layout: ~
4
+ ---
5
+ {% extends "layout/_template.njk" %}
6
+ {% from "components/question/_macro.njk" import onsQuestion %}
7
+ {% from "components/details/_macro.njk" import onsDetails %}
8
+ {% from "components/input/_macro.njk" import onsInput %}
9
+ {% from "components/button/_macro.njk" import onsButton %}
10
+
11
+ {% set pageConfig = {
12
+ "header": {
13
+ "title": "Question example"
14
+ },
15
+ "breadcrumbs": {
16
+ "ariaLabel": 'Breadcrumbs',
17
+ "itemsList": [
18
+ {
19
+ "url": '#0',
20
+ "text": 'Previous'
21
+ }
22
+ ]
23
+ }
24
+ } %}
25
+
26
+ {% block main %}
27
+ {% call onsQuestion({
28
+ "title": "How many visitors are staying overnight at 3 Severn Road on 13 May 2019?",
29
+ "description": "<p>Enter “0” if there are no visitors staying overnight</p>",
30
+ "justification": {
31
+ "title": "Why we ask this question",
32
+ "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>"
33
+ },
34
+ "submitButton": true
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
+ }) }}
45
+ {% endcall %}
46
+ {% endblock %}
@@ -0,0 +1,97 @@
1
+ {% from "components/radios/_macro.njk" import onsRadios %}
2
+ {% from "components/button/_macro.njk" import onsButton %}
3
+ {% from "components/question/_macro.njk" import onsQuestion %}
4
+ {% from "components/panel/_macro.njk" import onsPanel %}
5
+
6
+ {% call onsQuestion({
7
+ "title": "What is your religion?",
8
+ "legendIsQuestionTitle": true
9
+ }) %}
10
+ {{
11
+ onsPanel({
12
+ "body": '<p>This question is <strong>voluntary</strong></p>',
13
+ "classes": 'ons-u-mb-m'
14
+ })
15
+ }}
16
+ <form onsubmit="return false;">
17
+ {{
18
+ onsRadios({
19
+ "dontWrap": true,
20
+ "name": "religion",
21
+ "clearRadios": {
22
+ "text": "Clear selection",
23
+ "name": "clear-radios",
24
+ "ariaClearText": "You can clear your answer using the clear selection button after the radio inputs",
25
+ "ariaClearedText": "You have cleared your answer"
26
+ },
27
+ "radios": [
28
+ {
29
+ "id": "none",
30
+ "label": {
31
+ "text": "No religion"
32
+ },
33
+ "value": "none"
34
+ },
35
+ {
36
+ "id": "christian",
37
+ "label": {
38
+ "text": "Christian",
39
+ "description": "Including Church of England, Catholic, Protestant and all other Christian denominations"
40
+ },
41
+ "value": "christian"
42
+ },
43
+ {
44
+ "id": "buddhist",
45
+ "label": {
46
+ "text": "Buddhist"
47
+ },
48
+ "value": "buddhist"
49
+ },
50
+ {
51
+ "id": "hindu",
52
+ "label": {
53
+ "text": "Hindu"
54
+ },
55
+ "value": "hindu"
56
+ },
57
+ {
58
+ "id": "jewish",
59
+ "label": {
60
+ "text": "Jewish"
61
+ },
62
+ "value": "jewish"
63
+ },
64
+ {
65
+ "id": "muslim",
66
+ "label": {
67
+ "text": "Muslim"
68
+ },
69
+ "value": "muslim"
70
+ },
71
+ {
72
+ "id": "sikh",
73
+ "label": {
74
+ "text": "Sikh"
75
+ },
76
+ "value": "sikh"
77
+ },
78
+ {
79
+ "id": "other-radio",
80
+ "label": {
81
+ "text": "Any other religion"
82
+ },
83
+ "value": "other",
84
+ "other": {
85
+ "otherType": "input",
86
+ "id": "other-textbox",
87
+ "name": "other-answer",
88
+ "label": {
89
+ "text": "Enter your religion"
90
+ }
91
+ }
92
+ }
93
+ ]
94
+ })
95
+ }}
96
+ </form>
97
+ {% endcall %}
@@ -0,0 +1,57 @@
1
+ {% from "components/radios/_macro.njk" import onsRadios %}
2
+ {% from "components/question/_macro.njk" import onsQuestion %}
3
+
4
+ {% call onsQuestion({
5
+ "title": "What is your ethnic group or background?",
6
+ "classes": "ons-u-mt-no",
7
+ "legendIsQuestionTitle": true
8
+ }) %}
9
+ {{
10
+ onsRadios({
11
+ "dontWrap": true,
12
+ "name": "ethnicity",
13
+ "radios": [
14
+ {
15
+ "id": "white",
16
+ "label": {
17
+ "text": "White",
18
+ "description": "Includes British, Northern Irish, Irish, Gypsy, Irish Traveller, Roma or any other White background"
19
+ },
20
+ "name": "white"
21
+ },
22
+ {
23
+ "id": "mixed",
24
+ "label": {
25
+ "text": "Mixed or Multiple ethnic groups",
26
+ "description": "Includes White and Black Caribbean, White and Black African, White and Asian or any other Mixed or Multiple background"
27
+ },
28
+ "name": "mixed"
29
+ },
30
+ {
31
+ "id": "asian",
32
+ "label": {
33
+ "text": "Asian or Asian British",
34
+ "description": "Includes Indian, Pakistani, Bangladeshi, Chinese or any other Asian background"
35
+ },
36
+ "name": "asian"
37
+ },
38
+ {
39
+ "id": "black",
40
+ "label": {
41
+ "text": "Black, Black British, Caribbean or African",
42
+ "description": "Includes Black British, Caribbean, African or any other Black background"
43
+ },
44
+ "name": "black"
45
+ },
46
+ {
47
+ "id": "other",
48
+ "label": {
49
+ "text": "Other ethnic group",
50
+ "description": "Includes Arab or any other ethnic group"
51
+ },
52
+ "name": "other"
53
+ }
54
+ ]
55
+ })
56
+ }}
57
+ {% endcall %}
@@ -0,0 +1,38 @@
1
+ {% from "components/radios/_macro.njk" import onsRadios %}
2
+
3
+ {{
4
+ onsRadios({
5
+ "name": "gender-identity",
6
+ "dontWrap": true,
7
+ "radios": [
8
+ {
9
+ "id": "yes",
10
+ "label": {
11
+ "text": "Yes"
12
+ },
13
+ "value": "yes"
14
+ },
15
+ {
16
+ "id": "no",
17
+ "label": {
18
+ "text": "No"
19
+ },
20
+ "value": "no",
21
+ "checked": true,
22
+ "other": {
23
+ "open": true,
24
+ "otherType": "input",
25
+ "id": "no-textbox",
26
+ "name": "no-answer",
27
+ "label": {
28
+ "text": "Enter your gender identity"
29
+ }
30
+ }
31
+ }
32
+ ],
33
+ "error": {
34
+ "id": "dietary-error",
35
+ "text": "Enter your gender identity"
36
+ }
37
+ })
38
+ }}
@@ -0,0 +1,69 @@
1
+ {% from "components/radios/_macro.njk" import onsRadios %}
2
+
3
+ {{
4
+ onsRadios({
5
+ "legend": "How would you like us to contact you?",
6
+ "name": "contact",
7
+ "borderless": true,
8
+ "radios": [
9
+ {
10
+ "id": "post",
11
+ "label": {
12
+ "text": "By post"
13
+ },
14
+ "value": "post"
15
+ },
16
+ {
17
+ "id": "email",
18
+ "label": {
19
+ "text": "By email"
20
+ },
21
+ "value": "email"
22
+ },
23
+ {
24
+ "id": "phone",
25
+ "label": {
26
+ "text": "By phone"
27
+ },
28
+ "value": "phone",
29
+ "other": {
30
+ "otherType": "checkboxes",
31
+ "selectAllChildren": true,
32
+ "id": "phone-time",
33
+ "name": "phone-time",
34
+ "legend": "Select preferred times of day",
35
+ "checkboxes": [
36
+ {
37
+ "value": "anytime",
38
+ "id": "anytime",
39
+ "label": {
40
+ "text": "Anytime of day"
41
+ }
42
+ },
43
+ {
44
+ "value": "morning",
45
+ "id": "morning",
46
+ "label": {
47
+ "text": "Morning"
48
+ }
49
+ },
50
+ {
51
+ "value": "afternoon",
52
+ "id": "afternoon",
53
+ "label": {
54
+ "text": "Afternoon"
55
+ }
56
+ },
57
+ {
58
+ "value": "evening",
59
+ "id": "evening",
60
+ "label": {
61
+ "text": "Evening"
62
+ }
63
+ }
64
+ ]
65
+ }
66
+ }
67
+ ]
68
+ })
69
+ }}
@@ -0,0 +1,68 @@
1
+ {% from "components/radios/_macro.njk" import onsRadios %}
2
+
3
+ {{
4
+ onsRadios({
5
+ "legend": "How would you like us to contact you?",
6
+ "name": "contact",
7
+ "borderless": true,
8
+ "radios": [
9
+ {
10
+ "id": "post",
11
+ "label": {
12
+ "text": "By post"
13
+ },
14
+ "value": "post"
15
+ },
16
+ {
17
+ "id": "email",
18
+ "label": {
19
+ "text": "By email"
20
+ },
21
+ "value": "email"
22
+ },
23
+ {
24
+ "id": "phone",
25
+ "label": {
26
+ "text": "By phone"
27
+ },
28
+ "value": "phone",
29
+ "other": {
30
+ "otherType": "radios",
31
+ "id": "phone-time",
32
+ "name": "phone-time",
33
+ "legend": "Choose preferred time of day",
34
+ "radios": [
35
+ {
36
+ "value": "anytime",
37
+ "id": "anytime",
38
+ "label": {
39
+ "text": "Anytime of day"
40
+ }
41
+ },
42
+ {
43
+ "value": "morning",
44
+ "id": "morning",
45
+ "label": {
46
+ "text": "Morning"
47
+ }
48
+ },
49
+ {
50
+ "value": "afternoon",
51
+ "id": "afternoon",
52
+ "label": {
53
+ "text": "Afternoon"
54
+ }
55
+ },
56
+ {
57
+ "value": "evening",
58
+ "id": "evening",
59
+ "label": {
60
+ "text": "Evening"
61
+ }
62
+ }
63
+ ]
64
+ }
65
+ }
66
+ ]
67
+ })
68
+ }}
@@ -0,0 +1,69 @@
1
+ {% from "components/question/_macro.njk" import onsQuestion %}
2
+ {% from "components/radios/_macro.njk" import onsRadios %}
3
+
4
+ {% call onsQuestion({
5
+ "title": "How would you like us to contact you?",
6
+ "legendIsQuestionTitle": true
7
+ }) %}
8
+ {{
9
+ onsRadios({
10
+ "dontWrap": true,
11
+ "name": "contact",
12
+ "radios": [
13
+ {
14
+ "id": "post",
15
+ "label": {
16
+ "text": "By post"
17
+ },
18
+ "value": "post"
19
+ },
20
+ {
21
+ "id": "email",
22
+ "label": {
23
+ "text": "By email"
24
+ },
25
+ "value": "email"
26
+ },
27
+ {
28
+ "id": "phone",
29
+ "label": {
30
+ "text": "By phone"
31
+ },
32
+ "value": "phone",
33
+ "other": {
34
+ "otherType": "select",
35
+ "id": "phone-time",
36
+ "name": "phone-time",
37
+ "label": {
38
+ "text": "Choose preferred time of day"
39
+ },
40
+ "options": [
41
+ {
42
+ "value": "",
43
+ "text": "Select an option",
44
+ "disabled": true,
45
+ "selected": true
46
+ },
47
+ {
48
+ "value": "anytime",
49
+ "text": "Any time of day"
50
+ },
51
+ {
52
+ "value": "morning",
53
+ "text": "Morning"
54
+ },
55
+ {
56
+ "value": "afternoon",
57
+ "text": "Afternoon"
58
+ },
59
+ {
60
+ "value": "evening",
61
+ "text": "Evening"
62
+ }
63
+ ]
64
+ }
65
+ }
66
+ ]
67
+ })
68
+ }}
69
+ {% endcall %}
@@ -0,0 +1,80 @@
1
+ {% from "components/radios/_macro.njk" import onsRadios %}
2
+ {% from "components/question/_macro.njk" import onsQuestion %}
3
+
4
+ {% call onsQuestion({
5
+ "title": "How do you usually travel to work?",
6
+ "classes": "ons-u-mt-no",
7
+ "legendIsQuestionTitle": true
8
+ }) %}
9
+ {{
10
+ onsRadios({
11
+ "dontWrap": true,
12
+ "name": "travel",
13
+ "radios": [
14
+ {
15
+ "id": "home",
16
+ "label": {
17
+ "text": "Work mainly from home"
18
+ },
19
+ "value": "home"
20
+ },
21
+ {
22
+ "id": "car",
23
+ "label": {
24
+ "text": "Car or van"
25
+ },
26
+ "value": "car"
27
+ },
28
+ {
29
+ "id": "underground",
30
+ "label": {
31
+ "text": "Underground, metro, light rail or tram"
32
+ },
33
+ "value": "underground"
34
+ },
35
+ {
36
+ "id": "train",
37
+ "label": {
38
+ "text": "Train"
39
+ },
40
+ "value": "train"
41
+ },
42
+ {
43
+ "id": "bus",
44
+ "label": {
45
+ "text": "Bus, minibus or coach"
46
+ },
47
+ "value": "bus"
48
+ },
49
+ {
50
+ "id": "bicycle",
51
+ "label": {
52
+ "text": "Bicycle"
53
+ },
54
+ "value": "bicycle"
55
+ },
56
+ {
57
+ "id": "walk",
58
+ "label": {
59
+ "text": "Walk"
60
+ },
61
+ "value": "walk"
62
+ },
63
+ {
64
+ "id": "other-radio",
65
+ "label": {
66
+ "text": "Other"
67
+ },
68
+ "value": "other",
69
+ "other": {
70
+ "id": "other-textbox",
71
+ "name": "other-answer",
72
+ "label": {
73
+ "text": "Enter how you travel"
74
+ }
75
+ }
76
+ }
77
+ ]
78
+ })
79
+ }}
80
+ {% endcall %}
@@ -0,0 +1,59 @@
1
+ {% from "components/question/_macro.njk" import onsQuestion %}
2
+ {% from "components/radios/_macro.njk" import onsRadios %}
3
+
4
+ {% call onsQuestion({
5
+ "title": "How satisfied are you with this service?",
6
+ "legendIsQuestionTitle": true
7
+ }) %}
8
+ {{
9
+ onsRadios({
10
+ "dontWrap": true,
11
+ "name": "satisfaction",
12
+ "or": "Or",
13
+ "radios": [
14
+ {
15
+ "id": "very-satisfied",
16
+ "label": {
17
+ "text": "Very satisfied"
18
+ },
19
+ "value": "very-satisfied"
20
+ },
21
+ {
22
+ "id": "somewhat-satisfied",
23
+ "label": {
24
+ "text": "Somewhat satisfied"
25
+ },
26
+ "value": "somewhat-satisfied"
27
+ },
28
+ {
29
+ "id": "neither",
30
+ "label": {
31
+ "text": "Neither satisfied or dissatisfied"
32
+ },
33
+ "value": "neither"
34
+ },
35
+ {
36
+ "id": "somewhat-dissatisfied",
37
+ "label": {
38
+ "text": "Somewhat dissatisfied"
39
+ },
40
+ "value": "somewhat-dissatisfied"
41
+ },
42
+ {
43
+ "id": "very-dissatisfied",
44
+ "label": {
45
+ "text": "Very dissatisfied"
46
+ },
47
+ "value": "very-dissatisfied"
48
+ },
49
+ {
50
+ "id": "no",
51
+ "label": {
52
+ "text": "I don’t want to give feedback"
53
+ },
54
+ "value": "no"
55
+ }
56
+ ]
57
+ })
58
+ }}
59
+ {% endcall %}
@@ -0,0 +1,40 @@
1
+ {% from "components/radios/_macro.njk" import onsRadios %}
2
+ {% from "components/question/_macro.njk" import onsQuestion %}
3
+
4
+ {% call onsQuestion({
5
+ "title": "Is the gender you identify with the same as your sex registered at birth?",
6
+ "classes": "ons-u-mt-no",
7
+ "legendIsQuestionTitle": true
8
+ }) %}
9
+ {{
10
+ onsRadios({
11
+ "dontWrap": true,
12
+ "name": "gender-identity",
13
+ "radios": [
14
+ {
15
+ "id": "yes",
16
+ "label": {
17
+ "text": "Yes"
18
+ },
19
+ "value": "yes"
20
+ },
21
+ {
22
+ "id": "no",
23
+ "label": {
24
+ "text": "No"
25
+ },
26
+ "value": "no",
27
+ "other": {
28
+ "open": true,
29
+ "otherType": "input",
30
+ "id": "no-textbox",
31
+ "name": "no-answer",
32
+ "label": {
33
+ "text": "Enter your gender identity"
34
+ }
35
+ }
36
+ }
37
+ ]
38
+ })
39
+ }}
40
+ {% endcall %}