@ons/design-system 70.0.8 → 70.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/components/access-code/_macro.njk +31 -25
  2. package/components/access-code/example-access-code-error.njk +49 -37
  3. package/components/access-code/example-access-code.njk +40 -30
  4. package/components/accordion/_macro.njk +7 -6
  5. package/components/accordion/example-accordion-open.njk +0 -1
  6. package/components/address-input/_macro.njk +23 -11
  7. package/components/address-input/autosuggest.address.js +0 -5
  8. package/components/address-input/example-address-input-editable.njk +52 -50
  9. package/components/address-input/example-address-input-manual.njk +23 -21
  10. package/components/address-input/example-address-input.njk +40 -38
  11. package/components/address-output/_macro.njk +6 -6
  12. package/components/autosuggest/_macro.njk +57 -37
  13. package/components/autosuggest/example-autosuggest-country-multiple.njk +26 -26
  14. package/components/autosuggest/example-autosuggest-country.njk +24 -24
  15. package/components/back-to-top/example-back-to-top.njk +183 -6
  16. package/components/back-to-top/example-full-page-back-to-top.njk +135 -123
  17. package/components/breadcrumbs/_macro.njk +12 -4
  18. package/components/browser-banner/_macro.njk +6 -3
  19. package/components/button/_button.scss +36 -1
  20. package/components/button/_macro.njk +63 -62
  21. package/components/button/example-button-ghost.njk +1 -0
  22. package/components/call-to-action/_macro.njk +7 -5
  23. package/components/call-to-action/example-call-to-action-default.njk +3 -2
  24. package/components/card/_macro.njk +26 -10
  25. package/components/card/example-card-set-with-images.njk +31 -29
  26. package/components/card/example-card-set-with-lists.njk +58 -56
  27. package/components/card/example-card-set.njk +28 -26
  28. package/components/card/example-card.njk +9 -7
  29. package/components/char-check-limit/_macro.njk +1 -3
  30. package/components/checkboxes/_checkbox-macro.njk +19 -15
  31. package/components/checkboxes/_macro.njk +81 -72
  32. package/components/checkboxes/example-checkboxes-disabled.njk +30 -30
  33. package/components/checkboxes/example-checkboxes-error.njk +0 -1
  34. package/components/checkboxes/example-checkboxes-with-descriptions.njk +7 -5
  35. package/components/checkboxes/example-checkboxes-with-hidden-label.njk +162 -170
  36. package/components/checkboxes/example-checkboxes-with-revealed-checkboxes-expanded.njk +81 -81
  37. package/components/checkboxes/example-checkboxes-with-revealed-checkboxes.njk +79 -79
  38. package/components/checkboxes/example-checkboxes-with-revealed-select-expanded.njk +7 -5
  39. package/components/checkboxes/example-checkboxes-with-revealed-select.njk +7 -5
  40. package/components/checkboxes/example-checkboxes-with-revealed-text-input-expanded.njk +7 -5
  41. package/components/checkboxes/example-checkboxes-with-revealed-text-input.njk +7 -5
  42. package/components/checkboxes/example-checkboxes-with-select-all-button.njk +7 -5
  43. package/components/checkboxes/example-checkboxes-with-visible-text-input.njk +7 -5
  44. package/components/checkboxes/example-checkboxes.njk +7 -5
  45. package/components/content-pagination/_macro.njk +34 -32
  46. package/components/content-pagination/example-content-pagination.njk +17 -17
  47. package/components/cookies-banner/_macro.njk +19 -6
  48. package/components/cookies-banner/example-cookies-banner-cymraeg.njk +2 -1
  49. package/components/cookies-banner/example-cookies-banner.njk +3 -4
  50. package/components/date-input/_macro.njk +71 -63
  51. package/components/date-input/example-date-input-error-for-single-field.njk +0 -1
  52. package/components/date-input/example-date-input-error.njk +0 -1
  53. package/components/description-list/_macro.njk +20 -11
  54. package/components/details/_macro.njk +18 -11
  55. package/components/details/example-details-with-warning.njk +15 -10
  56. package/components/document-list/_macro.njk +102 -93
  57. package/components/document-list/example-document-list-article-featured.njk +27 -25
  58. package/components/document-list/example-document-list-articles.njk +55 -53
  59. package/components/document-list/example-document-list-downloads.njk +49 -47
  60. package/components/document-list/example-document-list-search-result-featured.njk +19 -17
  61. package/components/document-list/example-document-list-search-results.njk +60 -58
  62. package/components/duration/_macro.njk +61 -55
  63. package/components/duration/example-duration-error-for-single-field.njk +28 -26
  64. package/components/duration/example-duration-single-field.njk +23 -19
  65. package/components/duration/example-duration.njk +33 -29
  66. package/components/error/_macro.njk +8 -6
  67. package/components/external-link/_macro.njk +7 -5
  68. package/components/external-link/example-external-link.njk +9 -6
  69. package/components/feedback/_macro.njk +7 -5
  70. package/components/field/_macro.njk +2 -2
  71. package/components/fieldset/_macro.njk +23 -16
  72. package/components/footer/_macro.njk +28 -21
  73. package/components/footer/_macro.spec.js +1 -1
  74. package/components/footer/example-footer-cymraeg.njk +2 -1
  75. package/components/footer/example-footer-default.njk +3 -4
  76. package/components/footer/example-footer-transactional.njk +2 -1
  77. package/components/footer/example-footer-warning.njk +2 -1
  78. package/components/footer/example-footer-with-alternative-organisation.njk +2 -1
  79. package/components/footer/example-footer-with-coat-of-arms.njk +2 -1
  80. package/components/footer/example-footer-with-copyright.njk +2 -1
  81. package/components/footer/example-footer.njk +2 -1
  82. package/components/header/_header.scss +24 -19
  83. package/components/header/_macro.njk +183 -141
  84. package/components/header/example-header-default.njk +2 -1
  85. package/components/header/example-header-external-for-survey-with-description.njk +2 -1
  86. package/components/header/example-header-external-for-surveys.njk +2 -1
  87. package/components/header/example-header-external-welsh.njk +7 -7
  88. package/components/header/example-header-external-with-navigation-and-search.njk +3 -2
  89. package/components/header/example-header-external-with-navigation.njk +2 -1
  90. package/components/header/example-header-external-with-service-links.njk +2 -1
  91. package/components/header/example-header-external-with-sub-navigation-removed.njk +2 -1
  92. package/components/header/example-header-external-with-sub-navigation.njk +3 -2
  93. package/components/header/example-header-internal.njk +2 -1
  94. package/components/header/example-header-multiple-logos.njk +2 -1
  95. package/components/header/{example-header-neutral-for-multicoloured-logo.njk → example-header-neutral.njk} +2 -1
  96. package/components/helpers/grid.njk +17 -16
  97. package/components/hero/_macro.njk +6 -11
  98. package/components/hero/example-hero-dark.njk +2 -1
  99. package/components/hero/example-hero-default.njk +2 -1
  100. package/components/icon/_macro.njk +601 -168
  101. package/components/image/_macro.njk +7 -5
  102. package/components/input/_macro.njk +114 -95
  103. package/components/input/example-input-search-with-character-check.njk +1 -1
  104. package/components/input/example-input-search-with-placeholder.njk +1 -1
  105. package/components/input/example-input-search.njk +1 -1
  106. package/components/label/_macro.njk +32 -26
  107. package/components/language-selector/_macro.njk +11 -2
  108. package/components/list/_list.scss +13 -0
  109. package/components/list/_macro.njk +93 -73
  110. package/components/message/_macro.njk +20 -7
  111. package/components/message-list/_macro.njk +26 -20
  112. package/components/modal/_macro.njk +11 -12
  113. package/components/multiple-input-fields/_macro.njk +30 -28
  114. package/components/mutually-exclusive/_macro.njk +20 -13
  115. package/components/mutually-exclusive/example-mutually-exclusive-checkboxes.njk +6 -4
  116. package/components/mutually-exclusive/example-mutually-exclusive-date.njk +7 -5
  117. package/components/mutually-exclusive/example-mutually-exclusive-duration.njk +44 -40
  118. package/components/mutually-exclusive/example-mutually-exclusive-email.njk +7 -5
  119. package/components/mutually-exclusive/example-mutually-exclusive-multiple-options.njk +6 -4
  120. package/components/mutually-exclusive/example-mutually-exclusive-number.njk +6 -4
  121. package/components/mutually-exclusive/example-mutually-exclusive-textarea.njk +6 -4
  122. package/components/navigation/_macro.njk +133 -67
  123. package/components/navigation/_navigation.scss +0 -9
  124. package/components/pagination/_macro.njk +42 -20
  125. package/components/panel/_macro.njk +27 -16
  126. package/components/panel/example-panel-bare.njk +6 -4
  127. package/components/panel/example-panel-with-announcement.njk +7 -4
  128. package/components/panel/example-panel-with-error-summary.njk +6 -4
  129. package/components/panel/example-panel-with-warning.njk +5 -3
  130. package/components/password/_macro.njk +7 -5
  131. package/components/phase-banner/_macro.njk +3 -3
  132. package/components/phase-banner/example-phase-banner-alpha.njk +2 -1
  133. package/components/phase-banner/example-phase-banner-beta.njk +4 -3
  134. package/components/question/_macro.njk +62 -47
  135. package/components/question/example-question-ccs.njk +40 -35
  136. package/components/question/example-question-fieldset.njk +84 -80
  137. package/components/question/example-question-interviewer-note.njk +27 -24
  138. package/components/question/example-question-no-fieldset.njk +39 -33
  139. package/components/quote/_macro.njk +3 -1
  140. package/components/radios/_macro.njk +54 -36
  141. package/components/radios/_macro.spec.js +21 -0
  142. package/components/radios/example-radios-with-clear-button-expanded.njk +6 -4
  143. package/components/radios/example-radios-with-clear-button.njk +6 -4
  144. package/components/radios/example-radios-with-descriptions.njk +7 -5
  145. package/components/radios/example-radios-with-revealed-select-expanded.njk +6 -4
  146. package/components/radios/example-radios-with-revealed-select.njk +6 -4
  147. package/components/radios/example-radios-with-revealed-text-area-expanded.njk +7 -5
  148. package/components/radios/example-radios-with-revealed-text-area.njk +7 -5
  149. package/components/radios/example-radios-with-revealed-text-input-expanded.njk +7 -5
  150. package/components/radios/example-radios-with-revealed-text-input.njk +7 -5
  151. package/components/radios/example-radios-with-separator.njk +6 -4
  152. package/components/radios/example-radios-with-visible-text-input.njk +7 -5
  153. package/components/radios/example-radios-without-border.njk +0 -1
  154. package/components/radios/example-radios.njk +7 -5
  155. package/components/related-content/_macro.njk +10 -11
  156. package/components/related-content/_section-macro.njk +7 -7
  157. package/components/related-content/example-related-content-general.njk +5 -3
  158. package/components/related-content/example-related-content-multiple-rows-of-links.njk +51 -49
  159. package/components/related-content/example-related-content-social-media.njk +40 -38
  160. package/components/relationships/_macro.njk +10 -8
  161. package/components/relationships/example-relationships-error.njk +176 -168
  162. package/components/relationships/example-relationships-you.njk +169 -163
  163. package/components/relationships/example-relationships.njk +167 -161
  164. package/components/section-navigation/_macro.njk +34 -12
  165. package/components/select/_macro.njk +21 -18
  166. package/components/share-page/_macro.njk +10 -5
  167. package/components/skip-to-content/_macro.njk +1 -1
  168. package/components/skip-to-content/example-skip-to-content.njk +1 -0
  169. package/components/status/_macro.njk +1 -1
  170. package/components/summary/_macro.njk +53 -23
  171. package/components/summary/example-summary-household-no-rows.njk +18 -16
  172. package/components/summary/example-summary-household.njk +75 -73
  173. package/components/summary/example-summary-hub-minimal.njk +74 -72
  174. package/components/summary/example-summary-hub.njk +169 -167
  175. package/components/table/_macro.njk +72 -45
  176. package/components/table-of-contents/_macro.njk +34 -32
  177. package/components/table-of-contents/example-table-of-contents-grouped.njk +1 -1
  178. package/components/table-of-contents/example-table-of-contents-single.njk +1 -1
  179. package/components/table-of-contents/example-table-of-contents-sticky-full-page.njk +79 -38
  180. package/components/table-of-contents/example-table-of-contents-sticky.njk +50 -13
  181. package/components/tabs/_macro.njk +12 -6
  182. package/components/tabs/example-tabs-details.njk +5 -6
  183. package/components/text-indent/_macro.njk +1 -3
  184. package/components/textarea/_macro.njk +49 -46
  185. package/components/textarea/_macro.spec.js +0 -11
  186. package/components/timeline/_macro.njk +4 -6
  187. package/components/timeout-modal/_macro.njk +21 -19
  188. package/components/timeout-modal/example-timeout-modal.njk +16 -14
  189. package/components/timeout-panel/_macro.njk +19 -17
  190. package/components/timeout-panel/example-panel-with-timeout-warning.njk +13 -11
  191. package/components/upload/_macro.njk +20 -16
  192. package/components/video/_macro.njk +16 -2
  193. package/components/video/example-video.njk +2 -2
  194. package/css/main.css +1 -1
  195. package/layout/_dsTemplate.njk +22 -20
  196. package/layout/_template.njk +63 -49
  197. package/package.json +4 -3
  198. package/scripts/main.es5.js +1 -1
  199. package/scripts/main.js +1 -1
  200. package/scss/overrides/hcm.scss +1 -1
  201. package/scss/vars/_colors.scss +1 -1
