govuk_publishing_components 35.3.3 → 35.3.4

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 (266) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/component_guide/application.scss +37 -1
  3. data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +10 -6
  4. data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +2 -2
  5. data/app/views/govuk_publishing_components/component_guide/example.html.erb +1 -1
  6. data/app/views/govuk_publishing_components/component_guide/preview.html.erb +1 -1
  7. data/app/views/govuk_publishing_components/component_guide/show.html.erb +1 -1
  8. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +2 -2
  9. data/app/views/govuk_publishing_components/components/_metadata.html.erb +1 -1
  10. data/app/views/govuk_publishing_components/components/_share_links.html.erb +6 -2
  11. data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +1 -1
  12. data/app/views/govuk_publishing_components/components/docs/metadata.yml +1 -3
  13. data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +5 -5
  14. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_related.yml +1 -0
  15. data/app/views/layouts/govuk_publishing_components/application.html.erb +1 -0
  16. data/lib/govuk_publishing_components/app_helpers/asset_helper.rb +4 -0
  17. data/lib/govuk_publishing_components/presenters/breadcrumbs_helper.rb +1 -1
  18. data/lib/govuk_publishing_components/version.rb +1 -1
  19. data/node_modules/axe-core/axe.d.ts +77 -6
  20. data/node_modules/axe-core/axe.js +955 -600
  21. data/node_modules/axe-core/axe.min.js +2 -2
  22. data/node_modules/axe-core/locales/_template.json +6 -6
  23. data/node_modules/axe-core/locales/ja.json +91 -11
  24. data/node_modules/axe-core/package.json +5 -5
  25. data/node_modules/axe-core/sri-history.json +4 -0
  26. data/node_modules/govuk-frontend/README.md +4 -5
  27. data/node_modules/govuk-frontend/govuk/all-ie8.scss +8 -0
  28. data/node_modules/govuk-frontend/govuk/all.js +738 -258
  29. data/node_modules/govuk-frontend/govuk/all.js.map +1 -1
  30. data/node_modules/govuk-frontend/govuk/common/closest-attribute-value.js +11 -7
  31. data/node_modules/govuk-frontend/govuk/common/closest-attribute-value.js.map +1 -1
  32. data/node_modules/govuk-frontend/govuk/common/govuk-frontend-version.js +17 -0
  33. data/node_modules/govuk-frontend/govuk/common/govuk-frontend-version.js.map +1 -0
  34. data/node_modules/govuk-frontend/govuk/common/index.js +16 -4
  35. data/node_modules/govuk-frontend/govuk/common/index.js.map +1 -1
  36. data/node_modules/govuk-frontend/govuk/common/normalise-dataset.js +20 -10
  37. data/node_modules/govuk-frontend/govuk/common/normalise-dataset.js.map +1 -1
  38. data/node_modules/govuk-frontend/govuk/common.js +16 -4
  39. data/node_modules/govuk-frontend/govuk/common.js.map +1 -1
  40. data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +3 -3
  41. data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +234 -86
  42. data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js.map +1 -1
  43. data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +32 -13
  44. data/node_modules/govuk-frontend/govuk/components/accordion/macro-options.json +8 -2
  45. data/node_modules/govuk-frontend/govuk/components/accordion/template.njk +1 -0
  46. data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +1 -1
  47. data/node_modules/govuk-frontend/govuk/components/back-link/fixtures.json +1 -1
  48. data/node_modules/govuk-frontend/govuk/components/back-link/macro-options.json +1 -1
  49. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +1 -1
  50. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +12 -12
  51. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/macro-options.json +1 -1
  52. data/node_modules/govuk-frontend/govuk/components/button/_index.scss +8 -6
  53. data/node_modules/govuk-frontend/govuk/components/button/button.js +54 -19
  54. data/node_modules/govuk-frontend/govuk/components/button/button.js.map +1 -1
  55. data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +11 -1
  56. data/node_modules/govuk-frontend/govuk/components/button/macro-options.json +7 -1
  57. data/node_modules/govuk-frontend/govuk/components/button/template.njk +1 -1
  58. data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +170 -76
  59. data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js.map +1 -1
  60. data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +24 -24
  61. data/node_modules/govuk-frontend/govuk/components/character-count/macro-options.json +3 -3
  62. data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +6 -6
  63. data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js +75 -24
  64. data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js.map +1 -1
  65. data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +47 -47
  66. data/node_modules/govuk-frontend/govuk/components/checkboxes/macro-options.json +1 -1
  67. data/node_modules/govuk-frontend/govuk/components/checkboxes/template.njk +3 -3
  68. data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +24 -24
  69. data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro-options.json +1 -1
  70. data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +26 -26
  71. data/node_modules/govuk-frontend/govuk/components/date-input/macro-options.json +1 -1
  72. data/node_modules/govuk-frontend/govuk/components/date-input/template.njk +1 -1
  73. data/node_modules/govuk-frontend/govuk/components/details/details.js +39 -13
  74. data/node_modules/govuk-frontend/govuk/components/details/details.js.map +1 -1
  75. data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +1 -1
  76. data/node_modules/govuk-frontend/govuk/components/details/macro-options.json +1 -1
  77. data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +10 -10
  78. data/node_modules/govuk-frontend/govuk/components/error-message/macro-options.json +1 -1
  79. data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js +67 -27
  80. data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js.map +1 -1
  81. data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +19 -19
  82. data/node_modules/govuk-frontend/govuk/components/error-summary/macro-options.json +1 -1
  83. data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +19 -19
  84. data/node_modules/govuk-frontend/govuk/components/fieldset/macro-options.json +1 -1
  85. data/node_modules/govuk-frontend/govuk/components/file-upload/_index.scss +6 -1
  86. data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +14 -14
  87. data/node_modules/govuk-frontend/govuk/components/file-upload/macro-options.json +7 -1
  88. data/node_modules/govuk-frontend/govuk/components/file-upload/template.njk +2 -1
  89. data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +0 -7
  90. data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +24 -24
  91. data/node_modules/govuk-frontend/govuk/components/footer/macro-options.json +1 -1
  92. data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +22 -22
  93. data/node_modules/govuk-frontend/govuk/components/header/header.js +46 -14
  94. data/node_modules/govuk-frontend/govuk/components/header/header.js.map +1 -1
  95. data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +1 -1
  96. data/node_modules/govuk-frontend/govuk/components/header/template.njk +1 -1
  97. data/node_modules/govuk-frontend/govuk/components/hint/fixtures.json +1 -1
  98. data/node_modules/govuk-frontend/govuk/components/hint/macro-options.json +1 -1
  99. data/node_modules/govuk-frontend/govuk/components/input/_index.scss +15 -3
  100. data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +54 -41
  101. data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +7 -1
  102. data/node_modules/govuk-frontend/govuk/components/input/template.njk +2 -1
  103. data/node_modules/govuk-frontend/govuk/components/inset-text/fixtures.json +1 -1
  104. data/node_modules/govuk-frontend/govuk/components/inset-text/macro-options.json +1 -1
  105. data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +6 -6
  106. data/node_modules/govuk-frontend/govuk/components/label/macro-options.json +1 -1
  107. data/node_modules/govuk-frontend/govuk/components/notification-banner/fixtures.json +1 -1
  108. data/node_modules/govuk-frontend/govuk/components/notification-banner/macro-options.json +1 -1
  109. data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +49 -22
  110. data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js.map +1 -1
  111. data/node_modules/govuk-frontend/govuk/components/pagination/fixtures.json +16 -16
  112. data/node_modules/govuk-frontend/govuk/components/pagination/macro-options.json +1 -1
  113. data/node_modules/govuk-frontend/govuk/components/panel/fixtures.json +10 -10
  114. data/node_modules/govuk-frontend/govuk/components/panel/macro-options.json +1 -1
  115. data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +1 -1
  116. data/node_modules/govuk-frontend/govuk/components/phase-banner/macro-options.json +1 -1
  117. data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +5 -5
  118. data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +46 -46
  119. data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +1 -1
  120. data/node_modules/govuk-frontend/govuk/components/radios/radios.js +65 -22
  121. data/node_modules/govuk-frontend/govuk/components/radios/radios.js.map +1 -1
  122. data/node_modules/govuk-frontend/govuk/components/radios/template.njk +2 -2
  123. data/node_modules/govuk-frontend/govuk/components/select/_index.scss +7 -1
  124. data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +19 -20
  125. data/node_modules/govuk-frontend/govuk/components/select/macro-options.json +7 -1
  126. data/node_modules/govuk-frontend/govuk/components/select/template.njk +5 -2
  127. data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +1 -1
  128. data/node_modules/govuk-frontend/govuk/components/skip-link/macro-options.json +1 -1
  129. data/node_modules/govuk-frontend/govuk/components/skip-link/skip-link.js +41 -13
  130. data/node_modules/govuk-frontend/govuk/components/skip-link/skip-link.js.map +1 -1
  131. data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +34 -34
  132. data/node_modules/govuk-frontend/govuk/components/summary-list/macro-options.json +1 -1
  133. data/node_modules/govuk-frontend/govuk/components/table/fixtures.json +21 -21
  134. data/node_modules/govuk-frontend/govuk/components/table/macro-options.json +1 -1
  135. data/node_modules/govuk-frontend/govuk/components/tabs/fixtures.json +15 -15
  136. data/node_modules/govuk-frontend/govuk/components/tabs/macro-options.json +1 -1
  137. data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js +178 -60
  138. data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js.map +1 -1
  139. data/node_modules/govuk-frontend/govuk/components/tabs/template.njk +1 -1
  140. data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +18 -18
  141. data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +1 -1
  142. data/node_modules/govuk-frontend/govuk/components/tag/macro-options.json +1 -1
  143. data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +8 -1
  144. data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +18 -18
  145. data/node_modules/govuk-frontend/govuk/components/textarea/macro-options.json +7 -1
  146. data/node_modules/govuk-frontend/govuk/components/textarea/template.njk +2 -1
  147. data/node_modules/govuk-frontend/govuk/components/warning-text/fixtures.json +9 -5
  148. data/node_modules/govuk-frontend/govuk/components/warning-text/macro-options.json +3 -3
  149. data/node_modules/govuk-frontend/govuk/components/warning-text/template.njk +1 -1
  150. data/node_modules/govuk-frontend/govuk/core/_all.scss +1 -0
  151. data/node_modules/govuk-frontend/govuk/core/_govuk-frontend-version.scss +5 -0
  152. data/node_modules/govuk-frontend/govuk/helpers/_colour.scss +5 -2
  153. data/node_modules/govuk-frontend/govuk/helpers/_focused.scss +1 -1
  154. data/node_modules/govuk-frontend/govuk/helpers/_font-faces.scss +1 -1
  155. data/node_modules/govuk-frontend/govuk/i18n.js +38 -30
  156. data/node_modules/govuk-frontend/govuk/i18n.js.map +1 -1
  157. data/node_modules/govuk-frontend/govuk/macros/i18n.njk +12 -11
  158. data/node_modules/govuk-frontend/govuk/objects/_width-container.scss +1 -1
  159. data/node_modules/govuk-frontend/govuk/settings/_colours-organisations.scss +4 -0
  160. data/node_modules/govuk-frontend/govuk/settings/_ie8.scss +16 -0
  161. data/node_modules/govuk-frontend/govuk/settings/_links.scss +5 -1
  162. data/node_modules/govuk-frontend/govuk/tools/_ie8.scss +38 -2
  163. data/node_modules/govuk-frontend/govuk/vendor/polyfills/DOMTokenList.js +2 -1
  164. data/node_modules/govuk-frontend/govuk/vendor/polyfills/DOMTokenList.js.map +1 -1
  165. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Date/now.js +2 -1
  166. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Date/now.js.map +1 -1
  167. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Document.js +2 -1
  168. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Document.js.map +1 -1
  169. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/classList.js +10 -3
  170. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/classList.js.map +1 -1
  171. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/closest.js +4 -1
  172. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/closest.js.map +1 -1
  173. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/dataset.js +13 -7
  174. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/dataset.js.map +1 -1
  175. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/matches.js +2 -1
  176. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/matches.js.map +1 -1
  177. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/nextElementSibling.js +8 -2
  178. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/nextElementSibling.js.map +1 -1
  179. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/previousElementSibling.js +8 -2
  180. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/previousElementSibling.js.map +1 -1
  181. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element.js +4 -1
  182. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element.js.map +1 -1
  183. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Event.js +10 -3
  184. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Event.js.map +1 -1
  185. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Function/prototype/bind.js +4 -1
  186. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Function/prototype/bind.js.map +1 -1
  187. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Object/defineProperty.js +2 -1
  188. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Object/defineProperty.js.map +1 -1
  189. data/node_modules/govuk-frontend/govuk/vendor/polyfills/String/prototype/trim.js +3 -2
  190. data/node_modules/govuk-frontend/govuk/vendor/polyfills/String/prototype/trim.js.map +1 -1
  191. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Window.js +2 -1
  192. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Window.js.map +1 -1
  193. data/node_modules/govuk-frontend/govuk-esm/all.mjs +81 -60
  194. data/node_modules/govuk-frontend/govuk-esm/all.mjs.map +1 -0
  195. data/node_modules/govuk-frontend/govuk-esm/common/closest-attribute-value.mjs +12 -8
  196. data/node_modules/govuk-frontend/govuk-esm/common/closest-attribute-value.mjs.map +1 -0
  197. data/node_modules/govuk-frontend/govuk-esm/common/govuk-frontend-version.mjs +9 -0
  198. data/node_modules/govuk-frontend/govuk-esm/common/govuk-frontend-version.mjs.map +1 -0
  199. data/node_modules/govuk-frontend/govuk-esm/common/index.mjs +44 -29
  200. data/node_modules/govuk-frontend/govuk-esm/common/index.mjs.map +1 -0
  201. data/node_modules/govuk-frontend/govuk-esm/common/normalise-dataset.mjs +15 -9
  202. data/node_modules/govuk-frontend/govuk-esm/common/normalise-dataset.mjs.map +1 -0
  203. data/node_modules/govuk-frontend/govuk-esm/common.mjs +3 -5
  204. data/node_modules/govuk-frontend/govuk-esm/common.mjs.map +1 -0
  205. data/node_modules/govuk-frontend/govuk-esm/components/accordion/accordion.mjs +319 -211
  206. data/node_modules/govuk-frontend/govuk-esm/components/accordion/accordion.mjs.map +1 -0
  207. data/node_modules/govuk-frontend/govuk-esm/components/button/button.mjs +47 -30
  208. data/node_modules/govuk-frontend/govuk-esm/components/button/button.mjs.map +1 -0
  209. data/node_modules/govuk-frontend/govuk-esm/components/character-count/character-count.mjs +169 -115
  210. data/node_modules/govuk-frontend/govuk-esm/components/character-count/character-count.mjs.map +1 -0
  211. data/node_modules/govuk-frontend/govuk-esm/components/checkboxes/checkboxes.mjs +88 -51
  212. data/node_modules/govuk-frontend/govuk-esm/components/checkboxes/checkboxes.mjs.map +1 -0
  213. data/node_modules/govuk-frontend/govuk-esm/components/details/details.mjs +64 -54
  214. data/node_modules/govuk-frontend/govuk-esm/components/details/details.mjs.map +1 -0
  215. data/node_modules/govuk-frontend/govuk-esm/components/error-summary/error-summary.mjs +69 -50
  216. data/node_modules/govuk-frontend/govuk-esm/components/error-summary/error-summary.mjs.map +1 -0
  217. data/node_modules/govuk-frontend/govuk-esm/components/header/header.mjs +59 -35
  218. data/node_modules/govuk-frontend/govuk-esm/components/header/header.mjs.map +1 -0
  219. data/node_modules/govuk-frontend/govuk-esm/components/notification-banner/notification-banner.mjs +36 -25
  220. data/node_modules/govuk-frontend/govuk-esm/components/notification-banner/notification-banner.mjs.map +1 -0
  221. data/node_modules/govuk-frontend/govuk-esm/components/radios/radios.mjs +67 -38
  222. data/node_modules/govuk-frontend/govuk-esm/components/radios/radios.mjs.map +1 -0
  223. data/node_modules/govuk-frontend/govuk-esm/components/skip-link/skip-link.mjs +49 -32
  224. data/node_modules/govuk-frontend/govuk-esm/components/skip-link/skip-link.mjs.map +1 -0
  225. data/node_modules/govuk-frontend/govuk-esm/components/tabs/tabs.mjs +263 -163
  226. data/node_modules/govuk-frontend/govuk-esm/components/tabs/tabs.mjs.map +1 -0
  227. data/node_modules/govuk-frontend/govuk-esm/i18n.mjs +68 -57
  228. data/node_modules/govuk-frontend/govuk-esm/i18n.mjs.map +1 -0
  229. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/DOMTokenList.mjs +5 -3
  230. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/DOMTokenList.mjs.map +1 -0
  231. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Date/now.mjs +4 -2
  232. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Date/now.mjs.map +1 -0
  233. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Document.mjs +4 -2
  234. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Document.mjs.map +1 -0
  235. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/classList.mjs +7 -4
  236. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/classList.mjs.map +1 -0
  237. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/closest.mjs +5 -2
  238. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/closest.mjs.map +1 -0
  239. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/dataset.mjs +13 -10
  240. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/dataset.mjs.map +1 -0
  241. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/matches.mjs +4 -2
  242. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/matches.mjs.map +1 -0
  243. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/nextElementSibling.mjs +6 -3
  244. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/nextElementSibling.mjs.map +1 -0
  245. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/previousElementSibling.mjs +6 -3
  246. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/previousElementSibling.mjs.map +1 -0
  247. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element.mjs +5 -2
  248. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element.mjs.map +1 -0
  249. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Event.mjs +7 -4
  250. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Event.mjs.map +1 -0
  251. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Function/prototype/bind.mjs +5 -2
  252. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Function/prototype/bind.mjs.map +1 -0
  253. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Object/defineProperty.mjs +4 -2
  254. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Object/defineProperty.mjs.map +1 -0
  255. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/String/prototype/trim.mjs +5 -3
  256. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/String/prototype/trim.mjs.map +1 -0
  257. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Window.mjs +4 -2
  258. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Window.mjs.map +1 -0
  259. data/node_modules/govuk-frontend/govuk-prototype-kit/init.js +1 -0
  260. data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +2 -1
  261. data/node_modules/govuk-frontend/package.json +3 -2
  262. metadata +43 -6
  263. /data/app/assets/images/govuk_publishing_components/crests/{dit_crest_13px.png → dbt_crest_13px.png} +0 -0
  264. /data/app/assets/images/govuk_publishing_components/crests/{dit_crest_13px_x2.png → dbt_crest_13px_x2.png} +0 -0
  265. /data/app/assets/images/govuk_publishing_components/crests/{dit_crest_18px.png → dbt_crest_18px.png} +0 -0
  266. /data/app/assets/images/govuk_publishing_components/crests/{dit_crest_18px_x2.png → dbt_crest_18px_x2.png} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accordion.mjs","sources":["../../../../src/govuk/components/accordion/accordion.mjs"],"sourcesContent":["/* eslint-disable es-x/no-function-prototype-bind -- Polyfill imported */\n/* eslint-disable es-x/no-string-prototype-trim -- Polyfill imported */\n\nimport { nodeListForEach, mergeConfigs, extractConfigByNamespace } from '../../common/index.mjs'\nimport { normaliseDataset } from '../../common/normalise-dataset.mjs'\nimport { I18n } from '../../i18n.mjs'\nimport '../../vendor/polyfills/Element/prototype/classList.mjs'\nimport '../../vendor/polyfills/Element/prototype/closest.mjs'\nimport '../../vendor/polyfills/Event.mjs' // addEventListener, event.target normalization and DOMContentLoaded\nimport '../../vendor/polyfills/Function/prototype/bind.mjs'\nimport '../../vendor/polyfills/String/prototype/trim.mjs'\n\n/**\n * @constant\n * @type {AccordionTranslations}\n * @see Default value for {@link AccordionConfig.i18n}\n * @default\n */\nvar ACCORDION_TRANSLATIONS = {\n hideAllSections: 'Hide all sections',\n hideSection: 'Hide',\n hideSectionAriaLabel: 'Hide this section',\n showAllSections: 'Show all sections',\n showSection: 'Show',\n showSectionAriaLabel: 'Show this section'\n}\n\n/**\n * Accordion component\n *\n * This allows a collection of sections to be collapsed by default, showing only\n * their headers. Sections can be expanded or collapsed individually by clicking\n * their headers. A \"Show all sections\" button is also added to the top of the\n * accordion, which switches to \"Hide all sections\" when all the sections are\n * expanded.\n *\n * The state of each section is saved to the DOM via the `aria-expanded`\n * attribute, which also provides accessibility.\n *\n * @class\n * @param {Element} $module - HTML element to use for accordion\n * @param {AccordionConfig} [config] - Accordion config\n */\nfunction Accordion ($module, config) {\n if (!($module instanceof HTMLElement)) {\n return this\n }\n\n /** @deprecated Will be made private in v5.0 */\n this.$module = $module\n\n var defaultConfig = {\n i18n: ACCORDION_TRANSLATIONS,\n rememberExpanded: true\n }\n\n /**\n * @deprecated Will be made private in v5.0\n * @type {AccordionConfig}\n */\n this.config = mergeConfigs(\n defaultConfig,\n config || {},\n normaliseDataset($module.dataset)\n )\n\n /** @deprecated Will be made private in v5.0 */\n this.i18n = new I18n(extractConfigByNamespace(this.config, 'i18n'))\n\n /** @deprecated Will be made private in v5.0 */\n this.controlsClass = 'govuk-accordion__controls'\n\n /** @deprecated Will be made private in v5.0 */\n this.showAllClass = 'govuk-accordion__show-all'\n\n /** @deprecated Will be made private in v5.0 */\n this.showAllTextClass = 'govuk-accordion__show-all-text'\n\n /** @deprecated Will be made private in v5.0 */\n this.sectionClass = 'govuk-accordion__section'\n\n /** @deprecated Will be made private in v5.0 */\n this.sectionExpandedClass = 'govuk-accordion__section--expanded'\n\n /** @deprecated Will be made private in v5.0 */\n this.sectionButtonClass = 'govuk-accordion__section-button'\n\n /** @deprecated Will be made private in v5.0 */\n this.sectionHeaderClass = 'govuk-accordion__section-header'\n\n /** @deprecated Will be made private in v5.0 */\n this.sectionHeadingClass = 'govuk-accordion__section-heading'\n\n /** @deprecated Will be made private in v5.0 */\n this.sectionHeadingDividerClass = 'govuk-accordion__section-heading-divider'\n\n /** @deprecated Will be made private in v5.0 */\n this.sectionHeadingTextClass = 'govuk-accordion__section-heading-text'\n\n /** @deprecated Will be made private in v5.0 */\n this.sectionHeadingTextFocusClass = 'govuk-accordion__section-heading-text-focus'\n\n /** @deprecated Will be made private in v5.0 */\n this.sectionShowHideToggleClass = 'govuk-accordion__section-toggle'\n\n /** @deprecated Will be made private in v5.0 */\n this.sectionShowHideToggleFocusClass = 'govuk-accordion__section-toggle-focus'\n\n /** @deprecated Will be made private in v5.0 */\n this.sectionShowHideTextClass = 'govuk-accordion__section-toggle-text'\n\n /** @deprecated Will be made private in v5.0 */\n this.upChevronIconClass = 'govuk-accordion-nav__chevron'\n\n /** @deprecated Will be made private in v5.0 */\n this.downChevronIconClass = 'govuk-accordion-nav__chevron--down'\n\n /** @deprecated Will be made private in v5.0 */\n this.sectionSummaryClass = 'govuk-accordion__section-summary'\n\n /** @deprecated Will be made private in v5.0 */\n this.sectionSummaryFocusClass = 'govuk-accordion__section-summary-focus'\n\n /** @deprecated Will be made private in v5.0 */\n this.sectionContentClass = 'govuk-accordion__section-content'\n\n var $sections = this.$module.querySelectorAll('.' + this.sectionClass)\n if (!$sections.length) {\n return this\n }\n\n /** @deprecated Will be made private in v5.0 */\n this.$sections = $sections\n\n /** @deprecated Will be made private in v5.0 */\n this.browserSupportsSessionStorage = helper.checkForSessionStorage()\n\n /** @deprecated Will be made private in v5.0 */\n this.$showAllButton = null\n\n /** @deprecated Will be made private in v5.0 */\n this.$showAllIcon = null\n\n /** @deprecated Will be made private in v5.0 */\n this.$showAllText = null\n}\n\n/**\n * Initialise component\n */\nAccordion.prototype.init = function () {\n // Check that required elements are present\n if (!this.$module || !this.$sections) {\n return\n }\n\n this.initControls()\n this.initSectionHeaders()\n\n // See if \"Show all sections\" button text should be updated\n var areAllSectionsOpen = this.checkIfAllSectionsOpen()\n this.updateShowAllButton(areAllSectionsOpen)\n}\n\n/**\n * Initialise controls and set attributes\n *\n * @deprecated Will be made private in v5.0\n */\nAccordion.prototype.initControls = function () {\n // Create \"Show all\" button and set attributes\n this.$showAllButton = document.createElement('button')\n this.$showAllButton.setAttribute('type', 'button')\n this.$showAllButton.setAttribute('class', this.showAllClass)\n this.$showAllButton.setAttribute('aria-expanded', 'false')\n\n // Create icon, add to element\n this.$showAllIcon = document.createElement('span')\n this.$showAllIcon.classList.add(this.upChevronIconClass)\n this.$showAllButton.appendChild(this.$showAllIcon)\n\n // Create control wrapper and add controls to it\n var $accordionControls = document.createElement('div')\n $accordionControls.setAttribute('class', this.controlsClass)\n $accordionControls.appendChild(this.$showAllButton)\n this.$module.insertBefore($accordionControls, this.$module.firstChild)\n\n // Build additional wrapper for Show all toggle text and place after icon\n this.$showAllText = document.createElement('span')\n this.$showAllText.classList.add(this.showAllTextClass)\n this.$showAllButton.appendChild(this.$showAllText)\n\n // Handle click events on the show/hide all button\n this.$showAllButton.addEventListener('click', this.onShowOrHideAllToggle.bind(this))\n\n // Handle 'beforematch' events, if the user agent supports them\n if ('onbeforematch' in document) {\n document.addEventListener('beforematch', this.onBeforeMatch.bind(this))\n }\n}\n\n/**\n * Initialise section headers\n *\n * @deprecated Will be made private in v5.0\n */\nAccordion.prototype.initSectionHeaders = function () {\n var $component = this\n var $sections = this.$sections\n\n // Loop through sections\n nodeListForEach($sections, function ($section, i) {\n var $header = $section.querySelector('.' + $component.sectionHeaderClass)\n if (!$header) {\n return\n }\n\n // Set header attributes\n $component.constructHeaderMarkup($header, i)\n $component.setExpanded($component.isExpanded($section), $section)\n\n // Handle events\n $header.addEventListener('click', $component.onSectionToggle.bind($component, $section))\n\n // See if there is any state stored in sessionStorage and set the sections to\n // open or closed.\n $component.setInitialState($section)\n })\n}\n\n/**\n * Construct section header\n *\n * @deprecated Will be made private in v5.0\n * @param {Element} $header - Section header\n * @param {number} index - Section index\n */\nAccordion.prototype.constructHeaderMarkup = function ($header, index) {\n var $span = $header.querySelector('.' + this.sectionButtonClass)\n var $heading = $header.querySelector('.' + this.sectionHeadingClass)\n var $summary = $header.querySelector('.' + this.sectionSummaryClass)\n\n if (!$span || !$heading) {\n return\n }\n\n // Create a button element that will replace the '.govuk-accordion__section-button' span\n var $button = document.createElement('button')\n $button.setAttribute('type', 'button')\n $button.setAttribute('aria-controls', this.$module.id + '-content-' + (index + 1).toString())\n\n // Copy all attributes (https://developer.mozilla.org/en-US/docs/Web/API/Element/attributes) from $span to $button\n for (var i = 0; i < $span.attributes.length; i++) {\n var attr = $span.attributes.item(i)\n // Add all attributes but not ID as this is being added to\n // the section heading ($headingText)\n if (attr.nodeName !== 'id') {\n $button.setAttribute(attr.nodeName, attr.nodeValue)\n }\n }\n\n // Create container for heading text so it can be styled\n var $headingText = document.createElement('span')\n $headingText.classList.add(this.sectionHeadingTextClass)\n // Copy the span ID to the heading text to allow it to be referenced by `aria-labelledby` on the\n // hidden content area without \"Show this section\"\n $headingText.id = $span.id\n\n // Create an inner heading text container to limit the width of the focus state\n var $headingTextFocus = document.createElement('span')\n $headingTextFocus.classList.add(this.sectionHeadingTextFocusClass)\n $headingText.appendChild($headingTextFocus)\n // span could contain HTML elements (see https://www.w3.org/TR/2011/WD-html5-20110525/content-models.html#phrasing-content)\n $headingTextFocus.innerHTML = $span.innerHTML\n\n // Create container for show / hide icons and text.\n var $showHideToggle = document.createElement('span')\n $showHideToggle.classList.add(this.sectionShowHideToggleClass)\n // Tell Google not to index the 'show' text as part of the heading\n // For the snippet to work with JavaScript, it must be added before adding the page element to the\n // page's DOM. See https://developers.google.com/search/docs/advanced/robots/robots_meta_tag#data-nosnippet-attr\n $showHideToggle.setAttribute('data-nosnippet', '')\n // Create an inner container to limit the width of the focus state\n var $showHideToggleFocus = document.createElement('span')\n $showHideToggleFocus.classList.add(this.sectionShowHideToggleFocusClass)\n $showHideToggle.appendChild($showHideToggleFocus)\n // Create wrapper for the show / hide text. Append text after the show/hide icon\n var $showHideText = document.createElement('span')\n var $showHideIcon = document.createElement('span')\n $showHideIcon.classList.add(this.upChevronIconClass)\n $showHideToggleFocus.appendChild($showHideIcon)\n $showHideText.classList.add(this.sectionShowHideTextClass)\n $showHideToggleFocus.appendChild($showHideText)\n\n // Append elements to the button:\n // 1. Heading text\n // 2. Punctuation\n // 3. (Optional: Summary line followed by punctuation)\n // 4. Show / hide toggle\n $button.appendChild($headingText)\n $button.appendChild(this.getButtonPunctuationEl())\n\n // If summary content exists add to DOM in correct order\n if ($summary) {\n // Create a new `span` element and copy the summary line content from the original `div` to the\n // new `span`\n // This is because the summary line text is now inside a button element, which can only contain\n // phrasing content\n var $summarySpan = document.createElement('span')\n // Create an inner summary container to limit the width of the summary focus state\n var $summarySpanFocus = document.createElement('span')\n $summarySpanFocus.classList.add(this.sectionSummaryFocusClass)\n $summarySpan.appendChild($summarySpanFocus)\n\n // Get original attributes, and pass them to the replacement\n for (var j = 0, l = $summary.attributes.length; j < l; ++j) {\n var nodeName = $summary.attributes.item(j).nodeName\n var nodeValue = $summary.attributes.item(j).nodeValue\n $summarySpan.setAttribute(nodeName, nodeValue)\n }\n\n // Copy original contents of summary to the new summary span\n $summarySpanFocus.innerHTML = $summary.innerHTML\n\n // Replace the original summary `div` with the new summary `span`\n $summary.parentNode.replaceChild($summarySpan, $summary)\n\n $button.appendChild($summarySpan)\n $button.appendChild(this.getButtonPunctuationEl())\n }\n\n $button.appendChild($showHideToggle)\n\n $heading.removeChild($span)\n $heading.appendChild($button)\n}\n\n/**\n * When a section is opened by the user agent via the 'beforematch' event\n *\n * @deprecated Will be made private in v5.0\n * @param {Event} event - Generic event\n */\nAccordion.prototype.onBeforeMatch = function (event) {\n var $fragment = event.target\n\n // Handle elements with `.closest()` support only\n if (!($fragment instanceof Element)) {\n return\n }\n\n // Handle when fragment is inside section\n var $section = $fragment.closest('.' + this.sectionClass)\n if ($section) {\n this.setExpanded(true, $section)\n }\n}\n\n/**\n * When section toggled, set and store state\n *\n * @deprecated Will be made private in v5.0\n * @param {Element} $section - Section element\n */\nAccordion.prototype.onSectionToggle = function ($section) {\n var expanded = this.isExpanded($section)\n this.setExpanded(!expanded, $section)\n\n // Store the state in sessionStorage when a change is triggered\n this.storeState($section)\n}\n\n/**\n * When Open/Close All toggled, set and store state\n *\n * @deprecated Will be made private in v5.0\n */\nAccordion.prototype.onShowOrHideAllToggle = function () {\n var $component = this\n var $sections = this.$sections\n\n var nowExpanded = !this.checkIfAllSectionsOpen()\n\n // Loop through sections\n nodeListForEach($sections, function ($section) {\n $component.setExpanded(nowExpanded, $section)\n // Store the state in sessionStorage when a change is triggered\n $component.storeState($section)\n })\n\n $component.updateShowAllButton(nowExpanded)\n}\n\n/**\n * Set section attributes when opened/closed\n *\n * @deprecated Will be made private in v5.0\n * @param {boolean} expanded - Section expanded\n * @param {Element} $section - Section element\n */\nAccordion.prototype.setExpanded = function (expanded, $section) {\n var $showHideIcon = $section.querySelector('.' + this.upChevronIconClass)\n var $showHideText = $section.querySelector('.' + this.sectionShowHideTextClass)\n var $button = $section.querySelector('.' + this.sectionButtonClass)\n var $content = $section.querySelector('.' + this.sectionContentClass)\n\n if (!$showHideIcon ||\n !($showHideText instanceof HTMLElement) ||\n !$button ||\n !$content) {\n return\n }\n\n var newButtonText = expanded\n ? this.i18n.t('hideSection')\n : this.i18n.t('showSection')\n\n $showHideText.innerText = newButtonText\n $button.setAttribute('aria-expanded', expanded.toString())\n\n // Update aria-label combining\n var ariaLabelParts = []\n\n var $headingText = $section.querySelector('.' + this.sectionHeadingTextClass)\n if ($headingText instanceof HTMLElement) {\n ariaLabelParts.push($headingText.innerText.trim())\n }\n\n var $summary = $section.querySelector('.' + this.sectionSummaryClass)\n if ($summary instanceof HTMLElement) {\n ariaLabelParts.push($summary.innerText.trim())\n }\n\n var ariaLabelMessage = expanded\n ? this.i18n.t('hideSectionAriaLabel')\n : this.i18n.t('showSectionAriaLabel')\n ariaLabelParts.push(ariaLabelMessage)\n\n /*\n * Join with a comma to add pause for assistive technology.\n * Example: [heading]Section A ,[pause] Show this section.\n * https://accessibility.blog.gov.uk/2017/12/18/what-working-on-gov-uk-navigation-taught-us-about-accessibility/\n */\n $button.setAttribute('aria-label', ariaLabelParts.join(' , '))\n\n // Swap icon, change class\n if (expanded) {\n $content.removeAttribute('hidden')\n $section.classList.add(this.sectionExpandedClass)\n $showHideIcon.classList.remove(this.downChevronIconClass)\n } else {\n $content.setAttribute('hidden', 'until-found')\n $section.classList.remove(this.sectionExpandedClass)\n $showHideIcon.classList.add(this.downChevronIconClass)\n }\n\n // See if \"Show all sections\" button text should be updated\n var areAllSectionsOpen = this.checkIfAllSectionsOpen()\n this.updateShowAllButton(areAllSectionsOpen)\n}\n\n/**\n * Get state of section\n *\n * @deprecated Will be made private in v5.0\n * @param {Element} $section - Section element\n * @returns {boolean} True if expanded\n */\nAccordion.prototype.isExpanded = function ($section) {\n return $section.classList.contains(this.sectionExpandedClass)\n}\n\n/**\n * Check if all sections are open\n *\n * @deprecated Will be made private in v5.0\n * @returns {boolean} True if all sections are open\n */\nAccordion.prototype.checkIfAllSectionsOpen = function () {\n // Get a count of all the Accordion sections\n var sectionsCount = this.$sections.length\n // Get a count of all Accordion sections that are expanded\n var expandedSectionCount = this.$module.querySelectorAll('.' + this.sectionExpandedClass).length\n var areAllSectionsOpen = sectionsCount === expandedSectionCount\n\n return areAllSectionsOpen\n}\n\n/**\n * Update \"Show all sections\" button\n *\n * @deprecated Will be made private in v5.0\n * @param {boolean} expanded - Section expanded\n */\nAccordion.prototype.updateShowAllButton = function (expanded) {\n var newButtonText = expanded\n ? this.i18n.t('hideAllSections')\n : this.i18n.t('showAllSections')\n\n this.$showAllButton.setAttribute('aria-expanded', expanded.toString())\n this.$showAllText.innerText = newButtonText\n\n // Swap icon, toggle class\n if (expanded) {\n this.$showAllIcon.classList.remove(this.downChevronIconClass)\n } else {\n this.$showAllIcon.classList.add(this.downChevronIconClass)\n }\n}\n\nvar helper = {\n /**\n * Check for `window.sessionStorage`, and that it actually works.\n *\n * @returns {boolean} True if session storage is available\n */\n checkForSessionStorage: function () {\n var testString = 'this is the test string'\n var result\n try {\n window.sessionStorage.setItem(testString, testString)\n result = window.sessionStorage.getItem(testString) === testString.toString()\n window.sessionStorage.removeItem(testString)\n return result\n } catch (exception) {\n return false\n }\n }\n}\n\n/**\n * Set the state of the accordions in sessionStorage\n *\n * @deprecated Will be made private in v5.0\n * @param {Element} $section - Section element\n */\nAccordion.prototype.storeState = function ($section) {\n if (this.browserSupportsSessionStorage && this.config.rememberExpanded) {\n // We need a unique way of identifying each content in the Accordion. Since\n // an `#id` should be unique and an `id` is required for `aria-` attributes\n // `id` can be safely used.\n var $button = $section.querySelector('.' + this.sectionButtonClass)\n\n if ($button) {\n var contentId = $button.getAttribute('aria-controls')\n var contentState = $button.getAttribute('aria-expanded')\n\n // Only set the state when both `contentId` and `contentState` are taken from the DOM.\n if (contentId && contentState) {\n window.sessionStorage.setItem(contentId, contentState)\n }\n }\n }\n}\n\n/**\n * Read the state of the accordions from sessionStorage\n *\n * @deprecated Will be made private in v5.0\n * @param {Element} $section - Section element\n */\nAccordion.prototype.setInitialState = function ($section) {\n if (this.browserSupportsSessionStorage && this.config.rememberExpanded) {\n var $button = $section.querySelector('.' + this.sectionButtonClass)\n\n if ($button) {\n var contentId = $button.getAttribute('aria-controls')\n var contentState = contentId ? window.sessionStorage.getItem(contentId) : null\n\n if (contentState !== null) {\n this.setExpanded(contentState === 'true', $section)\n }\n }\n }\n}\n\n/**\n * Create an element to improve semantics of the section button with punctuation\n *\n * Adding punctuation to the button can also improve its general semantics by dividing its contents\n * into thematic chunks.\n * See https://github.com/alphagov/govuk-frontend/issues/2327#issuecomment-922957442\n *\n * @deprecated Will be made private in v5.0\n * @returns {Element} DOM element\n */\nAccordion.prototype.getButtonPunctuationEl = function () {\n var $punctuationEl = document.createElement('span')\n $punctuationEl.classList.add('govuk-visually-hidden', this.sectionHeadingDividerClass)\n $punctuationEl.innerHTML = ', '\n return $punctuationEl\n}\n\nexport default Accordion\n\n/**\n * Accordion config\n *\n * @typedef {object} AccordionConfig\n * @property {AccordionTranslations} [i18n = ACCORDION_TRANSLATIONS] - See constant {@link ACCORDION_TRANSLATIONS}\n * @property {boolean} [rememberExpanded] - Whether the expanded and collapsed\n * state of each section is remembered and restored when navigating.\n */\n\n/**\n * Accordion translations\n *\n * @typedef {object} AccordionTranslations\n *\n * Messages used by the component for the labels of its buttons. This includes\n * the visible text shown on screen, and text to help assistive technology users\n * for the buttons toggling each section.\n * @property {string} [hideAllSections] - The text content for the 'Hide all\n * sections' button, used when at least one section is expanded.\n * @property {string} [hideSection] - The text content for the 'Hide'\n * button, used when a section is expanded.\n * @property {string} [hideSectionAriaLabel] - The text content appended to the\n * 'Hide' button's accessible name when a section is expanded.\n * @property {string} [showAllSections] - The text content for the 'Show all\n * sections' button, used when all sections are collapsed.\n * @property {string} [showSection] - The text content for the 'Show'\n * button, used when a section is collapsed.\n * @property {string} [showSectionAriaLabel] - The text content appended to the\n * 'Show' button's accessible name when a section is expanded.\n */\n"],"names":[],"mappings":";;;;;;;;;AAAA;AACA,AAUA;;;;;;;AAOA,IAAI,sBAAsB,GAAG;EAC3B,eAAe,EAAE,mBAAmB;EACpC,WAAW,E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Ae,EAAC;MACrD,IAAI,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,eAAe,EAAC;;;MAGxD,IAAI,SAAS,IAAI,YAAY,EAAE;QAC7B,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,SAAS,EAAE,YAAY,EAAC;OACvD;KACF;GACF;EACF;;;;;;;;AAQD,SAAS,CAAC,SAAS,CAAC,eAAe,GAAG,UAAU,QAAQ,EAAE;EACxD,IAAI,IAAI,CAAC,6BAA6B,IAAI,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE;IACtE,IAAI,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,GAAG,IAAI,CAAC,kBAAkB,EAAC;;IAEnE,IAAI,OAAO,EAAE;MACX,IAAI,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,eAAe,EAAC;MACrD,IAAI,YAAY,GAAG,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,KAAI;;MAE9E,IAAI,YAAY,KAAK,IAAI,EAAE;QACzB,IAAI,CAAC,WAAW,CAAC,YAAY,KAAK,MAAM,EAAE,QAAQ,EAAC;OACpD;KACF;GACF;EACF;;;;;;;;;;;;AAYD,SAAS,CAAC,SAAS,CAAC,sBAAsB,GAAG,YAAY;EACvD,IAAI,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,EAAC;EACnD,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,uBAAuB,EAAE,IAAI,CAAC,0BAA0B,EAAC;EACtF,cAAc,CAAC,SAAS,GAAG,KAAI;EAC/B,OAAO,cAAc;EACtB;AACD,AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;;;;"}
