govuk_publishing_components 67.1.0 → 68.1.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 (355) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/govuk_publishing_components_manifest.js +1 -1
  3. data/app/assets/javascripts/govuk_publishing_components/lib/filter-list.js +29 -4
  4. data/app/assets/stylesheets/component_guide/application.scss +12 -18
  5. data/app/assets/stylesheets/govuk_publishing_components/all-components.scss +2 -0
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +6 -2
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_app-promo-banner.scss +3 -3
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_attachment-link.scss +1 -1
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +5 -5
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +1 -1
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +2 -2
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_cards.scss +6 -6
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_checkboxes.scss +1 -1
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list-with-body.scss +1 -1
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-guidance.scss +2 -2
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +4 -4
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_cross-service-header.scss +14 -14
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_devolved-nations.scss +3 -3
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +6 -6
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_emergency-banner.scss +3 -6
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +3 -3
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_error-summary.scss +1 -1
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +7 -7
  24. data/app/assets/stylesheets/govuk_publishing_components/components/_figure.scss +1 -1
  25. data/app/assets/stylesheets/govuk_publishing_components/components/_glance-metric.scss +3 -3
  26. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak-html-publication.scss +3 -3
  27. data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +3 -3
  28. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +3 -3
  29. data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +3 -3
  30. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +2 -2
  31. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +1 -1
  32. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss +1 -1
  33. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +30 -51
  34. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +23 -23
  35. data/app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss +1 -1
  36. data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +2 -2
  37. data/app/assets/stylesheets/govuk_publishing_components/components/_modal-dialogue.scss +3 -3
  38. data/app/assets/stylesheets/govuk_publishing_components/components/_option-select.scss +3 -3
  39. data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +2 -2
  40. data/app/assets/stylesheets/govuk_publishing_components/components/_pagination.scss +1 -1
  41. data/app/assets/stylesheets/govuk_publishing_components/components/_phase-banner.scss +3 -3
  42. data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +6 -6
  43. data/app/assets/stylesheets/govuk_publishing_components/components/_published-dates.scss +1 -1
  44. data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +1 -1
  45. data/app/assets/stylesheets/govuk_publishing_components/components/_reorderable-list.scss +3 -3
  46. data/app/assets/stylesheets/govuk_publishing_components/components/_search-with-autocomplete.scss +7 -7
  47. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +8 -8
  48. data/app/assets/stylesheets/govuk_publishing_components/components/_secondary-navigation.scss +6 -6
  49. data/app/assets/stylesheets/govuk_publishing_components/components/_select-with-search.scss +15 -15
  50. data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +2 -2
  51. data/app/assets/stylesheets/govuk_publishing_components/components/_signup-link.scss +2 -2
  52. data/app/assets/stylesheets/govuk_publishing_components/components/_single-page-notification-button.scss +6 -6
  53. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +2 -2
  54. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +1 -1
  55. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +11 -11
  56. data/app/assets/stylesheets/govuk_publishing_components/components/_sub-navigation-menu.scss +9 -9
  57. data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +5 -5
  58. data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +3 -3
  59. data/app/assets/stylesheets/govuk_publishing_components/components/_summary-banner.scss +1 -1
  60. data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +15 -10
  61. data/app/assets/stylesheets/govuk_publishing_components/components/_tag.scss +1 -1
  62. data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +3 -3
  63. data/app/assets/stylesheets/govuk_publishing_components/components/_warning-text.scss +3 -3
  64. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +4 -4
  65. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_call-to-action.scss +2 -2
  66. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +1 -1
  67. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_example.scss +1 -1
  68. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +4 -4
  69. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +1 -1
  70. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_images.scss +1 -1
  71. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_information-callout.scss +1 -1
  72. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_media-player.scss +2 -2
  73. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +1 -1
  74. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +2 -2
  75. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +2 -2
  76. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +1 -1
  77. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +8 -0
  78. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_colours.scss +9 -11
  79. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +3 -3
  80. data/app/assets/stylesheets/govuk_publishing_components/lib/_link.scss +3 -3
  81. data/app/assets/stylesheets/govuk_publishing_components/lib/_print_support.scss +2 -2
  82. data/app/assets/stylesheets/govuk_publishing_components/settings/_custom-properties.scss +9 -0
  83. data/app/assets/stylesheets/govuk_publishing_components/settings/_index.scss +1 -2
  84. data/app/assets/stylesheets/govuk_publishing_components/specific-components.scss +2 -0
  85. data/app/views/govuk_publishing_components/components/_glance_metric.html.erb +1 -1
  86. data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +1 -1
  87. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +1 -1
  88. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +14 -36
  89. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +1 -1
  90. data/app/views/govuk_publishing_components/components/_tag.html.erb +1 -1
  91. data/app/views/govuk_publishing_components/components/docs/layout_header.yml +0 -15
  92. data/app/views/govuk_publishing_components/components/docs/tag.yml +4 -8
  93. data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +4 -13
  94. data/app/views/layouts/govuk_publishing_components/application.html.erb +1 -1
  95. data/config/initializers/assets.rb +1 -1
  96. data/lib/govuk_publishing_components/version.rb +1 -1
  97. data/node_modules/axe-core/README.md +10 -7
  98. data/node_modules/axe-core/axe.d.ts +4 -15
  99. data/node_modules/axe-core/axe.js +4011 -3559
  100. data/node_modules/axe-core/axe.min.js +2 -2
  101. data/node_modules/axe-core/gather-internals.js +1 -1
  102. data/node_modules/axe-core/locales/README.md +2 -2
  103. data/node_modules/axe-core/locales/_template.json +15 -5
  104. data/node_modules/axe-core/locales/sv.json +1147 -0
  105. data/node_modules/axe-core/package.json +65 -73
  106. data/node_modules/axe-core/sri-history.json +4 -0
  107. data/node_modules/govuk-frontend/README.md +1 -1
  108. data/node_modules/govuk-frontend/dist/govuk/_base.scss +1 -0
  109. data/node_modules/govuk-frontend/dist/govuk/_base.scss.map +1 -1
  110. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +21 -95
  111. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -1
  112. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +22 -95
  113. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -1
  114. data/node_modules/govuk-frontend/dist/govuk/all.mjs +0 -1
  115. data/node_modules/govuk-frontend/dist/govuk/all.mjs.map +1 -1
  116. data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.ico +0 -0
  117. data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.svg +1 -1
  118. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-180.png +0 -0
  119. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-192.png +0 -0
  120. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-512.png +0 -0
  121. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-opengraph-image.png +0 -0
  122. data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
  123. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +14 -11
  124. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss.map +1 -1
  125. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js.map +1 -1
  126. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs.map +1 -1
  127. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss +2 -2
  128. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss.map +1 -1
  129. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss +1 -1
  130. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss.map +1 -1
  131. data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss +16 -19
  132. data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss.map +1 -1
  133. data/node_modules/govuk-frontend/dist/govuk/components/button/fixtures.json +7 -95
  134. data/node_modules/govuk-frontend/dist/govuk/components/button/macro-options.json +12 -19
  135. data/node_modules/govuk-frontend/dist/govuk/components/button/template.njk +8 -20
  136. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +2 -2
  137. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss.map +1 -1
  138. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +19 -9
  139. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js.map +1 -1
  140. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +19 -9
  141. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs.map +1 -1
  142. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +19 -9
  143. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs.map +1 -1
  144. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss +7 -6
  145. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss.map +1 -1
  146. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss +2 -5
  147. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss.map +1 -1
  148. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/fixtures.json +4 -40
  149. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-default.html +2 -2
  150. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-with-html.html +2 -2
  151. data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss +6 -4
  152. data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss.map +1 -1
  153. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss +1 -1
  154. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss.map +1 -1
  155. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss +4 -2
  156. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss.map +1 -1
  157. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js.map +1 -1
  158. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs.map +1 -1
  159. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +28 -37
  160. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss.map +1 -1
  161. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js.map +1 -1
  162. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs.map +1 -1
  163. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/fixtures.json +1 -1
  164. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/macro-options.json +0 -7
  165. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template.njk +0 -1
  166. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +18 -23
  167. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss.map +1 -1
  168. data/node_modules/govuk-frontend/dist/govuk/components/footer/fixtures.json +25 -38
  169. data/node_modules/govuk-frontend/dist/govuk/components/footer/macro-options.json +0 -6
  170. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-default.html +23 -2
  171. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-full-gds-example.html +23 -2
  172. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-three-equal-columns.html +23 -2
  173. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-html-content-licence-and-copyright-notice.html +23 -2
  174. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-meta.html +23 -2
  175. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-text-content-licence-and-copyright-notice.html +23 -2
  176. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-one-column.html +23 -2
  177. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-two-columns.html +23 -2
  178. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-meta-links-and-meta-content.html +23 -2
  179. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-navigation.html +23 -2
  180. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-no-content-licence.html +23 -2
  181. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-only-custom-meta.html +23 -2
  182. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-only-meta-links.html +23 -2
  183. data/node_modules/govuk-frontend/dist/govuk/components/footer/template.njk +6 -11
  184. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +85 -457
  185. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +1 -1
  186. data/node_modules/govuk-frontend/dist/govuk/components/header/fixtures.json +7 -536
  187. data/node_modules/govuk-frontend/dist/govuk/components/header/macro-options.json +2 -101
  188. data/node_modules/govuk-frontend/dist/govuk/components/header/template-default.html +7 -6
  189. data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width.html +7 -6
  190. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-product-name.html +7 -6
  191. data/node_modules/govuk-frontend/dist/govuk/components/header/template.njk +4 -50
  192. data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss +1 -1
  193. data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss.map +1 -1
  194. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +7 -5
  195. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss.map +1 -1
  196. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss +2 -1
  197. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss.map +1 -1
  198. data/node_modules/govuk-frontend/dist/govuk/components/label/fixtures.json +2 -2
  199. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +8 -6
  200. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss.map +1 -1
  201. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +9 -10
  202. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss.map +1 -1
  203. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +2 -2
  204. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss.map +1 -1
  205. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js.map +1 -1
  206. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs.map +1 -1
  207. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +12 -6
  208. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss.map +1 -1
  209. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/fixtures.json +7 -7
  210. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/template-default.html +1 -1
  211. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/template.njk +1 -1
  212. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +7 -6
  213. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss.map +1 -1
  214. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +5 -4
  215. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss.map +1 -1
  216. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +50 -71
  217. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss.map +1 -1
  218. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/fixtures.json +7 -32
  219. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +3 -2
  220. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss.map +1 -1
  221. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +9 -5
  222. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss.map +1 -1
  223. data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss +7 -8
  224. data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss.map +1 -1
  225. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss +8 -5
  226. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss.map +1 -1
  227. data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss +66 -31
  228. data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss.map +1 -1
  229. data/node_modules/govuk-frontend/dist/govuk/components/tag/fixtures.json +6 -18
  230. data/node_modules/govuk-frontend/dist/govuk/components/tag/template-pink.html +2 -2
  231. data/node_modules/govuk-frontend/dist/govuk/components/tag/template-turquoise.html +2 -2
  232. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss +7 -5
  233. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss.map +1 -1
  234. data/node_modules/govuk-frontend/dist/govuk/components/task-list/fixtures.json +13 -25
  235. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-with-all-possible-colours.html +12 -24
  236. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-with-hint-text-and-additional-states.html +2 -2
  237. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +4 -3
  238. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss.map +1 -1
  239. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +4 -3
  240. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss.map +1 -1
  241. data/node_modules/govuk-frontend/dist/govuk/core/_index.scss +0 -1
  242. data/node_modules/govuk-frontend/dist/govuk/core/_index.scss.map +1 -1
  243. data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss +2 -1
  244. data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss.map +1 -1
  245. data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss +3 -17
  246. data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss.map +1 -1
  247. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_breakpoints.scss +17 -0
  248. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_breakpoints.scss.map +1 -0
  249. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.scss +15 -0
  250. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.scss.map +1 -0
  251. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.scss +17 -0
  252. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.scss.map +1 -0
  253. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_index.scss +5 -0
  254. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_index.scss.map +1 -0
  255. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
  256. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
  257. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
  258. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -1
  259. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +168 -82
  260. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss.map +1 -1
  261. data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +8 -7
  262. data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss.map +1 -1
  263. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +23 -39
  264. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss.map +1 -1
  265. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +2 -26
  266. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss.map +1 -1
  267. data/node_modules/govuk-frontend/dist/govuk/i18n.mjs.map +1 -1
  268. data/node_modules/govuk-frontend/dist/govuk/init.mjs +1 -2
  269. data/node_modules/govuk-frontend/dist/govuk/init.mjs.map +1 -1
  270. data/node_modules/govuk-frontend/dist/govuk/macros/logo.njk +4 -26
  271. data/node_modules/govuk-frontend/dist/govuk/objects/_form-group.scss +2 -1
  272. data/node_modules/govuk-frontend/dist/govuk/objects/_form-group.scss.map +1 -1
  273. data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss +2 -6
  274. data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss.map +1 -1
  275. data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss +0 -2
  276. data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss.map +1 -1
  277. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss +3 -188
  278. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss.map +1 -1
  279. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.scss +366 -0
  280. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.scss.map +1 -0
  281. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +8 -254
  282. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss.map +1 -1
  283. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-palette.scss +117 -25
  284. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-palette.scss.map +1 -1
  285. data/node_modules/govuk-frontend/dist/govuk/settings/_custom-properties.scss +18 -0
  286. data/node_modules/govuk-frontend/dist/govuk/settings/_custom-properties.scss.map +1 -0
  287. data/node_modules/govuk-frontend/dist/govuk/settings/_index.scss +3 -14
  288. data/node_modules/govuk-frontend/dist/govuk/settings/_index.scss.map +1 -1
  289. data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss +0 -16
  290. data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss.map +1 -1
  291. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss +12 -189
  292. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss.map +1 -1
  293. data/node_modules/govuk-frontend/dist/govuk/template.njk +61 -23
  294. data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss +0 -1
  295. data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss.map +1 -1
  296. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss +2 -0
  297. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss.map +1 -1
  298. data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +1 -4
  299. data/node_modules/govuk-frontend/package.json +13 -12
  300. metadata +15 -56
  301. data/app/assets/javascripts/govuk_publishing_components/components/layout-header.js +0 -3
  302. data/app/assets/stylesheets/govuk_publishing_components/settings/_colours.scss +0 -5
  303. data/app/assets/stylesheets/govuk_publishing_components/settings/_typography.scss +0 -1
  304. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +0 -34
  305. data/node_modules/govuk-frontend/dist/govuk/all.scss +0 -9
  306. data/node_modules/govuk-frontend/dist/govuk/all.scss.map +0 -1
  307. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.ico +0 -0
  308. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.svg +0 -1
  309. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-crest.svg +0 -1
  310. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-180.png +0 -0
  311. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-192.png +0 -0
  312. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-512.png +0 -0
  313. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-mask.svg +0 -1
  314. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-opengraph-image.png +0 -0
  315. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/manifest.json +0 -39
  316. data/node_modules/govuk-frontend/dist/govuk/components/_all.scss +0 -10
  317. data/node_modules/govuk-frontend/dist/govuk/components/_all.scss.map +0 -1
  318. data/node_modules/govuk-frontend/dist/govuk/components/button/template-input.html +0 -1
  319. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +0 -238
  320. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js.map +0 -1
  321. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +0 -230
  322. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs.map +0 -1
  323. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs +0 -89
  324. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs.map +0 -1
  325. data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width-with-navigation.html +0 -54
  326. data/node_modules/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-html.html +0 -54
  327. data/node_modules/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-text-without-link.html +0 -48
  328. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-text.html +0 -59
  329. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-full-width-border.html +0 -29
  330. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-large-navigation.html +0 -119
  331. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-navigation.html +0 -59
  332. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name-and-navigation.html +0 -62
  333. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name-but-no-service-url.html +0 -34
  334. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name.html +0 -34
  335. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-st-edwards-crown.html +0 -19
  336. data/node_modules/govuk-frontend/dist/govuk/components/tag/template-light-blue.html +0 -3
  337. data/node_modules/govuk-frontend/dist/govuk/core/_all.scss +0 -10
  338. data/node_modules/govuk-frontend/dist/govuk/core/_all.scss.map +0 -1
  339. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +0 -15
  340. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss.map +0 -1
  341. data/node_modules/govuk-frontend/dist/govuk/helpers/_all.scss +0 -10
  342. data/node_modules/govuk-frontend/dist/govuk/helpers/_all.scss.map +0 -1
  343. data/node_modules/govuk-frontend/dist/govuk/objects/_all.scss +0 -10
  344. data/node_modules/govuk-frontend/dist/govuk/objects/_all.scss.map +0 -1
  345. data/node_modules/govuk-frontend/dist/govuk/overrides/_all.scss +0 -9
  346. data/node_modules/govuk-frontend/dist/govuk/overrides/_all.scss.map +0 -1
  347. data/node_modules/govuk-frontend/dist/govuk/settings/_all.scss +0 -10
  348. data/node_modules/govuk-frontend/dist/govuk/settings/_all.scss.map +0 -1
  349. data/node_modules/govuk-frontend/dist/govuk/tools/_all.scss +0 -10
  350. data/node_modules/govuk-frontend/dist/govuk/tools/_all.scss.map +0 -1
  351. data/node_modules/govuk-frontend/dist/govuk/tools/_rebrand.scss +0 -65
  352. data/node_modules/govuk-frontend/dist/govuk/tools/_rebrand.scss.map +0 -1
  353. data/node_modules/govuk-frontend/dist/govuk/utilities/_all.scss +0 -10
  354. data/node_modules/govuk-frontend/dist/govuk/utilities/_all.scss.map +0 -1
  355. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/functions.js +0 -25
