defra_ruby_template 5.4.1 → 5.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (427) hide show
  1. checksums.yaml +4 -4
  2. data/app/views/layouts/defra_ruby_template.html.erb +39 -18
  3. data/lib/defra_ruby_template/version.rb +1 -1
  4. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +882 -492
  5. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -1
  6. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +877 -492
  7. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -1
  8. data/node_modules/govuk-frontend/dist/govuk/all.mjs +5 -0
  9. data/node_modules/govuk-frontend/dist/govuk/all.mjs.map +1 -1
  10. data/node_modules/govuk-frontend/dist/govuk/all.scss +6 -0
  11. data/node_modules/govuk-frontend/dist/govuk/all.scss.map +1 -1
  12. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-crest.svg +1 -0
  13. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.ico +0 -0
  14. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.svg +1 -0
  15. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-crest.svg +1 -0
  16. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-180.png +0 -0
  17. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-192.png +0 -0
  18. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-512.png +0 -0
  19. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-mask.svg +1 -0
  20. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-opengraph-image.png +0 -0
  21. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/manifest.json +39 -0
  22. data/node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map +1 -1
  23. data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs +169 -0
  24. data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs.map +1 -0
  25. data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
  26. data/node_modules/govuk-frontend/dist/govuk/common/index.mjs +20 -83
  27. data/node_modules/govuk-frontend/dist/govuk/common/index.mjs.map +1 -1
  28. data/node_modules/govuk-frontend/dist/govuk/component.mjs +60 -0
  29. data/node_modules/govuk-frontend/dist/govuk/component.mjs.map +1 -0
  30. data/node_modules/govuk-frontend/dist/govuk/components/_index.scss +1 -0
  31. data/node_modules/govuk-frontend/dist/govuk/components/_index.scss.map +1 -1
  32. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +35 -31
  33. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss.map +1 -1
  34. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +296 -195
  35. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js.map +1 -1
  36. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +295 -194
  37. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs.map +1 -1
  38. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs +88 -110
  39. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs.map +1 -1
  40. data/node_modules/govuk-frontend/dist/govuk/components/accordion/fixtures.json +16 -3
  41. data/node_modules/govuk-frontend/dist/govuk/components/back-link/fixtures.json +25 -15
  42. data/node_modules/govuk-frontend/dist/govuk/components/back-link/template-with-custom-link.html +1 -0
  43. data/node_modules/govuk-frontend/dist/govuk/components/back-link/template.njk +2 -2
  44. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/fixtures.json +53 -15
  45. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/macro-options.json +6 -0
  46. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-default.html +2 -2
  47. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-inverse.html +2 -2
  48. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-with-collapse-on-mobile.html +2 -2
  49. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-with-last-breadcrumb-as-current-page.html +2 -2
  50. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-with-multiple-levels.html +2 -2
  51. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-with-one-level.html +2 -2
  52. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-without-the-home-section.html +2 -2
  53. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template.njk +2 -2
  54. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js +217 -106
  55. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js.map +1 -1
  56. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs +216 -105
  57. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs.map +1 -1
  58. data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs +9 -22
  59. data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs.map +1 -1
  60. data/node_modules/govuk-frontend/dist/govuk/components/button/fixtures.json +38 -0
  61. data/node_modules/govuk-frontend/dist/govuk/components/button/macro-options.json +2 -1
  62. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +12 -4
  63. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss.map +1 -1
  64. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +256 -145
  65. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js.map +1 -1
  66. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +255 -144
  67. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs.map +1 -1
  68. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +29 -34
  69. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs.map +1 -1
  70. data/node_modules/govuk-frontend/dist/govuk/components/character-count/fixtures.json +80 -1
  71. data/node_modules/govuk-frontend/dist/govuk/components/character-count/macro-options.json +6 -6
  72. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-error.html +12 -0
  73. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-hint-and-error.html +15 -0
  74. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template.njk +5 -4
  75. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss +6 -1
  76. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss.map +1 -1
  77. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js +96 -50
  78. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js.map +1 -1
  79. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs +95 -49
  80. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs.map +1 -1
  81. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs +9 -18
  82. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs.map +1 -1
  83. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/fixtures.json +88 -1
  84. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-divider-and-none.html +34 -0
  85. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss +23 -14
  86. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss.map +1 -1
  87. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/fixtures.json +23 -0
  88. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +2 -2
  89. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss.map +1 -1
  90. data/node_modules/govuk-frontend/dist/govuk/components/date-input/fixtures.json +27 -0
  91. data/node_modules/govuk-frontend/dist/govuk/components/date-input/macro-options.json +2 -2
  92. data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss +7 -2
  93. data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss.map +1 -1
  94. data/node_modules/govuk-frontend/dist/govuk/components/details/fixtures.json +10 -0
  95. data/node_modules/govuk-frontend/dist/govuk/components/error-message/fixtures.json +9 -0
  96. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss +4 -0
  97. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss.map +1 -1
  98. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js +238 -127
  99. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js.map +1 -1
  100. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs +237 -126
  101. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs.map +1 -1
  102. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs +10 -22
  103. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs.map +1 -1
  104. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/fixtures.json +19 -0
  105. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +218 -107
  106. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js.map +1 -1
  107. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +217 -106
  108. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs.map +1 -1
  109. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs +10 -22
  110. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs.map +1 -1
  111. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/fixtures.json +4 -0
  112. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.scss +3 -5
  113. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.scss.map +1 -1
  114. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/fixtures.json +18 -0
  115. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +175 -9
  116. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss.map +1 -1
  117. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js +744 -0
  118. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js.map +1 -0
  119. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs +736 -0
  120. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs.map +1 -0
  121. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs +257 -0
  122. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs.map +1 -0
  123. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/fixtures.json +220 -16
  124. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/macro-options.json +52 -3
  125. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-direct-media-capture.html +6 -0
  126. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-image-files-only.html +6 -0
  127. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-multiple-files.html +6 -0
  128. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-disabled.html +6 -0
  129. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-disabled.html +13 -0
  130. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-with-error-message-and-hint.html +16 -0
  131. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced.html +10 -0
  132. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-translated.html +10 -0
  133. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template.njk +42 -5
  134. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +61 -19
  135. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss.map +1 -1
  136. data/node_modules/govuk-frontend/dist/govuk/components/footer/fixtures.json +34 -0
  137. data/node_modules/govuk-frontend/dist/govuk/components/footer/macro-options.json +6 -0
  138. data/node_modules/govuk-frontend/dist/govuk/components/footer/template.njk +10 -0
  139. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +223 -21
  140. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +1 -1
  141. data/node_modules/govuk-frontend/dist/govuk/components/header/fixtures.json +78 -32
  142. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +90 -43
  143. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js.map +1 -1
  144. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +89 -42
  145. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs.map +1 -1
  146. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs +10 -18
  147. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs.map +1 -1
  148. data/node_modules/govuk-frontend/dist/govuk/components/header/macro-options.json +31 -12
  149. data/node_modules/govuk-frontend/dist/govuk/components/header/template-default.html +20 -12
  150. data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width-with-navigation.html +21 -15
  151. data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width.html +21 -15
  152. data/node_modules/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-html.html +20 -12
  153. data/node_modules/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-text-without-link.html +20 -12
  154. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-label.html +20 -12
  155. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-text.html +20 -12
  156. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-navigation-label.html +20 -12
  157. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-full-width-border.html +30 -0
  158. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-large-navigation.html +20 -12
  159. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-navigation.html +20 -12
  160. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-product-name.html +21 -15
  161. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name-and-navigation.html +20 -12
  162. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name-but-no-service-url.html +20 -12
  163. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name.html +20 -12
  164. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-st-edwards-crown.html +10 -12
  165. data/node_modules/govuk-frontend/dist/govuk/components/header/template.njk +11 -41
  166. data/node_modules/govuk-frontend/dist/govuk/components/hint/fixtures.json +6 -0
  167. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +7 -4
  168. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss.map +1 -1
  169. data/node_modules/govuk-frontend/dist/govuk/components/input/fixtures.json +97 -27
  170. data/node_modules/govuk-frontend/dist/govuk/components/input/macro-options.json +6 -6
  171. data/node_modules/govuk-frontend/dist/govuk/components/input/template-default.html +2 -2
  172. data/node_modules/govuk-frontend/dist/govuk/components/input/template-disabled.html +6 -0
  173. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-error-and-hint.html +12 -0
  174. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-error-message.html +2 -5
  175. data/node_modules/govuk-frontend/dist/govuk/components/input/template.njk +5 -4
  176. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/fixtures.json +6 -0
  177. data/node_modules/govuk-frontend/dist/govuk/components/label/fixtures.json +17 -0
  178. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +3 -2
  179. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss.map +1 -1
  180. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/fixtures.json +24 -0
  181. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js +238 -127
  182. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js.map +1 -1
  183. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs +237 -126
  184. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs.map +1 -1
  185. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs +10 -22
  186. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs.map +1 -1
  187. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +24 -37
  188. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss.map +1 -1
  189. data/node_modules/govuk-frontend/dist/govuk/components/pagination/fixtures.json +15 -0
  190. data/node_modules/govuk-frontend/dist/govuk/components/pagination/macro-options.json +4 -4
  191. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +13 -9
  192. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss.map +1 -1
  193. data/node_modules/govuk-frontend/dist/govuk/components/panel/fixtures.json +9 -0
  194. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss +12 -9
  195. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss.map +1 -1
  196. data/node_modules/govuk-frontend/dist/govuk/components/password-input/fixtures.json +27 -2
  197. data/node_modules/govuk-frontend/dist/govuk/components/password-input/macro-options.json +3 -3
  198. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +220 -110
  199. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js.map +1 -1
  200. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +219 -109
  201. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs.map +1 -1
  202. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs +12 -25
  203. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs.map +1 -1
  204. data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-default.html +3 -3
  205. data/node_modules/govuk-frontend/dist/govuk/components/password-input/template.njk +4 -2
  206. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +0 -8
  207. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss.map +1 -1
  208. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/fixtures.json +7 -0
  209. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +7 -5
  210. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss.map +1 -1
  211. data/node_modules/govuk-frontend/dist/govuk/components/radios/fixtures.json +51 -5
  212. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js +96 -50
  213. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js.map +1 -1
  214. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs +95 -49
  215. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs.map +1 -1
  216. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs +9 -18
  217. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs.map +1 -1
  218. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-a-divider.html +1 -1
  219. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-a-divider.html +1 -1
  220. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +5 -5
  221. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss.map +1 -1
  222. data/node_modules/govuk-frontend/dist/govuk/components/select/fixtures.json +43 -9
  223. data/node_modules/govuk-frontend/dist/govuk/components/select/macro-options.json +2 -2
  224. data/node_modules/govuk-frontend/dist/govuk/components/select/template-id.html +7 -0
  225. data/node_modules/govuk-frontend/dist/govuk/components/select/template.njk +6 -4
  226. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/README.md +15 -0
  227. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +187 -0
  228. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss.map +1 -0
  229. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.scss +4 -0
  230. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.scss.map +1 -0
  231. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/fixtures.json +515 -0
  232. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/macro-options.json +138 -0
  233. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/macro.njk +3 -0
  234. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +229 -0
  235. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js.map +1 -0
  236. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs +221 -0
  237. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs.map +1 -0
  238. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs +85 -0
  239. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs.map +1 -0
  240. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-default.html +57 -0
  241. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-html-navigation-items.html +49 -0
  242. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-large-navigation.html +153 -0
  243. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-long-service-name.html +20 -0
  244. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-navigation-with-a-current-item.html +58 -0
  245. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-navigation-with-an-active-item.html +58 -0
  246. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-non-link-navigation-items.html +49 -0
  247. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-service-link.html +20 -0
  248. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-service-name-and-navigation.html +63 -0
  249. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-service-name.html +18 -0
  250. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template.njk +103 -0
  251. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +6 -4
  252. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss.map +1 -1
  253. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/fixtures.json +9 -0
  254. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js +95 -48
  255. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js.map +1 -1
  256. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs +94 -47
  257. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs.map +1 -1
  258. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs +15 -23
  259. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs.map +1 -1
  260. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +14 -22
  261. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss.map +1 -1
  262. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/fixtures.json +174 -1
  263. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-extreme.html +106 -0
  264. data/node_modules/govuk-frontend/dist/govuk/components/table/fixtures.json +22 -1
  265. data/node_modules/govuk-frontend/dist/govuk/components/tabs/fixtures.json +15 -1
  266. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js +95 -53
  267. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js.map +1 -1
  268. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs +94 -52
  269. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs.map +1 -1
  270. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs +15 -28
  271. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs.map +1 -1
  272. data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss +11 -8
  273. data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss.map +1 -1
  274. data/node_modules/govuk-frontend/dist/govuk/components/tag/fixtures.json +14 -0
  275. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss +12 -10
  276. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss.map +1 -1
  277. data/node_modules/govuk-frontend/dist/govuk/components/task-list/fixtures.json +44 -0
  278. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-with-empty-values.html +27 -0
  279. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template.njk +1 -1
  280. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +3 -3
  281. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss.map +1 -1
  282. data/node_modules/govuk-frontend/dist/govuk/components/textarea/fixtures.json +32 -1
  283. data/node_modules/govuk-frontend/dist/govuk/components/textarea/macro-options.json +3 -3
  284. data/node_modules/govuk-frontend/dist/govuk/components/textarea/template.njk +6 -4
  285. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +6 -5
  286. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss.map +1 -1
  287. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/fixtures.json +8 -0
  288. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +1 -1
  289. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss.map +1 -1
  290. data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs +16 -3
  291. data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs.map +1 -1
  292. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
  293. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
  294. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
  295. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -1
  296. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +55 -8
  297. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss.map +1 -1
  298. data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +14 -4
  299. data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss.map +1 -1
  300. data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss +1 -1
  301. data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss.map +1 -1
  302. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +2 -2
  303. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss.map +1 -1
  304. data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.scss +1 -1
  305. data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.scss.map +1 -1
  306. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +18 -1
  307. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss.map +1 -1
  308. data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss +30 -62
  309. data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss.map +1 -1
  310. data/node_modules/govuk-frontend/dist/govuk/i18n.mjs.map +1 -1
  311. data/node_modules/govuk-frontend/dist/govuk/init.mjs +90 -24
  312. data/node_modules/govuk-frontend/dist/govuk/init.mjs.map +1 -1
  313. data/node_modules/govuk-frontend/dist/govuk/macros/logo.njk +78 -0
  314. data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss +5 -1
  315. data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss.map +1 -1
  316. data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss +5 -1
  317. data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss.map +1 -1
  318. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss +39 -1
  319. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss.map +1 -1
  320. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +244 -10
  321. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss.map +1 -1
  322. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss +5 -10
  323. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss.map +1 -1
  324. data/node_modules/govuk-frontend/dist/govuk/template.njk +20 -9
  325. data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss +1 -0
  326. data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss.map +1 -1
  327. data/node_modules/govuk-frontend/dist/govuk/tools/_rebrand.scss +65 -0
  328. data/node_modules/govuk-frontend/dist/govuk/tools/_rebrand.scss.map +1 -0
  329. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/functions.js +25 -0
  330. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss +1 -1
  331. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss.map +1 -1
  332. data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +8 -1
  333. data/node_modules/govuk-frontend/package.json +16 -16
  334. data/spec/spec_helper.rb +98 -0
  335. data/spec/tasks/assets_spec.rb +53 -0
  336. data/vendor/assets/assets/fonts/bold-affa96571d-v2.woff +0 -0
  337. data/vendor/assets/assets/fonts/bold-b542beb274-v2.woff2 +0 -0
  338. data/vendor/assets/assets/fonts/light-94a07e06a1-v2.woff2 +0 -0
  339. data/vendor/assets/assets/fonts/light-f591b13f7d-v2.woff +0 -0
  340. data/vendor/assets/assets/images/favicon.ico +0 -0
  341. data/vendor/assets/assets/images/favicon.svg +1 -0
  342. data/vendor/assets/assets/images/govuk-crest.svg +1 -0
  343. data/vendor/assets/assets/images/govuk-icon-180.png +0 -0
  344. data/vendor/assets/assets/images/govuk-icon-192.png +0 -0
  345. data/vendor/assets/assets/images/govuk-icon-512.png +0 -0
  346. data/vendor/assets/assets/images/govuk-icon-mask.svg +1 -0
  347. data/vendor/assets/assets/images/govuk-opengraph-image.png +0 -0
  348. data/vendor/assets/assets/manifest.json +39 -0
  349. data/vendor/assets/assets/rebrand/images/favicon.ico +0 -0
  350. data/vendor/assets/assets/rebrand/images/favicon.svg +1 -0
  351. data/vendor/assets/assets/rebrand/images/govuk-crest.svg +1 -0
  352. data/vendor/assets/assets/rebrand/images/govuk-icon-180.png +0 -0
  353. data/vendor/assets/assets/rebrand/images/govuk-icon-192.png +0 -0
  354. data/vendor/assets/assets/rebrand/images/govuk-icon-512.png +0 -0
  355. data/vendor/assets/assets/rebrand/images/govuk-icon-mask.svg +1 -0
  356. data/vendor/assets/assets/rebrand/images/govuk-opengraph-image.png +0 -0
  357. data/vendor/assets/assets/rebrand/manifest.json +39 -0
  358. data/vendor/assets/images/govuk-crest.svg +1 -0
  359. data/vendor/assets/javascripts/defra_ruby_template.js +882 -492
  360. data/vendor/assets/stylesheets/all.scss +6 -0
  361. data/vendor/assets/stylesheets/components/_index.scss +1 -0
  362. data/vendor/assets/stylesheets/components/accordion/_index.scss +35 -31
  363. data/vendor/assets/stylesheets/components/character-count/_index.scss +12 -4
  364. data/vendor/assets/stylesheets/components/checkboxes/_index.scss +6 -1
  365. data/vendor/assets/stylesheets/components/cookie-banner/_index.scss +23 -14
  366. data/vendor/assets/stylesheets/components/date-input/_index.scss +2 -2
  367. data/vendor/assets/stylesheets/components/details/_index.scss +7 -2
  368. data/vendor/assets/stylesheets/components/error-summary/_index.scss +4 -0
  369. data/vendor/assets/stylesheets/components/fieldset/_index.scss +3 -5
  370. data/vendor/assets/stylesheets/components/file-upload/_index.scss +175 -9
  371. data/vendor/assets/stylesheets/components/footer/_index.scss +61 -19
  372. data/vendor/assets/stylesheets/components/header/_index.scss +223 -21
  373. data/vendor/assets/stylesheets/components/input/_index.scss +7 -4
  374. data/vendor/assets/stylesheets/components/notification-banner/_index.scss +3 -2
  375. data/vendor/assets/stylesheets/components/pagination/_index.scss +24 -37
  376. data/vendor/assets/stylesheets/components/panel/_index.scss +13 -9
  377. data/vendor/assets/stylesheets/components/password-input/_index.scss +12 -9
  378. data/vendor/assets/stylesheets/components/phase-banner/_index.scss +0 -8
  379. data/vendor/assets/stylesheets/components/radios/_index.scss +7 -5
  380. data/vendor/assets/stylesheets/components/select/_index.scss +5 -5
  381. data/vendor/assets/stylesheets/components/service-navigation/_index.scss +187 -0
  382. data/vendor/assets/stylesheets/components/service-navigation/_service-navigation.scss +4 -0
  383. data/vendor/assets/stylesheets/components/skip-link/_index.scss +6 -4
  384. data/vendor/assets/stylesheets/components/summary-list/_index.scss +14 -22
  385. data/vendor/assets/stylesheets/components/tag/_index.scss +11 -8
  386. data/vendor/assets/stylesheets/components/task-list/_index.scss +12 -10
  387. data/vendor/assets/stylesheets/components/textarea/_index.scss +3 -3
  388. data/vendor/assets/stylesheets/components/warning-text/_index.scss +6 -5
  389. data/vendor/assets/stylesheets/core/_govuk-frontend-properties.scss +1 -1
  390. data/vendor/assets/stylesheets/defra_ruby_template.scss +6 -0
  391. data/vendor/assets/stylesheets/govuk-frontend.min.css +2 -2
  392. data/vendor/assets/stylesheets/helpers/_colour.scss +55 -8
  393. data/vendor/assets/stylesheets/helpers/_focused.scss +14 -4
  394. data/vendor/assets/stylesheets/helpers/_grid.scss +1 -1
  395. data/vendor/assets/stylesheets/helpers/_links.scss +2 -2
  396. data/vendor/assets/stylesheets/helpers/_shape-arrow.scss +1 -1
  397. data/vendor/assets/stylesheets/helpers/_typography.scss +18 -1
  398. data/vendor/assets/stylesheets/helpers/_visually-hidden.scss +30 -62
  399. data/vendor/assets/stylesheets/objects/_template.scss +5 -1
  400. data/vendor/assets/stylesheets/overrides/_typography.scss +5 -1
  401. data/vendor/assets/stylesheets/settings/_colours-applied.scss +39 -1
  402. data/vendor/assets/stylesheets/settings/_colours-organisations.scss +244 -10
  403. data/vendor/assets/stylesheets/settings/_typography-responsive.scss +5 -10
  404. data/vendor/assets/stylesheets/tools/_index.scss +1 -0
  405. data/vendor/assets/stylesheets/tools/_rebrand.scss +65 -0
  406. metadata +100 -24
  407. data/.github/dependabot.yml +0 -14
  408. data/.github/workflows/ci.yml +0 -31
  409. data/.gitignore +0 -8
  410. data/.rspec +0 -1
  411. data/.rubocop.yml +0 -3
  412. data/.ruby-version +0 -1
  413. data/Gemfile +0 -9
  414. data/Gemfile.lock +0 -58
  415. data/defra_ruby_template.gemspec +0 -35
  416. data/node_modules/.package-lock.json +0 -16
  417. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-crest-2x.png +0 -0
  418. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-crest.png +0 -0
  419. data/node_modules/govuk-frontend/dist/govuk/common/normalise-dataset.mjs +0 -18
  420. data/node_modules/govuk-frontend/dist/govuk/common/normalise-dataset.mjs.map +0 -1
  421. data/node_modules/govuk-frontend/dist/govuk/common/normalise-string.mjs +0 -31
  422. data/node_modules/govuk-frontend/dist/govuk/common/normalise-string.mjs.map +0 -1
  423. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-value.html +0 -6
  424. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend-component.mjs +0 -16
  425. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend-component.mjs.map +0 -1
  426. data/package-lock.json +0 -24
  427. data/package.json +0 -29