@@ -7,29 +7,33 @@
7
7
  {% set maxlength = params.maxlength | default(16) + extraSpaces %}
8
8
 
9
9
  {% set content %}
10
- {{ onsInput({
11
- "id": params.id,
12
- "type": params.type,
13
- "name": params.name,
14
- "classes": "ons-access-code__input ons-js-access-code" + (" ons-u-mb-xs" if params.postTextboxLinkText else ""),
15
- "label": params.label,
16
- "attributes": {
17
- "maxlength": maxlength,
18
- "data-group-size": groupSize,
19
- "autocomplete": "off",
20
- "autocapitalize": "characters"
21
- },
22
- "fieldClasses": "ons-question__answer",
23
- "error": params.error,
24
- "postTextboxLinkText": params.postTextboxLinkText,
25
- "postTextboxLinkUrl": params.postTextboxLinkUrl
26
- }) }}
10
+ {{
11
+ onsInput({
12
+ "id": params.id,
13
+ "type": params.type,
14
+ "name": params.name,
15
+ "classes": "ons-access-code__input ons-js-access-code" + (" ons-u-mb-xs" if params.postTextboxLinkText else ""),
16
+ "label": params.label,
17
+ "attributes": {
18
+ "maxlength": maxlength,
19
+ "data-group-size": groupSize,
20
+ "autocomplete": "off",
21
+ "autocapitalize": "characters"
22
+ },
23
+ "fieldClasses": "ons-question__answer",
24
+ "error": params.error,
25
+ "postTextboxLinkText": params.postTextboxLinkText,
26
+ "postTextboxLinkUrl": params.postTextboxLinkUrl
27
+ })
28
+ }}
27
29
  {% endset %}
