govuk_publishing_components 68.3.0 → 69.0.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 (328) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +98 -139
  3. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +3 -1
  4. data/app/assets/javascripts/govuk_publishing_components/lib/trigger-event.js +14 -11
  5. data/app/assets/stylesheets/component_guide/application.scss +3 -3
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +1 -1
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_add-another.scss +2 -2
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_app-promo-banner.scss +1 -1
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_back-link.scss +1 -1
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_big-number.scss +1 -1
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +1 -1
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +2 -2
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_character-count.scss +1 -1
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_checkboxes.scss +1 -1
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +2 -2
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +1 -1
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_date-input.scss +1 -1
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_details.scss +1 -1
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +4 -4
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_error-message.scss +1 -1
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_error-summary.scss +1 -1
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +4 -4
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_fieldset.scss +1 -1
  24. data/app/assets/stylesheets/govuk_publishing_components/components/_file-upload.scss +1 -1
  25. data/app/assets/stylesheets/govuk_publishing_components/components/_hint.scss +1 -1
  26. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +1 -1
  27. data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +1 -1
  28. data/app/assets/stylesheets/govuk_publishing_components/components/_inset-text.scss +1 -1
  29. data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +1 -1
  30. data/app/assets/stylesheets/govuk_publishing_components/components/_label.scss +1 -1
  31. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +1 -1
  32. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +1 -1
  33. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +8 -5
  34. data/app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss +1 -1
  35. data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +2 -2
  36. data/app/assets/stylesheets/govuk_publishing_components/components/_modal-dialogue.scss +1 -1
  37. data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +1 -1
  38. data/app/assets/stylesheets/govuk_publishing_components/components/_pagination.scss +1 -1
  39. data/app/assets/stylesheets/govuk_publishing_components/components/_panel.scss +1 -1
  40. data/app/assets/stylesheets/govuk_publishing_components/components/_password-input.scss +1 -1
  41. data/app/assets/stylesheets/govuk_publishing_components/components/_phase-banner.scss +1 -1
  42. data/app/assets/stylesheets/govuk_publishing_components/components/_radio.scss +1 -1
  43. data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +1 -1
  44. data/app/assets/stylesheets/govuk_publishing_components/components/_select-with-search.scss +1 -1
  45. data/app/assets/stylesheets/govuk_publishing_components/components/_select.scss +1 -1
  46. data/app/assets/stylesheets/govuk_publishing_components/components/_service-navigation.scss +1 -1
  47. data/app/assets/stylesheets/govuk_publishing_components/components/_skip-link.scss +1 -1
  48. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +1 -1
  49. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +1 -1
  50. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +2 -2
  51. data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +1 -1
  52. data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +1 -1
  53. data/app/assets/stylesheets/govuk_publishing_components/components/_summary-card.scss +1 -1
  54. data/app/assets/stylesheets/govuk_publishing_components/components/_summary-list.scss +1 -1
  55. data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +1 -1
  56. data/app/assets/stylesheets/govuk_publishing_components/components/_tabs.scss +1 -1
  57. data/app/assets/stylesheets/govuk_publishing_components/components/_tag.scss +1 -1
  58. data/app/assets/stylesheets/govuk_publishing_components/components/_textarea.scss +1 -1
  59. data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +1 -1
  60. data/app/assets/stylesheets/govuk_publishing_components/components/_warning-text.scss +1 -1
  61. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +1 -1
  62. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +9 -8
  63. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +1 -1
  64. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +1 -1
  65. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_index.scss +0 -1
  66. data/app/views/govuk_publishing_components/components/_date_input.html.erb +16 -10
  67. data/app/views/govuk_publishing_components/components/_metadata.html.erb +81 -74
  68. data/app/views/govuk_publishing_components/components/docs/date_input.yml +23 -0
  69. data/lib/govuk_publishing_components/version.rb +1 -1
  70. data/node_modules/choices.js/README.md +1 -1
  71. data/node_modules/choices.js/package.json +5 -9
  72. data/node_modules/choices.js/public/assets/scripts/choices.js +32 -23
  73. data/node_modules/choices.js/public/assets/scripts/choices.min.js +2 -2
  74. data/node_modules/choices.js/public/assets/scripts/choices.mjs +32 -23
  75. data/node_modules/choices.js/public/assets/scripts/choices.search-basic.js +31 -22
  76. data/node_modules/choices.js/public/assets/scripts/choices.search-basic.min.js +2 -2
  77. data/node_modules/choices.js/public/assets/scripts/choices.search-basic.mjs +31 -22
  78. data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.js +30 -21
  79. data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.min.js +2 -2
  80. data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.mjs +30 -21
  81. data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.js +30 -21
  82. data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.min.js +2 -2
  83. data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.mjs +30 -21
  84. data/node_modules/choices.js/public/types/src/scripts/choices.d.ts +3 -3
  85. data/node_modules/choices.js/public/types/src/scripts/interfaces/templates.d.ts +1 -1
  86. data/node_modules/choices.js/src/scripts/choices.ts +30 -25
  87. data/node_modules/choices.js/src/scripts/components/dropdown.ts +7 -3
  88. data/node_modules/choices.js/src/scripts/interfaces/templates.ts +1 -1
  89. data/node_modules/choices.js/src/scripts/templates.ts +8 -3
  90. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +1 -1
  91. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +1 -1
  92. data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
  93. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_accordion.scss +4 -1
  94. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_accordion.scss.map +1 -1
  95. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +3 -1
  96. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss.map +1 -1
  97. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_back-link.scss +4 -1
  98. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_back-link.scss.map +1 -1
  99. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss +7 -3
  100. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss.map +1 -1
  101. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_breadcrumbs.scss +4 -1
  102. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_breadcrumbs.scss.map +1 -1
  103. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss +8 -4
  104. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss.map +1 -1
  105. data/node_modules/govuk-frontend/dist/govuk/components/button/_button.scss +4 -1
  106. data/node_modules/govuk-frontend/dist/govuk/components/button/_button.scss.map +1 -1
  107. data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss +3 -1
  108. data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss.map +1 -1
  109. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_character-count.scss +4 -1
  110. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_character-count.scss.map +1 -1
  111. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +2 -0
  112. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss.map +1 -1
  113. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_checkboxes.scss +4 -1
  114. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_checkboxes.scss.map +1 -1
  115. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss +10 -6
  116. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss.map +1 -1
  117. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_cookie-banner.scss +4 -1
  118. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_cookie-banner.scss.map +1 -1
  119. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss +2 -0
  120. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss.map +1 -1
  121. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_date-input.scss +4 -1
  122. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_date-input.scss.map +1 -1
  123. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +2 -0
  124. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss.map +1 -1
  125. data/node_modules/govuk-frontend/dist/govuk/components/details/_details.scss +4 -1
  126. data/node_modules/govuk-frontend/dist/govuk/components/details/_details.scss.map +1 -1
  127. data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss +3 -1
  128. data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss.map +1 -1
  129. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_error-message.scss +4 -1
  130. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_error-message.scss.map +1 -1
  131. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss +2 -0
  132. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss.map +1 -1
  133. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_error-summary.scss +4 -1
  134. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_error-summary.scss.map +1 -1
  135. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss +3 -1
  136. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss.map +1 -1
  137. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_exit-this-page.scss +4 -1
  138. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_exit-this-page.scss.map +1 -1
  139. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss +3 -1
  140. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss.map +1 -1
  141. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_fieldset.scss +4 -1
  142. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_fieldset.scss.map +1 -1
  143. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.scss +3 -1
  144. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.scss.map +1 -1
  145. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_file-upload.scss +4 -1
  146. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_file-upload.scss.map +1 -1
  147. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +4 -1
  148. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss.map +1 -1
  149. data/node_modules/govuk-frontend/dist/govuk/components/footer/_footer.scss +4 -1
  150. data/node_modules/govuk-frontend/dist/govuk/components/footer/_footer.scss.map +1 -1
  151. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +2 -0
  152. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss.map +1 -1
  153. data/node_modules/govuk-frontend/dist/govuk/components/header/_header.scss +4 -1
  154. data/node_modules/govuk-frontend/dist/govuk/components/header/_header.scss.map +1 -1
  155. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +2 -0
  156. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +1 -1
  157. data/node_modules/govuk-frontend/dist/govuk/components/hint/_hint.scss +4 -1
  158. data/node_modules/govuk-frontend/dist/govuk/components/hint/_hint.scss.map +1 -1
  159. data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss +2 -0
  160. data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss.map +1 -1
  161. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +2 -0
  162. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss.map +1 -1
  163. data/node_modules/govuk-frontend/dist/govuk/components/input/_input.scss +4 -1
  164. data/node_modules/govuk-frontend/dist/govuk/components/input/_input.scss.map +1 -1
  165. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss +5 -1
  166. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss.map +1 -1
  167. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_inset-text.scss +4 -1
  168. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_inset-text.scss.map +1 -1
  169. data/node_modules/govuk-frontend/dist/govuk/components/label/_index.scss +3 -1
  170. data/node_modules/govuk-frontend/dist/govuk/components/label/_index.scss.map +1 -1
  171. data/node_modules/govuk-frontend/dist/govuk/components/label/_label.scss +4 -1
  172. data/node_modules/govuk-frontend/dist/govuk/components/label/_label.scss.map +1 -1
  173. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +6 -2
  174. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss.map +1 -1
  175. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_notification-banner.scss +4 -1
  176. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_notification-banner.scss.map +1 -1
  177. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +2 -0
  178. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss.map +1 -1
  179. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_pagination.scss +4 -1
  180. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_pagination.scss.map +1 -1
  181. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +3 -1
  182. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss.map +1 -1
  183. data/node_modules/govuk-frontend/dist/govuk/components/panel/_panel.scss +4 -1
  184. data/node_modules/govuk-frontend/dist/govuk/components/panel/_panel.scss.map +1 -1
  185. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss +2 -0
  186. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss.map +1 -1
  187. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_password-input.scss +4 -1
  188. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_password-input.scss.map +1 -1
  189. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +3 -1
  190. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss.map +1 -1
  191. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_phase-banner.scss +4 -1
  192. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_phase-banner.scss.map +1 -1
  193. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +14 -10
  194. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss.map +1 -1
  195. data/node_modules/govuk-frontend/dist/govuk/components/radios/_radios.scss +4 -1
  196. data/node_modules/govuk-frontend/dist/govuk/components/radios/_radios.scss.map +1 -1
  197. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +2 -0
  198. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss.map +1 -1
  199. data/node_modules/govuk-frontend/dist/govuk/components/select/_select.scss +4 -1
  200. data/node_modules/govuk-frontend/dist/govuk/components/select/_select.scss.map +1 -1
  201. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +5 -1
  202. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss.map +1 -1
  203. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.scss +4 -1
  204. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.scss.map +1 -1
  205. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +7 -3
  206. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss.map +1 -1
  207. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_skip-link.scss +4 -1
  208. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_skip-link.scss.map +1 -1
  209. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +15 -2
  210. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss.map +1 -1
  211. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_summary-list.scss +4 -1
  212. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_summary-list.scss.map +1 -1
  213. data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss +4 -1
  214. data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss.map +1 -1
  215. data/node_modules/govuk-frontend/dist/govuk/components/table/_table.scss +4 -1
  216. data/node_modules/govuk-frontend/dist/govuk/components/table/_table.scss.map +1 -1
  217. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss +5 -2
  218. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss.map +1 -1
  219. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_tabs.scss +4 -1
  220. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_tabs.scss.map +1 -1
  221. data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss +4 -1
  222. data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss.map +1 -1
  223. data/node_modules/govuk-frontend/dist/govuk/components/tag/_tag.scss +4 -1
  224. data/node_modules/govuk-frontend/dist/govuk/components/tag/_tag.scss.map +1 -1
  225. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss +6 -2
  226. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss.map +1 -1
  227. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_task-list.scss +4 -1
  228. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_task-list.scss.map +1 -1
  229. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +2 -0
  230. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss.map +1 -1
  231. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_textarea.scss +4 -1
  232. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_textarea.scss.map +1 -1
  233. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +3 -1
  234. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss.map +1 -1
  235. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_warning-text.scss +4 -1
  236. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_warning-text.scss.map +1 -1
  237. data/node_modules/govuk-frontend/dist/govuk/core/_global-styles.scss +4 -0
  238. data/node_modules/govuk-frontend/dist/govuk/core/_global-styles.scss.map +1 -1
  239. data/node_modules/govuk-frontend/dist/govuk/core/_index.scss +4 -0
  240. data/node_modules/govuk-frontend/dist/govuk/core/_index.scss.map +1 -1
  241. data/node_modules/govuk-frontend/dist/govuk/core/_links.scss +8 -0
  242. data/node_modules/govuk-frontend/dist/govuk/core/_links.scss.map +1 -1
  243. data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss +10 -1
  244. data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss.map +1 -1
  245. data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss +5 -0
  246. data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss.map +1 -1
  247. data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss +14 -13
  248. data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss.map +1 -1
  249. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.scss +1 -1
  250. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.scss +5 -0
  251. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.scss.map +1 -1
  252. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
  253. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
  254. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
  255. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +38 -70
  256. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss.map +1 -1
  257. data/node_modules/govuk-frontend/dist/govuk/helpers/_device-pixels.scss +2 -0
  258. data/node_modules/govuk-frontend/dist/govuk/helpers/_device-pixels.scss.map +1 -1
  259. data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +1 -1
  260. data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss.map +1 -1
  261. data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss +3 -2
  262. data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss.map +1 -1
  263. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +4 -4
  264. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss.map +1 -1
  265. data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss +17 -15
  266. data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss.map +1 -1
  267. data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.scss +2 -2
  268. data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.scss.map +1 -1
  269. data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss +19 -13
  270. data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss.map +1 -1
  271. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +48 -26
  272. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss.map +1 -1
  273. data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss +13 -11
  274. data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss.map +1 -1
  275. data/node_modules/govuk-frontend/dist/govuk/objects/_grid.scss +4 -2
  276. data/node_modules/govuk-frontend/dist/govuk/objects/_grid.scss.map +1 -1
  277. data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss +10 -9
  278. data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss.map +1 -1
  279. data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss +2 -0
  280. data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss.map +1 -1
  281. data/node_modules/govuk-frontend/dist/govuk/overrides/_index.scss +3 -0
  282. data/node_modules/govuk-frontend/dist/govuk/overrides/_index.scss.map +1 -1
  283. data/node_modules/govuk-frontend/dist/govuk/overrides/_spacing.scss +5 -1
  284. data/node_modules/govuk-frontend/dist/govuk/overrides/_spacing.scss.map +1 -1
  285. data/node_modules/govuk-frontend/dist/govuk/overrides/_text-align.scss +2 -0
  286. data/node_modules/govuk-frontend/dist/govuk/overrides/_text-align.scss.map +1 -1
  287. data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss +7 -2
  288. data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss.map +1 -1
  289. data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss +3 -0
  290. data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss.map +1 -1
  291. data/node_modules/govuk-frontend/dist/govuk/settings/_assets.scss +18 -0
  292. data/node_modules/govuk-frontend/dist/govuk/settings/_assets.scss.map +1 -1
  293. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.scss +28 -4
  294. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.scss.map +1 -1
  295. data/node_modules/govuk-frontend/dist/govuk/settings/_links.scss +3 -2
  296. data/node_modules/govuk-frontend/dist/govuk/settings/_links.scss.map +1 -1
  297. data/node_modules/govuk-frontend/dist/govuk/settings/_measurements.scss +8 -16
  298. data/node_modules/govuk-frontend/dist/govuk/settings/_measurements.scss.map +1 -1
  299. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-font.scss +4 -1
  300. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-font.scss.map +1 -1
  301. data/node_modules/govuk-frontend/dist/govuk/settings/_warnings.scss +15 -2
  302. data/node_modules/govuk-frontend/dist/govuk/settings/_warnings.scss.map +1 -1
  303. data/node_modules/govuk-frontend/dist/govuk/tools/_exports.scss +3 -2
  304. data/node_modules/govuk-frontend/dist/govuk/tools/_exports.scss.map +1 -1
  305. data/node_modules/govuk-frontend/dist/govuk/tools/_font-url.scss +13 -5
  306. data/node_modules/govuk-frontend/dist/govuk/tools/_font-url.scss.map +1 -1
  307. data/node_modules/govuk-frontend/dist/govuk/tools/_if.scss +24 -0
  308. data/node_modules/govuk-frontend/dist/govuk/tools/_if.scss.map +1 -0
  309. data/node_modules/govuk-frontend/dist/govuk/tools/_image-url.scss +13 -5
  310. data/node_modules/govuk-frontend/dist/govuk/tools/_image-url.scss.map +1 -1
  311. data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss +1 -0
  312. data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss.map +1 -1
  313. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss +5 -3
  314. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss.map +1 -1
  315. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss +4 -2
  316. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss.map +1 -1
  317. data/node_modules/govuk-frontend/dist/govuk/utilities/_clearfix.scss +3 -0
  318. data/node_modules/govuk-frontend/dist/govuk/utilities/_clearfix.scss.map +1 -1
  319. data/node_modules/govuk-frontend/dist/govuk/utilities/_index.scss +1 -0
  320. data/node_modules/govuk-frontend/dist/govuk/utilities/_index.scss.map +1 -1
  321. data/node_modules/govuk-frontend/dist/govuk/utilities/_visually-hidden.scss +3 -0
  322. data/node_modules/govuk-frontend/dist/govuk/utilities/_visually-hidden.scss.map +1 -1
  323. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss +3 -1
  324. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss.map +1 -1
  325. data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +1 -1
  326. data/node_modules/govuk-frontend/package.json +7 -7
  327. metadata +4 -3
  328. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_grid-helper.scss +0 -145
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03455dfe8892b30b454209d8b8a490fd52abfbe5605d8f2823dbe9bd03d52979
4
- data.tar.gz: c037b1fbba983e32b96b8abdc6e73cce0c7a2c448862982973f5d757ed324480
3
+ metadata.gz: 4d6a8ca8a18729239925c15778ecfe6f9e699c8c1531d199e3259ed084c2b40f
4
+ data.tar.gz: f94b13c75a3b38547a27716a5b40252b8a62a83cd609365c056eb578d6901741
5
5
  SHA512:
