defra_ruby_template 5.11.1 → 6.4.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 (1308) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +133 -9
  3. data/Rakefile +146 -22
  4. data/app/views/layouts/defra_ruby_template.html.erb +108 -60
  5. data/lib/defra_ruby_template/version.rb +1 -1
  6. data/lib/defra_ruby_template.rb +12 -8
  7. data/node_modules/govuk-frontend/README.md +1 -1
  8. data/node_modules/govuk-frontend/dist/govuk/_base.import.scss +6 -0
  9. data/node_modules/govuk-frontend/dist/govuk/_base.scss +4 -4
  10. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +214 -325
  11. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -1
  12. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +215 -325
  13. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -1
  14. data/node_modules/govuk-frontend/dist/govuk/all.mjs +0 -1
  15. data/node_modules/govuk-frontend/dist/govuk/all.mjs.map +1 -1
  16. data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.ico +0 -0
  17. data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.svg +1 -1
  18. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-180.png +0 -0
  19. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-192.png +0 -0
  20. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-512.png +0 -0
  21. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-opengraph-image.png +0 -0
  22. data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs +29 -2
  23. data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs.map +1 -1
  24. data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
  25. data/node_modules/govuk-frontend/dist/govuk/common/index.mjs +5 -11
  26. data/node_modules/govuk-frontend/dist/govuk/common/index.mjs.map +1 -1
  27. data/node_modules/govuk-frontend/dist/govuk/component.mjs.map +1 -1
  28. data/node_modules/govuk-frontend/dist/govuk/components/_index.import.scss +38 -0
  29. data/node_modules/govuk-frontend/dist/govuk/components/_index.scss +37 -39
  30. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_accordion.import.scss +6 -0
  31. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.import.scss +8 -0
  32. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +3 -368
  33. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_mixin.scss +375 -0
  34. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +14 -137
  35. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js.map +1 -1
  36. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +14 -137
  37. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs.map +1 -1
  38. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs +4 -4
  39. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs.map +1 -1
  40. data/node_modules/govuk-frontend/dist/govuk/components/accordion/fixtures.json +102 -97
  41. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_back-link.import.scss +6 -0
  42. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.import.scss +8 -0
  43. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss +3 -81
  44. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_mixin.scss +87 -0
  45. data/node_modules/govuk-frontend/dist/govuk/components/back-link/fixtures.json +21 -32
  46. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_breadcrumbs.import.scss +6 -0
  47. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.import.scss +8 -0
  48. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss +3 -132
  49. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_mixin.scss +134 -0
  50. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/fixtures.json +25 -45
  51. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-default.html +6 -0
  52. data/node_modules/govuk-frontend/dist/govuk/components/button/_button.import.scss +6 -0
  53. data/node_modules/govuk-frontend/dist/govuk/components/button/_index.import.scss +13 -0
  54. data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss +9 -260
  55. data/node_modules/govuk-frontend/dist/govuk/components/button/_mixin.scss +233 -0
  56. data/node_modules/govuk-frontend/dist/govuk/components/button/_settings.import.scss +32 -0
  57. data/node_modules/govuk-frontend/dist/govuk/components/button/_settings.scss +34 -0
  58. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js +7 -5
  59. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js.map +1 -1
  60. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs +7 -5
  61. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs.map +1 -1
  62. data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs.map +1 -1
  63. data/node_modules/govuk-frontend/dist/govuk/components/button/fixtures.json +193 -209
  64. data/node_modules/govuk-frontend/dist/govuk/components/button/macro-options.json +12 -19
  65. data/node_modules/govuk-frontend/dist/govuk/components/button/template-default-active-state.html +3 -0
  66. data/node_modules/govuk-frontend/dist/govuk/components/button/template-default-focus-state.html +3 -0
  67. data/node_modules/govuk-frontend/dist/govuk/components/button/template-default-hover-state.html +3 -0
  68. data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-active-state.html +3 -0
  69. data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-disabled.html +1 -1
  70. data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-focus-state.html +3 -0
  71. data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-hover-state.html +3 -0
  72. data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary-active-state.html +3 -0
  73. data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary-focus-state.html +3 -0
  74. data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary-hover-state.html +3 -0
  75. data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning-active-state.html +3 -0
  76. data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning-focus-state.html +3 -0
  77. data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning-hover-state.html +3 -0
  78. data/node_modules/govuk-frontend/dist/govuk/components/button/template.njk +20 -20
  79. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_character-count.import.scss +6 -0
  80. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.import.scss +12 -0
  81. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +7 -42
  82. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_mixin.scss +41 -0
  83. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +30 -143
  84. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js.map +1 -1
  85. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +30 -143
  86. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs.map +1 -1
  87. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +20 -10
  88. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs.map +1 -1
  89. data/node_modules/govuk-frontend/dist/govuk/components/character-count/fixtures.json +72 -86
  90. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_checkboxes.import.scss +6 -0
  91. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.import.scss +12 -0
  92. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss +7 -309
  93. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_mixin.scss +317 -0
  94. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js +10 -5
  95. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js.map +1 -1
  96. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs +10 -5
  97. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs.map +1 -1
  98. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs.map +1 -1
  99. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/fixtures.json +326 -480
  100. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/macro-options.json +1 -1
  101. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-default.html +5 -0
  102. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-conditional-reveal.html +21 -21
  103. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-divider-and-none.html +30 -30
  104. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-error.html +26 -26
  105. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-hint.html +25 -25
  106. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-long-text.html +23 -23
  107. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small.html +23 -23
  108. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-conditional-items.html +35 -35
  109. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-and-none.html +30 -32
  110. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-none-and-conditional-items.html +40 -42
  111. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-error-message.html +32 -23
  112. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-hint.html +30 -0
  113. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-hints-on-items.html +21 -23
  114. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-legend-as-a-page-heading.html +27 -27
  115. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-optional-form-group-classes-showing-group-error.html +36 -36
  116. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-pre-checked-values.html +25 -16
  117. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-very-long-option-text.html +27 -30
  118. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template.njk +1 -1
  119. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_cookie-banner.import.scss +6 -0
  120. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.import.scss +9 -0
  121. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss +4 -56
  122. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_mixin.scss +56 -0
  123. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/fixtures.json +82 -82
  124. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-default.html +2 -2
  125. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-with-html.html +2 -2
  126. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_date-input.import.scss +6 -0
  127. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.import.scss +13 -0
  128. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +8 -26
  129. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_mixin.scss +29 -0
  130. data/node_modules/govuk-frontend/dist/govuk/components/date-input/fixtures.json +780 -150
  131. data/node_modules/govuk-frontend/dist/govuk/components/date-input/macro-options.json +50 -0
  132. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-day-and-month-using-items.html +28 -0
  133. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-default.html +30 -22
  134. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-month-and-year-using-items.html +28 -0
  135. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-message-and-hint-using-items.html +39 -0
  136. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-message-and-hint.html +39 -0
  137. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-day-input-using-items.html +39 -0
  138. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-day-input.html +3 -3
  139. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-month-input-using-items.html +39 -0
  140. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-month-input.html +3 -3
  141. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-year-input-using-items.html +39 -0
  142. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-year-input.html +3 -3
  143. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-only-using-classes.html +33 -0
  144. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-only-using-items-and-classes.html +33 -0
  145. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-only-using-items.html +33 -0
  146. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-only.html +5 -8
  147. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-translations.html +36 -0
  148. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-values-and-name-prefix.html +36 -0
  149. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-values-name-prefix-and-custom-names.html +36 -0
  150. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-values.html +36 -0
  151. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template.njk +84 -29
  152. data/node_modules/govuk-frontend/dist/govuk/components/details/_details.import.scss +6 -0
  153. data/node_modules/govuk-frontend/dist/govuk/components/details/_index.import.scss +8 -0
  154. data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss +3 -137
  155. data/node_modules/govuk-frontend/dist/govuk/components/details/_mixin.scss +143 -0
  156. data/node_modules/govuk-frontend/dist/govuk/components/details/fixtures.json +22 -22
  157. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_error-message.import.scss +6 -0
  158. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.import.scss +8 -0
  159. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss +3 -12
  160. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_mixin.scss +16 -0
  161. data/node_modules/govuk-frontend/dist/govuk/components/error-message/fixtures.json +10 -10
  162. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_error-summary.import.scss +6 -0
  163. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.import.scss +8 -0
  164. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss +3 -53
  165. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_mixin.scss +58 -0
  166. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js +8 -12
  167. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js.map +1 -1
  168. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs +8 -12
  169. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs.map +1 -1
  170. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs +2 -2
  171. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs.map +1 -1
  172. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/fixtures.json +21 -21
  173. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_exit-this-page.import.scss +6 -0
  174. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.import.scss +9 -0
  175. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss +4 -89
  176. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_mixin.scss +96 -0
  177. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +10 -133
  178. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js.map +1 -1
  179. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +10 -133
  180. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs.map +1 -1
  181. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs.map +1 -1
  182. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/fixtures.json +19 -19
  183. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_fieldset.import.scss +6 -0
  184. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.import.scss +8 -0
  185. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.scss +3 -67
  186. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_mixin.scss +71 -0
  187. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/fixtures.json +19 -19
  188. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_file-upload.import.scss +6 -0
  189. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.import.scss +11 -0
  190. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +6 -216
  191. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_mixin.scss +217 -0
  192. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js +76 -164
  193. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js.map +1 -1
  194. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs +76 -164
  195. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs.map +1 -1
  196. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs +66 -32
  197. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs.map +1 -1
  198. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/fixtures.json +125 -138
  199. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/macro-options.json +15 -10
  200. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-custom-wrapper-classes-and-attributes.html +11 -0
  201. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-multiple-files.html +11 -0
  202. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-with-error-message-and-hint.html +3 -2
  203. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced.html +3 -2
  204. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-translated.html +3 -2
  205. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template.njk +2 -2
  206. data/node_modules/govuk-frontend/dist/govuk/components/footer/_footer.import.scss +6 -0
  207. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.import.scss +8 -0
  208. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +3 -192
  209. data/node_modules/govuk-frontend/dist/govuk/components/footer/_mixin.scss +199 -0
  210. data/node_modules/govuk-frontend/dist/govuk/components/footer/fixtures.json +129 -81
  211. data/node_modules/govuk-frontend/dist/govuk/components/footer/macro-options.json +1 -7
  212. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-default.html +45 -24
  213. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-full-gds-example.html +45 -24
  214. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-three-equal-columns.html +45 -24
  215. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-html-content-licence-and-copyright-notice.html +40 -19
  216. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-meta.html +45 -24
  217. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-text-content-licence-and-copyright-notice.html +40 -19
  218. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-one-column.html +45 -24
  219. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-two-columns.html +45 -24
  220. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-meta-links-and-meta-content.html +45 -24
  221. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-navigation.html +45 -24
  222. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-no-content-licence.html +37 -0
  223. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-only-custom-meta.html +41 -0
  224. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-only-meta-links.html +80 -0
  225. data/node_modules/govuk-frontend/dist/govuk/components/footer/template.njk +36 -39
  226. data/node_modules/govuk-frontend/dist/govuk/components/generic-header/README.md +15 -0
  227. data/node_modules/govuk-frontend/dist/govuk/components/generic-header/_generic-header.import.scss +6 -0
  228. data/node_modules/govuk-frontend/dist/govuk/components/generic-header/_index.import.scss +8 -0
  229. data/node_modules/govuk-frontend/dist/govuk/components/generic-header/_index.scss +5 -0
  230. data/node_modules/govuk-frontend/dist/govuk/components/generic-header/_mixin.scss +140 -0
  231. data/node_modules/govuk-frontend/dist/govuk/components/generic-header/fixtures.json +90 -0
  232. data/node_modules/govuk-frontend/dist/govuk/components/generic-header/macro-options.json +38 -0
  233. data/node_modules/govuk-frontend/dist/govuk/components/generic-header/macro.njk +3 -0
  234. data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template-default.html +11 -0
  235. data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template-full-width.html +20 -0
  236. data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template-with-image-logo.html +20 -0
  237. data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template-with-text-and-image-logo.html +20 -0
  238. data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template.njk +14 -0
  239. data/node_modules/govuk-frontend/dist/govuk/components/header/README.md +1 -1
  240. data/node_modules/govuk-frontend/dist/govuk/components/header/_header.import.scss +6 -0
  241. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.import.scss +8 -0
  242. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +3 -546
  243. data/node_modules/govuk-frontend/dist/govuk/components/header/_mixin.scss +119 -0
  244. data/node_modules/govuk-frontend/dist/govuk/components/header/fixtures.json +15 -492
  245. data/node_modules/govuk-frontend/dist/govuk/components/header/macro-options.json +2 -101
  246. data/node_modules/govuk-frontend/dist/govuk/components/header/template-default.html +12 -7
  247. data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width.html +12 -8
  248. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-product-name.html +11 -7
  249. data/node_modules/govuk-frontend/dist/govuk/components/header/template.njk +20 -63
  250. data/node_modules/govuk-frontend/dist/govuk/components/hint/_hint.import.scss +6 -0
  251. data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.import.scss +8 -0
  252. data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss +3 -43
  253. data/node_modules/govuk-frontend/dist/govuk/components/hint/_mixin.scss +47 -0
  254. data/node_modules/govuk-frontend/dist/govuk/components/hint/fixtures.json +7 -7
  255. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.import.scss +11 -0
  256. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +6 -166
  257. data/node_modules/govuk-frontend/dist/govuk/components/input/_input.import.scss +6 -0
  258. data/node_modules/govuk-frontend/dist/govuk/components/input/_mixin.scss +161 -0
  259. data/node_modules/govuk-frontend/dist/govuk/components/input/fixtures.json +161 -180
  260. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-extra-letter-spacing.html +1 -1
  261. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.import.scss +8 -0
  262. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss +3 -24
  263. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_inset-text.import.scss +6 -0
  264. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_mixin.scss +31 -0
  265. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/fixtures.json +7 -7
  266. data/node_modules/govuk-frontend/dist/govuk/components/label/_index.import.scss +8 -0
  267. data/node_modules/govuk-frontend/dist/govuk/components/label/_index.scss +3 -44
  268. data/node_modules/govuk-frontend/dist/govuk/components/label/_label.import.scss +6 -0
  269. data/node_modules/govuk-frontend/dist/govuk/components/label/_mixin.scss +48 -0
  270. data/node_modules/govuk-frontend/dist/govuk/components/label/fixtures.json +20 -20
  271. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.import.scss +8 -0
  272. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +3 -91
  273. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_mixin.scss +100 -0
  274. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_notification-banner.import.scss +6 -0
  275. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/fixtures.json +74 -108
  276. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js +7 -5
  277. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js.map +1 -1
  278. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs +7 -5
  279. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs.map +1 -1
  280. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs.map +1 -1
  281. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-text-as-html.html +7 -1
  282. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.import.scss +8 -0
  283. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +3 -226
  284. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_mixin.scss +235 -0
  285. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_pagination.import.scss +6 -0
  286. data/node_modules/govuk-frontend/dist/govuk/components/pagination/fixtures.json +109 -105
  287. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-default.html +3 -3
  288. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-first-page.html +3 -3
  289. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-last-page.html +3 -3
  290. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-custom-link-and-item-text.html +3 -3
  291. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-many-pages.html +9 -9
  292. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template.njk +4 -2
  293. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.import.scss +8 -0
  294. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +3 -56
  295. data/node_modules/govuk-frontend/dist/govuk/components/panel/_mixin.scss +94 -0
  296. data/node_modules/govuk-frontend/dist/govuk/components/panel/_panel.import.scss +6 -0
  297. data/node_modules/govuk-frontend/dist/govuk/components/panel/fixtures.json +249 -16
  298. data/node_modules/govuk-frontend/dist/govuk/components/panel/macro-options.json +58 -0
  299. data/node_modules/govuk-frontend/dist/govuk/components/panel/template-default.html +1 -1
  300. data/node_modules/govuk-frontend/dist/govuk/components/panel/template-interruption-with-content-with-long-line-length.html +17 -0
  301. data/node_modules/govuk-frontend/dist/govuk/components/panel/template-interruption-with-headings-content-and-lists.html +18 -0
  302. data/node_modules/govuk-frontend/dist/govuk/components/panel/template-interruption.html +14 -0
  303. data/node_modules/govuk-frontend/dist/govuk/components/panel/template.njk +42 -2
  304. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.import.scss +10 -0
  305. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss +5 -54
  306. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_mixin.scss +56 -0
  307. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_password-input.import.scss +6 -0
  308. data/node_modules/govuk-frontend/dist/govuk/components/password-input/fixtures.json +53 -48
  309. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +10 -133
  310. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js.map +1 -1
  311. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +10 -133
  312. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs.map +1 -1
  313. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs.map +1 -1
  314. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.import.scss +9 -0
  315. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +4 -33
  316. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_mixin.scss +42 -0
  317. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_phase-banner.import.scss +6 -0
  318. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/fixtures.json +15 -15
  319. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/template-default.html +1 -1
  320. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/template.njk +1 -1
  321. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.import.scss +12 -0
  322. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +7 -325
  323. data/node_modules/govuk-frontend/dist/govuk/components/radios/_mixin.scss +336 -0
  324. data/node_modules/govuk-frontend/dist/govuk/components/radios/_radios.import.scss +6 -0
  325. data/node_modules/govuk-frontend/dist/govuk/components/radios/fixtures.json +244 -354
  326. data/node_modules/govuk-frontend/dist/govuk/components/radios/macro-options.json +3 -3
  327. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js +10 -5
  328. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js.map +1 -1
  329. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs +10 -5
  330. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs.map +1 -1
  331. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs.map +1 -1
  332. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-default.html +5 -3
  333. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-inline.html +19 -19
  334. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-inline.html +23 -23
  335. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-a-divider.html +24 -24
  336. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-conditional-reveal.html +27 -27
  337. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-error.html +26 -26
  338. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-hint.html +25 -25
  339. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-long-text.html +23 -23
  340. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small.html +23 -23
  341. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-a-divider.html +24 -24
  342. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-item-checked.html +35 -35
  343. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items-and-pre-checked-value.html +35 -35
  344. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items.html +35 -35
  345. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-fieldset-and-error-message.html +20 -20
  346. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-hint.html +24 -0
  347. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-hints-on-items.html +23 -23
  348. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-legend-as-page-heading.html +21 -21
  349. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-optional-form-group-classes-showing-group-error.html +36 -36
  350. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-very-long-option-text.html +28 -28
  351. data/node_modules/govuk-frontend/dist/govuk/components/radios/template.njk +1 -1
  352. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.import.scss +11 -0
  353. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +6 -56
  354. data/node_modules/govuk-frontend/dist/govuk/components/select/_mixin.scss +45 -0
  355. data/node_modules/govuk-frontend/dist/govuk/components/select/_select.import.scss +6 -0
  356. data/node_modules/govuk-frontend/dist/govuk/components/select/fixtures.json +99 -115
  357. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.import.scss +8 -0
  358. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +3 -185
  359. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_mixin.scss +238 -0
  360. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.import.scss +6 -0
  361. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/fixtures.json +210 -69
  362. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/macro-options.json +6 -0
  363. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +41 -8
  364. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js.map +1 -1
  365. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs +41 -8
  366. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs.map +1 -1
  367. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs +30 -2
  368. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs.map +1 -1
  369. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-default.html +1 -1
  370. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-inverse.html +63 -0
  371. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-a-single-navigation-item-and-collapsenavigationonmobile-set-to-true.html +38 -0
  372. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-a-single-navigation-item.html +35 -0
  373. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-collapsenavigationonmobile-set-to-false.html +60 -0
  374. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-html-navigation-items.html +1 -1
  375. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-large-navigation.html +1 -1
  376. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-navigation-with-a-current-item.html +1 -1
  377. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-non-link-navigation-items.html +1 -1
  378. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-service-name-and-navigation.html +1 -1
  379. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template.njk +4 -1
  380. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.import.scss +8 -0
  381. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +3 -50
  382. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_mixin.scss +60 -0
  383. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_skip-link.import.scss +6 -0
  384. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/fixtures.json +10 -10
  385. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js +12 -19
  386. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js.map +1 -1
  387. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs +12 -19
  388. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs.map +1 -1
  389. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs +3 -9
  390. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs.map +1 -1
  391. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.import.scss +8 -0
  392. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +3 -267
  393. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_mixin.scss +286 -0
  394. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_summary-list.import.scss +6 -0
  395. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/fixtures.json +282 -518
  396. data/node_modules/govuk-frontend/dist/govuk/components/table/_index.import.scss +8 -0
  397. data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss +3 -73
  398. data/node_modules/govuk-frontend/dist/govuk/components/table/_mixin.scss +77 -0
  399. data/node_modules/govuk-frontend/dist/govuk/components/table/_table.import.scss +6 -0
  400. data/node_modules/govuk-frontend/dist/govuk/components/table/fixtures.json +75 -75
  401. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.import.scss +8 -0
  402. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss +3 -132
  403. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_mixin.scss +140 -0
  404. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_tabs.import.scss +6 -0
  405. data/node_modules/govuk-frontend/dist/govuk/components/tabs/fixtures.json +44 -39
  406. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js +13 -14
  407. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js.map +1 -1
  408. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs +13 -14
  409. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs.map +1 -1
  410. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs +3 -3
  411. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs.map +1 -1
  412. data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.import.scss +8 -0
  413. data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss +3 -94
  414. data/node_modules/govuk-frontend/dist/govuk/components/tag/_mixin.scss +135 -0
  415. data/node_modules/govuk-frontend/dist/govuk/components/tag/_tag.import.scss +6 -0
  416. data/node_modules/govuk-frontend/dist/govuk/components/tag/fixtures.json +19 -43
  417. data/node_modules/govuk-frontend/dist/govuk/components/tag/template-pink.html +2 -2
  418. data/node_modules/govuk-frontend/dist/govuk/components/tag/template-turquoise.html +2 -2
  419. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.import.scss +9 -0
  420. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss +4 -76
  421. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_mixin.scss +83 -0
  422. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_task-list.import.scss +6 -0
  423. data/node_modules/govuk-frontend/dist/govuk/components/task-list/fixtures.json +35 -58
  424. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-forced-hover-state.html +37 -0
  425. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-with-all-possible-colours.html +131 -0
  426. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-with-hint-text-and-additional-states.html +77 -0
  427. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.import.scss +11 -0
  428. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +6 -47
  429. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_mixin.scss +43 -0
  430. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_textarea.import.scss +6 -0
  431. data/node_modules/govuk-frontend/dist/govuk/components/textarea/fixtures.json +81 -81
  432. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.import.scss +8 -0
  433. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +3 -64
  434. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_mixin.scss +69 -0
  435. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_warning-text.import.scss +6 -0
  436. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/fixtures.json +9 -9
  437. data/node_modules/govuk-frontend/dist/govuk/core/_global-styles.import.scss +10 -0
  438. data/node_modules/govuk-frontend/dist/govuk/core/_global-styles.mixin.scss +19 -0
  439. data/node_modules/govuk-frontend/dist/govuk/core/_global-styles.scss +5 -18
  440. data/node_modules/govuk-frontend/dist/govuk/core/_index.import.scss +6 -0
  441. data/node_modules/govuk-frontend/dist/govuk/core/_index.scss +6 -7
  442. data/node_modules/govuk-frontend/dist/govuk/core/_links.import.scss +10 -0
  443. data/node_modules/govuk-frontend/dist/govuk/core/_links.mixin.scss +44 -0
  444. data/node_modules/govuk-frontend/dist/govuk/core/_links.scss +3 -40
  445. data/node_modules/govuk-frontend/dist/govuk/core/_lists.import.scss +14 -0
  446. data/node_modules/govuk-frontend/dist/govuk/core/_lists.mixin.scss +74 -0
  447. data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss +6 -64
  448. data/node_modules/govuk-frontend/dist/govuk/core/_section-break.import.scss +8 -0
  449. data/node_modules/govuk-frontend/dist/govuk/core/_section-break.mixin.scss +54 -0
  450. data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss +3 -49
  451. data/node_modules/govuk-frontend/dist/govuk/core/_typography.import.scss +8 -0
  452. data/node_modules/govuk-frontend/dist/govuk/core/_typography.mixin.scss +173 -0
  453. data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss +3 -187
  454. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_breakpoints.import.scss +8 -0
  455. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_breakpoints.mixin.scss +15 -0
  456. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_breakpoints.scss +4 -0
  457. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.import.scss +8 -0
  458. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.mixin.scss +13 -0
  459. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.scss +4 -0
  460. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.import.scss +8 -0
  461. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.mixin.scss +21 -0
  462. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.scss +4 -0
  463. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_index.import.scss +4 -0
  464. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_index.scss +4 -0
  465. data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs +5 -3
  466. data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs.map +1 -1
  467. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
  468. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
  469. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
  470. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -1
  471. data/node_modules/govuk-frontend/dist/govuk/helpers/_clearfix.import.scss +2 -0
  472. data/node_modules/govuk-frontend/dist/govuk/helpers/_clearfix.scss +0 -1
  473. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.import.scss +2 -0
  474. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +190 -89
  475. data/node_modules/govuk-frontend/dist/govuk/helpers/_device-pixels.import.scss +2 -0
  476. data/node_modules/govuk-frontend/dist/govuk/helpers/_device-pixels.scss +2 -1
  477. data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.import.scss +2 -0
  478. data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +44 -7
  479. data/node_modules/govuk-frontend/dist/govuk/helpers/_font-faces--internal.scss +41 -0
  480. data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.import.scss +2 -0
  481. data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss +7 -4
  482. data/node_modules/govuk-frontend/dist/govuk/helpers/_index.import.scss +2 -0
  483. data/node_modules/govuk-frontend/dist/govuk/helpers/_index.scss +12 -13
  484. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.import.scss +2 -0
  485. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +35 -46
  486. data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.import.scss +2 -0
  487. data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss +174 -34
  488. data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.import.scss +2 -0
  489. data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.scss +2 -3
  490. data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing--internal.scss +80 -0
  491. data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.import.scss +2 -0
  492. data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss +27 -82
  493. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography--internal.scss +24 -0
  494. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.import.scss +2 -0
  495. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +55 -74
  496. data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.import.scss +2 -0
  497. data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss +17 -13
  498. data/node_modules/govuk-frontend/dist/govuk/helpers/_width-container.import.scss +2 -0
  499. data/node_modules/govuk-frontend/dist/govuk/helpers/_width-container.scss +73 -0
  500. data/node_modules/govuk-frontend/dist/govuk/i18n.mjs +5 -128
  501. data/node_modules/govuk-frontend/dist/govuk/i18n.mjs.map +1 -1
  502. data/node_modules/govuk-frontend/dist/govuk/index.import.scss +10 -0
  503. data/node_modules/govuk-frontend/dist/govuk/index.scss +6 -7
  504. data/node_modules/govuk-frontend/dist/govuk/init.mjs +53 -45
  505. data/node_modules/govuk-frontend/dist/govuk/init.mjs.map +1 -1
  506. data/node_modules/govuk-frontend/dist/govuk/macros/attributes.njk +30 -14
  507. data/node_modules/govuk-frontend/dist/govuk/macros/logo.njk +7 -29
  508. data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.import.scss +8 -0
  509. data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.mixin.scss +80 -0
  510. data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.scss +3 -78
  511. data/node_modules/govuk-frontend/dist/govuk/objects/_form-group.import.scss +8 -0
  512. data/node_modules/govuk-frontend/dist/govuk/objects/_form-group.mixin.scss +26 -0
  513. data/node_modules/govuk-frontend/dist/govuk/objects/_form-group.scss +3 -23
  514. data/node_modules/govuk-frontend/dist/govuk/objects/_grid.import.scss +8 -0
  515. data/node_modules/govuk-frontend/dist/govuk/objects/_grid.mixin.scss +28 -0
  516. data/node_modules/govuk-frontend/dist/govuk/objects/_grid.scss +3 -24
  517. data/node_modules/govuk-frontend/dist/govuk/objects/_index.import.scss +7 -0
  518. data/node_modules/govuk-frontend/dist/govuk/objects/_index.scss +6 -7
  519. data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.import.scss +8 -0
  520. data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.mixin.scss +55 -0
  521. data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.scss +3 -53
  522. data/node_modules/govuk-frontend/dist/govuk/objects/_template.import.scss +8 -0
  523. data/node_modules/govuk-frontend/dist/govuk/objects/_template.mixin.scss +53 -0
  524. data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss +3 -55
  525. data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.import.scss +8 -0
  526. data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.mixin.scss +9 -0
  527. data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss +3 -75
  528. data/node_modules/govuk-frontend/dist/govuk/overrides/_display.import.scss +8 -0
  529. data/node_modules/govuk-frontend/dist/govuk/overrides/_display.mixin.scss +26 -0
  530. data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss +2 -24
  531. data/node_modules/govuk-frontend/dist/govuk/overrides/_index.import.scss +6 -0
  532. data/node_modules/govuk-frontend/dist/govuk/overrides/_index.scss +5 -6
  533. data/node_modules/govuk-frontend/dist/govuk/overrides/_spacing.import.scss +8 -0
  534. data/node_modules/govuk-frontend/dist/govuk/overrides/_spacing.mixin.scss +89 -0
  535. data/node_modules/govuk-frontend/dist/govuk/overrides/_spacing.scss +2 -84
  536. data/node_modules/govuk-frontend/dist/govuk/overrides/_text-align.import.scss +8 -0
  537. data/node_modules/govuk-frontend/dist/govuk/overrides/_text-align.mixin.scss +16 -0
  538. data/node_modules/govuk-frontend/dist/govuk/overrides/_text-align.scss +2 -14
  539. data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.import.scss +8 -0
  540. data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.mixin.scss +43 -0
  541. data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss +2 -40
  542. data/node_modules/govuk-frontend/dist/govuk/overrides/_width.import.scss +8 -0
  543. data/node_modules/govuk-frontend/dist/govuk/overrides/_width.mixin.scss +50 -0
  544. data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss +2 -46
  545. data/node_modules/govuk-frontend/dist/govuk/settings/_assets.import.scss +13 -0
  546. data/node_modules/govuk-frontend/dist/govuk/settings/_assets.scss +50 -21
  547. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.import.scss +13 -0
  548. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.import.scss +2 -0
  549. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.scss +168 -0
  550. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-legacy-functional.import.scss +2 -0
  551. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-legacy-functional.scss +188 -0
  552. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.import.scss +2 -0
  553. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +9 -274
  554. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-palette--internal.scss +128 -0
  555. data/node_modules/govuk-frontend/dist/govuk/settings/_custom-properties.import.scss +2 -0
  556. data/node_modules/govuk-frontend/dist/govuk/settings/_custom-properties.scss +17 -0
  557. data/node_modules/govuk-frontend/dist/govuk/settings/_global-styles.import.scss +2 -0
  558. data/node_modules/govuk-frontend/dist/govuk/settings/_global-styles.scss +0 -1
  559. data/node_modules/govuk-frontend/dist/govuk/settings/_index.import.scss +24 -0
  560. data/node_modules/govuk-frontend/dist/govuk/settings/_index.scss +14 -13
  561. data/node_modules/govuk-frontend/dist/govuk/settings/_links.import.scss +2 -0
  562. data/node_modules/govuk-frontend/dist/govuk/settings/_links.scss +3 -3
  563. data/node_modules/govuk-frontend/dist/govuk/settings/_measurements.import.scss +2 -0
  564. data/node_modules/govuk-frontend/dist/govuk/settings/_measurements.scss +8 -17
  565. data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.import.scss +2 -0
  566. data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss +0 -10
  567. data/node_modules/govuk-frontend/dist/govuk/settings/_spacing.import.scss +2 -0
  568. data/node_modules/govuk-frontend/dist/govuk/settings/_spacing.scss +0 -1
  569. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-font.import.scss +2 -0
  570. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-font.scss +3 -2
  571. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.import.scss +2 -0
  572. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss +12 -190
  573. data/node_modules/govuk-frontend/dist/govuk/settings/_warnings--internal.scss +69 -0
  574. data/node_modules/govuk-frontend/dist/govuk/settings/_warnings.import.scss +2 -0
  575. data/node_modules/govuk-frontend/dist/govuk/settings/_warnings.scss +9 -56
  576. data/node_modules/govuk-frontend/dist/govuk/template.njk +61 -23
  577. data/node_modules/govuk-frontend/dist/govuk/tools/_exports.import.scss +2 -0
  578. data/node_modules/govuk-frontend/dist/govuk/tools/_exports.scss +12 -6
  579. data/node_modules/govuk-frontend/dist/govuk/tools/_font-url.import.scss +31 -0
  580. data/node_modules/govuk-frontend/dist/govuk/tools/_font-url.scss +22 -6
  581. data/node_modules/govuk-frontend/dist/govuk/tools/_if.import.scss +2 -0
  582. data/node_modules/govuk-frontend/dist/govuk/tools/_if.scss +23 -0
  583. data/node_modules/govuk-frontend/dist/govuk/tools/_image-url.import.scss +31 -0
  584. data/node_modules/govuk-frontend/dist/govuk/tools/_image-url.scss +22 -6
  585. data/node_modules/govuk-frontend/dist/govuk/tools/_index.import.scss +2 -0
  586. data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss +6 -7
  587. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.import.scss +2 -0
  588. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss +9 -6
  589. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.import.scss +2 -0
  590. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss +6 -3
  591. data/node_modules/govuk-frontend/dist/govuk/utilities/_clearfix.import.scss +8 -0
  592. data/node_modules/govuk-frontend/dist/govuk/utilities/_clearfix.mixin.scss +10 -0
  593. data/node_modules/govuk-frontend/dist/govuk/utilities/_clearfix.scss +3 -6
  594. data/node_modules/govuk-frontend/dist/govuk/utilities/_index.import.scss +3 -0
  595. data/node_modules/govuk-frontend/dist/govuk/utilities/_index.scss +2 -3
  596. data/node_modules/govuk-frontend/dist/govuk/utilities/_visually-hidden.import.scss +8 -0
  597. data/node_modules/govuk-frontend/dist/govuk/utilities/_visually-hidden.mixin.scss +14 -0
  598. data/node_modules/govuk-frontend/dist/govuk/utilities/_visually-hidden.scss +2 -9
  599. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss +4 -3
  600. data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +5 -4
  601. data/node_modules/govuk-frontend/package.json +27 -22
  602. data/vendor/assets/assets/images/favicon.ico +0 -0
  603. data/vendor/assets/assets/images/favicon.svg +1 -1
  604. data/vendor/assets/assets/images/govuk-icon-180.png +0 -0
  605. data/vendor/assets/assets/images/govuk-icon-192.png +0 -0
  606. data/vendor/assets/assets/images/govuk-icon-512.png +0 -0
  607. data/vendor/assets/assets/images/govuk-opengraph-image.png +0 -0
  608. data/vendor/assets/assets/manifest.json.erb +39 -0
  609. data/vendor/assets/images/favicon.ico +0 -0
  610. data/vendor/assets/images/favicon.svg +1 -1
  611. data/vendor/assets/images/govuk-icon-180.png +0 -0
  612. data/vendor/assets/images/govuk-icon-192.png +0 -0
  613. data/vendor/assets/images/govuk-icon-512.png +0 -0
  614. data/vendor/assets/images/govuk-opengraph-image.png +0 -0
  615. data/vendor/assets/javascripts/defra_ruby_template.js +214 -325
  616. data/vendor/assets/javascripts/defra_ruby_template_supported.js +4 -0
  617. data/vendor/assets/stylesheets/_base.import.scss +6 -0
  618. data/vendor/assets/stylesheets/_base.scss +4 -4
  619. data/vendor/assets/stylesheets/components/_index.import.scss +38 -0
  620. data/vendor/assets/stylesheets/components/_index.scss +37 -39
  621. data/vendor/assets/stylesheets/components/accordion/_accordion.import.scss +6 -0
  622. data/vendor/assets/stylesheets/components/accordion/_index.import.scss +8 -0
  623. data/vendor/assets/stylesheets/components/accordion/_index.scss +3 -368
  624. data/vendor/assets/stylesheets/components/accordion/_mixin.scss +375 -0
  625. data/vendor/assets/stylesheets/components/back-link/_back-link.import.scss +6 -0
  626. data/vendor/assets/stylesheets/components/back-link/_index.import.scss +8 -0
  627. data/vendor/assets/stylesheets/components/back-link/_index.scss +3 -81
  628. data/vendor/assets/stylesheets/components/back-link/_mixin.scss +87 -0
  629. data/vendor/assets/stylesheets/components/breadcrumbs/_breadcrumbs.import.scss +6 -0
  630. data/vendor/assets/stylesheets/components/breadcrumbs/_index.import.scss +8 -0
  631. data/vendor/assets/stylesheets/components/breadcrumbs/_index.scss +3 -132
  632. data/vendor/assets/stylesheets/components/breadcrumbs/_mixin.scss +134 -0
  633. data/vendor/assets/stylesheets/components/button/_button.import.scss +6 -0
  634. data/vendor/assets/stylesheets/components/button/_index.import.scss +13 -0
  635. data/vendor/assets/stylesheets/components/button/_index.scss +9 -260
  636. data/vendor/assets/stylesheets/components/button/_mixin.scss +233 -0
  637. data/vendor/assets/stylesheets/components/button/_settings.import.scss +32 -0
  638. data/vendor/assets/stylesheets/components/button/_settings.scss +34 -0
  639. data/vendor/assets/stylesheets/components/character-count/_character-count.import.scss +6 -0
  640. data/vendor/assets/stylesheets/components/character-count/_index.import.scss +12 -0
  641. data/vendor/assets/stylesheets/components/character-count/_index.scss +7 -42
  642. data/vendor/assets/stylesheets/components/character-count/_mixin.scss +41 -0
  643. data/vendor/assets/stylesheets/components/checkboxes/_checkboxes.import.scss +6 -0
  644. data/vendor/assets/stylesheets/components/checkboxes/_index.import.scss +12 -0
  645. data/vendor/assets/stylesheets/components/checkboxes/_index.scss +7 -309
  646. data/vendor/assets/stylesheets/components/checkboxes/_mixin.scss +317 -0
  647. data/vendor/assets/stylesheets/components/cookie-banner/_cookie-banner.import.scss +6 -0
  648. data/vendor/assets/stylesheets/components/cookie-banner/_index.import.scss +9 -0
  649. data/vendor/assets/stylesheets/components/cookie-banner/_index.scss +4 -56
  650. data/vendor/assets/stylesheets/components/cookie-banner/_mixin.scss +56 -0
  651. data/vendor/assets/stylesheets/components/date-input/_date-input.import.scss +6 -0
  652. data/vendor/assets/stylesheets/components/date-input/_index.import.scss +13 -0
  653. data/vendor/assets/stylesheets/components/date-input/_index.scss +8 -26
  654. data/vendor/assets/stylesheets/components/date-input/_mixin.scss +29 -0
  655. data/vendor/assets/stylesheets/components/details/_details.import.scss +6 -0
  656. data/vendor/assets/stylesheets/components/details/_index.import.scss +8 -0
  657. data/vendor/assets/stylesheets/components/details/_index.scss +3 -137
  658. data/vendor/assets/stylesheets/components/details/_mixin.scss +143 -0
  659. data/vendor/assets/stylesheets/components/error-message/_error-message.import.scss +6 -0
  660. data/vendor/assets/stylesheets/components/error-message/_index.import.scss +8 -0
  661. data/vendor/assets/stylesheets/components/error-message/_index.scss +3 -12
  662. data/vendor/assets/stylesheets/components/error-message/_mixin.scss +16 -0
  663. data/vendor/assets/stylesheets/components/error-summary/_error-summary.import.scss +6 -0
  664. data/vendor/assets/stylesheets/components/error-summary/_index.import.scss +8 -0
  665. data/vendor/assets/stylesheets/components/error-summary/_index.scss +3 -53
  666. data/vendor/assets/stylesheets/components/error-summary/_mixin.scss +58 -0
  667. data/vendor/assets/stylesheets/components/exit-this-page/_exit-this-page.import.scss +6 -0
  668. data/vendor/assets/stylesheets/components/exit-this-page/_index.import.scss +9 -0
  669. data/vendor/assets/stylesheets/components/exit-this-page/_index.scss +4 -89
  670. data/vendor/assets/stylesheets/components/exit-this-page/_mixin.scss +96 -0
  671. data/vendor/assets/stylesheets/components/fieldset/_fieldset.import.scss +6 -0
  672. data/vendor/assets/stylesheets/components/fieldset/_index.import.scss +8 -0
  673. data/vendor/assets/stylesheets/components/fieldset/_index.scss +3 -67
  674. data/vendor/assets/stylesheets/components/fieldset/_mixin.scss +71 -0
  675. data/vendor/assets/stylesheets/components/file-upload/_file-upload.import.scss +6 -0
  676. data/vendor/assets/stylesheets/components/file-upload/_index.import.scss +11 -0
  677. data/vendor/assets/stylesheets/components/file-upload/_index.scss +6 -216
  678. data/vendor/assets/stylesheets/components/file-upload/_mixin.scss +217 -0
  679. data/vendor/assets/stylesheets/components/footer/_footer.import.scss +6 -0
  680. data/vendor/assets/stylesheets/components/footer/_index.import.scss +8 -0
  681. data/vendor/assets/stylesheets/components/footer/_index.scss +3 -192
  682. data/vendor/assets/stylesheets/components/footer/_mixin.scss +199 -0
  683. data/vendor/assets/stylesheets/components/generic-header/_generic-header.import.scss +6 -0
  684. data/vendor/assets/stylesheets/components/generic-header/_index.import.scss +8 -0
  685. data/vendor/assets/stylesheets/components/generic-header/_index.scss +5 -0
  686. data/vendor/assets/stylesheets/components/generic-header/_mixin.scss +140 -0
  687. data/vendor/assets/stylesheets/components/header/_header.import.scss +6 -0
  688. data/vendor/assets/stylesheets/components/header/_index.import.scss +8 -0
  689. data/vendor/assets/stylesheets/components/header/_index.scss +3 -546
  690. data/vendor/assets/stylesheets/components/header/_mixin.scss +119 -0
  691. data/vendor/assets/stylesheets/components/hint/_hint.import.scss +6 -0
  692. data/vendor/assets/stylesheets/components/hint/_index.import.scss +8 -0
  693. data/vendor/assets/stylesheets/components/hint/_index.scss +3 -43
  694. data/vendor/assets/stylesheets/components/hint/_mixin.scss +47 -0
  695. data/vendor/assets/stylesheets/components/input/_index.import.scss +11 -0
  696. data/vendor/assets/stylesheets/components/input/_index.scss +6 -166
  697. data/vendor/assets/stylesheets/components/input/_input.import.scss +6 -0
  698. data/vendor/assets/stylesheets/components/input/_mixin.scss +161 -0
  699. data/vendor/assets/stylesheets/components/inset-text/_index.import.scss +8 -0
  700. data/vendor/assets/stylesheets/components/inset-text/_index.scss +3 -24
  701. data/vendor/assets/stylesheets/components/inset-text/_inset-text.import.scss +6 -0
  702. data/vendor/assets/stylesheets/components/inset-text/_mixin.scss +31 -0
  703. data/vendor/assets/stylesheets/components/label/_index.import.scss +8 -0
  704. data/vendor/assets/stylesheets/components/label/_index.scss +3 -44
  705. data/vendor/assets/stylesheets/components/label/_label.import.scss +6 -0
  706. data/vendor/assets/stylesheets/components/label/_mixin.scss +48 -0
  707. data/vendor/assets/stylesheets/components/notification-banner/_index.import.scss +8 -0
  708. data/vendor/assets/stylesheets/components/notification-banner/_index.scss +3 -91
  709. data/vendor/assets/stylesheets/components/notification-banner/_mixin.scss +100 -0
  710. data/vendor/assets/stylesheets/components/notification-banner/_notification-banner.import.scss +6 -0
  711. data/vendor/assets/stylesheets/components/pagination/_index.import.scss +8 -0
  712. data/vendor/assets/stylesheets/components/pagination/_index.scss +3 -226
  713. data/vendor/assets/stylesheets/components/pagination/_mixin.scss +235 -0
  714. data/vendor/assets/stylesheets/components/pagination/_pagination.import.scss +6 -0
  715. data/vendor/assets/stylesheets/components/panel/_index.import.scss +8 -0
  716. data/vendor/assets/stylesheets/components/panel/_index.scss +3 -56
  717. data/vendor/assets/stylesheets/components/panel/_mixin.scss +94 -0
  718. data/vendor/assets/stylesheets/components/panel/_panel.import.scss +6 -0
  719. data/vendor/assets/stylesheets/components/password-input/_index.import.scss +10 -0
  720. data/vendor/assets/stylesheets/components/password-input/_index.scss +5 -54
  721. data/vendor/assets/stylesheets/components/password-input/_mixin.scss +56 -0
  722. data/vendor/assets/stylesheets/components/password-input/_password-input.import.scss +6 -0
  723. data/vendor/assets/stylesheets/components/phase-banner/_index.import.scss +9 -0
  724. data/vendor/assets/stylesheets/components/phase-banner/_index.scss +4 -33
  725. data/vendor/assets/stylesheets/components/phase-banner/_mixin.scss +42 -0
  726. data/vendor/assets/stylesheets/components/phase-banner/_phase-banner.import.scss +6 -0
  727. data/vendor/assets/stylesheets/components/radios/_index.import.scss +12 -0
  728. data/vendor/assets/stylesheets/components/radios/_index.scss +7 -325
  729. data/vendor/assets/stylesheets/components/radios/_mixin.scss +336 -0
  730. data/vendor/assets/stylesheets/components/radios/_radios.import.scss +6 -0
  731. data/vendor/assets/stylesheets/components/select/_index.import.scss +11 -0
  732. data/vendor/assets/stylesheets/components/select/_index.scss +6 -56
  733. data/vendor/assets/stylesheets/components/select/_mixin.scss +45 -0
  734. data/vendor/assets/stylesheets/components/select/_select.import.scss +6 -0
  735. data/vendor/assets/stylesheets/components/service-navigation/_index.import.scss +8 -0
  736. data/vendor/assets/stylesheets/components/service-navigation/_index.scss +3 -185
  737. data/vendor/assets/stylesheets/components/service-navigation/_mixin.scss +238 -0
  738. data/vendor/assets/stylesheets/components/service-navigation/_service-navigation.import.scss +6 -0
  739. data/vendor/assets/stylesheets/components/skip-link/_index.import.scss +8 -0
  740. data/vendor/assets/stylesheets/components/skip-link/_index.scss +3 -50
  741. data/vendor/assets/stylesheets/components/skip-link/_mixin.scss +60 -0
  742. data/vendor/assets/stylesheets/components/skip-link/_skip-link.import.scss +6 -0
  743. data/vendor/assets/stylesheets/components/summary-list/_index.import.scss +8 -0
  744. data/vendor/assets/stylesheets/components/summary-list/_index.scss +3 -267
  745. data/vendor/assets/stylesheets/components/summary-list/_mixin.scss +286 -0
  746. data/vendor/assets/stylesheets/components/summary-list/_summary-list.import.scss +6 -0
  747. data/vendor/assets/stylesheets/components/table/_index.import.scss +8 -0
  748. data/vendor/assets/stylesheets/components/table/_index.scss +3 -73
  749. data/vendor/assets/stylesheets/components/table/_mixin.scss +77 -0
  750. data/vendor/assets/stylesheets/components/table/_table.import.scss +6 -0
  751. data/vendor/assets/stylesheets/components/tabs/_index.import.scss +8 -0
  752. data/vendor/assets/stylesheets/components/tabs/_index.scss +3 -132
  753. data/vendor/assets/stylesheets/components/tabs/_mixin.scss +140 -0
  754. data/vendor/assets/stylesheets/components/tabs/_tabs.import.scss +6 -0
  755. data/vendor/assets/stylesheets/components/tag/_index.import.scss +8 -0
  756. data/vendor/assets/stylesheets/components/tag/_index.scss +3 -94
  757. data/vendor/assets/stylesheets/components/tag/_mixin.scss +135 -0
  758. data/vendor/assets/stylesheets/components/tag/_tag.import.scss +6 -0
  759. data/vendor/assets/stylesheets/components/task-list/_index.import.scss +9 -0
  760. data/vendor/assets/stylesheets/components/task-list/_index.scss +4 -76
  761. data/vendor/assets/stylesheets/components/task-list/_mixin.scss +83 -0
  762. data/vendor/assets/stylesheets/components/task-list/_task-list.import.scss +6 -0
  763. data/vendor/assets/stylesheets/components/textarea/_index.import.scss +11 -0
  764. data/vendor/assets/stylesheets/components/textarea/_index.scss +6 -47
  765. data/vendor/assets/stylesheets/components/textarea/_mixin.scss +43 -0
  766. data/vendor/assets/stylesheets/components/textarea/_textarea.import.scss +6 -0
  767. data/vendor/assets/stylesheets/components/warning-text/_index.import.scss +8 -0
  768. data/vendor/assets/stylesheets/components/warning-text/_index.scss +3 -64
  769. data/vendor/assets/stylesheets/components/warning-text/_mixin.scss +69 -0
  770. data/vendor/assets/stylesheets/components/warning-text/_warning-text.import.scss +6 -0
  771. data/vendor/assets/stylesheets/core/_global-styles.import.scss +10 -0
  772. data/vendor/assets/stylesheets/core/_global-styles.mixin.scss +19 -0
  773. data/vendor/assets/stylesheets/core/_global-styles.scss +5 -18
  774. data/vendor/assets/stylesheets/core/_index.import.scss +6 -0
  775. data/vendor/assets/stylesheets/core/_index.scss +6 -7
  776. data/vendor/assets/stylesheets/core/_links.import.scss +10 -0
  777. data/vendor/assets/stylesheets/core/_links.mixin.scss +44 -0
  778. data/vendor/assets/stylesheets/core/_links.scss +3 -40
  779. data/vendor/assets/stylesheets/core/_lists.import.scss +14 -0
  780. data/vendor/assets/stylesheets/core/_lists.mixin.scss +74 -0
  781. data/vendor/assets/stylesheets/core/_lists.scss +6 -64
  782. data/vendor/assets/stylesheets/core/_section-break.import.scss +8 -0
  783. data/vendor/assets/stylesheets/core/_section-break.mixin.scss +54 -0
  784. data/vendor/assets/stylesheets/core/_section-break.scss +3 -49
  785. data/vendor/assets/stylesheets/core/_typography.import.scss +8 -0
  786. data/vendor/assets/stylesheets/core/_typography.mixin.scss +173 -0
  787. data/vendor/assets/stylesheets/core/_typography.scss +3 -187
  788. data/vendor/assets/stylesheets/custom-properties/_breakpoints.import.scss +8 -0
  789. data/vendor/assets/stylesheets/custom-properties/_breakpoints.mixin.scss +15 -0
  790. data/vendor/assets/stylesheets/custom-properties/_breakpoints.scss +4 -0
  791. data/vendor/assets/stylesheets/custom-properties/_frontend-version.import.scss +8 -0
  792. data/vendor/assets/stylesheets/custom-properties/_frontend-version.mixin.scss +13 -0
  793. data/vendor/assets/stylesheets/custom-properties/_frontend-version.scss +4 -0
  794. data/vendor/assets/stylesheets/custom-properties/_functional-colours.import.scss +8 -0
  795. data/vendor/assets/stylesheets/custom-properties/_functional-colours.mixin.scss +21 -0
  796. data/vendor/assets/stylesheets/custom-properties/_functional-colours.scss +4 -0
  797. data/vendor/assets/stylesheets/custom-properties/_index.import.scss +4 -0
  798. data/vendor/assets/stylesheets/custom-properties/_index.scss +4 -0
  799. data/vendor/assets/stylesheets/defra_ruby_template.scss +29 -10
  800. data/vendor/assets/stylesheets/govuk-frontend.min.css +2 -2
  801. data/vendor/assets/stylesheets/helpers/_clearfix.import.scss +2 -0
  802. data/vendor/assets/stylesheets/helpers/_clearfix.scss +0 -1
  803. data/vendor/assets/stylesheets/helpers/_colour.import.scss +2 -0
  804. data/vendor/assets/stylesheets/helpers/_colour.scss +190 -89
  805. data/vendor/assets/stylesheets/helpers/_device-pixels.import.scss +2 -0
  806. data/vendor/assets/stylesheets/helpers/_device-pixels.scss +2 -1
  807. data/vendor/assets/stylesheets/helpers/_focused.import.scss +2 -0
  808. data/vendor/assets/stylesheets/helpers/_focused.scss +44 -7
  809. data/vendor/assets/stylesheets/helpers/_font-faces--internal.scss +41 -0
  810. data/vendor/assets/stylesheets/helpers/_grid.import.scss +2 -0
  811. data/vendor/assets/stylesheets/helpers/_grid.scss +7 -4
  812. data/vendor/assets/stylesheets/helpers/_index.import.scss +2 -0
  813. data/vendor/assets/stylesheets/helpers/_index.scss +12 -13
  814. data/vendor/assets/stylesheets/helpers/_links.import.scss +2 -0
  815. data/vendor/assets/stylesheets/helpers/_links.scss +35 -46
  816. data/vendor/assets/stylesheets/helpers/_media-queries.import.scss +2 -0
  817. data/vendor/assets/stylesheets/helpers/_media-queries.scss +174 -34
  818. data/vendor/assets/stylesheets/helpers/_shape-arrow.import.scss +2 -0
  819. data/vendor/assets/stylesheets/helpers/_shape-arrow.scss +2 -3
  820. data/vendor/assets/stylesheets/helpers/_spacing--internal.scss +80 -0
  821. data/vendor/assets/stylesheets/helpers/_spacing.import.scss +2 -0
  822. data/vendor/assets/stylesheets/helpers/_spacing.scss +27 -82
  823. data/vendor/assets/stylesheets/helpers/_typography--internal.scss +24 -0
  824. data/vendor/assets/stylesheets/helpers/_typography.import.scss +2 -0
  825. data/vendor/assets/stylesheets/helpers/_typography.scss +55 -74
  826. data/vendor/assets/stylesheets/helpers/_visually-hidden.import.scss +2 -0
  827. data/vendor/assets/stylesheets/helpers/_visually-hidden.scss +17 -13
  828. data/vendor/assets/stylesheets/helpers/_width-container.import.scss +2 -0
  829. data/vendor/assets/stylesheets/helpers/_width-container.scss +73 -0
  830. data/vendor/assets/stylesheets/index.import.scss +10 -0
  831. data/vendor/assets/stylesheets/index.scss +6 -7
  832. data/vendor/assets/stylesheets/objects/_button-group.import.scss +8 -0
  833. data/vendor/assets/stylesheets/objects/_button-group.mixin.scss +80 -0
  834. data/vendor/assets/stylesheets/objects/_button-group.scss +3 -78
  835. data/vendor/assets/stylesheets/objects/_form-group.import.scss +8 -0
  836. data/vendor/assets/stylesheets/objects/_form-group.mixin.scss +26 -0
  837. data/vendor/assets/stylesheets/objects/_form-group.scss +3 -23
  838. data/vendor/assets/stylesheets/objects/_grid.import.scss +8 -0
  839. data/vendor/assets/stylesheets/objects/_grid.mixin.scss +28 -0
  840. data/vendor/assets/stylesheets/objects/_grid.scss +3 -24
  841. data/vendor/assets/stylesheets/objects/_index.import.scss +7 -0
  842. data/vendor/assets/stylesheets/objects/_index.scss +6 -7
  843. data/vendor/assets/stylesheets/objects/_main-wrapper.import.scss +8 -0
  844. data/vendor/assets/stylesheets/objects/_main-wrapper.mixin.scss +55 -0
  845. data/vendor/assets/stylesheets/objects/_main-wrapper.scss +3 -53
  846. data/vendor/assets/stylesheets/objects/_template.import.scss +8 -0
  847. data/vendor/assets/stylesheets/objects/_template.mixin.scss +53 -0
  848. data/vendor/assets/stylesheets/objects/_template.scss +3 -55
  849. data/vendor/assets/stylesheets/objects/_width-container.import.scss +8 -0
  850. data/vendor/assets/stylesheets/objects/_width-container.mixin.scss +9 -0
  851. data/vendor/assets/stylesheets/objects/_width-container.scss +3 -75
  852. data/vendor/assets/stylesheets/overrides/_display.import.scss +8 -0
  853. data/vendor/assets/stylesheets/overrides/_display.mixin.scss +26 -0
  854. data/vendor/assets/stylesheets/overrides/_display.scss +2 -24
  855. data/vendor/assets/stylesheets/overrides/_index.import.scss +6 -0
  856. data/vendor/assets/stylesheets/overrides/_index.scss +5 -6
  857. data/vendor/assets/stylesheets/overrides/_spacing.import.scss +8 -0
  858. data/vendor/assets/stylesheets/overrides/_spacing.mixin.scss +89 -0
  859. data/vendor/assets/stylesheets/overrides/_spacing.scss +2 -84
  860. data/vendor/assets/stylesheets/overrides/_text-align.import.scss +8 -0
  861. data/vendor/assets/stylesheets/overrides/_text-align.mixin.scss +16 -0
  862. data/vendor/assets/stylesheets/overrides/_text-align.scss +2 -14
  863. data/vendor/assets/stylesheets/overrides/_typography.import.scss +8 -0
  864. data/vendor/assets/stylesheets/overrides/_typography.mixin.scss +43 -0
  865. data/vendor/assets/stylesheets/overrides/_typography.scss +2 -40
  866. data/vendor/assets/stylesheets/overrides/_width.import.scss +8 -0
  867. data/vendor/assets/stylesheets/overrides/_width.mixin.scss +50 -0
  868. data/vendor/assets/stylesheets/overrides/_width.scss +2 -46
  869. data/vendor/assets/stylesheets/settings/_assets.import.scss +13 -0
  870. data/vendor/assets/stylesheets/settings/_assets.scss +50 -21
  871. data/vendor/assets/stylesheets/settings/_colours-applied.import.scss +13 -0
  872. data/vendor/assets/stylesheets/settings/_colours-functional.import.scss +2 -0
  873. data/vendor/assets/stylesheets/settings/_colours-functional.scss +168 -0
  874. data/vendor/assets/stylesheets/settings/_colours-legacy-functional.import.scss +2 -0
  875. data/vendor/assets/stylesheets/settings/_colours-legacy-functional.scss +188 -0
  876. data/vendor/assets/stylesheets/settings/_colours-organisations.import.scss +2 -0
  877. data/vendor/assets/stylesheets/settings/_colours-organisations.scss +9 -274
  878. data/vendor/assets/stylesheets/settings/_colours-palette--internal.scss +128 -0
  879. data/vendor/assets/stylesheets/settings/_custom-properties.import.scss +2 -0
  880. data/vendor/assets/stylesheets/settings/_custom-properties.scss +17 -0
  881. data/vendor/assets/stylesheets/settings/_global-styles.import.scss +2 -0
  882. data/vendor/assets/stylesheets/settings/_global-styles.scss +0 -1
  883. data/vendor/assets/stylesheets/settings/_index.import.scss +24 -0
  884. data/vendor/assets/stylesheets/settings/_index.scss +14 -13
  885. data/vendor/assets/stylesheets/settings/_links.import.scss +2 -0
  886. data/vendor/assets/stylesheets/settings/_links.scss +3 -3
  887. data/vendor/assets/stylesheets/settings/_measurements.import.scss +2 -0
  888. data/vendor/assets/stylesheets/settings/_measurements.scss +8 -17
  889. data/vendor/assets/stylesheets/settings/_media-queries.import.scss +2 -0
  890. data/vendor/assets/stylesheets/settings/_media-queries.scss +0 -10
  891. data/vendor/assets/stylesheets/settings/_spacing.import.scss +2 -0
  892. data/vendor/assets/stylesheets/settings/_spacing.scss +0 -1
  893. data/vendor/assets/stylesheets/settings/_typography-font.import.scss +2 -0
  894. data/vendor/assets/stylesheets/settings/_typography-font.scss +3 -2
  895. data/vendor/assets/stylesheets/settings/_typography-responsive.import.scss +2 -0
  896. data/vendor/assets/stylesheets/settings/_typography-responsive.scss +12 -190
  897. data/vendor/assets/stylesheets/settings/_warnings--internal.scss +69 -0
  898. data/vendor/assets/stylesheets/settings/_warnings.import.scss +2 -0
  899. data/vendor/assets/stylesheets/settings/_warnings.scss +9 -56
  900. data/vendor/assets/stylesheets/tools/_exports.import.scss +2 -0
  901. data/vendor/assets/stylesheets/tools/_exports.scss +12 -6
  902. data/vendor/assets/stylesheets/tools/_font-url.import.scss +31 -0
  903. data/vendor/assets/stylesheets/tools/_font-url.scss +22 -6
  904. data/vendor/assets/stylesheets/tools/_if.import.scss +2 -0
  905. data/vendor/assets/stylesheets/tools/_if.scss +23 -0
  906. data/vendor/assets/stylesheets/tools/_image-url.import.scss +31 -0
  907. data/vendor/assets/stylesheets/tools/_image-url.scss +22 -6
  908. data/vendor/assets/stylesheets/tools/_index.import.scss +2 -0
  909. data/vendor/assets/stylesheets/tools/_index.scss +6 -7
  910. data/vendor/assets/stylesheets/tools/_px-to-em.import.scss +2 -0
  911. data/vendor/assets/stylesheets/tools/_px-to-em.scss +9 -6
  912. data/vendor/assets/stylesheets/tools/_px-to-rem.import.scss +2 -0
  913. data/vendor/assets/stylesheets/tools/_px-to-rem.scss +6 -3
  914. data/vendor/assets/stylesheets/utilities/_clearfix.import.scss +8 -0
  915. data/vendor/assets/stylesheets/utilities/_clearfix.mixin.scss +10 -0
  916. data/vendor/assets/stylesheets/utilities/_clearfix.scss +3 -6
  917. data/vendor/assets/stylesheets/utilities/_index.import.scss +3 -0
  918. data/vendor/assets/stylesheets/utilities/_index.scss +2 -3
  919. data/vendor/assets/stylesheets/utilities/_visually-hidden.import.scss +8 -0
  920. data/vendor/assets/stylesheets/utilities/_visually-hidden.mixin.scss +14 -0
  921. data/vendor/assets/stylesheets/utilities/_visually-hidden.scss +2 -9
  922. metadata +490 -408
  923. data/node_modules/govuk-frontend/dist/govuk/_base.scss.map +0 -1
  924. data/node_modules/govuk-frontend/dist/govuk/all.scss +0 -9
  925. data/node_modules/govuk-frontend/dist/govuk/all.scss.map +0 -1
  926. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.ico +0 -0
  927. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.svg +0 -1
  928. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-crest.svg +0 -1
  929. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-180.png +0 -0
  930. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-192.png +0 -0
  931. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-512.png +0 -0
  932. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-mask.svg +0 -1
  933. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-opengraph-image.png +0 -0
  934. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/manifest.json +0 -39
  935. data/node_modules/govuk-frontend/dist/govuk/components/_all.scss +0 -10
  936. data/node_modules/govuk-frontend/dist/govuk/components/_all.scss.map +0 -1
  937. data/node_modules/govuk-frontend/dist/govuk/components/_index.scss.map +0 -1
  938. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_accordion.scss +0 -4
  939. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_accordion.scss.map +0 -1
  940. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss.map +0 -1
  941. data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-with-focusable-elements-inside.html +0 -26
  942. data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-with-one-section-open.html +0 -30
  943. data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-with-translations.html +0 -30
  944. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_back-link.scss +0 -4
  945. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_back-link.scss.map +0 -1
  946. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss.map +0 -1
  947. data/node_modules/govuk-frontend/dist/govuk/components/back-link/template-with-custom-link.html +0 -1
  948. data/node_modules/govuk-frontend/dist/govuk/components/back-link/template-with-custom-text.html +0 -1
  949. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_breadcrumbs.scss +0 -4
  950. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_breadcrumbs.scss.map +0 -1
  951. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss.map +0 -1
  952. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-with-multiple-levels.html +0 -16
  953. data/node_modules/govuk-frontend/dist/govuk/components/button/_button.scss +0 -4
  954. data/node_modules/govuk-frontend/dist/govuk/components/button/_button.scss.map +0 -1
  955. data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss.map +0 -1
  956. data/node_modules/govuk-frontend/dist/govuk/components/button/template-input-disabled.html +0 -1
  957. data/node_modules/govuk-frontend/dist/govuk/components/button/template-input.html +0 -1
  958. data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-link.html +0 -3
  959. data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-start.html +0 -6
  960. data/node_modules/govuk-frontend/dist/govuk/components/button/template-prevent-double-click.html +0 -3
  961. data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary-link.html +0 -3
  962. data/node_modules/govuk-frontend/dist/govuk/components/button/template-start-link.html +0 -6
  963. data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning-link.html +0 -3
  964. data/node_modules/govuk-frontend/dist/govuk/components/button/template-with-active-state.html +0 -3
  965. data/node_modules/govuk-frontend/dist/govuk/components/button/template-with-focus-state.html +0 -3
  966. data/node_modules/govuk-frontend/dist/govuk/components/button/template-with-hover-state.html +0 -3
  967. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_character-count.scss +0 -4
  968. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_character-count.scss.map +0 -1
  969. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss.map +0 -1
  970. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-custom-textarea-description.html +0 -9
  971. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-error.html +0 -12
  972. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-translations.html +0 -9
  973. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_checkboxes.scss +0 -4
  974. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_checkboxes.scss.map +0 -1
  975. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss.map +0 -1
  976. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-disabled.html +0 -27
  977. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-a-medium-legend.html +0 -33
  978. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-conditional-item-checked.html +0 -39
  979. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-conditional-items-with-special-characters.html +0 -39
  980. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-disabled-item.html +0 -29
  981. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-error-message-and-hints-on-items.html +0 -39
  982. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-fieldset-and-error-message.html +0 -30
  983. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-id-and-name.html +0 -30
  984. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-single-option-and-hint-set-aria-describedby-on-input.html +0 -16
  985. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-single-option-set-aria-describedby-on-input.html +0 -13
  986. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-without-fieldset.html +0 -22
  987. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_cookie-banner.scss +0 -4
  988. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_cookie-banner.scss.map +0 -1
  989. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss.map +0 -1
  990. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-client-side-implementation.html +0 -60
  991. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_date-input.scss +0 -4
  992. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_date-input.scss.map +0 -1
  993. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss.map +0 -1
  994. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-autocomplete-values.html +0 -36
  995. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-default-items.html +0 -36
  996. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-and-hint.html +0 -39
  997. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-input-attributes.html +0 -36
  998. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-optional-form-group-classes.html +0 -36
  999. data/node_modules/govuk-frontend/dist/govuk/components/details/_details.scss +0 -4
  1000. data/node_modules/govuk-frontend/dist/govuk/components/details/_details.scss.map +0 -1
  1001. data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss.map +0 -1
  1002. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_error-message.scss +0 -4
  1003. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_error-message.scss.map +0 -1
  1004. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss.map +0 -1
  1005. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_error-summary.scss +0 -4
  1006. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_error-summary.scss.map +0 -1
  1007. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss.map +0 -1
  1008. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_exit-this-page.scss +0 -4
  1009. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_exit-this-page.scss.map +0 -1
  1010. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss.map +0 -1
  1011. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/template-translated.html +0 -5
  1012. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_fieldset.scss +0 -4
  1013. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_fieldset.scss.map +0 -1
  1014. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.scss.map +0 -1
  1015. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_file-upload.scss +0 -4
  1016. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_file-upload.scss.map +0 -1
  1017. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss.map +0 -1
  1018. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-direct-media-capture.html +0 -6
  1019. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-image-files-only.html +0 -6
  1020. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-multiple-files.html +0 -6
  1021. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-disabled.html +0 -6
  1022. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-disabled.html +0 -13
  1023. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-optional-form-group-classes.html +0 -6
  1024. data/node_modules/govuk-frontend/dist/govuk/components/footer/_footer.scss +0 -4
  1025. data/node_modules/govuk-frontend/dist/govuk/components/footer/_footer.scss.map +0 -1
  1026. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss.map +0 -1
  1027. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-meta.html +0 -56
  1028. data/node_modules/govuk-frontend/dist/govuk/components/header/_header.scss +0 -4
  1029. data/node_modules/govuk-frontend/dist/govuk/components/header/_header.scss.map +0 -1
  1030. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +0 -1
  1031. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +0 -233
  1032. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js.map +0 -1
  1033. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +0 -225
  1034. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs.map +0 -1
  1035. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs +0 -89
  1036. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs.map +0 -1
  1037. data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width-with-navigation.html +0 -55
  1038. data/node_modules/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-html.html +0 -57
  1039. data/node_modules/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-text-without-link.html +0 -51
  1040. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-label.html +0 -59
  1041. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-text.html +0 -59
  1042. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-navigation-label.html +0 -59
  1043. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-full-width-border.html +0 -30
  1044. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-large-navigation.html +0 -119
  1045. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-navigation.html +0 -59
  1046. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name-and-navigation.html +0 -62
  1047. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name-but-no-service-url.html +0 -34
  1048. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name.html +0 -34
  1049. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-st-edwards-crown.html +0 -19
  1050. data/node_modules/govuk-frontend/dist/govuk/components/hint/_hint.scss +0 -4
  1051. data/node_modules/govuk-frontend/dist/govuk/components/hint/_hint.scss.map +0 -1
  1052. data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss.map +0 -1
  1053. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss.map +0 -1
  1054. data/node_modules/govuk-frontend/dist/govuk/components/input/_input.scss +0 -4
  1055. data/node_modules/govuk-frontend/dist/govuk/components/input/_input.scss.map +0 -1
  1056. data/node_modules/govuk-frontend/dist/govuk/components/input/template-disabled.html +0 -6
  1057. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-autocapitalize-turned-off.html +0 -6
  1058. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-autocomplete-attribute.html +0 -6
  1059. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-optional-form-group-classes.html +0 -6
  1060. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-pattern-attribute.html +0 -6
  1061. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-prefix-and-long-suffix.html +0 -10
  1062. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-spellcheck-disabled.html +0 -6
  1063. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-spellcheck-enabled.html +0 -6
  1064. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss.map +0 -1
  1065. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_inset-text.scss +0 -4
  1066. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_inset-text.scss.map +0 -1
  1067. data/node_modules/govuk-frontend/dist/govuk/components/label/_index.scss.map +0 -1
  1068. data/node_modules/govuk-frontend/dist/govuk/components/label/_label.scss +0 -4
  1069. data/node_modules/govuk-frontend/dist/govuk/components/label/_label.scss.map +0 -1
  1070. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss.map +0 -1
  1071. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_notification-banner.scss +0 -4
  1072. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_notification-banner.scss.map +0 -1
  1073. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-auto-focus-disabled-with-type-as-success.html +0 -12
  1074. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-auto-focus-explicitly-enabled-with-type-as-success.html +0 -12
  1075. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-custom-tabindex.html +0 -12
  1076. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-paragraph-as-html-heading.html +0 -10
  1077. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-rolealert-overridden-to-roleregion-with-type-as-success.html +0 -12
  1078. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-success-with-custom-html.html +0 -16
  1079. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-a-list.html +0 -16
  1080. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss.map +0 -1
  1081. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_pagination.scss +0 -4
  1082. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_pagination.scss.map +0 -1
  1083. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-custom-accessible-labels-on-item-links.html +0 -39
  1084. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-custom-navigation-landmark.html +0 -39
  1085. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-in-a-different-language.html +0 -22
  1086. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss.map +0 -1
  1087. data/node_modules/govuk-frontend/dist/govuk/components/panel/_panel.scss +0 -4
  1088. data/node_modules/govuk-frontend/dist/govuk/components/panel/_panel.scss.map +0 -1
  1089. data/node_modules/govuk-frontend/dist/govuk/components/panel/template-custom-heading-level.html +0 -8
  1090. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss.map +0 -1
  1091. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_password-input.scss +0 -4
  1092. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_password-input.scss.map +0 -1
  1093. data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-new-password-autocomplete.html +0 -11
  1094. data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-translations.html +0 -11
  1095. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss.map +0 -1
  1096. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_phase-banner.scss +0 -4
  1097. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_phase-banner.scss.map +0 -1
  1098. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss.map +0 -1
  1099. data/node_modules/govuk-frontend/dist/govuk/components/radios/_radios.scss +0 -4
  1100. data/node_modules/govuk-frontend/dist/govuk/components/radios/_radios.scss.map +0 -1
  1101. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-prechecked-using-value.html +0 -16
  1102. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-prechecked.html +0 -19
  1103. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-inline-extreme.html +0 -69
  1104. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-disabled.html +0 -27
  1105. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-a-medium-legend.html +0 -24
  1106. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items-with-special-characters.html +0 -39
  1107. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-disabled.html +0 -29
  1108. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-idprefix.html +0 -16
  1109. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss.map +0 -1
  1110. data/node_modules/govuk-frontend/dist/govuk/components/select/_select.scss +0 -4
  1111. data/node_modules/govuk-frontend/dist/govuk/components/select/_select.scss.map +0 -1
  1112. data/node_modules/govuk-frontend/dist/govuk/components/select/template-id.html +0 -7
  1113. data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-no-items.html +0 -7
  1114. data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-optional-form-group-classes.html +0 -10
  1115. data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-selected-value.html +0 -10
  1116. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss.map +0 -1
  1117. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.scss +0 -4
  1118. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.scss.map +0 -1
  1119. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-navigation-with-an-active-item.html +0 -58
  1120. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss.map +0 -1
  1121. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_skip-link.scss +0 -4
  1122. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_skip-link.scss.map +0 -1
  1123. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss.map +0 -1
  1124. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_summary-list.scss +0 -4
  1125. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_summary-list.scss.map +0 -1
  1126. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-a-custom-header-level.html +0 -28
  1127. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-check-your-answers.html +0 -98
  1128. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-overridden-widths.html +0 -58
  1129. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-translated.html +0 -51
  1130. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-with-no-first-action.html +0 -58
  1131. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-with-some-actions.html +0 -45
  1132. data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss.map +0 -1
  1133. data/node_modules/govuk-frontend/dist/govuk/components/table/_table.scss +0 -4
  1134. data/node_modules/govuk-frontend/dist/govuk/components/table/_table.scss.map +0 -1
  1135. data/node_modules/govuk-frontend/dist/govuk/components/table/template-with-small-text-modifier-for-tables-with-a-lot-of-data.html +0 -19
  1136. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss.map +0 -1
  1137. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_tabs.scss +0 -4
  1138. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_tabs.scss.map +0 -1
  1139. data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss.map +0 -1
  1140. data/node_modules/govuk-frontend/dist/govuk/components/tag/_tag.scss +0 -4
  1141. data/node_modules/govuk-frontend/dist/govuk/components/tag/_tag.scss.map +0 -1
  1142. data/node_modules/govuk-frontend/dist/govuk/components/tag/template-blue.html +0 -3
  1143. data/node_modules/govuk-frontend/dist/govuk/components/tag/template-light-blue.html +0 -3
  1144. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss.map +0 -1
  1145. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_task-list.scss +0 -4
  1146. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_task-list.scss.map +0 -1
  1147. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-example-with-3-states.html +0 -49
  1148. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-example-with-all-possible-colours.html +0 -143
  1149. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-example-with-hint-text-and-additional-states.html +0 -77
  1150. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss.map +0 -1
  1151. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_textarea.scss +0 -4
  1152. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_textarea.scss.map +0 -1
  1153. data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-autocomplete-attribute.html +0 -6
  1154. data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-optional-form-group-classes.html +0 -6
  1155. data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-spellcheck-disabled.html +0 -6
  1156. data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-spellcheck-enabled.html +0 -6
  1157. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss.map +0 -1
  1158. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_warning-text.scss +0 -4
  1159. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_warning-text.scss.map +0 -1
  1160. data/node_modules/govuk-frontend/dist/govuk/core/_all.scss +0 -10
  1161. data/node_modules/govuk-frontend/dist/govuk/core/_all.scss.map +0 -1
  1162. data/node_modules/govuk-frontend/dist/govuk/core/_global-styles.scss.map +0 -1
  1163. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +0 -12
  1164. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss.map +0 -1
  1165. data/node_modules/govuk-frontend/dist/govuk/core/_index.scss.map +0 -1
  1166. data/node_modules/govuk-frontend/dist/govuk/core/_links.scss.map +0 -1
  1167. data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss.map +0 -1
  1168. data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss.map +0 -1
  1169. data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss.map +0 -1
  1170. data/node_modules/govuk-frontend/dist/govuk/helpers/_all.scss +0 -10
  1171. data/node_modules/govuk-frontend/dist/govuk/helpers/_all.scss.map +0 -1
  1172. data/node_modules/govuk-frontend/dist/govuk/helpers/_clearfix.scss.map +0 -1
  1173. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss.map +0 -1
  1174. data/node_modules/govuk-frontend/dist/govuk/helpers/_device-pixels.scss.map +0 -1
  1175. data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss.map +0 -1
  1176. data/node_modules/govuk-frontend/dist/govuk/helpers/_font-faces.scss +0 -41
  1177. data/node_modules/govuk-frontend/dist/govuk/helpers/_font-faces.scss.map +0 -1
  1178. data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss.map +0 -1
  1179. data/node_modules/govuk-frontend/dist/govuk/helpers/_index.scss.map +0 -1
  1180. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss.map +0 -1
  1181. data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss.map +0 -1
  1182. data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.scss.map +0 -1
  1183. data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss.map +0 -1
  1184. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss.map +0 -1
  1185. data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss.map +0 -1
  1186. data/node_modules/govuk-frontend/dist/govuk/index.scss.map +0 -1
  1187. data/node_modules/govuk-frontend/dist/govuk/objects/_all.scss +0 -10
  1188. data/node_modules/govuk-frontend/dist/govuk/objects/_all.scss.map +0 -1
  1189. data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.scss.map +0 -1
  1190. data/node_modules/govuk-frontend/dist/govuk/objects/_form-group.scss.map +0 -1
  1191. data/node_modules/govuk-frontend/dist/govuk/objects/_grid.scss.map +0 -1
  1192. data/node_modules/govuk-frontend/dist/govuk/objects/_index.scss.map +0 -1
  1193. data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.scss.map +0 -1
  1194. data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss.map +0 -1
  1195. data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss.map +0 -1
  1196. data/node_modules/govuk-frontend/dist/govuk/overrides/_all.scss +0 -9
  1197. data/node_modules/govuk-frontend/dist/govuk/overrides/_all.scss.map +0 -1
  1198. data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss.map +0 -1
  1199. data/node_modules/govuk-frontend/dist/govuk/overrides/_index.scss.map +0 -1
  1200. data/node_modules/govuk-frontend/dist/govuk/overrides/_spacing.scss.map +0 -1
  1201. data/node_modules/govuk-frontend/dist/govuk/overrides/_text-align.scss.map +0 -1
  1202. data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss.map +0 -1
  1203. data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss.map +0 -1
  1204. data/node_modules/govuk-frontend/dist/govuk/settings/_all.scss +0 -10
  1205. data/node_modules/govuk-frontend/dist/govuk/settings/_all.scss.map +0 -1
  1206. data/node_modules/govuk-frontend/dist/govuk/settings/_assets.scss.map +0 -1
  1207. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss +0 -195
  1208. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss.map +0 -1
  1209. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss.map +0 -1
  1210. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-palette.scss +0 -37
  1211. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-palette.scss.map +0 -1
  1212. data/node_modules/govuk-frontend/dist/govuk/settings/_global-styles.scss.map +0 -1
  1213. data/node_modules/govuk-frontend/dist/govuk/settings/_index.scss.map +0 -1
  1214. data/node_modules/govuk-frontend/dist/govuk/settings/_links.scss.map +0 -1
  1215. data/node_modules/govuk-frontend/dist/govuk/settings/_measurements.scss.map +0 -1
  1216. data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss.map +0 -1
  1217. data/node_modules/govuk-frontend/dist/govuk/settings/_spacing.scss.map +0 -1
  1218. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-font.scss.map +0 -1
  1219. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss.map +0 -1
  1220. data/node_modules/govuk-frontend/dist/govuk/settings/_warnings.scss.map +0 -1
  1221. data/node_modules/govuk-frontend/dist/govuk/tools/_all.scss +0 -10
  1222. data/node_modules/govuk-frontend/dist/govuk/tools/_all.scss.map +0 -1
  1223. data/node_modules/govuk-frontend/dist/govuk/tools/_exports.scss.map +0 -1
  1224. data/node_modules/govuk-frontend/dist/govuk/tools/_font-url.scss.map +0 -1
  1225. data/node_modules/govuk-frontend/dist/govuk/tools/_image-url.scss.map +0 -1
  1226. data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss.map +0 -1
  1227. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss.map +0 -1
  1228. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss.map +0 -1
  1229. data/node_modules/govuk-frontend/dist/govuk/tools/_rebrand.scss +0 -65
  1230. data/node_modules/govuk-frontend/dist/govuk/tools/_rebrand.scss.map +0 -1
  1231. data/node_modules/govuk-frontend/dist/govuk/utilities/_all.scss +0 -10
  1232. data/node_modules/govuk-frontend/dist/govuk/utilities/_all.scss.map +0 -1
  1233. data/node_modules/govuk-frontend/dist/govuk/utilities/_clearfix.scss.map +0 -1
  1234. data/node_modules/govuk-frontend/dist/govuk/utilities/_index.scss.map +0 -1
  1235. data/node_modules/govuk-frontend/dist/govuk/utilities/_visually-hidden.scss.map +0 -1
  1236. data/node_modules/govuk-frontend/dist/govuk/vendor/_sass-mq.scss +0 -349
  1237. data/node_modules/govuk-frontend/dist/govuk/vendor/_sass-mq.scss.map +0 -1
  1238. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/functions.js +0 -25
  1239. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss.map +0 -1
  1240. data/spec/spec_helper.rb +0 -98
  1241. data/spec/tasks/assets_spec.rb +0 -53
  1242. data/vendor/assets/assets/manifest.json +0 -39
  1243. data/vendor/assets/assets/rebrand/images/favicon.ico +0 -0
  1244. data/vendor/assets/assets/rebrand/images/favicon.svg +0 -1
  1245. data/vendor/assets/assets/rebrand/images/govuk-crest.svg +0 -1
  1246. data/vendor/assets/assets/rebrand/images/govuk-icon-180.png +0 -0
  1247. data/vendor/assets/assets/rebrand/images/govuk-icon-192.png +0 -0
  1248. data/vendor/assets/assets/rebrand/images/govuk-icon-512.png +0 -0
  1249. data/vendor/assets/assets/rebrand/images/govuk-icon-mask.svg +0 -1
  1250. data/vendor/assets/assets/rebrand/images/govuk-opengraph-image.png +0 -0
  1251. data/vendor/assets/assets/rebrand/manifest.json +0 -39
  1252. data/vendor/assets/images/govuk-crest-2x.png +0 -0
  1253. data/vendor/assets/images/govuk-crest.png +0 -0
  1254. data/vendor/assets/stylesheets/all.scss +0 -9
  1255. data/vendor/assets/stylesheets/components/_all.scss +0 -10
  1256. data/vendor/assets/stylesheets/components/accordion/_accordion.scss +0 -4
  1257. data/vendor/assets/stylesheets/components/back-link/_back-link.scss +0 -4
  1258. data/vendor/assets/stylesheets/components/breadcrumbs/_breadcrumbs.scss +0 -4
  1259. data/vendor/assets/stylesheets/components/button/_button.scss +0 -4
  1260. data/vendor/assets/stylesheets/components/character-count/_character-count.scss +0 -4
  1261. data/vendor/assets/stylesheets/components/checkboxes/_checkboxes.scss +0 -4
  1262. data/vendor/assets/stylesheets/components/cookie-banner/_cookie-banner.scss +0 -4
  1263. data/vendor/assets/stylesheets/components/date-input/_date-input.scss +0 -4
  1264. data/vendor/assets/stylesheets/components/details/_details.scss +0 -4
  1265. data/vendor/assets/stylesheets/components/error-message/_error-message.scss +0 -4
  1266. data/vendor/assets/stylesheets/components/error-summary/_error-summary.scss +0 -4
  1267. data/vendor/assets/stylesheets/components/exit-this-page/_exit-this-page.scss +0 -4
  1268. data/vendor/assets/stylesheets/components/fieldset/_fieldset.scss +0 -4
  1269. data/vendor/assets/stylesheets/components/file-upload/_file-upload.scss +0 -4
  1270. data/vendor/assets/stylesheets/components/footer/_footer.scss +0 -4
  1271. data/vendor/assets/stylesheets/components/header/_header.scss +0 -4
  1272. data/vendor/assets/stylesheets/components/hint/_hint.scss +0 -4
  1273. data/vendor/assets/stylesheets/components/input/_input.scss +0 -4
  1274. data/vendor/assets/stylesheets/components/inset-text/_inset-text.scss +0 -4
  1275. data/vendor/assets/stylesheets/components/label/_label.scss +0 -4
  1276. data/vendor/assets/stylesheets/components/notification-banner/_notification-banner.scss +0 -4
  1277. data/vendor/assets/stylesheets/components/pagination/_pagination.scss +0 -4
  1278. data/vendor/assets/stylesheets/components/panel/_panel.scss +0 -4
  1279. data/vendor/assets/stylesheets/components/password-input/_password-input.scss +0 -4
  1280. data/vendor/assets/stylesheets/components/phase-banner/_phase-banner.scss +0 -4
  1281. data/vendor/assets/stylesheets/components/radios/_radios.scss +0 -4
  1282. data/vendor/assets/stylesheets/components/select/_select.scss +0 -4
  1283. data/vendor/assets/stylesheets/components/service-navigation/_service-navigation.scss +0 -4
  1284. data/vendor/assets/stylesheets/components/skip-link/_skip-link.scss +0 -4
  1285. data/vendor/assets/stylesheets/components/summary-list/_summary-list.scss +0 -4
  1286. data/vendor/assets/stylesheets/components/table/_table.scss +0 -4
  1287. data/vendor/assets/stylesheets/components/tabs/_tabs.scss +0 -4
  1288. data/vendor/assets/stylesheets/components/tag/_tag.scss +0 -4
  1289. data/vendor/assets/stylesheets/components/task-list/_task-list.scss +0 -4
  1290. data/vendor/assets/stylesheets/components/textarea/_textarea.scss +0 -4
  1291. data/vendor/assets/stylesheets/components/warning-text/_warning-text.scss +0 -4
  1292. data/vendor/assets/stylesheets/core/_all.scss +0 -10
  1293. data/vendor/assets/stylesheets/core/_govuk-frontend-properties.scss +0 -12
  1294. data/vendor/assets/stylesheets/helpers/_all.scss +0 -10
  1295. data/vendor/assets/stylesheets/helpers/_font-faces.scss +0 -41
  1296. data/vendor/assets/stylesheets/objects/_all.scss +0 -10
  1297. data/vendor/assets/stylesheets/overrides/_all.scss +0 -9
  1298. data/vendor/assets/stylesheets/settings/_all.scss +0 -10
  1299. data/vendor/assets/stylesheets/settings/_colours-applied.scss +0 -195
  1300. data/vendor/assets/stylesheets/settings/_colours-palette.scss +0 -37
  1301. data/vendor/assets/stylesheets/tools/_all.scss +0 -10
  1302. data/vendor/assets/stylesheets/tools/_rebrand.scss +0 -65
  1303. data/vendor/assets/stylesheets/utilities/_all.scss +0 -10
  1304. data/vendor/assets/stylesheets/vendor/_sass-mq.scss +0 -349
  1305. /data/node_modules/govuk-frontend/dist/govuk/components/date-input/{template-complete-question.html → template-with-items.html} +0 -0
  1306. /data/node_modules/govuk-frontend/dist/govuk/components/table/{template-table-with-head-and-caption.html → template-with-head-and-caption.html} +0 -0
  1307. /data/node_modules/govuk-frontend/dist/govuk/components/table/{template-table-with-head.html → template-with-head.html} +0 -0
  1308. /data/node_modules/govuk-frontend/dist/govuk/components/task-list/{template-example-with-very-long-single-word-tags.html → template-with-very-long-single-word-tags.html} +0 -0