@@ -1,49 +1,58 @@
1
- /* eslint-disable es-x/no-function-prototype-bind -- Polyfill imported */
1
+ import { mergeConfigs } from '../../common/index.mjs';
2
+ import { normaliseDataset } from '../../common/normalise-dataset.mjs';
3
+ import '../../vendor/polyfills/Event.mjs';
4
+ import '../../vendor/polyfills/Function/prototype/bind.mjs';
2
5
 
3
- import { mergeConfigs } from '../../common/index.mjs'
4
- import { normaliseDataset } from '../../common/normalise-dataset.mjs'
5
- import '../../vendor/polyfills/Event.mjs' // addEventListener, event.target normalization and DOMContentLoaded
6
- import '../../vendor/polyfills/Function/prototype/bind.mjs'
6
+ /* eslint-disable es-x/no-function-prototype-bind -- Polyfill imported */
7
7
 
8
- var KEY_SPACE = 32
9
- var DEBOUNCE_TIMEOUT_IN_SECONDS = 1
8
+ var KEY_SPACE = 32;
9
+ var DEBOUNCE_TIMEOUT_IN_SECONDS = 1;
10
10
 
11
11
  /**
12
12
  * JavaScript enhancements for the Button component
13
13
  *
14
14
  * @class
15
- * @param {HTMLElement} $module - HTML element to use for button
15
+ * @param {Element} $module - HTML element to use for button
16
16
  * @param {ButtonConfig} [config] - Button config
17
17
  */