@@ -28,34 +28,34 @@ function setFocus($element, options = {}) {
28
28
  (_options$onBeforeFocu = options.onBeforeFocus) == null || _options$onBeforeFocu.call($element);
29
29
  $element.focus();
30
30
  }
31
+ function isInitialised($root, moduleName) {
32
+ return $root instanceof HTMLElement && $root.hasAttribute(`data-${moduleName}-init`);
33
+ }
34
+
35
+ /**
36
+ * Checks if GOV.UK Frontend is supported on this page
37
+ *
38
+ * Some browsers will load and run our JavaScript but GOV.UK Frontend
39
+ * won't be supported.
40
+ *
41
+ * @param {HTMLElement | null} [$scope] - (internal) `<body>` HTML element checked for browser support
42
+ * @returns {boolean} Whether GOV.UK Frontend is supported on this page
43
+ */
31
44
  function isSupported($scope = document.body) {
32
45
  if (!$scope) {
33
46
  return false;
34
47
  }
35
48
  return $scope.classList.contains('govuk-frontend-supported');
36
49
  }
37
-
38
- /**
39
- * Schema for component config
40
- *
41
- * @typedef {object} Schema
42
- * @property {{ [field: string]: SchemaProperty | undefined }} properties - Schema properties
43
- * @property {SchemaCondition[]} [anyOf] - List of schema conditions
44
- */
45
-
50
+ function formatErrorMessage(Component, message) {
51
+ return `${Component.moduleName}: ${message}`;
52
+ }
46
53
  /**
47
- * Schema property for component config
48
- *
49
- * @typedef {object} SchemaProperty
50
- * @property {'string' | 'boolean' | 'number' | 'object'} type - Property type
54
+ * @typedef ComponentWithModuleName
55
+ * @property {string} moduleName - Name of the component
51
56
  */