@@ -1 +1 @@
1
- {"version":3,"file":"character-count.mjs","sources":["../../../../src/govuk/components/character-count/character-count.mjs"],"sourcesContent":["import { closestAttributeValue } from '../../common/closest-attribute-value.mjs'\nimport {\n validateConfig,\n ConfigurableComponent,\n configOverride\n} from '../../common/configuration.mjs'\nimport { formatErrorMessage } from '../../common/index.mjs'\nimport { ConfigError, ElementError } from '../../errors/index.mjs'\nimport { I18n } from '../../i18n.mjs'\n\n/**\n * Character count component\n *\n * Tracks the number of characters or words in the `.govuk-js-character-count`\n * `<textarea>` inside the element. Displays a message with the remaining number\n * of characters/words available, or the number of characters/words in excess.\n *\n * You can configure the message to only appear after a certain percentage\n * of the available characters/words has been entered.\n *\n * @preserve\n * @augments ConfigurableComponent<CharacterCountConfig>\n */\nexport class CharacterCount extends ConfigurableComponent {\n /** @private */\n $textarea\n\n /** @private */\n $visibleCountMessage\n\n /** @private */\n $screenReaderCountMessage\n\n /**\n * @private\n * @type {number | null}\n */\n lastInputTimestamp = null\n\n /** @private */\n lastInputValue = ''\n\n /**\n * @private\n * @type {number | null}\n */\n valueChecker = null\n\n /** @private */\n i18n\n\n /** @private */\n maxLength;\n\n /**\n * Character count config override\n *\n * To ensure data-attributes take complete precedence, even if they change\n * the type of count, we need to reset the `maxlength` and `maxwords` from\n * the JavaScript config.\n *\n * @internal\n * @param {CharacterCountConfig} datasetConfig - configuration specified by dataset\n * @returns {CharacterCountConfig} - configuration to override by dataset\n */\n [configOverride](datasetConfig) {\n let configOverrides = {}\n if ('maxwords' in datasetConfig || 'maxlength' in datasetConfig) {\n configOverrides = {\n maxlength: undefined,\n maxwords: undefined\n }\n }\n\n return configOverrides\n }\n\n /**\n * @param {Element | null} $root - HTML element to use for character count\n * @param {CharacterCountConfig} [config] - Character count config\n */\n constructor($root, config = {}) {\n super($root, config)\n\n const $textarea = this.$root.querySelector('.govuk-js-character-count')\n if (\n !(\n $textarea instanceof HTMLTextAreaElement ||\n $textarea instanceof HTMLInputElement\n )\n ) {\n throw new ElementError({\n component: CharacterCount,\n element: $textarea,\n expectedType: 'HTMLTextareaElement or HTMLInputElement',\n identifier: 'Form field (`.govuk-js-character-count`)'\n })\n }\n\n // Check for valid config\n const errors = validateConfig(CharacterCount.schema, this.config)\n if (errors[0]) {\n throw new ConfigError(formatErrorMessage(CharacterCount, errors[0]))\n }\n\n this.i18n = new I18n(this.config.i18n, {\n // Read the fallback if necessary rather than have it set in the defaults\n locale: closestAttributeValue(this.$root, 'lang')\n })\n\n // Determine the limit attribute (characters or words)\n this.maxLength = this.config.maxwords ?? this.config.maxlength ?? Infinity\n\n this.$textarea = $textarea\n\n const textareaDescriptionId = `${this.$textarea.id}-info`\n const $textareaDescription = document.getElementById(textareaDescriptionId)\n if (!$textareaDescription) {\n throw new ElementError({\n component: CharacterCount,\n element: $textareaDescription,\n identifier: `Count message (\\`id=\"${textareaDescriptionId}\"\\`)`\n })\n }\n\n // Pre-existing validation error rendered from server\n this.$errorMessage = this.$root.querySelector('.govuk-error-message')\n\n // Inject a description for the textarea if none is present already\n // for when the component was rendered with no maxlength, maxwords\n // nor custom textareaDescriptionText\n // eslint-disable-next-line @typescript-eslint/prefer-regexp-exec\n if ($textareaDescription.textContent.match(/^\\s*$/)) {\n $textareaDescription.textContent = this.i18n.t('textareaDescription', {\n count: this.maxLength\n })\n }\n\n // Move the textarea description to be immediately after the textarea\n // Kept for backwards compatibility\n this.$textarea.insertAdjacentElement('afterend', $textareaDescription)\n\n // Create the *screen reader* specific live-updating counter\n // This doesn't need any styling classes, as it is never visible\n const $screenReaderCountMessage = document.createElement('div')\n $screenReaderCountMessage.className =\n 'govuk-character-count__sr-status govuk-visually-hidden'\n $screenReaderCountMessage.setAttribute('aria-live', 'polite')\n this.$screenReaderCountMessage = $screenReaderCountMessage\n $textareaDescription.insertAdjacentElement(\n 'afterend',\n $screenReaderCountMessage\n )\n\n // Create our live-updating counter element, copying the classes from the\n // textarea description for backwards compatibility as these may have been\n // configured\n const $visibleCountMessage = document.createElement('div')\n $visibleCountMessage.className = $textareaDescription.className\n $visibleCountMessage.classList.add('govuk-character-count__status')\n $visibleCountMessage.setAttribute('aria-hidden', 'true')\n this.$visibleCountMessage = $visibleCountMessage\n $textareaDescription.insertAdjacentElement('afterend', $visibleCountMessage)\n\n // Hide the textarea description\n $textareaDescription.classList.add('govuk-visually-hidden')\n\n // Remove hard limit if set\n this.$textarea.removeAttribute('maxlength')\n\n this.bindChangeEvents()\n\n // When the page is restored after navigating 'back' in some browsers the\n // state of form controls is not restored until *after* the DOMContentLoaded\n // event is fired, so we need to sync after the pageshow event.\n window.addEventListener('pageshow', () => this.updateCountMessage())\n\n // Although we've set up handlers to sync state on the pageshow event, init\n // could be called after those events have fired, for example if they are\n // added to the page dynamically, so update now too.\n this.updateCountMessage()\n }\n\n /**\n * Bind change events\n *\n * Set up event listeners on the $textarea so that the count messages update\n * when the user types.\n *\n * @private\n */\n bindChangeEvents() {\n this.$textarea.addEventListener('keyup', () => this.handleKeyUp())\n\n // Bind focus/blur events to start/stop polling\n this.$textarea.addEventListener('focus', () => this.handleFocus())\n this.$textarea.addEventListener('blur', () => this.handleBlur())\n }\n\n /**\n * Handle key up event\n *\n * Update the visible character counter and keep track of when the last update\n * happened for each keypress\n *\n * @private\n */\n handleKeyUp() {\n this.updateVisibleCountMessage()\n this.lastInputTimestamp = Date.now()\n }\n\n /**\n * Handle focus event\n *\n * Speech recognition software such as Dragon NaturallySpeaking will modify\n * the fields by directly changing its `value`. These changes don't trigger\n * events in JavaScript, so we need to poll to handle when and if they occur.\n *\n * Once the keyup event hasn't been detected for at least 1000 ms (1s), check\n * if the textarea value has changed and update the count message if it has.\n *\n * This is so that the update triggered by the manual comparison doesn't\n * conflict with debounced KeyboardEvent updates.\n *\n * @private\n */\n handleFocus() {\n this.valueChecker = window.setInterval(() => {\n if (\n !this.lastInputTimestamp ||\n Date.now() - 500 >= this.lastInputTimestamp\n ) {\n this.updateIfValueChanged()\n }\n }, 1000)\n }\n\n /**\n * Handle blur event\n *\n * Stop checking the textarea value once the textarea no longer has focus\n *\n * @private\n */\n handleBlur() {\n // Cancel value checking on blur\n if (this.valueChecker) {\n window.clearInterval(this.valueChecker)\n }\n }\n\n /**\n * Update count message if textarea value has changed\n *\n * @private\n */\n updateIfValueChanged() {\n if (this.$textarea.value !== this.lastInputValue) {\n this.lastInputValue = this.$textarea.value\n this.updateCountMessage()\n }\n }\n\n /**\n * Update count message\n *\n * Helper function to update both the visible and screen reader-specific\n * counters simultaneously (e.g. on init)\n *\n * @private\n */\n updateCountMessage() {\n this.updateVisibleCountMessage()\n this.updateScreenReaderCountMessage()\n }\n\n /**\n * Update visible count message\n *\n * @private\n */\n updateVisibleCountMessage() {\n const remainingNumber = this.maxLength - this.count(this.$textarea.value)\n const isError = remainingNumber < 0\n\n // If input is over the threshold, remove the disabled class which renders\n // the counter invisible.\n this.$visibleCountMessage.classList.toggle(\n 'govuk-character-count__message--disabled',\n !this.isOverThreshold()\n )\n\n // Update styles\n if (!this.$errorMessage) {\n // Only toggle the textarea error class if there isn't an error message\n // already, as it may be unrelated to the limit (eg: allowed characters)\n // and would set the border colour back to black.\n this.$textarea.classList.toggle('govuk-textarea--error', isError)\n }\n this.$visibleCountMessage.classList.toggle('govuk-error-message', isError)\n this.$visibleCountMessage.classList.toggle('govuk-hint', !isError)\n\n // Update message\n this.$visibleCountMessage.textContent = this.getCountMessage()\n }\n\n /**\n * Update screen reader count message\n *\n * @private\n */\n updateScreenReaderCountMessage() {\n // If over the threshold, remove the aria-hidden attribute, allowing screen\n // readers to announce the content of the element.\n if (this.isOverThreshold()) {\n this.$screenReaderCountMessage.removeAttribute('aria-hidden')\n } else {\n this.$screenReaderCountMessage.setAttribute('aria-hidden', 'true')\n }\n\n // Update message\n this.$screenReaderCountMessage.textContent = this.getCountMessage()\n }\n\n /**\n * Count the number of characters (or words, if `config.maxwords` is set)\n * in the given text\n *\n * @private\n * @param {string} text - The text to count the characters of\n * @returns {number} the number of characters (or words) in the text\n */\n count(text) {\n if (this.config.maxwords) {\n const tokens = text.match(/\\S+/g) ?? [] // Matches consecutive non-whitespace chars\n return tokens.length\n }\n\n return text.length\n }\n\n /**\n * Get count message\n *\n * @private\n * @returns {string} Status message\n */\n getCountMessage() {\n const remainingNumber = this.maxLength - this.count(this.$textarea.value)\n const countType = this.config.maxwords ? 'words' : 'characters'\n return this.formatCountMessage(remainingNumber, countType)\n }\n\n /**\n * Formats the message shown to users according to what's counted\n * and how many remain\n *\n * @private\n * @param {number} remainingNumber - The number of words/characaters remaining\n * @param {string} countType - \"words\" or \"characters\"\n * @returns {string} Status message\n */\n formatCountMessage(remainingNumber, countType) {\n if (remainingNumber === 0) {\n return this.i18n.t(`${countType}AtLimit`)\n }\n\n const translationKeySuffix =\n remainingNumber < 0 ? 'OverLimit' : 'UnderLimit'\n\n return this.i18n.t(`${countType}${translationKeySuffix}`, {\n count: Math.abs(remainingNumber)\n })\n }\n\n /**\n * Check if count is over threshold\n *\n * Checks whether the value is over the configured threshold for the input.\n * If there is no configured threshold, it is set to 0 and this function will\n * always return true.\n *\n * @private\n * @returns {boolean} true if the current count is over the config.threshold\n * (or no threshold is set)\n */\n isOverThreshold() {\n // No threshold means we're always above threshold so save some computation\n if (!this.config.threshold) {\n return true\n }\n\n // Determine the remaining number of characters/words\n const currentLength = this.count(this.$textarea.value)\n const maxLength = this.maxLength\n\n const thresholdValue = (maxLength * this.config.threshold) / 100\n\n return thresholdValue <= currentLength\n }\n\n /**\n * Name for the component used when initialising using data-module attributes.\n */\n static moduleName = 'govuk-character-count'\n\n /**\n * Character count default config\n *\n * @see {@link CharacterCountConfig}\n * @constant\n * @type {CharacterCountConfig}\n */\n static defaults = Object.freeze({\n threshold: 0,\n i18n: {\n // Characters\n charactersUnderLimit: {\n one: 'You have %{count} character remaining',\n other: 'You have %{count} characters remaining'\n },\n charactersAtLimit: 'You have 0 characters remaining',\n charactersOverLimit: {\n one: 'You have %{count} character too many',\n other: 'You have %{count} characters too many'\n },\n // Words\n wordsUnderLimit: {\n one: 'You have %{count} word remaining',\n other: 'You have %{count} words remaining'\n },\n wordsAtLimit: 'You have 0 words remaining',\n wordsOverLimit: {\n one: 'You have %{count} word too many',\n other: 'You have %{count} words too many'\n },\n textareaDescription: {\n other: ''\n }\n }\n })\n\n /**\n * Character count config schema\n *\n * @constant\n * @satisfies {Schema<CharacterCountConfig>}\n */\n static schema = Object.freeze({\n properties: {\n i18n: { type: 'object' },\n maxwords: { type: 'number' },\n maxlength: { type: 'number' },\n threshold: { type: 'number' }\n },\n anyOf: [\n {\n required: ['maxwords'],\n errorMessage: 'Either \"maxlength\" or \"maxwords\" must be provided'\n },\n {\n required: ['maxlength'],\n errorMessage: 'Either \"maxlength\" or \"maxwords\" must be provided'\n }\n ]\n })\n}\n\n/**\n * Character count config\n *\n * @see {@link CharacterCount.defaults}\n * @typedef {object} CharacterCountConfig\n * @property {number} [maxlength] - The maximum number of characters.\n * If maxwords is provided, the maxlength option will be ignored.\n * @property {number} [maxwords] - The maximum number of words. If maxwords is\n * provided, the maxlength option will be ignored.\n * @property {number} [threshold=0] - The percentage value of the limit at\n * which point the count message is displayed. If this attribute is set, the\n * count message will be hidden by default.\n * @property {CharacterCountTranslations} [i18n=CharacterCount.defaults.i18n] - Character count translations\n */\n\n/**\n * Character count translations\n *\n * @see {@link CharacterCount.defaults.i18n}\n * @typedef {object} CharacterCountTranslations\n *\n * Messages shown to users as they type. It provides feedback on how many words\n * or characters they have remaining or if they are over the limit. This also\n * includes a message used as an accessible description for the textarea.\n * @property {TranslationPluralForms} [charactersUnderLimit] - Message displayed\n * when the number of characters is under the configured maximum, `maxlength`.\n * This message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining characters. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {string} [charactersAtLimit] - Message displayed when the number of\n * characters reaches the configured maximum, `maxlength`. This message is\n * displayed visually and through assistive technologies.\n * @property {TranslationPluralForms} [charactersOverLimit] - Message displayed\n * when the number of characters is over the configured maximum, `maxlength`.\n * This message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining characters. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {TranslationPluralForms} [wordsUnderLimit] - Message displayed when\n * the number of words is under the configured maximum, `maxlength`. This\n * message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining words. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {string} [wordsAtLimit] - Message displayed when the number of\n * words reaches the configured maximum, `maxlength`. This message is\n * displayed visually and through assistive technologies.\n * @property {TranslationPluralForms} [wordsOverLimit] - Message displayed when\n * the number of words is over the configured maximum, `maxlength`. This\n * message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining words. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {TranslationPluralForms} [textareaDescription] - Message made\n * available to assistive technologies, if none is already present in the\n * HTML, to describe that the component accepts only a limited amount of\n * content. It is visible on the page when JavaScript is unavailable. The\n * component will replace the `%{count}` placeholder with the value of the\n * `maxlength` or `maxwords` parameter.\n */\n\n/**\n * @import { Schema } from '../../common/configuration.mjs'\n * @import { TranslationPluralForms } from '../../i18n.mjs'\n */\n"],"names":["CharacterCount","ConfigurableComponent","configOverride","datasetConfig","configOverrides","maxlength","undefined","maxwords","constructor","$root","config","_ref","_this$config$maxwords","$textarea","$visibleCountMessage","$screenReaderCountMessage","lastInputTimestamp","lastInputValue","valueChecker","i18n","maxLength","querySelector","HTMLTextAreaElement","HTMLInputElement","ElementError","component","element","expectedType","identifier","errors","validateConfig","schema","ConfigError","formatErrorMessage","I18n","locale","closestAttributeValue","Infinity","textareaDescriptionId","id","$textareaDescription","document","getElementById","$errorMessage","textContent","match","t","count","insertAdjacentElement","createElement","className","setAttribute","classList","add","removeAttribute","bindChangeEvents","window","addEventListener","updateCountMessage","handleKeyUp","handleFocus","handleBlur","updateVisibleCountMessage","Date","now","setInterval","updateIfValueChanged","clearInterval","value","updateScreenReaderCountMessage","remainingNumber","isError","toggle","isOverThreshold","getCountMessage","text","_text$match","tokens","length","countType","formatCountMessage","translationKeySuffix","Math","abs","threshold","currentLength","thresholdValue","moduleName","defaults","Object","freeze","charactersUnderLimit","one","other","charactersAtLimit","charactersOverLimit","wordsUnderLimit","wordsAtLimit","wordsOverLimit","textareaDescription","properties","type","anyOf","required","errorMessage"],"mappings":";;;;;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,cAAc,SAASC,qBAAqB,CAAC;EA0CxD,CAACC,cAAc,CAAA,CAAEC,aAAa,EAAE;IAC9B,IAAIC,eAAe,GAAG,EAAE;AACxB,IAAA,IAAI,UAAU,IAAID,aAAa,IAAI,WAAW,IAAIA,aAAa,EAAE;AAC/DC,MAAAA,eAAe,GAAG;AAChBC,QAAAA,SAAS,EAAEC,SAAS;AACpBC,QAAAA,QAAQ,EAAED;OACX;AACH,IAAA;AAEA,IAAA,OAAOF,eAAe;AACxB,EAAA;;AAEA;AACF;AACA;AACA;AACEI,EAAAA,WAAWA,CAACC,KAAK,EAAEC,MAAM,GAAG,EAAE,EAAE;IAAA,IAAAC,IAAA,EAAAC,qBAAA;AAC9B,IAAA,KAAK,CAACH,KAAK,EAAEC,MAAM,CAAC;AAAA,IAAA,IAAA,CAzDtBG,SAAS,GAAA,MAAA;AAAA,IAAA,IAAA,CAGTC,oBAAoB,GAAA,MAAA;AAAA,IAAA,IAAA,CAGpBC,yBAAyB,GAAA,MAAA;IAAA,IAAA,CAMzBC,kBAAkB,GAAG,IAAI;IAAA,IAAA,CAGzBC,cAAc,GAAG,EAAE;IAAA,IAAA,CAMnBC,YAAY,GAAG,IAAI;AAAA,IAAA,IAAA,CAGnBC,IAAI,GAAA,MAAA;AAAA,IAAA,IAAA,CAGJC,SAAS,GAAA,MAAA;IAgCP,MAAMP,SAAS,GAAG,IAAI,CAACJ,KAAK,CAACY,aAAa,CAAC,2BAA2B,CAAC;IACvE,IACE,EACER,SAAS,YAAYS,mBAAmB,IACxCT,SAAS,YAAYU,gB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,4BAA4B;AAC1CC,IAAAA,cAAc,EAAE;AACdN,MAAAA,GAAG,EAAE,iCAAiC;AACtCC,MAAAA,KAAK,EAAE;KACR;AACDM,IAAAA,mBAAmB,EAAE;AACnBN,MAAAA,KAAK,EAAE;AACT;AACF;AACF,CAAC,CAAC;AAlaS7F,cAAc,CA0alB+B,MAAM,GAAG0D,MAAM,CAACC,MAAM,CAAC;AAC5BU,EAAAA,UAAU,EAAE;AACVjF,IAAAA,IAAI,EAAE;AAAEkF,MAAAA,IAAI,EAAE;KAAU;AACxB9F,IAAAA,QAAQ,EAAE;AAAE8F,MAAAA,IAAI,EAAE;KAAU;AAC5BhG,IAAAA,SAAS,EAAE;AAAEgG,MAAAA,IAAI,EAAE;KAAU;AAC7BjB,IAAAA,SAAS,EAAE;AAAEiB,MAAAA,IAAI,EAAE;AAAS;GAC7B;AACDC,EAAAA,KAAK,EAAE,CACL;IACEC,QAAQ,EAAE,CAAC,UAAU,CAAC;AACtBC,IAAAA,YAAY,EAAE;AAChB,GAAC,EACD;IACED,QAAQ,EAAE,CAAC,WAAW,CAAC;AACvBC,IAAAA,YAAY,EAAE;GACf;AAEL,CAAC,CAAC;;;;"}
1
+ {"version":3,"file":"character-count.mjs","sources":["../../../../src/govuk/components/character-count/character-count.mjs"],"sourcesContent":["import { closestAttributeValue } from '../../common/closest-attribute-value.mjs'\nimport {\n validateConfig,\n ConfigurableComponent,\n configOverride\n} from '../../common/configuration.mjs'\nimport { formatErrorMessage } from '../../common/index.mjs'\nimport { ConfigError, ElementError } from '../../errors/index.mjs'\nimport { I18n } from '../../i18n.mjs'\n\n/**\n * Character count component\n *\n * Tracks the number of characters or words in the `.govuk-js-character-count`\n * `<textarea>` inside the element. Displays a message with the remaining number\n * of characters/words available, or the number of characters/words in excess.\n *\n * You can configure the message to only appear after a certain percentage\n * of the available characters/words has been entered.\n *\n * @preserve\n * @augments ConfigurableComponent<CharacterCountConfig>\n */\nexport class CharacterCount extends ConfigurableComponent {\n /** @private */\n $textarea\n\n /** @private */\n count = 0\n\n /** @private */\n $visibleCountMessage\n\n /** @private */\n $screenReaderCountMessage\n\n /**\n * @private\n * @type {number | null}\n */\n lastInputTimestamp = null\n\n /** @private */\n lastInputValue = ''\n\n /**\n * @private\n * @type {number | null}\n */\n valueChecker = null\n\n /** @private */\n i18n\n\n /** @private */\n maxLength;\n\n /**\n * Character count config override\n *\n * To ensure data-attributes take complete precedence, even if they change\n * the type of count, we need to reset the `maxlength` and `maxwords` from\n * the JavaScript config.\n *\n * @internal\n * @param {CharacterCountConfig} datasetConfig - configuration specified by dataset\n * @returns {CharacterCountConfig} - configuration to override by dataset\n */\n [configOverride](datasetConfig) {\n let configOverrides = {}\n if ('maxwords' in datasetConfig || 'maxlength' in datasetConfig) {\n configOverrides = {\n maxlength: undefined,\n maxwords: undefined\n }\n }\n\n return configOverrides\n }\n\n /**\n * @param {Element | null} $root - HTML element to use for character count\n * @param {CharacterCountConfig} [config] - Character count config\n */\n constructor($root, config = {}) {\n super($root, config)\n\n const $textarea = this.$root.querySelector('.govuk-js-character-count')\n if (\n !(\n $textarea instanceof HTMLTextAreaElement ||\n $textarea instanceof HTMLInputElement\n )\n ) {\n throw new ElementError({\n component: CharacterCount,\n element: $textarea,\n expectedType: 'HTMLTextareaElement or HTMLInputElement',\n identifier: 'Form field (`.govuk-js-character-count`)'\n })\n }\n\n // Check for valid config\n const errors = validateConfig(CharacterCount.schema, this.config)\n if (errors[0]) {\n throw new ConfigError(formatErrorMessage(CharacterCount, errors[0]))\n }\n\n this.i18n = new I18n(this.config.i18n, {\n // Read the fallback if necessary rather than have it set in the defaults\n locale: closestAttributeValue(this.$root, 'lang')\n })\n\n // Determine the limit attribute (characters or words)\n this.maxLength = this.config.maxwords ?? this.config.maxlength ?? Infinity\n\n this.$textarea = $textarea\n\n const textareaDescriptionId = `${this.$textarea.id}-info`\n const $textareaDescription = document.getElementById(textareaDescriptionId)\n if (!$textareaDescription) {\n throw new ElementError({\n component: CharacterCount,\n element: $textareaDescription,\n identifier: `Count message (\\`id=\"${textareaDescriptionId}\"\\`)`\n })\n }\n\n // Pre-existing validation error rendered from server\n this.$errorMessage = this.$root.querySelector('.govuk-error-message')\n\n // Inject a description for the textarea if none is present already\n // for when the component was rendered with no maxlength, maxwords\n // nor custom textareaDescriptionText\n // eslint-disable-next-line @typescript-eslint/prefer-regexp-exec\n if ($textareaDescription.textContent.match(/^\\s*$/)) {\n $textareaDescription.textContent = this.i18n.t('textareaDescription', {\n count: this.maxLength\n })\n }\n\n // Move the textarea description to be immediately after the textarea\n // Kept for backwards compatibility\n this.$textarea.insertAdjacentElement('afterend', $textareaDescription)\n\n // Create the *screen reader* specific live-updating counter\n // This doesn't need any styling classes, as it is never visible\n const $screenReaderCountMessage = document.createElement('div')\n $screenReaderCountMessage.className =\n 'govuk-character-count__sr-status govuk-visually-hidden'\n $screenReaderCountMessage.setAttribute('aria-live', 'polite')\n this.$screenReaderCountMessage = $screenReaderCountMessage\n $textareaDescription.insertAdjacentElement(\n 'afterend',\n $screenReaderCountMessage\n )\n\n // Create our live-updating counter element, copying the classes from the\n // textarea description for backwards compatibility as these may have been\n // configured\n const $visibleCountMessage = document.createElement('div')\n $visibleCountMessage.className = $textareaDescription.className\n $visibleCountMessage.classList.add('govuk-character-count__status')\n $visibleCountMessage.setAttribute('aria-hidden', 'true')\n this.$visibleCountMessage = $visibleCountMessage\n $textareaDescription.insertAdjacentElement('afterend', $visibleCountMessage)\n\n // Hide the textarea description\n $textareaDescription.classList.add('govuk-visually-hidden')\n\n // Remove hard limit if set\n this.$textarea.removeAttribute('maxlength')\n\n this.bindChangeEvents()\n\n // When the page is restored after navigating 'back' in some browsers the\n // state of form controls is not restored until *after* the DOMContentLoaded\n // event is fired, so we need to sync after the pageshow event.\n window.addEventListener('pageshow', () => {\n // If the current value of the textarea is the same as what's\n // in the HTML, don't re-run when users have not edited the field yet\n // (new page load or BF cache navigation without having edited).\n if (this.$textarea.value !== this.$textarea.textContent) {\n this.updateCount()\n this.updateCountMessage()\n }\n })\n\n // Although we've set up handlers to sync state on the pageshow event, init\n // could be called after those events have fired, for example if they are\n // added to the page dynamically, so update now too.\n this.updateCount()\n this.updateCountMessage()\n }\n\n /**\n * Bind change events\n *\n * Set up event listeners on the $textarea so that the count messages update\n * when the user types.\n *\n * @private\n */\n bindChangeEvents() {\n this.$textarea.addEventListener('input', () => this.handleInput())\n\n // Bind focus/blur events to start/stop polling\n this.$textarea.addEventListener('focus', () => this.handleFocus())\n this.$textarea.addEventListener('blur', () => this.handleBlur())\n }\n\n /**\n * Handle input event\n *\n * Update the visible character counter and keep track of when the last update\n * happened for each keypress\n *\n * @private\n */\n handleInput() {\n this.updateCount()\n this.updateVisibleCountMessage()\n this.lastInputTimestamp = Date.now()\n }\n\n /**\n * Handle focus event\n *\n * Speech recognition software such as Dragon NaturallySpeaking will modify\n * the fields by directly changing its `value`. These changes don't trigger\n * events in JavaScript, so we need to poll to handle when and if they occur.\n *\n * Once the keyup event hasn't been detected for at least 1000 ms (1s), check\n * if the textarea value has changed and update the count message if it has.\n *\n * This is so that the update triggered by the manual comparison doesn't\n * conflict with debounced KeyboardEvent updates.\n *\n * @private\n */\n handleFocus() {\n this.valueChecker = window.setInterval(() => {\n if (\n !this.lastInputTimestamp ||\n Date.now() - 500 >= this.lastInputTimestamp\n ) {\n this.updateIfValueChanged()\n }\n }, 1000)\n }\n\n /**\n * Handle blur event\n *\n * Stop checking the textarea value once the textarea no longer has focus\n *\n * @private\n */\n handleBlur() {\n // Cancel value checking on blur\n if (this.valueChecker) {\n window.clearInterval(this.valueChecker)\n }\n }\n\n /**\n * Update count message if textarea value has changed\n *\n * @private\n */\n updateIfValueChanged() {\n if (this.$textarea.value !== this.lastInputValue) {\n this.lastInputValue = this.$textarea.value\n this.updateCountMessage()\n }\n }\n\n /**\n * Update count message\n *\n * Helper function to update both the visible and screen reader-specific\n * counters simultaneously (e.g. on init)\n *\n * @private\n */\n updateCountMessage() {\n this.updateVisibleCountMessage()\n this.updateScreenReaderCountMessage()\n }\n\n /**\n * Update visible count message\n *\n * @private\n */\n updateVisibleCountMessage() {\n const remainingNumber = this.maxLength - this.count\n const isError = remainingNumber < 0\n\n // If input is over the threshold, remove the disabled class which renders\n // the counter invisible.\n this.$visibleCountMessage.classList.toggle(\n 'govuk-character-count__message--disabled',\n !this.isOverThreshold()\n )\n\n // Update styles\n if (!this.$errorMessage) {\n // Only toggle the textarea error class if there isn't an error message\n // already, as it may be unrelated to the limit (eg: allowed characters)\n // and would set the border colour back to black.\n this.$textarea.classList.toggle('govuk-textarea--error', isError)\n }\n this.$visibleCountMessage.classList.toggle('govuk-error-message', isError)\n this.$visibleCountMessage.classList.toggle('govuk-hint', !isError)\n\n // Update message\n this.$visibleCountMessage.textContent = this.getCountMessage()\n }\n\n /**\n * Update screen reader count message\n *\n * @private\n */\n updateScreenReaderCountMessage() {\n // If over the threshold, remove the aria-hidden attribute, allowing screen\n // readers to announce the content of the element.\n if (this.isOverThreshold()) {\n this.$screenReaderCountMessage.removeAttribute('aria-hidden')\n } else {\n this.$screenReaderCountMessage.setAttribute('aria-hidden', 'true')\n }\n\n // Update message\n this.$screenReaderCountMessage.textContent = this.getCountMessage()\n }\n\n /**\n * Count the number of characters (or words, if `config.maxwords` is set)\n * in the given text, and update the component-wide count\n *\n * @private\n */\n updateCount() {\n const text = this.$textarea.value\n\n if (this.config.maxwords) {\n const tokens = text.match(/\\S+/g) ?? [] // Matches consecutive non-whitespace chars\n this.count = tokens.length\n return\n }\n\n this.count = text.length\n }\n\n /**\n * Get count message\n *\n * @private\n * @returns {string} Status message\n */\n getCountMessage() {\n const remainingNumber = this.maxLength - this.count\n const countType = this.config.maxwords ? 'words' : 'characters'\n return this.formatCountMessage(remainingNumber, countType)\n }\n\n /**\n * Formats the message shown to users according to what's counted\n * and how many remain\n *\n * @private\n * @param {number} remainingNumber - The number of words/characaters remaining\n * @param {string} countType - \"words\" or \"characters\"\n * @returns {string} Status message\n */\n formatCountMessage(remainingNumber, countType) {\n if (remainingNumber === 0) {\n return this.i18n.t(`${countType}AtLimit`)\n }\n\n const translationKeySuffix =\n remainingNumber < 0 ? 'OverLimit' : 'UnderLimit'\n\n return this.i18n.t(`${countType}${translationKeySuffix}`, {\n count: Math.abs(remainingNumber)\n })\n }\n\n /**\n * Check if count is over threshold\n *\n * Checks whether the value is over the configured threshold for the input.\n * If there is no configured threshold, it is set to 0 and this function will\n * always return true.\n *\n * @private\n * @returns {boolean} true if the current count is over the config.threshold\n * (or no threshold is set)\n */\n isOverThreshold() {\n // No threshold means we're always above threshold so save some computation\n if (!this.config.threshold) {\n return true\n }\n\n // Determine the remaining number of characters/words\n const currentLength = this.count\n const maxLength = this.maxLength\n\n const thresholdValue = (maxLength * this.config.threshold) / 100\n\n return thresholdValue <= currentLength\n }\n\n /**\n * Name for the component used when initialising using data-module attributes.\n */\n static moduleName = 'govuk-character-count'\n\n /**\n * Character count default config\n *\n * @see {@link CharacterCountConfig}\n * @constant\n * @type {CharacterCountConfig}\n */\n static defaults = Object.freeze({\n threshold: 0,\n i18n: {\n // Characters\n charactersUnderLimit: {\n one: 'You have %{count} character remaining',\n other: 'You have %{count} characters remaining'\n },\n charactersAtLimit: 'You have 0 characters remaining',\n charactersOverLimit: {\n one: 'You have %{count} character too many',\n other: 'You have %{count} characters too many'\n },\n // Words\n wordsUnderLimit: {\n one: 'You have %{count} word remaining',\n other: 'You have %{count} words remaining'\n },\n wordsAtLimit: 'You have 0 words remaining',\n wordsOverLimit: {\n one: 'You have %{count} word too many',\n other: 'You have %{count} words too many'\n },\n textareaDescription: {\n other: ''\n }\n }\n })\n\n /**\n * Character count config schema\n *\n * @constant\n * @satisfies {Schema<CharacterCountConfig>}\n */\n static schema = Object.freeze({\n properties: {\n i18n: { type: 'object' },\n maxwords: { type: 'number' },\n maxlength: { type: 'number' },\n threshold: { type: 'number' }\n },\n anyOf: [\n {\n required: ['maxwords'],\n errorMessage: 'Either \"maxlength\" or \"maxwords\" must be provided'\n },\n {\n required: ['maxlength'],\n errorMessage: 'Either \"maxlength\" or \"maxwords\" must be provided'\n }\n ]\n })\n}\n\n/**\n * Character count config\n *\n * @see {@link CharacterCount.defaults}\n * @typedef {object} CharacterCountConfig\n * @property {number} [maxlength] - The maximum number of characters.\n * If maxwords is provided, the maxlength option will be ignored.\n * @property {number} [maxwords] - The maximum number of words. If maxwords is\n * provided, the maxlength option will be ignored.\n * @property {number} [threshold=0] - The percentage value of the limit at\n * which point the count message is displayed. If this attribute is set, the\n * count message will be hidden by default.\n * @property {CharacterCountTranslations} [i18n=CharacterCount.defaults.i18n] - Character count translations\n */\n\n/**\n * Character count translations\n *\n * @see {@link CharacterCount.defaults.i18n}\n * @typedef {object} CharacterCountTranslations\n *\n * Messages shown to users as they type. It provides feedback on how many words\n * or characters they have remaining or if they are over the limit. This also\n * includes a message used as an accessible description for the textarea.\n * @property {TranslationPluralForms} [charactersUnderLimit] - Message displayed\n * when the number of characters is under the configured maximum, `maxlength`.\n * This message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining characters. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {string} [charactersAtLimit] - Message displayed when the number of\n * characters reaches the configured maximum, `maxlength`. This message is\n * displayed visually and through assistive technologies.\n * @property {TranslationPluralForms} [charactersOverLimit] - Message displayed\n * when the number of characters is over the configured maximum, `maxlength`.\n * This message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining characters. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {TranslationPluralForms} [wordsUnderLimit] - Message displayed when\n * the number of words is under the configured maximum, `maxlength`. This\n * message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining words. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {string} [wordsAtLimit] - Message displayed when the number of\n * words reaches the configured maximum, `maxlength`. This message is\n * displayed visually and through assistive technologies.\n * @property {TranslationPluralForms} [wordsOverLimit] - Message displayed when\n * the number of words is over the configured maximum, `maxlength`. This\n * message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining words. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {TranslationPluralForms} [textareaDescription] - Message made\n * available to assistive technologies, if none is already present in the\n * HTML, to describe that the component accepts only a limited amount of\n * content. It is visible on the page when JavaScript is unavailable. The\n * component will replace the `%{count}` placeholder with the value of the\n * `maxlength` or `maxwords` parameter.\n */\n\n/**\n * @import { Schema } from '../../common/configuration.mjs'\n * @import { TranslationPluralForms } from '../../i18n.mjs'\n */\n"],"names":["CharacterCount","ConfigurableComponent","configOverride","datasetConfig","configOverrides","maxlength","undefined","maxwords","constructor","$root","config","_ref","_this$config$maxwords","$textarea","count","$visibleCountMessage","$screenReaderCountMessage","lastInputTimestamp","lastInputValue","valueChecker","i18n","maxLength","querySelector","HTMLTextAreaElement","HTMLInputElement","ElementError","component","element","expectedType","identifier","errors","validateConfig","schema","ConfigError","formatErrorMessage","I18n","locale","closestAttributeValue","Infinity","textareaDescriptionId","id","$textareaDescription","document","getElementById","$errorMessage","textContent","match","t","insertAdjacentElement","createElement","className","setAttribute","classList","add","removeAttribute","bindChangeEvents","window","addEventListener","value","updateCount","updateCountMessage","handleInput","handleFocus","handleBlur","updateVisibleCountMessage","Date","now","setInterval","updateIfValueChanged","clearInterval","updateScreenReaderCountMessage","remainingNumber","isError","toggle","isOverThreshold","getCountMessage","text","_text$match","tokens","length","countType","formatCountMessage","translationKeySuffix","Math","abs","threshold","currentLength","thresholdValue","moduleName","defaults","Object","freeze","charactersUnderLimit","one","other","charactersAtLimit","charactersOverLimit","wordsUnderLimit","wordsAtLimit","wordsOverLimit","textareaDescription","properties","type","anyOf","required","errorMessage"],"mappings":";;;;;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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,4BAA4B;AAC1CC,IAAAA,cAAc,EAAE;AACdN,MAAAA,GAAG,EAAE,iCAAiC;AACtCC,MAAAA,KAAK,EAAE;KACR;AACDM,IAAAA,mBAAmB,EAAE;AACnBN,MAAAA,KAAK,EAAE;AACT;AACF;AACF,CAAC,CAAC;AAhbS9F,cAAc,CAwblBgC,MAAM,GAAG0D,MAAM,CAACC,MAAM,CAAC;AAC5BU,EAAAA,UAAU,EAAE;AACVjF,IAAAA,IAAI,EAAE;AAAEkF,MAAAA,IAAI,EAAE;KAAU;AACxB/F,IAAAA,QAAQ,EAAE;AAAE+F,MAAAA,IAAI,EAAE;KAAU;AAC5BjG,IAAAA,SAAS,EAAE;AAAEiG,MAAAA,IAAI,EAAE;KAAU;AAC7BjB,IAAAA,SAAS,EAAE;AAAEiB,MAAAA,IAAI,EAAE;AAAS;GAC7B;AACDC,EAAAA,KAAK,EAAE,CACL;IACEC,QAAQ,EAAE,CAAC,UAAU,CAAC;AACtBC,IAAAA,YAAY,EAAE;AAChB,GAAC,EACD;IACED,QAAQ,EAAE,CAAC,WAAW,CAAC;AACvBC,IAAAA,YAAY,EAAE;GACf;AAEL,CAAC,CAAC;;;;"}
@@ -119,7 +119,7 @@
119
119
  outline-color: Highlight;