18
18
  function Button ($module, config) {
19
- if (!$module) {
19
+ if (!($module instanceof HTMLElement)) {
20
20
  return this
21
21
  }
22
22
 
23
- this.$module = $module
24
- this.debounceFormSubmitTimer = null
23
+ /** @deprecated Will be made private in v5.0 */
24
+ this.$module = $module;
25
+
26
+ /** @deprecated Will be made private in v5.0 */
27
+ this.debounceFormSubmitTimer = null;
25
28
 
26
29
  var defaultConfig = {
27
30
  preventDoubleClick: false
28
- }
31
+ };
32
+
33
+ /**
34
+ * @deprecated Will be made private in v5.0
35
+ * @type {ButtonConfig}
36
+ */
29
37
  this.config = mergeConfigs(
30
38
  defaultConfig,
31
39
  config || {},
32
40
  normaliseDataset($module.dataset)
33
- )
41
+ );
34
42
  }
35
43
 
36
44
  /**
37
45
  * Initialise component
38
46
  */
39
47
  Button.prototype.init = function () {
48
+ // Check that required elements are present
40
49
  if (!this.$module) {
41
50
  return
42
51
  }
43
52
 
44
- this.$module.addEventListener('keydown', this.handleKeyDown)
45
- this.$module.addEventListener('click', this.debounce.bind(this))
46
- }
53
+ this.$module.addEventListener('keydown', this.handleKeyDown);
54
+ this.$module.addEventListener('click', this.debounce.bind(this));
55
+ };
47
56
 