28
30
 
29
31
  {% if not params.error %}
30
- {% call onsPanel({
31
- "classes": "ons-u-mb-s" + (' ' + params.classes if params.classes else '')
32
- }) %}
32
+ {%
33
+ call onsPanel({
34
+ "classes": "ons-u-mb-s" + (" " + params.classes if params.classes else "")
35
+ })
36
+ %}
33
37
  {{ content | safe }}
34
38
  {% endcall %}
35
39
  {% else %}
@@ -37,11 +41,13 @@
37
41
  {% endif %}
38
42
 
39
43
  {% if params.securityMessage %}
40
- {% call onsPanel({
41
- "variant": "bare",
42
- "iconType": "lock",
43
- "classes": "ons-u-mb-s"
44
- }) %}
44
+ {%
45
+ call onsPanel({
46
+ "variant": "bare",
47
+ "iconType": "lock",
48
+ "classes": "ons-u-mb-s"
49
+ })
50
+ %}
45
51
  {{ params.securityMessage }}
46
52
  {% endcall %}
47
53
  {% endif %}
@@ -1,22 +1,26 @@
1
1
  ---
2
- title: "Example: Access code error"
2
+ title: 'Example: Access code error'
3
3
  layout: ~
4
4
  ---
5
+
5
6
  {% extends "layout/_template.njk" %}