120
120
  }
121
121
 
122
- box-shadow: 0 0 0 $govuk-focus-width $govuk-focus-colour;
122
+ box-shadow: 0 0 0 $govuk-focus-width govuk-functional-colour(focus);
123
123
  }
124
124
 
125
125
  // Selected state
@@ -169,7 +169,8 @@
169
169
  @include govuk-responsive-margin(4, "bottom");
170
170
  margin-left: $conditional-margin-left;
171
171
  padding-left: $conditional-padding-left;
172
- border-left: $conditional-border-width solid $govuk-border-colour;
172
+ border-left: $conditional-border-width solid;
173
+ border-left-color: govuk-functional-colour(border);
173
174
 
174
175
  .govuk-frontend-supported &--hidden {
175
176
  display: none;
@@ -271,7 +272,7 @@
271
272
  // Apply an outline for those modes to use instead.
272
273
  outline: $govuk-focus-width dashed transparent;
273
274
  outline-offset: 1px;
274
- box-shadow: 0 0 0 $govuk-hover-width $govuk-hover-colour;
275
+ box-shadow: 0 0 0 $govuk-hover-width govuk-functional-colour(hover);
275
276
  }
276
277
 
277
278
  // Because we've overridden the border-shadow provided by the focus state,
@@ -286,8 +287,8 @@
286
287
  }