6
- metadata.gz: f3e2136388c8bbc98caf66c605efc335139e485f59e15a4e1bffcc72b5f2ea94d67dcbcefb9dbde13ba8dc779dd465301ed25c22c0f2a88f0022f3ab2704d634
7
- data.tar.gz: 275c48bef08012285e2091aef239b78effce8f893c5ed191fec261f05f708c5ef77241cc17a0763d2407a30512a4d4d040105b3aef9178dccc3fc45520e1d8ea
6
+ metadata.gz: 5318a3a3ddda3807aedfa588342b942574d5d863ca064d553b9fd83beb0a9817e927f0e8583bd76a9dd90a344b7961e7f4c8c6bcbbb0f1bc2d32bfdc01575b1c
7
+ data.tar.gz: bca644a69295230d4e4715a01819589b4e50c11c84e47b5410772e4b614b9d7bcbf109680b50015a63907195dea5f7eaa586672e18c0f5115507a11815c54706
@@ -1,89 +1,51 @@
1
1
  (function (Modules) {
2
- var SETTINGS = {
2
+ const SETTINGS = {
3
3
  label: {
4
4
  hide: 'data-text-for-hide',
5
5
  show: 'data-text-for-show'
6
6
  }
7
7
  }
8
8
 
9
- // Small helpers that update the label when the state of the button has
10
- // changed:
11
- var setLabel = function ($button, showOrHide) {
12
- var newLabel = $button.getAttribute(SETTINGS.label[showOrHide])
9
+ // Small helpers that update the label when the state of the button has changed:
10
+ const setLabel = function (button, showOrHide) {
11
+ const newLabel = button.getAttribute(SETTINGS.label[showOrHide])
13
12
 
14
13
  if (newLabel) {
15
- $button.setAttribute('aria-label', newLabel)
14
+ button.setAttribute('aria-label', newLabel)
16
15
  }
17
16
  }
18
17
 
19
18
  // Wrapper functions to contain all of the mechanisms needed for hiding and
20
19
  // toggling the menus.
21
- var hide = function ($button, $menu) {
22
- $button.setAttribute('aria-expanded', false)
23
- $button.classList.remove('gem-c-layout-super-navigation-header__open-button')
24
- $menu.setAttribute('hidden', 'hidden')
25
- setLabel($button, 'show')
20
+ const hide = function (button, menu) {
21
+ button.setAttribute('aria-expanded', false)
22
+ button.classList.remove('gem-c-layout-super-navigation-header__open-button')
23
+ menu.setAttribute('hidden', 'hidden')
24
+ setLabel(button, 'show')
26
25
  }
27
- var show = function ($button, $menu) {
28
- $button.setAttribute('aria-expanded', true)
29
- $button.classList.add('gem-c-layout-super-navigation-header__open-button')
30
- $menu.removeAttribute('hidden')
31
- setLabel($button, 'hide')
26
+
27
+ const show = function (button, menu) {
28
+ button.setAttribute('aria-expanded', true)
29
+ button.classList.add('gem-c-layout-super-navigation-header__open-button')
30
+ menu.removeAttribute('hidden')
31
+ setLabel(button, 'hide')
32
32
  }
33
33
 
34
- var toggle = function ($button, $menu) {
35
- var isOpen = $button.getAttribute('aria-expanded') === 'true'
34
+ const toggle = function (button, menu) {
35
+ const isOpen = button.getAttribute('aria-expanded') === 'true'
36
36
  if (isOpen) {
37
- hide($button, $menu)
37
+ hide(button, menu)
38
38
  } else {
39
- show($button, $menu)
39
+ show(button, menu)
40
40
  }
41
41
  }
42
42
 
43
- // Clicking an element inside a `button` element causes the `event.target` to
44
- // be the inside element, not the button. This can be taken care of by setting
45
- // the CSS pointer-events to be none, but that doesn't work for older
46
- // browsers, won't work for people with CSS turned off, or for people who are
47
- // using CSS overrides.
48
- // This checks if the $element is the `elementType`; if it is, it gets
49
- // returned; if not it recursively checks to see if the parent element is a
50
- // `elementType`. This means that it can be used with `pointer-events: none`.
51
- var closestParentIncluding = function ($element, elementType) {
52
- if ($element.tagName.toLowerCase() === elementType.toLowerCase()) {
53
- return $element
54
- }
55
- return closestParentIncluding($element.parentNode, elementType)
56
- }
57
-
58
- // Searched the previous elements to find one with the same tag as set in
59
- // `elementType` . If it's found the element is returned; if not, it returns
60
- // null.
61
- var closestPrevious = function ($element, elementType) {
62
- if ($element === null) {
63
- return null
64
- }
65
-
66
- // Using `previousSibling` means that there is a possibility that the
67
- // $element could be a text node or a comment node - checking the `nodeType`
68
- // of the element will ensure that it's a real element.
69
- if ($element.nodeType === 1 && $element.tagName.toLowerCase() === elementType.toLowerCase()) {
70
- return $element
71
- }
72
-
73
- // If `previousElementSibling` can be used then let's use it as it'll be
74
- // slightly faster since it skips things that aren't elements. If not,
75
- // `previousSibling` can still be used as there's a `nodeType` check.
76
- var previousElement = $element.previousElementSibling || $element.previousSibling
77
-
78
- return closestPrevious(previousElement, elementType)
79
- }
80
-
81
- function SuperNavigationMegaMenu ($module) {
82
- this.$module = $module
83
- this.$searchToggle = this.$module.querySelector('#super-search-menu-toggle')
84
- this.$searchMenu = this.$module.querySelector('#super-search-menu')
85
- this.$navToggle = this.$module.querySelector('#super-navigation-menu-toggle')
86
- this.$navMenu = this.$module.querySelector('#super-navigation-menu')
43
+ function SuperNavigationMegaMenu (module) {
44
+ this.module = module
45
+ this.searchToggle = this.module.querySelector('#super-search-menu-toggle')
46
+ this.searchMenu = this.module.querySelector('#super-search-menu')
47
+ this.navToggle = this.module.querySelector('#super-navigation-menu-toggle')
48
+ this.navMenu = this.module.querySelector('#super-navigation-menu')
87
49
 
88
50
  // The menu toggler buttons need three attributes for this to work:
89
51
  // - `aria-controls` contains the id of the menu to be toggled
@@ -91,132 +53,129 @@
91
53
  // smaller screens
92
54
  // - `data-toggle-desktop-group` is the group that the menu belongs to on
93
55
  // larger screens
94
- this.$buttons = this.$module.querySelectorAll(
56
+ this.buttons = this.module.querySelectorAll(
95
57
  'button[aria-controls][data-toggle-mobile-group][data-toggle-desktop-group]'
96
58
  )
97
59
 
98
- this.hiddenButtons = this.$module.querySelectorAll('button[hidden]')
60
+ this.hiddenButtons = this.module.querySelectorAll('button[hidden]')
99
61
  }
100
62
 
101
63
  SuperNavigationMegaMenu.prototype.buttonHandler = function (event) {
102
- var $target = closestParentIncluding(event.target, 'button')
103
- var $targetMenu = this.$module.querySelector('#' + $target.getAttribute('aria-controls'))
104
-
105
- var toggleGroupAttribute = 'data-toggle-desktop-group'
106
- var toggleGroupName = $target.getAttribute(toggleGroupAttribute)
107
- var toggleGroupList = this.$module.querySelectorAll('[' + toggleGroupAttribute + '="' + toggleGroupName + '"]')
108
-
109
- for (var k = 0; k < toggleGroupList.length; k++) {
110
- var $element = toggleGroupList[k]
111
- if ($element !== $target) {
112
- var $menu = this.$module.querySelector('#' + $element.getAttribute('aria-controls'))
113
- hide($element, $menu)
64
+ const target = event.target.closest('button')
65
+ const targetMenu = this.module.querySelector('#' + target.getAttribute('aria-controls'))
66
+
67
+ const toggleGroupAttribute = 'data-toggle-desktop-group'
68
+ const toggleGroupName = target.getAttribute(toggleGroupAttribute)
69
+ const toggleGroupList = this.module.querySelectorAll('[' + toggleGroupAttribute + '="' + toggleGroupName + '"]')
70
+
71
+ for (const element of toggleGroupList) {
72
+ if (element !== target) {
73
+ const menu = this.module.querySelector('#' + element.getAttribute('aria-controls'))
74
+ hide(element, menu)
114
75
  }
115
76
  }
116
77
 
117
- toggle($target, $targetMenu)
78
+ toggle(target, targetMenu)
118
79
  }
119
80
 
120
81
  SuperNavigationMegaMenu.prototype.handleKeyDown = function (event) {
121
- var KEY_TAB = 9
122
- var KEY_ESC = 27
123
- var $navMenuLinks = this.$navMenu.querySelectorAll('li a')
124
- var $firstNavLink = $navMenuLinks[0]
125
- var $lastNavLink = $navMenuLinks[$navMenuLinks.length - 1]
126
- var $searchMenuTabbable = this.$searchMenu.querySelectorAll('li a, input, button')
127
- var $lastSearchMenuTabbable = $searchMenuTabbable[$searchMenuTabbable.length - 1]
128
-
129
- if (event.keyCode === KEY_TAB) {
130
- if (!this.$navMenu.hasAttribute('hidden')) {
82
+ if (event.key !== 'Tab' && event.key !== 'Escape') {
83
+ return
84
+ }
85
+
86
+ const navMenuLinks = this.navMenu.querySelectorAll('li a')
87
+ const firstNavLink = navMenuLinks[0]
88
+ const lastNavLink = navMenuLinks[navMenuLinks.length - 1]
89
+ const searchMenuTabbable = this.searchMenu.querySelectorAll('li a, input, button')
90
+ const lastSearchMenuTabbable = searchMenuTabbable[searchMenuTabbable.length - 1]
91
+
92
+ if (event.key === 'Tab') {
93
+ if (!this.navMenu.hasAttribute('hidden')) {
131
94
  switch (document.activeElement) {
132
- case this.$navToggle:
95
+ case this.navToggle:
133
96
  if (!event.shiftKey) {
134
97
  event.preventDefault()
135
- $firstNavLink.focus()
98
+ firstNavLink.focus()
136
99
  }
137
100
  break
138
- case $lastNavLink:
101
+ case lastNavLink:
139
102
  if (!event.shiftKey) {
140
103
  event.preventDefault()
141
- this.$searchToggle.focus()
142
- hide(this.$navToggle, this.$navMenu)
104
+ this.searchToggle.focus()
105
+ hide(this.navToggle, this.navMenu)
143
106
  }
144
107
  break
145
- case $firstNavLink:
108
+ case firstNavLink:
146
109
  if (event.shiftKey) {
147
110
  event.preventDefault()
148
- this.$navToggle.focus()
111
+ this.navToggle.focus()
149
112
  }
150
113
  break
151
- case this.$searchToggle:
114
+ case this.searchToggle:
152
115
  if (event.shiftKey) {
153
116
  event.preventDefault()
154
- $lastNavLink.focus()
117
+ lastNavLink.focus()
155
118
  }
156
119
  break
157
120
  default:
158
121
  break
159
122
  }
160
- } else if (!this.$searchMenu.hasAttribute('hidden')) {
161
- if (document.activeElement === $lastSearchMenuTabbable) {
123
+ } else if (!this.searchMenu.hasAttribute('hidden')) {
124
+ if (document.activeElement === lastSearchMenuTabbable) {
162
125
  if (!event.shiftKey) {
163
- hide(this.$searchToggle, this.$searchMenu)
126
+ hide(this.searchToggle, this.searchMenu)
164
127
  }
165
128
  }
166
129
  }
167
- } else if (event.keyCode === KEY_ESC) {
168
- if (!this.$navMenu.hasAttribute('hidden')) {
169
- hide(this.$navToggle, this.$navMenu)
170
- this.$navToggle.focus()
171
- } else if (!this.$searchMenu.hasAttribute('hidden')) {
172
- hide(this.$searchToggle, this.$searchMenu)
173
- this.$searchToggle.focus()
130
+ } else if (event.key === 'Escape') {
131
+ if (!this.navMenu.hasAttribute('hidden')) {
132
+ hide(this.navToggle, this.navMenu)
133
+ this.navToggle.focus()
134
+ } else if (!this.searchMenu.hasAttribute('hidden')) {
135
+ hide(this.searchToggle, this.searchMenu)
136
+ this.searchToggle.focus()
174
137
  }
175
138
  }
176
139
  }
177
140
 
178
141
  SuperNavigationMegaMenu.prototype.init = function () {
179
142
  // Handle key events for tab and escape keys
180
- this.$module.addEventListener('keydown', this.handleKeyDown.bind(this))
143
+ this.module.addEventListener('keydown', this.handleKeyDown.bind(this))
181
144
 
182
- for (var j = 0; j < this.$buttons.length; j++) {
183
- var $button = this.$buttons[j]
184
- $button.addEventListener('click', this.buttonHandler.bind(this), true)
145
+ for (const button of this.buttons) {
146
+ button.addEventListener('click', this.buttonHandler.bind(this), true)
185
147
  }
186
148
 
187
- // The toggle buttons are hardcoded to be hidden in the markup - this means
188
- // that people without JavaScript turned on won't have buttons present that
189
- // don't do anything.
190
- // Since JavaScript is enabled we can remove the hidden attribute from
191
- // the buttons so that they're perceivable by users.
192
- // As the toggle buttons are now selectable, we should prevent the links
193
- // from being selectable to avoid confusion.
194
- for (var i = 0; i < this.hiddenButtons.length; i++) {
195
- var $element = this.hiddenButtons[i]
196
- $element.removeAttribute('hidden')
197
-
198
- var closestSiblingLink = closestPrevious($element, 'a')
199
-
200
- if (closestSiblingLink) {
201
- closestSiblingLink.setAttribute('hidden', 'hidden')
149
+ // Reveal toggle buttons hidden by default in HTML for non-JavaScript users
150
+ // and hide the fallback links now that JavaScript is available.
151
+ for (const element of this.hiddenButtons) {
152
+ element.removeAttribute('hidden')
153
+
154
+ let sibling = element.previousElementSibling
155
+
156
+ // Find and hide the preceding no JavaScript fallback links
157
+ while (sibling) {
158
+ if (sibling.matches('a')) {
159
+ sibling.setAttribute('hidden', 'hidden')
160
+ break
161
+ }
162
+ sibling = sibling.previousElementSibling
202
163
  }
203
164
  }
204
165
 
205
- this.$module.querySelector('.gem-c-layout-super-navigation-header__search-item-link')
166
+ this.module.querySelector('.gem-c-layout-super-navigation-header__search-item-link')
206
167
  .setAttribute('hidden', 'hidden')
207
168
 
208
169
  // Navigation menu and search menu are hardcoded to be open in the markup -
209
- // this means that the menu still makes sense with CSS and JavaScript turned
210
- // off.
211
- // The menus now need to be hidden as part of the JavaScript
212
- // initialisation.
213
- // - On both mobile and desktop, this means hiding the search menu
214
- // - On mobile, this means hiding the navigation
215
- // - On desktop, this means hiding the navigation button, showing the
216
- // second level navigation menu
217
- hide(this.$searchToggle, this.$searchMenu)
218
-
219
- this.$module.classList.add('js-module-initialised')
170
+ // this means that the menu still makes sense with CSS and JavaScript turned off.
171
+ // The menus now need to be hidden as part of the JavaScript initialisation:
172
+ // - On both mobile and desktop, this means hiding the search menu
173
+ // - On mobile, this means hiding the navigation
174
+ // - On desktop, this means hiding the navigation button, showing the
175
+ // second level navigation menu
176
+ hide(this.searchToggle, this.searchMenu)
177
+
178
+ this.module.classList.add('js-module-initialised')
220
179
  }
221
180
 
222
181
  Modules.SuperNavigationMegaMenu = SuperNavigationMegaMenu
@@ -45,9 +45,11 @@
45
45
  <span class="govuk-heading-s">How to watch this YouTube video</span>
46
46
  <span class="gem-c-govspeak__youtube-placeholder-text">There's a YouTube video on this page. You can't access it because of your cookie settings.</span>
47
47
  <span class="gem-c-govspeak__youtube-placeholder-text">You can <a href="/help/cookies" class="govuk-link">change your cookie settings</a> or watch the video on YouTube instead:</span>
48
- <a href="${href}" class="govuk-link">${text}</a>
48
+ <a href="${href}" class="govuk-link js-youtube-link"></a>
49
49
  `
50
50
  placeholder.innerHTML = markup
51
+ const link = placeholder.querySelector('.js-youtube-link')
52
+ link.textContent = text
51
53
  $linkParent.after(placeholder)
52
54
  $linkParent.classList.add('gem-c-govspeak__youtube-placeholder-link')
53
55
  }
@@ -1,11 +1,13 @@
1
1
  // see https://github.com/alphagov/govuk_publishing_components/blob/main/docs/lib/trigger_event.md
2
- (function (root) {
2
+ (function () {
3
3
  'use strict'
4
4
 
5
+ window.GOVUK = window.GOVUK || {}
6
+
5
7
  window.GOVUK.triggerEvent = function (element, eventName, parameters) {
6
- var params = parameters || {}
7
- var event
8
- var keyCode = params.keyCode
8
+ const params = parameters || {}
9
+ const keyCode = params.keyCode
10
+ const key = params.key
9
11
 
10
12
  if (!Object.prototype.hasOwnProperty.call(params, 'bubbles')) {
11
13
  params.bubbles = true
@@ -15,11 +17,10 @@
15
17
  params.cancelable = true
16
18
  }
17
19
 
18
- if (typeof window.CustomEvent === 'function') {
19
- event = new window.CustomEvent(eventName, params)
20
- } else {
21
- event = document.createEvent('CustomEvent')
22
- event.initCustomEvent(eventName, params.bubbles, params.cancelable, params.detail)
20
+ const event = new window.CustomEvent(eventName, params)
21
+
22
+ if (key) {
23
+ event.key = key
23
24
  }
24
25
 
25
26
  if (keyCode) {
@@ -30,6 +31,8 @@
30
31
  event.shiftKey = true
31
32
  }
32
33
 
33
- element.dispatchEvent(event)
34
+ if (element && typeof element.dispatchEvent === 'function') {
35
+ element.dispatchEvent(event)
36
+ }
34
37
  }
35
- }(window))
38
+ }())
@@ -15,7 +15,7 @@ $gem-guide-border-width: 1px;
15
15
  border: 3px solid govuk-functional-colour(error);
16
16
  margin: 0 0 govuk-spacing(6);
17
17
  padding: govuk-spacing(6);
18
- @include govuk-text-colour;
18
+ color: govuk-functional-colour(text);
19
19
 
20
20
  .component-violation__title {
21
21
  margin: 0;
@@ -115,8 +115,8 @@ $gem-guide-border-width: 1px;
115
115
  .component-guide-preview--violation,
116
116
  .component-guide-preview--warning {
117
117
  margin-top: -$gem-guide-border-width;
118
-
119
- @include govuk-text-colour;
118
+
119
+ color: govuk-functional-colour(text);
120
120
  @include govuk-font($size: 19);
121
121
 
122
122
  &:empty {
@@ -1,4 +1,4 @@
1
- @import "govuk/components/accordion/accordion";
1
+ @import "govuk/components/accordion";
2
2
 
3
3
  // Prevent elements inside the button from receiving click events
4
4
  .gem-c-accordion__show-all > * {
@@ -1,5 +1,5 @@
1
- @import "govuk/components/button/button";
2
- @import "govuk/components/fieldset/fieldset";
1
+ @import "govuk/components/button";
2
+ @import "govuk/components/fieldset";
3
3
 
4
4
  .gem-c-add-another {
5
5
  .gem-c-add-another__remove-button {
@@ -3,7 +3,7 @@
3
3
  padding: govuk-spacing(5) 0;
4
4
  border-top: 4px solid govuk-functional-colour(brand);
5
5
  background-color: $govuk-blue-tint-95;
6
- @include govuk-text-colour;
6
+ color: govuk-functional-colour(text);
7
7
  }
8
8
 
9
9
  .gem-c-app-promo-banner--visible {
@@ -1 +1 @@
1
- @import "govuk/components/back-link/back-link";
1
+ @import "govuk/components/back-link";
@@ -1,6 +1,6 @@
1
1
  .gem-c-big-number {
2
2
  margin-bottom: govuk-spacing(3);
3
- @include govuk-text-colour;
3
+ color: govuk-functional-colour(text);
4
4
  }
5
5
 
6
6
  .gem-c-big-number__value {
@@ -1,4 +1,4 @@
1
- @import "govuk/components/breadcrumbs/breadcrumbs";
1
+ @import "govuk/components/breadcrumbs";
2
2
 
3
3
  .gem-c-breadcrumbs--border-bottom {
4
4
  border-bottom: 1px solid govuk-functional-colour(border);
@@ -1,4 +1,4 @@
1
- @import "govuk/components/button/button";
1
+ @import "govuk/components/button";
2
2
 
3
3
  // Because govuk-frontend adds a responsive bottom margin by default for each component
4
4
  // we reset it to zero so we can set it separately using `gem-c-button--bottom-margin`
@@ -33,7 +33,7 @@
33
33
  display: block;
34
34
  max-width: 14em;
35
35
  margin-top: .5em;
36
- @include govuk-text-colour;
36
+ color: govuk-functional-colour(text);
37
37
  @include govuk-font($size: 16);
38
38
  }
39
39
 
@@ -1 +1 @@
1
- @import "govuk/components/character-count/character-count";
1
+ @import "govuk/components/character-count";
@@ -1,4 +1,4 @@
1
- @import "govuk/components/checkboxes/checkboxes";
1
+ @import "govuk/components/checkboxes";
2
2
 
3
3
  .govuk-checkboxes--nested {
4
4
  width: 100%;
@@ -9,7 +9,7 @@
9
9
 
10
10
  .gem-c-contents-list__title {
11
11
  margin: 0;
12
- @include govuk-text-colour;
12
+ color: govuk-functional-colour(text);
13
13
  @include govuk-font($size: 16, $weight: regular, $line-height: 1.5);
14
14
  }
15
15
 
@@ -18,7 +18,7 @@
18
18
  margin: 0;
19
19
  padding: 0;
20
20
  list-style-type: none;
21
- @include govuk-text-colour;
21
+ color: govuk-functional-colour(text);
22
22
  @include govuk-font($size: 16);
23
23
  }
24
24
 
@@ -1,4 +1,4 @@
1
- @import "govuk/components/cookie-banner/cookie-banner";
1
+ @import "govuk/components/cookie-banner";
2
2
 
3
3
  .gem-c-cookie-banner {
4
4
  [hidden],
@@ -1,4 +1,4 @@
1
- @import "govuk/components/date-input/date-input";
1
+ @import "govuk/components/date-input";
2
2
 
3
3
  // Add spacing between input items on narrow containers when they collapse under each other
4
4
  .govuk-date-input {
@@ -1,4 +1,4 @@
1
- @import "govuk/components/details/details";
1
+ @import "govuk/components/details";
2
2
 
3
3
  [dir="rtl"] .gem-c-details,
4
4
  .direction-rtl .gem-c-details,
@@ -1,7 +1,7 @@
1
1
  .gem-c-document-list {
2
2
  margin: 0;
3
3
  padding: 0;
4
- @include govuk-text-colour;
4
+ color: govuk-functional-colour(text);
5
5
  @include govuk-font(19);
6
6
  }
7
7
 
@@ -55,7 +55,7 @@
55
55
 
56
56
  .gem-c-document-list__item-description {
57
57
  margin: govuk-spacing(1) 0;
58
- @include govuk-text-colour;
58
+ color: govuk-functional-colour(text);
59
59
  }
60
60
 
61
61
  .gem-c-document-list__subtext {
@@ -79,7 +79,7 @@
79
79
  display: inline-block;
80
80
  list-style: none;
81
81
  padding-right: govuk-spacing(4);
82
- @include govuk-text-colour;
82
+ color: govuk-functional-colour(text);
83
83
  @include govuk-font(16);
84
84
 
85
85
  & { // stylelint-disable-line no-duplicate-selectors, block-no-redundant-nested-style-rules
@@ -160,7 +160,7 @@
160
160
  .gem-c-document-list-child__description {
161
161
  margin-top: govuk-spacing(1);
162
162
  margin-bottom: govuk-spacing(1);
163
- @include govuk-text-colour;
163
+ color: govuk-functional-colour(text);
164
164
 
165
165
  @include govuk-media-query($until: tablet) {
166
166
  display: none;
@@ -1 +1 @@
1
- @import "govuk/components/error-message/error-message";
1
+ @import "govuk/components/error-message";
@@ -1,4 +1,4 @@
1
- @import "govuk/components/error-summary/error-summary";
1
+ @import "govuk/components/error-summary";
2
2
 
3
3
  .gem-c-error-summary__list-item {
4
4
  color: govuk-functional-colour(error);
@@ -176,13 +176,13 @@ $feedback-prompt-border-top-colour: $govuk-blue-tint-50;
176
176
  // this comes from the backend so we can't put a class on it
177
177
  h2 {
178
178
  margin: 0 0 govuk-spacing(3);
179
- @include govuk-text-colour;
179
+ color: govuk-functional-colour(text);
180
180
  @include govuk-font($size: 24, $weight: bold);
181
181
  }
182
182
 
183
183
  p {
184
184
  margin: 0 0 govuk-spacing(3);
185
- @include govuk-text-colour;
185
+ color: govuk-functional-colour(text);
186
186
  @include govuk-font($size: 19);
187
187
  }
188
188
 
@@ -211,13 +211,13 @@ $feedback-prompt-border-top-colour: $govuk-blue-tint-50;
211
211
 
212
212
  .gem-c-feedback__form-heading {
213
213
  margin: 0 0 govuk-spacing(3);
214
- @include govuk-text-colour;
214
+ color: govuk-functional-colour(text);
215
215
  @include govuk-font(24, $weight: bold);
216
216
  }
217
217
 
218
218
  .gem-c-feedback__form-paragraph {
219
219
  margin: 0 0 govuk-spacing(6);
220
- @include govuk-text-colour;
220
+ color: govuk-functional-colour(text);
221
221
  @include govuk-font(19);
222
222
  }
223
223
 
@@ -1 +1 @@
1
- @import "govuk/components/fieldset/fieldset";
1
+ @import "govuk/components/fieldset";
@@ -1 +1 @@
1
- @import "govuk/components/file-upload/file-upload";
1
+ @import "govuk/components/file-upload";
@@ -1 +1 @@
1
- @import "govuk/components/hint/hint";
1
+ @import "govuk/components/hint";
@@ -8,7 +8,7 @@
8
8
  gap: govuk-spacing(2);
9
9
  justify-content: space-between;
10
10
  align-items: stretch;
11
- @include govuk-text-colour;
11
+ color: govuk-functional-colour(text);
12
12
 
13
13
  @include govuk-media-query($until: tablet) {
14
14
  gap: govuk-spacing(3);
@@ -1,4 +1,4 @@
1
- @import "govuk/components/input/input";
1
+ @import "govuk/components/input";
2
2
 
3
3
  $search-icon-size: 40px;
4
4