52
-
53
57
  /**
54
- * Schema condition for component config
55
- *
56
- * @typedef {object} SchemaCondition
57
- * @property {string[]} required - List of required config fields
58
- * @property {string} errorMessage - Error message when required config fields not provided
58
+ * @import { ObjectNested } from './configuration.mjs'
59
59
  */
60
60
 
61
61
  class GOVUKFrontendError extends Error {
@@ -81,60 +81,106 @@ class ElementError extends GOVUKFrontendError {
81
81
  let message = typeof messageOrOptions === 'string' ? messageOrOptions : '';
82
82
  if (typeof messageOrOptions === 'object') {
83
83
  const {
84
- componentName,
84
+ component,
85
85
  identifier,
86
86
  element,
87
87
  expectedType
88
88
  } = messageOrOptions;
89
- message = `${componentName}: ${identifier}`;
89
+ message = identifier;
90
90
  message += element ? ` is not of type ${expectedType != null ? expectedType : 'HTMLElement'}` : ' not found';
91
+ message = formatErrorMessage(component, message);
91
92
  }
92
93
  super(message);
93
94
  this.name = 'ElementError';
94
95
  }
95
96
  }
97
+ class InitError extends GOVUKFrontendError {
98
+ constructor(componentOrMessage) {
99
+ const message = typeof componentOrMessage === 'string' ? componentOrMessage : formatErrorMessage(componentOrMessage, `Root element (\`$root\`) already initialised`);
100
+ super(message);
101
+ this.name = 'InitError';
102
+ }
103
+ }
104
+ /**
105
+ * @import { ComponentWithModuleName } from '../common/index.mjs'
106
+ */
96
107
 