287
288
  // prettier-ignore
288
289
  box-shadow:
289
- 0 0 0 $govuk-focus-width $govuk-focus-colour, // 1
290
- 0 0 0 $govuk-hover-width $govuk-hover-colour; // 2
290
+ 0 0 0 $govuk-focus-width govuk-functional-colour(focus), // 1
291
+ 0 0 0 $govuk-hover-width govuk-functional-colour(hover); // 2
291
292
  }
292
293
 
293
294
  // For devices that explicitly don't support hover, don't provide a hover
@@ -302,7 +303,7 @@
302
303
  }
303
304
 
304
305
  .govuk-checkboxes__item:hover .govuk-checkboxes__input:focus + .govuk-checkboxes__label::before {
305
- box-shadow: 0 0 0 $govuk-focus-width $govuk-focus-colour;
306
+ box-shadow: 0 0 0 $govuk-focus-width govuk-functional-colour(focus);
306
307
  }
307
308
  }
308
309
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/govuk/components/checkboxes/_index.scss"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,2BAA2B;AAC3B,uBAAuB;AACvB,wBAAwB;;AAExB;EACE,+BAA+B;EAC/B,4BAA4B;EAC5B,+EAA+E;EAC/E,kCAAkC;EAClC,4DAA4D;EAC5D,+CAA+C;;EAE/C;IACE,aAAa;IACb,eAAe;IACf,kBAAkB;IAClB,+BAA+B;EACjC;;EAEA;;IAEE,gBAAgB;EAClB;;EAEA;IACE,uEAAuE;IACvE,iEAAiE;IACjE,UAAU;IACV,+BAA+B;IAC/B,gCAAgC;IAChC,SAAS;IACT,UAAU;IACV,eAAe;EACjB;;EAEA;IACE,kBAAkB;;IAElB,wEAAwE;IACxE,qEAAqE;IACrE,yEAAyE;IACzE,kEAAkE;IAClE,wGAAwG;IACxG,gBAAgB;IAChB,+EAA+E;IAC/E,eAAe;IACf,8BAA8B;IA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EAAwE;IACxE,oDAAoD;IACpD;MACE,wEAAwE;MACxE;QACE,wBAAwB;MAC1B;MACA,iBAAiB;MACjB;;oDAE8C,EAAE,GAAG;IACrD;;IAEA,wEAAwE;IACxE,yCAAyC;IACzC,CAAC;IACD,wEAAwE;IACxE,sEAAsE;IACtE,2DAA2D;IAC3D;MACE;QACE,mBAAmB;MACrB;;MAEA;QACE,wDAAwD;MAC1D;IACF;EACF;AACF","file":"_index.scss","sourcesContent":["@import \"../error-message/index\";\n@import \"../fieldset/index\";\n@import \"../hint/index\";\n@import \"../label/index\";\n\n@include govuk-exports(\"govuk/component/checkboxes\") {\n $govuk-touch-target-gutter: 4px;\n $govuk-checkboxes-size: 40px;\n $govuk-touch-target-size: ($govuk-checkboxes-size + $govuk-touch-target-gutter);\n $govuk-small-checkboxes-size: 24px;\n $govuk-checkboxes-label-padding-left-right: govuk-spacing(3);\n $govuk-checkbox-check-horizontal-position: 10px;\n\n .govuk-checkboxes__item {\n display: flex;\n flex-wrap: wrap;\n position: relative;\n margin-bottom: govuk-spacing(2);\n }\n\n .govuk-checkboxes__item:last-child,\n .govuk-checkboxes__item:last-of-type {\n margin-bottom: 0;\n }\n\n .govuk-checkboxes__input {\n // Allow the input to sit above the label, enabling its proper detection\n // when exploring by touch or using automation tools like Selenium\n z-index: 1;\n width: $govuk-touch-target-size;\n height: $govuk-touch-target-size;\n margin: 0;\n opacity: 0;\n cursor: pointer;\n }\n\n .govuk-checkboxes__label {\n align-self: center;\n\n // Ensure that the width of the label is never more than the width of the\n // container minus the input width minus the padding on either side of\n // the label. This prevents the label from going onto the next line due to\n // __item using flex-wrap because we want hints on a separate line.\n max-width: calc(100% - #{(($govuk-checkboxes-label-padding-left-right * 2) + $govuk-touch-target-size)});\n margin-bottom: 0;\n padding: (govuk-spacing(1) + $govuk-border-width-form-element) govuk-spacing(3);\n cursor: pointer;\n // remove 300ms pause on mobile\n touch-action: manipulation;\n }\n\n // [ ] Check box\n .govuk-checkboxes__label::before {\n content: \"\";\n box-sizing: border-box;\n position: absolute;\n top: ($govuk-touch-target-gutter / 2);\n left: ($govuk-touch-target-gutter / 2);\n width: $govuk-checkboxes-size;\n height: $govuk-checkboxes-size;\n border: $govuk-border-width-form-element solid currentcolor;\n background: transparent;\n }\n\n // ✔ Check mark\n //\n // The check mark is a box with a border on the left and bottom side (└──),\n // rotated 45 degrees\n .govuk-checkboxes__label::after {\n content: \"\";\n box-sizing: border-box;\n position: absolute;\n\n // Use \"magic numbers\" to define shape and position of check mark because\n // the complexity of the shape makes it difficult to calculate dynamically.\n top: 13px;\n left: $govuk-checkbox-check-horizontal-position;\n width: 23px;\n height: 12px;\n transform: rotate(-45deg);\n border: solid;\n border-width: 0 0 5px 5px;\n // Fix bug in IE11 caused by transform rotate (-45deg).\n // See: alphagov/govuk_elements/issues/518\n border-top-color: transparent;\n opacity: 0;\n background: transparent;\n }\n\n .govuk-checkboxes__hint {\n display: block;\n width: 100%;\n margin-top: govuk-spacing(-1);\n padding-right: $govuk-checkboxes-label-padding-left-right;\n padding-left: ($govuk-checkboxes-label-padding-left-right + $govuk-touch-target-size);\n }\n\n // This is to bypass govuk-hint's specificity on hints following labels having\n // a margin bottom of 10px (govuk-spacing(2)). Because checkboxes are flexbox,\n // the margin doesn't collapse so we have to do this manually.\n .govuk-label:not(.govuk-label--m):not(.govuk-label--l):not(.govuk-label--xl) + .govuk-checkboxes__hint {\n margin-bottom: 0;\n }\n\n // Focused state\n .govuk-checkboxes__input:focus + .govuk-checkboxes__label::before {\n border-width: 4px;\n\n // When colours are overridden, the yellow box-shadow becomes invisible\n // which means the focus state is less obvious. By adding a transparent\n // outline, which becomes solid (text-coloured) in that context, we ensure\n // the focus remains clearly visible.\n outline: $govuk-focus-width solid transparent;\n outline-offset: 1px;\n\n // When in an explicit forced-color mode, we can use the Highlight system\n // color for the outline to better match focus states of native controls\n @media screen and (forced-colors: active), (-ms-high-contrast: active) {\n outline-color: Highlight;\n }\n\n box-shadow: 0 0 0 $govuk-focus-width $govuk-focus-colour;\n }\n\n // Selected state\n .govuk-checkboxes__input:checked + .govuk-checkboxes__label::after {\n opacity: 1;\n }\n\n // Disabled state\n .govuk-checkboxes__input:disabled,\n .govuk-checkboxes__input:disabled + .govuk-checkboxes__label {\n cursor: not-allowed;\n }\n\n .govuk-checkboxes__input:disabled + .govuk-checkboxes__label,\n .govuk-checkboxes__input:disabled ~ .govuk-hint {\n opacity: 0.5;\n }\n\n // =========================================================\n // Dividers ('or')\n // =========================================================\n\n .govuk-checkboxes__divider {\n @include govuk-font($size: 19);\n @include govuk-text-colour;\n $govuk-divider-size: $govuk-checkboxes-size !default;\n width: $govuk-divider-size;\n margin-bottom: govuk-spacing(2);\n text-align: center;\n }\n\n // =========================================================\n // Conditional reveals\n // =========================================================\n\n // The narrow border is used in the conditional reveals because the border has\n // to be an even number in order to be centred under the 40px checkbox or radio.\n $conditional-border-width: $govuk-border-width-narrow;\n // Calculate the amount of padding needed to keep the border centered against the checkbox.\n $conditional-border-padding: ($govuk-touch-target-size / 2) - ($conditional-border-width / 2);\n // Move the border centered with the checkbox\n $conditional-margin-left: $conditional-border-padding;\n // Move the contents of the conditional inline with the label\n $conditional-padding-left: $conditional-border-padding + $govuk-checkboxes-label-padding-left-right;\n\n .govuk-checkboxes__conditional {\n @include govuk-responsive-margin(4, \"bottom\");\n margin-left: $conditional-margin-left;\n padding-left: $conditional-padding-left;\n border-left: $conditional-border-width solid $govuk-border-colour;\n\n .govuk-frontend-supported &--hidden {\n display: none;\n }\n\n & > :last-child {\n margin-bottom: 0;\n }\n }\n\n // =========================================================\n // Small checkboxes\n // =========================================================\n\n .govuk-checkboxes--small {\n $input-offset: ($govuk-touch-target-size - $govuk-small-checkboxes-size) / 2;\n\n .govuk-checkboxes__item {\n margin-bottom: 0;\n }\n\n // Shift the touch target into the left margin so that the visible edge of\n // the control is aligned\n //\n // ┆What colours do you like?\n // ┌┆───┐\n // │┆[] │ Purple\n // └┆▲──┘\n // ▲┆└─ Check box pseudo element, aligned with margin\n // └─── Touch target (invisible input), shifted into the margin\n .govuk-checkboxes__input {\n margin-left: $input-offset * -1;\n }\n\n .govuk-checkboxes__label {\n // Create a tiny space between the small checkbox hover state so that it\n // doesn't clash with the label\n padding-left: 1px;\n }\n\n // [ ] Check box\n //\n // Reduce the size of the check box [1], vertically center it within the\n // touch target [2]\n // Left here is 0 because we've shifted the input into the left margin\n .govuk-checkboxes__label::before {\n top: $input-offset; // 2\n left: 0;\n width: $govuk-small-checkboxes-size; // 1\n height: $govuk-small-checkboxes-size; // 1\n }\n\n // ✔ Check mark\n //\n // Reduce the size of the check mark and re-align within the checkbox\n .govuk-checkboxes__label::after {\n top: 17px;\n\n // Horizontal position is just the normal sized left value accounting for\n // the new width of the smaller checkbox\n left: (16px - $govuk-checkbox-check-horizontal-position);\n width: 12px;\n height: 6.5px;\n border-width: 0 0 3px 3px;\n }\n\n // Fix position of hint with small checkboxes\n //\n // Do not use hints with small checkboxes – because they're within the input\n // wrapper they trigger the hover state, but clicking them doesn't actually\n // activate the control.\n //\n // (If you do use them, they won't look completely broken... but seriously,\n // don't use them)\n .govuk-checkboxes__hint {\n padding-left: ($govuk-small-checkboxes-size + $input-offset);\n }\n\n // Align conditional reveals with small checkboxes\n .govuk-checkboxes__conditional {\n $margin-left: ($govuk-small-checkboxes-size / 2) - ($conditional-border-width / 2);\n margin-left: $margin-left;\n padding-left: ($govuk-touch-target-size - $input-offset) - ($margin-left + $conditional-border-width);\n }\n\n .govuk-checkboxes__divider {\n width: $govuk-small-checkboxes-size;\n margin-bottom: govuk-spacing(1);\n }\n\n // Hover state for small checkboxes.\n //\n // We use a hover state for small checkboxes because the touch target size\n // is so much larger than their visible size, and so we need to provide\n // feedback to the user as to which checkbox they will select when their\n // cursor is outside of the visible area.\n .govuk-checkboxes__item:hover .govuk-checkboxes__input:not(:disabled) + .govuk-checkboxes__label::before {\n // Forced colours modes tend to ignore box-shadow.\n // Apply an outline for those modes to use instead.\n outline: $govuk-focus-width dashed transparent;\n outline-offset: 1px;\n box-shadow: 0 0 0 $govuk-hover-width $govuk-hover-colour;\n }\n\n // Because we've overridden the border-shadow provided by the focus state,\n // we need to redefine that too.\n //\n // We use two box shadows, one that restores the original focus state [1]\n // and another that then applies the hover state [2].\n .govuk-checkboxes__item:hover .govuk-checkboxes__input:focus + .govuk-checkboxes__label::before {\n // Set different HCM colour when we have both hover/focus applied at once\n @media screen and (forced-colors: active), (-ms-high-contrast: active) {\n outline-color: Highlight;\n }\n // prettier-ignore\n box-shadow:\n 0 0 0 $govuk-focus-width $govuk-focus-colour, // 1\n 0 0 0 $govuk-hover-width $govuk-hover-colour; // 2\n }\n\n // For devices that explicitly don't support hover, don't provide a hover\n // state (e.g. on touch devices like iOS).\n //\n // We can't use `@media (hover: hover)` because we wouldn't get the hover\n // state in browsers that don't support `@media (hover)` (like Internet\n // Explorer) – so we have to 'undo' the hover state instead.\n @media (hover: none), (pointer: coarse) {\n .govuk-checkboxes__item:hover .govuk-checkboxes__input:not(:disabled) + .govuk-checkboxes__label::before {\n box-shadow: initial;\n }\n\n .govuk-checkboxes__item:hover .govuk-checkboxes__input:focus + .govuk-checkboxes__label::before {\n box-shadow: 0 0 0 $govuk-focus-width $govuk-focus-colour;\n }\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../../../../src/govuk/components/checkboxes/_index.scss"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,2BAA2B;AAC3B,uBAAuB;AACvB,wBAAwB;;AAExB;EACE,+BAA+B;EAC/B,4BAA4B;EAC5B,+EAA+E;EAC/E,kCAAkC;EAClC,4DAA4D;EAC5D,+CAA+C;;EAE/C;IACE,aAAa;IACb,eAAe;IACf,kBAAkB;IAClB,+BAA+B;EACjC;;EAEA;;IAEE,gBAAgB;EAClB;;EAEA;IACE,uEAAuE;IACvE,iEAAiE;IACjE,UAAU;IACV,+BAA+B;IAC/B,gCAAgC;IAChC,SAAS;IACT,UAAU;IACV,eAAe;EACjB;;EAEA;IACE,kBAAkB;;IAEl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AwC;IACxC;MACE,iDAAiD;MACjD,kDAAkD;MAClD,8CAA8C;MAC9C,mBAAmB;MACnB,mEAAmE;IACrE;;IAEA,yEAAyE;IACzE,+BAA+B;IAC/B,CAAC;IACD,wEAAwE;IACxE,oDAAoD;IACpD;MACE,wEAAwE;MACxE;QACE,wBAAwB;MAC1B;MACA,iBAAiB;MACjB;;+DAEyD,EAAE,GAAG;IAChE;;IAEA,wEAAwE;IACxE,yCAAyC;IACzC,CAAC;IACD,wEAAwE;IACxE,sEAAsE;IACtE,2DAA2D;IAC3D;MACE;QACE,mBAAmB;MACrB;;MAEA;QACE,mEAAmE;MACrE;IACF;EACF;AACF","file":"_index.scss","sourcesContent":["@import \"../error-message/index\";\n@import \"../fieldset/index\";\n@import \"../hint/index\";\n@import \"../label/index\";\n\n@include govuk-exports(\"govuk/component/checkboxes\") {\n $govuk-touch-target-gutter: 4px;\n $govuk-checkboxes-size: 40px;\n $govuk-touch-target-size: ($govuk-checkboxes-size + $govuk-touch-target-gutter);\n $govuk-small-checkboxes-size: 24px;\n $govuk-checkboxes-label-padding-left-right: govuk-spacing(3);\n $govuk-checkbox-check-horizontal-position: 10px;\n\n .govuk-checkboxes__item {\n display: flex;\n flex-wrap: wrap;\n position: relative;\n margin-bottom: govuk-spacing(2);\n }\n\n .govuk-checkboxes__item:last-child,\n .govuk-checkboxes__item:last-of-type {\n margin-bottom: 0;\n }\n\n .govuk-checkboxes__input {\n // Allow the input to sit above the label, enabling its proper detection\n // when exploring by touch or using automation tools like Selenium\n z-index: 1;\n width: $govuk-touch-target-size;\n height: $govuk-touch-target-size;\n margin: 0;\n opacity: 0;\n cursor: pointer;\n }\n\n .govuk-checkboxes__label {\n align-self: center;\n\n // Ensure that the width of the label is never more than the width of the\n // container minus the input width minus the padding on either side of\n // the label. This prevents the label from going onto the next line due to\n // __item using flex-wrap because we want hints on a separate line.\n max-width: calc(100% - #{(($govuk-checkboxes-label-padding-left-right * 2) + $govuk-touch-target-size)});\n margin-bottom: 0;\n padding: (govuk-spacing(1) + $govuk-border-width-form-element) govuk-spacing(3);\n cursor: pointer;\n // remove 300ms pause on mobile\n touch-action: manipulation;\n }\n\n // [ ] Check box\n .govuk-checkboxes__label::before {\n content: \"\";\n box-sizing: border-box;\n position: absolute;\n top: ($govuk-touch-target-gutter / 2);\n left: ($govuk-touch-target-gutter / 2);\n width: $govuk-checkboxes-size;\n height: $govuk-checkboxes-size;\n border: $govuk-border-width-form-element solid currentcolor;\n background: transparent;\n }\n\n // ✔ Check mark\n //\n // The check mark is a box with a border on the left and bottom side (└──),\n // rotated 45 degrees\n .govuk-checkboxes__label::after {\n content: \"\";\n box-sizing: border-box;\n position: absolute;\n\n // Use \"magic numbers\" to define shape and position of check mark because\n // the complexity of the shape makes it difficult to calculate dynamically.\n top: 13px;\n left: $govuk-checkbox-check-horizontal-position;\n width: 23px;\n height: 12px;\n transform: rotate(-45deg);\n border: solid;\n border-width: 0 0 5px 5px;\n // Fix bug in IE11 caused by transform rotate (-45deg).\n // See: alphagov/govuk_elements/issues/518\n border-top-color: transparent;\n opacity: 0;\n background: transparent;\n }\n\n .govuk-checkboxes__hint {\n display: block;\n width: 100%;\n margin-top: govuk-spacing(-1);\n padding-right: $govuk-checkboxes-label-padding-left-right;\n padding-left: ($govuk-checkboxes-label-padding-left-right + $govuk-touch-target-size);\n }\n\n // This is to bypass govuk-hint's specificity on hints following labels having\n // a margin bottom of 10px (govuk-spacing(2)). Because checkboxes are flexbox,\n // the margin doesn't collapse so we have to do this manually.\n .govuk-label:not(.govuk-label--m):not(.govuk-label--l):not(.govuk-label--xl) + .govuk-checkboxes__hint {\n margin-bottom: 0;\n }\n\n // Focused state\n .govuk-checkboxes__input:focus + .govuk-checkboxes__label::before {\n border-width: 4px;\n\n // When colours are overridden, the yellow box-shadow becomes invisible\n // which means the focus state is less obvious. By adding a transparent\n // outline, which becomes solid (text-coloured) in that context, we ensure\n // the focus remains clearly visible.\n outline: $govuk-focus-width solid transparent;\n outline-offset: 1px;\n\n // When in an explicit forced-color mode, we can use the Highlight system\n // color for the outline to better match focus states of native controls\n @media screen and (forced-colors: active), (-ms-high-contrast: active) {\n outline-color: Highlight;\n }\n\n box-shadow: 0 0 0 $govuk-focus-width govuk-functional-colour(focus);\n }\n\n // Selected state\n .govuk-checkboxes__input:checked + .govuk-checkboxes__label::after {\n opacity: 1;\n }\n\n // Disabled state\n .govuk-checkboxes__input:disabled,\n .govuk-checkboxes__input:disabled + .govuk-checkboxes__label {\n cursor: not-allowed;\n }\n\n .govuk-checkboxes__input:disabled + .govuk-checkboxes__label,\n .govuk-checkboxes__input:disabled ~ .govuk-hint {\n opacity: 0.5;\n }\n\n // =========================================================\n // Dividers ('or')\n // =========================================================\n\n .govuk-checkboxes__divider {\n @include govuk-font($size: 19);\n @include govuk-text-colour;\n $govuk-divider-size: $govuk-checkboxes-size !default;\n width: $govuk-divider-size;\n margin-bottom: govuk-spacing(2);\n text-align: center;\n }\n\n // =========================================================\n // Conditional reveals\n // =========================================================\n\n // The narrow border is used in the conditional reveals because the border has\n // to be an even number in order to be centred under the 40px checkbox or radio.\n $conditional-border-width: $govuk-border-width-narrow;\n // Calculate the amount of padding needed to keep the border centered against the checkbox.\n $conditional-border-padding: ($govuk-touch-target-size / 2) - ($conditional-border-width / 2);\n // Move the border centered with the checkbox\n $conditional-margin-left: $conditional-border-padding;\n // Move the contents of the conditional inline with the label\n $conditional-padding-left: $conditional-border-padding + $govuk-checkboxes-label-padding-left-right;\n\n .govuk-checkboxes__conditional {\n @include govuk-responsive-margin(4, \"bottom\");\n margin-left: $conditional-margin-left;\n padding-left: $conditional-padding-left;\n border-left: $conditional-border-width solid;\n border-left-color: govuk-functional-colour(border);\n\n .govuk-frontend-supported &--hidden {\n display: none;\n }\n\n & > :last-child {\n margin-bottom: 0;\n }\n }\n\n // =========================================================\n // Small checkboxes\n // =========================================================\n\n .govuk-checkboxes--small {\n $input-offset: ($govuk-touch-target-size - $govuk-small-checkboxes-size) / 2;\n\n .govuk-checkboxes__item {\n margin-bottom: 0;\n }\n\n // Shift the touch target into the left margin so that the visible edge of\n // the control is aligned\n //\n // ┆What colours do you like?\n // ┌┆───┐\n // │┆[] │ Purple\n // └┆▲──┘\n // ▲┆└─ Check box pseudo element, aligned with margin\n // └─── Touch target (invisible input), shifted into the margin\n .govuk-checkboxes__input {\n margin-left: $input-offset * -1;\n }\n\n .govuk-checkboxes__label {\n // Create a tiny space between the small checkbox hover state so that it\n // doesn't clash with the label\n padding-left: 1px;\n }\n\n // [ ] Check box\n //\n // Reduce the size of the check box [1], vertically center it within the\n // touch target [2]\n // Left here is 0 because we've shifted the input into the left margin\n .govuk-checkboxes__label::before {\n top: $input-offset; // 2\n left: 0;\n width: $govuk-small-checkboxes-size; // 1\n height: $govuk-small-checkboxes-size; // 1\n }\n\n // ✔ Check mark\n //\n // Reduce the size of the check mark and re-align within the checkbox\n .govuk-checkboxes__label::after {\n top: 17px;\n\n // Horizontal position is just the normal sized left value accounting for\n // the new width of the smaller checkbox\n left: (16px - $govuk-checkbox-check-horizontal-position);\n width: 12px;\n height: 6.5px;\n border-width: 0 0 3px 3px;\n }\n\n // Fix position of hint with small checkboxes\n //\n // Do not use hints with small checkboxes – because they're within the input\n // wrapper they trigger the hover state, but clicking them doesn't actually\n // activate the control.\n //\n // (If you do use them, they won't look completely broken... but seriously,\n // don't use them)\n .govuk-checkboxes__hint {\n padding-left: ($govuk-small-checkboxes-size + $input-offset);\n }\n\n // Align conditional reveals with small checkboxes\n .govuk-checkboxes__conditional {\n $margin-left: ($govuk-small-checkboxes-size / 2) - ($conditional-border-width / 2);\n margin-left: $margin-left;\n padding-left: ($govuk-touch-target-size - $input-offset) - ($margin-left + $conditional-border-width);\n }\n\n .govuk-checkboxes__divider {\n width: $govuk-small-checkboxes-size;\n margin-bottom: govuk-spacing(1);\n }\n\n // Hover state for small checkboxes.\n //\n // We use a hover state for small checkboxes because the touch target size\n // is so much larger than their visible size, and so we need to provide\n // feedback to the user as to which checkbox they will select when their\n // cursor is outside of the visible area.\n .govuk-checkboxes__item:hover .govuk-checkboxes__input:not(:disabled) + .govuk-checkboxes__label::before {\n // Forced colours modes tend to ignore box-shadow.\n // Apply an outline for those modes to use instead.\n outline: $govuk-focus-width dashed transparent;\n outline-offset: 1px;\n box-shadow: 0 0 0 $govuk-hover-width govuk-functional-colour(hover);\n }\n\n // Because we've overridden the border-shadow provided by the focus state,\n // we need to redefine that too.\n //\n // We use two box shadows, one that restores the original focus state [1]\n // and another that then applies the hover state [2].\n .govuk-checkboxes__item:hover .govuk-checkboxes__input:focus + .govuk-checkboxes__label::before {\n // Set different HCM colour when we have both hover/focus applied at once\n @media screen and (forced-colors: active), (-ms-high-contrast: active) {\n outline-color: Highlight;\n }\n // prettier-ignore\n box-shadow:\n 0 0 0 $govuk-focus-width govuk-functional-colour(focus), // 1\n 0 0 0 $govuk-hover-width govuk-functional-colour(hover); // 2\n }\n\n // For devices that explicitly don't support hover, don't provide a hover\n // state (e.g. on touch devices like iOS).\n //\n // We can't use `@media (hover: hover)` because we wouldn't get the hover\n // state in browsers that don't support `@media (hover)` (like Internet\n // Explorer) – so we have to 'undo' the hover state instead.\n @media (hover: none), (pointer: coarse) {\n .govuk-checkboxes__item:hover .govuk-checkboxes__input:not(:disabled) + .govuk-checkboxes__label::before {\n box-shadow: initial;\n }\n\n .govuk-checkboxes__item:hover .govuk-checkboxes__input:focus + .govuk-checkboxes__label::before {\n box-shadow: 0 0 0 $govuk-focus-width govuk-functional-colour(focus);\n }\n }\n }\n}\n"]}
@@ -13,11 +13,8 @@
13
13
  // changes colours in their browser.
