@ons/design-system 62.0.1 → 62.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/README.md +0 -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/_button.scss +5 -3
  15. package/components/button/example-button-custom.njk +20 -0
  16. package/components/button/example-button-disabled.njk +7 -0
  17. package/components/button/example-button-download.njk +9 -0
  18. package/components/button/example-button-ghost.njk +15 -0
  19. package/components/button/example-button-group.njk +16 -0
  20. package/components/button/example-button-link.njk +7 -0
  21. package/components/button/example-button-loader.njk +9 -0
  22. package/components/button/example-button-new-window.njk +12 -0
  23. package/components/button/example-button-print.njk +8 -0
  24. package/components/button/example-button-secondary-small.njk +8 -0
  25. package/components/button/example-button-secondary.njk +8 -0
  26. package/components/button/example-button-small.njk +8 -0
  27. package/components/button/example-button-timer.njk +9 -0
  28. package/components/button/example-button.njk +6 -0
  29. package/components/call-to-action/example-call-to-action-default.njk +14 -0
  30. package/components/card/example-card-set-with-images.njk +41 -0
  31. package/components/card/example-card-set-with-lists.njk +68 -0
  32. package/components/card/example-card-set.njk +38 -0
  33. package/components/card/example-card.njk +9 -0
  34. package/components/checkboxes/example-checkboxes-disabled.njk +34 -0
  35. package/components/checkboxes/example-checkboxes-error.njk +60 -0
  36. package/components/checkboxes/example-checkboxes-with-descriptions.njk +71 -0
  37. package/components/checkboxes/example-checkboxes-with-hidden-label.njk +177 -0
  38. package/components/checkboxes/example-checkboxes-with-revealed-checkboxes.njk +86 -0
  39. package/components/checkboxes/example-checkboxes-with-revealed-radios.njk +69 -0
  40. package/components/checkboxes/example-checkboxes-with-revealed-select.njk +71 -0
  41. package/components/checkboxes/example-checkboxes-with-revealed-text-input.njk +59 -0
  42. package/components/checkboxes/example-checkboxes-with-select-all-button.njk +51 -0
  43. package/components/checkboxes/example-checkboxes-with-visible-text-input.njk +61 -0
  44. package/components/checkboxes/example-checkboxes-without-border.njk +33 -0
  45. package/components/checkboxes/example-checkboxes.njk +46 -0
  46. package/components/content-pagination/example-content-pagination.njk +20 -0
  47. package/components/cookies-banner/_macro.njk +4 -4
  48. package/components/cookies-banner/_macro.spec.js +41 -1
  49. package/components/cookies-banner/example-cookies-banner-cymraeg.njk +9 -0
  50. package/components/cookies-banner/example-cookies-banner.njk +7 -0
  51. package/components/date-input/example-date-input-error.njk +62 -0
  52. package/components/date-input/example-date-input.njk +36 -0
  53. package/components/details/example-details-with-saved-state.njk +10 -0
  54. package/components/details/example-details-with-warning.njk +19 -0
  55. package/components/details/example-details.njk +9 -0
  56. package/components/document-list/example-document-list-article-featured.njk +31 -0
  57. package/components/document-list/example-document-list-articles.njk +60 -0
  58. package/components/document-list/example-document-list-downloads.njk +59 -0
  59. package/components/document-list/example-document-list-search-result-featured.njk +19 -0
  60. package/components/document-list/example-document-list-search-results.njk +67 -0
  61. package/components/duration/example-duration-error.njk +30 -0
  62. package/components/duration/example-duration.njk +35 -0
  63. package/components/duration/examples-duration-error-for-single-field.njk +31 -0
  64. package/components/external-link/example-external-link.njk +8 -0
  65. package/components/feedback/example-feedback-call-to-action.njk +14 -0
  66. package/components/footer/example-footer-cymraeg.njk +54 -0
  67. package/components/footer/example-footer-default.njk +7 -0
  68. package/components/footer/example-footer-transactional.njk +62 -0
  69. package/components/footer/example-footer-warning.njk +32 -0
  70. package/components/footer/example-footer-with-alternative-organisation.njk +124 -0
  71. package/components/footer/example-footer-with-coat-of-arms.njk +32 -0
  72. package/components/footer/example-footer-with-copyright.njk +35 -0
  73. package/components/footer/example-footer.njk +85 -0
  74. package/components/header/_header.scss +2 -2
  75. package/components/header/_macro.spec.js +97 -0
  76. package/components/header/example-header-default.njk +12 -0
  77. package/components/header/example-header-external-for-survey-with-description.njk +20 -0
  78. package/components/header/example-header-external-for-surveys.njk +33 -0
  79. package/components/header/example-header-external-welsh.njk +29 -0
  80. package/components/header/example-header-external-with-navigation.njk +42 -0
  81. package/components/header/example-header-external-with-service-links.njk +35 -0
  82. package/components/header/example-header-external-with-sub-navigation.njk +132 -0
  83. package/components/header/example-header-internal.njk +32 -0
  84. package/components/header/example-header-neutral-for-multicoloured-logo.njk +59 -0
  85. package/components/hero/example-hero-dark.njk +15 -0
  86. package/components/hero/example-hero-default.njk +14 -0
  87. package/components/images/example-images-for-regular-screens.njk +8 -0
  88. package/components/images/example-images-for-retina-screens.njk +10 -0
  89. package/components/input/example-input-email.njk +12 -0
  90. package/components/input/example-input-number-prefixed.njk +17 -0
  91. package/components/input/example-input-number-suffixed.njk +34 -0
  92. package/components/input/example-input-number.njk +15 -0
  93. package/components/input/example-input-numeric-values.njk +64 -0
  94. package/components/input/example-input-telephone.njk +13 -0
  95. package/components/input/example-input-text-width-constrained.njk +11 -0
  96. package/components/input/example-input-text-with-character-limit-checker.njk +17 -0
  97. package/components/input/example-input-text-with-description.njk +10 -0
  98. package/components/input/example-input-text.njk +9 -0
  99. package/components/label/example-label-with-description.njk +8 -0
  100. package/components/label/example-label.njk +8 -0
  101. package/components/metadata/example-metadata.njk +57 -0
  102. package/components/mutually-exclusive/example-mutually-exclusive-checkboxes.njk +71 -0
  103. package/components/mutually-exclusive/example-mutually-exclusive-date-with-error.njk +47 -0
  104. package/components/mutually-exclusive/example-mutually-exclusive-date.njk +49 -0
  105. package/components/mutually-exclusive/example-mutually-exclusive-duration.njk +45 -0
  106. package/components/mutually-exclusive/example-mutually-exclusive-email.njk +36 -0
  107. package/components/mutually-exclusive/example-mutually-exclusive-multiple-options.njk +63 -0
  108. package/components/mutually-exclusive/example-mutually-exclusive-number.njk +43 -0
  109. package/components/mutually-exclusive/example-mutually-exclusive-textarea.njk +40 -0
  110. package/components/navigation/_macro.njk +1 -1
  111. package/components/pagination/example-pagination-first.njk +24 -0
  112. package/components/pagination/example-pagination-last.njk +24 -0
  113. package/components/pagination/example-pagination-with-no-range-indicator.njk +42 -0
  114. package/components/pagination/example-pagination.njk +116 -0
  115. package/components/panel/example-panel-bare.njk +9 -0
  116. package/components/panel/example-panel-with-announcement.njk +18 -0
  117. package/components/panel/example-panel-with-error-details.njk +18 -0
  118. package/components/panel/example-panel-with-error-summary.njk +25 -0
  119. package/components/panel/example-panel-with-information.njk +7 -0
  120. package/components/panel/example-panel-with-spacious-information.njk +7 -0
  121. package/components/panel/example-panel-with-success-message.njk +10 -0
  122. package/components/panel/example-panel-with-warning.njk +8 -0
  123. package/components/password/example-password.njk +11 -0
  124. package/components/phase-banner/example-phase-banner-alpha.njk +10 -0
  125. package/components/phase-banner/example-phase-banner-beta.njk +9 -0
  126. package/components/question/example-question-ccs.njk +49 -0
  127. package/components/question/example-question-fieldset.njk +99 -0
  128. package/components/question/example-question-interviewer-note.njk +38 -0
  129. package/components/question/example-question-no-fieldset.njk +46 -0
  130. package/components/radios/example-radios-with-clear-button.njk +97 -0
  131. package/components/radios/example-radios-with-descriptions.njk +57 -0
  132. package/components/radios/example-radios-with-error.njk +38 -0
  133. package/components/radios/example-radios-with-revealed-checkboxes.njk +69 -0
  134. package/components/radios/example-radios-with-revealed-radios.njk +68 -0
  135. package/components/radios/example-radios-with-revealed-select.njk +69 -0
  136. package/components/radios/example-radios-with-revealed-text-input.njk +80 -0
  137. package/components/radios/example-radios-with-separator.njk +59 -0
  138. package/components/radios/example-radios-with-visible-text-input.njk +40 -0
  139. package/components/radios/example-radios-without-border.njk +48 -0
  140. package/components/radios/examples-radios.njk +38 -0
  141. package/components/related-content/example-related-content-general.njk +44 -0
  142. package/components/related-content/example-related-content-multiple-rows-of-links.njk +51 -0
  143. package/components/related-content/example-related-content-social-media.njk +40 -0
  144. package/components/relationships/example-relationships-error.njk +211 -0
  145. package/components/relationships/example-relationships-you.njk +187 -0
  146. package/components/relationships/example-relationships.njk +185 -0
  147. package/components/search/example-search-with-character-check.njk +23 -0
  148. package/components/search/example-search-with-placeholder.njk +16 -0
  149. package/components/search/example-search.njk +16 -0
  150. package/components/section-navigation/example-section-navigation-vertical.njk +40 -0
  151. package/components/section-navigation/example-section-navigation.njk +21 -0
  152. package/components/select/example-select-wide.njk +55 -0
  153. package/components/select/example-select-with-error.njk +58 -0
  154. package/components/select/example-select-with-inline-label.njk +23 -0
  155. package/components/select/example-select.njk +50 -0
  156. package/components/share-page/example-share-page.njk +11 -0
  157. package/components/skip-to-content/example-skip-to-content.njk +10 -0
  158. package/components/status/example-status-dead.njk +7 -0
  159. package/components/status/example-status-error.njk +7 -0
  160. package/components/status/example-status-neutral-information.njk +6 -0
  161. package/components/status/example-status-pending.njk +7 -0
  162. package/components/status/example-status-small.njk +8 -0
  163. package/components/status/example-status-success.njk +7 -0
  164. package/components/summary/example-summary-grouped-total.njk +67 -0
  165. package/components/summary/example-summary-grouped-with-errors.njk +96 -0
  166. package/components/summary/example-summary-grouped.njk +353 -0
  167. package/components/summary/example-summary-household-no-rows.njk +20 -0
  168. package/components/summary/example-summary-household.njk +77 -0
  169. package/components/summary/example-summary-hub.njk +170 -0
  170. package/components/summary/example-summary-multiple.njk +81 -0
  171. package/components/summary/example-summary-no-action.njk +40 -0
  172. package/components/summary/example-summary.njk +107 -0
  173. package/components/table/_macro.njk +1 -1
  174. package/components/table/_table.scss +10 -10
  175. package/components/table/example-table-basic.njk +47 -0
  176. package/components/table/example-table-compact.njk +73 -0
  177. package/components/table/example-table-footer.njk +56 -0
  178. package/components/table/example-table-numeric.njk +81 -0
  179. package/components/table/example-table-responsive.njk +89 -0
  180. package/components/table/example-table-scrollable.njk +158 -0
  181. package/components/table/example-table-sortable.njk +236 -0
  182. package/components/table/sortable-table.dom.js +1 -1
  183. package/components/table/sortable-table.js +5 -2
  184. package/components/table-of-contents/example-table-of-contents-grouped.njk +50 -0
  185. package/components/table-of-contents/example-table-of-contents-single.njk +39 -0
  186. package/components/table-of-contents/example-table-of-contents-sticky.njk +78 -0
  187. package/components/tabs/example-tabs-details.njk +59 -0
  188. package/components/tabs/example-tabs.njk +39 -0
  189. package/components/textarea/example-textarea-error.njk +16 -0
  190. package/components/textarea/example-textarea-with-character-limit.njk +18 -0
  191. package/components/textarea/example-textarea.njk +12 -0
  192. package/components/timeline/example-timeline.njk +35 -0
  193. package/components/timeout-modal/example-timeout-modal.njk +16 -0
  194. package/components/timeout-panel/example-panel-with-timeout-warning.njk +13 -0
  195. package/components/upload/example-upload-error.njk +16 -0
  196. package/components/upload/example-upload.njk +12 -0
  197. package/components/video/example-video.njk +14 -0
  198. package/css/main.css +3 -3
  199. package/css/print.css +1 -1
  200. package/layout/_template.njk +1 -12
  201. package/package.json +3 -8
  202. package/scripts/main.es5.js +1 -1
  203. package/scripts/main.js +2 -2
  204. package/scss/base/_typography.scss +2 -2
  205. package/scss/main.scss +0 -1
  206. package/scss/print.scss +13 -5
  207. package/scss/utilities/_highlight.scss +6 -0
  208. package/scss/utilities/_index.scss +1 -0
  209. package/components/code-highlight/_macro.njk +0 -5
  210. package/components/code-highlight/_macro.spec.js +0 -56
  211. package/components/code-highlight/code-highlight.spec.js +0 -18
  212. package/scss/patternlib.scss +0 -148