@@ -1,3 +1,5 @@
1
+ import { isObject } from './common/index.mjs';
2
+
1
3
  class I18n {
2
4
  constructor(translations = {}, config = {}) {
3
5
  var _config$locale;
@@ -11,7 +13,7 @@ class I18n {
11
13
  throw new Error('i18n: lookup key missing');
12
14
  }
13
15
  let translation = this.translations[lookupKey];
14
- if (typeof (options == null ? void 0 : options.count) === 'number' && typeof translation === 'object') {
16
+ if (typeof (options == null ? void 0 : options.count) === 'number' && isObject(translation)) {
15
17
  const translationPluralForm = translation[this.getPluralSuffix(lookupKey, options.count)];
16
18
  if (translationPluralForm) {
17
19
  translation = translationPluralForm;
@@ -53,8 +55,8 @@ class I18n {
53
55
  return 'other';
54
56
  }
55
57
  const translation = this.translations[lookupKey];
56
- const preferredForm = this.hasIntlPluralRulesSupport() ? new Intl.PluralRules(this.locale).select(count) : this.selectPluralFormUsingFallbackRules(count);
57
- if (typeof translation === 'object') {
58
+ const preferredForm = this.hasIntlPluralRulesSupport() ? new Intl.PluralRules(this.locale).select(count) : 'other';
59
+ if (isObject(translation)) {
58
60
  if (preferredForm in translation) {
59
61
  return preferredForm;
60
62
  } else if ('other' in translation) {
@@ -64,132 +66,7 @@ class I18n {
64
66
  }
65
67
  throw new Error(`i18n: Plural form ".other" is required for "${this.locale}" locale`);
66
68
  }
67
- selectPluralFormUsingFallbackRules(count) {
68
- count = Math.abs(Math.floor(count));
69
- const ruleset = this.getPluralRulesForLocale();
70
- if (ruleset) {
71
- return I18n.pluralRules[ruleset](count);
72
- }
73
- return 'other';
74
- }
75
- getPluralRulesForLocale() {
76
- const localeShort = this.locale.split('-')[0];
77
- for (const pluralRule in I18n.pluralRulesMap) {
78
- const languages = I18n.pluralRulesMap[pluralRule];
79
- if (languages.includes(this.locale) || languages.includes(localeShort)) {
80
- return pluralRule;
81
- }
82
- }
83
- }
84
69
  }
85
- I18n.pluralRulesMap = {
86
- arabic: ['ar'],
87
- chinese: ['my', 'zh', 'id', 'ja', 'jv', 'ko', 'ms', 'th', 'vi'],
88
- french: ['hy', 'bn', 'fr', 'gu', 'hi', 'fa', 'pa', 'zu'],
89
- german: ['af', 'sq', 'az', 'eu', 'bg', 'ca', 'da', 'nl', 'en', 'et', 'fi', 'ka', 'de', 'el', 'hu', 'lb', 'no', 'so', 'sw', 'sv', 'ta', 'te', 'tr', 'ur'],
90
- irish: ['ga'],
91
- russian: ['ru', 'uk'],
92
- scottish: ['gd'],
93
- spanish: ['pt-PT', 'it', 'es'],
94
- welsh: ['cy']
95
- };
96
- I18n.pluralRules = {
97
- arabic(n) {
98
- if (n === 0) {
99
- return 'zero';
100
- }
101
- if (n === 1) {
102
- return 'one';
103
- }
104
- if (n === 2) {
105
- return 'two';
106
- }
107
- if (n % 100 >= 3 && n % 100 <= 10) {
108
- return 'few';
109
- }
110
- if (n % 100 >= 11 && n % 100 <= 99) {
111
- return 'many';
112
- }
113
- return 'other';
114
- },
115
- chinese() {
116
- return 'other';
117
- },
118
- french(n) {
119
- return n === 0 || n === 1 ? 'one' : 'other';
120
- },
121
- german(n) {
122
- return n === 1 ? 'one' : 'other';
123
- },
124
- irish(n) {
125
- if (n === 1) {
126
- return 'one';
127
- }
128
- if (n === 2) {
129
- return 'two';
130
- }
131
- if (n >= 3 && n <= 6) {
132
- return 'few';
133
- }
134
- if (n >= 7 && n <= 10) {
135
- return 'many';
136
- }
137
- return 'other';
138
- },
139
- russian(n) {
140
- const lastTwo = n % 100;
141
- const last = lastTwo % 10;
142
- if (last === 1 && lastTwo !== 11) {
143
- return 'one';
144
- }
145
- if (last >= 2 && last <= 4 && !(lastTwo >= 12 && lastTwo <= 14)) {
146
- return 'few';
147
- }
148
- if (last === 0 || last >= 5 && last <= 9 || lastTwo >= 11 && lastTwo <= 14) {
149
- return 'many';
150
- }
151
- return 'other';
152
- },
153
- scottish(n) {
154
- if (n === 1 || n === 11) {
155
- return 'one';
156
- }
157
- if (n === 2 || n === 12) {
158
- return 'two';
159
- }
160
- if (n >= 3 && n <= 10 || n >= 13 && n <= 19) {
161
- return 'few';
162
- }
163
- return 'other';
164
- },
165
- spanish(n) {
166
- if (n === 1) {
167
- return 'one';
168
- }
169
- if (n % 1000000 === 0 && n !== 0) {
170
- return 'many';
171
- }
172
- return 'other';
173
- },
174
- welsh(n) {
175
- if (n === 0) {
176
- return 'zero';
177
- }
178
- if (n === 1) {
179
- return 'one';
180
- }
181
- if (n === 2) {
182
- return 'two';
183
- }
184
- if (n === 3) {
185
- return 'few';
186
- }
187
- if (n === 6) {
188
- return 'many';
189
- }
190
- return 'other';
191
- }
192
- };
193
70
 
194
71
  export { I18n };
195
72
  //# sourceMappingURL=i18n.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.mjs","sources":["../../src/govuk/i18n.mjs"],"sourcesContent":["/**\n * Internal support for selecting messages to render, with placeholder\n * interpolation and locale-aware number formatting and pluralisation\n *\n * @internal\n */\nexport class I18n {\n translations\n locale\n\n /**\n * @internal\n * @param {{ [key: string]: string | TranslationPluralForms }} translations - Key-value pairs of the translation strings to use.\n * @param {object} [config] - Configuration options for the function.\n * @param {string | null} [config.locale] - An overriding locale for the PluralRules functionality.\n */\n constructor(translations = {}, config = {}) {\n // Make list of translations available throughout function\n this.translations = translations\n\n // The locale to use for PluralRules and NumberFormat\n this.locale = config.locale ?? (document.documentElement.lang || 'en')\n }\n\n /**\n * The most used function - takes the key for a given piece of UI text and\n * returns the appropriate string.\n *\n * @internal\n * @param {string} lookupKey - The lookup key of the string to use.\n * @param {{ [key: string]: unknown }} [options] - Any options passed with the translation string, e.g: for string interpolation.\n * @returns {string} The appropriate translation string.\n * @throws {Error} Lookup key required\n * @throws {Error} Options required for `${}` placeholders\n */\n t(lookupKey, options) {\n if (!lookupKey) {\n // Print a console error if no lookup key has been provided\n throw new Error('i18n: lookup key missing')\n }\n\n // Fetch the translation for that lookup key\n let translation = this.translations[lookupKey]\n\n // If the `count` option is set, determine which plural suffix is needed and\n // change the lookupKey to match. We check to see if it's numeric instead of\n // falsy, as this could legitimately be 0.\n if (typeof options?.count === 'number' && typeof translation === 'object') {\n const translationPluralForm =\n translation[this.getPluralSuffix(lookupKey, options.count)]\n\n // Update translation with plural suffix\n if (translationPluralForm) {\n translation = translationPluralForm\n }\n }\n\n if (typeof translation === 'string') {\n // Check for ${} placeholders in the translation string\n if (translation.match(/%{(.\\S+)}/)) {\n if (!options) {\n throw new Error(\n 'i18n: cannot replace placeholders in string if no option data provided'\n )\n }\n\n return this.replacePlaceholders(translation, options)\n }\n\n return translation\n }\n\n // If the key wasn't found in our translations object,\n // return the lookup key itself as the fallback\n return lookupKey\n }\n\n /**\n * Takes a translation string with placeholders, and replaces the placeholders\n * with the provided data\n *\n * @internal\n * @param {string} translationString - The translation string\n * @param {{ [key: string]: unknown }} options - Any options passed with the translation string, e.g: for string interpolation.\n * @returns {string} The translation string to output, with $\\{\\} placeholders replaced\n */\n replacePlaceholders(translationString, options) {\n const formatter = Intl.NumberFormat.supportedLocalesOf(this.locale).length\n ? new Intl.NumberFormat(this.locale)\n : undefined\n\n return translationString.replace(\n /%{(.\\S+)}/g,\n\n /**\n * Replace translation string placeholders\n *\n * @internal\n * @param {string} placeholderWithBraces - Placeholder with braces\n * @param {string} placeholderKey - Placeholder key\n * @returns {string} Placeholder value\n */\n function (placeholderWithBraces, placeholderKey) {\n if (Object.prototype.hasOwnProperty.call(options, placeholderKey)) {\n const placeholderValue = options[placeholderKey]\n\n // If a user has passed `false` as the value for the placeholder\n // treat it as though the value should not be displayed\n if (\n placeholderValue === false ||\n (typeof placeholderValue !== 'number' &&\n typeof placeholderValue !== 'string')\n ) {\n return ''\n }\n\n // If the placeholder's value is a number, localise the number formatting\n if (typeof placeholderValue === 'number') {\n return formatter\n ? formatter.format(placeholderValue)\n : `${placeholderValue}`\n }\n\n return placeholderValue\n }\n\n throw new Error(\n `i18n: no data found to replace ${placeholderWithBraces} placeholder in string`\n )\n }\n )\n }\n\n /**\n * Check to see if the browser supports Intl.PluralRules\n *\n * It requires all conditions to be met in order to be supported:\n * - The implementation of Intl supports PluralRules (NOT true in Safari 10–12)\n * - The browser/OS has plural rules for the current locale (browser dependent)\n *\n * {@link https://browsersl.ist/#q=supports+es6-module+and+not+supports+intl-pluralrules}\n *\n * @internal\n * @returns {boolean} Returns true if all conditions are met. Returns false otherwise.\n */\n hasIntlPluralRulesSupport() {\n return Boolean(\n 'PluralRules' in window.Intl &&\n Intl.PluralRules.supportedLocalesOf(this.locale).length\n )\n }\n\n /**\n * Get the appropriate suffix for the plural form.\n *\n * Uses Intl.PluralRules (or our own fallback implementation) to get the\n * 'preferred' form to use for the given count.\n *\n * Checks that a translation has been provided for that plural form – if it\n * hasn't, it'll fall back to the 'other' plural form (unless that doesn't exist\n * either, in which case an error will be thrown)\n *\n * @internal\n * @param {string} lookupKey - The lookup key of the string to use.\n * @param {number} count - Number used to determine which pluralisation to use.\n * @returns {PluralRule} The suffix associated with the correct pluralisation for this locale.\n * @throws {Error} Plural form `.other` required when preferred plural form is missing\n */\n getPluralSuffix(lookupKey, count) {\n // Validate that the number is actually a number.\n //\n // Number(count) will turn anything that can't be converted to a Number type\n // into 'NaN'. isFinite filters out NaN, as it isn't a finite number.\n count = Number(count)\n if (!isFinite(count)) {\n return 'other'\n }\n\n // Fetch the translation for that lookup key\n const translation = this.translations[lookupKey]\n\n // Check to verify that all the requirements for Intl.PluralRules are met.\n // If so, we can use that instead of our custom implementation. Otherwise,\n // use the hardcoded fallback.\n const preferredForm = this.hasIntlPluralRulesSupport()\n ? new Intl.PluralRules(this.locale).select(count)\n : this.selectPluralFormUsingFallbackRules(count)\n\n // Use the correct plural form if provided\n if (typeof translation === 'object') {\n if (preferredForm in translation) {\n return preferredForm\n // Fall back to `other` if the plural form is missing, but log a warning\n // to the console\n } else if ('other' in translation) {\n console.warn(\n `i18n: Missing plural form \".${preferredForm}\" for \"${this.locale}\" locale. Falling back to \".other\".`\n )\n\n return 'other'\n }\n }\n\n // If the required `other` plural form is missing, all we can do is error\n throw new Error(\n `i18n: Plural form \".other\" is required for \"${this.locale}\" locale`\n )\n }\n\n /**\n * Get the plural form using our fallback implementation\n *\n * This is split out into a separate function to make it easier to test the\n * fallback behaviour in an environment where Intl.PluralRules exists.\n *\n * @internal\n * @param {number} count - Number used to determine which pluralisation to use.\n * @returns {PluralRule} The pluralisation form for count in this locale.\n */\n selectPluralFormUsingFallbackRules(count) {\n // Currently our custom code can only handle positive integers, so let's\n // make sure our number is one of those.\n count = Math.abs(Math.floor(count))\n\n const ruleset = this.getPluralRulesForLocale()\n\n if (ruleset) {\n return I18n.pluralRules[ruleset](count)\n }\n\n return 'other'\n }\n\n /**\n * Work out which pluralisation rules to use for the current locale\n *\n * The locale may include a regional indicator (such as en-GB), but we don't\n * usually care about this part, as pluralisation rules are usually the same\n * regardless of region. There are exceptions, however, (e.g. Portuguese) so\n * this searches by both the full and shortened locale codes, just to be sure.\n *\n * @internal\n * @returns {string | undefined} The name of the pluralisation rule to use (a key for one\n * of the functions in this.pluralRules)\n */\n getPluralRulesForLocale() {\n const localeShort = this.locale.split('-')[0]\n\n // Look through the plural rules map to find which `pluralRule` is\n // appropriate for our current `locale`.\n for (const pluralRule in I18n.pluralRulesMap) {\n const languages = I18n.pluralRulesMap[pluralRule]\n if (languages.includes(this.locale) || languages.includes(localeShort)) {\n return pluralRule\n }\n }\n }\n\n /**\n * Map of plural rules to languages where those rules apply.\n *\n * Note: These groups are named for the most dominant or recognisable language\n * that uses each system. The groupings do not imply that the languages are\n * related to one another. Many languages have evolved the same systems\n * independently of one another.\n *\n * Code to support more languages can be found in the i18n spike:\n * {@link https://github.com/alphagov/govuk-frontend/blob/spike-i18n-support/src/govuk/i18n.mjs}\n *\n * Languages currently supported:\n *\n * Arabic: Arabic (ar)\n * Chinese: Burmese (my), Chinese (zh), Indonesian (id), Japanese (ja),\n * Javanese (jv), Korean (ko), Malay (ms), Thai (th), Vietnamese (vi)\n * French: Armenian (hy), Bangla (bn), French (fr), Gujarati (gu), Hindi (hi),\n * Persian Farsi (fa), Punjabi (pa), Zulu (zu)\n * German: Afrikaans (af), Albanian (sq), Azerbaijani (az), Basque (eu),\n * Bulgarian (bg), Catalan (ca), Danish (da), Dutch (nl), English (en),\n * Estonian (et), Finnish (fi), Georgian (ka), German (de), Greek (el),\n * Hungarian (hu), Luxembourgish (lb), Norwegian (no), Somali (so),\n * Swahili (sw), Swedish (sv), Tamil (ta), Telugu (te), Turkish (tr),\n * Urdu (ur)\n * Irish: Irish Gaelic (ga)\n * Russian: Russian (ru), Ukrainian (uk)\n * Scottish: Scottish Gaelic (gd)\n * Spanish: European Portuguese (pt-PT), Italian (it), Spanish (es)\n * Welsh: Welsh (cy)\n *\n * @internal\n * @type {{ [key: string]: string[] }}\n */\n static pluralRulesMap = {\n arabic: ['ar'],\n chinese: ['my', 'zh', 'id', 'ja', 'jv', 'ko', 'ms', 'th', 'vi'],\n french: ['hy', 'bn', 'fr', 'gu', 'hi', 'fa', 'pa', 'zu'],\n german: [\n 'af',\n 'sq',\n 'az',\n 'eu',\n 'bg',\n 'ca',\n 'da',\n 'nl',\n 'en',\n 'et',\n 'fi',\n 'ka',\n 'de',\n 'el',\n 'hu',\n 'lb',\n 'no',\n 'so',\n 'sw',\n 'sv',\n 'ta',\n 'te',\n 'tr',\n 'ur'\n ],\n irish: ['ga'],\n russian: ['ru', 'uk'],\n scottish: ['gd'],\n spanish: ['pt-PT', 'it', 'es'],\n welsh: ['cy']\n }\n\n /**\n * Different pluralisation rule sets\n *\n * Returns the appropriate suffix for the plural form associated with `n`.\n * Possible suffixes: 'zero', 'one', 'two', 'few', 'many', 'other' (the actual\n * meaning of each differs per locale). 'other' should always exist, even in\n * languages without plurals, such as Chinese.\n * {@link https://cldr.unicode.org/index/cldr-spec/plural-rules}\n *\n * The count must be a positive integer. Negative numbers and decimals aren't accounted for\n *\n * @internal\n * @type {{ [key: string]: (count: number) => PluralRule }}\n */\n static pluralRules = {\n arabic(n) {\n if (n === 0) {\n return 'zero'\n }\n if (n === 1) {\n return 'one'\n }\n if (n === 2) {\n return 'two'\n }\n if (n % 100 >= 3 && n % 100 <= 10) {\n return 'few'\n }\n if (n % 100 >= 11 && n % 100 <= 99) {\n return 'many'\n }\n return 'other'\n },\n chinese() {\n return 'other'\n },\n french(n) {\n return n === 0 || n === 1 ? 'one' : 'other'\n },\n german(n) {\n return n === 1 ? 'one' : 'other'\n },\n irish(n) {\n if (n === 1) {\n return 'one'\n }\n if (n === 2) {\n return 'two'\n }\n if (n >= 3 && n <= 6) {\n return 'few'\n }\n if (n >= 7 && n <= 10) {\n return 'many'\n }\n return 'other'\n },\n russian(n) {\n const lastTwo = n % 100\n const last = lastTwo % 10\n if (last === 1 && lastTwo !== 11) {\n return 'one'\n }\n if (last >= 2 && last <= 4 && !(lastTwo >= 12 && lastTwo <= 14)) {\n return 'few'\n }\n if (\n last === 0 ||\n (last >= 5 && last <= 9) ||\n (lastTwo >= 11 && lastTwo <= 14)\n ) {\n return 'many'\n }\n // Note: The 'other' suffix is only used by decimal numbers in Russian.\n // We don't anticipate it being used, but it's here for consistency.\n return 'other'\n },\n scottish(n) {\n if (n === 1 || n === 11) {\n return 'one'\n }\n if (n === 2 || n === 12) {\n return 'two'\n }\n if ((n >= 3 && n <= 10) || (n >= 13 && n <= 19)) {\n return 'few'\n }\n return 'other'\n },\n spanish(n) {\n if (n === 1) {\n return 'one'\n }\n if (n % 1000000 === 0 && n !== 0) {\n return 'many'\n }\n return 'other'\n },\n welsh(n) {\n if (n === 0) {\n return 'zero'\n }\n if (n === 1) {\n return 'one'\n }\n if (n === 2) {\n return 'two'\n }\n if (n === 3) {\n return 'few'\n }\n if (n === 6) {\n return 'many'\n }\n return 'other'\n }\n }\n}\n\n/**\n * Plural rule category mnemonic tags\n *\n * @internal\n * @typedef {'zero' | 'one' | 'two' | 'few' | 'many' | 'other'} PluralRule\n */\n\n/**\n * Translated message by plural rule they correspond to.\n *\n * Allows to group pluralised messages under a single key when passing\n * translations to a component's constructor\n *\n * @internal\n * @typedef {object} TranslationPluralForms\n * @property {string} [other] - General plural form\n * @property {string} [zero] - Plural form used with 0\n * @property {string} [one] - Plural form used with 1\n * @property {string} [two] - Plural form used with 2\n * @property {string} [few] - Plural form used for a few\n * @property {string} [many] - Plural form used for many\n */\n"],"names":["I18n","constructor","translations","config","_config$locale","locale","document","documentElement","lang","t","lookupKey","options","Error","translation","count","translationPluralForm","getPluralSuffix","match","replacePlaceholders","translationString","formatter","Intl","NumberFormat","supportedLocalesOf","length","undefined","replace","placeholderWithBraces","placeholderKey","Object","prototype","hasOwnProperty","call","placeholderValue","format","hasIntlPluralRulesSupport","Boolean","window","PluralRules","Number","isFinite","preferredForm","select","selectPluralFormUsingFallbackRules","console","warn","Math","abs","floor","ruleset","getPluralRulesForLocale","pluralRules","localeShort","split","pluralRule","pluralRulesMap","languages","includes","arabic","chinese","french","german","irish","russian","scottish","spanish","welsh","n","lastTwo","last"],"mappings":"AAMO,MAAMA,IAAI,CAAC;EAUhBC,WAAWA,CAACC,YAAY,GAAG,EAAE,EAAEC,MAAM,GAAG,EAAE,EAAE;AAAA,IAAA,IAAAC,cAAA;AAAA,IAAA,IAAA,CAT5CF,YAAY,GAAA,MAAA;AAAA,IAAA,IAAA,CACZG,MAAM,GAAA,MAAA;IAUJ,IAAI,CAACH,YAAY,GAAGA,YAAY;AAGhC,IAAA,IAAI,CAACG,MAAM,GAAA,CAAAD,cAAA,GAAGD,MAAM,CAACE,MAAM,KAAAD,IAAAA,GAAAA,cAAA,GAAKE,QAAQ,CAACC,eAAe,CAACC,IAAI,IAAI,IAAK;AACxE;AAaAC,EAAAA,CAACA,CAACC,SAAS,EAAEC,OAAO,EAAE;IACpB,IAAI,CAACD,SAAS,EAAE;AAEd,MAAA,MAAM,IAAIE,KAAK,CAAC,0BAA0B,CAAC;AAC7C;AAGA,IAAA,IAAIC,WAAW,GAAG,IAAI,CAACX,YAAY,CAACQ,SAAS,CAAC;AAK9C,IAAA,IAAI,QAAOC,OAAO,IAAPA,IAAAA,GAAAA,MAAAA,GAAAA,OAAO,CAAEG,KAAK,CAAK,KAAA,QAAQ,IAAI,OAAOD,WAAW,KAAK,QAAQ,EAAE;AACzE,MAAA,MAAME,qBAAqB,GACzBF,WAAW,CAAC,IAAI,CAACG,eAAe,CAACN,SAAS,EAAEC,OAAO,CAACG,KAAK,CAAC,CAAC;AAG7D,MAAA,IAAIC,qBAAqB,EAAE;AACzBF,QAAAA,WAAW,GAAGE,qBAAqB;AACrC;AACF;AAEA,IAAA,IAAI,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ACT,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,KAAK;AACd;IACA,IAAIA,CAAC,GAAG,OAAO,KAAK,CAAC,IAAIA,CAAC,KAAK,CAAC,EAAE;AAChC,MAAA,OAAO,MAAM;AACf;AACA,IAAA,OAAO,OAAO;GACf;EACDD,KAAKA,CAACC,CAAC,EAAE;IACP,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,MAAM;AACf;IACA,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,KAAK;AACd;IACA,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,KAAK;AACd;IACA,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,KAAK;AACd;IACA,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,MAAM;AACf;AACA,IAAA,OAAO,OAAO;AAChB;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"i18n.mjs","sources":["../../src/govuk/i18n.mjs"],"sourcesContent":["import { isObject } from './common/index.mjs'\n\n/**\n * Internal support for selecting messages to render, with placeholder\n * interpolation and locale-aware number formatting and pluralisation\n *\n * @internal\n */\nexport class I18n {\n translations\n locale\n\n /**\n * @internal\n * @param {{ [key: string]: string | TranslationPluralForms }} translations - Key-value pairs of the translation strings to use.\n * @param {object} [config] - Configuration options for the function.\n * @param {string | null} [config.locale] - An overriding locale for the PluralRules functionality.\n */\n constructor(translations = {}, config = {}) {\n // Make list of translations available throughout function\n this.translations = translations\n\n // The locale to use for PluralRules and NumberFormat\n this.locale = config.locale ?? (document.documentElement.lang || 'en')\n }\n\n /**\n * The most used function - takes the key for a given piece of UI text and\n * returns the appropriate string.\n *\n * @internal\n * @param {string} lookupKey - The lookup key of the string to use.\n * @param {{ [key: string]: unknown }} [options] - Any options passed with the translation string, e.g: for string interpolation.\n * @returns {string} The appropriate translation string.\n * @throws {Error} Lookup key required\n * @throws {Error} Options required for `${}` placeholders\n */\n t(lookupKey, options) {\n if (!lookupKey) {\n // Print a console error if no lookup key has been provided\n throw new Error('i18n: lookup key missing')\n }\n\n // Fetch the translation for that lookup key\n let translation = this.translations[lookupKey]\n\n // If the `count` option is set, determine which plural suffix is needed and\n // change the lookupKey to match. We check to see if it's numeric instead of\n // falsy, as this could legitimately be 0.\n if (typeof options?.count === 'number' && isObject(translation)) {\n const translationPluralForm =\n translation[this.getPluralSuffix(lookupKey, options.count)]\n\n // Update translation with plural suffix\n if (translationPluralForm) {\n translation = translationPluralForm\n }\n }\n\n if (typeof translation === 'string') {\n // Check for ${} placeholders in the translation string\n // eslint-disable-next-line @typescript-eslint/prefer-regexp-exec\n if (translation.match(/%{(.\\S+)}/)) {\n if (!options) {\n throw new Error(\n 'i18n: cannot replace placeholders in string if no option data provided'\n )\n }\n\n return this.replacePlaceholders(translation, options)\n }\n\n return translation\n }\n\n // If the key wasn't found in our translations object,\n // return the lookup key itself as the fallback\n return lookupKey\n }\n\n /**\n * Takes a translation string with placeholders, and replaces the placeholders\n * with the provided data\n *\n * @internal\n * @param {string} translationString - The translation string\n * @param {{ [key: string]: unknown }} options - Any options passed with the translation string, e.g: for string interpolation.\n * @returns {string} The translation string to output, with $\\{\\} placeholders replaced\n */\n replacePlaceholders(translationString, options) {\n const formatter = Intl.NumberFormat.supportedLocalesOf(this.locale).length\n ? new Intl.NumberFormat(this.locale)\n : undefined\n\n return translationString.replace(\n /%{(.\\S+)}/g,\n\n /**\n * Replace translation string placeholders\n *\n * @internal\n * @param {string} placeholderWithBraces - Placeholder with braces\n * @param {string} placeholderKey - Placeholder key\n * @returns {string} Placeholder value\n */\n function (placeholderWithBraces, placeholderKey) {\n if (Object.prototype.hasOwnProperty.call(options, placeholderKey)) {\n const placeholderValue = options[placeholderKey]\n\n // If a user has passed `false` as the value for the placeholder\n // treat it as though the value should not be displayed\n if (\n placeholderValue === false ||\n (typeof placeholderValue !== 'number' &&\n typeof placeholderValue !== 'string')\n ) {\n return ''\n }\n\n // If the placeholder's value is a number, localise the number formatting\n if (typeof placeholderValue === 'number') {\n return formatter\n ? formatter.format(placeholderValue)\n : `${placeholderValue}`\n }\n\n return placeholderValue\n }\n\n throw new Error(\n `i18n: no data found to replace ${placeholderWithBraces} placeholder in string`\n )\n }\n )\n }\n\n /**\n * Check to see if the browser supports Intl.PluralRules\n *\n * It requires all conditions to be met in order to be supported:\n * - The implementation of Intl supports PluralRules (NOT true in Safari 10–12)\n * - The browser/OS has plural rules for the current locale (browser dependent)\n *\n * {@link https://browsersl.ist/#q=supports+es6-module+and+not+supports+intl-pluralrules}\n *\n * @internal\n * @returns {boolean} Returns true if all conditions are met. Returns false otherwise.\n */\n hasIntlPluralRulesSupport() {\n return Boolean(\n 'PluralRules' in window.Intl &&\n Intl.PluralRules.supportedLocalesOf(this.locale).length\n )\n }\n\n /**\n * Get the appropriate suffix for the plural form.\n *\n * Uses Intl.PluralRules (or our own fallback implementation) to get the\n * 'preferred' form to use for the given count.\n *\n * Checks that a translation has been provided for that plural form – if it\n * hasn't, it'll fall back to the 'other' plural form (unless that doesn't exist\n * either, in which case an error will be thrown)\n *\n * @internal\n * @param {string} lookupKey - The lookup key of the string to use.\n * @param {number} count - Number used to determine which pluralisation to use.\n * @returns {PluralRule} The suffix associated with the correct pluralisation for this locale.\n * @throws {Error} Plural form `.other` required when preferred plural form is missing\n */\n getPluralSuffix(lookupKey, count) {\n // Validate that the number is actually a number.\n //\n // Number(count) will turn anything that can't be converted to a Number type\n // into 'NaN'. isFinite filters out NaN, as it isn't a finite number.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-conversion\n count = Number(count)\n if (!isFinite(count)) {\n return 'other'\n }\n\n // Fetch the translation for that lookup key\n const translation = this.translations[lookupKey]\n\n // Check to verify that all the requirements for Intl.PluralRules are met.\n // If so, we can use that instead of our custom implementation. Otherwise,\n // use the hardcoded fallback.\n const preferredForm = this.hasIntlPluralRulesSupport()\n ? new Intl.PluralRules(this.locale).select(count)\n : 'other'\n\n // Use the correct plural form if provided\n if (isObject(translation)) {\n if (preferredForm in translation) {\n return preferredForm\n // Fall back to `other` if the plural form is missing, but log a warning\n // to the console\n } else if ('other' in translation) {\n console.warn(\n `i18n: Missing plural form \".${preferredForm}\" for \"${this.locale}\" locale. Falling back to \".other\".`\n )\n\n return 'other'\n }\n }\n\n // If the required `other` plural form is missing, all we can do is error\n throw new Error(\n `i18n: Plural form \".other\" is required for \"${this.locale}\" locale`\n )\n }\n}\n\n/**\n * Plural rule category mnemonic tags\n *\n * @internal\n * @typedef {'zero' | 'one' | 'two' | 'few' | 'many' | 'other'} PluralRule\n */\n\n/**\n * Translated message by plural rule they correspond to.\n *\n * Allows to group pluralised messages under a single key when passing\n * translations to a component's constructor\n *\n * @internal\n * @typedef {object} TranslationPluralForms\n * @property {string} [other] - General plural form\n * @property {string} [zero] - Plural form used with 0\n * @property {string} [one] - Plural form used with 1\n * @property {string} [two] - Plural form used with 2\n * @property {string} [few] - Plural form used for a few\n * @property {string} [many] - Plural form used for many\n */\n"],"names":["I18n","constructor","translations","config","_config$locale","locale","document","documentElement","lang","t","lookupKey","options","Error","translation","count","isObject","translationPluralForm","getPluralSuffix","match","replacePlaceholders","translationString","formatter","Intl","NumberFormat","supportedLocalesOf","length","undefined","replace","placeholderWithBraces","placeholderKey","Object","prototype","hasOwnProperty","call","placeholderValue","format","hasIntlPluralRulesSupport","Boolean","window","PluralRules","Number","isFinite","preferredForm","select","console","warn"],"mappings":";;AAQO,MAAMA,IAAI,CAAC;EAUhBC,WAAWA,CAACC,YAAY,GAAG,EAAE,EAAEC,MAAM,GAAG,EAAE,EAAE;AAAA,IAAA,IAAAC,cAAA;AAAA,IAAA,IAAA,CAT5CF,YAAY,GAAA,MAAA;AAAA,IAAA,IAAA,CACZG,MAAM,GAAA,MAAA;IAUJ,IAAI,CAACH,YAAY,GAAGA,YAAY;AAGhC,IAAA,IAAI,CAACG,MAAM,GAAA,CAAAD,cAAA,GAAGD,MAAM,CAACE,MAAM,KA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G,IAAI,CAACN,yBAAyB,EAAE,GAClD,IAAId,IAAI,CAACiB,WAAW,CAAC,IAAI,CAAClC,MAAM,CAAC,CAACsC,MAAM,CAAC7B,KAAK,CAAC,GAC/C,OAAO;AAGX,IAAA,IAAIC,QAAQ,CAACF,WAAW,CAAC,EAAE;MACzB,IAAI6B,aAAa,IAAI7B,WAAW,EAAE;AAChC,QAAA,OAAO6B,aAAa;AAGtB,MAAA,CAAC,MAAM,IAAI,OAAO,IAAI7B,WAAW,EAAE;QACjC+B,OAAO,CAACC,IAAI,CACV,CAAA,4BAAA,EAA+BH,aAAa,UAAU,IAAI,CAACrC,MAAM,CAAA,mCAAA,CACnE,CAAC;AAED,QAAA,OAAO,OAAO;AAChB,MAAA;AACF,IAAA;IAGA,MAAM,IAAIO,KAAK,CACb,CAAA,4CAAA,EAA+C,IAAI,CAACP,MAAM,UAC5D,CAAC;AACH,EAAA;AACF;;;;"}
@@ -0,0 +1,10 @@
1
+ @import "base";
2
+
3
+ @import "core";
4
+ @import "objects";
5
+
6
+ @import "components";
7
+
8
+ @import "utilities";
9
+ @import "overrides";
10
+
@@ -1,11 +1,10 @@
1
- @import "base";
1
+ @forward "base";
2
2
 
3
- @import "core/index";
4
- @import "objects/index";
3
+ @use "core";
4
+ @use "objects";
5
5
 
6
- @import "components/index";
6
+ @use "components";
7
7
 
8
- @import "utilities/index";
9
- @import "overrides/index";
8
+ @use "utilities";
9
+ @use "overrides";
10
10
 
11
- /*# sourceMappingURL=index.scss.map */
@@ -1,4 +1,5 @@
1
- import { isSupported } from './common/index.mjs';
1
+ import { normaliseOptions } from './common/configuration.mjs';
2
+ import { isSupported, isObject } from './common/index.mjs';
2
3
  import { Accordion } from './components/accordion/accordion.mjs';
3
4
  import { Button } from './components/button/button.mjs';
4
5
  import { CharacterCount } from './components/character-count/character-count.mjs';
@@ -6,14 +7,13 @@ import { Checkboxes } from './components/checkboxes/checkboxes.mjs';
6
7
  import { ErrorSummary } from './components/error-summary/error-summary.mjs';
7
8
  import { ExitThisPage } from './components/exit-this-page/exit-this-page.mjs';
8
9
  import { FileUpload } from './components/file-upload/file-upload.mjs';
9
- import { Header } from './components/header/header.mjs';
10
10
  import { NotificationBanner } from './components/notification-banner/notification-banner.mjs';
11
11
  import { PasswordInput } from './components/password-input/password-input.mjs';
12
12
  import { Radios } from './components/radios/radios.mjs';
13
13
  import { ServiceNavigation } from './components/service-navigation/service-navigation.mjs';
14
14
  import { SkipLink } from './components/skip-link/skip-link.mjs';
15
15
  import { Tabs } from './components/tabs/tabs.mjs';
16
- import { SupportError } from './errors/index.mjs';
16
+ import { SupportError, ElementError } from './errors/index.mjs';
17
17
 
18
18
  /**
19
19
  * Initialise all components
@@ -21,28 +21,34 @@ import { SupportError } from './errors/index.mjs';
21
21
  * Use the `data-module` attributes to find, instantiate and init all of the
22
22
  * components provided as part of GOV.UK Frontend.
23
23
  *
24
- * @param {Config & { scope?: Element, onError?: OnErrorCallback<CompatibleClass> }} [config] - Config for all components (with optional scope)
24
+ * @param {Config | Element | Document | null} [scopeOrConfig] - Scope of the document to search within or config for all components (with optional scope)
25
25
  */
26
- function initAll(config) {
27
- var _config$scope;
28
- config = typeof config !== 'undefined' ? config : {};
29
- if (!isSupported()) {
30
- if (config.onError) {
31
- config.onError(new SupportError(), {
26
+ function initAll(scopeOrConfig = {}) {
27
+ const config = isObject(scopeOrConfig) ? scopeOrConfig : {};
28
+ const options = normaliseOptions(scopeOrConfig);
29
+ try {
30
+ if (!isSupported()) {
31
+ throw new SupportError();
32
+ }
33
+ if (options.scope === null) {
34
+ throw new ElementError({
35
+ element: options.scope,
36
+ identifier: 'GOV.UK Frontend scope element (`$scope`)'
37
+ });
38
+ }
39
+ } catch (error) {
40
+ if (options.onError) {
41
+ options.onError(error, {
32
42
  config
33
43
  });
34
44
  } else {
35
- console.log(new SupportError());
45
+ console.log(error);
36
46
  }
37
47
  return;
38
48
  }
39
- const components = [[Accordion, config.accordion], [Button, config.button], [CharacterCount, config.characterCount], [Checkboxes], [ErrorSummary, config.errorSummary], [ExitThisPage, config.exitThisPage], [FileUpload, config.fileUpload], [Header], [NotificationBanner, config.notificationBanner], [PasswordInput, config.passwordInput], [Radios], [ServiceNavigation], [SkipLink], [Tabs]];
40
- const options = {
41
- scope: (_config$scope = config.scope) != null ? _config$scope : document,
42
- onError: config.onError
43
- };
44
- components.forEach(([Component, config]) => {
45
- createAll(Component, config, options);
49
+ const components = [[Accordion, config.accordion], [Button, config.button], [CharacterCount, config.characterCount], [Checkboxes], [ErrorSummary, config.errorSummary], [ExitThisPage, config.exitThisPage], [FileUpload, config.fileUpload], [NotificationBanner, config.notificationBanner], [PasswordInput, config.passwordInput], [Radios], [ServiceNavigation], [SkipLink], [Tabs]];
50
+ components.forEach(([Component, componentConfig]) => {
51
+ createAll(Component, componentConfig, options);
46
52
  });
47
53
  }
48
54
 
@@ -58,42 +64,42 @@ function initAll(config) {
58
64
  * @template {CompatibleClass} ComponentClass
59
65
  * @param {ComponentClass} Component - class of the component to create
60
66
  * @param {ComponentConfig<ComponentClass>} [config] - Config supplied to component
61
- * @param {OnErrorCallback<ComponentClass> | Element | Document | CreateAllOptions<ComponentClass> } [createAllOptions] - options for createAll including scope of the document to search within and callback function if error throw by component on init
67
+ * @param {OnErrorCallback<ComponentClass> | Element | Document | null | CreateAllOptions<ComponentClass>} [scopeOrOptions] - options for createAll including scope of the document to search within and callback function if error throw by component on init
62
68
  * @returns {Array<InstanceType<ComponentClass>>} - array of instantiated components
63
69
  */
64
- function createAll(Component, config, createAllOptions) {
65
- let $scope = document;
66
- let onError;
67
- if (typeof createAllOptions === 'object') {
68
- var _createAllOptions$sco;
69
- createAllOptions = createAllOptions;
70
- $scope = (_createAllOptions$sco = createAllOptions.scope) != null ? _createAllOptions$sco : $scope;
71
- onError = createAllOptions.onError;
72
- }
73
- if (typeof createAllOptions === 'function') {
74
- onError = createAllOptions;
75
- }
76
- if (createAllOptions instanceof HTMLElement) {
77
- $scope = createAllOptions;
78
- }
79
- const $elements = $scope.querySelectorAll(`[data-module="${Component.moduleName}"]`);
80
- if (!isSupported()) {
81
- if (onError) {
82
- onError(new SupportError(), {
70
+ function createAll(Component, config, scopeOrOptions) {
71
+ let $elements;
72
+ const options = normaliseOptions(scopeOrOptions);
73
+ try {
74
+ var _options$scope;
75
+ if (!isSupported()) {
76
+ throw new SupportError();
77
+ }
78
+ if (options.scope === null) {
79
+ throw new ElementError({
80
+ element: options.scope,
81
+ component: Component,
82
+ identifier: 'Scope element (`$scope`)'
83
+ });
84
+ }
85
+ $elements = (_options$scope = options.scope) == null ? void 0 : _options$scope.querySelectorAll(`[data-module="${Component.moduleName}"]`);
86
+ } catch (error) {
87
+ if (options.onError) {
88
+ options.onError(error, {
83
89
  component: Component,
84
90
  config
85
91
  });
86
92
  } else {
87
- console.log(new SupportError());
93
+ console.log(error);
88
94
  }
89
95
  return [];
90
96
  }
91
- return Array.from($elements).map($element => {
97
+ return Array.from($elements != null ? $elements : []).map($element => {
92
98
  try {
93
99
  return typeof config !== 'undefined' ? new Component($element, config) : new Component($element);
94
100
  } catch (error) {
95
- if (onError) {
96
- onError(error, {
101
+ if (options.onError) {
102
+ options.onError(error, {
97
103
  element: $element,
98
104
  component: Component,
99
105
  config
@@ -112,6 +118,8 @@ function createAll(Component, config, createAllOptions) {
112
118
  * Config for all components via `initAll()`
113
119
  *
114
120
  * @typedef {object} Config
121
+ * @property {Element | Document | null} [scope] - Scope of the document to search within
122
+ * @property {OnErrorCallback<CompatibleClass>} [onError] - Initialisation error callback
115
123
  * @property {AccordionConfig} [accordion] - Accordion config
116
124
  * @property {ButtonConfig} [button] - Button config
117
125
  * @property {CharacterCountConfig} [characterCount] - Character Count config
@@ -136,7 +144,7 @@ function createAll(Component, config, createAllOptions) {
136
144
  /**
137
145
  * Component config keys, e.g. `accordion` and `characterCount`
138
146
  *
139
- * @typedef {keyof Config} ConfigKey
147
+ * @typedef {keyof Omit<Config, 'scope' | 'onError'>} ConfigKey
140
148
  */
141
149
  /**
142
150
  * @template {CompatibleClass} ComponentClass
@@ -147,7 +155,7 @@ function createAll(Component, config, createAllOptions) {
147
155
  * @typedef {object} ErrorContext
148
156
  * @property {Element} [element] - Element used for component module initialisation
149
157
  * @property {ComponentClass} [component] - Class of component
150
- * @property {ComponentConfig<ComponentClass>} config - Config supplied to component
158
+ * @property {Config | ComponentConfig<ComponentClass>} [config] - Config supplied to components
151
159
  */
152
160
  /**
153
161
  * @template {CompatibleClass} ComponentClass
@@ -158,7 +166,7 @@ function createAll(Component, config, createAllOptions) {
158
166
  /**
159
167
  * @template {CompatibleClass} ComponentClass
160
168
  * @typedef {object} CreateAllOptions
161
- * @property {Element | Document} [scope] - scope of the document to search within
169
+ * @property {Element | Document | null} [scope] - scope of the document to search within
162
170
  * @property {OnErrorCallback<ComponentClass>} [onError] - callback function if error throw by component on init
163
171
  */
164
172
 
@@ -1 +1 @@
1
- {"version":3,"file":"init.mjs","sources":["../../src/govuk/init.mjs"],"sourcesContent":["import { isSupported } from './common/index.mjs'\nimport { Accordion } from './components/accordion/accordion.mjs'\nimport { Button } from './components/button/button.mjs'\nimport { CharacterCount } from './components/character-count/character-count.mjs'\nimport { Checkboxes } from './components/checkboxes/checkboxes.mjs'\nimport { ErrorSummary } from './components/error-summary/error-summary.mjs'\nimport { ExitThisPage } from './components/exit-this-page/exit-this-page.mjs'\nimport { FileUpload } from './components/file-upload/file-upload.mjs'\nimport { Header } from './components/header/header.mjs'\nimport { NotificationBanner } from './components/notification-banner/notification-banner.mjs'\nimport { PasswordInput } from './components/password-input/password-input.mjs'\nimport { Radios } from './components/radios/radios.mjs'\nimport { ServiceNavigation } from './components/service-navigation/service-navigation.mjs'\nimport { SkipLink } from './components/skip-link/skip-link.mjs'\nimport { Tabs } from './components/tabs/tabs.mjs'\nimport { SupportError } from './errors/index.mjs'\n\n/**\n * Initialise all components\n *\n * Use the `data-module` attributes to find, instantiate and init all of the\n * components provided as part of GOV.UK Frontend.\n *\n * @param {Config & { scope?: Element, onError?: OnErrorCallback<CompatibleClass> }} [config] - Config for all components (with optional scope)\n */\nfunction initAll(config) {\n config = typeof config !== 'undefined' ? config : {}\n\n // Skip initialisation when GOV.UK Frontend is not supported\n if (!isSupported()) {\n if (config.onError) {\n config.onError(new SupportError(), {\n config\n })\n } else {\n console.log(new SupportError())\n }\n return\n }\n\n const components = /** @type {const} */ ([\n [Accordion, config.accordion],\n [Button, config.button],\n [CharacterCount, config.characterCount],\n [Checkboxes],\n [ErrorSummary, config.errorSummary],\n [ExitThisPage, config.exitThisPage],\n [FileUpload, config.fileUpload],\n [Header],\n [NotificationBanner, config.notificationBanner],\n [PasswordInput, config.passwordInput],\n [Radios],\n [ServiceNavigation],\n [SkipLink],\n [Tabs]\n ])\n\n // Allow the user to initialise GOV.UK Frontend in only certain sections of the page\n // Defaults to the entire document if nothing is set.\n // const $scope = config.scope ?? document\n\n const options = {\n scope: config.scope ?? document,\n onError: config.onError\n }\n\n components.forEach(([Component, config]) => {\n createAll(Component, config, options)\n })\n}\n\n/**\n * Create all instances of a specific component on the page\n *\n * Uses the `data-module` attribute to find all elements matching the specified\n * component on the page, creating instances of the component object for each\n * of them.\n *\n * Any component errors will be caught and logged to the console.\n *\n * @template {CompatibleClass} ComponentClass\n * @param {ComponentClass} Component - class of the component to create\n * @param {ComponentConfig<ComponentClass>} [config] - Config supplied to component\n * @param {OnErrorCallback<ComponentClass> | Element | Document | CreateAllOptions<ComponentClass> } [createAllOptions] - options for createAll including scope of the document to search within and callback function if error throw by component on init\n * @returns {Array<InstanceType<ComponentClass>>} - array of instantiated components\n */\nfunction createAll(Component, config, createAllOptions) {\n let /** @type {Element | Document} */ $scope = document\n let /** @type {OnErrorCallback<Component> | undefined} */ onError\n\n if (typeof createAllOptions === 'object') {\n createAllOptions = /** @type {CreateAllOptions<Component>} */ (\n // eslint-disable-next-line no-self-assign\n createAllOptions\n )\n\n $scope = createAllOptions.scope ?? $scope\n onError = createAllOptions.onError\n }\n\n if (typeof createAllOptions === 'function') {\n onError = createAllOptions\n }\n\n if (createAllOptions instanceof HTMLElement) {\n $scope = createAllOptions\n }\n\n const $elements = $scope.querySelectorAll(\n `[data-module=\"${Component.moduleName}\"]`\n )\n\n // Skip initialisation when GOV.UK Frontend is not supported\n if (!isSupported()) {\n if (onError) {\n onError(new SupportError(), {\n component: Component,\n config\n })\n } else {\n console.log(new SupportError())\n }\n return []\n }\n\n /* eslint-disable-next-line @typescript-eslint/no-unsafe-return --\n * We can't define CompatibleClass as `{new(): CompatibleClass, moduleName: string}`,\n * as when doing `typeof Accordion` (or any component), TypeScript doesn't seem\n * to acknowledge the static `moduleName` that's set in our component classes.\n * This means we have to set the constructor of `CompatibleClass` as `{new(): any}`,\n * leading to ESLint frowning that we're returning `any[]`.\n */\n return Array.from($elements)\n .map(($element) => {\n try {\n // Only pass config to components that accept it\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return typeof config !== 'undefined'\n ? new Component($element, config)\n : new Component($element)\n } catch (error) {\n if (onError) {\n onError(error, {\n element: $element,\n component: Component,\n config\n })\n } else {\n console.log(error)\n }\n\n return null\n }\n })\n .filter(Boolean) // Exclude components that errored\n}\n\nexport { initAll, createAll }\n\n/* eslint-disable jsdoc/valid-types --\n * `{new(...args: any[] ): object}` is not recognised as valid\n * https://github.com/gajus/eslint-plugin-jsdoc/issues/145#issuecomment-1308722878\n * https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/131\n **/\n\n/**\n * @typedef {{new (...args: any[]): any, moduleName: string}} CompatibleClass\n */\n\n/* eslint-enable jsdoc/valid-types */\n\n/**\n * Config for all components via `initAll()`\n *\n * @typedef {object} Config\n * @property {AccordionConfig} [accordion] - Accordion config\n * @property {ButtonConfig} [button] - Button config\n * @property {CharacterCountConfig} [characterCount] - Character Count config\n * @property {ErrorSummaryConfig} [errorSummary] - Error Summary config\n * @property {ExitThisPageConfig} [exitThisPage] - Exit This Page config\n * @property {FileUploadConfig} [fileUpload] - File Upload config\n * @property {NotificationBannerConfig} [notificationBanner] - Notification Banner config\n * @property {PasswordInputConfig} [passwordInput] - Password input config\n */\n\n/**\n * Config for individual components\n *\n * @import { AccordionConfig } from './components/accordion/accordion.mjs'\n * @import { ButtonConfig } from './components/button/button.mjs'\n * @import { CharacterCountConfig } from './components/character-count/character-count.mjs'\n * @import { ErrorSummaryConfig } from './components/error-summary/error-summary.mjs'\n * @import { ExitThisPageConfig } from './components/exit-this-page/exit-this-page.mjs'\n * @import { NotificationBannerConfig } from './components/notification-banner/notification-banner.mjs'\n * @import { PasswordInputConfig } from './components/password-input/password-input.mjs'\n * @import { FileUploadConfig } from './components/file-upload/file-upload.mjs'\n */\n\n/**\n * Component config keys, e.g. `accordion` and `characterCount`\n *\n * @typedef {keyof Config} ConfigKey\n */\n\n/**\n * @template {CompatibleClass} ComponentClass\n * @typedef {ConstructorParameters<ComponentClass>[1]} ComponentConfig\n */\n\n/**\n * @template {CompatibleClass} ComponentClass\n * @typedef {object} ErrorContext\n * @property {Element} [element] - Element used for component module initialisation\n * @property {ComponentClass} [component] - Class of component\n * @property {ComponentConfig<ComponentClass>} config - Config supplied to component\n */\n\n/**\n * @template {CompatibleClass} ComponentClass\n * @callback OnErrorCallback\n * @param {unknown} error - Thrown error\n * @param {ErrorContext<ComponentClass>} context - Object containing the element, component class and configuration\n */\n\n/**\n * @template {CompatibleClass} ComponentClass\n * @typedef {object} CreateAllOptions\n * @property {Element | Document} [scope] - scope of the document to search within\n * @property {OnErrorCallback<ComponentClass>} [onError] - callback function if error throw by component on init\n */\n"],"names":["initAll","config","_config$scope","isSupported","onError","SupportError","console","log","components","Accordion","accordion","Button","button","CharacterCount","characterCount","Checkboxes","ErrorSummary","errorSummary","ExitThisPage","exitThisPage","FileUpload","fileUpload","Header","NotificationBanner","notificationBanner","PasswordInput","passwordInput","Radios","ServiceNavigation","SkipLink","Tabs","options","scope","document","forEach","Component","createAll","createAllOptions","$scope","_createAllOptions$sco","HTMLElement","$elements","querySelectorAll","moduleName","component","Array","from","map","$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,EAAE,CAAC;AACjC;AACA,IAAA,OAAO,EAAE;AACX;EASA,OAAOwC,KAAK,CAACC,IAAI,CAACL,SAAS,CAAC,CACzBM,GAAG,CAAEC,QAAQ,IAAK;IACjB,IAAI;AAGF,MAAA,OAAO,OAAO/C,MAAM,KAAK,WAAW,GAChC,IAAIkC,SAAS,CAACa,QAAQ,EAAE/C,MAAM,CAAC,GAC/B,IAAIkC,SAAS,CAACa,QAAQ,CAAC;KAC5B,CAAC,OAAOC,KAAK,EAAE;AACd,MAAA,IAAI7C,OAAO,EAAE;QACXA,OAAO,CAAC6C,KAAK,EAAE;AACbC,UAAAA,OAAO,EAAEF,QAAQ;AACjBJ,UAAAA,SAAS,EAAET,SAAS;AACpBlC,UAAAA;AACF,SAAC,CAAC;AACJ,OAAC,MAAM;AACLK,QAAAA,OAAO,CAACC,GAAG,CAAC0C,KAAK,CAAC;AACpB;AAEA,MAAA,OAAO,IAAI;AACb;AACF,GAAC,CAAC,CACDE,MAAM,CAACC,OAAO,CAAC;AACpB;AAUA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"init.mjs","sources":["../../src/govuk/init.mjs"],"sourcesContent":["import { normaliseOptions } from './common/configuration.mjs'\nimport { isObject, isSupported } from './common/index.mjs'\nimport { Accordion } from './components/accordion/accordion.mjs'\nimport { Button } from './components/button/button.mjs'\nimport { CharacterCount } from './components/character-count/character-count.mjs'\nimport { Checkboxes } from './components/checkboxes/checkboxes.mjs'\nimport { ErrorSummary } from './components/error-summary/error-summary.mjs'\nimport { ExitThisPage } from './components/exit-this-page/exit-this-page.mjs'\nimport { FileUpload } from './components/file-upload/file-upload.mjs'\nimport { NotificationBanner } from './components/notification-banner/notification-banner.mjs'\nimport { PasswordInput } from './components/password-input/password-input.mjs'\nimport { Radios } from './components/radios/radios.mjs'\nimport { ServiceNavigation } from './components/service-navigation/service-navigation.mjs'\nimport { SkipLink } from './components/skip-link/skip-link.mjs'\nimport { Tabs } from './components/tabs/tabs.mjs'\nimport { ElementError, SupportError } from './errors/index.mjs'\n\n/**\n * Initialise all components\n *\n * Use the `data-module` attributes to find, instantiate and init all of the\n * components provided as part of GOV.UK Frontend.\n *\n * @param {Config | Element | Document | null} [scopeOrConfig] - Scope of the document to search within or config for all components (with optional scope)\n */\nfunction initAll(scopeOrConfig = {}) {\n const config = isObject(scopeOrConfig) ? scopeOrConfig : {}\n\n // Extract initialisation options\n const options = normaliseOptions(scopeOrConfig)\n\n try {\n // Skip initialisation when GOV.UK Frontend is not supported\n if (!isSupported()) {\n throw new SupportError()\n }\n\n // Users can initialise GOV.UK Frontend in certain sections of the page\n // unless the scope is null (for example, query selector not found)\n if (options.scope === null) {\n throw new ElementError({\n element: options.scope,\n identifier: 'GOV.UK Frontend scope element (`$scope`)'\n })\n }\n } catch (error) {\n if (options.onError) {\n options.onError(error, {\n config\n })\n } else {\n console.log(error)\n }\n\n return\n }\n\n const components = /** @type {const} */ ([\n [Accordion, config.accordion],\n [Button, config.button],\n [CharacterCount, config.characterCount],\n [Checkboxes],\n [ErrorSummary, config.errorSummary],\n [ExitThisPage, config.exitThisPage],\n [FileUpload, config.fileUpload],\n [NotificationBanner, config.notificationBanner],\n [PasswordInput, config.passwordInput],\n [Radios],\n [ServiceNavigation],\n [SkipLink],\n [Tabs]\n ])\n\n components.forEach(([Component, componentConfig]) => {\n createAll(Component, componentConfig, options)\n })\n}\n\n/**\n * Create all instances of a specific component on the page\n *\n * Uses the `data-module` attribute to find all elements matching the specified\n * component on the page, creating instances of the component object for each\n * of them.\n *\n * Any component errors will be caught and logged to the console.\n *\n * @template {CompatibleClass} ComponentClass\n * @param {ComponentClass} Component - class of the component to create\n * @param {ComponentConfig<ComponentClass>} [config] - Config supplied to component\n * @param {OnErrorCallback<ComponentClass> | Element | Document | null | CreateAllOptions<ComponentClass>} [scopeOrOptions] - options for createAll including scope of the document to search within and callback function if error throw by component on init\n * @returns {Array<InstanceType<ComponentClass>>} - array of instantiated components\n */\nfunction createAll(Component, config, scopeOrOptions) {\n let /** @type {NodeListOf<Element> | undefined} */ $elements\n\n // Extract initialisation options\n const options = normaliseOptions(scopeOrOptions)\n\n try {\n // Skip initialisation when GOV.UK Frontend is not supported\n if (!isSupported()) {\n throw new SupportError()\n }\n\n // Users can initialise GOV.UK Frontend in certain sections of the page\n // unless the scope is null (for example, query selector not found)\n if (options.scope === null) {\n throw new ElementError({\n element: options.scope,\n component: Component,\n identifier: 'Scope element (`$scope`)'\n })\n }\n\n $elements = options.scope?.querySelectorAll(\n `[data-module=\"${Component.moduleName}\"]`\n )\n } catch (error) {\n if (options.onError) {\n options.onError(error, {\n component: Component,\n config\n })\n } else {\n console.log(error)\n }\n\n return []\n }\n\n /* eslint-disable-next-line @typescript-eslint/no-unsafe-return --\n * We can't define CompatibleClass as `{new(): CompatibleClass, moduleName: string}`,\n * as when doing `typeof Accordion` (or any component), TypeScript doesn't seem\n * to acknowledge the static `moduleName` that's set in our component classes.\n * This means we have to set the constructor of `CompatibleClass` as `{new(): any}`,\n * leading to ESLint frowning that we're returning `any[]`.\n */\n return Array.from($elements ?? [])\n .map(($element) => {\n try {\n // Only pass config to components that accept it\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return typeof config !== 'undefined'\n ? new Component($element, config)\n : new Component($element)\n } catch (error) {\n if (options.onError) {\n options.onError(error, {\n element: $element,\n component: Component,\n config\n })\n } else {\n console.log(error)\n }\n\n return null\n }\n })\n .filter(Boolean) // Exclude components that errored\n}\n\nexport { initAll, createAll }\n\n/* eslint-disable jsdoc/valid-types --\n * `{new(...args: any[] ): object}` is not recognised as valid\n * https://github.com/gajus/eslint-plugin-jsdoc/issues/145#issuecomment-1308722878\n * https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/131\n **/\n\n/**\n * @typedef {{new (...args: any[]): any, moduleName: string}} CompatibleClass\n */\n\n/* eslint-enable jsdoc/valid-types */\n\n/**\n * Config for all components via `initAll()`\n *\n * @typedef {object} Config\n * @property {Element | Document | null} [scope] - Scope of the document to search within\n * @property {OnErrorCallback<CompatibleClass>} [onError] - Initialisation error callback\n * @property {AccordionConfig} [accordion] - Accordion config\n * @property {ButtonConfig} [button] - Button config\n * @property {CharacterCountConfig} [characterCount] - Character Count config\n * @property {ErrorSummaryConfig} [errorSummary] - Error Summary config\n * @property {ExitThisPageConfig} [exitThisPage] - Exit This Page config\n * @property {FileUploadConfig} [fileUpload] - File Upload config\n * @property {NotificationBannerConfig} [notificationBanner] - Notification Banner config\n * @property {PasswordInputConfig} [passwordInput] - Password input config\n */\n\n/**\n * Config for individual components\n *\n * @import { AccordionConfig } from './components/accordion/accordion.mjs'\n * @import { ButtonConfig } from './components/button/button.mjs'\n * @import { CharacterCountConfig } from './components/character-count/character-count.mjs'\n * @import { ErrorSummaryConfig } from './components/error-summary/error-summary.mjs'\n * @import { ExitThisPageConfig } from './components/exit-this-page/exit-this-page.mjs'\n * @import { NotificationBannerConfig } from './components/notification-banner/notification-banner.mjs'\n * @import { PasswordInputConfig } from './components/password-input/password-input.mjs'\n * @import { FileUploadConfig } from './components/file-upload/file-upload.mjs'\n */\n\n/**\n * Component config keys, e.g. `accordion` and `characterCount`\n *\n * @typedef {keyof Omit<Config, 'scope' | 'onError'>} ConfigKey\n */\n\n/**\n * @template {CompatibleClass} ComponentClass\n * @typedef {ConstructorParameters<ComponentClass>[1]} ComponentConfig\n */\n\n/**\n * @template {CompatibleClass} ComponentClass\n * @typedef {object} ErrorContext\n * @property {Element} [element] - Element used for component module initialisation\n * @property {ComponentClass} [component] - Class of component\n * @property {Config | ComponentConfig<ComponentClass>} [config] - Config supplied to components\n */\n\n/**\n * @template {CompatibleClass} ComponentClass\n * @callback OnErrorCallback\n * @param {unknown} error - Thrown error\n * @param {ErrorContext<ComponentClass>} context - Object containing the element, component class and configuration\n */\n\n/**\n * @template {CompatibleClass} ComponentClass\n * @typedef {object} CreateAllOptions\n * @property {Element | Document | null} [scope] - scope of the document to search within\n * @property {OnErrorCallback<ComponentClass>} [onError] - callback function if error throw by component on init\n */\n"],"names":["initAll","scopeOrConfig","config","isObject","options","normaliseOptions","isSupported","SupportError","scope","ElementError","element","identifier","error","onError","console","log","components","Accordion","accordion","Button","button","CharacterCount","characterCount","Checkboxes","ErrorSummary","errorSummary","ExitThisPage","exitThisPage","FileUpload","fileUpload","NotificationBanner","notificationBanner","PasswordInput","passwordInput","Radios","ServiceNavigation","SkipLink","Tabs","forEach","Component","componentConfig","createAll","scopeOrOptions","$elements","_options$scope","component","querySelectorAll","moduleName","Array","from","map","$element","filter","Boolean"],"mappings":";;;;;;;;;;;;;;;;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAOA,CAACC,aAAa,GAAG,EAAE,EAAE;EACnC,MAAMC,MAAM,GAAGC,QAAQ,CAACF,aAAa,CAAC,GAAGA,aAAa,GAAG,EAAE;AAG3D,EAAA,MAAMG,OAAO,GAAGC,gBAAgB,CAACJ,aAAa,CAAC;EAE/C,IAAI;AAEF,IAAA,IAAI,CAACK,WAAW,EAAE,EAAE;MAClB,MAAM,IAAIC,YAAY,EAAE;AAC1B,IAAA;AAIA,IAAA,IAAIH,OAAO,CAACI,KAAK,KAAK,IAAI,EAAE;MAC1B,MAAM,IAAIC,YAAY,CAAC;QACrBC,OAAO,EAAEN,OAAO,CAACI,KAAK;AACtBG,QAAAA,UAAU,EAAE;AACd,OAAC,CAAC;AACJ,IAAA;EACF,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,IAAIR,OAAO,CAACS,OAAO,EAAE;AACnBT,MAAAA,OAAO,CAACS,OAAO,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AACF,SAAC,CAAC;AACJ,MAAA,CAAC,MAAM;AACLY,QAAAA,OAAO,CAACC,GAAG,CAACH,KAAK,CAAC;AACpB,MAAA;AAEA,MAAA,OAAO,IAAI;AACb,IAAA;AACF,EAAA,CAAC,CAAC,CACDwC,MAAM,CAACC,OAAO,CAAC;AACpB;AAUA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;;"}
@@ -62,30 +62,46 @@
62
62
  @param {{ [attribute: string]: string | { value: string, optional?: boolean } } | string} attributes - Component attributes param
63
63
  #}
64
64
  {% macro govukAttributes(attributes) -%}
65
- {#- Default attributes output -#}
65
+ {#- Default attributes output as string -#}
66
66
  {% set attributesHtml = attributes if attributes is string else "" %}
67
67
 
68
- {#- Append attribute name/value pairs -#}
69
- {%- if attributes is mapping %}
70
- {% for name, value in attributes %}
71
- {#- Detect if this is a `safe` filtered value. Just pass the value through if so. -#}
72
- {#- https://github.com/alphagov/govuk-frontend/issues/4937 -#}
73
- {% if value is mapping and not [undefined, null].includes(value.val) and value.length %}
74
- {% set value = value.val %}
75
- {% endif %}
68
+ {#- Default attributes output as `safe` filtered string -#}
69
+ {%- if attributes is escaped and attributes.val is string %}
70
+ {% set attributesHtml = attributes %}
76
71
 
72
+ {#- Append attribute name/value pairs -#}
73
+ {%- elif attributes is mapping and attributes is not escaped %}
74
+ {% for name, item in attributes %}
77
75
  {#- Set default attribute options -#}
78
- {% set options = value if value is mapping else {
79
- value: value,
76
+ {% set options = item if item is mapping and item is not escaped else {
77
+ value: item,
80
78
  optional: false
81
79
  } %}
82
80
 
81
+ {#- Remove values when not provided -#}
82
+ {%- if options.value in [undefined, null] %}
83
+ {% set value = null %}
84
+ {% set valueEscaped = "" %}
85
+
86
+ {#- Extract unescaped value when `safe` filtered -#}
87
+ {#- https://github.com/alphagov/govuk-frontend/issues/4937 -#}
88
+ {%- elif options.value is escaped %}
89
+ {% set value = options.value.val %}
90
+ {% set valueEscaped = options.value %}
91
+
92
+ {#- Otherwise assume escaping is necessary -#}
93
+ {#- https://github.com/alphagov/govuk-frontend/issues/4940 -#}
94
+ {%- else %}
95
+ {% set value = options.value %}
96
+ {% set valueEscaped = options.value | escape %}
97
+ {% endif %}
98
+
83
99
  {#- Output ` name` only (no value) for boolean attributes -#}
84
- {% if options.optional === true and options.value === true %}
100
+ {% if options.optional === true and value === true %}
85
101
  {% set attributesHtml = attributesHtml + " " + name | escape %}
86
102
  {#- Skip optional empty attributes or output ` name="value"` pair by default -#}
87
- {% elif (options.optional === true and not [undefined, null, false].includes(options.value)) or options.optional !== true %}
88
- {% set attributesHtml = attributesHtml + " " + name | escape + '="' + options.value | escape + '"' %}
103
+ {% elif (options.optional === true and value not in [undefined, null, false]) or options.optional !== true %}
104
+ {% set attributesHtml = attributesHtml + " " + name | escape + '="' + valueEscaped + '"' %}
89
105
  {% endif %}
90
106
  {% endfor %}
91
107
  {% endif -%}