@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,59 @@
1
+ ---
2
+ "fullWidth": true
3
+ ---
4
+ {% from "components/header/_macro.njk" import onsHeader %}
5
+
6
+ {{
7
+ onsHeader({
8
+ "title": 'ONS Service',
9
+ "variants": 'neutral',
10
+ "mastheadLogoUrl": '#0',
11
+ "serviceLinks": {
12
+ "id": "service-links",
13
+ "ariaLabel": 'Services menu',
14
+ "ariaListLabel": 'Menu',
15
+ "toggleServicesButton": {
16
+ "text": 'Account',
17
+ "ariaLabel": 'Toggle services menu'
18
+ },
19
+ "itemsList": [
20
+ {
21
+ "title": "Help",
22
+ "url": "#0"
23
+ },
24
+ {
25
+ "title": "My Account",
26
+ "url": "#0"
27
+ },
28
+ {
29
+ "title": "Sign out",
30
+ "url": "#0"
31
+ }
32
+ ]
33
+ },
34
+ "navigation": {
35
+ "id": 'main-nav',
36
+ "ariaLabel": 'Main menu',
37
+ "currentPath": '#menu-item-2',
38
+ "currentPageTitle": 'Design system',
39
+ "itemsList": [
40
+ {
41
+ "title": 'Menu item 1',
42
+ "url": '#0'
43
+ },
44
+ {
45
+ "title": 'Menu item 2',
46
+ "url": '#menu-item-2'
47
+ },
48
+ {
49
+ "title": 'Menu item 3',
50
+ "url": '#0'
51
+ }
52
+ ],
53
+ "toggleNavigationButton": {
54
+ "text": 'Menu',
55
+ "ariaLabel": 'Toggle main menu'
56
+ }
57
+ }
58
+ })
59
+ }}
@@ -0,0 +1,15 @@
1
+ ---
2
+ "fullWidth": true
3
+ ---
4
+ {% from "components/hero/_macro.njk" import onsHero %}
5
+ {{
6
+ onsHero({
7
+ "title": 'Design and build digital services for the ONS',
8
+ "text": 'Everything you need to make accessible, consistent digital products',
9
+ "button": {
10
+ "url": '#0',
11
+ "text": 'Get started'
12
+ },
13
+ "variants": ['dark']
14
+ })
15
+ }}
@@ -0,0 +1,14 @@
1
+ ---
2
+ "fullWidth": true
3
+ ---
4
+ {% from "components/hero/_macro.njk" import onsHero %}
5
+ {{
6
+ onsHero({
7
+ "title": 'Design and build digital services for the ONS',
8
+ "text": 'Everything you need to make accessible, consistent digital products',
9
+ "button": {
10
+ "url": '#0',
11
+ "text": 'Get started'
12
+ }
13
+ })
14
+ }}
@@ -0,0 +1,8 @@
1
+ {% from "components/images/_macro.njk" import onsImage %}
2
+ {{
3
+ onsImage({
4
+ "url": '/img/small/woman-in-purple-dress-shirt.jpg',
5
+ "alt": 'Woman in a purple dress shirt using a laptop',
6
+ "caption": 'Image 1 - Woman in a purple dress shirt using a laptop'
7
+ })
8
+ }}
@@ -0,0 +1,10 @@
1
+ {% from "components/images/_macro.njk" import onsImage %}
2
+ {{
3
+ onsImage({
4
+ "image": {
5
+ "smallSrc": '/img/small/woman-in-purple-dress-shirt.jpg',
6
+ "largeSrc": '/img/large/woman-in-purple-dress-shirt.jpg'
7
+ },
8
+ "caption": 'Image 1 - Woman in a purple dress shirt using a laptop'
9
+ })
10
+ }}
@@ -0,0 +1,12 @@
1
+ {% from "components/input/_macro.njk" import onsInput %}
2
+ {{
3
+ onsInput({
4
+ "id": "email",
5
+ "type": "email",
6
+ "autocomplete": "email",
7
+ "label": {
8
+ "text": "Email address",
9
+ "description": "This will not be stored and only used once to send your confirmation"
10
+ }
11
+ })
12
+ }}
@@ -0,0 +1,17 @@
1
+ {% from "components/input/_macro.njk" import onsInput %}
2
+ {{
3
+ onsInput({
4
+ "id": "prefixed",
5
+ "type": "number",
6
+ "width": "6",
7
+ "autocomplete": "off",
8
+ "label": {
9
+ "text": "Your annual salary before taxes"
10
+ },
11
+ "prefix": {
12
+ "title": "British pounds (GBP)",
13
+ "text": "£",
14
+ "id": "annual-salary-gpb-prefix"
15
+ }
16
+ })
17
+ }}
@@ -0,0 +1,34 @@
1
+ {% from "components/input/_macro.njk" import onsInput %}
2
+ {{
3
+ onsInput({
4
+ "id": "suffixed-per-cent",
5
+ "type": "number",
6
+ "width": "3",
7
+ "autocomplete": "off",
8
+ "label": {
9
+ "text": "People with internet access"
10
+ },
11
+ "suffix": {
12
+ "title": "per cent",
13
+ "text": "%",
14
+ "id": "internet-access-per-cent-suffix"
15
+ }
16
+ })
17
+ }}
18
+ {{
19
+ onsInput({
20
+ "id": "suffixed-centimetres",
21
+ "type": "number",
22
+ "width": "4",
23
+ "autocomplete": "off",
24
+ "label": {
25
+ "text": "Length",
26
+ "description": "For example enter 1250 for 12.5m"
27
+ },
28
+ "suffix": {
29
+ "title": "centimetres",
30
+ "text": "cm",
31
+ "id": "length-cm-suffix"
32
+ }
33
+ })
34
+ }}
@@ -0,0 +1,15 @@
1
+ {% from "components/input/_macro.njk" import onsInput %}
2
+ {{
3
+ onsInput({
4
+ "id": "number",
5
+ "type": "number",
6
+ "width": "2",
7
+ "autocomplete": "off",
8
+ "attributes": {
9
+ "min": 0
10
+ },
11
+ "label": {
12
+ "text": "Number of bedrooms"
13
+ }
14
+ })
15
+ }}
@@ -0,0 +1,64 @@
1
+ {% from "components/input/_macro.njk" import onsInput %}
2
+ {{
3
+ onsInput({
4
+ "id": "number",
5
+ "type": "number",
6
+ "width": "2",
7
+ "autocomplete": "off",
8
+ "attributes": {
9
+ "min": 0
10
+ },
11
+ "label": {
12
+ "text": "Number of bedrooms"
13
+ }
14
+ })
15
+ }}
16
+ {{
17
+ onsInput({
18
+ "id": "prefixed",
19
+ "type": "number",
20
+ "width": "6",
21
+ "autocomplete": "off",
22
+ "label": {
23
+ "text": "Your annual salary before taxes"
24
+ },
25
+ "prefix": {
26
+ "text": "£",
27
+ "title": "British pounds (GBP)",
28
+ "id": "annual-salary-gpb-prefix"
29
+ }
30
+ })
31
+ }}
32
+ {{
33
+ onsInput({
34
+ "id": "suffixed-percent",
35
+ "type": "number",
36
+ "width": "3",
37
+ "autocomplete": "off",
38
+ "label": {
39
+ "text": "People with internet access"
40
+ },
41
+ "suffix": {
42
+ "title": "per cent",
43
+ "text": "%",
44
+ "id": "internet-access-per-cent-suffix"
45
+ }
46
+ })
47
+ }}
48
+ {{
49
+ onsInput({
50
+ "id": "suffixed-centimetres",
51
+ "type": "number",
52
+ "width": "4",
53
+ "autocomplete": "off",
54
+ "label": {
55
+ "text": "Length",
56
+ "description": "For example enter 1250 for 12.5m"
57
+ },
58
+ "suffix": {
59
+ "title": "centimetres",
60
+ "text": "cm",
61
+ "id": "length-cm-suffix"
62
+ }
63
+ })
64
+ }}
@@ -0,0 +1,13 @@
1
+ {% from "components/input/_macro.njk" import onsInput %}
2
+ {{
3
+ onsInput({
4
+ "id": "telephone",
5
+ "type": "tel",
6
+ "autocomplete": "tel",
7
+ "width": "15",
8
+ "label": {
9
+ "text": "UK mobile number",
10
+ "description": "This will not be stored and only used once to send your access code"
11
+ }
12
+ })
13
+ }}
@@ -0,0 +1,11 @@
1
+ {% from "components/input/_macro.njk" import onsInput %}
2
+ {{
3
+ onsInput({
4
+ "id": "text-width",
5
+ "width": "7",
6
+ "autocomplete": "postal-code",
7
+ "label": {
8
+ "text": "Postcode"
9
+ }
10
+ })
11
+ }}
@@ -0,0 +1,17 @@
1
+ {% from "components/input/_macro.njk" import onsInput %}
2
+ {{
3
+ onsInput({
4
+ "id": "text",
5
+ "label": {
6
+ "text": "Enter some text"
7
+ },
8
+ "width": "10",
9
+ "charCheckLimit": {
10
+ "limit": 10,
11
+ "charCountOverLimitSingular": "{x} character too many",
12
+ "charCountOverLimitPlural": "{x} characters too many",
13
+ "charCountSingular": "You have {x} character remaining",
14
+ "charCountPlural": "You have {x} characters remaining"
15
+ }
16
+ })
17
+ }}
@@ -0,0 +1,10 @@
1
+ {% from "components/input/_macro.njk" import onsInput %}
2
+ {{
3
+ onsInput({
4
+ "id": "text",
5
+ "label": {
6
+ "text": "Enter some text",
7
+ "description": "Example description hint text"
8
+ }
9
+ })
10
+ }}
@@ -0,0 +1,9 @@
1
+ {% from "components/input/_macro.njk" import onsInput %}
2
+ {{
3
+ onsInput({
4
+ "id": "text",
5
+ "label": {
6
+ "text": "Enter some text"
7
+ }
8
+ })
9
+ }}
@@ -0,0 +1,8 @@
1
+ {% from "components/label/_macro.njk" import onsLabel %}
2
+ {{
3
+ onsLabel({
4
+ "text": "Label",
5
+ "for": "some-input",
6
+ "description": "An example description"
7
+ })
8
+ }}
@@ -0,0 +1,8 @@
1
+ {% from "components/label/_macro.njk" import onsLabel %}
2
+ {{
3
+ onsLabel({
4
+ "id": 'label',
5
+ "for": "some-input",
6
+ "text": 'Label'
7
+ })
8
+ }}
@@ -0,0 +1,57 @@
1
+ {% from "components/metadata/_macro.njk" import onsMetadata %}
2
+ {{
3
+ onsMetadata({
4
+ "classes": "ons-u-mb-no",
5
+ "metadataLabel": "Information about this business and its survey requirements",
6
+ "termCol": "2",
7
+ "descriptionCol": "10",
8
+ "itemsList": [
9
+ {
10
+ "term": "Survey:",
11
+ "descriptions": [
12
+ {
13
+ "description": "Bricks & Blocks"
14
+ }
15
+ ]
16
+ },
17
+ {
18
+ "term": "RU Refs:",
19
+ "descriptions": [
20
+ {
21
+ "description": "49900000118"
22
+ },
23
+ {
24
+ "description": "49300005832"
25
+ }
26
+ ]
27
+ },
28
+ {
29
+ "term": "Business:",
30
+ "descriptions": [
31
+ {
32
+ "description": "Bolts & Ratchets Ltd."
33
+ }
34
+ ]
35
+ },
36
+ {
37
+ "term": "Trading as:",
38
+ "descriptions": [
39
+ {
40
+ "description": "Bolts & Ratchets"
41
+ }
42
+ ]
43
+ },
44
+ {
45
+ "term": "To:",
46
+ "descriptions": [
47
+ {
48
+ "description": "Jacky Turner"
49
+ },
50
+ {
51
+ "description": "Louise Goodland"
52
+ }
53
+ ]
54
+ }
55
+ ]
56
+ })
57
+ }}
@@ -0,0 +1,71 @@
1
+ {% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
2
+ {% from "components/question/_macro.njk" import onsQuestion %}
3
+
4
+ {% call onsQuestion({
5
+ "title": "What type of central heating do you have?",
6
+ "legendIsQuestionTitle": true
7
+ }) %}
8
+ {{
9
+ onsCheckboxes({
10
+ "id": "central-heating-answers",
11
+ "dontWrap": true,
12
+ "checkboxesLabel": "Select all that apply",
13
+ "name": "mutually-exclusive",
14
+ "checkboxes": [
15
+ {
16
+ "id": "gas",
17
+ "label": {
18
+ "text": "Gas"
19
+ },
20
+ "value": "gas"
21
+ },
22
+ {
23
+ "id": "electric",
24
+ "label": {
25
+ "text": "Electric"
26
+ },
27
+ "value": "electric"
28
+ },
29
+ {
30
+ "id": "solid-fuel",
31
+ "label": {
32
+ "text": "Solid fuel"
33
+ },
34
+ "value": "solid-fuel"
35
+ },
36
+ {
37
+ "id": "other-fuel",
38
+ "label": {
39
+ "text": "Other"
40
+ },
41
+ "value": "other",
42
+ "other": {
43
+ "id": "other-fuel-textbox",
44
+ "name": "other-fuel-answer",
45
+ "label": {
46
+ "text": "Please specify"
47
+ }
48
+ }
49
+ }
50
+ ],
51
+ "mutuallyExclusive": {
52
+ "or": "Or",
53
+ "deselectMessage": "Selecting this will uncheck all other checkboxes",
54
+ "deselectGroupAdjective": "deselected",
55
+ "deselectExclusiveOptionAdjective": "deselected",
56
+ "exclusiveOptions": [
57
+ {
58
+ "id": "no-central-heating",
59
+ "label": {
60
+ "text": "No central heating"
61
+ },
62
+ "attributes": {
63
+ "data-attribute": "Example attribute"
64
+ },
65
+ "value": "no-central-heating"
66
+ }
67
+ ]
68
+ }
69
+ })
70
+ }}
71
+ {% endcall %}
@@ -0,0 +1,47 @@
1
+ {% from "components/date-input/_macro.njk" import onsDateInput %}
2
+
3
+ {{
4
+ onsDateInput({
5
+ "id": "date-mutually-exclusive",
6
+ "legendOrLabel": "When did you leave your last paid job?",
7
+ "legendClasses": "ons-u-vh",
8
+ "day": {
9
+ "label": {
10
+ "text": "Day"
11
+ },
12
+ "name": "day-exclusive"
13
+ },
14
+ "month": {
15
+ "label": {
16
+ "text": "Month"
17
+ },
18
+ "name": "month-exclusive"
19
+ },
20
+ "year": {
21
+ "label": {
22
+ "text": "Year"
23
+ },
24
+ "name": "year-exclusive"
25
+ },
26
+ "mutuallyExclusive": {
27
+ "or": "Or",
28
+ "deselectMessage": "Selecting this will clear the date if one has been inputted",
29
+ "deselectGroupAdjective": "cleared",
30
+ "deselectExclusiveOptionAdjective": "deselected",
31
+ "exclusiveOptions": [
32
+ {
33
+ "id": "date-exclusive-checkbox",
34
+ "name": "no-paid-job",
35
+ "value": "no-paid-job",
36
+ "label": {
37
+ "text": "I have never had a paid job"
38
+ }
39
+ }
40
+ ]
41
+ },
42
+ "error": {
43
+ "id": 'date-mutually-exclusive-error',
44
+ "text": 'Enter when you left your last paid job'
45
+ }
46
+ })
47
+ }}
@@ -0,0 +1,49 @@
1
+ {% from "components/date-input/_macro.njk" import onsDateInput %}
2
+ {% from "components/question/_macro.njk" import onsQuestion %}
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
+ }) %}
9
+ {{
10
+ onsDateInput({
11
+ "id": "date-mutually-exclusive",
12
+ "dontWrap": true,
13
+ "day": {
14
+ "label": {
15
+ "text": "Day"
16
+ },
17
+ "name": "day-exclusive"
18
+ },
19
+ "month": {
20
+ "label": {
21
+ "text": "Month"
22
+ },
23
+ "name": "month-exclusive"
24
+ },
25
+ "year": {
26
+ "label": {
27
+ "text": "Year"
28
+ },
29
+ "name": "year-exclusive"
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": "date-exclusive-checkbox",
39
+ "name": "no-paid-job",
40
+ "value": "no-paid-job",
41
+ "label": {
42
+ "text": "I have never had a paid job"
43
+ }
44
+ }
45
+ ]
46
+ }
47
+ })
48
+ }}
49
+ {% endcall %}
@@ -0,0 +1,45 @@
1
+ {% from "components/question/_macro.njk" import onsQuestion %}
2
+ {% from "components/duration/_macro.njk" import onsDuration %}
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
+ }
41
+ }
42
+ ]
43
+ }
44
+ }) }}
45
+ {% endcall %}
@@ -0,0 +1,36 @@
1
+ {% from "components/input/_macro.njk" import onsInput %}
2
+ {% from "components/question/_macro.njk" import onsQuestion %}
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
+ }) %}
9
+ {{
10
+ onsInput({
11
+ "id": "email",
12
+ "type": "email",
13
+ "label": {
14
+ "text": "Email address",
15
+ "description": "This will not be stored and only used once to send your confirmation"
16
+ },
17
+ "dontWrap": true,
18
+ "mutuallyExclusive": {
19
+ "or": "Or",
20
+ "deselectMessage": "Selecting this will clear your email",
21
+ "deselectGroupAdjective": "cleared",
22
+ "deselectExclusiveOptionAdjective": "deselected",
23
+ "exclusiveOptions": [
24
+ {
25
+ "id": "email-checkbox",
26
+ "name": "no-email",
27
+ "value": "no-email",
28
+ "label": {
29
+ "text": "I don’t want to receive a confirmation email"
30
+ }
31
+ }
32
+ ]
33
+ }
34
+ })
35
+ }}
36
+ {% endcall %}