14
14
  border-bottom: $border-bottom-width solid transparent;
15
15
 
16
- @include _govuk-rebrand(
17
- "background-color",
18
- $govuk-template-background-colour,
19
- $_govuk-rebrand-template-background-colour
20
- );
16
+ color: govuk-functional-colour(surface-text);
17
+ background-color: govuk-functional-colour(surface-background);
21
18
  }
22
19
 
23
20
  // Support older browsers which don't hide elements with the `hidden` attribute
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/govuk/components/cookie-banner/_index.scss"],"names":[],"mappings":"AAAA,yBAAyB;;AAEzB;EACE,kEAAkE;EAClE,sCAAsC;;EAEtC;IACE,6BAA6B;IAC7B,yEAAyE;IACzE,4CAA4C;;IAE5C,uEAAuE;IACvE,mCAAmC;IACnC,qDAAqD;;IAErD;;;;KAIC;EACH;;EAEA,8EAA8E;EAC9E,+DAA+D;EAC/D;IACE,aAAa;EACf;;EAEA;IACE,wDAAwD;IACxD,oCAAoC;;IAEpC;MACE,oEAAoE;MACpE,qEAAqE;MACrE,UAAU;MACV,aAAa;IACf;;IAEA;MACE,+DAA+D;MAC/D,2BAA2B;MAC3B,CAAC;MACD,yEAAyE;MACzE,wEAAwE;MACxE,yEAAyE;MACzE,kEAAkE;MAClE,uEAAuE;MACvE,CAAC;MACD,iEAAiE;MACjE,uBAAuB;MACvB,CAAC;MACD,+DAA+D;MAC/D,aAAa;IACf;EACF;AACF","file":"_index.scss","sourcesContent":["@import \"../button/index\";\n\n@include govuk-exports(\"govuk/component/cookie-banner\") {\n // This needs to be kept in sync with the header component's styles\n $border-bottom-width: govuk-spacing(2);\n\n .govuk-cookie-banner {\n padding-top: govuk-spacing(4);\n // The component does not set bottom spacing. The bottom spacing should be\n // created by the items inside the component.\n\n // Visually separate the cookie banner from content underneath when user\n // changes colours in their browser.\n border-bottom: $border-bottom-width solid transparent;\n\n @include _govuk-rebrand(\n \"background-color\",\n $govuk-template-background-colour,\n $_govuk-rebrand-template-background-colour\n );\n }\n\n // Support older browsers which don't hide elements with the `hidden` attribute\n // when user hides the whole cookie banner with a 'Hide' button.\n .govuk-cookie-banner[hidden] {\n display: none;\n }\n\n .govuk-cookie-banner__message {\n // Remove the extra height added by the separator border.\n margin-bottom: -$border-bottom-width;\n\n &[hidden] {\n // Support older browsers which don't hide elements with the `hidden`\n // attribute when the visibility of cookie and replacement messages is\n // toggled.\n display: none;\n }\n\n &:focus {\n // Remove the native visible focus indicator when the element is\n // programmatically focused.\n //\n // The focused cookie banner is the first element on the page and the last\n // thing the user interacted with prior to it gaining focus. We therefore\n // assume that moving focus to it is not going to surprise users, and that\n // giving it a visible focus indicator could be more confusing than\n // helpful, especially as the element is not normally keyboard operable.\n //\n // We have flagged this in the research section of the guidance as\n // something to monitor.\n //\n // A related discussion: https://github.com/w3c/wcag/issues/1001\n outline: none;\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../../../../src/govuk/components/cookie-banner/_index.scss"],"names":[],"mappings":"AAAA,yBAAyB;;AAEzB;EACE,kEAAkE;EAClE,sCAAsC;;EAEtC;IACE,6BAA6B;IAC7B,yEAAyE;IACzE,4CAA4C;;IAE5C,uEAAuE;IACvE,mCAAmC;IACnC,qDAAqD;;IAErD,4CAA4C;IAC5C,6DAA6D;EAC/D;;EAEA,8EAA8E;EAC9E,+DAA+D;EAC/D;IACE,aAAa;EACf;;EAEA;IACE,wDAAwD;IACxD,oCAAoC;;IAEpC;MACE,oEAAoE;MACpE,qEAAqE;MACrE,UAAU;MACV,aAAa;IACf;;IAEA;MACE,+DAA+D;MAC/D,2BAA2B;MAC3B,CAAC;MACD,yEAAyE;MACzE,wEAAwE;MACxE,yEAAyE;MACzE,kEAAkE;MAClE,uEAAuE;MACvE,CAAC;MACD,iEAAiE;MACjE,uBAAuB;MACvB,CAAC;MACD,+DAA+D;MAC/D,aAAa;IACf;EACF;AACF","file":"_index.scss","sourcesContent":["@import \"../button/index\";\n\n@include govuk-exports(\"govuk/component/cookie-banner\") {\n // This needs to be kept in sync with the header component's styles\n $border-bottom-width: govuk-spacing(2);\n\n .govuk-cookie-banner {\n padding-top: govuk-spacing(4);\n // The component does not set bottom spacing. The bottom spacing should be\n // created by the items inside the component.\n\n // Visually separate the cookie banner from content underneath when user\n // changes colours in their browser.\n border-bottom: $border-bottom-width solid transparent;\n\n color: govuk-functional-colour(surface-text);\n background-color: govuk-functional-colour(surface-background);\n }\n\n // Support older browsers which don't hide elements with the `hidden` attribute\n // when user hides the whole cookie banner with a 'Hide' button.\n .govuk-cookie-banner[hidden] {\n display: none;\n }\n\n .govuk-cookie-banner__message {\n // Remove the extra height added by the separator border.\n margin-bottom: -$border-bottom-width;\n\n &[hidden] {\n // Support older browsers which don't hide elements with the `hidden`\n // attribute when the visibility of cookie and replacement messages is\n // toggled.\n display: none;\n }\n\n &:focus {\n // Remove the native visible focus indicator when the element is\n // programmatically focused.\n //\n // The focused cookie banner is the first element on the page and the last\n // thing the user interacted with prior to it gaining focus. We therefore\n // assume that moving focus to it is not going to surprise users, and that\n // giving it a visible focus indicator could be more confusing than\n // helpful, especially as the element is not normally keyboard operable.\n //\n // We have flagged this in the research section of the guidance as\n // something to monitor.\n //\n // A related discussion: https://github.com/w3c/wcag/issues/1001\n outline: none;\n }\n }\n}\n"]}
@@ -33,7 +33,7 @@
33
33
  "description": "",