97
- class GOVUKFrontendComponent {
98
- constructor() {
99
- this.checkSupport();
108
+ class Component {
109
+ /**
110
+ * Returns the root element of the component
111
+ *
112
+ * @protected
113
+ * @returns {RootElementType} - the root element of component
114
+ */
115
+ get $root() {
116
+ return this._$root;
117
+ }
118
+ constructor($root) {
119
+ this._$root = void 0;
120
+ const childConstructor = this.constructor;
121
+ if (typeof childConstructor.moduleName !== 'string') {
122
+ throw new InitError(`\`moduleName\` not defined in component`);
123
+ }
124
+ if (!($root instanceof childConstructor.elementType)) {
125
+ throw new ElementError({
126
+ element: $root,
127
+ component: childConstructor,
128
+ identifier: 'Root element (`$root`)',
129
+ expectedType: childConstructor.elementType.name
130
+ });
131
+ } else {
132
+ this._$root = $root;
133
+ }
134
+ childConstructor.checkSupport();
135
+ this.checkInitialised();
136
+ const moduleName = childConstructor.moduleName;
137
+ this.$root.setAttribute(`data-${moduleName}-init`, '');
138
+ }
139
+ checkInitialised() {
140
+ const constructor = this.constructor;
141
+ const moduleName = constructor.moduleName;
142
+ if (moduleName && isInitialised(this.$root, moduleName)) {
143
+ throw new InitError(constructor);
144
+ }
100
145
  }
101
- checkSupport() {
146
+ static checkSupport() {
102
147
  if (!isSupported()) {
103
148
  throw new SupportError();
104
149
  }
105
150
  }
106
151
  }
107
152
 
153
+ /**
154
+ * @typedef ChildClass
155
+ * @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component
156
+ */
157
+
158
+ /**
159
+ * @typedef {typeof Component & ChildClass} ChildClassConstructor
160
+ */
161
+ Component.elementType = HTMLElement;
162
+
108
163
  /**
109
164
  * Skip link component
110
165
  *
111
166
  * @preserve
167
+ * @augments Component<HTMLAnchorElement>
112
168
  */
113
- class SkipLink extends GOVUKFrontendComponent {
169
+ class SkipLink extends Component {
114
170
  /**
115
- * @param {Element | null} $module - HTML element to use for skip link
116
- * @throws {ElementError} when $module is not set or the wrong type
117
- * @throws {ElementError} when $module.hash does not contain a hash
171
+ * @param {Element | null} $root - HTML element to use for skip link
172
+ * @throws {ElementError} when $root is not set or the wrong type
173
+ * @throws {ElementError} when $root.hash does not contain a hash
118
174
  * @throws {ElementError} when the linked element is missing or the wrong type
119
175
  */
120
- constructor($module) {
121
- var _this$$module$getAttr;
122
- super();
123
- this.$module = void 0;
124
- if (!($module instanceof HTMLAnchorElement)) {
125
- throw new ElementError({
126
- componentName: 'Skip link',
127
- element: $module,
128
- expectedType: 'HTMLAnchorElement',
129
- identifier: 'Root element (`$module`)'
130
- });
131
- }
132
- this.$module = $module;
133
- const hash = this.$module.hash;
134
- const href = (_this$$module$getAttr = this.$module.getAttribute('href')) != null ? _this$$module$getAttr : '';
176
+ constructor($root) {
177
+ var _this$$root$getAttrib;
178
+ super($root);
179
+ const hash = this.$root.hash;
180
+ const href = (_this$$root$getAttrib = this.$root.getAttribute('href')) != null ? _this$$root$getAttrib : '';
135
181
  let url;
136
182
  try {
137
- url = new window.URL(this.$module.href);
183
+ url = new window.URL(this.$root.href);
138
184
  } catch (error) {
139
185
  throw new ElementError(`Skip link: Target link (\`href="${href}"\`) is invalid`);
140
186
  }
@@ -148,12 +194,12 @@ class SkipLink extends GOVUKFrontendComponent {
148
194
  const $linkedElement = document.getElementById(linkedElementId);
149
195
  if (!$linkedElement) {
150
196
  throw new ElementError({
151
- componentName: 'Skip link',
197
+ component: SkipLink,
152
198
  element: $linkedElement,
153
199
  identifier: `Target content (\`id="${linkedElementId}"\`)`
154
200
  });
155
201
  }
156
- this.$module.addEventListener('click', () => setFocus($linkedElement, {
202
+ this.$root.addEventListener('click', () => setFocus($linkedElement, {
157
203
  onBeforeFocus() {
158
204
  $linkedElement.classList.add('govuk-skip-link-focused-element');
159
205
  },
@@ -163,6 +209,7 @@ class SkipLink extends GOVUKFrontendComponent {
163
209
  }));
164
210
  }
165
211
  }
212
+ SkipLink.elementType = HTMLAnchorElement;
166
213
  SkipLink.moduleName = 'govuk-skip-link';
167
214
 
168
215
  export { SkipLink };
@@ -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":["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,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,GAAA;EAKA,SAASD,MAAMA,GAAG;AAAA,IAAA,IAAAE,eAAA,CAAA;IAChB,CAAAA,eAAA,GAAAT,OAAO,CAACO,MAAM,KAAdE,IAAAA,IAAAA,eAAA,CAAgBC,IAAI,CAACX,QAAQ,CAAC,CAAA;IAE9B,IAAI,CAACG,WAAW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,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/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 * 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 component is already initialised\n *\n * @internal\n * @param {Element} $root - HTML element to be checked\n * @param {string} moduleName - name of component module\n * @returns {boolean} Whether component is already initialised\n */\nexport function isInitialised($root, moduleName) {\n return (\n $root instanceof HTMLElement &&\n $root.hasAttribute(`data-${moduleName}-init`)\n )\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 * @param {HTMLElement | null} [$scope] - (internal) `<body>` HTML element 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 * 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 * @template {Partial<Record<keyof ObjectType, unknown>>} [ObjectType=ObjectNested]\n * @param {unknown | ObjectType} option - Option to check\n * @returns {option is ObjectType} Whether the option is an object\n */\nexport function isObject(option) {\n return !!option && typeof option === 'object' && !isArray(option)\n}\n\n/**\n * Format error message\n *\n * @internal\n * @param {ComponentWithModuleName} Component - Component that threw the error\n * @param {string} message - Error message\n * @returns {string} - Formatted error message\n */\nexport function formatErrorMessage(Component, message) {\n return `${Component.moduleName}: ${message}`\n}\n\n/* eslint-disable jsdoc/valid-types --\n * `{new(...args: any[] ): object}` is not recognised as valid\n * https://github.com/gajus/eslint-plugin-jsdoc/issues/145#issuecomment-1308722878\n * https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/131\n **/\n\n/**\n * @typedef ComponentWithModuleName\n * @property {string} moduleName - Name of the component\n */\n\n/* eslint-enable jsdoc/valid-types */\n\n/**\n * @import { ObjectNested } from './configuration.mjs'\n */\n","import { formatErrorMessage } from '../common/index.mjs'\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 * @virtual\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 { component, identifier, element, expectedType } = messageOrOptions\n\n message = identifier\n\n // Append reason\n message += element\n ? ` is not of type ${expectedType ?? 'HTMLElement'}`\n : ' not found'\n\n message = formatErrorMessage(component, message)\n }\n\n super(message)\n }\n}\n\n/**\n * Indicates that a component is already initialised\n */\nexport class InitError extends GOVUKFrontendError {\n name = 'InitError'\n\n /**\n * @internal\n * @param {ComponentWithModuleName | string} componentOrMessage - name of the component module\n */\n constructor(componentOrMessage) {\n const message =\n typeof componentOrMessage === 'string'\n ? componentOrMessage\n : formatErrorMessage(\n componentOrMessage,\n `Root element (\\`$root\\`) already initialised`\n )\n\n super(message)\n }\n}\n\n/**\n * Element error options\n *\n * @internal\n * @typedef {object} ElementErrorOptions\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 * @property {ComponentWithModuleName} component - Component throwing the error\n */\n\n/**\n * @import { ComponentWithModuleName } from '../common/index.mjs'\n */\n","import { isInitialised, isSupported } from './common/index.mjs'\nimport { ElementError, InitError, SupportError } from './errors/index.mjs'\n\n/**\n * Base Component class\n *\n * Centralises the behaviours shared by our components\n *\n * @virtual\n * @template {Element} [RootElementType=HTMLElement]\n */\nexport class Component {\n /**\n * @type {typeof Element}\n */\n static elementType = HTMLElement\n\n // allows Typescript user to work around the lack of types\n // in GOVUKFrontend package, Typescript is not aware of $root\n // in components that extend GOVUKFrontendComponent\n /**\n * Returns the root element of the component\n *\n * @protected\n * @returns {RootElementType} - the root element of component\n */\n get $root() {\n return this._$root\n }\n\n /**\n * @protected\n * @type {RootElementType}\n */\n _$root\n\n /**\n * Constructs a new component, validating that GOV.UK Frontend is supported\n *\n * @internal\n * @param {Element | null} [$root] - HTML element to use for component\n */\n constructor($root) {\n const childConstructor = /** @type {ChildClassConstructor} */ (\n this.constructor\n )\n\n // TypeScript does not enforce that inheriting classes will define a `moduleName`\n // (even if we add a `@virtual` `static moduleName` property to this class).\n // While we trust users to do this correctly, we do a little check to provide them\n // a helpful error message.\n //\n // After this, we'll be sure that `childConstructor` has a `moduleName`\n // as expected of the `ChildClassConstructor` we've cast `this.constructor` to.\n if (typeof childConstructor.moduleName !== 'string') {\n throw new InitError(`\\`moduleName\\` not defined in component`)\n }\n\n if (!($root instanceof childConstructor.elementType)) {\n throw new ElementError({\n element: $root,\n component: childConstructor,\n identifier: 'Root element (`$root`)',\n expectedType: childConstructor.elementType.name\n })\n } else {\n this._$root = /** @type {RootElementType} */ ($root)\n }\n\n childConstructor.checkSupport()\n\n this.checkInitialised()\n\n const moduleName = childConstructor.moduleName\n\n this.$root.setAttribute(`data-${moduleName}-init`, '')\n }\n\n /**\n * Validates whether component is already initialised\n *\n * @private\n * @throws {InitError} when component is already initialised\n */\n checkInitialised() {\n const constructor = /** @type {ChildClassConstructor} */ (this.constructor)\n const moduleName = constructor.moduleName\n\n if (moduleName && isInitialised(this.$root, moduleName)) {\n throw new InitError(constructor)\n }\n }\n\n /**\n * Validates whether components are supported\n *\n * @throws {SupportError} when the components are not supported\n */\n static checkSupport() {\n if (!isSupported()) {\n throw new SupportError()\n }\n }\n}\n\n/**\n * @typedef ChildClass\n * @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component\n */\n\n/**\n * @typedef {typeof Component & ChildClass} ChildClassConstructor\n */\n","import { getFragmentFromUrl, setFocus } from '../../common/index.mjs'\nimport { Component } from '../../component.mjs'\nimport { ElementError } from '../../errors/index.mjs'\n\n/**\n * Skip link component\n *\n * @preserve\n * @augments Component<HTMLAnchorElement>\n */\nexport class SkipLink extends Component {\n static elementType = HTMLAnchorElement\n\n /**\n * @param {Element | null} $root - HTML element to use for skip link\n * @throws {ElementError} when $root is not set or the wrong type\n * @throws {ElementError} when $root.hash does not contain a hash\n * @throws {ElementError} when the linked element is missing or the wrong type\n */\n constructor($root) {\n super($root)\n\n const hash = this.$root.hash\n const href = this.$root.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.$root.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 component: SkipLink,\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.$root.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","isInitialised","$root","moduleName","HTMLElement","hasAttribute","isSupported","$scope","document","body","classList","contains","formatErrorMessage","Component","message","GOVUKFrontendError","Error","constructor","args","name","SupportError","supportMessage","HTMLScriptElement","prototype","ElementError","messageOrOptions","component","identifier","element","expectedType","InitError","componentOrMessage","_$root","childConstructor","elementType","checkSupport","checkInitialised","SkipLink","_this$$root$getAttrib","hash","href","window","URL","error","origin","location","pathname","linkedElementId","$linkedElement","getElementById","add","remove","HTMLAnchorElement"],"mappings":"AAkBO,SAASA,kBAAkBA,CAACC,GAAG,EAAE;AACtC,EAAA,IAAI,CAACA,GAAG,CAACC,QAAQ,CAAC,GAAG,CAAC,EAAE;AACtB,IAAA,OAAOC,SAAS;AAClB;EAEA,OAAOF,GAAG,CAACG,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,EAAE;AAC7B;AAoCO,SAASC,QAAQA,CAACC,QAAQ,EAAEC,OAAO,GAAG,EAAE,EAAE;AAAA,EAAA,IAAAC,qBAAA;AAC/C,EAAA,MAAMC,WAAW,GAAGH,QAAQ,CAACI,YAAY,CAAC,UAAU,CAAC;EAErD,IAAI,CAACD,WAAW,EAAE;AAChBH,IAAAA,QAAQ,CAACK,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC;AACzC;EAKA,SAASC,OAAOA,GAAG;AACjBN,IAAAA,QAAQ,CAACO,gBAAgB,CAAC,MAAM,EAAEC,MAAM,EAAE;AAAEC,MAAAA,IAAI,EAAE;AAAK,KAAC,CAAC;AAC3D;EAKA,SAASD,MAAMA,GAAG;AAAA,IAAA,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A,EAAAA,IAAI,2BACzC,CAAC;AACH;AAEA,IAAA,MAAMQ,cAAc,GAAGxC,QAAQ,CAACyC,cAAc,CAACF,eAAe,CAAC;IAG/D,IAAI,CAACC,cAAc,EAAE;MACnB,MAAM,IAAIxB,YAAY,CAAC;AACrBE,QAAAA,SAAS,EAAEW,QAAQ;AACnBT,QAAAA,OAAO,EAAEoB,cAAc;QACvBrB,UAAU,EAAE,yBAAyBoB,eAAe,CAAA,IAAA;AACtD,OAAC,CAAC;AACJ;IAQA,IAAI,CAAC7C,KAAK,CAACT,gBAAgB,CAAC,OAAO,EAAE,MACnCR,QAAQ,CAAC+D,cAAc,EAAE;AACvBjD,MAAAA,aAAaA,GAAG;AACdiD,QAAAA,cAAc,CAACtC,SAAS,CAACwC,GAAG,CAAC,iCAAiC,CAAC;OAChE;AACDxD,MAAAA,MAAMA,GAAG;AACPsD,QAAAA,cAAc,CAACtC,SAAS,CAACyC,MAAM,CAAC,iCAAiC,CAAC;AACpE;AACF,KAAC,CACH,CAAC;AACH;AAMF;AAnFad,QAAQ,CACZH,WAAW,GAAGkB,iBAAiB;AAD3Bf,QAAQ,CAkFZlC,UAAU,GAAG,iBAAiB;;;;"}
@@ -1,37 +1,28 @@
1
1
  import { getFragmentFromUrl, setFocus } from '../../common/index.mjs';
2
+ import { Component } from '../../component.mjs';
2
3
  import { ElementError } from '../../errors/index.mjs';
3
- import { GOVUKFrontendComponent } from '../../govuk-frontend-component.mjs';
4
4
 
5
5
  /**
6
6
  * Skip link component
7
7
  *
8
8
  * @preserve
9
+ * @augments Component<HTMLAnchorElement>
9
10
  */
10
- class SkipLink extends GOVUKFrontendComponent {
11
+ class SkipLink extends Component {
11
12
  /**
12
- * @param {Element | null} $module - HTML element to use for skip link
13
- * @throws {ElementError} when $module is not set or the wrong type
14
- * @throws {ElementError} when $module.hash does not contain a hash
13
+ * @param {Element | null} $root - HTML element to use for skip link
14
+ * @throws {ElementError} when $root is not set or the wrong type
15
+ * @throws {ElementError} when $root.hash does not contain a hash
15
16
  * @throws {ElementError} when the linked element is missing or the wrong type
16
17
  */
17
- constructor($module) {
18
- var _this$$module$getAttr;
19
- super();
20
- this.$module = void 0;
21
- if (!($module instanceof HTMLAnchorElement)) {
22
- throw new ElementError({
23
- componentName: 'Skip link',
24
- element: $module,
25
- expectedType: 'HTMLAnchorElement',
26
- identifier: 'Root element (`$module`)'
27
- });
28
- }
29
- this.$module = $module;
30
- const hash = this.$module.hash;
31
- const href = (_this$$module$getAttr = this.$module.getAttribute('href')) != null ? _this$$module$getAttr : '';
18
+ constructor($root) {
19
+ var _this$$root$getAttrib;
20
+ super($root);
21
+ const hash = this.$root.hash;
22
+ const href = (_this$$root$getAttrib = this.$root.getAttribute('href')) != null ? _this$$root$getAttrib : '';
32
23
  let url;
33
24
  try {
34
- url = new window.URL(this.$module.href);
25
+ url = new window.URL(this.$root.href);
35
26
  } catch (error) {
36
27
  throw new ElementError(`Skip link: Target link (\`href="${href}"\`) is invalid`);
37
28
  }
@@ -45,12 +36,12 @@ class SkipLink extends GOVUKFrontendComponent {
45
36
  const $linkedElement = document.getElementById(linkedElementId);
46
37
  if (!$linkedElement) {
47
38
  throw new ElementError({
48
- componentName: 'Skip link',
39
+ component: SkipLink,
49
40
  element: $linkedElement,
50
41
  identifier: `Target content (\`id="${linkedElementId}"\`)`
51
42
  });
52
43
  }
53
- this.$module.addEventListener('click', () => setFocus($linkedElement, {
44
+ this.$root.addEventListener('click', () => setFocus($linkedElement, {
54
45
  onBeforeFocus() {
55
46
  $linkedElement.classList.add('govuk-skip-link-focused-element');
56
47
  },
@@ -60,6 +51,7 @@ class SkipLink extends GOVUKFrontendComponent {
60
51
  }));
61
52
  }
62
53
  }
54
+ SkipLink.elementType = HTMLAnchorElement;
63
55
  SkipLink.moduleName = 'govuk-skip-link';
64
56
 
65
57
  export { SkipLink };
@@ -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,IAAAA,GAAAA,qBAAA,GAAI,EAAE,CAAA;AAGpD,IAAA,IAAIU,GAAG,CAAA;IASP,IAAI;MACFA,GAAG,GAAG,IAAIC,MAAM,CAACC,GAAG,CAAC,IAAI,CAACb,OAAO,CAACS,IAAI,CAAC,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link.mjs","sources":["../../../../src/govuk/components/skip-link/skip-link.mjs"],"sourcesContent":["import { getFragmentFromUrl, setFocus } from '../../common/index.mjs'\nimport { Component } from '../../component.mjs'\nimport { ElementError } from '../../errors/index.mjs'\n\n/**\n * Skip link component\n *\n * @preserve\n * @augments Component<HTMLAnchorElement>\n */\nexport class SkipLink extends Component {\n static elementType = HTMLAnchorElement\n\n /**\n * @param {Element | null} $root - HTML element to use for skip link\n * @throws {ElementError} when $root is not set or the wrong type\n * @throws {ElementError} when $root.hash does not contain a hash\n * @throws {ElementError} when the linked element is missing or the wrong type\n */\n constructor($root) {\n super($root)\n\n const hash = this.$root.hash\n const href = this.$root.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.$root.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 component: SkipLink,\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.$root.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","Component","constructor","$root","_this$$root$getAttrib","hash","href","getAttribute","url","window","URL","error","ElementError","origin","location","pathname","linkedElementId","getFragmentFromUrl","$linkedElement","document","getElementById","component","element","identifier","addEventListener","setFocus","onBeforeFocus","classList","add","onBlur","remove","elementType","HTMLAnchorElement","moduleName"],"mappings":";;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,QAAQ,SAASC,SAAS,CAAC;AAGtC;AACF;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,KAAK,EAAE;AAAA,IAAA,IAAAC,qBAAA;IACjB,KAAK,CAACD,KAAK,CAAC;AAEZ,IAAA,MAAME,IAAI,GAAG,IAAI,CAACF,KAAK,CAACE,IAAI;AAC5B,IAAA,MAAMC,IAAI,GAAA,CAAAF,qBAAA,GAAG,IAAI,CAACD,KAAK,CAACI,YAAY,CAAC,MAAM,CAAC,KAAAH,IAAAA,GAAAA,qBAAA,GAAI,EAAE;AAGlD,IAAA,IAAII,GAAG;IASP,IAAI;MACFA,GAAG,GAAG,IAAIC,MAAM,CAACC,GAAG,CAAC,IAAI,CAACP,KAAK,CAACG,IAAI,CAAC;KACtC,CAAC,OAAOK,KAAK,EAAE;AACd,MAAA,MAAM,IAAIC,YAAY,CACpB,CAAmCN,gCAAAA,EAAAA,IAAI,iBACzC,CAAC;AACH;AAGA,IAAA,IACEE,GAAG,CAACK,MAAM,KAAKJ,MAAM,CAACK,QAAQ,CAACD,MAAM,IACrCL,GAAG,CAACO,QAAQ,KAAKN,MAAM,CAACK,QAAQ,CAACC,QAAQ,EACzC;AACA,MAAA;AACF;AAEA,IAAA,MAAMC,eAAe,GAAGC,kBAAkB,CAACZ,IAAI,CAAC;IAGhD,IAAI,CAACW,eAAe,EAAE;AACpB,MAAA,MAAM,IAAIJ,YAAY,CACpB,CAAmCN,gCAAAA,EAAAA,IAAI,2BACzC,CAAC;AACH;AAEA,IAAA,MAAMY,cAAc,GAAGC,QAAQ,CAACC,cAAc,CAACJ,eAAe,CAAC;IAG/D,IAAI,CAACE,cAAc,EAAE;MACnB,MAAM,IAAIN,YAAY,CAAC;AACrBS,QAAAA,SAAS,EAAErB,QAAQ;AACnBsB,QAAAA,OAAO,EAAEJ,cAAc;QACvBK,UAAU,EAAE,yBAAyBP,eAAe,CAAA,IAAA;AACtD,OAAC,CAAC;AACJ;IAQA,IAAI,CAACb,KAAK,CAACqB,gBAAgB,CAAC,OAAO,EAAE,MACnCC,QAAQ,CAACP,cAAc,EAAE;AACvBQ,MAAAA,aAAaA,GAAG;AACdR,QAAAA,cAAc,CAACS,SAAS,CAACC,GAAG,CAAC,iCAAiC,CAAC;OAChE;AACDC,MAAAA,MAAMA,GAAG;AACPX,QAAAA,cAAc,CAACS,SAAS,CAACG,MAAM,CAAC,iCAAiC,CAAC;AACpE;AACF,KAAC,CACH,CAAC;AACH;AAMF;AAnFa9B,QAAQ,CACZ+B,WAAW,GAAGC,iBAAiB;AAD3BhC,QAAQ,CAkFZiC,UAAU,GAAG,iBAAiB;;;;"}
@@ -96,18 +96,21 @@
96
96
  padding: 0; // Reset default user agent styles
97
97
  }
98
98
 
99
- .govuk-summary-list__actions-list-item {
99
+ .govuk-summary-list__actions-list-item,
100
+ .govuk-summary-card__action {
100
101
  display: inline-block;
101
102
  }
102
103
 
103
104
  @include govuk-media-query($until: tablet) {
104
- .govuk-summary-list__actions-list-item {
105
+ .govuk-summary-list__actions-list-item,
106
+ .govuk-summary-card__action {
105
107
  margin-right: govuk-spacing(2);
106
108
  padding-right: govuk-spacing(2);
107
109
  border-right: 1px solid $govuk-border-colour;
108
110
  }
109
111
 
110
- .govuk-summary-list__actions-list-item:last-child {
112
+ .govuk-summary-list__actions-list-item:last-child,
113
+ .govuk-summary-card__action:last-child {
111
114
  margin-right: 0;
112
115
  padding-right: 0;
113
116
  border: 0;
@@ -115,16 +118,19 @@
115
118
  }
116
119
 
117
120
  @include govuk-media-query($from: tablet) {
118
- .govuk-summary-list__actions-list-item {
121
+ .govuk-summary-list__actions-list-item,
122
+ .govuk-summary-card__action {
119
123
  margin-left: govuk-spacing(2);
120
124
  padding-left: govuk-spacing(2);
121
125
  }
122
126
 
123
- .govuk-summary-list__actions-list-item:not(:first-child) {
127
+ .govuk-summary-list__actions-list-item:not(:first-child),
128
+ .govuk-summary-card__action:not(:first-child) {
124
129
  border-left: 1px solid $govuk-border-colour;
125
130
  }
126
131
 
127
- .govuk-summary-list__actions-list-item:first-child {
132
+ .govuk-summary-list__actions-list-item:first-child,
133
+ .govuk-summary-card__action:first-child {
128
134
  margin-left: 0;
129
135
  padding-left: 0;
130
136
  border: 0;
@@ -179,7 +185,8 @@
179
185
  .govuk-summary-card__title-wrapper {
180
186
  padding: govuk-spacing(3);
181
187
 
182
- // Ensures the card header appears separate to the summary list in forced colours mode
188
+ // Ensures the card header appears separate to the summary list in forced
189
+ // colours mode
183
190
  border-bottom: 1px solid transparent;
184
191
  background-color: govuk-colour("light-grey");
185
192
 
@@ -219,13 +226,6 @@
219
226
 
220
227
  .govuk-summary-card__action {
221
228
  display: inline;
222
- margin: 0 govuk-spacing(2) 0 0;
223
- padding-right: govuk-spacing(2);
224
- border-right: 1px solid $govuk-border-colour;
225
-
226
- @include govuk-media-query($from: "tablet") {
227
- margin-right: 0;
228
- }
229
229
 
230
230
  // We use the following media query to target IE11 and 10 only to add margin
231
231
  // between actions.
@@ -242,14 +242,6 @@
242
242
  }
243
243
 
244
244
  .govuk-summary-card__action:last-child {
245
- margin: 0;
246
- padding-right: 0;
247
- border-right: none;
248
-
249
- @include govuk-media-query($from: "tablet") {
250
- padding-left: govuk-spacing(2);
251
- }
252
-
253
245
  // See above comment for why this is here
254
246
  @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
255
247
  margin-bottom: 0;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/govuk/components/summary-list/_index.scss"],"names":[],"mappings":"AAAA;EACE;IACE,8BAA8B;IAC9B,0BAA0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S;IACX;;IAEA,4DAA4D;IAC5D;MACE;;;QAGE,sCAAsC;MACxC;IACF;EACF;;EAEA,4BAA4B;EAC5B;IACE,SAAS;;IAET,4DAA4D;IAC5D;MACE;;;QAGE,sCAAsC;MACxC;IACF;EACF;;EAEA,uCAAuC;EACvC;IACE,6CAA6C;IAC7C,sCAAsC;EACxC;;EAEA;IACE,yBAAyB;;IAEzB,qFAAqF;IACrF,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 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;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;;;IAGE,SAAS,EAAE,iCAAiC;;IAE5C;MACE,mBAAmB;MACnB,6BAA6B;MAC7B,+BAA+B;MAC/B,gCAAgC;IAClC;EACF;;EAEA;IACE,+BAA+B;IAC/B;MACE,UAAU;MACV,iBAAiB;IACnB;EACF;;EAEA;;IAEE,qDAAqD;IACrD,qBAAqB,EAAE,kCAAkC;IACzD,yBAAyB;EAC3B;;EAEA;IACE,+BAA+B;IAC/B,qCAAqC;IACrC;MACE,UAAU;IACZ;EACF;;EAEA;IACE;MACE,+BAA+B;IACjC;EACF;;EAEA;IACE,+BAA+B;EACjC;;EAEA;IACE,gBAAgB;EAClB;;EAEA;IACE,WAAW;IACX,SAAS,EAAE,iCAAiC;IAC5C,UAAU,EAAE,iCAAiC;EAC/C;;EAEA;;IAEE,qBAAqB;EACvB;;EAEA;IACE;;MAEE,8BAA8B;MAC9B,+BAA+B;MAC/B,4CAA4C;IAC9C;;IAEA;;MAEE,eAAe;MACf,gBAAgB;MAChB,SAAS;IACX;EACF;;EAEA;IACE;;MAEE,6BAA6B;MAC7B,8BAA8B;IAChC;;IAEA;;MAEE,2CAA2C;IAC7C;;IAEA;;MAEE,cAAc;MACd,eAAe;MACf,SAAS;IACX;EACF;;EAEA,6EAA6E;EAC7E,wEAAwE;EACxE,4EAA4E;EAC5E,4EAA4E;EAC5E,4CAA4C;EAC5C;IACE,kBAAkB;EACpB;;EAEA,kCAAkC;EAClC;IACE;MACE,SAAS;IACX;;IAEA,4DAA4D;IAC5D;MACE;;;QAGE,sCAAsC;MACxC;IACF;EACF;;EAEA,4BAA4B;EAC5B;IACE,SAAS;;IAET,4DAA4D;IAC5D;MACE;;;QAGE,sCAAsC;MACxC;IACF;EACF;;EAEA,uCAAuC;EACvC;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;;IAEf,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,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 .govuk-summary-card__action {\n display: inline-block;\n }\n\n @include govuk-media-query($until: tablet) {\n .govuk-summary-list__actions-list-item,\n .govuk-summary-card__action {\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 .govuk-summary-card__action: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 .govuk-summary-card__action {\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 .govuk-summary-card__action:not(:first-child) {\n border-left: 1px solid $govuk-border-colour;\n }\n\n .govuk-summary-list__actions-list-item:first-child,\n .govuk-summary-card__action: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\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 // 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"]}