48
57
  /**
49
58
  * Trigger a click event when the space key is pressed
@@ -53,16 +62,23 @@ Button.prototype.init = function () {
53
62
  *
54
63
  * See https://github.com/alphagov/govuk_elements/pull/272#issuecomment-233028270
55
64
  *
65
+ * @deprecated Will be made private in v5.0
56
66
  * @param {KeyboardEvent} event - Keydown event
57
67
  */
58
68
  Button.prototype.handleKeyDown = function (event) {
59
- var $target = event.target
69
+ var $target = event.target;
60
70
 
61
- if ($target.getAttribute('role') === 'button' && event.keyCode === KEY_SPACE) {
62
- event.preventDefault() // prevent the page from scrolling
63
- $target.click()
71
+ // Handle space bar only
72
+ if (event.keyCode !== KEY_SPACE) {
73
+ return
64
74
  }
65
- }
75
+
76
+ // Handle elements with [role="button"] only
77
+ if ($target instanceof HTMLElement && $target.getAttribute('role') === 'button') {
78
+ event.preventDefault(); // prevent the page from scrolling
79
+ $target.click();
80
+ }
81
+ };
66
82
 
67
83
  /**
68
84
  * Debounce double-clicks
@@ -71,6 +87,7 @@ Button.prototype.handleKeyDown = function (event) {
71
87
  * stops people accidentally causing multiple form submissions by double
72
88
  * clicking buttons.
73
89
  *
90
+ * @deprecated Will be made private in v5.0
74
91
  * @param {MouseEvent} event - Mouse click event
75
92
  * @returns {undefined | false} Returns undefined, or false when debounced
76
93
  */
