govuk_publishing_components 42.0.0 → 43.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (591) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +2 -1
  3. data/app/assets/stylesheets/govuk_publishing_components/component_support.scss +4 -4
  4. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +18 -3
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_attachment-link.scss +15 -0
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +20 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +21 -1
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_cards.scss +27 -6
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_chat-entry.scss +36 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +6 -6
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_cross-service-header.scss +29 -0
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_devolved-nations.scss +23 -0
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +19 -0
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak-html-publication.scss +5 -3
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +16 -0
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +19 -0
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_inset-text.scss +23 -0
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +29 -0
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-admin.scss +1 -1
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss +6 -0
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +16 -0
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +7 -0
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_phase-banner.scss +21 -0
  24. data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +8 -0
  25. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +8 -7
  26. data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +22 -0
  27. data/app/assets/stylesheets/govuk_publishing_components/components/_title.scss +8 -0
  28. data/app/assets/stylesheets/govuk_publishing_components/components/_warning-text.scss +11 -0
  29. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +24 -2
  30. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_govuk-frontend-settings.scss +2 -0
  31. data/app/views/govuk_publishing_components/components/_action_link.html.erb +1 -1
  32. data/app/views/govuk_publishing_components/components/_attachment.html.erb +2 -2
  33. data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +2 -1
  34. data/app/views/govuk_publishing_components/components/_chat_entry.html.erb +46 -0
  35. data/app/views/govuk_publishing_components/components/_contextual_breadcrumbs.html.erb +6 -4
  36. data/app/views/govuk_publishing_components/components/_contextual_footer.html.erb +1 -1
  37. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +1 -1
  38. data/app/views/govuk_publishing_components/components/_error_alert.html.erb +1 -1
  39. data/app/views/govuk_publishing_components/components/_intervention.html.erb +1 -1
  40. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +2 -2
  41. data/app/views/govuk_publishing_components/components/_modal_dialogue.html.erb +3 -5
  42. data/app/views/govuk_publishing_components/components/_related_navigation.html.erb +1 -1
  43. data/app/views/govuk_publishing_components/components/cross_service_header/_one_login_header.html.erb +1 -1
  44. data/app/views/govuk_publishing_components/components/cross_service_header/_service_header.html.erb +2 -2
  45. data/app/views/govuk_publishing_components/components/docs/chat_entry.yml +36 -0
  46. data/app/views/govuk_publishing_components/components/docs/contents_list.yml +3 -3
  47. data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +1 -1
  48. data/{node_modules/govuk-frontend/dist/govuk/components/header/template-with-tudor-crown.html → app/views/govuk_publishing_components/components/govuk_logo/_govuk_logo.html.erb} +5 -12
  49. data/app/views/govuk_publishing_components/components/govuk_logo/_govuk_logo_crown_only.html.erb +15 -0
  50. data/app/views/govuk_publishing_components/components/layout_for_public/_header_logo.html.erb +6 -27
  51. data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +1 -13
  52. data/config/locales/ar.yml +4 -1
  53. data/config/locales/az.yml +4 -1
  54. data/config/locales/be.yml +4 -1
  55. data/config/locales/bg.yml +4 -1
  56. data/config/locales/bn.yml +4 -1
  57. data/config/locales/cs.yml +4 -1
  58. data/config/locales/cy.yml +4 -1
  59. data/config/locales/da.yml +4 -1
  60. data/config/locales/de.yml +4 -1
  61. data/config/locales/dr.yml +4 -1
  62. data/config/locales/el.yml +4 -1
  63. data/config/locales/en.yml +3 -0
  64. data/config/locales/es-419.yml +4 -1
  65. data/config/locales/es.yml +4 -1
  66. data/config/locales/et.yml +4 -1
  67. data/config/locales/fa.yml +4 -1
  68. data/config/locales/fi.yml +4 -1
  69. data/config/locales/fr.yml +4 -1
  70. data/config/locales/gd.yml +4 -1
  71. data/config/locales/gu.yml +4 -1
  72. data/config/locales/he.yml +4 -1
  73. data/config/locales/hi.yml +4 -1
  74. data/config/locales/hr.yml +4 -1
  75. data/config/locales/hu.yml +4 -1
  76. data/config/locales/hy.yml +4 -1
  77. data/config/locales/id.yml +4 -1
  78. data/config/locales/is.yml +4 -1
  79. data/config/locales/it.yml +4 -1
  80. data/config/locales/ja.yml +4 -1
  81. data/config/locales/ka.yml +4 -1
  82. data/config/locales/kk.yml +4 -1
  83. data/config/locales/ko.yml +4 -1
  84. data/config/locales/lt.yml +4 -1
  85. data/config/locales/lv.yml +4 -1
  86. data/config/locales/ms.yml +4 -1
  87. data/config/locales/mt.yml +4 -1
  88. data/config/locales/nl.yml +4 -1
  89. data/config/locales/no.yml +4 -1
  90. data/config/locales/pa-pk.yml +4 -1
  91. data/config/locales/pa.yml +4 -1
  92. data/config/locales/pl.yml +4 -1
  93. data/config/locales/ps.yml +4 -1
  94. data/config/locales/pt.yml +4 -1
  95. data/config/locales/ro.yml +4 -1
  96. data/config/locales/ru.yml +4 -1
  97. data/config/locales/si.yml +4 -1
  98. data/config/locales/sk.yml +4 -1
  99. data/config/locales/sl.yml +4 -1
  100. data/config/locales/so.yml +4 -1
  101. data/config/locales/sq.yml +4 -1
  102. data/config/locales/sr.yml +4 -1
  103. data/config/locales/sv.yml +4 -1
  104. data/config/locales/sw.yml +4 -1
  105. data/config/locales/ta.yml +4 -1
  106. data/config/locales/th.yml +4 -1
  107. data/config/locales/tk.yml +4 -1
  108. data/config/locales/tr.yml +4 -1
  109. data/config/locales/uk.yml +4 -1
  110. data/config/locales/ur.yml +4 -1
  111. data/config/locales/uz.yml +4 -1
  112. data/config/locales/vi.yml +4 -1
  113. data/config/locales/zh-hk.yml +4 -1
  114. data/config/locales/zh-tw.yml +4 -1
  115. data/config/locales/zh.yml +4 -1
  116. data/lib/govuk_publishing_components/presenters/contents_list_helper.rb +2 -1
  117. data/lib/govuk_publishing_components/version.rb +1 -1
  118. data/node_modules/govuk-frontend/dist/govuk/_base.scss +3 -3
  119. data/node_modules/govuk-frontend/dist/govuk/_base.scss.map +1 -1
  120. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +451 -176
  121. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -1
  122. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +450 -177
  123. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -1
  124. data/node_modules/govuk-frontend/dist/govuk/all.mjs +13 -76
  125. data/node_modules/govuk-frontend/dist/govuk/all.mjs.map +1 -1
  126. data/node_modules/govuk-frontend/dist/govuk/all.scss +1 -9
  127. data/node_modules/govuk-frontend/dist/govuk/all.scss.map +1 -1
  128. data/node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map +1 -1
  129. data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
  130. data/node_modules/govuk-frontend/dist/govuk/common/index.mjs +56 -36
  131. data/node_modules/govuk-frontend/dist/govuk/common/index.mjs.map +1 -1
  132. data/node_modules/govuk-frontend/dist/govuk/common/normalise-dataset.mjs +12 -20
  133. data/node_modules/govuk-frontend/dist/govuk/common/normalise-dataset.mjs.map +1 -1
  134. data/node_modules/govuk-frontend/dist/govuk/common/normalise-string.mjs +31 -0
  135. data/node_modules/govuk-frontend/dist/govuk/common/normalise-string.mjs.map +1 -0
  136. data/node_modules/govuk-frontend/dist/govuk/components/_all.scss +7 -35
  137. data/node_modules/govuk-frontend/dist/govuk/components/_all.scss.map +1 -1
  138. data/node_modules/govuk-frontend/dist/govuk/components/_index.scss +39 -0
  139. data/node_modules/govuk-frontend/dist/govuk/components/_index.scss.map +1 -0
  140. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +35 -31
  141. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss.map +1 -1
  142. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +177 -133
  143. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js.map +1 -1
  144. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +177 -133
  145. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs.map +1 -1
  146. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs +80 -76
  147. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs.map +1 -1
  148. data/node_modules/govuk-frontend/dist/govuk/components/accordion/fixtures.json +16 -3
  149. data/node_modules/govuk-frontend/dist/govuk/components/accordion/template.njk +2 -1
  150. data/node_modules/govuk-frontend/dist/govuk/components/back-link/fixtures.json +25 -15
  151. data/node_modules/govuk-frontend/dist/govuk/components/back-link/template-with-custom-link.html +1 -0
  152. data/node_modules/govuk-frontend/dist/govuk/components/back-link/template.njk +6 -2
  153. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/fixtures.json +53 -15
  154. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/macro-options.json +6 -0
  155. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-default.html +2 -2
  156. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-inverse.html +2 -2
  157. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-with-collapse-on-mobile.html +2 -2
  158. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-with-last-breadcrumb-as-current-page.html +2 -2
  159. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-with-multiple-levels.html +2 -2
  160. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-with-one-level.html +2 -2
  161. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-without-the-home-section.html +2 -2
  162. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template.njk +6 -4
  163. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js +97 -39
  164. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js.map +1 -1
  165. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs +97 -39
  166. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs.map +1 -1
  167. data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs +13 -3
  168. data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs.map +1 -1
  169. data/node_modules/govuk-frontend/dist/govuk/components/button/fixtures.json +38 -0
  170. data/node_modules/govuk-frontend/dist/govuk/components/button/template.njk +4 -2
  171. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +4 -4
  172. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss.map +1 -1
  173. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +125 -69
  174. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js.map +1 -1
  175. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +125 -69
  176. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs.map +1 -1
  177. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +17 -3
  178. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs.map +1 -1
  179. data/node_modules/govuk-frontend/dist/govuk/components/character-count/fixtures.json +46 -23
  180. data/node_modules/govuk-frontend/dist/govuk/components/character-count/macro-options.json +40 -0
  181. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-default.html +1 -4
  182. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-custom-rows.html +1 -4
  183. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-custom-textarea-description.html +1 -4
  184. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-default-value-exceeding-limit.html +1 -4
  185. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-default-value.html +1 -4
  186. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-hint.html +1 -4
  187. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-label-as-page-heading.html +1 -4
  188. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-threshold.html +1 -4
  189. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-translations.html +1 -4
  190. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-word-count.html +1 -4
  191. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template.njk +72 -39
  192. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss +10 -2
  193. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss.map +1 -1
  194. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js +9 -1
  195. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js.map +1 -1
  196. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs +9 -1
  197. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs.map +1 -1
  198. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs +1 -1
  199. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs.map +1 -1
  200. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/fixtures.json +153 -47
  201. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/macro-options.json +40 -0
  202. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-default.html +12 -12
  203. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-conditional-reveal.html +11 -12
  204. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-disabled.html +12 -12
  205. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-divider-and-none.html +34 -0
  206. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-error.html +12 -12
  207. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-hint.html +13 -13
  208. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-long-text.html +12 -12
  209. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small.html +12 -12
  210. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-a-medium-legend.html +12 -12
  211. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-conditional-item-checked.html +21 -24
  212. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-conditional-items-with-special-characters.html +21 -24
  213. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-conditional-items.html +21 -24
  214. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-disabled-item.html +10 -10
  215. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-and-none.html +17 -16
  216. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-none-and-conditional-items.html +24 -24
  217. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-error-message-and-hints-on-items.html +15 -15
  218. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-error-message.html +12 -12
  219. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-fieldset-and-error-message.html +12 -12
  220. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-hints-on-items.html +10 -10
  221. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-id-and-name.html +12 -12
  222. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-legend-as-a-page-heading.html +12 -12
  223. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-optional-form-group-classes-showing-group-error.html +21 -24
  224. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-pre-checked-values.html +15 -16
  225. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-single-option-and-hint-set-aria-describedby-on-input.html +5 -5
  226. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-single-option-set-aria-describedby-on-input.html +4 -4
  227. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-very-long-option-text.html +12 -12
  228. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-without-fieldset.html +12 -12
  229. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template.njk +58 -54
  230. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss +17 -14
  231. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss.map +1 -1
  232. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/fixtures.json +46 -23
  233. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-accepted-confirmation-banner.html +11 -8
  234. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-client-side-implementation.html +38 -29
  235. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-default.html +18 -13
  236. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-rejected-confirmation-banner.html +11 -8
  237. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-with-html.html +19 -15
  238. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template.njk +37 -44
  239. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +1 -2
  240. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss.map +1 -1
  241. data/node_modules/govuk-frontend/dist/govuk/components/date-input/fixtures.json +27 -0
  242. data/node_modules/govuk-frontend/dist/govuk/components/date-input/macro-options.json +40 -0
  243. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template.njk +10 -3
  244. data/node_modules/govuk-frontend/dist/govuk/components/details/fixtures.json +10 -0
  245. data/node_modules/govuk-frontend/dist/govuk/components/details/template.njk +6 -2
  246. data/node_modules/govuk-frontend/dist/govuk/components/error-message/fixtures.json +9 -0
  247. data/node_modules/govuk-frontend/dist/govuk/components/error-message/template.njk +4 -1
  248. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss +14 -3
  249. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss.map +1 -1
  250. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js +96 -37
  251. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js.map +1 -1
  252. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs +96 -37
  253. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs.map +1 -1
  254. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs +12 -1
  255. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs.map +1 -1
  256. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/fixtures.json +48 -18
  257. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/macro-options.json +2 -2
  258. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/template-default.html +8 -8
  259. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/template-mixed-with-and-without-links.html +8 -8
  260. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/template-with-description-only.html +12 -0
  261. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/template-with-everything.html +8 -8
  262. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/template-without-links.html +5 -5
  263. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/template.njk +19 -14
  264. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +112 -61
  265. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js.map +1 -1
  266. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +112 -61
  267. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs.map +1 -1
  268. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs +15 -4
  269. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs.map +1 -1
  270. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/fixtures.json +4 -0
  271. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/template.njk +3 -1
  272. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.scss +3 -5
  273. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.scss.map +1 -1
  274. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/fixtures.json +18 -0
  275. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template.njk +3 -1
  276. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +8 -9
  277. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss.map +1 -1
  278. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/fixtures.json +13 -0
  279. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/macro-options.json +40 -0
  280. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template.njk +10 -2
  281. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +1 -1
  282. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss.map +1 -1
  283. data/node_modules/govuk-frontend/dist/govuk/components/footer/fixtures.json +46 -23
  284. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-default.html +10 -9
  285. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-full-gds-example.html +41 -40
  286. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-three-equal-columns.html +10 -9
  287. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-html-content-licence-and-copyright-notice.html +5 -4
  288. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-meta.html +14 -13
  289. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-text-content-licence-and-copyright-notice.html +5 -4
  290. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-one-column.html +10 -9
  291. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-two-columns.html +10 -9
  292. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-meta-links-and-meta-content.html +56 -55
  293. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-meta.html +28 -27
  294. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-navigation.html +10 -9
  295. data/node_modules/govuk-frontend/dist/govuk/components/footer/template.njk +42 -38
  296. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +1 -1
  297. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +1 -1
  298. data/node_modules/govuk-frontend/dist/govuk/components/header/fixtures.json +49 -26
  299. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +8 -0
  300. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js.map +1 -1
  301. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +8 -0
  302. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs.map +1 -1
  303. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs.map +1 -1
  304. data/node_modules/govuk-frontend/dist/govuk/components/header/macro-options.json +1 -1
  305. data/node_modules/govuk-frontend/dist/govuk/components/header/template-default.html +13 -16
  306. data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width-with-navigation.html +35 -36
  307. data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width.html +13 -16
  308. data/node_modules/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-html.html +35 -36
  309. data/node_modules/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-text-without-link.html +29 -30
  310. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-label.html +40 -41
  311. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-text.html +40 -41
  312. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-navigation-label.html +40 -41
  313. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-large-navigation.html +100 -101
  314. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-navigation.html +40 -41
  315. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-product-name.html +13 -16
  316. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name-and-navigation.html +40 -41
  317. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name-but-no-service-url.html +13 -16
  318. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name.html +13 -16
  319. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-st-edwards-crown.html +21 -0
  320. data/node_modules/govuk-frontend/dist/govuk/components/header/template.njk +31 -26
  321. data/node_modules/govuk-frontend/dist/govuk/components/hint/fixtures.json +6 -0
  322. data/node_modules/govuk-frontend/dist/govuk/components/hint/template.njk +3 -1
  323. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +7 -4
  324. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss.map +1 -1
  325. data/node_modules/govuk-frontend/dist/govuk/components/input/fixtures.json +138 -25
  326. data/node_modules/govuk-frontend/dist/govuk/components/input/macro-options.json +67 -1
  327. data/node_modules/govuk-frontend/dist/govuk/components/input/template-disabled.html +6 -0
  328. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-autocapitalize-turned-off.html +6 -0
  329. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-error-and-hint.html +12 -0
  330. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-error-message.html +2 -5
  331. data/node_modules/govuk-frontend/dist/govuk/components/input/template.njk +70 -14
  332. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/fixtures.json +7 -1
  333. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/template-with-html.html +8 -9
  334. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/template.njk +4 -2
  335. data/node_modules/govuk-frontend/dist/govuk/components/label/fixtures.json +17 -0
  336. data/node_modules/govuk-frontend/dist/govuk/components/label/template.njk +3 -1
  337. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +3 -2
  338. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss.map +1 -1
  339. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/fixtures.json +50 -26
  340. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js +96 -37
  341. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js.map +1 -1
  342. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs +96 -37
  343. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs.map +1 -1
  344. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs +12 -1
  345. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs.map +1 -1
  346. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-auto-focus-disabled-with-type-as-success.html +4 -1
  347. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-auto-focus-explicitly-enabled-with-type-as-success.html +4 -1
  348. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-custom-tabindex.html +4 -1
  349. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-default.html +4 -1
  350. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-paragraph-as-html-heading.html +3 -2
  351. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-rolealert-overridden-to-roleregion-with-type-as-success.html +4 -1
  352. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-success-with-custom-html.html +9 -8
  353. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-a-list.html +9 -8
  354. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-long-heading.html +4 -1
  355. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-lots-of-content.html +12 -9
  356. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-text-as-html.html +8 -5
  357. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-type-as-success.html +4 -1
  358. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template.njk +11 -7
  359. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +24 -37
  360. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss.map +1 -1
  361. data/node_modules/govuk-frontend/dist/govuk/components/pagination/fixtures.json +30 -15
  362. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-default.html +38 -23
  363. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-first-page.html +28 -16
  364. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-last-page.html +29 -20
  365. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-custom-accessible-labels-on-item-links.html +38 -23
  366. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-custom-link-and-item-text.html +38 -23
  367. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-custom-navigation-landmark.html +38 -23
  368. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-many-pages.html +64 -39
  369. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-next-only.html +11 -4
  370. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-and-labels.html +25 -13
  371. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-and-very-long-labels.html +25 -13
  372. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-in-a-different-language.html +21 -11
  373. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only.html +21 -11
  374. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-previous-only.html +11 -7
  375. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template.njk +78 -63
  376. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +14 -10
  377. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss.map +1 -1
  378. data/node_modules/govuk-frontend/dist/govuk/components/panel/fixtures.json +9 -0
  379. data/node_modules/govuk-frontend/dist/govuk/components/panel/template.njk +6 -3
  380. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss +57 -0
  381. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss.map +1 -0
  382. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_password-input.scss +4 -0
  383. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_password-input.scss.map +1 -0
  384. data/node_modules/govuk-frontend/dist/govuk/components/password-input/fixtures.json +196 -0
  385. data/node_modules/govuk-frontend/dist/govuk/components/password-input/macro-options.json +181 -0
  386. data/node_modules/govuk-frontend/dist/govuk/components/password-input/macro.njk +3 -0
  387. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +528 -0
  388. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js.map +1 -0
  389. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +520 -0
  390. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs.map +1 -0
  391. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs +163 -0
  392. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs.map +1 -0
  393. data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-default.html +11 -0
  394. data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-error-message.html +17 -0
  395. data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-hint-text.html +14 -0
  396. data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-input-width-class.html +11 -0
  397. data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-label-as-page-heading.html +13 -0
  398. data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-new-password-autocomplete.html +11 -0
  399. data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-translations.html +11 -0
  400. data/node_modules/govuk-frontend/dist/govuk/components/password-input/template.njk +91 -0
  401. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +6 -8
  402. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss.map +1 -1
  403. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/fixtures.json +7 -0
  404. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/template.njk +4 -2
  405. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +11 -6
  406. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss.map +1 -1
  407. data/node_modules/govuk-frontend/dist/govuk/components/radios/fixtures.json +113 -48
  408. data/node_modules/govuk-frontend/dist/govuk/components/radios/macro-options.json +41 -1
  409. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js +8 -0
  410. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js.map +1 -1
  411. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs +8 -0
  412. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs.map +1 -1
  413. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs.map +1 -1
  414. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-default.html +8 -8
  415. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-inline.html +8 -8
  416. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-prechecked-using-value.html +8 -8
  417. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-prechecked.html +8 -8
  418. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-inline-extreme.html +40 -40
  419. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-inline.html +12 -12
  420. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-a-divider.html +13 -12
  421. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-conditional-reveal.html +15 -16
  422. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-disabled.html +12 -12
  423. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-error.html +12 -12
  424. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-hint.html +13 -13
  425. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-long-text.html +12 -12
  426. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small.html +12 -12
  427. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-a-divider.html +13 -12
  428. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-a-medium-legend.html +8 -8
  429. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-item-checked.html +21 -24
  430. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items-and-pre-checked-value.html +21 -24
  431. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items-with-special-characters.html +21 -24
  432. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items.html +21 -24
  433. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-disabled.html +10 -10
  434. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-fieldset-and-error-message.html +8 -8
  435. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-hints-on-items.html +10 -10
  436. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-idprefix.html +8 -8
  437. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-legend-as-page-heading.html +8 -8
  438. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-optional-form-group-classes-showing-group-error.html +21 -24
  439. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-very-long-option-text.html +12 -12
  440. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-without-fieldset.html +12 -12
  441. data/node_modules/govuk-frontend/dist/govuk/components/radios/template.njk +54 -50
  442. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +5 -5
  443. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss.map +1 -1
  444. data/node_modules/govuk-frontend/dist/govuk/components/select/fixtures.json +42 -23
  445. data/node_modules/govuk-frontend/dist/govuk/components/select/macro-options.json +40 -0
  446. data/node_modules/govuk-frontend/dist/govuk/components/select/template-default.html +3 -6
  447. data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-full-width-override.html +3 -6
  448. data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-hint-text-and-error-message.html +3 -6
  449. data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-label-as-page-heading.html +3 -6
  450. data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-optional-form-group-classes.html +3 -6
  451. data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-selected-value.html +3 -6
  452. data/node_modules/govuk-frontend/dist/govuk/components/select/template.njk +18 -8
  453. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +7 -4
  454. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss.map +1 -1
  455. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/fixtures.json +9 -0
  456. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js +8 -0
  457. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js.map +1 -1
  458. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs +8 -0
  459. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs.map +1 -1
  460. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs.map +1 -1
  461. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/template.njk +4 -1
  462. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +2 -1
  463. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss.map +1 -1
  464. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/fixtures.json +63 -32
  465. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-a-custom-header-level.html +25 -20
  466. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-a-html-header.html +25 -20
  467. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-a-text-header.html +25 -20
  468. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-actions-plus-summary-list-actions.html +46 -29
  469. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-actions.html +33 -23
  470. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-check-your-answers.html +96 -97
  471. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-default.html +35 -36
  472. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-extreme.html +261 -70
  473. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-no-border-on-last-row.html +35 -36
  474. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-no-border.html +35 -36
  475. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-overridden-widths.html +58 -45
  476. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-translated.html +51 -45
  477. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-with-actions.html +58 -45
  478. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-with-no-first-action.html +58 -59
  479. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-with-some-actions.html +45 -39
  480. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template.njk +68 -65
  481. data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss +10 -0
  482. data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss.map +1 -1
  483. data/node_modules/govuk-frontend/dist/govuk/components/table/fixtures.json +93 -21
  484. data/node_modules/govuk-frontend/dist/govuk/components/table/template-default.html +15 -15
  485. data/node_modules/govuk-frontend/dist/govuk/components/table/template-table-with-head-and-caption.html +15 -15
  486. data/node_modules/govuk-frontend/dist/govuk/components/table/template-table-with-head.html +15 -15
  487. data/node_modules/govuk-frontend/dist/govuk/components/table/template-with-small-text-modifier-for-tables-with-a-lot-of-data.html +19 -0
  488. data/node_modules/govuk-frontend/dist/govuk/components/table/template.njk +43 -31
  489. data/node_modules/govuk-frontend/dist/govuk/components/tabs/fixtures.json +27 -13
  490. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js +13 -11
  491. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js.map +1 -1
  492. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs +13 -11
  493. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs.map +1 -1
  494. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs +5 -11
  495. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs.map +1 -1
  496. data/node_modules/govuk-frontend/dist/govuk/components/tabs/template-default.html +110 -113
  497. data/node_modules/govuk-frontend/dist/govuk/components/tabs/template-tabs-with-anchor-in-panel.html +19 -21
  498. data/node_modules/govuk-frontend/dist/govuk/components/tabs/template.njk +30 -18
  499. data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss +11 -8
  500. data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss.map +1 -1
  501. data/node_modules/govuk-frontend/dist/govuk/components/tag/fixtures.json +14 -0
  502. data/node_modules/govuk-frontend/dist/govuk/components/tag/template.njk +5 -2
  503. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss +12 -10
  504. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss.map +1 -1
  505. data/node_modules/govuk-frontend/dist/govuk/components/task-list/fixtures.json +54 -10
  506. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-default.html +35 -28
  507. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-example-with-3-states.html +47 -38
  508. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-example-with-all-possible-colours.html +141 -116
  509. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-example-with-hint-text-and-additional-states.html +72 -59
  510. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-example-with-very-long-single-word-tags.html +35 -28
  511. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-with-empty-values.html +27 -0
  512. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template.njk +33 -23
  513. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +3 -3
  514. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss.map +1 -1
  515. data/node_modules/govuk-frontend/dist/govuk/components/textarea/fixtures.json +17 -0
  516. data/node_modules/govuk-frontend/dist/govuk/components/textarea/macro-options.json +40 -0
  517. data/node_modules/govuk-frontend/dist/govuk/components/textarea/template.njk +10 -2
  518. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +5 -5
  519. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss.map +1 -1
  520. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/fixtures.json +8 -0
  521. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/template.njk +3 -2
  522. data/node_modules/govuk-frontend/dist/govuk/core/_all.scss +8 -6
  523. data/node_modules/govuk-frontend/dist/govuk/core/_all.scss.map +1 -1
  524. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +1 -1
  525. data/node_modules/govuk-frontend/dist/govuk/core/_index.scss +8 -0
  526. data/node_modules/govuk-frontend/dist/govuk/core/_index.scss.map +1 -0
  527. data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs.map +1 -1
  528. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend-component.mjs.map +1 -1
  529. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
  530. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
  531. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
  532. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -1
  533. data/node_modules/govuk-frontend/dist/govuk/helpers/_all.scss +8 -12
  534. data/node_modules/govuk-frontend/dist/govuk/helpers/_all.scss.map +1 -1
  535. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +44 -8
  536. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss.map +1 -1
  537. data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss +1 -1
  538. data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss.map +1 -1
  539. data/node_modules/govuk-frontend/dist/govuk/helpers/_index.scss +14 -0
  540. data/node_modules/govuk-frontend/dist/govuk/helpers/_index.scss.map +1 -0
  541. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +2 -2
  542. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss.map +1 -1
  543. data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.scss +1 -1
  544. data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.scss.map +1 -1
  545. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +19 -0
  546. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss.map +1 -1
  547. data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss +30 -62
  548. data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss.map +1 -1
  549. data/node_modules/govuk-frontend/dist/govuk/i18n.mjs +18 -12
  550. data/node_modules/govuk-frontend/dist/govuk/i18n.mjs.map +1 -1
  551. data/node_modules/govuk-frontend/dist/govuk/index.scss +11 -0
  552. data/node_modules/govuk-frontend/dist/govuk/index.scss.map +1 -0
  553. data/node_modules/govuk-frontend/dist/govuk/init.mjs +100 -0
  554. data/node_modules/govuk-frontend/dist/govuk/init.mjs.map +1 -0
  555. data/node_modules/govuk-frontend/dist/govuk/macros/attributes.njk +94 -0
  556. data/node_modules/govuk-frontend/dist/govuk/objects/_all.scss +8 -6
  557. data/node_modules/govuk-frontend/dist/govuk/objects/_all.scss.map +1 -1
  558. data/node_modules/govuk-frontend/dist/govuk/objects/_index.scss +8 -0
  559. data/node_modules/govuk-frontend/dist/govuk/objects/_index.scss.map +1 -0
  560. data/node_modules/govuk-frontend/dist/govuk/overrides/_all.scss +7 -5
  561. data/node_modules/govuk-frontend/dist/govuk/overrides/_all.scss.map +1 -1
  562. data/node_modules/govuk-frontend/dist/govuk/overrides/_index.scss +7 -0
  563. data/node_modules/govuk-frontend/dist/govuk/overrides/_index.scss.map +1 -0
  564. data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss +10 -0
  565. data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss.map +1 -1
  566. data/node_modules/govuk-frontend/dist/govuk/settings/_all.scss +8 -21
  567. data/node_modules/govuk-frontend/dist/govuk/settings/_all.scss.map +1 -1
  568. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +235 -9
  569. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss.map +1 -1
  570. data/node_modules/govuk-frontend/dist/govuk/settings/_index.scss +23 -0
  571. data/node_modules/govuk-frontend/dist/govuk/settings/_index.scss.map +1 -0
  572. data/node_modules/govuk-frontend/dist/govuk/settings/_measurements.scss +1 -1
  573. data/node_modules/govuk-frontend/dist/govuk/settings/_measurements.scss.map +1 -1
  574. data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss +1 -1
  575. data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss.map +1 -1
  576. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss +172 -13
  577. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss.map +1 -1
  578. data/node_modules/govuk-frontend/dist/govuk/settings/_warnings.scss +8 -3
  579. data/node_modules/govuk-frontend/dist/govuk/settings/_warnings.scss.map +1 -1
  580. data/node_modules/govuk-frontend/dist/govuk/template.njk +3 -2
  581. data/node_modules/govuk-frontend/dist/govuk/tools/_all.scss +8 -5
  582. data/node_modules/govuk-frontend/dist/govuk/tools/_all.scss.map +1 -1
  583. data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss +7 -0
  584. data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss.map +1 -0
  585. data/node_modules/govuk-frontend/dist/govuk/utilities/_all.scss +8 -2
  586. data/node_modules/govuk-frontend/dist/govuk/utilities/_all.scss.map +1 -1
  587. data/node_modules/govuk-frontend/dist/govuk/utilities/_index.scss +4 -0
  588. data/node_modules/govuk-frontend/dist/govuk/utilities/_index.scss.map +1 -0
  589. data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +5 -1
  590. data/node_modules/govuk-frontend/package.json +16 -15
  591. metadata +60 -3