34
34
  "pageTemplateOptions": {},
35
35
  "screenshot": true,
36
- "html": "<div class=\"govuk-cookie-banner\" data-nosnippet role=\"region\" aria-label=\"Cookie banner\">\n <div class=\"govuk-cookie-banner__message govuk-width-container\">\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h2 class=\"govuk-cookie-banner__heading govuk-heading-m\">\n Cookies on this government service\n </h2>\n <div class=\"govuk-cookie-banner__content\">\n <p class=\"govuk-body\">We use analytics cookies to help understand how users use our service.</p>\n </div>\n </div>\n </div>\n\n <div class=\"govuk-button-group\">\n <button value=\"accept\" type=\"submit\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\">\n Accept analytics cookies\n </button>\n <button value=\"reject\" type=\"submit\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\">\n Reject analytics cookies\n </button>\n <a class=\"govuk-link\" href=\"/cookie-preferences\">View cookie preferences</a>\n </div>\n\n </div>\n</div>"
36
+ "html": "<div class=\"govuk-cookie-banner\" data-nosnippet role=\"region\" aria-label=\"Cookie banner\">\n <div class=\"govuk-cookie-banner__message govuk-width-container\">\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h2 class=\"govuk-cookie-banner__heading govuk-heading-m\">\n Cookies on this government service\n </h2>\n <div class=\"govuk-cookie-banner__content\">\n <p class=\"govuk-body\">We use analytics cookies to help understand how users use our service.</p>\n </div>\n </div>\n </div>\n\n <div class=\"govuk-button-group\">\n <button type=\"submit\" value=\"accept\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\">\n Accept analytics cookies\n </button>\n <button type=\"submit\" value=\"reject\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\">\n Reject analytics cookies\n </button>\n <a class=\"govuk-link\" href=\"/cookie-preferences\">View cookie preferences</a>\n </div>\n\n </div>\n</div>"
37
37
  },
38
38
  {
39
39
  "name": "accepted confirmation banner",
@@ -111,7 +111,7 @@
111
111
  "description": "",
112
112
  "pageTemplateOptions": {},
113
113
  "screenshot": false,
114
- "html": "<div class=\"govuk-cookie-banner\" data-nosnippet role=\"region\" aria-label=\"Cookie banner\">\n <div class=\"govuk-cookie-banner__message govuk-width-container\">\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h2 class=\"govuk-cookie-banner__heading govuk-heading-m\">\n Cookies on <span>my service</span>\n </h2>\n <div class=\"govuk-cookie-banner__content\">\n <p class=\"govuk-body\">We use cookies in <span>our service</span>.</p>\n <p class=\"govuk-body\">We’d like to use analytics cookies so we can understand how you use the Design System and make improvements.</p>\n </div>\n </div>\n </div>\n\n <div class=\"govuk-button-group\">\n <button value=\"accept\" type=\"submit\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\">\n Accept analytics cookies\n </button>\n <button value=\"reject\" type=\"submit\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\">\n Reject analytics cookies\n </button>\n <a class=\"govuk-link\" href=\"/cookie-preferences\">View cookie preferences</a>\n </div>\n\n </div>\n</div>"
114
+ "html": "<div class=\"govuk-cookie-banner\" data-nosnippet role=\"region\" aria-label=\"Cookie banner\">\n <div class=\"govuk-cookie-banner__message govuk-width-container\">\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h2 class=\"govuk-cookie-banner__heading govuk-heading-m\">\n Cookies on <span>my service</span>\n </h2>\n <div class=\"govuk-cookie-banner__content\">\n <p class=\"govuk-body\">We use cookies in <span>our service</span>.</p>\n <p class=\"govuk-body\">We’d like to use analytics cookies so we can understand how you use the Design System and make improvements.</p>\n </div>\n </div>\n </div>\n\n <div class=\"govuk-button-group\">\n <button type=\"submit\" value=\"accept\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\">\n Accept analytics cookies\n </button>\n <button type=\"submit\" value=\"reject\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\">\n Reject analytics cookies\n </button>\n <a class=\"govuk-link\" href=\"/cookie-preferences\">View cookie preferences</a>\n </div>\n\n </div>\n</div>"
115
115
  },