6
7
  {% from "components/access-code/_macro.njk" import onsAccessCode %}
7
8
  {% from "components/button/_macro.njk" import onsButton %}
8
9
  {% from "components/panel/_macro.njk" import onsPanel %}
9
10
  {% from "components/details/_macro.njk" import onsDetails %}
10
-
11
- {% set pageConfig = {
12
- "title": "Study title"
13
- } %}
11
+ {%
12
+ set pageConfig = {
13
+ "title": "Study title"
14
+ }
15
+ %}
14
16
 
15
17
  {% block main %}
16
- {% call onsPanel({
17
- "title": "There is a problem with this page",
18
- "variant": "error"
19
- }) %}
18
+ {%
19
+ call onsPanel({
20
+ "title": "There is a problem with this page",
21
+ "variant": "error"
22
+ })
23
+ %}
20
24
  {% from "components/list/_macro.njk" import onsList %}
21
25
  {{
22
26
  onsList({
@@ -34,46 +38,54 @@ layout: ~
34
38
 
35
39
  <h1 class="ons-u-mt-l">Start study</h1>
36
40
 
37
- {{ onsAccessCode({
38
- "id": "access-code",
39
- "name": "access-code",
40
- "postTextboxLinkText": "Where to find your access code",
41
- "postTextboxLinkUrl": "#0",
42
- "label": {
43
- "text": "Enter your 16-character access code",
44
- "description": "Keep this code safe. You will need to enter it every time you access your survey"
45
- },
46
- "securityMessage": "Your personal information is protected by law and will be kept confidential",
47
- "error": {
48
- "id": "access-code-error",
49
- "text": "Enter an access code"
50
- }
51
- }) }}
41
+ {{
42
+ onsAccessCode({
43
+ "id": "access-code",
44
+ "name": "access-code",
45
+ "postTextboxLinkText": "Where to find your access code",
46
+ "postTextboxLinkUrl": "#0",
47
+ "label": {
48
+ "text": "Enter your 16-character access code",
49
+ "description": "Keep this code safe. You will need to enter it every time you access your survey"
50
+ },
51
+ "securityMessage": "Your personal information is protected by law and will be kept confidential",
52
+ "error": {
53
+ "id": "access-code-error",
54
+ "text": "Enter an access code"
55
+ }
56
+ })
57
+ }}
52
58
 
53
- {{ onsButton({
54
- "text": "Access study",
55
- "classes": "ons-u-mb-xl"
56
- }) }}
59
+ {{
60
+ onsButton({
61
+ "text": "Access study",
62
+ "classes": "ons-u-mb-xl"
63
+ })
64
+ }}
57
65
 
58
66
  <h2>If you do not have an access code</h2>
59
67
  <p>
60
- If you have lost or not received an access code, you can <a href="#0">request a new access code</a>.
61
- This can be sent to you by text or post.
68
+ If you have lost or not received an access code, you can <a href="#0">request a new access code</a>. This can be sent to you by text
69
+ or post.
62
70
  </p>
63
71
 
64
72
  {% set content %}
65
73
  <p>If you need to answer separately from the people you live with, you can <a href="#0">request an individual access code</a>.</p>
66
- {% call onsPanel({
67
- "variant": "warn"
68
- }) %}
74
+ {%
75
+ call onsPanel({
76
+ "variant": "warn"
77
+ })
78
+ %}
69
79
  Someone in your household must still complete a study using this household access code
70
80
  {% endcall %}
71
81
  {% endset %}
72
82
 
73
- {% call onsDetails({
74
- "id": "details-access-code-error",
75
- "title": "Need to answer separately from your household?"
76
- }) %}
83
+ {%
84
+ call onsDetails({
85
+ "id": "details-access-code-error",
86
+ "title": "Need to answer separately from your household?"
87
+ })
88
+ %}
77
89
  {{ content | safe }}
78
90
  {% endcall %}
79
91
  {% endblock %}
@@ -1,58 +1,68 @@
1
1
  ---
2
- title: "Example: Access code"
2
+ title: 'Example: Access code'
3
3
  layout: ~
4
4
  ---
5
+
5
6
  {% extends "layout/_template.njk" %}
6
7
  {% from "components/access-code/_macro.njk" import onsAccessCode %}
7
8
  {% from "components/button/_macro.njk" import onsButton %}
8
9
  {% from "components/panel/_macro.njk" import onsPanel %}
9
10
  {% from "components/details/_macro.njk" import onsDetails %}
10
-
11
- {% set pageConfig = {
12
- "header": {
13
- "title": "Study title"
11
+ {%
12
+ set pageConfig = {
13
+ "header": {
14
+ "title": "Study title"
15
+ }
14
16
  }
15
- } %}
17
+ %}
16
18
 
17
19
  {% block main %}
18
20
  <h1 class="ons-u-mt-l">Start study</h1>
19
21
 
20
- {{ onsAccessCode({
21
- "id": "access-code-example",
22
- "name": "access-code",
23
- "postTextboxLinkText": "Where to find your access code",
24
- "postTextboxLinkUrl": "#0",
25
- "label": {
26
- "text": "Enter your 16-character access code",
27
- "description": "Keep this code safe. You will need to enter it every time you access your study"
28
- },
29
- "securityMessage": "Your personal information is protected by law and will be kept confidential"
30
- }) }}
22
+ {{
23
+ onsAccessCode({
24
+ "id": "access-code-example",
25
+ "name": "access-code",
26
+ "postTextboxLinkText": "Where to find your access code",
27
+ "postTextboxLinkUrl": "#0",
28
+ "label": {
29
+ "text": "Enter your 16-character access code",
30
+ "description": "Keep this code safe. You will need to enter it every time you access your study"
31
+ },
32
+ "securityMessage": "Your personal information is protected by law and will be kept confidential"
33
+ })
34
+ }}
31
35
 
32
- {{ onsButton({
33
- "text": "Access study",
34
- "classes": "ons-u-mb-xl"
35
- }) }}
36
+ {{
37
+ onsButton({
38
+ "text": "Access study",
39
+ "classes": "ons-u-mb-xl"
40
+ })
41
+ }}
36
42
 
37
43
  <h2>If you do not have an access code</h2>
38
44
  <p>
39
- If you have lost or not received an access code, you can <a href="#0">request a new access code</a>.
40
- This can be sent to you by text or post.
45
+ If you have lost or not received an access code, you can <a href="#0">request a new access code</a>. This can be sent to you by text
46
+ or post.
41
47
  </p>
42
48
 
43
49
  {% set content %}
44
50
  <p>If you need to answer separately from the people you live with, you can <a href="#0">request an individual access code</a>.</p>
45
- {% call onsPanel({
46
- "variant": "warn"
47
- }) %}
51
+ {%
52
+ call onsPanel({
53
+ "variant": "warn"
54
+ })
55
+ %}
48
56
  Someone in your household must still complete a study using this household access code
49
57
  {% endcall %}
50
58
  {% endset %}
51
59
 
52
- {% call onsDetails({
53
- "id": "details",
54
- "title": "Need to answer separately from your household?"
55
- }) %}
60
+ {%
61
+ call onsDetails({
62
+ "id": "details",
63
+ "title": "Need to answer separately from your household?"
64
+ })
65
+ %}
56
66
  {{ content | safe }}
57
67
  {% endcall %}
58
68
  {% endblock %}
@@ -1,15 +1,16 @@
1
1
  {% macro onsAccordion(params) %}
2
2
  {% from "components/details/_macro.njk" import onsDetails %}
3
3
 
4
- <div id="{{params.id}}" class="ons-accordion{{ ' ' + params.classes if params.classes }}">
4
+ <div id="{{ params.id }}" class="ons-accordion{{ ' ' + params.classes if params.classes else '' }}">
5
5
  {% if params.allButton %}
6
6
  {% from "components/button/_macro.njk" import onsButton %}
7
7
  {% set attributes = params.allButton.attributes | default({}) %}
8
-
9
- {% set attributes = attributes | setAttributes({
10
- "data-close-all": params.allButton.close,
11
- "data-group": params.id
12
- }) %}
8
+ {%
9
+ set attributes = attributes | setAttributes({
10
+ "data-close-all": params.allButton.close,
11
+ "data-group": params.id
12
+ })
13
+ %}
13
14
 
14
15
  {{
15
16
  onsButton({
@@ -1,7 +1,6 @@
1
1
  {% from "components/accordion/_macro.njk" import onsAccordion %}
2
2
  {% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
3
3
 
4
-
5
4
  {% set content1 %}
6
5
  {{
7
6
  onsCheckboxes({
@@ -3,10 +3,13 @@
3
3
  {% from "components/input/_macro.njk" import onsInput %}
4
4
 
5
5
  {% macro onsAddressInput(params) %}
6
- {% set fields %}
7
- <div id="address" class="ons-field ons-address-input {% if not params.manualEntry %}ons-address-input--search ons-js-address-autosuggest{% endif %}">
6
+ {% set fields %}
7
+ <div
8
+ id="address"
9
+ class="ons-field ons-address-input{{ ' ons-address-input--search ons-js-address-autosuggest' if not params.manualEntry }}"
10
+ >
8
11
  {% if params.isEditable == true or params.manualEntry %}
9
- {% if not params.manualEntry %}<div class="ons-js-address-input__manual ons-u-db-no-js_enabled">{% endif %}
12
+ {% set addressInputs %}
10
13
  {% if params.organisation %}
11
14
  {{
12
15
  onsInput({
@@ -81,11 +84,16 @@
81
84
  })
82
85
  }}
83
86
  {% endif %}
87
+ {% endset %}
84
88
  {% if not params.manualEntry %}
89
+ <div class="ons-js-address-input__manual ons-u-db-no-js_enabled">
90
+ {{ addressInputs | safe }}
85
91
  <div class="ons-u-mt-s">
86
92
  <a href="#0" class="ons-js-address-search-btn ons-u-db-no-js_disabled">{{ params.searchButton }}</a>
87
93
  </div>
88
94
  </div>
95
+ {% else %}
96
+ {{ addressInputs | safe }}
89
97
  {% endif %}
90
98
  {% endif %}
91
99
 
@@ -105,7 +113,7 @@
105
113
  })
106
114
  }}
107
115
  {% if not params.manualEntry %}
108
- <div class="ons-js-address-input__search{% if params.isEditable == true %} ons-u-db-no-js_disabled{% endif %}">
116
+ <div class="ons-js-address-input__search{{ ' ons-u-db-no-js_disabled' if params.isEditable == true }}">
109
117
  {{
110
118
  onsAutosuggest({
111
119
  "id": params.id + "-autosuggest",
@@ -157,7 +165,9 @@
157
165
  })
158
166
  }}
159
167
  {% if params.manualLinkText %}
160
- <a href="{{ params.manualLink | default('#0') }}" class="ons-js-address-manual-btn ons-u-mt-s ons-u-dib">{{ params.manualLinkText }}</a>
168
+ <a href="{{ params.manualLink | default('#0') }}" class="ons-js-address-manual-btn ons-u-mt-s ons-u-dib"
169
+ >{{ params.manualLinkText }}</a
170
+ >
161
171
  {% endif %}
162
172
  </div>
163
173
  {% endif %}
@@ -167,12 +177,14 @@
167
177
  {% if params.dontWrap %}
168
178
  {{ fields | safe }}
169
179
  {% else %}
170
- {% call onsFieldset({
171
- "id": params.id,
172
- "classes": params.classes,
173
- "legend": params.legend,
174
- "legendClasses": params.legendClasses
175
- }) %}
180
+ {%
181
+ call onsFieldset({
182
+ "id": params.id,
183
+ "classes": params.classes,
184
+ "legend": params.legend,
185
+ "legendClasses": params.legendClasses
186
+ })
187
+ %}
176
188
  {{ fields | safe }}
177
189
  {% endcall %}
178
190
  {% endif %}
@@ -1,5 +1,4 @@
1
1
  import abortableFetch from '../../js/abortable-fetch';
2
- import { sanitiseAutosuggestText } from '../autosuggest/autosuggest.helpers';
3
2
  import AutosuggestUI from '../autosuggest/autosuggest.ui';
4
3
  import AddressError from './autosuggest.address.error';
5
4
  import AddressSetter from './autosuggest.address.setter';
@@ -180,10 +179,8 @@ export default class AutosuggestAddress {
180
179
  }
181
180
 
182
181
  results = updatedResults.map(({ uprn, address, type }) => {
183
- const sanitisedText = sanitiseAutosuggestText(address, this.addressReplaceChars);
184
182
  return {
185
183
  [this.lang]: address,
186
- sanitisedText,
187
184
  uprn,
188
185
  type,
189
186
  };
@@ -235,10 +232,8 @@ export default class AutosuggestAddress {
235
232
  const data = await this.retrieveAddress(id);
236
233
  const address = data.response.address.formattedAddress;
237
234
  const uprn = data.response.address.uprn;
238
- const sanitisedText = sanitiseAutosuggestText(address, this.addressReplaceChars);
239
235
  return {
240
236
  [this.lang]: address,
241
- sanitisedText,
242
237
  uprn,
243
238
  };
244
239
  }
@@ -1,52 +1,54 @@
1
1
  {% from "components/address-input/_macro.njk" import onsAddressInput %}
2
2
 
3
- {{ onsAddressInput({
4
- "id": "address-input-editable",
5
- "dontWrap": true,
6
- "label": {
7
- "text": "Enter address or postcode and select from results",
8
- "id": "address-label-input-editable"
9
- },
10
- "isEditable": true,
11
- "mandatory": true,
12
- "APIDomain": "https://mock-address-api.gcp.onsdigital.uk",
13
- 'APIDomainBearerToken': "some_token",
14
- "instructions": "Use up and down keys to navigate suggestions once you\'ve typed more than two characters. Use the enter key to select a suggestion. Touch device users, explore by touch or with swipe gestures.",
15
- "ariaYouHaveSelected": "You have selected",
16
- "ariaMinChars": "Enter 3 or more characters for suggestions.",
17
- "ariaOneResult": "There is one suggestion available.",
18
- "ariaNResults": "There are {n} suggestions available.",
19
- "ariaLimitedResults": "Results have been limited to 10 suggestions. Type more characters to improve your search",
20
- "ariaGroupedResults": "There are {n} for {x}",
21
- "groupCount": "{n} addresses",
22
- "moreResults": "Enter more of the address to improve results",
23
- "resultsTitle": "Select an address",
24
- "resultsTitleId": "address-results",
25
- "noResults": "No results found. Try entering a different part of the address",
26
- "tooManyResults": "{n} results found. Enter more of the address to improve results",
27
- "typeMore": "Enter more of the address to get results",
28
- "autocomplete": "off",
29
- "errorTitle": "There is a problem with your answer",
30
- "errorMessageEnter": "Enter an address",
31
- "errorMessageSelect": "Select an address",
32
- "errorMessageAPI": "Sorry, there is a problem loading addresses.",
33
- "errorMessageAPILinkText": "Enter address manually",
34
- "options": {
35
- "regionCode": "gb-eng",
36
- "addressType": "residential"
37
- },
38
- "line1": {
39
- "label": "Address line 1"
40
- },
41
- "line2": {
42
- "label": "Address line 2"
43
- },
44
- "town": {
45
- "label": "Town or city"
46
- },
47
- "postcode": {
48
- "label": "Postcode"
49
- },
50
- "searchButton": "Search for an address",
51
- "manualLinkText": "Manually enter address"
52
- }) }}
3
+ {{
4
+ onsAddressInput({
5
+ "id": "address-input-editable",
6
+ "dontWrap": true,
7
+ "label": {
8
+ "text": "Enter address or postcode and select from results",
9
+ "id": "address-label-input-editable"
10
+ },
11
+ "isEditable": true,
12
+ "mandatory": true,
13
+ "APIDomain": "https://mock-address-api.gcp.onsdigital.uk",
14
+ 'APIDomainBearerToken': "some_token",
15
+ "instructions": "Use up and down keys to navigate suggestions once you\'ve typed more than two characters. Use the enter key to select a suggestion. Touch device users, explore by touch or with swipe gestures.",
16
+ "ariaYouHaveSelected": "You have selected",
17
+ "ariaMinChars": "Enter 3 or more characters for suggestions.",
18
+ "ariaOneResult": "There is one suggestion available.",
19
+ "ariaNResults": "There are {n} suggestions available.",
20
+ "ariaLimitedResults": "Results have been limited to 10 suggestions. Type more characters to improve your search",
21
+ "ariaGroupedResults": "There are {n} for {x}",
22
+ "groupCount": "{n} addresses",
23
+ "moreResults": "Enter more of the address to improve results",
24
+ "resultsTitle": "Select an address",
25
+ "resultsTitleId": "address-results",
26
+ "noResults": "No results found. Try entering a different part of the address",
27
+ "tooManyResults": "{n} results found. Enter more of the address to improve results",
28
+ "typeMore": "Enter more of the address to get results",
29
+ "autocomplete": "off",
30
+ "errorTitle": "There is a problem with your answer",
31
+ "errorMessageEnter": "Enter an address",
32
+ "errorMessageSelect": "Select an address",
33
+ "errorMessageAPI": "Sorry, there is a problem loading addresses.",
34
+ "errorMessageAPILinkText": "Enter address manually",
35
+ "options": {
36
+ "regionCode": "gb-eng",
37
+ "addressType": "residential"
38
+ },
39
+ "line1": {
40
+ "label": "Address line 1"
41
+ },
42
+ "line2": {
43
+ "label": "Address line 2"
44
+ },
45
+ "town": {
46
+ "label": "Town or city"
47
+ },
48
+ "postcode": {
49
+ "label": "Postcode"
50
+ },
51
+ "searchButton": "Search for an address",
52
+ "manualLinkText": "Manually enter address"
53
+ })
54
+ }}
@@ -1,23 +1,25 @@
1
1
  {% from "components/address-input/_macro.njk" import onsAddressInput %}
2
2
 
3
- {{ onsAddressInput({
4
- "id": "address-input-manual",
5
- "dontWrap": true,
6
- "manualEntry": true,
7
- "label": {
8
- "text": "Enter address or postcode and select from results",
9
- "id": "address-label-input-manual"
10
- },
11
- "line1": {
12
- "label": "Address line 1"
13
- },
14
- "line2": {
15
- "label": "Address line 2"
16
- },
17
- "town": {
18
- "label": "Town or city"
19
- },
20
- "postcode": {
21
- "label": "Postcode"
22
- }
23
- }) }}
3
+ {{
4
+ onsAddressInput({
5
+ "id": "address-input-manual",
6
+ "dontWrap": true,
7
+ "manualEntry": true,
8
+ "label": {
9
+ "text": "Enter address or postcode and select from results",
10
+ "id": "address-label-input-manual"
11
+ },
12
+ "line1": {
13
+ "label": "Address line 1"
14
+ },
15
+ "line2": {
16
+ "label": "Address line 2"
17
+ },
18
+ "town": {
19
+ "label": "Town or city"
20
+ },
21
+ "postcode": {
22
+ "label": "Postcode"
23
+ }
24
+ })
25
+ }}