@@ -10,18 +10,21 @@ class I18n {
10
10
  if (!lookupKey) {
11
11
  throw new Error('i18n: lookup key missing');
12
12
  }
13
- if (typeof (options == null ? void 0 : options.count) === 'number') {
14
- lookupKey = `${lookupKey}.${this.getPluralSuffix(lookupKey, options.count)}`;
13
+ let translation = this.translations[lookupKey];
14
+ if (typeof (options == null ? void 0 : options.count) === 'number' && typeof translation === 'object') {
15
+ const translationPluralForm = translation[this.getPluralSuffix(lookupKey, options.count)];
16
+ if (translationPluralForm) {
17
+ translation = translationPluralForm;
18
+ }
15
19
  }
16
- const translationString = this.translations[lookupKey];
17
- if (typeof translationString === 'string') {
18
- if (translationString.match(/%{(.\S+)}/)) {
20
+ if (typeof translation === 'string') {
21
+ if (translation.match(/%{(.\S+)}/)) {
19
22
  if (!options) {
20
23
  throw new Error('i18n: cannot replace placeholders in string if no option data provided');
21
24
  }
22
- return this.replacePlaceholders(translationString, options);
25
+ return this.replacePlaceholders(translation, options);
23
26
  }
24
- return translationString;
27
+ return translation;
25
28
  }
26
29
  return lookupKey;
27
30
  }
@@ -49,12 +52,15 @@ class I18n {
49
52
  if (!isFinite(count)) {
50
53
  return 'other';
51
54
  }
55
+ const translation = this.translations[lookupKey];
52
56
  const preferredForm = this.hasIntlPluralRulesSupport() ? new Intl.PluralRules(this.locale).select(count) : this.selectPluralFormUsingFallbackRules(count);
53
- if (`${lookupKey}.${preferredForm}` in this.translations) {
54
- return preferredForm;
55
- } else if (`${lookupKey}.other` in this.translations) {
56
- console.warn(`i18n: Missing plural form ".${preferredForm}" for "${this.locale}" locale. Falling back to ".other".`);
57
- return 'other';
57
+ if (typeof translation === 'object') {
58
+ if (preferredForm in translation) {
59
+ return preferredForm;
60
+ } else if ('other' in translation) {
61
+ console.warn(`i18n: Missing plural form ".${preferredForm}" for "${this.locale}" locale. Falling back to ".other".`);
62
+ return 'other';
63
+ }
58
64
  }
59
65
  throw new Error(`i18n: Plural form ".other" is required for "${this.locale}" locale`);
60
66
  }
@@ -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]: unknown }} 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 // 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') {\n // Get the plural suffix\n lookupKey = `${lookupKey}.${this.getPluralSuffix(\n lookupKey,\n options.count\n )}`\n }\n\n // Fetch the translation string for that lookup key\n const translationString = this.translations[lookupKey]\n\n if (typeof translationString === 'string') {\n // Check for ${} placeholders in the translation string\n if (translationString.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(translationString, options)\n }\n\n return translationString\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 // 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 (`${lookupKey}.${preferredForm}` in this.translations) {\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 (`${lookupKey}.other` in this.translations) {\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 // 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","count","getPluralSuffix","translationString","match","replacePlaceholders","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,CAAA;AAAA,IAAA,IAAA,CAT5CF,YAAY,GAAA,KAAA,CAAA,CAAA;AAAA,IAAA,IAAA,CACZG,MAAM,GAAA,KAAA,CAAA,CAAA;IAUJ,IAAI,CAACH,YAAY,GAAGA,YAAY,CAAA;AAGhC,IAAA,IAAI,CAACG,MAAM,GAAA,CAAAD,cAAA,GAAGD,MAAM,CAACE,MAAM,KAAAD,IAAAA,GAAAA,cAAA,GAAKE,QAA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CAAA;AACf,KAAA;AACA,IAAA,OAAO,OAAO,CAAA;GACf;EACDD,KAAKA,CAACC,CAAC,EAAE;IACP,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,MAAM,CAAA;AACf,KAAA;IACA,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,KAAK,CAAA;AACd,KAAA;IACA,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,KAAK,CAAA;AACd,KAAA;IACA,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,KAAK,CAAA;AACd,KAAA;IACA,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,MAAM,CAAA;AACf,KAAA;AACA,IAAA,OAAO,OAAO,CAAA;AAChB,GAAA;AACF,CAAC;;;;"}
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,CAAA;AAAA,IAAA,IAAA,CAT5CF,YAAY,GAAA,KAAA,CAAA,CAAA;AAAA,IAAA,IAAA,CACZG,MAAM,GAAA,KAAA,CAAA,CAAA;IAUJ,IAAI,CAACH,YAAY,GAAGA,YAAY,CAAA;AAGhC,IAAA,IAAI,CAACG,MAAM,GAAA,CAAAD,cAAA,GAAGD,MAAM,CAACE,MAAM,KAAAD,IAAAA,GAAAA,cAAA,GAAKE,QAAQ,CAACC,eAAe,CAACC,IAAI,IAAI,IAAK,CAAA;AACxE,GAAA;AAaAC,EAAAA,CAACA,CAACC,SAAS,EAAEC,OAAO,EAAE;IACpB,IAAI,CAACD,SAAS,EAAE;AAEd,MAAA,MAAM,IAAIE,KAAK,CAAC,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,CAAA;GACf;EACDD,KAAKA,CAACC,CAAC,EAAE;IACP,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,MAAM,CAAA;AACf,KAAA;IACA,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,KAAK,CAAA;AACd,KAAA;IACA,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,KAAK,CAAA;AACd,KAAA;IACA,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,KAAK,CAAA;AACd,KAAA;IACA,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,MAAM,CAAA;AACf,KAAA;AACA,IAAA,OAAO,OAAO,CAAA;AAChB,GAAA;AACF,CAAC;;;;"}
@@ -0,0 +1,11 @@
1
+ @import "base";
2
+
3
+ @import "core/index";
4
+ @import "objects/index";
5
+
6
+ @import "components/index";
7
+
8
+ @import "utilities/index";
9
+ @import "overrides/index";
10
+
11
+ /*# sourceMappingURL=index.scss.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/govuk/index.scss"],"names":[],"mappings":"AAAA,cAAc;;AAEd,oBAAoB;AACpB,uBAAuB;;AAEvB,0BAA0B;;AAE1B,yBAAyB;AACzB,yBAAyB","file":"index.scss","sourcesContent":["@import \"base\";\n\n@import \"core/index\";\n@import \"objects/index\";\n\n@import \"components/index\";\n\n@import \"utilities/index\";\n@import \"overrides/index\";\n"]}
@@ -0,0 +1,100 @@
1
+ import { isSupported } from './common/index.mjs';
2
+ import { Accordion } from './components/accordion/accordion.mjs';
3
+ import { Button } from './components/button/button.mjs';
4
+ import { CharacterCount } from './components/character-count/character-count.mjs';
5
+ import { Checkboxes } from './components/checkboxes/checkboxes.mjs';
6
+ import { ErrorSummary } from './components/error-summary/error-summary.mjs';
7
+ import { ExitThisPage } from './components/exit-this-page/exit-this-page.mjs';
8
+ import { Header } from './components/header/header.mjs';
9
+ import { NotificationBanner } from './components/notification-banner/notification-banner.mjs';
10
+ import { PasswordInput } from './components/password-input/password-input.mjs';
11
+ import { Radios } from './components/radios/radios.mjs';
12
+ import { SkipLink } from './components/skip-link/skip-link.mjs';
13
+ import { Tabs } from './components/tabs/tabs.mjs';
14
+ import { SupportError } from './errors/index.mjs';
15
+
16
+ /**
17
+ * Initialise all components
18
+ *
19
+ * Use the `data-module` attributes to find, instantiate and init all of the
20
+ * components provided as part of GOV.UK Frontend.
21
+ *
22
+ * @param {Config & { scope?: Element }} [config] - Config for all components (with optional scope)
23
+ */
24
+ function initAll(config) {
25
+ var _config$scope;
26
+ config = typeof config !== 'undefined' ? config : {};
27
+ if (!isSupported()) {
28
+ console.log(new SupportError());
29
+ return;
30
+ }
31
+ const components = [[Accordion, config.accordion], [Button, config.button], [CharacterCount, config.characterCount], [Checkboxes], [ErrorSummary, config.errorSummary], [ExitThisPage, config.exitThisPage], [Header], [NotificationBanner, config.notificationBanner], [PasswordInput, config.passwordInput], [Radios], [SkipLink], [Tabs]];
32
+ const $scope = (_config$scope = config.scope) != null ? _config$scope : document;
33
+ components.forEach(([Component, config]) => {
34
+ createAll(Component, config, $scope);
35
+ });
36
+ }
37
+
38
+ /**
39
+ * Create all instances of a specific component on the page
40
+ *
41
+ * Uses the `data-module` attribute to find all elements matching the specified
42
+ * component on the page, creating instances of the component object for each
43
+ * of them.
44
+ *
45
+ * Any component errors will be caught and logged to the console.
46
+ *
47
+ * @template {CompatibleClass} T
48
+ * @param {T} Component - class of the component to create
49
+ * @param {T["defaults"]} [config] - config for the component
50
+ * @param {Element|Document} [$scope] - scope of the document to search within
51
+ * @returns {Array<InstanceType<T>>} - array of instantiated components
52
+ */
53
+ function createAll(Component, config, $scope = document) {
54
+ const $elements = $scope.querySelectorAll(`[data-module="${Component.moduleName}"]`);
55
+ return Array.from($elements).map($element => {
56
+ try {
57
+ return 'defaults' in Component && typeof config !== 'undefined' ? new Component($element, config) : new Component($element);
58
+ } catch (error) {
59
+ console.log(error);
60
+ return null;
61
+ }
62
+ }).filter(Boolean);
63
+ }
64
+ /**
65
+ * @typedef {{new (...args: any[]): any, defaults?: object, moduleName: string}} CompatibleClass
66
+ */
67
+ /**
68
+ * Config for all components via `initAll()`
69
+ *
70
+ * @typedef {object} Config
71
+ * @property {AccordionConfig} [accordion] - Accordion config
72
+ * @property {ButtonConfig} [button] - Button config
73
+ * @property {CharacterCountConfig} [characterCount] - Character Count config
74
+ * @property {ErrorSummaryConfig} [errorSummary] - Error Summary config
75
+ * @property {ExitThisPageConfig} [exitThisPage] - Exit This Page config
76
+ * @property {NotificationBannerConfig} [notificationBanner] - Notification Banner config
77
+ * @property {PasswordInputConfig} [passwordInput] - Password input config
78
+ */
79
+ /**
80
+ * Config for individual components
81
+ *
82
+ * @typedef {import('./components/accordion/accordion.mjs').AccordionConfig} AccordionConfig
83
+ * @typedef {import('./components/accordion/accordion.mjs').AccordionTranslations} AccordionTranslations
84
+ * @typedef {import('./components/button/button.mjs').ButtonConfig} ButtonConfig
85
+ * @typedef {import('./components/character-count/character-count.mjs').CharacterCountConfig} CharacterCountConfig
86
+ * @typedef {import('./components/character-count/character-count.mjs').CharacterCountTranslations} CharacterCountTranslations
87
+ * @typedef {import('./components/error-summary/error-summary.mjs').ErrorSummaryConfig} ErrorSummaryConfig
88
+ * @typedef {import('./components/exit-this-page/exit-this-page.mjs').ExitThisPageConfig} ExitThisPageConfig
89
+ * @typedef {import('./components/exit-this-page/exit-this-page.mjs').ExitThisPageTranslations} ExitThisPageTranslations
90
+ * @typedef {import('./components/notification-banner/notification-banner.mjs').NotificationBannerConfig} NotificationBannerConfig
91
+ * @typedef {import('./components/password-input/password-input.mjs').PasswordInputConfig} PasswordInputConfig
92
+ */
93
+ /**
94
+ * Component config keys, e.g. `accordion` and `characterCount`
95
+ *
96
+ * @typedef {keyof Config} ConfigKey
97
+ */
98
+
99
+ export { createAll, initAll };
100
+ //# sourceMappingURL=init.mjs.map
@@ -0,0 +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 { 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 { 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 }} [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 console.log(new SupportError())\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 [Header],\n [NotificationBanner, config.notificationBanner],\n [PasswordInput, config.passwordInput],\n [Radios],\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 components.forEach(([Component, config]) => {\n createAll(Component, config, $scope)\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} T\n * @param {T} Component - class of the component to create\n * @param {T[\"defaults\"]} [config] - config for the component\n * @param {Element|Document} [$scope] - scope of the document to search within\n * @returns {Array<InstanceType<T>>} - array of instantiated components\n */\nfunction createAll(Component, config, $scope = document) {\n const $elements = $scope.querySelectorAll(\n `[data-module=\"${Component.moduleName}\"]`\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 'defaults' in Component && typeof config !== 'undefined'\n ? new Component($element, config)\n : new Component($element)\n } catch (error) {\n console.log(error)\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, defaults?: object, 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 {NotificationBannerConfig} [notificationBanner] - Notification Banner config\n * @property {PasswordInputConfig} [passwordInput] - Password input config\n */\n\n/**\n * Config for individual components\n *\n * @typedef {import('./components/accordion/accordion.mjs').AccordionConfig} AccordionConfig\n * @typedef {import('./components/accordion/accordion.mjs').AccordionTranslations} AccordionTranslations\n * @typedef {import('./components/button/button.mjs').ButtonConfig} ButtonConfig\n * @typedef {import('./components/character-count/character-count.mjs').CharacterCountConfig} CharacterCountConfig\n * @typedef {import('./components/character-count/character-count.mjs').CharacterCountTranslations} CharacterCountTranslations\n * @typedef {import('./components/error-summary/error-summary.mjs').ErrorSummaryConfig} ErrorSummaryConfig\n * @typedef {import('./components/exit-this-page/exit-this-page.mjs').ExitThisPageConfig} ExitThisPageConfig\n * @typedef {import('./components/exit-this-page/exit-this-page.mjs').ExitThisPageTranslations} ExitThisPageTranslations\n * @typedef {import('./components/notification-banner/notification-banner.mjs').NotificationBannerConfig} NotificationBannerConfig\n * @typedef {import('./components/password-input/password-input.mjs').PasswordInputConfig} PasswordInputConfig\n */\n\n/**\n * Component config keys, e.g. `accordion` and `characterCount`\n *\n * @typedef {keyof Config} ConfigKey\n */\n"],"names":["initAll","config","_config$scope","isSupported","console","log","SupportError","components","Accordion","accordion","Button","button","CharacterCount","characterCount","Checkboxes","ErrorSummary","errorSummary","ExitThisPage","exitThisPage","Header","NotificationBanner","notificationBanner","PasswordInput","passwordInput","Radios","SkipLink","Tabs","$scope","scope","document","forEach","Component","createAll","$elements","querySelectorAll","moduleName","Array","from","map","$element","error","filter","Boolean"],"mappings":";;;;;;;;;;;;;;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAOA,CAACC,MAAM,EAAE;AAAA,EAAA,IAAAC,aAAA,CAAA;EACvBD,MAAM,GAAG,OAAOA,MAAM,KAAK,WAAW,GAAGA,MAAM,GAAG,EAAE,CAAA;AAGpD,EAAA,IAAI,CAACE,WAAW,EAAE,EAAE;AAClBC,IAAAA,OAAO,CAACC,GAAG,CAAC,IAAIC,YAAY,EAAE,CAAC,CAAA;AAC/B,IAAA,OAAA;AACF,GAAA;AAEA,EAAA,MAAMC,UAAU,GAAyB,CACvC,CAACC,SAAS,EAAEP,MAAM,CAACQ,SAAS,CAAC,E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,GAC/B,IAAI8B,SAAS,CAACQ,QAAQ,CAAC,CAAA;KAC5B,CAAC,OAAOC,KAAK,EAAE;AACdpC,MAAAA,OAAO,CAACC,GAAG,CAACmC,KAAK,CAAC,CAAA;AAClB,MAAA,OAAO,IAAI,CAAA;AACb,KAAA;AACF,GAAC,CAAC,CACDC,MAAM,CAACC,OAAO,CAAC,CAAA;AACpB,CAAA;AAUA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;;;"}
@@ -0,0 +1,94 @@
1
+ {#
2
+ Renders component attributes as string
3
+
4
+ * By default or using `optional: false`, attributes render as ` name="value"`
5
+ * Using `optional: true`, attributes with empty (`null`, `undefined` or `false`) values are omitted
6
+ * Using `optional: true`, attributes with `true` (boolean) values render `name` only without value
7
+
8
+ {@link https://developer.mozilla.org/en-US/docs/Glossary/Boolean/HTML}
9
+
10
+ @example
11
+ Output attribute ` aria-hidden="true"` when `true` (boolean) or `"true"` (string)
12
+
13
+ ```njk
14
+ govukAttributes({
15
+ "aria-hidden": true
16
+ })
17
+ ```
18
+
19
+ @example
20
+ Output attribute ` aria-hidden="false"` when `false` (boolean) or `"false"` (string)
21
+
22
+ ```njk
23
+ govukAttributes({
24
+ "aria-hidden": false
25
+ })
26
+ ```
27
+
28
+ @example
29
+ Output attribute ` hidden=""` when `null`, `undefined` or empty `""` (string)
30
+
31
+ ```njk
32
+ govukAttributes({
33
+ "hidden": undefined
34
+ })
35
+ ```
36
+
37
+ @example
38
+ Output attribute ` hidden` as boolean attribute when optional and `true`
39
+
40
+ ```njk
41
+ govukAttributes({
42
+ hidden: {
43
+ value: true,
44
+ optional: true
45
+ },
46
+ })
47
+ ```
48
+
49
+ @example
50
+ Output empty string when optional and `null`, `undefined` or `false`
51
+
52
+ ```njk
53
+ govukAttributes({
54
+ hidden: {
55
+ value: undefined,
56
+ optional: true
57
+ },
58
+ })
59
+ ```
60
+
61
+ @private
62
+ @param {{ [attribute: string]: string | { value: string, optional?: boolean } } | string} attributes - Component attributes param
63
+ #}
64
+ {% macro govukAttributes(attributes) -%}
65
+ {#- Default attributes output -#}
66
+ {% set attributesHtml = attributes if attributes is string else "" %}
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 %}
76
+
77
+ {#- Set default attribute options -#}
78
+ {% set options = value if value is mapping else {
79
+ value: value,
80
+ optional: false
81
+ } %}
82
+
83
+ {#- Output ` name` only (no value) for boolean attributes -#}
84
+ {% if options.optional === true and options.value === true %}
85
+ {% set attributesHtml = attributesHtml + " " + name | escape %}
86
+ {#- 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 + '"' %}
89
+ {% endif %}
90
+ {% endfor %}
91
+ {% endif -%}
92
+
93
+ {{- attributesHtml | safe -}}
94
+ {%- endmacro %}
@@ -1,8 +1,10 @@
1
- @import "button-group";
2
- @import "form-group";
3
- @import "grid";
4
- @import "main-wrapper";
5
- @import "template";
6
- @import "width-container";
1
+ @import "../settings/warnings";
2
+ @import "index";
3
+
4
+ @include _warning(
5
+ "import-using-all",
6
+ "Importing using 'govuk/objects/all' is deprecated. Update your import statement to import 'govuk/objects/index'.",
7
+ $silence-further-warnings: false
8
+ );
7
9
 
8
10
  /*# sourceMappingURL=_all.scss.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/govuk/objects/_all.scss"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,oBAAoB;AACpB,cAAc;AACd,sBAAsB;AACtB,kBAAkB;AAClB,yBAAyB","file":"_all.scss","sourcesContent":["@import \"button-group\";\n@import \"form-group\";\n@import \"grid\";\n@import \"main-wrapper\";\n@import \"template\";\n@import \"width-container\";\n"]}
1
+ {"version":3,"sources":["../../../src/govuk/objects/_all.scss"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,eAAe;;AAEf;;;;CAIC","file":"_all.scss","sourcesContent":["@import \"../settings/warnings\";\n@import \"index\";\n\n@include _warning(\n \"import-using-all\",\n \"Importing using 'govuk/objects/all' is deprecated. Update your import statement to import 'govuk/objects/index'.\",\n $silence-further-warnings: false\n);\n"]}
@@ -0,0 +1,8 @@
1
+ @import "button-group";
2
+ @import "form-group";
3
+ @import "grid";
4
+ @import "main-wrapper";
5
+ @import "template";
6
+ @import "width-container";
7
+
8
+ /*# sourceMappingURL=_index.scss.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/govuk/objects/_index.scss"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,oBAAoB;AACpB,cAAc;AACd,sBAAsB;AACtB,kBAAkB;AAClB,yBAAyB","file":"_index.scss","sourcesContent":["@import \"button-group\";\n@import \"form-group\";\n@import \"grid\";\n@import \"main-wrapper\";\n@import \"template\";\n@import \"width-container\";\n"]}
@@ -1,7 +1,9 @@
1
- @import "display";
2
- @import "spacing";
3
- @import "text-align";
4
- @import "typography";
5
- @import "width";
1
+ @import "../settings/warnings";
2
+ @import "index";
3
+
4
+ @include _warning(
5
+ "import-using-all",
6
+ "Importing using 'govuk/overrides/all' is deprecated. Update your import statement to import 'govuk/overrides/index'."
7
+ );
6
8
 
7
9
  /*# sourceMappingURL=_all.scss.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/govuk/overrides/_all.scss"],"names":[],"mappings":"AAAA,iBAAiB;AACjB,iBAAiB;AACjB,oBAAoB;AACpB,oBAAoB;AACpB,eAAe","file":"_all.scss","sourcesContent":["@import \"display\";\n@import \"spacing\";\n@import \"text-align\";\n@import \"typography\";\n@import \"width\";\n"]}
1
+ {"version":3,"sources":["../../../src/govuk/overrides/_all.scss"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,eAAe;;AAEf;;;CAGC","file":"_all.scss","sourcesContent":["@import \"../settings/warnings\";\n@import \"index\";\n\n@include _warning(\n \"import-using-all\",\n \"Importing using 'govuk/overrides/all' is deprecated. Update your import statement to import 'govuk/overrides/index'.\"\n);\n"]}
@@ -0,0 +1,7 @@
1
+ @import "display";
2
+ @import "spacing";
3
+ @import "text-align";
4
+ @import "typography";
5
+ @import "width";
6
+
7
+ /*# sourceMappingURL=_index.scss.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/govuk/overrides/_index.scss"],"names":[],"mappings":"AAAA,iBAAiB;AACjB,iBAAiB;AACjB,oBAAoB;AACpB,oBAAoB;AACpB,eAAe","file":"_index.scss","sourcesContent":["@import \"display\";\n@import \"spacing\";\n@import \"text-align\";\n@import \"typography\";\n@import \"width\";\n"]}
@@ -27,6 +27,16 @@
27
27
  .govuk-\!-font-weight-bold {
28
28
  @include govuk-typography-weight-bold($important: true);
29
29
  }
30
+
31
+ // Typography helpers
32
+
33
+ .govuk-\!-font-tabular-numbers {
34
+ @include govuk-font-tabular-numbers($important: true);
35
+ }
36
+
37
+ .govuk-\!-text-break-word {
38
+ @include govuk-text-break-word($important: true);
39
+ }
30
40
  }
31
41
 
32
42
  /*# sourceMappingURL=_typography.scss.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/govuk/overrides/_typography.scss"],"names":[],"mappings":"AAAA;EACE,2BAA2B;;EAE3B,0EAA0E;EAC1E,4CAA4C;EAC5C,CAAC;EACD,oCAAoC;EACpC;IACE;MACE,kDAAkD;;MAElD,oDAAoD;MACpD;QACE,gBAAgB;MAClB;;MAEA,iDAAiD;IACnD;EACF;;EAEA,SAAS;;EAET;IACE,0DAA0D;EAC5D;;EAEA;IACE,uDAAuD;EACzD;AACF","file":"_typography.scss","sourcesContent":["@include govuk-exports(\"govuk/overrides/typography\") {\n // Font size and line height\n\n // Generate typography override classes for each responsive font map in the\n // typography scale eg .govuk-\\!-font-size-80\n //\n // govuk-!-font-size-14 is deprecated\n @each $size, $font-map in $govuk-typography-scale {\n .govuk-\\!-font-size-#{$size} {\n $font-map: map-get($govuk-typography-scale, $size);\n\n // Add underscore to deprecated typography scale keys\n @if map-has-key($font-map, \"deprecation\") {\n $size: _#{$size};\n }\n\n @include govuk-font-size($size, $important: true);\n }\n }\n\n // Weights\n\n .govuk-\\!-font-weight-regular {\n @include govuk-typography-weight-regular($important: true);\n }\n\n .govuk-\\!-font-weight-bold {\n @include govuk-typography-weight-bold($important: true);\n }\n}\n"]}
1
+ {"version":3,"sources":["../../../src/govuk/overrides/_typography.scss"],"names":[],"mappings":"AAAA;EACE,2BAA2B;;EAE3B,0EAA0E;EAC1E,4CAA4C;EAC5C,CAAC;EACD,oCAAoC;EACpC;IACE;MACE,kDAAkD;;MAElD,oDAAoD;MACpD;QACE,gBAAgB;MAClB;;MAEA,iDAAiD;IACnD;EACF;;EAEA,SAAS;;EAET;IACE,0DAA0D;EAC5D;;EAEA;IACE,uDAAuD;EACzD;;EAEA,oBAAoB;;EAEpB;IACE,qDAAqD;EACvD;;EAEA;IACE,gDAAgD;EAClD;AACF","file":"_typography.scss","sourcesContent":["@include govuk-exports(\"govuk/overrides/typography\") {\n // Font size and line height\n\n // Generate typography override classes for each responsive font map in the\n // typography scale eg .govuk-\\!-font-size-80\n //\n // govuk-!-font-size-14 is deprecated\n @each $size, $font-map in $govuk-typography-scale {\n .govuk-\\!-font-size-#{$size} {\n $font-map: map-get($govuk-typography-scale, $size);\n\n // Add underscore to deprecated typography scale keys\n @if map-has-key($font-map, \"deprecation\") {\n $size: _#{$size};\n }\n\n @include govuk-font-size($size, $important: true);\n }\n }\n\n // Weights\n\n .govuk-\\!-font-weight-regular {\n @include govuk-typography-weight-regular($important: true);\n }\n\n .govuk-\\!-font-weight-bold {\n @include govuk-typography-weight-bold($important: true);\n }\n\n // Typography helpers\n\n .govuk-\\!-font-tabular-numbers {\n @include govuk-font-tabular-numbers($important: true);\n }\n\n .govuk-\\!-text-break-word {\n @include govuk-text-break-word($important: true);\n }\n}\n"]}
@@ -1,23 +1,10 @@
1
- // The order we import settings in is important, as some settings files rely on
2
- // others
3
-
4
- @import "assets";
5
-
6
- @import "warnings";
7
- @import "global-styles";
8
-
9
- @import "media-queries";
10
-
11
- @import "colours-palette";
12
- @import "colours-organisations";
13
- @import "colours-applied";
14
-
15
- @import "spacing";
16
- @import "measurements";
17
-
18
- @import "typography-font";
19
- @import "typography-responsive";
20
-
21
- @import "links";
1
+ @import "../settings/warnings";
2
+ @import "index";
3
+
4
+ @include _warning(
5
+ "import-using-all",
6
+ "Importing using 'govuk/settings/all' is deprecated. Update your import statement to import 'govuk/settings/index'.",
7
+ $silence-further-warnings: false
8
+ );
22
9
 
23
10
  /*# sourceMappingURL=_all.scss.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/govuk/settings/_all.scss"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,QAAQ;;AAER,gBAAgB;;AAEhB,kBAAkB;AAClB,uBAAuB;;AAEvB,uBAAuB;;AAEvB,yBAAyB;AACzB,+BAA+B;AAC/B,yBAAyB;;AAEzB,iBAAiB;AACjB,sBAAsB;;AAEtB,yBAAyB;AACzB,+BAA+B;;AAE/B,eAAe","file":"_all.scss","sourcesContent":["// The order we import settings in is important, as some settings files rely on\n// others\n\n@import \"assets\";\n\n@import \"warnings\";\n@import \"global-styles\";\n\n@import \"media-queries\";\n\n@import \"colours-palette\";\n@import \"colours-organisations\";\n@import \"colours-applied\";\n\n@import \"spacing\";\n@import \"measurements\";\n\n@import \"typography-font\";\n@import \"typography-responsive\";\n\n@import \"links\";\n"]}
1
+ {"version":3,"sources":["../../../src/govuk/settings/_all.scss"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,eAAe;;AAEf;;;;CAIC","file":"_all.scss","sourcesContent":["@import \"../settings/warnings\";\n@import \"index\";\n\n@include _warning(\n \"import-using-all\",\n \"Importing using 'govuk/settings/all' is deprecated. Update your import statement to import 'govuk/settings/index'.\",\n $silence-further-warnings: false\n);\n"]}