116
116
  {
117
117
  "name": "heading html",
@@ -478,7 +478,7 @@
478
478
  "description": "",
479
479
  "pageTemplateOptions": {},
480
480
  "screenshot": false,
481
- "html": "<div class=\"govuk-cookie-banner\" data-nosnippet role=\"region\" aria-label=\"Cookie banner\">\n <div class=\"govuk-cookie-banner__message govuk-width-container\">\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h2 class=\"govuk-cookie-banner__heading govuk-heading-m\">\n Cookies on this service\n </h2>\n <div class=\"govuk-cookie-banner__content\">\n <p class=\"govuk-body\">We use cookies to help understand how users use our service.</p>\n </div>\n </div>\n </div>\n\n <div class=\"govuk-button-group\">\n <button value=\"accept\" type=\"submit\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\">\n Accept analytics cookies\n </button>\n <button value=\"reject\" type=\"submit\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\">\n Reject analytics cookies\n </button>\n <a class=\"govuk-link\" href=\"/cookie-preferences\">View cookie preferences</a>\n </div>\n\n </div>\n <div class=\"govuk-cookie-banner__message govuk-width-container\" role=\"alert\" hidden>\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <div class=\"govuk-cookie-banner__content\">\n <p class=\"govuk-body\">Your cookie preferences have been saved. You have accepted cookies.</p>\n </div>\n </div>\n </div>\n\n <div class=\"govuk-button-group\">\n <button type=\"button\" class=\"govuk-button\" data-module=\"govuk-button\">\n Hide cookie message\n </button>\n </div>\n\n </div>\n <div class=\"govuk-cookie-banner__message govuk-width-container\" role=\"alert\" hidden>\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <div class=\"govuk-cookie-banner__content\">\n <p class=\"govuk-body\">Your cookie preferences have been saved. You have rejected cookies.</p>\n </div>\n </div>\n </div>\n\n <div class=\"govuk-button-group\">\n <button type=\"button\" class=\"govuk-button\" data-module=\"govuk-button\">\n Hide cookie message\n </button>\n </div>\n\n </div>\n</div>"
481
+ "html": "<div class=\"govuk-cookie-banner\" data-nosnippet role=\"region\" aria-label=\"Cookie banner\">\n <div class=\"govuk-cookie-banner__message govuk-width-container\">\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h2 class=\"govuk-cookie-banner__heading govuk-heading-m\">\n Cookies on this service\n </h2>\n <div class=\"govuk-cookie-banner__content\">\n <p class=\"govuk-body\">We use cookies to help understand how users use our service.</p>\n </div>\n </div>\n </div>\n\n <div class=\"govuk-button-group\">\n <button type=\"submit\" value=\"accept\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\">\n Accept analytics cookies\n </button>\n <button type=\"submit\" value=\"reject\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\">\n Reject analytics cookies\n </button>\n <a class=\"govuk-link\" href=\"/cookie-preferences\">View cookie preferences</a>\n </div>\n\n </div>\n <div class=\"govuk-cookie-banner__message govuk-width-container\" role=\"alert\" hidden>\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <div class=\"govuk-cookie-banner__content\">\n <p class=\"govuk-body\">Your cookie preferences have been saved. You have accepted cookies.</p>\n </div>\n </div>\n </div>\n\n <div class=\"govuk-button-group\">\n <button type=\"button\" class=\"govuk-button\" data-module=\"govuk-button\">\n Hide cookie message\n </button>\n </div>\n\n </div>\n <div class=\"govuk-cookie-banner__message govuk-width-container\" role=\"alert\" hidden>\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <div class=\"govuk-cookie-banner__content\">\n <p class=\"govuk-body\">Your cookie preferences have been saved. You have rejected cookies.</p>\n </div>\n </div>\n </div>\n\n <div class=\"govuk-button-group\">\n <button type=\"button\" class=\"govuk-button\" data-module=\"govuk-button\">\n Hide cookie message\n </button>\n </div>\n\n </div>\n</div>"
482
482
  },
483
483
  {
484
484
  "name": "full banner hidden",
@@ -537,43 +537,7 @@
537
537
  "description": "",
538
538
  "pageTemplateOptions": {},
539
539
  "screenshot": false,
540
- "html": "<div class=\"govuk-cookie-banner hide-cookie-banner\" data-nosnippet role=\"region\" aria-label=\"Cookie banner\" hidden data-hide-cookie-banner=\"true\">\n <div class=\"govuk-cookie-banner__message govuk-width-container\">\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h2 class=\"govuk-cookie-banner__heading govuk-heading-m\">\n Cookies on this service\n </h2>\n <div class=\"govuk-cookie-banner__content\">\n <p class=\"govuk-body\">We use cookies to help understand how users use our service.</p>\n </div>\n </div>\n </div>\n\n <div class=\"govuk-button-group\">\n <button value=\"accept\" type=\"submit\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\">\n Accept analytics cookies\n </button>\n <button value=\"reject\" type=\"submit\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\">\n Reject analytics cookies\n </button>\n <a class=\"govuk-link\" href=\"/cookie-preferences\">View cookie preferences</a>\n </div>\n\n </div>\n <div class=\"govuk-cookie-banner__message govuk-width-container\" role=\"alert\">\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <div class=\"govuk-cookie-banner__content\">\n <p class=\"govuk-body\">Your cookie preferences have been saved. You have accepted cookies.</p>\n </div>\n </div>\n </div>\n\n <div class=\"govuk-button-group\">\n <button type=\"button\" class=\"govuk-button\" data-module=\"govuk-button\">\n Hide cookie message\n </button>\n </div>\n\n </div>\n <div class=\"govuk-cookie-banner__message govuk-width-container\" role=\"alert\">\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <div class=\"govuk-cookie-banner__content\">\n <p class=\"govuk-body\">Your cookie preferences have been saved. You have rejected cookies.</p>\n </div>\n </div>\n </div>\n\n <div class=\"govuk-button-group\">\n <button type=\"button\" class=\"govuk-button\" data-module=\"govuk-button\">\n Hide cookie message\n </button>\n </div>\n\n </div>\n</div>"
541
- },
542
- {
543
- "name": "rebrand",
544
- "options": {
545
- "messages": [
546
- {
547
- "headingText": "Cookies on this government service",
548
- "text": "We use analytics cookies to help understand how users use our service.",
549
- "actions": [
550
- {
551
- "text": "Accept analytics cookies",
552
- "type": "submit",
553
- "name": "cookies",
554
- "value": "accept"
555
- },
556
- {
557
- "text": "Reject analytics cookies",
558
- "type": "submit",
559
- "name": "cookies",
560
- "value": "reject"
561
- },
562
- {
563
- "text": "View cookie preferences",
564
- "href": "/cookie-preferences"
565
- }
566
- ]
567
- }
568
- ]
569
- },
570
- "hidden": true,
571
- "description": "",
572
- "pageTemplateOptions": {
573
- "htmlClasses": "govuk-template--rebranded"
574
- },
575
- "screenshot": true,
576
- "html": "<div class=\"govuk-cookie-banner\" data-nosnippet role=\"region\" aria-label=\"Cookie banner\">\n <div class=\"govuk-cookie-banner__message govuk-width-container\">\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h2 class=\"govuk-cookie-banner__heading govuk-heading-m\">\n Cookies on this government service\n </h2>\n <div class=\"govuk-cookie-banner__content\">\n <p class=\"govuk-body\">We use analytics cookies to help understand how users use our service.</p>\n </div>\n </div>\n </div>\n\n <div class=\"govuk-button-group\">\n <button value=\"accept\" type=\"submit\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\">\n Accept analytics cookies\n </button>\n <button value=\"reject\" type=\"submit\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\">\n Reject analytics cookies\n </button>\n <a class=\"govuk-link\" href=\"/cookie-preferences\">View cookie preferences</a>\n </div>\n\n </div>\n</div>"
540
+ "html": "<div class=\"govuk-cookie-banner hide-cookie-banner\" data-nosnippet role=\"region\" aria-label=\"Cookie banner\" hidden data-hide-cookie-banner=\"true\">\n <div class=\"govuk-cookie-banner__message govuk-width-container\">\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h2 class=\"govuk-cookie-banner__heading govuk-heading-m\">\n Cookies on this service\n </h2>\n <div class=\"govuk-cookie-banner__content\">\n <p class=\"govuk-body\">We use cookies to help understand how users use our service.</p>\n </div>\n </div>\n </div>\n\n <div class=\"govuk-button-group\">\n <button type=\"submit\" value=\"accept\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\">\n Accept analytics cookies\n </button>\n <button type=\"submit\" value=\"reject\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\">\n Reject analytics cookies\n </button>\n <a class=\"govuk-link\" href=\"/cookie-preferences\">View cookie preferences</a>\n </div>\n\n </div>\n <div class=\"govuk-cookie-banner__message govuk-width-container\" role=\"alert\">\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <div class=\"govuk-cookie-banner__content\">\n <p class=\"govuk-body\">Your cookie preferences have been saved. You have accepted cookies.</p>\n </div>\n </div>\n </div>\n\n <div class=\"govuk-button-group\">\n <button type=\"button\" class=\"govuk-button\" data-module=\"govuk-button\">\n Hide cookie message\n </button>\n </div>\n\n </div>\n <div class=\"govuk-cookie-banner__message govuk-width-container\" role=\"alert\">\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <div class=\"govuk-cookie-banner__content\">\n <p class=\"govuk-body\">Your cookie preferences have been saved. You have rejected cookies.</p>\n </div>\n </div>\n </div>\n\n <div class=\"govuk-button-group\">\n <button type=\"button\" class=\"govuk-button\" data-module=\"govuk-button\">\n Hide cookie message\n </button>\n </div>\n\n </div>\n</div>"
577
541
  }
578
542
  ]
579
543
  }
@@ -13,10 +13,10 @@
13
13
  </div>
14
14
 
15
15
  <div class="govuk-button-group">
16
- <button value="accept" type="submit" name="cookies" class="govuk-button" data-module="govuk-button">
16
+ <button type="submit" value="accept" name="cookies" class="govuk-button" data-module="govuk-button">
17
17
  Accept analytics cookies
18
18
  </button>
19
- <button value="reject" type="submit" name="cookies" class="govuk-button" data-module="govuk-button">
19
+ <button type="submit" value="reject" name="cookies" class="govuk-button" data-module="govuk-button">
20
20
  Reject analytics cookies
21
21
  </button>
22
22
  <a class="govuk-link" href="/cookie-preferences">View cookie preferences</a>
@@ -14,10 +14,10 @@
14
14
  </div>
15
15
 
16
16
  <div class="govuk-button-group">
17
- <button value="accept" type="submit" name="cookies" class="govuk-button" data-module="govuk-button">
17
+ <button type="submit" value="accept" name="cookies" class="govuk-button" data-module="govuk-button">
18
18
  Accept analytics cookies
19
19
  </button>
20
- <button value="reject" type="submit" name="cookies" class="govuk-button" data-module="govuk-button">
20
+ <button type="submit" value="reject" name="cookies" class="govuk-button" data-module="govuk-button">
21
21
  Reject analytics cookies
22
22
  </button>
23
23
  <a class="govuk-link" href="/cookie-preferences">View cookie preferences</a>
@@ -46,7 +46,8 @@
46
46
  // like inset text
