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
@@ -1 +1 @@
1
- {"version":3,"file":"skip-link.bundle.js","sources":["../../../../src/govuk/common/index.mjs","../../../../src/govuk/errors/index.mjs","../../../../src/govuk/govuk-frontend-component.mjs","../../../../src/govuk/components/skip-link/skip-link.mjs"],"sourcesContent":["/**\n * Common helpers which do not require polyfill.\n *\n * IMPORTANT: If a helper require a polyfill, please isolate it in its own module\n * so that the polyfill can be properly tree-shaken and does not burden\n * the components that do not need that helper\n */\n\n/**\n * Config flattening function\n *\n * Takes any number of objects, flattens them into namespaced key-value pairs,\n * (e.g. \\{'i18n.showSection': 'Show section'\\}) and combines them together, with\n * greatest priority on the LAST item passed in.\n *\n * @internal\n * @param {...{ [key: string]: unknown }} configObjects - Config object to merge\n * @returns {{ [key: string]: unknown }} A flattened object of key-value pairs.\n */\nexport function mergeConfigs(...configObjects) {\n /**\n * Function to take nested objects and flatten them to a dot-separated keyed\n * object. Doing this means we don't need to do any deep/recursive merging of\n * each of our objects, nor transform our dataset from a flat list into a\n * nested object.\n *\n * @internal\n * @param {{ [key: string]: unknown }} configObject - Deeply nested object\n * @returns {{ [key: string]: unknown }} Flattened object with dot-separated keys\n */\n function flattenObject(configObject) {\n // Prepare an empty return object\n /** @type {{ [key: string]: unknown }} */\n const flattenedObject = {}\n\n /**\n * Our flattening function, this is called recursively for each level of\n * depth in the object. At each level we prepend the previous level names to\n * the key using `prefix`.\n *\n * @internal\n * @param {Partial<{ [key: string]: unknown }>} obj - Object to flatten\n * @param {string} [prefix] - Optional dot-separated prefix\n */\n function flattenLoop(obj, prefix) {\n for (const [key, value] of Object.entries(obj)) {\n const prefixedKey = prefix ? `${prefix}.${key}` : key\n\n // If the value is a nested object, recurse over that too\n if (value && typeof value === 'object') {\n flattenLoop(value, prefixedKey)\n } else {\n // Otherwise, add this value to our return object\n flattenedObject[prefixedKey] = value\n }\n }\n }\n\n // Kick off the recursive loop\n flattenLoop(configObject)\n return flattenedObject\n }\n\n // Start with an empty object as our base\n /** @type {{ [key: string]: unknown }} */\n const formattedConfigObject = {}\n\n // Loop through each of the passed objects\n for (const configObject of configObjects) {\n const obj = flattenObject(configObject)\n\n // Push their keys one-by-one into formattedConfigObject. Any duplicate\n // keys will override the existing key with the new value.\n for (const [key, value] of Object.entries(obj)) {\n formattedConfigObject[key] = value\n }\n }\n\n return formattedConfigObject\n}\n\n/**\n * Extracts keys starting with a particular namespace from a flattened config\n * object, removing the namespace in the process.\n *\n * @internal\n * @param {{ [key: string]: unknown }} configObject - The object to extract key-value pairs from.\n * @param {string} namespace - The namespace to filter keys with.\n * @returns {{ [key: string]: unknown }} Flattened object with dot-separated key namespace removed\n */\nexport function extractConfigByNamespace(configObject, namespace) {\n /** @type {{ [key: string]: unknown }} */\n const newObject = {}\n\n for (const [key, value] of Object.entries(configObject)) {\n // Split the key into parts, using . as our namespace separator\n const keyParts = key.split('.')\n\n // Check if the first namespace matches the configured namespace\n if (keyParts[0] === namespace) {\n // Remove the first item (the namespace) from the parts array,\n // but only if there is more than one part (we don't want blank keys!)\n if (keyParts.length > 1) {\n keyParts.shift()\n }\n\n // Join the remaining parts back together\n const newKey = keyParts.join('.')\n\n // Add them to our new object\n newObject[newKey] = value\n }\n }\n\n return newObject\n}\n\n/**\n * Get hash fragment from URL\n *\n * Extract the hash fragment (everything after the hash) from a URL,\n * but not including the hash symbol\n *\n * @private\n * @param {string} url - URL\n * @returns {string | undefined} Fragment from URL, without the hash\n */\nexport function getFragmentFromUrl(url) {\n if (!url.includes('#')) {\n return undefined\n }\n\n return url.split('#').pop()\n}\n\n/**\n * Get GOV.UK Frontend breakpoint value from CSS custom property\n *\n * @private\n * @param {string} name - Breakpoint name\n * @returns {{ property: string, value?: string }} Breakpoint object\n */\nexport function getBreakpoint(name) {\n const property = `--govuk-frontend-breakpoint-${name}`\n\n // Get value from `<html>` with breakpoints on CSS :root\n const value = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue(property)\n\n return {\n property,\n value: value || undefined\n }\n}\n\n/**\n * Move focus to element\n *\n * Sets tabindex to -1 to make the element programmatically focusable,\n * but removes it on blur as the element doesn't need to be focused again.\n *\n * @private\n * @template {HTMLElement} FocusElement\n * @param {FocusElement} $element - HTML element\n * @param {object} [options] - Handler options\n * @param {function(this: FocusElement): void} [options.onBeforeFocus] - Callback before focus\n * @param {function(this: FocusElement): void} [options.onBlur] - Callback on blur\n */\nexport function setFocus($element, options = {}) {\n const isFocusable = $element.getAttribute('tabindex')\n\n if (!isFocusable) {\n $element.setAttribute('tabindex', '-1')\n }\n\n /**\n * Handle element focus\n */\n function onFocus() {\n $element.addEventListener('blur', onBlur, { once: true })\n }\n\n /**\n * Handle element blur\n */\n function onBlur() {\n options.onBlur?.call($element)\n\n if (!isFocusable) {\n $element.removeAttribute('tabindex')\n }\n }\n\n // Add listener to reset element on blur, after focus\n $element.addEventListener('focus', onFocus, { once: true })\n\n // Focus element\n options.onBeforeFocus?.call($element)\n $element.focus()\n}\n\n/**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * Some browsers will load and run our JavaScript but GOV.UK Frontend\n * won't be supported.\n *\n * @internal\n * @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support\n * @returns {boolean} Whether GOV.UK Frontend is supported on this page\n */\nexport function isSupported($scope = document.body) {\n if (!$scope) {\n return false\n }\n\n return $scope.classList.contains('govuk-frontend-supported')\n}\n\n/**\n * Validate component config by schema\n *\n * @internal\n * @param {Schema} schema - Config schema\n * @param {{ [key: string]: unknown }} config - Component config\n * @returns {string[]} List of validation errors\n */\nexport function validateConfig(schema, config) {\n const validationErrors = []\n\n // Check errors for each schema\n for (const [name, conditions] of Object.entries(schema)) {\n const errors = []\n\n // Check errors for each schema condition\n for (const { required, errorMessage } of conditions) {\n if (!required.every((key) => !!config[key])) {\n errors.push(errorMessage) // Missing config key value\n }\n }\n\n // Check one condition passes or add errors\n if (name === 'anyOf' && !(conditions.length - errors.length >= 1)) {\n validationErrors.push(...errors)\n }\n }\n\n return validationErrors\n}\n\n/**\n * Schema for component config\n *\n * @typedef {object} Schema\n * @property {SchemaCondition[]} [anyOf] - List of schema conditions\n */\n\n/**\n * Schema condition for component config\n *\n * @typedef {object} SchemaCondition\n * @property {string[]} required - List of required config fields\n * @property {string} errorMessage - Error message when required config fields not provided\n */\n","/**\n * GOV.UK Frontend error\n *\n * A base class for `Error`s thrown by GOV.UK Frontend.\n *\n * It is meant to be extended into specific types of errors\n * to be thrown by our code.\n *\n * @example\n * ```js\n * class MissingRootError extends GOVUKFrontendError {\n * // Setting an explicit name is important as extending the class will not\n * // set a new `name` on the subclass. The `name` property is important\n * // to ensure intelligible error names even if the class name gets\n * // mangled by a minifier\n * name = \"MissingRootError\"\n * }\n * ```\n * @abstract\n */\nexport class GOVUKFrontendError extends Error {\n name = 'GOVUKFrontendError'\n}\n\n/**\n * Indicates that GOV.UK Frontend is not supported\n */\nexport class SupportError extends GOVUKFrontendError {\n name = 'SupportError'\n\n /**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support\n */\n constructor($scope = document.body) {\n const supportMessage =\n 'noModule' in HTMLScriptElement.prototype\n ? 'GOV.UK Frontend initialised without `<body class=\"govuk-frontend-supported\">` from template `<script>` snippet'\n : 'GOV.UK Frontend is not supported in this browser'\n\n super(\n $scope\n ? supportMessage\n : 'GOV.UK Frontend initialised without `<script type=\"module\">`'\n )\n }\n}\n\n/**\n * Indicates that a component has received an illegal configuration\n */\nexport class ConfigError extends GOVUKFrontendError {\n name = 'ConfigError'\n}\n\n/**\n * Indicates an issue with an element (possibly `null` or `undefined`)\n */\nexport class ElementError extends GOVUKFrontendError {\n name = 'ElementError'\n\n /**\n * @internal\n * @overload\n * @param {string} message - Element error message\n */\n\n /**\n * @internal\n * @overload\n * @param {ElementErrorOptions} options - Element error options\n */\n\n /**\n * @internal\n * @param {string | ElementErrorOptions} messageOrOptions - Element error message or options\n */\n constructor(messageOrOptions) {\n let message = typeof messageOrOptions === 'string' ? messageOrOptions : ''\n\n // Build message from options\n if (typeof messageOrOptions === 'object') {\n const { componentName, identifier, element, expectedType } =\n messageOrOptions\n\n // Add prefix and identifier\n message = `${componentName}: ${identifier}`\n\n // Append reason\n message += element\n ? ` is not of type ${expectedType ?? 'HTMLElement'}`\n : ' not found'\n }\n\n super(message)\n }\n}\n\n/**\n * Element error options\n *\n * @internal\n * @typedef {object} ElementErrorOptions\n * @property {string} componentName - The name of the component throwing the error\n * @property {string} identifier - An identifier that'll let the user understand which element has an error. This is whatever makes the most sense\n * @property {Element | null} [element] - The element in error\n * @property {string} [expectedType] - The type that was expected for the identifier\n */\n","import { isSupported } from './common/index.mjs'\nimport { SupportError } from './errors/index.mjs'\n\n/**\n * Base Component class\n *\n * Centralises the behaviours shared by our components\n *\n * @internal\n * @abstract\n */\nexport class GOVUKFrontendComponent {\n /**\n * Constructs a new component, validating that GOV.UK Frontend is supported\n *\n * @internal\n */\n constructor() {\n this.checkSupport()\n }\n\n /**\n * Validates whether GOV.UK Frontend is supported\n *\n * @private\n */\n checkSupport() {\n if (!isSupported()) {\n throw new SupportError()\n }\n }\n}\n","import { getFragmentFromUrl, setFocus } from '../../common/index.mjs'\nimport { ElementError } from '../../errors/index.mjs'\nimport { GOVUKFrontendComponent } from '../../govuk-frontend-component.mjs'\n\n/**\n * Skip link component\n *\n * @preserve\n */\nexport class SkipLink extends GOVUKFrontendComponent {\n /** @private */\n $module\n\n /**\n * @param {Element | null} $module - HTML element to use for skip link\n * @throws {ElementError} when $module is not set or the wrong type\n * @throws {ElementError} when $module.hash does not contain a hash\n * @throws {ElementError} when the linked element is missing or the wrong type\n */\n constructor($module) {\n super()\n\n if (!($module instanceof HTMLAnchorElement)) {\n throw new ElementError({\n componentName: 'Skip link',\n element: $module,\n expectedType: 'HTMLAnchorElement',\n identifier: 'Root element (`$module`)'\n })\n }\n\n this.$module = $module\n\n const hash = this.$module.hash\n const href = this.$module.getAttribute('href') ?? ''\n\n /** @type {URL | undefined} */\n let url\n\n /**\n * Check for valid link URL\n *\n * {@link https://caniuse.com/url}\n * {@link https://url.spec.whatwg.org}\n *\n */\n try {\n url = new window.URL(this.$module.href)\n } catch (error) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) is invalid`\n )\n }\n\n // Return early for external URLs or links to other pages\n if (\n url.origin !== window.location.origin ||\n url.pathname !== window.location.pathname\n ) {\n return\n }\n\n const linkedElementId = getFragmentFromUrl(hash)\n\n // Check link path matching current page\n if (!linkedElementId) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) has no hash fragment`\n )\n }\n\n const $linkedElement = document.getElementById(linkedElementId)\n\n // Check for link target element\n if (!$linkedElement) {\n throw new ElementError({\n componentName: 'Skip link',\n element: $linkedElement,\n identifier: `Target content (\\`id=\"${linkedElementId}\"\\`)`\n })\n }\n\n /**\n * Focus the linked element on click\n *\n * Adds a helper CSS class to hide native focus styles,\n * but removes it on blur to restore native focus styles\n */\n this.$module.addEventListener('click', () =>\n setFocus($linkedElement, {\n onBeforeFocus() {\n $linkedElement.classList.add('govuk-skip-link-focused-element')\n },\n onBlur() {\n $linkedElement.classList.remove('govuk-skip-link-focused-element')\n }\n })\n )\n }\n\n /**\n * Name for the component used when initialising using data-module attributes.\n */\n static moduleName = 'govuk-skip-link'\n}\n"],"names":["getFragmentFromUrl","url","includes","undefined","split","pop","setFocus","$element","options","_options$onBeforeFocu","isFocusable","getAttribute","setAttribute","onFocus","addEventListener","onBlur","once","_options$onBlur","call","removeAttribute","onBeforeFocus","focus","isSupported","$scope","document","body","classList","contains","GOVUKFrontendError","Error","constructor","args","name","SupportError","supportMessage","HTMLScriptElement","prototype","ElementError","messageOrOptions","message","componentName","identifier","element","expectedType","GOVUKFrontendComponent","checkSupport","SkipLink","$module","_this$$module$getAttr","HTMLAnchorElement","hash","href","window","URL","error","origin","location","pathname","linkedElementId","$linkedElement","getElementById","add","remove","moduleName"],"mappings":";;;;;;EA+HO,SAASA,kBAAkBA,CAACC,GAAG,EAAE;EACtC,EAAA,IAAI,CAACA,GAAG,CAACC,QAAQ,CAAC,GAAG,CAAC,EAAE;EACtB,IAAA,OAAOC,SAAS,CAAA;EAClB,GAAA;IAEA,OAAOF,GAAG,CAACG,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,EAAE,CAAA;EAC7B,CAAA;EAoCO,SAASC,QAAQA,CAACC,QAAQ,EAAEC,OAAO,GAAG,EAAE,EAAE;EAAA,EAAA,IAAAC,qBAAA,CAAA;EAC/C,EAAA,MAAMC,WAAW,GAAGH,QAAQ,CAACI,YAAY,CAAC,UAAU,CAAC,CAAA;IAErD,IAAI,CAACD,WAAW,EAAE;EAChBH,IAAAA,QAAQ,CAACK,YAAY,CAAC,UAAU,EAAE,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ACI,QAAQ,CAACC,QAAQ,EACzC;EACA,MAAA,OAAA;EACF,KAAA;EAEA,IAAA,MAAMC,eAAe,GAAG1D,kBAAkB,CAACkD,IAAI,CAAC,CAAA;MAGhD,IAAI,CAACQ,eAAe,EAAE;EACpB,MAAA,MAAM,IAAIrB,YAAY,CACnB,CAAkCc,gCAAAA,EAAAA,IAAK,2BAC1C,CAAC,CAAA;EACH,KAAA;EAEA,IAAA,MAAMQ,cAAc,GAAGnC,QAAQ,CAACoC,cAAc,CAACF,eAAe,CAAC,CAAA;MAG/D,IAAI,CAACC,cAAc,EAAE;QACnB,MAAM,IAAItB,YAAY,CAAC;EACrBG,QAAAA,aAAa,EAAE,WAAW;EAC1BE,QAAAA,OAAO,EAAEiB,cAAc;UACvBlB,UAAU,EAAG,yBAAwBiB,eAAgB,CAAA,IAAA,CAAA;EACvD,OAAC,CAAC,CAAA;EACJ,KAAA;MAQA,IAAI,CAACX,OAAO,CAACjC,gBAAgB,CAAC,OAAO,EAAE,MACrCR,QAAQ,CAACqD,cAAc,EAAE;EACvBvC,MAAAA,aAAaA,GAAG;EACduC,QAAAA,cAAc,CAACjC,SAAS,CAACmC,GAAG,CAAC,iCAAiC,CAAC,CAAA;SAChE;EACD9C,MAAAA,MAAMA,GAAG;EACP4C,QAAAA,cAAc,CAACjC,SAAS,CAACoC,MAAM,CAAC,iCAAiC,CAAC,CAAA;EACpE,OAAA;EACF,KAAC,CACH,CAAC,CAAA;EACH,GAAA;EAMF,CAAA;EA/FahB,QAAQ,CA8FZiB,UAAU,GAAG,iBAAiB;;;;;;;;"}
1
+ {"version":3,"file":"skip-link.bundle.js","sources":["../../../../src/govuk/common/index.mjs","../../../../src/govuk/errors/index.mjs","../../../../src/govuk/govuk-frontend-component.mjs","../../../../src/govuk/components/skip-link/skip-link.mjs"],"sourcesContent":["import { normaliseString } from './normalise-string.mjs'\n\n/**\n * Common helpers which do not require polyfill.\n *\n * IMPORTANT: If a helper require a polyfill, please isolate it in its own module\n * so that the polyfill can be properly tree-shaken and does not burden\n * the components that do not need that helper\n */\n\n/**\n * Config merging function\n *\n * Takes any number of objects and combines them together, with\n * greatest priority on the LAST item passed in.\n *\n * @internal\n * @param {...{ [key: string]: unknown }} configObjects - Config objects to merge\n * @returns {{ [key: string]: unknown }} A merged config object\n */\nexport function mergeConfigs(...configObjects) {\n // Start with an empty object as our base\n /** @type {{ [key: string]: unknown }} */\n const formattedConfigObject = {}\n\n // Loop through each of the passed objects\n for (const configObject of configObjects) {\n for (const key of Object.keys(configObject)) {\n const option = formattedConfigObject[key]\n const override = configObject[key]\n\n // Push their keys one-by-one into formattedConfigObject. Any duplicate\n // keys with object values will be merged, otherwise the new value will\n // override the existing value.\n if (isObject(option) && isObject(override)) {\n // @ts-expect-error Index signature for type 'string' is missing\n formattedConfigObject[key] = mergeConfigs(option, override)\n } else {\n // Apply override\n formattedConfigObject[key] = override\n }\n }\n }\n\n return formattedConfigObject\n}\n\n/**\n * Extracts keys starting with a particular namespace from dataset ('data-*')\n * object, removing the namespace in the process, normalising all values\n *\n * @internal\n * @param {{ schema: Schema }} Component - Component class\n * @param {DOMStringMap} dataset - The object to extract key-value pairs from\n * @param {string} namespace - The namespace to filter keys with\n * @returns {ObjectNested | undefined} Nested object with dot-separated key namespace removed\n */\nexport function extractConfigByNamespace(Component, dataset, namespace) {\n const property = Component.schema.properties[namespace]\n\n // Only extract configs for object schema properties\n if (property?.type !== 'object') {\n return\n }\n\n // Add default empty config\n const newObject = {\n [namespace]: /** @type {ObjectNested} */ ({})\n }\n\n for (const [key, value] of Object.entries(dataset)) {\n /** @type {ObjectNested | ObjectNested[NestedKey]} */\n let current = newObject\n\n // Split the key into parts, using . as our namespace separator\n const keyParts = key.split('.')\n\n /**\n * Create new level per part\n *\n * e.g. 'i18n.textareaDescription.other' becomes\n * `{ i18n: { textareaDescription: { other } } }`\n */\n for (const [index, name] of keyParts.entries()) {\n if (typeof current === 'object') {\n // Drop down to nested object until the last part\n if (index < keyParts.length - 1) {\n // New nested object (optionally) replaces existing value\n if (!isObject(current[name])) {\n current[name] = {}\n }\n\n // Drop down into new or existing nested object\n current = current[name]\n } else if (key !== namespace) {\n // Normalised value (optionally) replaces existing value\n current[name] = normaliseString(value)\n }\n }\n }\n }\n\n return newObject[namespace]\n}\n\n/**\n * Get hash fragment from URL\n *\n * Extract the hash fragment (everything after the hash) from a URL,\n * but not including the hash symbol\n *\n * @private\n * @param {string} url - URL\n * @returns {string | undefined} Fragment from URL, without the hash\n */\nexport function getFragmentFromUrl(url) {\n if (!url.includes('#')) {\n return undefined\n }\n\n return url.split('#').pop()\n}\n\n/**\n * Get GOV.UK Frontend breakpoint value from CSS custom property\n *\n * @private\n * @param {string} name - Breakpoint name\n * @returns {{ property: string, value?: string }} Breakpoint object\n */\nexport function getBreakpoint(name) {\n const property = `--govuk-frontend-breakpoint-${name}`\n\n // Get value from `<html>` with breakpoints on CSS :root\n const value = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue(property)\n\n return {\n property,\n value: value || undefined\n }\n}\n\n/**\n * Move focus to element\n *\n * Sets tabindex to -1 to make the element programmatically focusable,\n * but removes it on blur as the element doesn't need to be focused again.\n *\n * @private\n * @template {HTMLElement} FocusElement\n * @param {FocusElement} $element - HTML element\n * @param {object} [options] - Handler options\n * @param {function(this: FocusElement): void} [options.onBeforeFocus] - Callback before focus\n * @param {function(this: FocusElement): void} [options.onBlur] - Callback on blur\n */\nexport function setFocus($element, options = {}) {\n const isFocusable = $element.getAttribute('tabindex')\n\n if (!isFocusable) {\n $element.setAttribute('tabindex', '-1')\n }\n\n /**\n * Handle element focus\n */\n function onFocus() {\n $element.addEventListener('blur', onBlur, { once: true })\n }\n\n /**\n * Handle element blur\n */\n function onBlur() {\n options.onBlur?.call($element)\n\n if (!isFocusable) {\n $element.removeAttribute('tabindex')\n }\n }\n\n // Add listener to reset element on blur, after focus\n $element.addEventListener('focus', onFocus, { once: true })\n\n // Focus element\n options.onBeforeFocus?.call($element)\n $element.focus()\n}\n\n/**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * Some browsers will load and run our JavaScript but GOV.UK Frontend\n * won't be supported.\n *\n * @internal\n * @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support\n * @returns {boolean} Whether GOV.UK Frontend is supported on this page\n */\nexport function isSupported($scope = document.body) {\n if (!$scope) {\n return false\n }\n\n return $scope.classList.contains('govuk-frontend-supported')\n}\n\n/**\n * Validate component config by schema\n *\n * Follows limited examples in JSON schema for wider support in future\n *\n * {@link https://ajv.js.org/json-schema.html#compound-keywords}\n * {@link https://ajv.js.org/packages/ajv-errors.html#single-message}\n *\n * @internal\n * @param {Schema} schema - Config schema\n * @param {{ [key: string]: unknown }} config - Component config\n * @returns {string[]} List of validation errors\n */\nexport function validateConfig(schema, config) {\n const validationErrors = []\n\n // Check errors for each schema\n for (const [name, conditions] of Object.entries(schema)) {\n const errors = []\n\n // Check errors for each schema condition\n if (Array.isArray(conditions)) {\n for (const { required, errorMessage } of conditions) {\n if (!required.every((key) => !!config[key])) {\n errors.push(errorMessage) // Missing config key value\n }\n }\n\n // Check one condition passes or add errors\n if (name === 'anyOf' && !(conditions.length - errors.length >= 1)) {\n validationErrors.push(...errors)\n }\n }\n }\n\n return validationErrors\n}\n\n/**\n * Check for an array\n *\n * @internal\n * @param {unknown} option - Option to check\n * @returns {boolean} Whether the option is an array\n */\nfunction isArray(option) {\n return Array.isArray(option)\n}\n\n/**\n * Check for an object\n *\n * @internal\n * @param {unknown} option - Option to check\n * @returns {boolean} Whether the option is an object\n */\nfunction isObject(option) {\n return !!option && typeof option === 'object' && !isArray(option)\n}\n\n/**\n * Schema for component config\n *\n * @typedef {object} Schema\n * @property {{ [field: string]: SchemaProperty | undefined }} properties - Schema properties\n * @property {SchemaCondition[]} [anyOf] - List of schema conditions\n */\n\n/**\n * Schema property for component config\n *\n * @typedef {object} SchemaProperty\n * @property {'string' | 'boolean' | 'number' | 'object'} type - Property type\n */\n\n/**\n * Schema condition for component config\n *\n * @typedef {object} SchemaCondition\n * @property {string[]} required - List of required config fields\n * @property {string} errorMessage - Error message when required config fields not provided\n */\n\n/**\n * @internal\n * @typedef {keyof ObjectNested} NestedKey\n * @typedef {{ [key: string]: string | boolean | number | ObjectNested | undefined }} ObjectNested\n */\n","/**\n * GOV.UK Frontend error\n *\n * A base class for `Error`s thrown by GOV.UK Frontend.\n *\n * It is meant to be extended into specific types of errors\n * to be thrown by our code.\n *\n * @example\n * ```js\n * class MissingRootError extends GOVUKFrontendError {\n * // Setting an explicit name is important as extending the class will not\n * // set a new `name` on the subclass. The `name` property is important\n * // to ensure intelligible error names even if the class name gets\n * // mangled by a minifier\n * name = \"MissingRootError\"\n * }\n * ```\n * @abstract\n */\nexport class GOVUKFrontendError extends Error {\n name = 'GOVUKFrontendError'\n}\n\n/**\n * Indicates that GOV.UK Frontend is not supported\n */\nexport class SupportError extends GOVUKFrontendError {\n name = 'SupportError'\n\n /**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support\n */\n constructor($scope = document.body) {\n const supportMessage =\n 'noModule' in HTMLScriptElement.prototype\n ? 'GOV.UK Frontend initialised without `<body class=\"govuk-frontend-supported\">` from template `<script>` snippet'\n : 'GOV.UK Frontend is not supported in this browser'\n\n super(\n $scope\n ? supportMessage\n : 'GOV.UK Frontend initialised without `<script type=\"module\">`'\n )\n }\n}\n\n/**\n * Indicates that a component has received an illegal configuration\n */\nexport class ConfigError extends GOVUKFrontendError {\n name = 'ConfigError'\n}\n\n/**\n * Indicates an issue with an element (possibly `null` or `undefined`)\n */\nexport class ElementError extends GOVUKFrontendError {\n name = 'ElementError'\n\n /**\n * @internal\n * @overload\n * @param {string} message - Element error message\n */\n\n /**\n * @internal\n * @overload\n * @param {ElementErrorOptions} options - Element error options\n */\n\n /**\n * @internal\n * @param {string | ElementErrorOptions} messageOrOptions - Element error message or options\n */\n constructor(messageOrOptions) {\n let message = typeof messageOrOptions === 'string' ? messageOrOptions : ''\n\n // Build message from options\n if (typeof messageOrOptions === 'object') {\n const { componentName, identifier, element, expectedType } =\n messageOrOptions\n\n // Add prefix and identifier\n message = `${componentName}: ${identifier}`\n\n // Append reason\n message += element\n ? ` is not of type ${expectedType ?? 'HTMLElement'}`\n : ' not found'\n }\n\n super(message)\n }\n}\n\n/**\n * Element error options\n *\n * @internal\n * @typedef {object} ElementErrorOptions\n * @property {string} componentName - The name of the component throwing the error\n * @property {string} identifier - An identifier that'll let the user understand which element has an error. This is whatever makes the most sense\n * @property {Element | null} [element] - The element in error\n * @property {string} [expectedType] - The type that was expected for the identifier\n */\n","import { isSupported } from './common/index.mjs'\nimport { SupportError } from './errors/index.mjs'\n\n/**\n * Base Component class\n *\n * Centralises the behaviours shared by our components\n *\n * @internal\n * @abstract\n */\nexport class GOVUKFrontendComponent {\n /**\n * Constructs a new component, validating that GOV.UK Frontend is supported\n *\n * @internal\n */\n constructor() {\n this.checkSupport()\n }\n\n /**\n * Validates whether GOV.UK Frontend is supported\n *\n * @private\n * @throws {SupportError} when GOV.UK Frontend is not supported\n */\n checkSupport() {\n if (!isSupported()) {\n throw new SupportError()\n }\n }\n}\n","import { getFragmentFromUrl, setFocus } from '../../common/index.mjs'\nimport { ElementError } from '../../errors/index.mjs'\nimport { GOVUKFrontendComponent } from '../../govuk-frontend-component.mjs'\n\n/**\n * Skip link component\n *\n * @preserve\n */\nexport class SkipLink extends GOVUKFrontendComponent {\n /** @private */\n $module\n\n /**\n * @param {Element | null} $module - HTML element to use for skip link\n * @throws {ElementError} when $module is not set or the wrong type\n * @throws {ElementError} when $module.hash does not contain a hash\n * @throws {ElementError} when the linked element is missing or the wrong type\n */\n constructor($module) {\n super()\n\n if (!($module instanceof HTMLAnchorElement)) {\n throw new ElementError({\n componentName: 'Skip link',\n element: $module,\n expectedType: 'HTMLAnchorElement',\n identifier: 'Root element (`$module`)'\n })\n }\n\n this.$module = $module\n\n const hash = this.$module.hash\n const href = this.$module.getAttribute('href') ?? ''\n\n /** @type {URL | undefined} */\n let url\n\n /**\n * Check for valid link URL\n *\n * {@link https://caniuse.com/url}\n * {@link https://url.spec.whatwg.org}\n *\n */\n try {\n url = new window.URL(this.$module.href)\n } catch (error) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) is invalid`\n )\n }\n\n // Return early for external URLs or links to other pages\n if (\n url.origin !== window.location.origin ||\n url.pathname !== window.location.pathname\n ) {\n return\n }\n\n const linkedElementId = getFragmentFromUrl(hash)\n\n // Check link path matching current page\n if (!linkedElementId) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) has no hash fragment`\n )\n }\n\n const $linkedElement = document.getElementById(linkedElementId)\n\n // Check for link target element\n if (!$linkedElement) {\n throw new ElementError({\n componentName: 'Skip link',\n element: $linkedElement,\n identifier: `Target content (\\`id=\"${linkedElementId}\"\\`)`\n })\n }\n\n /**\n * Focus the linked element on click\n *\n * Adds a helper CSS class to hide native focus styles,\n * but removes it on blur to restore native focus styles\n */\n this.$module.addEventListener('click', () =>\n setFocus($linkedElement, {\n onBeforeFocus() {\n $linkedElement.classList.add('govuk-skip-link-focused-element')\n },\n onBlur() {\n $linkedElement.classList.remove('govuk-skip-link-focused-element')\n }\n })\n )\n }\n\n /**\n * Name for the component used when initialising using data-module attributes.\n */\n static moduleName = 'govuk-skip-link'\n}\n"],"names":["getFragmentFromUrl","url","includes","undefined","split","pop","setFocus","$element","options","_options$onBeforeFocu","isFocusable","getAttribute","setAttribute","onFocus","addEventListener","onBlur","once","_options$onBlur","call","removeAttribute","onBeforeFocus","focus","isSupported","$scope","document","body","classList","contains","GOVUKFrontendError","Error","constructor","args","name","SupportError","supportMessage","HTMLScriptElement","prototype","ElementError","messageOrOptions","message","componentName","identifier","element","expectedType","GOVUKFrontendComponent","checkSupport","SkipLink","$module","_this$$module$getAttr","HTMLAnchorElement","hash","href","window","URL","error","origin","location","pathname","linkedElementId","$linkedElement","getElementById","add","remove","moduleName"],"mappings":";;;;;;E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,SAAS,CAACmC,GAAG,CAAC,iCAAiC,CAAC,CAAA;SAChE;EACD9C,MAAAA,MAAMA,GAAG;EACP4C,QAAAA,cAAc,CAACjC,SAAS,CAACoC,MAAM,CAAC,iCAAiC,CAAC,CAAA;EACpE,OAAA;EACF,KAAC,CACH,CAAC,CAAA;EACH,GAAA;EAMF,CAAA;EA/FahB,QAAQ,CA8FZiB,UAAU,GAAG,iBAAiB;;;;;;;;"}
@@ -39,9 +39,17 @@ function isSupported($scope = document.body) {
39
39
  * Schema for component config
40
40
  *
41
41
  * @typedef {object} Schema
42
+ * @property {{ [field: string]: SchemaProperty | undefined }} properties - Schema properties
42
43
  * @property {SchemaCondition[]} [anyOf] - List of schema conditions
43
44
  */
44
45
 
46
+ /**
47
+ * Schema property for component config
48
+ *
49
+ * @typedef {object} SchemaProperty
50
+ * @property {'string' | 'boolean' | 'number' | 'object'} type - Property type
51
+ */
52
+
45
53
  /**
46
54
  * Schema condition for component config
47
55
  *
@@ -1 +1 @@
1
- {"version":3,"file":"skip-link.bundle.mjs","sources":["../../../../src/govuk/common/index.mjs","../../../../src/govuk/errors/index.mjs","../../../../src/govuk/govuk-frontend-component.mjs","../../../../src/govuk/components/skip-link/skip-link.mjs"],"sourcesContent":["/**\n * Common helpers which do not require polyfill.\n *\n * IMPORTANT: If a helper require a polyfill, please isolate it in its own module\n * so that the polyfill can be properly tree-shaken and does not burden\n * the components that do not need that helper\n */\n\n/**\n * Config flattening function\n *\n * Takes any number of objects, flattens them into namespaced key-value pairs,\n * (e.g. \\{'i18n.showSection': 'Show section'\\}) and combines them together, with\n * greatest priority on the LAST item passed in.\n *\n * @internal\n * @param {...{ [key: string]: unknown }} configObjects - Config object to merge\n * @returns {{ [key: string]: unknown }} A flattened object of key-value pairs.\n */\nexport function mergeConfigs(...configObjects) {\n /**\n * Function to take nested objects and flatten them to a dot-separated keyed\n * object. Doing this means we don't need to do any deep/recursive merging of\n * each of our objects, nor transform our dataset from a flat list into a\n * nested object.\n *\n * @internal\n * @param {{ [key: string]: unknown }} configObject - Deeply nested object\n * @returns {{ [key: string]: unknown }} Flattened object with dot-separated keys\n */\n function flattenObject(configObject) {\n // Prepare an empty return object\n /** @type {{ [key: string]: unknown }} */\n const flattenedObject = {}\n\n /**\n * Our flattening function, this is called recursively for each level of\n * depth in the object. At each level we prepend the previous level names to\n * the key using `prefix`.\n *\n * @internal\n * @param {Partial<{ [key: string]: unknown }>} obj - Object to flatten\n * @param {string} [prefix] - Optional dot-separated prefix\n */\n function flattenLoop(obj, prefix) {\n for (const [key, value] of Object.entries(obj)) {\n const prefixedKey = prefix ? `${prefix}.${key}` : key\n\n // If the value is a nested object, recurse over that too\n if (value && typeof value === 'object') {\n flattenLoop(value, prefixedKey)\n } else {\n // Otherwise, add this value to our return object\n flattenedObject[prefixedKey] = value\n }\n }\n }\n\n // Kick off the recursive loop\n flattenLoop(configObject)\n return flattenedObject\n }\n\n // Start with an empty object as our base\n /** @type {{ [key: string]: unknown }} */\n const formattedConfigObject = {}\n\n // Loop through each of the passed objects\n for (const configObject of configObjects) {\n const obj = flattenObject(configObject)\n\n // Push their keys one-by-one into formattedConfigObject. Any duplicate\n // keys will override the existing key with the new value.\n for (const [key, value] of Object.entries(obj)) {\n formattedConfigObject[key] = value\n }\n }\n\n return formattedConfigObject\n}\n\n/**\n * Extracts keys starting with a particular namespace from a flattened config\n * object, removing the namespace in the process.\n *\n * @internal\n * @param {{ [key: string]: unknown }} configObject - The object to extract key-value pairs from.\n * @param {string} namespace - The namespace to filter keys with.\n * @returns {{ [key: string]: unknown }} Flattened object with dot-separated key namespace removed\n */\nexport function extractConfigByNamespace(configObject, namespace) {\n /** @type {{ [key: string]: unknown }} */\n const newObject = {}\n\n for (const [key, value] of Object.entries(configObject)) {\n // Split the key into parts, using . as our namespace separator\n const keyParts = key.split('.')\n\n // Check if the first namespace matches the configured namespace\n if (keyParts[0] === namespace) {\n // Remove the first item (the namespace) from the parts array,\n // but only if there is more than one part (we don't want blank keys!)\n if (keyParts.length > 1) {\n keyParts.shift()\n }\n\n // Join the remaining parts back together\n const newKey = keyParts.join('.')\n\n // Add them to our new object\n newObject[newKey] = value\n }\n }\n\n return newObject\n}\n\n/**\n * Get hash fragment from URL\n *\n * Extract the hash fragment (everything after the hash) from a URL,\n * but not including the hash symbol\n *\n * @private\n * @param {string} url - URL\n * @returns {string | undefined} Fragment from URL, without the hash\n */\nexport function getFragmentFromUrl(url) {\n if (!url.includes('#')) {\n return undefined\n }\n\n return url.split('#').pop()\n}\n\n/**\n * Get GOV.UK Frontend breakpoint value from CSS custom property\n *\n * @private\n * @param {string} name - Breakpoint name\n * @returns {{ property: string, value?: string }} Breakpoint object\n */\nexport function getBreakpoint(name) {\n const property = `--govuk-frontend-breakpoint-${name}`\n\n // Get value from `<html>` with breakpoints on CSS :root\n const value = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue(property)\n\n return {\n property,\n value: value || undefined\n }\n}\n\n/**\n * Move focus to element\n *\n * Sets tabindex to -1 to make the element programmatically focusable,\n * but removes it on blur as the element doesn't need to be focused again.\n *\n * @private\n * @template {HTMLElement} FocusElement\n * @param {FocusElement} $element - HTML element\n * @param {object} [options] - Handler options\n * @param {function(this: FocusElement): void} [options.onBeforeFocus] - Callback before focus\n * @param {function(this: FocusElement): void} [options.onBlur] - Callback on blur\n */\nexport function setFocus($element, options = {}) {\n const isFocusable = $element.getAttribute('tabindex')\n\n if (!isFocusable) {\n $element.setAttribute('tabindex', '-1')\n }\n\n /**\n * Handle element focus\n */\n function onFocus() {\n $element.addEventListener('blur', onBlur, { once: true })\n }\n\n /**\n * Handle element blur\n */\n function onBlur() {\n options.onBlur?.call($element)\n\n if (!isFocusable) {\n $element.removeAttribute('tabindex')\n }\n }\n\n // Add listener to reset element on blur, after focus\n $element.addEventListener('focus', onFocus, { once: true })\n\n // Focus element\n options.onBeforeFocus?.call($element)\n $element.focus()\n}\n\n/**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * Some browsers will load and run our JavaScript but GOV.UK Frontend\n * won't be supported.\n *\n * @internal\n * @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support\n * @returns {boolean} Whether GOV.UK Frontend is supported on this page\n */\nexport function isSupported($scope = document.body) {\n if (!$scope) {\n return false\n }\n\n return $scope.classList.contains('govuk-frontend-supported')\n}\n\n/**\n * Validate component config by schema\n *\n * @internal\n * @param {Schema} schema - Config schema\n * @param {{ [key: string]: unknown }} config - Component config\n * @returns {string[]} List of validation errors\n */\nexport function validateConfig(schema, config) {\n const validationErrors = []\n\n // Check errors for each schema\n for (const [name, conditions] of Object.entries(schema)) {\n const errors = []\n\n // Check errors for each schema condition\n for (const { required, errorMessage } of conditions) {\n if (!required.every((key) => !!config[key])) {\n errors.push(errorMessage) // Missing config key value\n }\n }\n\n // Check one condition passes or add errors\n if (name === 'anyOf' && !(conditions.length - errors.length >= 1)) {\n validationErrors.push(...errors)\n }\n }\n\n return validationErrors\n}\n\n/**\n * Schema for component config\n *\n * @typedef {object} Schema\n * @property {SchemaCondition[]} [anyOf] - List of schema conditions\n */\n\n/**\n * Schema condition for component config\n *\n * @typedef {object} SchemaCondition\n * @property {string[]} required - List of required config fields\n * @property {string} errorMessage - Error message when required config fields not provided\n */\n","/**\n * GOV.UK Frontend error\n *\n * A base class for `Error`s thrown by GOV.UK Frontend.\n *\n * It is meant to be extended into specific types of errors\n * to be thrown by our code.\n *\n * @example\n * ```js\n * class MissingRootError extends GOVUKFrontendError {\n * // Setting an explicit name is important as extending the class will not\n * // set a new `name` on the subclass. The `name` property is important\n * // to ensure intelligible error names even if the class name gets\n * // mangled by a minifier\n * name = \"MissingRootError\"\n * }\n * ```\n * @abstract\n */\nexport class GOVUKFrontendError extends Error {\n name = 'GOVUKFrontendError'\n}\n\n/**\n * Indicates that GOV.UK Frontend is not supported\n */\nexport class SupportError extends GOVUKFrontendError {\n name = 'SupportError'\n\n /**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support\n */\n constructor($scope = document.body) {\n const supportMessage =\n 'noModule' in HTMLScriptElement.prototype\n ? 'GOV.UK Frontend initialised without `<body class=\"govuk-frontend-supported\">` from template `<script>` snippet'\n : 'GOV.UK Frontend is not supported in this browser'\n\n super(\n $scope\n ? supportMessage\n : 'GOV.UK Frontend initialised without `<script type=\"module\">`'\n )\n }\n}\n\n/**\n * Indicates that a component has received an illegal configuration\n */\nexport class ConfigError extends GOVUKFrontendError {\n name = 'ConfigError'\n}\n\n/**\n * Indicates an issue with an element (possibly `null` or `undefined`)\n */\nexport class ElementError extends GOVUKFrontendError {\n name = 'ElementError'\n\n /**\n * @internal\n * @overload\n * @param {string} message - Element error message\n */\n\n /**\n * @internal\n * @overload\n * @param {ElementErrorOptions} options - Element error options\n */\n\n /**\n * @internal\n * @param {string | ElementErrorOptions} messageOrOptions - Element error message or options\n */\n constructor(messageOrOptions) {\n let message = typeof messageOrOptions === 'string' ? messageOrOptions : ''\n\n // Build message from options\n if (typeof messageOrOptions === 'object') {\n const { componentName, identifier, element, expectedType } =\n messageOrOptions\n\n // Add prefix and identifier\n message = `${componentName}: ${identifier}`\n\n // Append reason\n message += element\n ? ` is not of type ${expectedType ?? 'HTMLElement'}`\n : ' not found'\n }\n\n super(message)\n }\n}\n\n/**\n * Element error options\n *\n * @internal\n * @typedef {object} ElementErrorOptions\n * @property {string} componentName - The name of the component throwing the error\n * @property {string} identifier - An identifier that'll let the user understand which element has an error. This is whatever makes the most sense\n * @property {Element | null} [element] - The element in error\n * @property {string} [expectedType] - The type that was expected for the identifier\n */\n","import { isSupported } from './common/index.mjs'\nimport { SupportError } from './errors/index.mjs'\n\n/**\n * Base Component class\n *\n * Centralises the behaviours shared by our components\n *\n * @internal\n * @abstract\n */\nexport class GOVUKFrontendComponent {\n /**\n * Constructs a new component, validating that GOV.UK Frontend is supported\n *\n * @internal\n */\n constructor() {\n this.checkSupport()\n }\n\n /**\n * Validates whether GOV.UK Frontend is supported\n *\n * @private\n */\n checkSupport() {\n if (!isSupported()) {\n throw new SupportError()\n }\n }\n}\n","import { getFragmentFromUrl, setFocus } from '../../common/index.mjs'\nimport { ElementError } from '../../errors/index.mjs'\nimport { GOVUKFrontendComponent } from '../../govuk-frontend-component.mjs'\n\n/**\n * Skip link component\n *\n * @preserve\n */\nexport class SkipLink extends GOVUKFrontendComponent {\n /** @private */\n $module\n\n /**\n * @param {Element | null} $module - HTML element to use for skip link\n * @throws {ElementError} when $module is not set or the wrong type\n * @throws {ElementError} when $module.hash does not contain a hash\n * @throws {ElementError} when the linked element is missing or the wrong type\n */\n constructor($module) {\n super()\n\n if (!($module instanceof HTMLAnchorElement)) {\n throw new ElementError({\n componentName: 'Skip link',\n element: $module,\n expectedType: 'HTMLAnchorElement',\n identifier: 'Root element (`$module`)'\n })\n }\n\n this.$module = $module\n\n const hash = this.$module.hash\n const href = this.$module.getAttribute('href') ?? ''\n\n /** @type {URL | undefined} */\n let url\n\n /**\n * Check for valid link URL\n *\n * {@link https://caniuse.com/url}\n * {@link https://url.spec.whatwg.org}\n *\n */\n try {\n url = new window.URL(this.$module.href)\n } catch (error) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) is invalid`\n )\n }\n\n // Return early for external URLs or links to other pages\n if (\n url.origin !== window.location.origin ||\n url.pathname !== window.location.pathname\n ) {\n return\n }\n\n const linkedElementId = getFragmentFromUrl(hash)\n\n // Check link path matching current page\n if (!linkedElementId) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) has no hash fragment`\n )\n }\n\n const $linkedElement = document.getElementById(linkedElementId)\n\n // Check for link target element\n if (!$linkedElement) {\n throw new ElementError({\n componentName: 'Skip link',\n element: $linkedElement,\n identifier: `Target content (\\`id=\"${linkedElementId}\"\\`)`\n })\n }\n\n /**\n * Focus the linked element on click\n *\n * Adds a helper CSS class to hide native focus styles,\n * but removes it on blur to restore native focus styles\n */\n this.$module.addEventListener('click', () =>\n setFocus($linkedElement, {\n onBeforeFocus() {\n $linkedElement.classList.add('govuk-skip-link-focused-element')\n },\n onBlur() {\n $linkedElement.classList.remove('govuk-skip-link-focused-element')\n }\n })\n )\n }\n\n /**\n * Name for the component used when initialising using data-module attributes.\n */\n static moduleName = 'govuk-skip-link'\n}\n"],"names":["getFragmentFromUrl","url","includes","undefined","split","pop","setFocus","$element","options","_options$onBeforeFocu","isFocusable","getAttribute","setAttribute","onFocus","addEventListener","onBlur","once","_options$onBlur","call","removeAttribute","onBeforeFocus","focus","isSupported","$scope","document","body","classList","contains","GOVUKFrontendError","Error","constructor","args","name","SupportError","supportMessage","HTMLScriptElement","prototype","ElementError","messageOrOptions","message","componentName","identifier","element","expectedType","GOVUKFrontendComponent","checkSupport","SkipLink","$module","_this$$module$getAttr","HTMLAnchorElement","hash","href","window","URL","error","origin","location","pathname","linkedElementId","$linkedElement","getElementById","add","remove","moduleName"],"mappings":"AA+HO,SAASA,kBAAkBA,CAACC,GAAG,EAAE;AACtC,EAAA,IAAI,CAACA,GAAG,CAACC,QAAQ,CAAC,GAAG,CAAC,EAAE;AACtB,IAAA,OAAOC,SAAS,CAAA;AAClB,GAAA;EAEA,OAAOF,GAAG,CAACG,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,EAAE,CAAA;AAC7B,CAAA;AAoCO,SAASC,QAAQA,CAACC,QAAQ,EAAEC,OAAO,GAAG,EAAE,EAAE;AAAA,EAAA,IAAAC,qBAAA,CAAA;AAC/C,EAAA,MAAMC,WAAW,GAAGH,QAAQ,CAACI,YAAY,CAAC,UAAU,CAAC,CAAA;EAErD,IAAI,CAACD,WAAW,EAAE;AAChBH,IAAAA,QAAQ,CAACK,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;AACzC,GAAA;EAKA,SAASC,OAAOA,GAAG;AACjBN,IAAAA,QAAQ,CAACO,gBAAgB,CAAC,MAAM,EAAEC,MAAM,EAAE;AAAEC,MAAAA,IAAI,EAAE,IAAA;AAAK,KAAC,CAAC,CAAA;AAC3D,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AY,CACnB,CAAkCc,gCAAAA,EAAAA,IAAK,2BAC1C,CAAC,CAAA;AACH,KAAA;AAEA,IAAA,MAAMQ,cAAc,GAAGnC,QAAQ,CAACoC,cAAc,CAACF,eAAe,CAAC,CAAA;IAG/D,IAAI,CAACC,cAAc,EAAE;MACnB,MAAM,IAAItB,YAAY,CAAC;AACrBG,QAAAA,aAAa,EAAE,WAAW;AAC1BE,QAAAA,OAAO,EAAEiB,cAAc;QACvBlB,UAAU,EAAG,yBAAwBiB,eAAgB,CAAA,IAAA,CAAA;AACvD,OAAC,CAAC,CAAA;AACJ,KAAA;IAQA,IAAI,CAACX,OAAO,CAACjC,gBAAgB,CAAC,OAAO,EAAE,MACrCR,QAAQ,CAACqD,cAAc,EAAE;AACvBvC,MAAAA,aAAaA,GAAG;AACduC,QAAAA,cAAc,CAACjC,SAAS,CAACmC,GAAG,CAAC,iCAAiC,CAAC,CAAA;OAChE;AACD9C,MAAAA,MAAMA,GAAG;AACP4C,QAAAA,cAAc,CAACjC,SAAS,CAACoC,MAAM,CAAC,iCAAiC,CAAC,CAAA;AACpE,OAAA;AACF,KAAC,CACH,CAAC,CAAA;AACH,GAAA;AAMF,CAAA;AA/FahB,QAAQ,CA8FZiB,UAAU,GAAG,iBAAiB;;;;"}
1
+ {"version":3,"file":"skip-link.bundle.mjs","sources":["../../../../src/govuk/common/index.mjs","../../../../src/govuk/errors/index.mjs","../../../../src/govuk/govuk-frontend-component.mjs","../../../../src/govuk/components/skip-link/skip-link.mjs"],"sourcesContent":["import { normaliseString } from './normalise-string.mjs'\n\n/**\n * Common helpers which do not require polyfill.\n *\n * IMPORTANT: If a helper require a polyfill, please isolate it in its own module\n * so that the polyfill can be properly tree-shaken and does not burden\n * the components that do not need that helper\n */\n\n/**\n * Config merging function\n *\n * Takes any number of objects and combines them together, with\n * greatest priority on the LAST item passed in.\n *\n * @internal\n * @param {...{ [key: string]: unknown }} configObjects - Config objects to merge\n * @returns {{ [key: string]: unknown }} A merged config object\n */\nexport function mergeConfigs(...configObjects) {\n // Start with an empty object as our base\n /** @type {{ [key: string]: unknown }} */\n const formattedConfigObject = {}\n\n // Loop through each of the passed objects\n for (const configObject of configObjects) {\n for (const key of Object.keys(configObject)) {\n const option = formattedConfigObject[key]\n const override = configObject[key]\n\n // Push their keys one-by-one into formattedConfigObject. Any duplicate\n // keys with object values will be merged, otherwise the new value will\n // override the existing value.\n if (isObject(option) && isObject(override)) {\n // @ts-expect-error Index signature for type 'string' is missing\n formattedConfigObject[key] = mergeConfigs(option, override)\n } else {\n // Apply override\n formattedConfigObject[key] = override\n }\n }\n }\n\n return formattedConfigObject\n}\n\n/**\n * Extracts keys starting with a particular namespace from dataset ('data-*')\n * object, removing the namespace in the process, normalising all values\n *\n * @internal\n * @param {{ schema: Schema }} Component - Component class\n * @param {DOMStringMap} dataset - The object to extract key-value pairs from\n * @param {string} namespace - The namespace to filter keys with\n * @returns {ObjectNested | undefined} Nested object with dot-separated key namespace removed\n */\nexport function extractConfigByNamespace(Component, dataset, namespace) {\n const property = Component.schema.properties[namespace]\n\n // Only extract configs for object schema properties\n if (property?.type !== 'object') {\n return\n }\n\n // Add default empty config\n const newObject = {\n [namespace]: /** @type {ObjectNested} */ ({})\n }\n\n for (const [key, value] of Object.entries(dataset)) {\n /** @type {ObjectNested | ObjectNested[NestedKey]} */\n let current = newObject\n\n // Split the key into parts, using . as our namespace separator\n const keyParts = key.split('.')\n\n /**\n * Create new level per part\n *\n * e.g. 'i18n.textareaDescription.other' becomes\n * `{ i18n: { textareaDescription: { other } } }`\n */\n for (const [index, name] of keyParts.entries()) {\n if (typeof current === 'object') {\n // Drop down to nested object until the last part\n if (index < keyParts.length - 1) {\n // New nested object (optionally) replaces existing value\n if (!isObject(current[name])) {\n current[name] = {}\n }\n\n // Drop down into new or existing nested object\n current = current[name]\n } else if (key !== namespace) {\n // Normalised value (optionally) replaces existing value\n current[name] = normaliseString(value)\n }\n }\n }\n }\n\n return newObject[namespace]\n}\n\n/**\n * Get hash fragment from URL\n *\n * Extract the hash fragment (everything after the hash) from a URL,\n * but not including the hash symbol\n *\n * @private\n * @param {string} url - URL\n * @returns {string | undefined} Fragment from URL, without the hash\n */\nexport function getFragmentFromUrl(url) {\n if (!url.includes('#')) {\n return undefined\n }\n\n return url.split('#').pop()\n}\n\n/**\n * Get GOV.UK Frontend breakpoint value from CSS custom property\n *\n * @private\n * @param {string} name - Breakpoint name\n * @returns {{ property: string, value?: string }} Breakpoint object\n */\nexport function getBreakpoint(name) {\n const property = `--govuk-frontend-breakpoint-${name}`\n\n // Get value from `<html>` with breakpoints on CSS :root\n const value = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue(property)\n\n return {\n property,\n value: value || undefined\n }\n}\n\n/**\n * Move focus to element\n *\n * Sets tabindex to -1 to make the element programmatically focusable,\n * but removes it on blur as the element doesn't need to be focused again.\n *\n * @private\n * @template {HTMLElement} FocusElement\n * @param {FocusElement} $element - HTML element\n * @param {object} [options] - Handler options\n * @param {function(this: FocusElement): void} [options.onBeforeFocus] - Callback before focus\n * @param {function(this: FocusElement): void} [options.onBlur] - Callback on blur\n */\nexport function setFocus($element, options = {}) {\n const isFocusable = $element.getAttribute('tabindex')\n\n if (!isFocusable) {\n $element.setAttribute('tabindex', '-1')\n }\n\n /**\n * Handle element focus\n */\n function onFocus() {\n $element.addEventListener('blur', onBlur, { once: true })\n }\n\n /**\n * Handle element blur\n */\n function onBlur() {\n options.onBlur?.call($element)\n\n if (!isFocusable) {\n $element.removeAttribute('tabindex')\n }\n }\n\n // Add listener to reset element on blur, after focus\n $element.addEventListener('focus', onFocus, { once: true })\n\n // Focus element\n options.onBeforeFocus?.call($element)\n $element.focus()\n}\n\n/**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * Some browsers will load and run our JavaScript but GOV.UK Frontend\n * won't be supported.\n *\n * @internal\n * @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support\n * @returns {boolean} Whether GOV.UK Frontend is supported on this page\n */\nexport function isSupported($scope = document.body) {\n if (!$scope) {\n return false\n }\n\n return $scope.classList.contains('govuk-frontend-supported')\n}\n\n/**\n * Validate component config by schema\n *\n * Follows limited examples in JSON schema for wider support in future\n *\n * {@link https://ajv.js.org/json-schema.html#compound-keywords}\n * {@link https://ajv.js.org/packages/ajv-errors.html#single-message}\n *\n * @internal\n * @param {Schema} schema - Config schema\n * @param {{ [key: string]: unknown }} config - Component config\n * @returns {string[]} List of validation errors\n */\nexport function validateConfig(schema, config) {\n const validationErrors = []\n\n // Check errors for each schema\n for (const [name, conditions] of Object.entries(schema)) {\n const errors = []\n\n // Check errors for each schema condition\n if (Array.isArray(conditions)) {\n for (const { required, errorMessage } of conditions) {\n if (!required.every((key) => !!config[key])) {\n errors.push(errorMessage) // Missing config key value\n }\n }\n\n // Check one condition passes or add errors\n if (name === 'anyOf' && !(conditions.length - errors.length >= 1)) {\n validationErrors.push(...errors)\n }\n }\n }\n\n return validationErrors\n}\n\n/**\n * Check for an array\n *\n * @internal\n * @param {unknown} option - Option to check\n * @returns {boolean} Whether the option is an array\n */\nfunction isArray(option) {\n return Array.isArray(option)\n}\n\n/**\n * Check for an object\n *\n * @internal\n * @param {unknown} option - Option to check\n * @returns {boolean} Whether the option is an object\n */\nfunction isObject(option) {\n return !!option && typeof option === 'object' && !isArray(option)\n}\n\n/**\n * Schema for component config\n *\n * @typedef {object} Schema\n * @property {{ [field: string]: SchemaProperty | undefined }} properties - Schema properties\n * @property {SchemaCondition[]} [anyOf] - List of schema conditions\n */\n\n/**\n * Schema property for component config\n *\n * @typedef {object} SchemaProperty\n * @property {'string' | 'boolean' | 'number' | 'object'} type - Property type\n */\n\n/**\n * Schema condition for component config\n *\n * @typedef {object} SchemaCondition\n * @property {string[]} required - List of required config fields\n * @property {string} errorMessage - Error message when required config fields not provided\n */\n\n/**\n * @internal\n * @typedef {keyof ObjectNested} NestedKey\n * @typedef {{ [key: string]: string | boolean | number | ObjectNested | undefined }} ObjectNested\n */\n","/**\n * GOV.UK Frontend error\n *\n * A base class for `Error`s thrown by GOV.UK Frontend.\n *\n * It is meant to be extended into specific types of errors\n * to be thrown by our code.\n *\n * @example\n * ```js\n * class MissingRootError extends GOVUKFrontendError {\n * // Setting an explicit name is important as extending the class will not\n * // set a new `name` on the subclass. The `name` property is important\n * // to ensure intelligible error names even if the class name gets\n * // mangled by a minifier\n * name = \"MissingRootError\"\n * }\n * ```\n * @abstract\n */\nexport class GOVUKFrontendError extends Error {\n name = 'GOVUKFrontendError'\n}\n\n/**\n * Indicates that GOV.UK Frontend is not supported\n */\nexport class SupportError extends GOVUKFrontendError {\n name = 'SupportError'\n\n /**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support\n */\n constructor($scope = document.body) {\n const supportMessage =\n 'noModule' in HTMLScriptElement.prototype\n ? 'GOV.UK Frontend initialised without `<body class=\"govuk-frontend-supported\">` from template `<script>` snippet'\n : 'GOV.UK Frontend is not supported in this browser'\n\n super(\n $scope\n ? supportMessage\n : 'GOV.UK Frontend initialised without `<script type=\"module\">`'\n )\n }\n}\n\n/**\n * Indicates that a component has received an illegal configuration\n */\nexport class ConfigError extends GOVUKFrontendError {\n name = 'ConfigError'\n}\n\n/**\n * Indicates an issue with an element (possibly `null` or `undefined`)\n */\nexport class ElementError extends GOVUKFrontendError {\n name = 'ElementError'\n\n /**\n * @internal\n * @overload\n * @param {string} message - Element error message\n */\n\n /**\n * @internal\n * @overload\n * @param {ElementErrorOptions} options - Element error options\n */\n\n /**\n * @internal\n * @param {string | ElementErrorOptions} messageOrOptions - Element error message or options\n */\n constructor(messageOrOptions) {\n let message = typeof messageOrOptions === 'string' ? messageOrOptions : ''\n\n // Build message from options\n if (typeof messageOrOptions === 'object') {\n const { componentName, identifier, element, expectedType } =\n messageOrOptions\n\n // Add prefix and identifier\n message = `${componentName}: ${identifier}`\n\n // Append reason\n message += element\n ? ` is not of type ${expectedType ?? 'HTMLElement'}`\n : ' not found'\n }\n\n super(message)\n }\n}\n\n/**\n * Element error options\n *\n * @internal\n * @typedef {object} ElementErrorOptions\n * @property {string} componentName - The name of the component throwing the error\n * @property {string} identifier - An identifier that'll let the user understand which element has an error. This is whatever makes the most sense\n * @property {Element | null} [element] - The element in error\n * @property {string} [expectedType] - The type that was expected for the identifier\n */\n","import { isSupported } from './common/index.mjs'\nimport { SupportError } from './errors/index.mjs'\n\n/**\n * Base Component class\n *\n * Centralises the behaviours shared by our components\n *\n * @internal\n * @abstract\n */\nexport class GOVUKFrontendComponent {\n /**\n * Constructs a new component, validating that GOV.UK Frontend is supported\n *\n * @internal\n */\n constructor() {\n this.checkSupport()\n }\n\n /**\n * Validates whether GOV.UK Frontend is supported\n *\n * @private\n * @throws {SupportError} when GOV.UK Frontend is not supported\n */\n checkSupport() {\n if (!isSupported()) {\n throw new SupportError()\n }\n }\n}\n","import { getFragmentFromUrl, setFocus } from '../../common/index.mjs'\nimport { ElementError } from '../../errors/index.mjs'\nimport { GOVUKFrontendComponent } from '../../govuk-frontend-component.mjs'\n\n/**\n * Skip link component\n *\n * @preserve\n */\nexport class SkipLink extends GOVUKFrontendComponent {\n /** @private */\n $module\n\n /**\n * @param {Element | null} $module - HTML element to use for skip link\n * @throws {ElementError} when $module is not set or the wrong type\n * @throws {ElementError} when $module.hash does not contain a hash\n * @throws {ElementError} when the linked element is missing or the wrong type\n */\n constructor($module) {\n super()\n\n if (!($module instanceof HTMLAnchorElement)) {\n throw new ElementError({\n componentName: 'Skip link',\n element: $module,\n expectedType: 'HTMLAnchorElement',\n identifier: 'Root element (`$module`)'\n })\n }\n\n this.$module = $module\n\n const hash = this.$module.hash\n const href = this.$module.getAttribute('href') ?? ''\n\n /** @type {URL | undefined} */\n let url\n\n /**\n * Check for valid link URL\n *\n * {@link https://caniuse.com/url}\n * {@link https://url.spec.whatwg.org}\n *\n */\n try {\n url = new window.URL(this.$module.href)\n } catch (error) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) is invalid`\n )\n }\n\n // Return early for external URLs or links to other pages\n if (\n url.origin !== window.location.origin ||\n url.pathname !== window.location.pathname\n ) {\n return\n }\n\n const linkedElementId = getFragmentFromUrl(hash)\n\n // Check link path matching current page\n if (!linkedElementId) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) has no hash fragment`\n )\n }\n\n const $linkedElement = document.getElementById(linkedElementId)\n\n // Check for link target element\n if (!$linkedElement) {\n throw new ElementError({\n componentName: 'Skip link',\n element: $linkedElement,\n identifier: `Target content (\\`id=\"${linkedElementId}\"\\`)`\n })\n }\n\n /**\n * Focus the linked element on click\n *\n * Adds a helper CSS class to hide native focus styles,\n * but removes it on blur to restore native focus styles\n */\n this.$module.addEventListener('click', () =>\n setFocus($linkedElement, {\n onBeforeFocus() {\n $linkedElement.classList.add('govuk-skip-link-focused-element')\n },\n onBlur() {\n $linkedElement.classList.remove('govuk-skip-link-focused-element')\n }\n })\n )\n }\n\n /**\n * Name for the component used when initialising using data-module attributes.\n */\n static moduleName = 'govuk-skip-link'\n}\n"],"names":["getFragmentFromUrl","url","includes","undefined","split","pop","setFocus","$element","options","_options$onBeforeFocu","isFocusable","getAttribute","setAttribute","onFocus","addEventListener","onBlur","once","_options$onBlur","call","removeAttribute","onBeforeFocus","focus","isSupported","$scope","document","body","classList","contains","GOVUKFrontendError","Error","constructor","args","name","SupportError","supportMessage","HTMLScriptElement","prototype","ElementError","messageOrOptions","message","componentName","identifier","element","expectedType","GOVUKFrontendComponent","checkSupport","SkipLink","$module","_this$$module$getAttr","HTMLAnchorElement","hash","href","window","URL","error","origin","location","pathname","linkedElementId","$linkedElement","getElementById","add","remove","moduleName"],"mappings":"AAmHO,SAASA,kBAAkBA,CAACC,GAAG,EAAE;AACtC,EAAA,IAAI,CAACA,GAAG,CAACC,QAAQ,CAAC,GAAG,CAAC,EAAE;AACtB,IAAA,OAAOC,SAAS,CAAA;AAClB,GAAA;EAEA,OAAOF,GAAG,CAACG,KAAK,CAAC,GAAG,C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ACH,GAAA;AAMF,CAAA;AA/FahB,QAAQ,CA8FZiB,UAAU,GAAG,iBAAiB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"skip-link.mjs","sources":["../../../../src/govuk/components/skip-link/skip-link.mjs"],"sourcesContent":["import { getFragmentFromUrl, setFocus } from '../../common/index.mjs'\nimport { ElementError } from '../../errors/index.mjs'\nimport { GOVUKFrontendComponent } from '../../govuk-frontend-component.mjs'\n\n/**\n * Skip link component\n *\n * @preserve\n */\nexport class SkipLink extends GOVUKFrontendComponent {\n /** @private */\n $module\n\n /**\n * @param {Element | null} $module - HTML element to use for skip link\n * @throws {ElementError} when $module is not set or the wrong type\n * @throws {ElementError} when $module.hash does not contain a hash\n * @throws {ElementError} when the linked element is missing or the wrong type\n */\n constructor($module) {\n super()\n\n if (!($module instanceof HTMLAnchorElement)) {\n throw new ElementError({\n componentName: 'Skip link',\n element: $module,\n expectedType: 'HTMLAnchorElement',\n identifier: 'Root element (`$module`)'\n })\n }\n\n this.$module = $module\n\n const hash = this.$module.hash\n const href = this.$module.getAttribute('href') ?? ''\n\n /** @type {URL | undefined} */\n let url\n\n /**\n * Check for valid link URL\n *\n * {@link https://caniuse.com/url}\n * {@link https://url.spec.whatwg.org}\n *\n */\n try {\n url = new window.URL(this.$module.href)\n } catch (error) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) is invalid`\n )\n }\n\n // Return early for external URLs or links to other pages\n if (\n url.origin !== window.location.origin ||\n url.pathname !== window.location.pathname\n ) {\n return\n }\n\n const linkedElementId = getFragmentFromUrl(hash)\n\n // Check link path matching current page\n if (!linkedElementId) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) has no hash fragment`\n )\n }\n\n const $linkedElement = document.getElementById(linkedElementId)\n\n // Check for link target element\n if (!$linkedElement) {\n throw new ElementError({\n componentName: 'Skip link',\n element: $linkedElement,\n identifier: `Target content (\\`id=\"${linkedElementId}\"\\`)`\n })\n }\n\n /**\n * Focus the linked element on click\n *\n * Adds a helper CSS class to hide native focus styles,\n * but removes it on blur to restore native focus styles\n */\n this.$module.addEventListener('click', () =>\n setFocus($linkedElement, {\n onBeforeFocus() {\n $linkedElement.classList.add('govuk-skip-link-focused-element')\n },\n onBlur() {\n $linkedElement.classList.remove('govuk-skip-link-focused-element')\n }\n })\n )\n }\n\n /**\n * Name for the component used when initialising using data-module attributes.\n */\n static moduleName = 'govuk-skip-link'\n}\n"],"names":["SkipLink","GOVUKFrontendComponent","constructor","$module","_this$$module$getAttr","HTMLAnchorElement","ElementError","componentName","element","expectedType","identifier","hash","href","getAttribute","url","window","URL","error","origin","location","pathname","linkedElementId","getFragmentFromUrl","$linkedElement","document","getElementById","addEventListener","setFocus","onBeforeFocus","classList","add","onBlur","remove","moduleName"],"mappings":";;;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAMA,QAAQ,SAASC,sBAAsB,CAAC;AAInD;AACF;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,OAAO,EAAE;AAAA,IAAA,IAAAC,qBAAA,CAAA;AACnB,IAAA,KAAK,EAAE,CAAA;AAAA,IAAA,IAAA,CATTD,OAAO,GAAA,KAAA,CAAA,CAAA;AAWL,IAAA,IAAI,EAAEA,OAAO,YAAYE,iBAAiB,CAAC,EAAE;MAC3C,MAAM,IAAIC,YAAY,CAAC;AACrBC,QAAAA,aAAa,EAAE,WAAW;AAC1BC,QAAAA,OAAO,EAAEL,OAAO;AAChBM,QAAAA,YAAY,EAAE,mBAAmB;AACjCC,QAAAA,UAAU,EAAE,0BAAA;AACd,OAAC,CAAC,CAAA;AACJ,KAAA;IAEA,IAAI,CAACP,OAAO,GAAGA,OAAO,CAAA;AAEtB,IAAA,MAAMQ,IAAI,GAAG,IAAI,CAACR,OAAO,CAACQ,IAAI,CAAA;AAC9B,IAAA,MAAMC,IAAI,GAAA,CAAAR,qBAAA,GAAG,IAAI,CAACD,OAAO,CAACU,YAAY,CAAC,MAAM,CAAC,KAAAT,IAAA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,CAAC,iCAAiC,CAAC,CAAA;AACpE,OAAA;AACF,KAAC,CACH,CAAC,CAAA;AACH,GAAA;AAMF,CAAA;AA/FahC,QAAQ,CA8FZiC,UAAU,GAAG,iBAAiB;;;;"}
1
+ {"version":3,"file":"skip-link.mjs","sources":["../../../../src/govuk/components/skip-link/skip-link.mjs"],"sourcesContent":["import { getFragmentFromUrl, setFocus } from '../../common/index.mjs'\nimport { ElementError } from '../../errors/index.mjs'\nimport { GOVUKFrontendComponent } from '../../govuk-frontend-component.mjs'\n\n/**\n * Skip link component\n *\n * @preserve\n */\nexport class SkipLink extends GOVUKFrontendComponent {\n /** @private */\n $module\n\n /**\n * @param {Element | null} $module - HTML element to use for skip link\n * @throws {ElementError} when $module is not set or the wrong type\n * @throws {ElementError} when $module.hash does not contain a hash\n * @throws {ElementError} when the linked element is missing or the wrong type\n */\n constructor($module) {\n super()\n\n if (!($module instanceof HTMLAnchorElement)) {\n throw new ElementError({\n componentName: 'Skip link',\n element: $module,\n expectedType: 'HTMLAnchorElement',\n identifier: 'Root element (`$module`)'\n })\n }\n\n this.$module = $module\n\n const hash = this.$module.hash\n const href = this.$module.getAttribute('href') ?? ''\n\n /** @type {URL | undefined} */\n let url\n\n /**\n * Check for valid link URL\n *\n * {@link https://caniuse.com/url}\n * {@link https://url.spec.whatwg.org}\n *\n */\n try {\n url = new window.URL(this.$module.href)\n } catch (error) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) is invalid`\n )\n }\n\n // Return early for external URLs or links to other pages\n if (\n url.origin !== window.location.origin ||\n url.pathname !== window.location.pathname\n ) {\n return\n }\n\n const linkedElementId = getFragmentFromUrl(hash)\n\n // Check link path matching current page\n if (!linkedElementId) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) has no hash fragment`\n )\n }\n\n const $linkedElement = document.getElementById(linkedElementId)\n\n // Check for link target element\n if (!$linkedElement) {\n throw new ElementError({\n componentName: 'Skip link',\n element: $linkedElement,\n identifier: `Target content (\\`id=\"${linkedElementId}\"\\`)`\n })\n }\n\n /**\n * Focus the linked element on click\n *\n * Adds a helper CSS class to hide native focus styles,\n * but removes it on blur to restore native focus styles\n */\n this.$module.addEventListener('click', () =>\n setFocus($linkedElement, {\n onBeforeFocus() {\n $linkedElement.classList.add('govuk-skip-link-focused-element')\n },\n onBlur() {\n $linkedElement.classList.remove('govuk-skip-link-focused-element')\n }\n })\n )\n }\n\n /**\n * Name for the component used when initialising using data-module attributes.\n */\n static moduleName = 'govuk-skip-link'\n}\n"],"names":["SkipLink","GOVUKFrontendComponent","constructor","$module","_this$$module$getAttr","HTMLAnchorElement","ElementError","componentName","element","expectedType","identifier","hash","href","getAttribute","url","window","URL","error","origin","location","pathname","linkedElementId","getFragmentFromUrl","$linkedElement","document","getElementById","addEventListener","setFocus","onBeforeFocus","classList","add","onBlur","remove","moduleName"],"mappings":";;;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAMA,QAAQ,SAASC,sBAAsB,CAAC;AAInD;AACF;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,OAAO,EAAE;AAAA,IAAA,IAAAC,qBAAA,CAAA;AACnB,IAAA,KAAK,EAAE,CAAA;AAAA,IAAA,IAAA,CATTD,OAAO,GAAA,KAAA,CAAA,CAAA;AAWL,IAAA,IAAI,EAAEA,OAAO,YAAYE,iBAAiB,CAAC,EAAE;MAC3C,MAAM,IAAIC,YAAY,CAAC;AACrBC,QAAAA,aAAa,EAAE,WAAW;AAC1BC,QAAAA,OAAO,EAAEL,OAAO;AAChBM,QAAAA,YAAY,EAAE,mBAAmB;AACjCC,QAAAA,UAAU,EAAE,0BAAA;AACd,OAAC,CAAC,CAAA;AACJ,KAAA;IAEA,IAAI,CAACP,OAAO,GAAGA,OAAO,CAAA;AAEtB,IAAA,MAAMQ,IAAI,GAAG,IAAI,CAACR,OAAO,CAACQ,IAAI,CAAA;AAC9B,IAAA,MAAMC,IAAI,GAAA,CAAAR,qBAAA,GAAG,IAAI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MA,GAAG;AACPR,QAAAA,cAAc,CAACM,SAAS,CAACG,MAAM,CAAC,iCAAiC,CAAC,CAAA;AACpE,OAAA;AACF,KAAC,CACH,CAAC,CAAA;AACH,GAAA;AAMF,CAAA;AA/FahC,QAAQ,CA8FZiC,UAAU,GAAG,iBAAiB;;;;"}
@@ -1,3 +1,6 @@
1
- <a href="{{ params.href | default("#content", true) }}" class="govuk-skip-link {%- if params.classes %} {{ params.classes }}{% endif %}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %} data-module="govuk-skip-link">
1
+ {% from "../../macros/attributes.njk" import govukAttributes -%}
2
+
3
+ <a href="{{ params.href | default("#content", true) }}" class="govuk-skip-link {%- if params.classes %} {{ params.classes }}{% endif %}"
4
+ {{- govukAttributes(params.attributes) }} data-module="govuk-skip-link">
2
5
  {{- params.html | safe if params.html else params.text -}}
3
6
  </a>
@@ -179,7 +179,8 @@
179
179
  .govuk-summary-card__title-wrapper {
180
180
  padding: govuk-spacing(3);
181
181
 
182
- // Ensures the card header appears separate to the summary list in forced colours mode
182
+ // Ensures the card header appears separate to the summary list in forced
183
+ // colours mode
183
184
  border-bottom: 1px solid transparent;
184
185
  background-color: govuk-colour("light-grey");
185
186
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/govuk/components/summary-list/_index.scss"],"names":[],"mappings":"AAAA;EACE;IACE,8BAA8B;IAC9B,0BAA0B;IAC1B;MACE,cAAc;MACd,WAAW;MACX,mBAAmB,EAAE,mDAAmD;MACxE,yBAAyB;IAC3B;IACA,SAAS,EAAE,iCAAiC;IAC5C,6CAA6C;EAC/C;;EAEA;IACE,6CAA6C;;IAE7C;MACE,+BAA+B;IACjC;IACA;MACE,kBAAkB;IACpB;EACF;;EAEA,sDAAsD;EACtD;IACE,gBAAgB;EAClB;;EAEA,0EAA0E;EAC1E,uEAAuE;EACvE;IACE;MACE;QACE,WAAW;QACX,mBAAmB;QACnB,UAAU;MACZ;IACF;EACF;;EAEA;;;I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;;EAEA;IACE,6CAA6C;IAC7C,0BAA0B;IAC1B,4DAA4D;;IAE5D;MACE,+BAA+B;IACjC;EACF;;EAEA;IACE,mCAAmC;IACnC,qCAAqC;IACrC,aAAa;IACb,eAAe;IACf,aAAa;IACb,0BAA0B;IAC1B,UAAU;IACV,gBAAgB;;IAEhB;MACE,sBAAsB;MACtB,iBAAiB;IACnB;EACF;;EAEA;IACE,eAAe;IACf,8BAA8B;IAC9B,+BAA+B;IAC/B,4CAA4C;;IAE5C;MACE,eAAe;IACjB;;IAEA,2EAA2E;IAC3E,kBAAkB;IAClB,CAAC;IACD,2EAA2E;IAC3E,6EAA6E;IAC7E,yEAAyE;IACzE,CAAC;IACD,yGAAyG;IACzG,sDAAsD;IACtD;MACE,+BAA+B;IACjC;EACF;;EAEA;IACE,SAAS;IACT,gBAAgB;IAChB,kBAAkB;;IAElB;MACE,8BAA8B;IAChC;;IAEA,wCAAwC;IACxC;MACE,gBAAgB;IAClB;EACF;;EAEA;IACE,4CAA4C;;IAE5C;MACE,0CAA0C;IAC5C;;IAEA;MACE,gBAAgB;IAClB;;IAEA;MACE,gBAAgB;MAChB,mBAAmB;IACrB;EACF;AACF","file":"_index.scss","sourcesContent":["@include govuk-exports(\"govuk/component/summary-list\") {\n .govuk-summary-list {\n @include govuk-font($size: 19);\n @include govuk-text-colour;\n @include govuk-media-query($from: tablet) {\n display: table;\n width: 100%;\n table-layout: fixed; // Required to allow us to wrap words that overflow.\n border-collapse: collapse;\n }\n margin: 0; // Reset default user agent styles\n @include govuk-responsive-margin(6, \"bottom\");\n }\n\n .govuk-summary-list__row {\n border-bottom: 1px solid $govuk-border-colour;\n\n @include govuk-media-query($until: tablet) {\n margin-bottom: govuk-spacing(3);\n }\n @include govuk-media-query($from: tablet) {\n display: table-row;\n }\n }\n\n // Remove right padding from the last column in the row\n .govuk-summary-list__row:not(.govuk-summary-list__row--no-actions) > :last-child {\n padding-right: 0;\n }\n\n // Provide an empty 'cell' for rows that don't have actions – otherwise the\n // bottom border is not drawn for that part of the row in some browsers.\n .govuk-summary-list__row--no-actions {\n @include govuk-media-query($from: tablet) {\n &::after {\n content: \"\";\n display: table-cell;\n width: 20%;\n }\n }\n }\n\n .govuk-summary-list__key,\n .govuk-summary-list__value,\n .govuk-summary-list__actions {\n margin: 0; // Reset default user agent styles\n\n @include govuk-media-query($from: tablet) {\n display: table-cell;\n padding-top: govuk-spacing(2);\n padding-right: govuk-spacing(4);\n padding-bottom: govuk-spacing(2);\n }\n }\n\n .govuk-summary-list__actions {\n margin-bottom: govuk-spacing(3);\n @include govuk-media-query($from: tablet) {\n width: 20%;\n text-align: right;\n }\n }\n\n .govuk-summary-list__key,\n .govuk-summary-list__value {\n // Automatic wrapping for unbreakable text (e.g. URLs)\n word-wrap: break-word; // Fallback for older browsers only\n overflow-wrap: break-word;\n }\n\n .govuk-summary-list__key {\n margin-bottom: govuk-spacing(1);\n @include govuk-typography-weight-bold;\n @include govuk-media-query($from: tablet) {\n width: 30%;\n }\n }\n\n .govuk-summary-list__value {\n @include govuk-media-query($until: tablet) {\n margin-bottom: govuk-spacing(3);\n }\n }\n\n .govuk-summary-list__value > p {\n margin-bottom: govuk-spacing(2);\n }\n\n .govuk-summary-list__value > :last-child {\n margin-bottom: 0;\n }\n\n .govuk-summary-list__actions-list {\n width: 100%;\n margin: 0; // Reset default user agent styles\n padding: 0; // Reset default user agent styles\n }\n\n .govuk-summary-list__actions-list-item {\n display: inline-block;\n }\n\n @include govuk-media-query($until: tablet) {\n .govuk-summary-list__actions-list-item {\n margin-right: govuk-spacing(2);\n padding-right: govuk-spacing(2);\n border-right: 1px solid $govuk-border-colour;\n }\n\n .govuk-summary-list__actions-list-item:last-child {\n margin-right: 0;\n padding-right: 0;\n border: 0;\n }\n }\n\n @include govuk-media-query($from: tablet) {\n .govuk-summary-list__actions-list-item {\n margin-left: govuk-spacing(2);\n padding-left: govuk-spacing(2);\n }\n\n .govuk-summary-list__actions-list-item:not(:first-child) {\n border-left: 1px solid $govuk-border-colour;\n }\n\n .govuk-summary-list__actions-list-item:first-child {\n margin-left: 0;\n padding-left: 0;\n border: 0;\n }\n }\n\n // Large groups of action links may wrap onto multiple lines. Because the link\n // focus styles are applied outside of the link's bounding box, there are\n // situations where the focus style on a link can be overlapped by subsequent\n // links. We don't want this, so let's create a new stacking context on focus\n // so the link always appears to be 'on top'.\n .govuk-summary-list__actions-list-item .govuk-link:focus {\n isolation: isolate;\n }\n\n // No border on entire summary list\n .govuk-summary-list--no-border {\n .govuk-summary-list__row {\n border: 0;\n }\n\n // Increase padding by 1px to compensate for 'missing' border\n @include govuk-media-query($from: tablet) {\n .govuk-summary-list__key,\n .govuk-summary-list__value,\n .govuk-summary-list__actions {\n padding-bottom: govuk-spacing(2) + 1px;\n }\n }\n }\n\n // No border on specific rows\n .govuk-summary-list__row--no-border {\n border: 0;\n\n // Increase padding by 1px to compensate for 'missing' border\n @include govuk-media-query($from: tablet) {\n .govuk-summary-list__key,\n .govuk-summary-list__value,\n .govuk-summary-list__actions {\n padding-bottom: govuk-spacing(2) + 1px;\n }\n }\n }\n\n // Additional block for the summary card\n .govuk-summary-card {\n @include govuk-responsive-margin(6, \"bottom\");\n border: 1px solid $govuk-border-colour;\n }\n\n .govuk-summary-card__title-wrapper {\n padding: govuk-spacing(3);\n\n // Ensures the card header appears separate to the summary list in forced colours mode\n border-bottom: 1px solid transparent;\n background-color: govuk-colour(\"light-grey\");\n\n @include govuk-media-query($from: \"tablet\") {\n display: flex;\n justify-content: space-between;\n flex-wrap: nowrap;\n padding: govuk-spacing(3) govuk-spacing(4);\n }\n }\n\n .govuk-summary-card__title {\n @include govuk-font($size: 19, $weight: bold);\n @include govuk-text-colour;\n margin: govuk-spacing(1) govuk-spacing(4) govuk-spacing(2) 0;\n\n @include govuk-media-query($from: \"tablet\") {\n margin-bottom: govuk-spacing(1);\n }\n }\n\n .govuk-summary-card__actions {\n @include govuk-font-size($size: 19);\n @include govuk-typography-weight-bold;\n display: flex;\n flex-wrap: wrap;\n row-gap: 10px;\n margin: govuk-spacing(1) 0;\n padding: 0;\n list-style: none;\n\n @include govuk-media-query($from: \"tablet\") {\n justify-content: right;\n text-align: right;\n }\n }\n\n .govuk-summary-card__action {\n display: inline;\n margin: 0 govuk-spacing(2) 0 0;\n padding-right: govuk-spacing(2);\n border-right: 1px solid $govuk-border-colour;\n\n @include govuk-media-query($from: \"tablet\") {\n margin-right: 0;\n }\n\n // We use the following media query to target IE11 and 10 only to add margin\n // between actions.\n //\n // We do this because we're using row-gap to create space between actions on\n // more evergreen browsers which IE doesn't support. @supports currently isn't\n // a viable solution, see https://github.com/w3c/csswg-drafts/issues/3559.\n //\n // Solution taken from https://stackoverflow.com/questions/11173106/apply-style-only-on-ie#answer-36448860\n // which also includes an explanation of why this works\n @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n margin-bottom: govuk-spacing(1);\n }\n }\n\n .govuk-summary-card__action:last-child {\n margin: 0;\n padding-right: 0;\n border-right: none;\n\n @include govuk-media-query($from: \"tablet\") {\n padding-left: govuk-spacing(2);\n }\n\n // See above comment for why this is here\n @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n margin-bottom: 0;\n }\n }\n\n .govuk-summary-card__content {\n padding: govuk-spacing(3) govuk-spacing(3) 0;\n\n @include govuk-media-query($from: \"tablet\") {\n padding: govuk-spacing(3) govuk-spacing(4);\n }\n\n .govuk-summary-list {\n margin-bottom: 0;\n }\n\n .govuk-summary-list__row:last-of-type {\n margin-bottom: 0;\n border-bottom: none;\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../../../../src/govuk/components/summary-list/_index.scss"],"names":[],"mappings":"AAAA;EACE;IACE,8BAA8B;IAC9B,0BAA0B;IAC1B;MACE,cAAc;MACd,WAAW;MACX,mBAAmB,EAAE,mDAAmD;MACxE,yBAAyB;IAC3B;IACA,SAAS,EAAE,iCAAiC;IAC5C,6CAA6C;EAC/C;;EAEA;IACE,6CAA6C;;IAE7C;MACE,+BAA+B;IACjC;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ACvC;IACE,6CAA6C;IAC7C,sCAAsC;EACxC;;EAEA;IACE,yBAAyB;;IAEzB,wEAAwE;IACxE,cAAc;IACd,oCAAoC;IACpC,4CAA4C;;IAE5C;MACE,aAAa;MACb,8BAA8B;MAC9B,iBAAiB;MACjB,0CAA0C;IAC5C;EACF;;EAEA;IACE,6CAA6C;IAC7C,0BAA0B;IAC1B,4DAA4D;;IAE5D;MACE,+BAA+B;IACjC;EACF;;EAEA;IACE,mCAAmC;IACnC,qCAAqC;IACrC,aAAa;IACb,eAAe;IACf,aAAa;IACb,0BAA0B;IAC1B,UAAU;IACV,gBAAgB;;IAEhB;MACE,sBAAsB;MACtB,iBAAiB;IACnB;EACF;;EAEA;IACE,eAAe;IACf,8BAA8B;IAC9B,+BAA+B;IAC/B,4CAA4C;;IAE5C;MACE,eAAe;IACjB;;IAEA,2EAA2E;IAC3E,kBAAkB;IAClB,CAAC;IACD,2EAA2E;IAC3E,6EAA6E;IAC7E,yEAAyE;IACzE,CAAC;IACD,yGAAyG;IACzG,sDAAsD;IACtD;MACE,+BAA+B;IACjC;EACF;;EAEA;IACE,SAAS;IACT,gBAAgB;IAChB,kBAAkB;;IAElB;MACE,8BAA8B;IAChC;;IAEA,wCAAwC;IACxC;MACE,gBAAgB;IAClB;EACF;;EAEA;IACE,4CAA4C;;IAE5C;MACE,0CAA0C;IAC5C;;IAEA;MACE,gBAAgB;IAClB;;IAEA;MACE,gBAAgB;MAChB,mBAAmB;IACrB;EACF;AACF","file":"_index.scss","sourcesContent":["@include govuk-exports(\"govuk/component/summary-list\") {\n .govuk-summary-list {\n @include govuk-font($size: 19);\n @include govuk-text-colour;\n @include govuk-media-query($from: tablet) {\n display: table;\n width: 100%;\n table-layout: fixed; // Required to allow us to wrap words that overflow.\n border-collapse: collapse;\n }\n margin: 0; // Reset default user agent styles\n @include govuk-responsive-margin(6, \"bottom\");\n }\n\n .govuk-summary-list__row {\n border-bottom: 1px solid $govuk-border-colour;\n\n @include govuk-media-query($until: tablet) {\n margin-bottom: govuk-spacing(3);\n }\n @include govuk-media-query($from: tablet) {\n display: table-row;\n }\n }\n\n // Remove right padding from the last column in the row\n .govuk-summary-list__row:not(.govuk-summary-list__row--no-actions) > :last-child {\n padding-right: 0;\n }\n\n // Provide an empty 'cell' for rows that don't have actions – otherwise the\n // bottom border is not drawn for that part of the row in some browsers.\n .govuk-summary-list__row--no-actions {\n @include govuk-media-query($from: tablet) {\n &::after {\n content: \"\";\n display: table-cell;\n width: 20%;\n }\n }\n }\n\n .govuk-summary-list__key,\n .govuk-summary-list__value,\n .govuk-summary-list__actions {\n margin: 0; // Reset default user agent styles\n\n @include govuk-media-query($from: tablet) {\n display: table-cell;\n padding-top: govuk-spacing(2);\n padding-right: govuk-spacing(4);\n padding-bottom: govuk-spacing(2);\n }\n }\n\n .govuk-summary-list__actions {\n margin-bottom: govuk-spacing(3);\n @include govuk-media-query($from: tablet) {\n width: 20%;\n text-align: right;\n }\n }\n\n .govuk-summary-list__key,\n .govuk-summary-list__value {\n // Automatic wrapping for unbreakable text (e.g. URLs)\n word-wrap: break-word; // Fallback for older browsers only\n overflow-wrap: break-word;\n }\n\n .govuk-summary-list__key {\n margin-bottom: govuk-spacing(1);\n @include govuk-typography-weight-bold;\n @include govuk-media-query($from: tablet) {\n width: 30%;\n }\n }\n\n .govuk-summary-list__value {\n @include govuk-media-query($until: tablet) {\n margin-bottom: govuk-spacing(3);\n }\n }\n\n .govuk-summary-list__value > p {\n margin-bottom: govuk-spacing(2);\n }\n\n .govuk-summary-list__value > :last-child {\n margin-bottom: 0;\n }\n\n .govuk-summary-list__actions-list {\n width: 100%;\n margin: 0; // Reset default user agent styles\n padding: 0; // Reset default user agent styles\n }\n\n .govuk-summary-list__actions-list-item {\n display: inline-block;\n }\n\n @include govuk-media-query($until: tablet) {\n .govuk-summary-list__actions-list-item {\n margin-right: govuk-spacing(2);\n padding-right: govuk-spacing(2);\n border-right: 1px solid $govuk-border-colour;\n }\n\n .govuk-summary-list__actions-list-item:last-child {\n margin-right: 0;\n padding-right: 0;\n border: 0;\n }\n }\n\n @include govuk-media-query($from: tablet) {\n .govuk-summary-list__actions-list-item {\n margin-left: govuk-spacing(2);\n padding-left: govuk-spacing(2);\n }\n\n .govuk-summary-list__actions-list-item:not(:first-child) {\n border-left: 1px solid $govuk-border-colour;\n }\n\n .govuk-summary-list__actions-list-item:first-child {\n margin-left: 0;\n padding-left: 0;\n border: 0;\n }\n }\n\n // Large groups of action links may wrap onto multiple lines. Because the link\n // focus styles are applied outside of the link's bounding box, there are\n // situations where the focus style on a link can be overlapped by subsequent\n // links. We don't want this, so let's create a new stacking context on focus\n // so the link always appears to be 'on top'.\n .govuk-summary-list__actions-list-item .govuk-link:focus {\n isolation: isolate;\n }\n\n // No border on entire summary list\n .govuk-summary-list--no-border {\n .govuk-summary-list__row {\n border: 0;\n }\n\n // Increase padding by 1px to compensate for 'missing' border\n @include govuk-media-query($from: tablet) {\n .govuk-summary-list__key,\n .govuk-summary-list__value,\n .govuk-summary-list__actions {\n padding-bottom: govuk-spacing(2) + 1px;\n }\n }\n }\n\n // No border on specific rows\n .govuk-summary-list__row--no-border {\n border: 0;\n\n // Increase padding by 1px to compensate for 'missing' border\n @include govuk-media-query($from: tablet) {\n .govuk-summary-list__key,\n .govuk-summary-list__value,\n .govuk-summary-list__actions {\n padding-bottom: govuk-spacing(2) + 1px;\n }\n }\n }\n\n // Additional block for the summary card\n .govuk-summary-card {\n @include govuk-responsive-margin(6, \"bottom\");\n border: 1px solid $govuk-border-colour;\n }\n\n .govuk-summary-card__title-wrapper {\n padding: govuk-spacing(3);\n\n // Ensures the card header appears separate to the summary list in forced\n // colours mode\n border-bottom: 1px solid transparent;\n background-color: govuk-colour(\"light-grey\");\n\n @include govuk-media-query($from: \"tablet\") {\n display: flex;\n justify-content: space-between;\n flex-wrap: nowrap;\n padding: govuk-spacing(3) govuk-spacing(4);\n }\n }\n\n .govuk-summary-card__title {\n @include govuk-font($size: 19, $weight: bold);\n @include govuk-text-colour;\n margin: govuk-spacing(1) govuk-spacing(4) govuk-spacing(2) 0;\n\n @include govuk-media-query($from: \"tablet\") {\n margin-bottom: govuk-spacing(1);\n }\n }\n\n .govuk-summary-card__actions {\n @include govuk-font-size($size: 19);\n @include govuk-typography-weight-bold;\n display: flex;\n flex-wrap: wrap;\n row-gap: 10px;\n margin: govuk-spacing(1) 0;\n padding: 0;\n list-style: none;\n\n @include govuk-media-query($from: \"tablet\") {\n justify-content: right;\n text-align: right;\n }\n }\n\n .govuk-summary-card__action {\n display: inline;\n margin: 0 govuk-spacing(2) 0 0;\n padding-right: govuk-spacing(2);\n border-right: 1px solid $govuk-border-colour;\n\n @include govuk-media-query($from: \"tablet\") {\n margin-right: 0;\n }\n\n // We use the following media query to target IE11 and 10 only to add margin\n // between actions.\n //\n // We do this because we're using row-gap to create space between actions on\n // more evergreen browsers which IE doesn't support. @supports currently isn't\n // a viable solution, see https://github.com/w3c/csswg-drafts/issues/3559.\n //\n // Solution taken from https://stackoverflow.com/questions/11173106/apply-style-only-on-ie#answer-36448860\n // which also includes an explanation of why this works\n @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n margin-bottom: govuk-spacing(1);\n }\n }\n\n .govuk-summary-card__action:last-child {\n margin: 0;\n padding-right: 0;\n border-right: none;\n\n @include govuk-media-query($from: \"tablet\") {\n padding-left: govuk-spacing(2);\n }\n\n // See above comment for why this is here\n @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n margin-bottom: 0;\n }\n }\n\n .govuk-summary-card__content {\n padding: govuk-spacing(3) govuk-spacing(3) 0;\n\n @include govuk-media-query($from: \"tablet\") {\n padding: govuk-spacing(3) govuk-spacing(4);\n }\n\n .govuk-summary-list {\n margin-bottom: 0;\n }\n\n .govuk-summary-list__row:last-of-type {\n margin-bottom: 0;\n border-bottom: none;\n }\n }\n}\n"]}