@@ -82,22 +99,22 @@ Button.prototype.debounce = function (event) {
82
99
 
83
100
  // If the timer is still running, prevent the click from submitting the form
84
101
  if (this.debounceFormSubmitTimer) {
85
- event.preventDefault()
102
+ event.preventDefault();
86
103
  return false
87
104
  }
88
105
 
89
106
  this.debounceFormSubmitTimer = setTimeout(function () {
90
- this.debounceFormSubmitTimer = null
91
- }.bind(this), DEBOUNCE_TIMEOUT_IN_SECONDS * 1000)
92
- }
93
-
94
- export default Button
107
+ this.debounceFormSubmitTimer = null;
108
+ }.bind(this), DEBOUNCE_TIMEOUT_IN_SECONDS * 1000);
109
+ };
95
110
 
96
111
  /**
97
112
  * Button config
98
113
  *
99
114
  * @typedef {object} ButtonConfig
100
- * @property {boolean} [preventDoubleClick = false] -
101
- * Prevent accidental double clicks on submit buttons from submitting forms
102
- * multiple times.
115
+ * @property {boolean} [preventDoubleClick = false] - Prevent accidental double
116
+ * clicks on submit buttons from submitting forms multiple times.
103
117
  */
118
+
119
+ export default Button;
120
+ //# sourceMappingURL=components/button/button.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.mjs","sources":["../../../../src/govuk/components/button/button.mjs"],"sourcesContent":["/* eslint-disable es-x/no-function-prototype-bind -- Polyfill imported */\n\nimport { mergeConfigs } from '../../common/index.mjs'\nimport { normaliseDataset } from '../../common/normalise-dataset.mjs'\nimport '../../vendor/polyfills/Event.mjs' // addEventListener, event.target normalization and DOMContentLoaded\nimport '../../vendor/polyfills/Function/prototype/bind.mjs'\n\nvar KEY_SPACE = 32\nvar DEBOUNCE_TIMEOUT_IN_SECONDS = 1\n\n/**\n * JavaScript enhancements for the Button component\n *\n * @class\n * @param {Element} $module - HTML element to use for button\n * @param {ButtonConfig} [config] - Button config\n */\nfunction Button ($module, config) {\n if (!($module instanceof HTMLElement)) {\n return this\n }\n\n /** @deprecated Will be made private in v5.0 */\n this.$module = $module\n\n /** @deprecated Will be made private in v5.0 */\n this.debounceFormSubmitTimer = null\n\n var defaultConfig = {\n preventDoubleClick: false\n }\n\n /**\n * @deprecated Will be made private in v5.0\n * @type {ButtonConfig}\n */\n this.config = mergeConfigs(\n defaultConfig,\n config || {},\n normaliseDataset($module.dataset)\n )\n}\n\n/**\n * Initialise component\n */\nButton.prototype.init = function () {\n // Check that required elements are present\n if (!this.$module) {\n return\n }\n\n this.$module.addEventListener('keydown', this.handleKeyDown)\n this.$module.addEventListener('click', this.debounce.bind(this))\n}\n\n/**\n * Trigger a click event when the space key is pressed\n *\n * Some screen readers tell users they can activate things with the 'button'\n * role, so we need to match the functionality of native HTML buttons\n *\n * See https://github.com/alphagov/govuk_elements/pull/272#issuecomment-233028270\n *\n * @deprecated Will be made private in v5.0\n * @param {KeyboardEvent} event - Keydown event\n */\nButton.prototype.handleKeyDown = function (event) {\n var $target = event.target\n\n // Handle space bar only\n if (event.keyCode !== KEY_SPACE) {\n return\n }\n\n // Handle elements with [role=\"button\"] only\n if ($target instanceof HTMLElement && $target.getAttribute('role') === 'button') {\n event.preventDefault() // prevent the page from scrolling\n $target.click()\n }\n}\n\n/**\n * Debounce double-clicks\n *\n * If the click quickly succeeds a previous click then nothing will happen. This\n * stops people accidentally causing multiple form submissions by double\n * clicking buttons.\n *\n * @deprecated Will be made private in v5.0\n * @param {MouseEvent} event - Mouse click event\n * @returns {undefined | false} Returns undefined, or false when debounced\n */\nButton.prototype.debounce = function (event) {\n // Check the button that was clicked has preventDoubleClick enabled\n if (!this.config.preventDoubleClick) {\n return\n }\n\n // If the timer is still running, prevent the click from submitting the form\n if (this.debounceFormSubmitTimer) {\n event.preventDefault()\n return false\n }\n\n this.debounceFormSubmitTimer = setTimeout(function () {\n this.debounceFormSubmitTimer = null\n }.bind(this), DEBOUNCE_TIMEOUT_IN_SECONDS * 1000)\n}\n\nexport default Button\n\n/**\n * Button config\n *\n * @typedef {object} ButtonConfig\n * @property {boolean} [preventDoubleClick = false] - Prevent accidental double\n * clicks on submit buttons from submitting forms multiple times.\n */\n"],"names":[],"mappings":";;;;;AAAA;AACA,AAKA;AACA,IAAI,SAAS,GAAG,GAAE;AAClB,IAAI,2BAA2B,GAAG,EAAC;;;;;;;;;AASnC,SAAS,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE;EAChC,IAAI,EAAE,OAAO,YAAY,WAAW,CAAC,EAAE;IACrC,OAAO,IAAI;GACZ;;;EAGD,IAAI,CAAC,OAAO,GAAG,QAAO;;;EAGtB,IAAI,CAAC,uBAAuB,GAAG,KAAI;;EAEnC,IAAI,aAAa,GAAG;IAClB,kBAAkB,EAAE,KAAK;IAC1B;;;;;;EAMD,IAAI,CAAC,MAAM,GAAG,YAAY;IACxB,aAAa;IACb,MA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