47
47
  @media screen\0 {
48
48
  .govuk-details {
49
- border-left: $govuk-border-width-wide solid $govuk-border-colour;
49
+ border-left: $govuk-border-width-wide solid;
50
+ border-left-color: govuk-functional-colour(border);
50
51
  }
51
52
 
52
53
  .govuk-details__summary {
@@ -81,11 +82,11 @@
81
82
  padding-left: govuk-spacing(4) + $govuk-border-width;
82
83
 
83
84
  // Style the summary to look like a link...
84
- color: $govuk-link-colour;
85
+ color: govuk-functional-colour(link);
85
86
  cursor: pointer;
86
87
 
87
88
  &:hover {
88
- color: $govuk-link-hover-colour;
89
+ color: govuk-functional-colour(link-hover);
89
90
  }
90
91
 
91
92
  &:focus {
@@ -131,7 +132,8 @@
131
132
  }
132
133
 
133
134
  .govuk-details__text {
134
- border-left: $govuk-border-width solid $govuk-border-colour;
135
+ border-left: $govuk-border-width solid;
136
+ border-left-color: govuk-functional-colour(border);
135
137
  }
136
138
  }
137
139
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/govuk/components/details/_index.scss"],"names":[],"mappings":"AAAA;EACE;IACE,8BAA8B;IAC9B,0BAA0B;IAC1B,6CAA6C;;IAE7C,cAAc;EAChB;;EAEA;IACE,cAAc;EAChB;;EAEA;IACE,+BAA+B;EACjC;;EAEA;IACE;MACE,aAAa;IACf;;IAEA;;MAEE,gBAAgB;IAClB;EACF;;EAEA;IACE,6BAA6B;IAC7B,gCAAgC;IAChC,8BAA8B;EAChC;;EAEA;IACE,aAAa;IACb,+BAA+B;EACjC;;EAEA;IACE,gBAAgB;EAClB;;EAEA,oDAAoD;EACpD,2EAA2E;EAC3E,iBAAiB;EACjB;IACE;MACE,gEAAgE;IAClE;;IAEA;MACE,4BAA4B;IAC9B;;IAEA;MACE,qCAAqC;MACrC,6CAA6C;MAC7C,8BAA8B;IAChC;EACF;;EAEA,2EAA2E;EAC3E,0DAA0D;EAC1D,CAAC;EACD,+DAA+D;EAC/D,CAAC;EACD,2DAA2D;EAC3D,sEAAsE;EACtE,oEAAoE;EACpE;IACE;MACE,qDAAqD;MACrD,kBAAkB;;MAElB,oEAAoE;MACpE,0BAAkB;MAAlB,kBAAkB;;MAElB,sEAAsE;MACtE,oDAAoD;;MAEpD,0CAA0C;MAC1C,yBAAyB;MACzB,eAAe;;MAEf;QACE,+BAA+B;MACjC;;MAEA;QACE,2BAA2B;MAC7B;IACF;IACA,+CAA+C;IAC/C;MACE,8BAA8B;IAChC;;IAEA;MACE,oCAAoC;IACtC;;IAEA,+DAA+D;IAC/D;MACE,qBAAqB;IACvB;;IAEA,4EAA4E;IAC5E,mEAAmE;IACnE;MACE,aAAa;IACf;;IAEA,4DAA4D;IAC5D;MACE,WAAW;MACX,kBAAkB;;MAElB,SAAS;MACT,SAAS;MACT,OAAO;;MAEP,YAAY;;MAEZ,0DAA0D;;MAE1D;QACE,yDAAyD;MAC3D;IACF;;IAEA;MACE,2DAA2D;IAC7D;EACF;AACF","file":"_index.scss","sourcesContent":["@include govuk-exports(\"govuk/component/details\") {\n .govuk-details {\n @include govuk-font($size: 19);\n @include govuk-text-colour;\n @include govuk-responsive-margin(6, \"bottom\");\n\n display: block;\n }\n\n .govuk-details__summary {\n display: block;\n }\n\n .govuk-details[open] .govuk-details__summary {\n margin-bottom: govuk-spacing(1);\n }\n\n .govuk-details__summary-text {\n > :first-child {\n margin-top: 0;\n }\n\n > :only-child,\n > :last-child {\n margin-bottom: 0;\n }\n }\n\n .govuk-details__text {\n padding-top: govuk-spacing(3);\n padding-bottom: govuk-spacing(3);\n padding-left: govuk-spacing(4);\n }\n\n .govuk-details__text p {\n margin-top: 0;\n margin-bottom: govuk-spacing(4);\n }\n\n .govuk-details__text > :last-child {\n margin-bottom: 0;\n }\n\n // Hack to target IE8 - IE11 (and REALLY old Firefox)\n // These browsers don't support the details element, so fall back to looking\n // like inset text\n @media screen\\0 {\n .govuk-details {\n border-left: $govuk-border-width-wide solid $govuk-border-colour;\n }\n\n .govuk-details__summary {\n margin-top: govuk-spacing(3);\n }\n\n .govuk-details__summary-text {\n @include govuk-typography-weight-bold;\n @include govuk-responsive-margin(4, \"bottom\");\n padding-left: govuk-spacing(4);\n }\n }\n\n // We wrap styles for newer browsers in a feature query, which is ignored by\n // older browsers, which always expand the details element.\n //\n // Additionally, -ms-ime-align is only supported by Edge 12 - 18\n //\n // This ensures we don't use these styles in browsers which:\n // - support ES6 modules but not the <details> element (Edge 16 - 18)\n // - do not support ES6 modules or the <details> element (eg, IE8+)\n @supports not (-ms-ime-align: auto) {\n .govuk-details__summary {\n // Absolutely position the marker against this element\n position: relative;\n\n // Make the focus outline shrink-wrap the text content of the summary\n width: fit-content;\n\n // Allow for absolutely positioned marker and align with disclosed text\n padding-left: govuk-spacing(4) + $govuk-border-width;\n\n // Style the summary to look like a link...\n color: $govuk-link-colour;\n cursor: pointer;\n\n &:hover {\n color: $govuk-link-hover-colour;\n }\n\n &:focus {\n @include govuk-focused-text;\n }\n }\n // ...but only underline the text, not the arrow\n .govuk-details__summary-text {\n @include govuk-link-decoration;\n }\n\n .govuk-details__summary:hover .govuk-details__summary-text {\n @include govuk-link-hover-decoration;\n }\n\n // Remove the underline when focussed to avoid duplicate borders\n .govuk-details__summary:focus .govuk-details__summary-text {\n text-decoration: none;\n }\n\n // Remove the default details marker so we can style our own consistently and\n // ensure it displays in Firefox (see implementation.md for details)\n .govuk-details__summary::-webkit-details-marker {\n display: none;\n }\n\n // Append our own open / closed marker using a pseudo-element\n .govuk-details__summary::before {\n content: \"\";\n position: absolute;\n\n top: -1px;\n bottom: 0;\n left: 0;\n\n margin: auto;\n\n @include govuk-shape-arrow($direction: right, $base: 14px);\n\n .govuk-details[open] > & {\n @include govuk-shape-arrow($direction: down, $base: 14px);\n }\n }\n\n .govuk-details__text {\n border-left: $govuk-border-width solid $govuk-border-colour;\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../../../../src/govuk/components/details/_index.scss"],"names":[],"mappings":"AAAA;EACE;IACE,8BAA8B;IAC9B,0BAA0B;IAC1B,6CAA6C;;IAE7C,cAAc;EAChB;;EAEA;IACE,cAAc;EAChB;;EAEA;IACE,+BAA+B;EACjC;;EAEA;IACE;MACE,aAAa;IACf;;IAEA;;MAEE,gBAAgB;IAClB;EACF;;EAEA;IACE,6BAA6B;IAC7B,gCAAgC;IAChC,8BAA8B;EAChC;;EAEA;IACE,aAAa;IACb,+BAA+B;EACjC;;EAEA;IACE,gBAAgB;EAClB;;EAEA,oDAAoD;EACpD,2EAA2E;EAC3E,iBAAiB;EACjB;IACE;MACE,2CAA2C;MAC3C,kDAAkD;IACpD;;IAEA;MACE,4BAA4B;IAC9B;;IAEA;MACE,qCAAqC;MACrC,6CAA6C;MAC7C,8BAA8B;IAChC;EACF;;EAEA,2EAA2E;EAC3E,0DAA0D;EAC1D,CAAC;EACD,+DAA+D;EAC/D,CAAC;EACD,2DAA2D;EAC3D,sEAAsE;EACtE,oEAAoE;EACpE;IACE;MACE,qDAAqD;MACrD,kBAAkB;;MAElB,oEAAoE;MACpE,0BAAkB;MAAlB,kBAAkB;;MAElB,sEAAsE;MACtE,oDAAoD;;MAEpD,0CAA0C;MAC1C,oCAAoC;MACpC,eAAe;;MAEf;QACE,0CAA0C;MAC5C;;MAEA;QACE,2BAA2B;MAC7B;IACF;IACA,+CAA+C;IAC/C;MACE,8BAA8B;IAChC;;IAEA;MACE,oCAAoC;IACtC;;IAEA,+DAA+D;IAC/D;MACE,qBAAqB;IACvB;;IAEA,4EAA4E;IAC5E,mEAAmE;IACnE;MACE,aAAa;IACf;;IAEA,4DAA4D;IAC5D;MACE,WAAW;MACX,kBAAkB;;MAElB,SAAS;MACT,SAAS;MACT,OAAO;;MAEP,YAAY;;MAEZ,0DAA0D;;MAE1D;QACE,yDAAyD;MAC3D;IACF;;IAEA;MACE,sCAAsC;MACtC,kDAAkD;IACpD;EACF;AACF","file":"_index.scss","sourcesContent":["@include govuk-exports(\"govuk/component/details\") {\n .govuk-details {\n @include govuk-font($size: 19);\n @include govuk-text-colour;\n @include govuk-responsive-margin(6, \"bottom\");\n\n display: block;\n }\n\n .govuk-details__summary {\n display: block;\n }\n\n .govuk-details[open] .govuk-details__summary {\n margin-bottom: govuk-spacing(1);\n }\n\n .govuk-details__summary-text {\n > :first-child {\n margin-top: 0;\n }\n\n > :only-child,\n > :last-child {\n margin-bottom: 0;\n }\n }\n\n .govuk-details__text {\n padding-top: govuk-spacing(3);\n padding-bottom: govuk-spacing(3);\n padding-left: govuk-spacing(4);\n }\n\n .govuk-details__text p {\n margin-top: 0;\n margin-bottom: govuk-spacing(4);\n }\n\n .govuk-details__text > :last-child {\n margin-bottom: 0;\n }\n\n // Hack to target IE8 - IE11 (and REALLY old Firefox)\n // These browsers don't support the details element, so fall back to looking\n // like inset text\n @media screen\\0 {\n .govuk-details {\n border-left: $govuk-border-width-wide solid;\n border-left-color: govuk-functional-colour(border);\n }\n\n .govuk-details__summary {\n margin-top: govuk-spacing(3);\n }\n\n .govuk-details__summary-text {\n @include govuk-typography-weight-bold;\n @include govuk-responsive-margin(4, \"bottom\");\n padding-left: govuk-spacing(4);\n }\n }\n\n // We wrap styles for newer browsers in a feature query, which is ignored by\n // older browsers, which always expand the details element.\n //\n // Additionally, -ms-ime-align is only supported by Edge 12 - 18\n //\n // This ensures we don't use these styles in browsers which:\n // - support ES6 modules but not the <details> element (Edge 16 - 18)\n // - do not support ES6 modules or the <details> element (eg, IE8+)\n @supports not (-ms-ime-align: auto) {\n .govuk-details__summary {\n // Absolutely position the marker against this element\n position: relative;\n\n // Make the focus outline shrink-wrap the text content of the summary\n width: fit-content;\n\n // Allow for absolutely positioned marker and align with disclosed text\n padding-left: govuk-spacing(4) + $govuk-border-width;\n\n // Style the summary to look like a link...\n color: govuk-functional-colour(link);\n cursor: pointer;\n\n &:hover {\n color: govuk-functional-colour(link-hover);\n }\n\n &:focus {\n @include govuk-focused-text;\n }\n }\n // ...but only underline the text, not the arrow\n .govuk-details__summary-text {\n @include govuk-link-decoration;\n }\n\n .govuk-details__summary:hover .govuk-details__summary-text {\n @include govuk-link-hover-decoration;\n }\n\n // Remove the underline when focussed to avoid duplicate borders\n .govuk-details__summary:focus .govuk-details__summary-text {\n text-decoration: none;\n }\n\n // Remove the default details marker so we can style our own consistently and\n // ensure it displays in Firefox (see implementation.md for details)\n .govuk-details__summary::-webkit-details-marker {\n display: none;\n }\n\n // Append our own open / closed marker using a pseudo-element\n .govuk-details__summary::before {\n content: \"\";\n position: absolute;\n\n top: -1px;\n bottom: 0;\n left: 0;\n\n margin: auto;\n\n @include govuk-shape-arrow($direction: right, $base: 14px);\n\n .govuk-details[open] > & {\n @include govuk-shape-arrow($direction: down, $base: 14px);\n }\n }\n\n .govuk-details__text {\n border-left: $govuk-border-width solid;\n border-left-color: govuk-functional-colour(border);\n }\n }\n}\n"]}
@@ -7,7 +7,7 @@
7
7
  margin-bottom: govuk-spacing(3);
8
8
  clear: both;
9
9
 
10
- color: $govuk-error-colour;
10
+ color: govuk-functional-colour(error);
11
11
  }
12
12
  }
13
13
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/govuk/components/error-message/_index.scss"],"names":[],"mappings":"AAAA;EACE;IACE,6CAA6C;;IAE7C,cAAc;IACd,aAAa,EAAE,kDAAkD;IACjE,+BAA+B;IAC/B,WAAW;;IAEX,0BAA0B;EAC5B;AACF","file":"_index.scss","sourcesContent":["@include govuk-exports(\"govuk/component/error-message\") {\n .govuk-error-message {\n @include govuk-font($size: 19, $weight: bold);\n\n display: block;\n margin-top: 0; // Reset any default browser margins for paragraphs\n margin-bottom: govuk-spacing(3);\n clear: both;\n\n color: $govuk-error-colour;\n }\n}\n"]}
1
+ {"version":3,"sources":["../../../../src/govuk/components/error-message/_index.scss"],"names":[],"mappings":"AAAA;EACE;IACE,6CAA6C;;IAE7C,cAAc;IACd,aAAa,EAAE,kDAAkD;IACjE,+BAA+B;IAC/B,WAAW;;IAEX,qCAAqC;EACvC;AACF","file":"_index.scss","sourcesContent":["@include govuk-exports(\"govuk/component/error-message\") {\n .govuk-error-message {\n @include govuk-font($size: 19, $weight: bold);\n\n display: block;\n margin-top: 0; // Reset any default browser margins for paragraphs\n margin-bottom: govuk-spacing(3);\n clear: both;\n\n color: govuk-functional-colour(error);\n }\n}\n"]}
@@ -7,10 +7,12 @@
7
7
  @include govuk-responsive-padding(4);
8
8
  @include govuk-responsive-margin(8, "bottom");
9
9
 
10
- border: $govuk-border-width solid $govuk-error-colour;
10
+ border: $govuk-border-width solid;
11
+ border-color: govuk-functional-colour(error);
11
12
 
12
13
  &:focus {
13
- outline: $govuk-focus-width solid $govuk-focus-colour;
14
+ outline: $govuk-focus-width solid;
15
+ outline-color: govuk-functional-colour(focus);
14
16
  }
15
17
  }
16
18
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/govuk/components/error-summary/_index.scss"],"names":[],"mappings":"AAAA,0BAA0B;;AAE1B;EACE;IACE,8BAA8B;IAC9B,0BAA0B;IAC1B,oCAAoC;IACpC,6CAA6C;;IAE7C,qDAAqD;;IAErD;MACE,qDAAqD;IACvD;EACF;;EAEA;IACE,mCAAmC;IACnC,qCAAqC;;IAErC,aAAa;IACb,6CAA6C;EAC/C;;EAEA;IACE;MACE,gBAAgB;IAClB;;IAEA;MACE,0CAA0C;IAC5C;;IAEA;MACE,6CAA6C;IAC/C;EACF;;EAEA,2DAA2D;EAC3D;IACE,gBAAgB;EAClB;;EAEA,kDAAkD;EAClD;IACE,gBAAgB;EAClB;;EAEA;IACE,qCAAqC;IACrC,0BAA0B;IAC1B,+BAA+B;EACjC;AACF","file":"_index.scss","sourcesContent":["@import \"../../core/lists\";\n\n@include govuk-exports(\"govuk/component/error-summary\") {\n .govuk-error-summary {\n @include govuk-font($size: 19);\n @include govuk-text-colour;\n @include govuk-responsive-padding(4);\n @include govuk-responsive-margin(8, \"bottom\");\n\n border: $govuk-border-width solid $govuk-error-colour;\n\n &:focus {\n outline: $govuk-focus-width solid $govuk-focus-colour;\n }\n }\n\n .govuk-error-summary__title {\n @include govuk-font-size($size: 24);\n @include govuk-typography-weight-bold;\n\n margin-top: 0;\n @include govuk-responsive-margin(4, \"bottom\");\n }\n\n .govuk-error-summary__body {\n p {\n margin-bottom: 0;\n }\n\n > * + * {\n @include govuk-responsive-margin(4, \"top\");\n }\n\n > :last-child {\n @include govuk-responsive-margin(1, \"bottom\");\n }\n }\n\n // Cross-component class - adjusts styling of list component\n .govuk-error-summary__list {\n margin-bottom: 0;\n }\n\n // Remove the bottom margin from the last list item\n .govuk-error-summary__list li:last-child {\n margin-bottom: 0;\n }\n\n .govuk-error-summary__list a {\n @include govuk-typography-weight-bold;\n @include govuk-link-common;\n @include govuk-link-style-error;\n }\n}\n"]}
1
+ {"version":3,"sources":["../../../../src/govuk/components/error-summary/_index.scss"],"names":[],"mappings":"AAAA,0BAA0B;;AAE1B;EACE;IACE,8BAA8B;IAC9B,0BAA0B;IAC1B,oCAAoC;IACpC,6CAA6C;;IAE7C,iCAAiC;IACjC,4CAA4C;;IAE5C;MACE,iCAAiC;MACjC,6CAA6C;IAC/C;EACF;;EAEA;IACE,mCAAmC;IACnC,qCAAqC;;IAErC,aAAa;IACb,6CAA6C;EAC/C;;EAEA;IACE;MACE,gBAAgB;IAClB;;IAEA;MACE,0CAA0C;IAC5C;;IAEA;MACE,6CAA6C;IAC/C;EACF;;EAEA,2DAA2D;EAC3D;IACE,gBAAgB;EAClB;;EAEA,kDAAkD;EAClD;IACE,gBAAgB;EAClB;;EAEA;IACE,qCAAqC;IACrC,0BAA0B;IAC1B,+BAA+B;EACjC;AACF","file":"_index.scss","sourcesContent":["@import \"../../core/lists\";\n\n@include govuk-exports(\"govuk/component/error-summary\") {\n .govuk-error-summary {\n @include govuk-font($size: 19);\n @include govuk-text-colour;\n @include govuk-responsive-padding(4);\n @include govuk-responsive-margin(8, \"bottom\");\n\n border: $govuk-border-width solid;\n border-color: govuk-functional-colour(error);\n\n &:focus {\n outline: $govuk-focus-width solid;\n outline-color: govuk-functional-colour(focus);\n }\n }\n\n .govuk-error-summary__title {\n @include govuk-font-size($size: 24);\n @include govuk-typography-weight-bold;\n\n margin-top: 0;\n @include govuk-responsive-margin(4, \"bottom\");\n }\n\n .govuk-error-summary__body {\n p {\n margin-bottom: 0;\n }\n\n > * + * {\n @include govuk-responsive-margin(4, \"top\");\n }\n\n > :last-child {\n @include govuk-responsive-margin(1, \"bottom\");\n }\n }\n\n // Cross-component class - adjusts styling of list component\n .govuk-error-summary__list {\n margin-bottom: 0;\n }\n\n // Remove the bottom margin from the last list item\n .govuk-error-summary__list li:last-child {\n margin-bottom: 0;\n }\n\n .govuk-error-summary__list a {\n @include govuk-typography-weight-bold;\n @include govuk-link-common;\n @include govuk-link-style-error;\n }\n}\n"]}