@@ -0,0 +1,86 @@
1
+ {% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
2
+
3
+ {{
4
+ onsCheckboxes({
5
+ "legend": "Content type",
6
+ "checkboxesLabel": "Show only:",
7
+ "borderless": true,
8
+ "name": "dietary",
9
+ "checkboxes": [
10
+ {
11
+ "id": "data",
12
+ "label": {
13
+ "text": "Data (309)"
14
+ },
15
+ "value": "data",
16
+ "other": {
17
+ "otherType": "checkboxes",
18
+ "selectAllChildren": true,
19
+ "legend": "Data type",
20
+ "legendClasses": "ons-u-vh",
21
+ "name": "name",
22
+ "checkboxes": [
23
+ {
24
+ "id": "datasets",
25
+ "label": {
26
+ "text": "Datasets (100)"
27
+ },
28
+ "value": "datasets"
29
+ },
30
+ {
31
+ "id": "timeseries",
32
+ "label": {
33
+ "text": "Timeseries (20)"
34
+ },
35
+ "value": "timeseries"
36
+ },
37
+ {
38
+ "id": "requested",
39
+ "label": {
40
+ "text": "User requested data (17)"
41
+ },
42
+ "value": "requested"
43
+ }
44
+ ]
45
+ }
46
+ },
47
+ {
48
+ "id": "publications",
49
+ "label": {
50
+ "text": "Publications (137)"
51
+ },
52
+ "value": "publications",
53
+ "other": {
54
+ "otherType": "checkboxes",
55
+ "selectAllChildren": true,
56
+ "legend": "Publication type",
57
+ "legendClasses": "ons-u-vh",
58
+ "name": "name",
59
+ "checkboxes": [
60
+ {
61
+ "id": "press-release",
62
+ "label": {
63
+ "text": "Press release (100)"
64
+ },
65
+ "value": "pressrelease"
66
+ },
67
+ {
68
+ "id": "bulletin",
69
+ "label": {
70
+ "text": "Bulletin (20)"
71
+ },
72
+ "value": "bulletin"
73
+ }
74
+ ]
75
+ }
76
+ },
77
+ {
78
+ "id": "areas",
79
+ "label": {
80
+ "text": "Areas (0)"
81
+ },
82
+ "value": "areas"
83
+ }
84
+ ]
85
+ })
86
+ }}
@@ -0,0 +1,69 @@
1
+ {% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
2
+
3
+ {{
4
+ onsCheckboxes({
5
+ "checkboxesLabel": "Select all that apply",
6
+ "legend": "How would you like us to contact you?",
7
+ "name": "contact",
8
+ "borderless": true,
9
+ "checkboxes": [
10
+ {
11
+ "id": "post",
12
+ "label": {
13
+ "text": "By post"
14
+ },
15
+ "value": "post"
16
+ },
17
+ {
18
+ "id": "email",
19
+ "label": {
20
+ "text": "By email"
21
+ },
22
+ "value": "email"
23
+ },
24
+ {
25
+ "id": "phone",
26
+ "label": {
27
+ "text": "By phone"
28
+ },
29
+ "value": "phone",
30
+ "other": {
31
+ "otherType": "radios",
32
+ "id": "phone-time",
33
+ "name": "phone-time",
34
+ "legend": "Choose preferred time of day",
35
+ "radios": [
36
+ {
37
+ "value": "anytime",
38
+ "id": "anytime",
39
+ "label": {
40
+ "text": "Any time 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,71 @@
1
+ {% from "components/question/_macro.njk" import onsQuestion %}
2
+ {% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
3
+
4
+ {% call onsQuestion({
5
+ "title": "How would you like us to contact you?",
6
+ "legendIsQuestionTitle": true,
7
+ "classes": "ons-u-mt-no"
8
+ }) %}
9
+ {{
10
+ onsCheckboxes({
11
+ "checkboxesLabel": "Select all that apply",
12
+ "dontWrap": true,
13
+ "name": "contact",
14
+ "checkboxes": [
15
+ {
16
+ "id": "post",
17
+ "label": {
18
+ "text": "By post"
19
+ },
20
+ "value": "post"
21
+ },
22
+ {
23
+ "id": "email",
24
+ "label": {
25
+ "text": "By email"
26
+ },
27
+ "value": "email"
28
+ },
29
+ {
30
+ "id": "phone",
31
+ "label": {
32
+ "text": "By phone"
33
+ },
34
+ "value": "phone",
35
+ "other": {
36
+ "otherType": "select",
37
+ "id": "phone-time",
38
+ "name": "phone-time",
39
+ "label": {
40
+ "text": "Choose preferred time of day"
41
+ },
42
+ "options": [
43
+ {
44
+ "value": "",
45
+ "text": "Select an option",
46
+ "disabled": true,
47
+ "selected": true
48
+ },
49
+ {
50
+ "value": "anytime",
51
+ "text": "Anytime of day"
52
+ },
53
+ {
54
+ "value": "morning",
55
+ "text": "Morning"
56
+ },
57
+ {
58
+ "value": "afternoon",
59
+ "text": "Afternoon"
60
+ },
61
+ {
62
+ "value": "evening",
63
+ "text": "Evening"
64
+ }
65
+ ]
66
+ }
67
+ }
68
+ ]
69
+ })
70
+ }}
71
+ {% endcall %}
@@ -0,0 +1,59 @@
1
+ {% from "components/question/_macro.njk" import onsQuestion %}
2
+ {% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
3
+
4
+ {% call onsQuestion({
5
+ "title": "Do you have any dietary requirements?",
6
+ "legendIsQuestionTitle": true,
7
+ "classes": "ons-u-mt-no"
8
+ }) %}
9
+ {{
10
+ onsCheckboxes({
11
+ "checkboxesLabel": "Select all that apply",
12
+ "dontWrap": true,
13
+ "checkboxes": [
14
+ {
15
+ "id": "gluten-free",
16
+ "label": {
17
+ "text": "Gluten free"
18
+ },
19
+ "value": "gluten-free"
20
+ },
21
+ {
22
+ "id": "lactose-intolerant",
23
+ "label": {
24
+ "text": "Lactose intolerant"
25
+ },
26
+ "value": "lactose-intolerant"
27
+ },
28
+ {
29
+ "id": "vegan",
30
+ "label": {
31
+ "text": "Vegan"
32
+ },
33
+ "value": "vegan"
34
+ },
35
+ {
36
+ "id": "vegetarian",
37
+ "label": {
38
+ "text": "Vegetarian"
39
+ },
40
+ "value": "vegetarian"
41
+ },
42
+ {
43
+ "id": "other-checkbox",
44
+ "label": {
45
+ "text": "Other"
46
+ },
47
+ "value": "other",
48
+ "other": {
49
+ "id": "other-textbox",
50
+ "name": "other-answer",
51
+ "label": {
52
+ "text": "Enter dietary requirements"
53
+ }
54
+ }
55
+ }
56
+ ]
57
+ })
58
+ }}
59
+ {% endcall %}
@@ -0,0 +1,51 @@
1
+ {% from "components/question/_macro.njk" import onsQuestion %}
2
+ {% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
3
+
4
+ {% call onsQuestion({
5
+ "title": "What devices do you own?",
6
+ "legendIsQuestionTitle": true,
7
+ "classes": "ons-u-mt-no"
8
+ }) %}
9
+ {{
10
+ onsCheckboxes({
11
+ "checkboxesLabel": "Select all that apply",
12
+ "dontWrap": true,
13
+ "name": "devices",
14
+ "autoSelect": {
15
+ "selectAllText": "Select all",
16
+ "unselectAllText": "Unselect all",
17
+ "context": "following checkboxes"
18
+ },
19
+ "checkboxes": [
20
+ {
21
+ "id": "mobile-phone",
22
+ "label": {
23
+ "text": "Mobile phone"
24
+ },
25
+ "value": "mobile-phone"
26
+ },
27
+ {
28
+ "id": "tablet",
29
+ "label": {
30
+ "text": "Tablet"
31
+ },
32
+ "value": "tablet"
33
+ },
34
+ {
35
+ "id": "laptop",
36
+ "label": {
37
+ "text": "Laptop"
38
+ },
39
+ "value": "laptop"
40
+ },
41
+ {
42
+ "id": "desktop",
43
+ "label": {
44
+ "text": "Desktop computer"
45
+ },
46
+ "value": "desktop"
47
+ }
48
+ ]
49
+ })
50
+ }}
51
+ {% endcall %}
@@ -0,0 +1,61 @@
1
+ {% from "components/question/_macro.njk" import onsQuestion %}
2
+ {% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
3
+
4
+ {% call onsQuestion({
5
+ "title": "Do you have any dietary requirements?",
6
+ "legendIsQuestionTitle": true,
7
+ "classes": "ons-u-mt-no"
8
+ }) %}
9
+ {{
10
+ onsCheckboxes({
11
+ "checkboxesLabel": "Select all that apply",
12
+ "dontWrap": true,
13
+ "name": "dietary",
14
+ "checkboxes": [
15
+ {
16
+ "id": "gluten-free",
17
+ "label": {
18
+ "text": "Gluten free"
19
+ },
20
+ "value": "gluten-free"
21
+ },
22
+ {
23
+ "id": "lactose-intolerant",
24
+ "label": {
25
+ "text": "Lactose intolerant"
26
+ },
27
+ "value": "lactose-intolerant"
28
+ },
29
+ {
30
+ "id": "vegan",
31
+ "label": {
32
+ "text": "Vegan"
33
+ },
34
+ "value": "vegan"
35
+ },
36
+ {
37
+ "id": "vegetarian",
38
+ "label": {
39
+ "text": "Vegetarian"
40
+ },
41
+ "value": "vegetarian"
42
+ },
43
+ {
44
+ "id": "other-checkbox",
45
+ "label": {
46
+ "text": "Other"
47
+ },
48
+ "value": "other",
49
+ "other": {
50
+ "open": true,
51
+ "id": "other-textbox",
52
+ "name": "other-answer",
53
+ "label": {
54
+ "text": "Enter dietary requirements"
55
+ }
56
+ }
57
+ }
58
+ ]
59
+ })
60
+ }}
61
+ {% endcall %}
@@ -0,0 +1,33 @@
1
+ {% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
2
+
3
+ {{
4
+ onsCheckboxes({
5
+ "checkboxesLabel": "All types",
6
+ "legend": "Select type",
7
+ "name": "types",
8
+ "borderless": true,
9
+ "checkboxes": [
10
+ {
11
+ "id": "booklet",
12
+ "label": {
13
+ "text": "Booklet"
14
+ },
15
+ "value": "booklet"
16
+ },
17
+ {
18
+ "id": "logo",
19
+ "label": {
20
+ "text": "Logo"
21
+ },
22
+ "value": "logo"
23
+ },
24
+ {
25
+ "id": "poster",
26
+ "label": {
27
+ "text": "Poster"
28
+ },
29
+ "value": "poster"
30
+ }
31
+ ]
32
+ })
33
+ }}
@@ -0,0 +1,46 @@
1
+ {% from "components/question/_macro.njk" import onsQuestion %}
2
+ {% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
3
+
4
+ {% call onsQuestion({
5
+ "title": "What devices do you own?",
6
+ "legendIsQuestionTitle": true,
7
+ "classes": "ons-u-mt-no"
8
+ }) %}
9
+ {{
10
+ onsCheckboxes({
11
+ "checkboxesLabel": "Select all that apply",
12
+ "dontWrap": true,
13
+ "name": "devices",
14
+ "checkboxes": [
15
+ {
16
+ "id": "mobile-phone",
17
+ "label": {
18
+ "text": "Mobile phone"
19
+ },
20
+ "value": "mobile-phone"
21
+ },
22
+ {
23
+ "id": "tablet",
24
+ "label": {
25
+ "text": "Tablet"
26
+ },
27
+ "value": "tablet"
28
+ },
29
+ {
30
+ "id": "laptop",
31
+ "label": {
32
+ "text": "Laptop"
33
+ },
34
+ "value": "laptop"
35
+ },
36
+ {
37
+ "id": "desktop",
38
+ "label": {
39
+ "text": "Desktop computer"
40
+ },
41
+ "value": "desktop"
42
+ }
43
+ ]
44
+ })
45
+ }}
46
+ {% endcall %}
@@ -0,0 +1,20 @@
1
+ {% from "components/content-pagination/_macro.njk" import onsContentPagination %}
2
+
3
+ {{-
4
+ onsContentPagination({
5
+ "contentPaginationItems": [
6
+ {
7
+ "rel": 'prev',
8
+ "text": 'Previous',
9
+ "url": '#0',
10
+ "label": 'Overview'
11
+ },
12
+ {
13
+ "rel": 'next',
14
+ "text": 'Next',
15
+ "url": '#0',
16
+ "label": 'Who should take part and why'
17
+ }
18
+ ]
19
+ })
20
+ }}
@@ -4,7 +4,7 @@
4
4
  {% set serviceName = 'ons.gov.uk' %}
5
5
  {% set statementTitle = 'Cwcis ar' %}
6
6
  {% set settingsLinkText = 'Gweld cwcis' %}
7
- {% set settingsLinkURL = '/cwics' %}
7
+ {% set settingsLinkURL = params.settingsLinkTextURL | default('/cwics') %}
8
8
  {% set statementText = '<p>Ffeiliau bach a gaiff eu storio ar eich dyfais pan fyddwch yn mynd ar wefan yw cwcis. Rydym ni’n defnyddio rhai cwcis hanfodol i wneud i’r wefan hon weithio.</p><p>Hoffem osod <a href="' + settingsLinkURL + '">cwcis ychwanegol</a> er mwyn cofio eich gosodiadau a deall sut rydych chi’n defnyddio’r wefan. Mae hyn yn ein helpu ni i wella ein gwasanaethau.</p>' %}
9
9
  {% set acceptButtonText = 'Derbyn cwcis ychwanegol' %}
10
10
  {% set rejectButtonText = 'Gwrthod cwcis ychwanegol' %}
@@ -18,7 +18,7 @@
18
18
  {% set serviceName = 'ons.gov.uk' %}
19
19
  {% set statementTitle = 'Cookies on' %}
20
20
  {% set settingsLinkText = 'View cookies' %}
21
- {% set settingsLinkURL = '/cookies' %}
21
+ {% set settingsLinkURL = params.settingsLinkTextURL | default('/cookies') %}
22
22
  {% set statementText = '<p>Cookies are small files stored on your device when you visit a website. We use some essential cookies to make this website work.</p><p>We would like to set <a href="' + settingsLinkURL + '">additional cookies</a> to remember your settings and understand how you use the site. This helps us to improve our services. </p>' %}
23
23
  {% set acceptButtonText = 'Accept additional cookies' %}
24
24
  {% set rejectButtonText = 'Reject additional cookies' %}
@@ -30,7 +30,7 @@
30
30
  {% endif %}
31
31
 
32
32
  <div class="ons-cookies-banner" role="region" aria-label="{{ params.ariaLabel | default(ariaLabel)}}">
33
- <div class="ons-container ons-cookies-banner__primary">
33
+ <div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }} ons-cookies-banner__primary">
34
34
  <div class="ons-grid">
35
35
  <div class="ons-grid__col ons-col-8@m">
36
36
  <h2 class="ons-cookies-banner__title ons-u-mb-xs">{{ params.statementTitle | default(statementTitle) }} {{ params.serviceName | default(serviceName) }}</h2>
@@ -68,7 +68,7 @@
68
68
  </div>
69
69
  </div>
70
70
  </div>
71
- <div class="ons-container ons-cookies-banner__confirmation ons-u-d-no">
71
+ <div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }} ons-cookies-banner__confirmation ons-u-d-no">
72
72
  <div class="ons-grid ons-grid--flex ons-grid--between ons-grid--gutterless ons-grid--no-wrap@s ons-grid--vertical-center">
73
73
  <div class="ons-grid__col ons-grid__col--flex ons-col-auto ons-u-flex-shrink@s">
74
74
  <p class="ons-cookies-banner__desc ons-u-mb-no@s ons-u-mr-s@s"><span class="ons-js-accepted-text ons-u-d-no">{{ params.acceptedText | default(acceptedText) | safe }} </span><span class="ons-js-rejected-text ons-u-d-no">{{ params.rejectedText | default(rejectedText) | safe }} </span><span class="ons-cookies-banner__preferences-text">{{ params.preferencesText | default(preferencesText) | safe }}</span></p>
@@ -10,7 +10,7 @@ const EXAMPLE_COOKIES_BANNER_PARAMS = {
10
10
  serviceName: 'ons.gov.uk override',
11
11
  statementTitle: 'Cookies on override',
12
12
  settingsLinkText: 'Cookie settings override',
13
- settingsLinkURL: '/cookiesoverride',
13
+ settingsLinkTextURL: '/cookiesoverride',
14
14
  statementText: 'Statement override',
15
15
  acceptButtonText: 'Accept additional cookies override',
16
16
  rejectButtonText: 'Reject additional cookies override',
@@ -184,6 +184,26 @@ describe('macro: cookies-banner', () => {
184
184
  const linkText = $('.ons-cookies-banner__link').attr('href');
185
185
  expect(linkText).toBe('/cookies');
186
186
  });
187
+
188
+ it('has `container--wide` class when `wide` is true', () => {
189
+ const $ = cheerio.load(
190
+ renderComponent('cookies-banner', {
191
+ wide: true,
192
+ }),
193
+ );
194
+
195
+ expect($('.ons-container.ons-cookies-banner__primary').hasClass('ons-container--wide')).toBe(true);
196
+ });
197
+
198
+ it('has `container--full-width` class when `fullWidth` is true', () => {
199
+ const $ = cheerio.load(
200
+ renderComponent('cookies-banner', {
201
+ fullWidth: true,
202
+ }),
203
+ );
204
+
205
+ expect($('.ons-container.ons-cookies-banner__primary').hasClass('ons-container--full-width')).toBe(true);
206
+ });
187
207
  });
188
208
 
189
209
  describe('confirmation banner', () => {
@@ -213,6 +233,26 @@ describe('macro: cookies-banner', () => {
213
233
 
214
234
  expect(buttonSpy.occurrences[2].buttonContext).toBe('this message');
215
235
  });
236
+
237
+ it('has `container--wide` class when `wide` is true', () => {
238
+ const $ = cheerio.load(
239
+ renderComponent('cookies-banner', {
240
+ wide: true,
241
+ }),
242
+ );
243
+
244
+ expect($('.ons-container.ons-cookies-banner__confirmation').hasClass('ons-container--wide')).toBe(true);
245
+ });
246
+
247
+ it('has `container--full-width` class when `fullWidth` is true', () => {
248
+ const $ = cheerio.load(
249
+ renderComponent('cookies-banner', {
250
+ fullWidth: true,
251
+ }),
252
+ );
253
+
254
+ expect($('.ons-container.ons-cookies-banner__confirmation').hasClass('ons-container--full-width')).toBe(true);
255
+ });
216
256
  });
217
257
  });
218
258
 
@@ -0,0 +1,9 @@
1
+ ---
2
+ "fullWidth": true
3
+ ---
4
+ {% from "components/cookies-banner/_macro.njk" import onsCookiesBanner %}
5
+ {{
6
+ onsCookiesBanner({
7
+ 'lang': 'cy'
8
+ })
9
+ }}
@@ -0,0 +1,7 @@
1
+ ---
2
+ "fullWidth": true
3
+ ---
4
+ {% from "components/cookies-banner/_macro.njk" import onsCookiesBanner %}
5
+ {{
6
+ onsCookiesBanner()
7
+ }}