govuk_publishing_components 60.0.2 → 60.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 (229) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +5 -0
  3. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +7 -3
  4. data/lib/govuk_publishing_components/version.rb +1 -1
  5. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +3 -2
  6. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -1
  7. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +3 -2
  8. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -1
  9. data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
  10. data/node_modules/govuk-frontend/dist/govuk/common/index.mjs +1 -1
  11. data/node_modules/govuk-frontend/dist/govuk/common/index.mjs.map +1 -1
  12. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js.map +1 -1
  13. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs.map +1 -1
  14. data/node_modules/govuk-frontend/dist/govuk/components/accordion/fixtures.json +102 -97
  15. data/node_modules/govuk-frontend/dist/govuk/components/back-link/fixtures.json +21 -32
  16. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/fixtures.json +25 -45
  17. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-default.html +6 -0
  18. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js.map +1 -1
  19. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs.map +1 -1
  20. data/node_modules/govuk-frontend/dist/govuk/components/button/fixtures.json +66 -210
  21. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js.map +1 -1
  22. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs.map +1 -1
  23. data/node_modules/govuk-frontend/dist/govuk/components/character-count/fixtures.json +72 -86
  24. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js.map +1 -1
  25. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs.map +1 -1
  26. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/fixtures.json +305 -464
  27. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-default.html +24 -19
  28. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-and-none.html +2 -4
  29. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-none-and-conditional-items.html +2 -4
  30. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-error-message.html +12 -3
  31. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/{template-with-fieldset-and-error-message.html → template-with-hint.html} +5 -5
  32. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-hints-on-items.html +2 -4
  33. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-pre-checked-values.html +36 -27
  34. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-very-long-option-text.html +2 -5
  35. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/fixtures.json +79 -79
  36. data/node_modules/govuk-frontend/dist/govuk/components/date-input/fixtures.json +147 -159
  37. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-default.html +30 -22
  38. data/node_modules/govuk-frontend/dist/govuk/components/details/fixtures.json +22 -22
  39. data/node_modules/govuk-frontend/dist/govuk/components/error-message/fixtures.json +10 -10
  40. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js.map +1 -1
  41. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs.map +1 -1
  42. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/fixtures.json +21 -21
  43. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js.map +1 -1
  44. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs.map +1 -1
  45. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/fixtures.json +19 -19
  46. data/node_modules/govuk-frontend/dist/govuk/components/fieldset/fixtures.json +19 -19
  47. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js.map +1 -1
  48. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs.map +1 -1
  49. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/fixtures.json +99 -150
  50. data/node_modules/govuk-frontend/dist/govuk/components/footer/fixtures.json +50 -63
  51. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +10 -4
  52. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +1 -1
  53. data/node_modules/govuk-frontend/dist/govuk/components/header/fixtures.json +155 -103
  54. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +2 -1
  55. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js.map +1 -1
  56. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +2 -1
  57. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs.map +1 -1
  58. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs +1 -0
  59. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs.map +1 -1
  60. data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width-with-navigation.html +0 -1
  61. data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width.html +0 -1
  62. data/node_modules/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-html.html +0 -3
  63. data/node_modules/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-text-without-link.html +0 -3
  64. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-full-width-border.html +0 -1
  65. data/node_modules/govuk-frontend/dist/govuk/components/hint/fixtures.json +7 -7
  66. data/node_modules/govuk-frontend/dist/govuk/components/input/fixtures.json +158 -179
  67. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/fixtures.json +7 -7
  68. data/node_modules/govuk-frontend/dist/govuk/components/label/fixtures.json +18 -18
  69. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/fixtures.json +74 -108
  70. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js.map +1 -1
  71. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs.map +1 -1
  72. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-text-as-html.html +7 -1
  73. data/node_modules/govuk-frontend/dist/govuk/components/pagination/fixtures.json +80 -98
  74. data/node_modules/govuk-frontend/dist/govuk/components/pagination/macro-options.json +4 -4
  75. data/node_modules/govuk-frontend/dist/govuk/components/panel/fixtures.json +22 -22
  76. data/node_modules/govuk-frontend/dist/govuk/components/password-input/fixtures.json +53 -48
  77. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js.map +1 -1
  78. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs.map +1 -1
  79. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/fixtures.json +8 -8
  80. data/node_modules/govuk-frontend/dist/govuk/components/radios/fixtures.json +213 -328
  81. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js.map +1 -1
  82. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs.map +1 -1
  83. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-default.html +18 -16
  84. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-hint.html +24 -0
  85. data/node_modules/govuk-frontend/dist/govuk/components/select/fixtures.json +99 -115
  86. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +72 -5
  87. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss.map +1 -1
  88. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/fixtures.json +198 -62
  89. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/macro-options.json +6 -0
  90. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +1 -1
  91. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js.map +1 -1
  92. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs +1 -1
  93. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs.map +1 -1
  94. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/{template-with-navigation-with-an-active-item.html → template-inverse.html} +7 -2
  95. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-a-single-navigation-item-and-collapsenavigationonmobile-set-to-true.html +38 -0
  96. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-a-single-navigation-item.html +35 -0
  97. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-collapsenavigationonmobile-set-to-false.html +60 -0
  98. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template.njk +3 -0
  99. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/fixtures.json +10 -10
  100. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js.map +1 -1
  101. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs.map +1 -1
  102. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/fixtures.json +282 -518
  103. data/node_modules/govuk-frontend/dist/govuk/components/table/fixtures.json +75 -75
  104. data/node_modules/govuk-frontend/dist/govuk/components/tabs/fixtures.json +44 -39
  105. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js +1 -1
  106. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js.map +1 -1
  107. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs +1 -1
  108. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs.map +1 -1
  109. data/node_modules/govuk-frontend/dist/govuk/components/tag/fixtures.json +14 -26
  110. data/node_modules/govuk-frontend/dist/govuk/components/task-list/fixtures.json +14 -71
  111. data/node_modules/govuk-frontend/dist/govuk/components/textarea/fixtures.json +81 -81
  112. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/fixtures.json +9 -9
  113. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +5 -2
  114. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss.map +1 -1
  115. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
  116. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
  117. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
  118. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -1
  119. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +31 -2
  120. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss.map +1 -1
  121. data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss +4 -1
  122. data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss.map +1 -1
  123. data/node_modules/govuk-frontend/dist/govuk/macros/logo.njk +2 -2
  124. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss +2 -2
  125. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss.map +1 -1
  126. data/node_modules/govuk-frontend/dist/govuk/settings/_index.scss +13 -0
  127. data/node_modules/govuk-frontend/dist/govuk/settings/_index.scss.map +1 -1
  128. data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +1 -1
  129. data/node_modules/govuk-frontend/package.json +7 -7
  130. metadata +13 -102
  131. data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-with-focusable-elements-inside.html +0 -26
  132. data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-with-one-section-open.html +0 -30
  133. data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-with-translations.html +0 -30
  134. data/node_modules/govuk-frontend/dist/govuk/components/back-link/template-with-custom-link.html +0 -1
  135. data/node_modules/govuk-frontend/dist/govuk/components/back-link/template-with-custom-text.html +0 -1
  136. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-with-multiple-levels.html +0 -16
  137. data/node_modules/govuk-frontend/dist/govuk/components/button/template-input-disabled.html +0 -1
  138. data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-disabled.html +0 -3
  139. data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-link.html +0 -3
  140. data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-start.html +0 -6
  141. data/node_modules/govuk-frontend/dist/govuk/components/button/template-prevent-double-click.html +0 -3
  142. data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary-disabled.html +0 -3
  143. data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary-link.html +0 -3
  144. data/node_modules/govuk-frontend/dist/govuk/components/button/template-start-link.html +0 -6
  145. data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning-disabled.html +0 -3
  146. data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning-link.html +0 -3
  147. data/node_modules/govuk-frontend/dist/govuk/components/button/template-with-active-state.html +0 -3
  148. data/node_modules/govuk-frontend/dist/govuk/components/button/template-with-focus-state.html +0 -3
  149. data/node_modules/govuk-frontend/dist/govuk/components/button/template-with-hover-state.html +0 -3
  150. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-custom-textarea-description.html +0 -9
  151. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-error.html +0 -12
  152. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-translations.html +0 -9
  153. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-disabled.html +0 -27
  154. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-a-medium-legend.html +0 -33
  155. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-conditional-item-checked.html +0 -39
  156. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-conditional-items-with-special-characters.html +0 -39
  157. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-disabled-item.html +0 -29
  158. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-error-message-and-hints-on-items.html +0 -39
  159. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-id-and-name.html +0 -30
  160. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-single-option-and-hint-set-aria-describedby-on-input.html +0 -16
  161. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-single-option-set-aria-describedby-on-input.html +0 -13
  162. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-without-fieldset.html +0 -22
  163. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-client-side-implementation.html +0 -60
  164. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-autocomplete-values.html +0 -36
  165. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-default-items.html +0 -36
  166. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-input-attributes.html +0 -36
  167. data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-optional-form-group-classes.html +0 -36
  168. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/template-translated.html +0 -5
  169. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-direct-media-capture.html +0 -6
  170. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-image-files-only.html +0 -6
  171. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-multiple-files.html +0 -6
  172. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-disabled.html +0 -6
  173. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-disabled.html +0 -13
  174. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-optional-form-group-classes.html +0 -6
  175. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-meta.html +0 -56
  176. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-label.html +0 -59
  177. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-navigation-label.html +0 -59
  178. data/node_modules/govuk-frontend/dist/govuk/components/input/template-disabled.html +0 -6
  179. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-autocapitalize-turned-off.html +0 -6
  180. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-autocomplete-attribute.html +0 -6
  181. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-optional-form-group-classes.html +0 -6
  182. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-pattern-attribute.html +0 -6
  183. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-prefix-and-long-suffix.html +0 -10
  184. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-spellcheck-disabled.html +0 -6
  185. data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-spellcheck-enabled.html +0 -6
  186. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-auto-focus-disabled-with-type-as-success.html +0 -12
  187. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-auto-focus-explicitly-enabled-with-type-as-success.html +0 -12
  188. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-custom-tabindex.html +0 -12
  189. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-paragraph-as-html-heading.html +0 -10
  190. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-rolealert-overridden-to-roleregion-with-type-as-success.html +0 -12
  191. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-success-with-custom-html.html +0 -16
  192. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-a-list.html +0 -16
  193. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-custom-accessible-labels-on-item-links.html +0 -39
  194. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-custom-navigation-landmark.html +0 -39
  195. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-in-a-different-language.html +0 -22
  196. data/node_modules/govuk-frontend/dist/govuk/components/panel/template-custom-heading-level.html +0 -8
  197. data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-new-password-autocomplete.html +0 -11
  198. data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-translations.html +0 -11
  199. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-prechecked-using-value.html +0 -16
  200. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-prechecked.html +0 -19
  201. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-inline-extreme.html +0 -69
  202. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-disabled.html +0 -27
  203. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-a-medium-legend.html +0 -24
  204. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items-with-special-characters.html +0 -39
  205. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-disabled.html +0 -29
  206. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-idprefix.html +0 -16
  207. data/node_modules/govuk-frontend/dist/govuk/components/select/template-id.html +0 -7
  208. data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-no-items.html +0 -7
  209. data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-optional-form-group-classes.html +0 -10
  210. data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-selected-value.html +0 -10
  211. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-a-custom-header-level.html +0 -28
  212. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-check-your-answers.html +0 -98
  213. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-overridden-widths.html +0 -58
  214. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-translated.html +0 -51
  215. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-with-no-first-action.html +0 -58
  216. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-with-some-actions.html +0 -45
  217. data/node_modules/govuk-frontend/dist/govuk/components/table/template-with-small-text-modifier-for-tables-with-a-lot-of-data.html +0 -19
  218. data/node_modules/govuk-frontend/dist/govuk/components/tag/template-blue.html +0 -3
  219. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-example-with-3-states.html +0 -49
  220. data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-autocomplete-attribute.html +0 -6
  221. data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-optional-form-group-classes.html +0 -6
  222. data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-spellcheck-disabled.html +0 -6
  223. data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-spellcheck-enabled.html +0 -6
  224. /data/node_modules/govuk-frontend/dist/govuk/components/date-input/{template-complete-question.html → template-with-items.html} +0 -0
  225. /data/node_modules/govuk-frontend/dist/govuk/components/table/{template-table-with-head-and-caption.html → template-with-head-and-caption.html} +0 -0
  226. /data/node_modules/govuk-frontend/dist/govuk/components/table/{template-table-with-head.html → template-with-head.html} +0 -0
  227. /data/node_modules/govuk-frontend/dist/govuk/components/task-list/{template-example-with-all-possible-colours.html → template-with-all-possible-colours.html} +0 -0
  228. /data/node_modules/govuk-frontend/dist/govuk/components/task-list/{template-example-with-hint-text-and-additional-states.html → template-with-hint-text-and-additional-states.html} +0 -0
  229. /data/node_modules/govuk-frontend/dist/govuk/components/task-list/{template-example-with-very-long-single-word-tags.html → template-with-very-long-single-word-tags.html} +0 -0
@@ -12,26 +12,14 @@
12
12
  },
13
13
  "hidden": false,
14
14
  "description": "",
15
- "previewLayoutModifiers": [],
16
- "screenshot": false,
17
- "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"more-detail\">\n Can you provide more detail?\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"more-detail\" name=\"more-detail\" rows=\"5\" aria-describedby=\"more-detail-info\"></textarea>\n <div id=\"more-detail-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
18
- },
19
- {
20
- "name": "with custom textarea description",
21
- "options": {
22
- "name": "custom-textarea-description",
23
- "id": "custom-textarea-description",
24
- "maxlength": 10,
25
- "label": {
26
- "text": "Can you provide more detail?"
27
- },
28
- "textareaDescriptionText": "Gallwch ddefnyddio hyd at %{count} nod"
15
+ "pageTemplateOptions": {},
16
+ "screenshot": {
17
+ "variants": [
18
+ "default",
19
+ "no-js"
20
+ ]
29
21
  },
30
- "hidden": false,
31
- "description": "with textarea description translated into Welsh.",
32
- "previewLayoutModifiers": [],
33
- "screenshot": false,
34
- "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"custom-textarea-description\">\n Can you provide more detail?\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"custom-textarea-description\" name=\"custom-textarea-description\" rows=\"5\" aria-describedby=\"custom-textarea-description-info\"></textarea>\n <div id=\"custom-textarea-description-info\" class=\"govuk-hint govuk-character-count__message\">\n Gallwch ddefnyddio hyd at 10 nod\n </div>\n</div>"
22
+ "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"more-detail\">\n Can you provide more detail?\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"more-detail\" name=\"more-detail\" rows=\"5\" aria-describedby=\"more-detail-info\"></textarea>\n <div id=\"more-detail-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
35
23
  },
36
24
  {
37
25
  "name": "with hint",
@@ -48,29 +36,10 @@
48
36
  },
49
37
  "hidden": false,
50
38
  "description": "",
51
- "previewLayoutModifiers": [],
39
+ "pageTemplateOptions": {},
52
40
  "screenshot": false,
53
41
  "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"with-hint\">\n Can you provide more detail?\n </label>\n <div id=\"with-hint-hint\" class=\"govuk-hint\">\n Don&#39;t include personal or financial information, eg your National Insurance number or credit card details.\n </div>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"with-hint\" name=\"with-hint\" rows=\"5\" aria-describedby=\"with-hint-info with-hint-hint\"></textarea>\n <div id=\"with-hint-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
54
42
  },
55
- {
56
- "name": "with error",
57
- "options": {
58
- "name": "with-error",
59
- "id": "with-error",
60
- "maxlength": 10,
61
- "label": {
62
- "text": "Can you provide more detail?"
63
- },
64
- "errorMessage": {
65
- "text": "Please provide more detail"
66
- }
67
- },
68
- "hidden": false,
69
- "description": "",
70
- "previewLayoutModifiers": [],
71
- "screenshot": false,
72
- "html": "<div class=\"govuk-form-group govuk-form-group--error govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"with-error\">\n Can you provide more detail?\n </label>\n <p id=\"with-error-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Please provide more detail\n </p>\n <textarea class=\"govuk-textarea govuk-textarea--error govuk-js-character-count\" id=\"with-error\" name=\"with-error\" rows=\"5\" aria-describedby=\"with-error-info with-error-error\"></textarea>\n <div id=\"with-error-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
73
- },
74
43
  {
75
44
  "name": "with hint and error",
76
45
  "options": {
@@ -89,7 +58,7 @@
89
58
  },
90
59
  "hidden": false,
91
60
  "description": "",
92
- "previewLayoutModifiers": [],
61
+ "pageTemplateOptions": {},
93
62
  "screenshot": false,
94
63
  "html": "<div class=\"govuk-form-group govuk-form-group--error govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"with-error\">\n Can you provide more detail?\n </label>\n <div id=\"with-error-hint\" class=\"govuk-hint\">\n Don&#39;t include personal or financial information, eg your National Insurance number or credit card details.\n </div>\n <p id=\"with-error-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Please provide more detail\n </p>\n <textarea class=\"govuk-textarea govuk-textarea--error govuk-js-character-count\" id=\"with-error\" name=\"with-error\" rows=\"5\" aria-describedby=\"with-error-info with-error-hint with-error-error\"></textarea>\n <div id=\"with-error-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
95
64
  },
@@ -106,7 +75,7 @@
106
75
  },
107
76
  "hidden": false,
108
77
  "description": "",
109
- "previewLayoutModifiers": [],
78
+ "pageTemplateOptions": {},
110
79
  "screenshot": false,
111
80
  "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"100\">\n <label class=\"govuk-label\" for=\"with-default-value\">\n Full address\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"with-default-value\" name=\"default-value\" rows=\"5\" aria-describedby=\"with-default-value-info\">221B Baker Street\nLondon\nNW1 6XE\n</textarea>\n <div id=\"with-default-value-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 100 characters\n </div>\n</div>"
112
81
  },
@@ -126,7 +95,7 @@
126
95
  },
127
96
  "hidden": false,
128
97
  "description": "",
129
- "previewLayoutModifiers": [],
98
+ "pageTemplateOptions": {},
130
99
  "screenshot": false,
131
100
  "html": "<div class=\"govuk-form-group govuk-form-group--error govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"exceeding-characters\">\n Full address\n </label>\n <p id=\"exceeding-characters-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Please do not exceed the maximum allowed limit\n </p>\n <textarea class=\"govuk-textarea govuk-textarea--error govuk-js-character-count\" id=\"exceeding-characters\" name=\"exceeding\" rows=\"5\" aria-describedby=\"exceeding-characters-info exceeding-characters-error\">221B Baker Street\nLondon\nNW1 6XE\n</textarea>\n <div id=\"exceeding-characters-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
132
101
  },
@@ -143,7 +112,7 @@
143
112
  },
144
113
  "hidden": false,
145
114
  "description": "",
146
- "previewLayoutModifiers": [],
115
+ "pageTemplateOptions": {},
147
116
  "screenshot": false,
148
117
  "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"custom-rows\">\n Full address\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"custom-rows\" name=\"custom\" rows=\"8\" aria-describedby=\"custom-rows-info\"></textarea>\n <div id=\"custom-rows-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
149
118
  },
@@ -161,7 +130,7 @@
161
130
  },
162
131
  "hidden": false,
163
132
  "description": "",
164
- "previewLayoutModifiers": [],
133
+ "pageTemplateOptions": {},
165
134
  "screenshot": false,
166
135
  "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <h1 class=\"govuk-label-wrapper\">\n <label class=\"govuk-label govuk-label--l\" for=\"textarea-with-page-heading\">\n Full address\n </label>\n </h1>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"textarea-with-page-heading\" name=\"address\" rows=\"5\" aria-describedby=\"textarea-with-page-heading-info\"></textarea>\n <div id=\"textarea-with-page-heading-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
167
136
  },
@@ -177,7 +146,7 @@
177
146
  },
178
147
  "hidden": false,
179
148
  "description": "",
180
- "previewLayoutModifiers": [],
149
+ "pageTemplateOptions": {},
181
150
  "screenshot": false,
182
151
  "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxwords=\"10\">\n <label class=\"govuk-label\" for=\"word-count\">\n Full address\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"word-count\" name=\"word-count\" rows=\"5\" aria-describedby=\"word-count-info\"></textarea>\n <div id=\"word-count-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 words\n </div>\n</div>"
183
152
  },
@@ -194,43 +163,26 @@
194
163
  },
195
164
  "hidden": false,
196
165
  "description": "",
197
- "previewLayoutModifiers": [],
166
+ "pageTemplateOptions": {},
198
167
  "screenshot": false,
199
168
  "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\" data-threshold=\"75\">\n <label class=\"govuk-label\" for=\"with-threshold\">\n Full address\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"with-threshold\" name=\"with-threshold\" rows=\"5\" aria-describedby=\"with-threshold-info\"></textarea>\n <div id=\"with-threshold-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
200
169
  },
201
170
  {
202
- "name": "with translations",
171
+ "name": "with custom textarea description",
203
172
  "options": {
204
- "id": "with-translations",
205
- "name": "with-translations",
173
+ "name": "custom-textarea-description",
174
+ "id": "custom-textarea-description",
206
175
  "maxlength": 10,
207
176
  "label": {
208
- "text": "Full address"
209
- },
210
- "charactersUnderLimitText": {
211
- "other": "%{count} characters to go",
212
- "one": "One character to go"
213
- },
214
- "charactersAtLimitText": "Zero characters left",
215
- "charactersOverLimitText": {
216
- "other": "%{count} characters too many",
217
- "one": "One character too many"
218
- },
219
- "wordsUnderLimitText": {
220
- "other": "%{count} words to go",
221
- "one": "One word to go"
177
+ "text": "Can you provide more detail?"
222
178
  },
223
- "wordsAtLimitText": "Zero words left",
224
- "wordsOverLimitText": {
225
- "other": "%{count} words too many",
226
- "one": "One word too many"
227
- }
179
+ "textareaDescriptionText": "Gallwch ddefnyddio hyd at %{count} nod"
228
180
  },
229
- "hidden": false,
230
- "description": "",
231
- "previewLayoutModifiers": [],
181
+ "hidden": true,
182
+ "description": "with textarea description translated into Welsh.",
183
+ "pageTemplateOptions": {},
232
184
  "screenshot": false,
233
- "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\" data-i18n.characters-under-limit.other=\"%{count} characters to go\" data-i18n.characters-under-limit.one=\"One character to go\" data-i18n.characters-at-limit=\"Zero characters left\" data-i18n.characters-over-limit.other=\"%{count} characters too many\" data-i18n.characters-over-limit.one=\"One character too many\" data-i18n.words-under-limit.other=\"%{count} words to go\" data-i18n.words-under-limit.one=\"One word to go\" data-i18n.words-at-limit=\"Zero words left\" data-i18n.words-over-limit.other=\"%{count} words too many\" data-i18n.words-over-limit.one=\"One word too many\">\n <label class=\"govuk-label\" for=\"with-translations\">\n Full address\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"with-translations\" name=\"with-translations\" rows=\"5\" aria-describedby=\"with-translations-info\"></textarea>\n <div id=\"with-translations-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
185
+ "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"custom-textarea-description\">\n Can you provide more detail?\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"custom-textarea-description\" name=\"custom-textarea-description\" rows=\"5\" aria-describedby=\"custom-textarea-description-info\"></textarea>\n <div id=\"custom-textarea-description-info\" class=\"govuk-hint govuk-character-count__message\">\n Gallwch ddefnyddio hyd at 10 nod\n </div>\n</div>"
234
186
  },
235
187
  {
236
188
  "name": "classes",
@@ -245,7 +197,7 @@
245
197
  },
246
198
  "hidden": true,
247
199
  "description": "",
248
- "previewLayoutModifiers": [],
200
+ "pageTemplateOptions": {},
249
201
  "screenshot": false,
250
202
  "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"with-classes\">\n With classes\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count app-character-count--custom-modifier\" id=\"with-classes\" name=\"with-classes\" rows=\"5\" aria-describedby=\"with-classes-info\"></textarea>\n <div id=\"with-classes-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
251
203
  },
@@ -261,7 +213,7 @@
261
213
  },
262
214
  "hidden": true,
263
215
  "description": "",
264
- "previewLayoutModifiers": [],
216
+ "pageTemplateOptions": {},
265
217
  "screenshot": false,
266
218
  "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"character-count-id\">\n With custom id\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"character-count-id\" name=\"test-name\" rows=\"5\" aria-describedby=\"character-count-id-info\"></textarea>\n <div id=\"character-count-id-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
267
219
  },
@@ -280,7 +232,7 @@
280
232
  },
281
233
  "hidden": true,
282
234
  "description": "",
283
- "previewLayoutModifiers": [],
235
+ "pageTemplateOptions": {},
284
236
  "screenshot": false,
285
237
  "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"with-attributes\">\n With attributes\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"with-attributes\" name=\"with-attributes\" rows=\"5\" aria-describedby=\"with-attributes-info\" data-attribute=\"my data value\"></textarea>\n <div id=\"with-attributes-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
286
238
  },
@@ -299,7 +251,7 @@
299
251
  },
300
252
  "hidden": true,
301
253
  "description": "",
302
- "previewLayoutModifiers": [],
254
+ "pageTemplateOptions": {},
303
255
  "screenshot": false,
304
256
  "html": "<div class=\"govuk-form-group govuk-character-count app-character-count--custom-modifier\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"with-formgroup\">\n With formgroup\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"with-formgroup\" name=\"with-formgroup\" rows=\"5\" aria-describedby=\"with-formgroup-info\"></textarea>\n <div id=\"with-formgroup-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
305
257
  },
@@ -318,7 +270,7 @@
318
270
  },
319
271
  "hidden": true,
320
272
  "description": "",
321
- "previewLayoutModifiers": [],
273
+ "pageTemplateOptions": {},
322
274
  "screenshot": false,
323
275
  "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"with-custom-countmessage-class\">\n With custom countMessage class\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"with-custom-countmessage-class\" name=\"with-custom-countmessage-class\" rows=\"5\" aria-describedby=\"with-custom-countmessage-class-info\"></textarea>\n <div id=\"with-custom-countmessage-class-info\" class=\"govuk-hint govuk-character-count__message app-custom-count-message\">\n You can enter up to 10 characters\n </div>\n</div>"
324
276
  },
@@ -335,7 +287,7 @@
335
287
  },
336
288
  "hidden": true,
337
289
  "description": "",
338
- "previewLayoutModifiers": [],
290
+ "pageTemplateOptions": {},
339
291
  "screenshot": false,
340
292
  "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"with-spellcheck\">\n With spellcheck\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"with-spellcheck\" name=\"with-spellcheck\" rows=\"5\" spellcheck=\"true\" aria-describedby=\"with-spellcheck-info\"></textarea>\n <div id=\"with-spellcheck-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
341
293
  },
@@ -352,7 +304,7 @@
352
304
  },
353
305
  "hidden": true,
354
306
  "description": "",
355
- "previewLayoutModifiers": [],
307
+ "pageTemplateOptions": {},
356
308
  "screenshot": false,
357
309
  "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"without-spellcheck\">\n Without spellcheck\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"without-spellcheck\" name=\"without-spellcheck\" rows=\"5\" spellcheck=\"false\" aria-describedby=\"without-spellcheck-info\"></textarea>\n <div id=\"without-spellcheck-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
358
310
  },
@@ -372,7 +324,7 @@
372
324
  },
373
325
  "hidden": true,
374
326
  "description": "",
375
- "previewLayoutModifiers": [],
327
+ "pageTemplateOptions": {},
376
328
  "screenshot": false,
377
329
  "html": "<div class=\"govuk-form-group govuk-form-group--error govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"with-custom-error-class\">\n With custom error class\n </label>\n <p id=\"with-custom-error-class-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Error message\n </p>\n <textarea class=\"govuk-textarea govuk-textarea--error govuk-js-character-count app-character-count--custom-modifier\" id=\"with-custom-error-class\" name=\"with-custom-error-class\" rows=\"5\" aria-describedby=\"with-custom-error-class-info with-custom-error-class-error\"></textarea>\n <div id=\"with-custom-error-class-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
378
330
  },
@@ -388,7 +340,7 @@
388
340
  },
389
341
  "hidden": true,
390
342
  "description": "",
391
- "previewLayoutModifiers": [],
343
+ "pageTemplateOptions": {},
392
344
  "screenshot": false,
393
345
  "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"1_more-detail\">\n Can you provide more detail?\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"1_more-detail\" name=\"more-detail\" rows=\"5\" aria-describedby=\"1_more-detail-info\"></textarea>\n <div id=\"1_more-detail-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
394
346
  },
@@ -404,7 +356,7 @@
404
356
  },
405
357
  "hidden": true,
406
358
  "description": "",
407
- "previewLayoutModifiers": [],
359
+ "pageTemplateOptions": {},
408
360
  "screenshot": false,
409
361
  "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"user1.profile[address]\">\n Full address\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"user1.profile[address]\" name=\"address\" rows=\"5\" aria-describedby=\"user1.profile[address]-info\"></textarea>\n <div id=\"user1.profile[address]-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
410
362
  },
@@ -423,7 +375,7 @@
423
375
  },
424
376
  "hidden": true,
425
377
  "description": "",
426
- "previewLayoutModifiers": [],
378
+ "pageTemplateOptions": {},
427
379
  "screenshot": false,
428
380
  "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\">\n <label class=\"govuk-label\" for=\"maxlength-should-be-removed\">\n Full address\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"maxlength-should-be-removed\" name=\"address\" rows=\"5\" aria-describedby=\"maxlength-should-be-removed-info\" maxlength=\"10\"></textarea>\n <div id=\"maxlength-should-be-removed-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
429
381
  },
@@ -438,7 +390,7 @@
438
390
  },
439
391
  "hidden": true,
440
392
  "description": "",
441
- "previewLayoutModifiers": [],
393
+ "pageTemplateOptions": {},
442
394
  "screenshot": false,
443
395
  "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\">\n <label class=\"govuk-label\" for=\"to-configure-in-javascript\">\n Full address\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"to-configure-in-javascript\" name=\"address\" rows=\"5\" aria-describedby=\"to-configure-in-javascript-info\"></textarea>\n <div id=\"to-configure-in-javascript-info\" class=\"govuk-hint govuk-character-count__message\">\n \n </div>\n</div>"
444
396
  },
@@ -454,7 +406,7 @@
454
406
  },
455
407
  "hidden": true,
456
408
  "description": "",
457
- "previewLayoutModifiers": [],
409
+ "pageTemplateOptions": {},
458
410
  "screenshot": false,
459
411
  "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-i18n.textarea-description.other=\"No more than %{count} characters\">\n <label class=\"govuk-label\" for=\"no-maximum\">\n Full address\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"no-maximum\" name=\"no-maximum\" rows=\"5\" aria-describedby=\"no-maximum-info\"></textarea>\n <div id=\"no-maximum-info\" class=\"govuk-hint govuk-character-count__message\">\n \n </div>\n</div>"
460
412
  },
@@ -469,9 +421,43 @@
469
421
  },
470
422
  "hidden": true,
471
423
  "description": "",
472
- "previewLayoutModifiers": [],
424
+ "pageTemplateOptions": {},
473
425
  "screenshot": false,
474
426
  "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\">\n <label class=\"govuk-label\" for=\"no-maximum\">\n Full address\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"no-maximum\" name=\"no-maximum\" rows=\"5\" aria-describedby=\"no-maximum-info\"></textarea>\n <div id=\"no-maximum-info\" class=\"govuk-hint govuk-character-count__message\">\n \n </div>\n</div>"
427
+ },
428
+ {
429
+ "name": "with translations",
430
+ "options": {
431
+ "id": "with-translations",
432
+ "name": "with-translations",
433
+ "maxlength": 10,
434
+ "label": {
435
+ "text": "Full address"
436
+ },
437
+ "charactersUnderLimitText": {
438
+ "other": "%{count} characters to go",
439
+ "one": "One character to go"
440
+ },
441
+ "charactersAtLimitText": "Zero characters left",
442
+ "charactersOverLimitText": {
443
+ "other": "%{count} characters too many",
444
+ "one": "One character too many"
445
+ },
446
+ "wordsUnderLimitText": {
447
+ "other": "%{count} words to go",
448
+ "one": "One word to go"
449
+ },
450
+ "wordsAtLimitText": "Zero words left",
451
+ "wordsOverLimitText": {
452
+ "other": "%{count} words too many",
453
+ "one": "One word too many"
454
+ }
455
+ },
456
+ "hidden": true,
457
+ "description": "",
458
+ "pageTemplateOptions": {},
459
+ "screenshot": false,
460
+ "html": "<div class=\"govuk-form-group govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"10\" data-i18n.characters-under-limit.other=\"%{count} characters to go\" data-i18n.characters-under-limit.one=\"One character to go\" data-i18n.characters-at-limit=\"Zero characters left\" data-i18n.characters-over-limit.other=\"%{count} characters too many\" data-i18n.characters-over-limit.one=\"One character too many\" data-i18n.words-under-limit.other=\"%{count} words to go\" data-i18n.words-under-limit.one=\"One word to go\" data-i18n.words-at-limit=\"Zero words left\" data-i18n.words-over-limit.other=\"%{count} words too many\" data-i18n.words-over-limit.one=\"One word too many\">\n <label class=\"govuk-label\" for=\"with-translations\">\n Full address\n </label>\n <textarea class=\"govuk-textarea govuk-js-character-count\" id=\"with-translations\" name=\"with-translations\" rows=\"5\" aria-describedby=\"with-translations-info\"></textarea>\n <div id=\"with-translations-info\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 10 characters\n </div>\n</div>"
475
461
  }
476
462
  ]
477
463
  }
@@ -1 +1 @@
1
- {"version":3,"file":"checkboxes.bundle.js","sources":["../../../../src/govuk/common/index.mjs","../../../../src/govuk/errors/index.mjs","../../../../src/govuk/component.mjs","../../../../src/govuk/components/checkboxes/checkboxes.mjs"],"sourcesContent":["/**\n * Common helpers which do not require polyfill.\n *\n * IMPORTANT: If a helper require a polyfill, please isolate it in its own module\n * so that the polyfill can be properly tree-shaken and does not burden\n * the components that do not need that helper\n */\n\n/**\n * Get hash fragment from URL\n *\n * Extract the hash fragment (everything after the hash) from a URL,\n * but not including the hash symbol\n *\n * @private\n * @param {string} url - URL\n * @returns {string | undefined} Fragment from URL, without the hash\n */\nexport function getFragmentFromUrl(url) {\n if (!url.includes('#')) {\n return undefined\n }\n\n return url.split('#').pop()\n}\n\n/**\n * Get GOV.UK Frontend breakpoint value from CSS custom property\n *\n * @private\n * @param {string} name - Breakpoint name\n * @returns {{ property: string, value?: string }} Breakpoint object\n */\nexport function getBreakpoint(name) {\n const property = `--govuk-frontend-breakpoint-${name}`\n\n // Get value from `<html>` with breakpoints on CSS :root\n const value = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue(property)\n\n return {\n property,\n value: value || undefined\n }\n}\n\n/**\n * Move focus to element\n *\n * Sets tabindex to -1 to make the element programmatically focusable,\n * but removes it on blur as the element doesn't need to be focused again.\n *\n * @private\n * @template {HTMLElement} FocusElement\n * @param {FocusElement} $element - HTML element\n * @param {object} [options] - Handler options\n * @param {function(this: FocusElement): void} [options.onBeforeFocus] - Callback before focus\n * @param {function(this: FocusElement): void} [options.onBlur] - Callback on blur\n */\nexport function setFocus($element, options = {}) {\n const isFocusable = $element.getAttribute('tabindex')\n\n if (!isFocusable) {\n $element.setAttribute('tabindex', '-1')\n }\n\n /**\n * Handle element focus\n */\n function onFocus() {\n $element.addEventListener('blur', onBlur, { once: true })\n }\n\n /**\n * Handle element blur\n */\n function onBlur() {\n options.onBlur?.call($element)\n\n if (!isFocusable) {\n $element.removeAttribute('tabindex')\n }\n }\n\n // Add listener to reset element on blur, after focus\n $element.addEventListener('focus', onFocus, { once: true })\n\n // Focus element\n options.onBeforeFocus?.call($element)\n $element.focus()\n}\n\n/**\n * Checks if component is already initialised\n *\n * @internal\n * @param {Element} $root - HTML element to be checked\n * @param {string} moduleName - name of component module\n * @returns {boolean} Whether component is already initialised\n */\nexport function isInitialised($root, moduleName) {\n return (\n $root instanceof HTMLElement &&\n $root.hasAttribute(`data-${moduleName}-init`)\n )\n}\n\n/**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * Some browsers will load and run our JavaScript but GOV.UK Frontend\n * won't be supported.\n *\n * @param {HTMLElement | null} [$scope] - (internal) `<body>` HTML element checked for browser support\n * @returns {boolean} Whether GOV.UK Frontend is supported on this page\n */\nexport function isSupported($scope = document.body) {\n if (!$scope) {\n return false\n }\n\n return $scope.classList.contains('govuk-frontend-supported')\n}\n\n/**\n * Check for an array\n *\n * @internal\n * @param {unknown} option - Option to check\n * @returns {boolean} Whether the option is an array\n */\nfunction isArray(option) {\n return Array.isArray(option)\n}\n\n/**\n * Check for an object\n *\n * @internal\n * @template {Partial<Record<keyof ObjectType, unknown>>} [ObjectType=ObjectNested]\n * @param {unknown | ObjectType} option - Option to check\n * @returns {option is ObjectType} Whether the option is an object\n */\nexport function isObject(option) {\n return !!option && typeof option === 'object' && !isArray(option)\n}\n\n/**\n * Format error message\n *\n * @internal\n * @param {ComponentWithModuleName} Component - Component that threw the error\n * @param {string} message - Error message\n * @returns {string} - Formatted error message\n */\nexport function formatErrorMessage(Component, message) {\n return `${Component.moduleName}: ${message}`\n}\n\n/* eslint-disable jsdoc/valid-types --\n * `{new(...args: any[] ): object}` is not recognised as valid\n * https://github.com/gajus/eslint-plugin-jsdoc/issues/145#issuecomment-1308722878\n * https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/131\n **/\n\n/**\n * @typedef ComponentWithModuleName\n * @property {string} moduleName - Name of the component\n */\n\n/* eslint-enable jsdoc/valid-types */\n\n/**\n * @import { ObjectNested } from './configuration.mjs'\n */\n","import { formatErrorMessage } from '../common/index.mjs'\n\n/**\n * GOV.UK Frontend error\n *\n * A base class for `Error`s thrown by GOV.UK Frontend.\n *\n * It is meant to be extended into specific types of errors\n * to be thrown by our code.\n *\n * @example\n * ```js\n * class MissingRootError extends GOVUKFrontendError {\n * // Setting an explicit name is important as extending the class will not\n * // set a new `name` on the subclass. The `name` property is important\n * // to ensure intelligible error names even if the class name gets\n * // mangled by a minifier\n * name = \"MissingRootError\"\n * }\n * ```\n * @virtual\n */\nexport class GOVUKFrontendError extends Error {\n name = 'GOVUKFrontendError'\n}\n\n/**\n * Indicates that GOV.UK Frontend is not supported\n */\nexport class SupportError extends GOVUKFrontendError {\n name = 'SupportError'\n\n /**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support\n */\n constructor($scope = document.body) {\n const supportMessage =\n 'noModule' in HTMLScriptElement.prototype\n ? 'GOV.UK Frontend initialised without `<body class=\"govuk-frontend-supported\">` from template `<script>` snippet'\n : 'GOV.UK Frontend is not supported in this browser'\n\n super(\n $scope\n ? supportMessage\n : 'GOV.UK Frontend initialised without `<script type=\"module\">`'\n )\n }\n}\n\n/**\n * Indicates that a component has received an illegal configuration\n */\nexport class ConfigError extends GOVUKFrontendError {\n name = 'ConfigError'\n}\n\n/**\n * Indicates an issue with an element (possibly `null` or `undefined`)\n */\nexport class ElementError extends GOVUKFrontendError {\n name = 'ElementError'\n\n /**\n * @internal\n * @overload\n * @param {string} message - Element error message\n */\n\n /**\n * @internal\n * @overload\n * @param {ElementErrorOptions} options - Element error options\n */\n\n /**\n * @internal\n * @param {string | ElementErrorOptions} messageOrOptions - Element error message or options\n */\n constructor(messageOrOptions) {\n let message = typeof messageOrOptions === 'string' ? messageOrOptions : ''\n\n // Build message from options\n if (typeof messageOrOptions === 'object') {\n const { component, identifier, element, expectedType } = messageOrOptions\n\n message = identifier\n\n // Append reason\n message += element\n ? ` is not of type ${expectedType ?? 'HTMLElement'}`\n : ' not found'\n\n message = formatErrorMessage(component, message)\n }\n\n super(message)\n }\n}\n\n/**\n * Indicates that a component is already initialised\n */\nexport class InitError extends GOVUKFrontendError {\n name = 'InitError'\n\n /**\n * @internal\n * @param {ComponentWithModuleName | string} componentOrMessage - name of the component module\n */\n constructor(componentOrMessage) {\n const message =\n typeof componentOrMessage === 'string'\n ? componentOrMessage\n : formatErrorMessage(\n componentOrMessage,\n `Root element (\\`$root\\`) already initialised`\n )\n\n super(message)\n }\n}\n\n/**\n * Element error options\n *\n * @internal\n * @typedef {object} ElementErrorOptions\n * @property {string} identifier - An identifier that'll let the user understand which element has an error. This is whatever makes the most sense\n * @property {Element | null} [element] - The element in error\n * @property {string} [expectedType] - The type that was expected for the identifier\n * @property {ComponentWithModuleName} component - Component throwing the error\n */\n\n/**\n * @import { ComponentWithModuleName } from '../common/index.mjs'\n */\n","import { isInitialised, isSupported } from './common/index.mjs'\nimport { ElementError, InitError, SupportError } from './errors/index.mjs'\n\n/**\n * Base Component class\n *\n * Centralises the behaviours shared by our components\n *\n * @virtual\n * @template {Element} [RootElementType=HTMLElement]\n */\nexport class Component {\n /**\n * @type {typeof Element}\n */\n static elementType = HTMLElement\n\n // allows Typescript user to work around the lack of types\n // in GOVUKFrontend package, Typescript is not aware of $root\n // in components that extend GOVUKFrontendComponent\n /**\n * Returns the root element of the component\n *\n * @protected\n * @returns {RootElementType} - the root element of component\n */\n get $root() {\n return this._$root\n }\n\n /**\n * @protected\n * @type {RootElementType}\n */\n _$root\n\n /**\n * Constructs a new component, validating that GOV.UK Frontend is supported\n *\n * @internal\n * @param {Element | null} [$root] - HTML element to use for component\n */\n constructor($root) {\n const childConstructor = /** @type {ChildClassConstructor} */ (\n this.constructor\n )\n\n // TypeScript does not enforce that inheriting classes will define a `moduleName`\n // (even if we add a `@virtual` `static moduleName` property to this class).\n // While we trust users to do this correctly, we do a little check to provide them\n // a helpful error message.\n //\n // After this, we'll be sure that `childConstructor` has a `moduleName`\n // as expected of the `ChildClassConstructor` we've cast `this.constructor` to.\n if (typeof childConstructor.moduleName !== 'string') {\n throw new InitError(`\\`moduleName\\` not defined in component`)\n }\n\n if (!($root instanceof childConstructor.elementType)) {\n throw new ElementError({\n element: $root,\n component: childConstructor,\n identifier: 'Root element (`$root`)',\n expectedType: childConstructor.elementType.name\n })\n } else {\n this._$root = /** @type {RootElementType} */ ($root)\n }\n\n childConstructor.checkSupport()\n\n this.checkInitialised()\n\n const moduleName = childConstructor.moduleName\n\n this.$root.setAttribute(`data-${moduleName}-init`, '')\n }\n\n /**\n * Validates whether component is already initialised\n *\n * @private\n * @throws {InitError} when component is already initialised\n */\n checkInitialised() {\n const constructor = /** @type {ChildClassConstructor} */ (this.constructor)\n const moduleName = constructor.moduleName\n\n if (moduleName && isInitialised(this.$root, moduleName)) {\n throw new InitError(constructor)\n }\n }\n\n /**\n * Validates whether components are supported\n *\n * @throws {SupportError} when the components are not supported\n */\n static checkSupport() {\n if (!isSupported()) {\n throw new SupportError()\n }\n }\n}\n\n/**\n * @typedef ChildClass\n * @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component\n */\n\n/**\n * @typedef {typeof Component & ChildClass} ChildClassConstructor\n */\n","import { Component } from '../../component.mjs'\nimport { ElementError } from '../../errors/index.mjs'\n\n/**\n * Checkboxes component\n *\n * @preserve\n */\nexport class Checkboxes extends Component {\n /** @private */\n $inputs\n\n /**\n * Checkboxes can be associated with a 'conditionally revealed' content block\n * – for example, a checkbox for 'Phone' could reveal an additional form field\n * for the user to enter their phone number.\n *\n * These associations are made using a `data-aria-controls` attribute, which\n * is promoted to an aria-controls attribute during initialisation.\n *\n * We also need to restore the state of any conditional reveals on the page\n * (for example if the user has navigated back), and set up event handlers to\n * keep the reveal in sync with the checkbox state.\n *\n * @param {Element | null} $root - HTML element to use for checkboxes\n */\n constructor($root) {\n super($root)\n\n const $inputs = this.$root.querySelectorAll('input[type=\"checkbox\"]')\n if (!$inputs.length) {\n throw new ElementError({\n component: Checkboxes,\n identifier: 'Form inputs (`<input type=\"checkbox\">`)'\n })\n }\n\n this.$inputs = $inputs\n\n this.$inputs.forEach(($input) => {\n const targetId = $input.getAttribute('data-aria-controls')\n\n // Skip radios without data-aria-controls attributes\n if (!targetId) {\n return\n }\n\n // Throw if target conditional element does not exist.\n if (!document.getElementById(targetId)) {\n throw new ElementError({\n component: Checkboxes,\n identifier: `Conditional reveal (\\`id=\"${targetId}\"\\`)`\n })\n }\n\n // Promote the data-aria-controls attribute to a aria-controls attribute\n // so that the relationship is exposed in the AOM\n $input.setAttribute('aria-controls', targetId)\n $input.removeAttribute('data-aria-controls')\n })\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.syncAllConditionalReveals())\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 sync now too.\n this.syncAllConditionalReveals()\n\n // Handle events\n this.$root.addEventListener('click', (event) => this.handleClick(event))\n }\n\n /**\n * Sync the conditional reveal states for all checkboxes in this component.\n *\n * @private\n */\n syncAllConditionalReveals() {\n this.$inputs.forEach(($input) =>\n this.syncConditionalRevealWithInputState($input)\n )\n }\n\n /**\n * Sync conditional reveal with the input state\n *\n * Synchronise the visibility of the conditional reveal, and its accessible\n * state, with the input's checked state.\n *\n * @private\n * @param {HTMLInputElement} $input - Checkbox input\n */\n syncConditionalRevealWithInputState($input) {\n const targetId = $input.getAttribute('aria-controls')\n if (!targetId) {\n return\n }\n\n const $target = document.getElementById(targetId)\n if ($target?.classList.contains('govuk-checkboxes__conditional')) {\n const inputIsChecked = $input.checked\n\n $input.setAttribute('aria-expanded', inputIsChecked.toString())\n $target.classList.toggle(\n 'govuk-checkboxes__conditional--hidden',\n !inputIsChecked\n )\n }\n }\n\n /**\n * Uncheck other checkboxes\n *\n * Find any other checkbox inputs with the same name value, and uncheck them.\n * This is useful for when a “None of these\" checkbox is checked.\n *\n * @private\n * @param {HTMLInputElement} $input - Checkbox input\n */\n unCheckAllInputsExcept($input) {\n const allInputsWithSameName = document.querySelectorAll(\n `input[type=\"checkbox\"][name=\"${$input.name}\"]`\n )\n\n allInputsWithSameName.forEach(($inputWithSameName) => {\n const hasSameFormOwner = $input.form === $inputWithSameName.form\n if (hasSameFormOwner && $inputWithSameName !== $input) {\n $inputWithSameName.checked = false\n this.syncConditionalRevealWithInputState($inputWithSameName)\n }\n })\n }\n\n /**\n * Uncheck exclusive checkboxes\n *\n * Find any checkbox inputs with the same name value and the 'exclusive'\n * behaviour, and uncheck them. This helps prevent someone checking both a\n * regular checkbox and a \"None of these\" checkbox in the same fieldset.\n *\n * @private\n * @param {HTMLInputElement} $input - Checkbox input\n */\n unCheckExclusiveInputs($input) {\n const allInputsWithSameNameAndExclusiveBehaviour =\n document.querySelectorAll(\n `input[data-behaviour=\"exclusive\"][type=\"checkbox\"][name=\"${$input.name}\"]`\n )\n\n allInputsWithSameNameAndExclusiveBehaviour.forEach(($exclusiveInput) => {\n const hasSameFormOwner = $input.form === $exclusiveInput.form\n if (hasSameFormOwner) {\n $exclusiveInput.checked = false\n this.syncConditionalRevealWithInputState($exclusiveInput)\n }\n })\n }\n\n /**\n * Click event handler\n *\n * Handle a click within the component root – if the click occurred on a checkbox,\n * sync the state of any associated conditional reveal with the checkbox\n * state.\n *\n * @private\n * @param {MouseEvent} event - Click event\n */\n handleClick(event) {\n const $clickedInput = event.target\n\n // Ignore clicks on things that aren't checkbox inputs\n if (\n !($clickedInput instanceof HTMLInputElement) ||\n $clickedInput.type !== 'checkbox'\n ) {\n return\n }\n\n // If the checkbox conditionally-reveals some content, sync the state\n const hasAriaControls = $clickedInput.getAttribute('aria-controls')\n if (hasAriaControls) {\n this.syncConditionalRevealWithInputState($clickedInput)\n }\n\n // No further behaviour needed for unchecking\n if (!$clickedInput.checked) {\n return\n }\n\n // Handle 'exclusive' checkbox behaviour (ie \"None of these\")\n const hasBehaviourExclusive =\n $clickedInput.getAttribute('data-behaviour') === 'exclusive'\n if (hasBehaviourExclusive) {\n this.unCheckAllInputsExcept($clickedInput)\n } else {\n this.unCheckExclusiveInputs($clickedInput)\n }\n }\n\n /**\n * Name for the component used when initialising using data-module attributes.\n */\n static moduleName = 'govuk-checkboxes'\n}\n"],"names":["isInitialised","$root","moduleName","HTMLElement","hasAttribute","isSupported","$scope","document","body","classList","contains","formatErrorMessage","Component","message","GOVUKFrontendError","Error","constructor","args","name","SupportError","supportMessage","HTMLScriptElement","prototype","ElementError","messageOrOptions","component","identifier","element","expectedType","InitError","componentOrMessage","_$root","childConstructor","elementType","checkSupport","checkInitialised","setAttribute","Checkboxes","$inputs","querySelectorAll","length","forEach","$input","targetId","getAttribute","getElementById","removeAttribute","window","addEventListener","syncAllConditionalReveals","event","handleClick","syncConditionalRevealWithInputState","$target","inputIsChecked","checked","toString","toggle","unCheckAllInputsExcept","allInputsWithSameName","$inputWithSameName","hasSameFormOwner","form","unCheckExclusiveInputs","allInputsWithSameNameAndExclusiveBehaviour","$exclusiveInput","$clickedInput","target","HTMLInputElement","type","hasAriaControls","hasBehaviourExclusive"],"mappings":";;;;;;EAqGO,SAASA,aAAaA,CAACC,KAAK,EAAEC,UAAU,EAAE;IAC/C,OACED,KAAK,YAAYE,WAAW,IAC5BF,KAAK,CAACG,YAAY,CAAC,CAAA,KAAA,EAAQF,UAAU,CAAA,KAAA,CAAO,CAAC;EAEjD;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACO,SAASG,WAAWA,CAACC,MAAM,GAAGC,QAAQ,CAACC,IAAI,EAAE;IAClD,IAAI,CAACF,MAAM,EAAE;EACX,IAAA,OAAO,KAAK;EACd;EAEA,EAAA,OAAOA,MAAM,CAACG,SAAS,CAACC,QAAQ,CAAC,0BAA0B,CAAC;EAC9D;EAiCO,SAASC,kBAAkBA,CAACC,SAAS,EAAEC,OAAO,EAAE;EACrD,EAAA,OAAO,GAAGD,SAAS,CAACV,UAAU,CAAA,EAAA,EAAKW,OAAO,CAAE,CAAA;EAC9C;EAQA;EACA;EACA;EACA;EAIA;EACA;EACA;;ECzJO,MAAMC,kBAAkB,SAASC,KAAK,CAAC;EAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;EAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA;MAAA,IAC5CC,CAAAA,IAAI,GAAG,oBAAoB;EAAA;EAC7B;EAKO,MAAMC,YAAY,SAASL,kBAAkB,CAAC;EAGnD;EACF;EACA;EACA;EACA;EACEE,EAAAA,WAAWA,CAACV,MAAM,GAAGC,QAAQ,CAACC,IAAI,EAAE;MAClC,MAA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C;EAC5C;EACF;EAMF;EAvMa7B,UAAU,CAsMdnC,UAAU,GAAG,kBAAkB;;;;;;;;"}
1
+ {"version":3,"file":"checkboxes.bundle.js","sources":["../../../../src/govuk/common/index.mjs","../../../../src/govuk/errors/index.mjs","../../../../src/govuk/component.mjs","../../../../src/govuk/components/checkboxes/checkboxes.mjs"],"sourcesContent":["/**\n * Common helpers which do not require polyfill.\n *\n * IMPORTANT: If a helper require a polyfill, please isolate it in its own module\n * so that the polyfill can be properly tree-shaken and does not burden\n * the components that do not need that helper\n */\n\n/**\n * Get hash fragment from URL\n *\n * Extract the hash fragment (everything after the hash) from a URL,\n * but not including the hash symbol\n *\n * @private\n * @param {string} url - URL\n * @returns {string | undefined} Fragment from URL, without the hash\n */\nexport function getFragmentFromUrl(url) {\n if (!url.includes('#')) {\n return undefined\n }\n\n return url.split('#').pop()\n}\n\n/**\n * Get GOV.UK Frontend breakpoint value from CSS custom property\n *\n * @private\n * @param {string} name - Breakpoint name\n * @returns {{ property: string, value?: string }} Breakpoint object\n */\nexport function getBreakpoint(name) {\n const property = `--govuk-breakpoint-${name}`\n\n // Get value from `<html>` with breakpoints on CSS :root\n const value = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue(property)\n\n return {\n property,\n value: value || undefined\n }\n}\n\n/**\n * Move focus to element\n *\n * Sets tabindex to -1 to make the element programmatically focusable,\n * but removes it on blur as the element doesn't need to be focused again.\n *\n * @private\n * @template {HTMLElement} FocusElement\n * @param {FocusElement} $element - HTML element\n * @param {object} [options] - Handler options\n * @param {function(this: FocusElement): void} [options.onBeforeFocus] - Callback before focus\n * @param {function(this: FocusElement): void} [options.onBlur] - Callback on blur\n */\nexport function setFocus($element, options = {}) {\n const isFocusable = $element.getAttribute('tabindex')\n\n if (!isFocusable) {\n $element.setAttribute('tabindex', '-1')\n }\n\n /**\n * Handle element focus\n */\n function onFocus() {\n $element.addEventListener('blur', onBlur, { once: true })\n }\n\n /**\n * Handle element blur\n */\n function onBlur() {\n options.onBlur?.call($element)\n\n if (!isFocusable) {\n $element.removeAttribute('tabindex')\n }\n }\n\n // Add listener to reset element on blur, after focus\n $element.addEventListener('focus', onFocus, { once: true })\n\n // Focus element\n options.onBeforeFocus?.call($element)\n $element.focus()\n}\n\n/**\n * Checks if component is already initialised\n *\n * @internal\n * @param {Element} $root - HTML element to be checked\n * @param {string} moduleName - name of component module\n * @returns {boolean} Whether component is already initialised\n */\nexport function isInitialised($root, moduleName) {\n return (\n $root instanceof HTMLElement &&\n $root.hasAttribute(`data-${moduleName}-init`)\n )\n}\n\n/**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * Some browsers will load and run our JavaScript but GOV.UK Frontend\n * won't be supported.\n *\n * @param {HTMLElement | null} [$scope] - (internal) `<body>` HTML element checked for browser support\n * @returns {boolean} Whether GOV.UK Frontend is supported on this page\n */\nexport function isSupported($scope = document.body) {\n if (!$scope) {\n return false\n }\n\n return $scope.classList.contains('govuk-frontend-supported')\n}\n\n/**\n * Check for an array\n *\n * @internal\n * @param {unknown} option - Option to check\n * @returns {boolean} Whether the option is an array\n */\nfunction isArray(option) {\n return Array.isArray(option)\n}\n\n/**\n * Check for an object\n *\n * @internal\n * @template {Partial<Record<keyof ObjectType, unknown>>} [ObjectType=ObjectNested]\n * @param {unknown | ObjectType} option - Option to check\n * @returns {option is ObjectType} Whether the option is an object\n */\nexport function isObject(option) {\n return !!option && typeof option === 'object' && !isArray(option)\n}\n\n/**\n * Format error message\n *\n * @internal\n * @param {ComponentWithModuleName} Component - Component that threw the error\n * @param {string} message - Error message\n * @returns {string} - Formatted error message\n */\nexport function formatErrorMessage(Component, message) {\n return `${Component.moduleName}: ${message}`\n}\n\n/* eslint-disable jsdoc/valid-types --\n * `{new(...args: any[] ): object}` is not recognised as valid\n * https://github.com/gajus/eslint-plugin-jsdoc/issues/145#issuecomment-1308722878\n * https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/131\n **/\n\n/**\n * @typedef ComponentWithModuleName\n * @property {string} moduleName - Name of the component\n */\n\n/* eslint-enable jsdoc/valid-types */\n\n/**\n * @import { ObjectNested } from './configuration.mjs'\n */\n","import { formatErrorMessage } from '../common/index.mjs'\n\n/**\n * GOV.UK Frontend error\n *\n * A base class for `Error`s thrown by GOV.UK Frontend.\n *\n * It is meant to be extended into specific types of errors\n * to be thrown by our code.\n *\n * @example\n * ```js\n * class MissingRootError extends GOVUKFrontendError {\n * // Setting an explicit name is important as extending the class will not\n * // set a new `name` on the subclass. The `name` property is important\n * // to ensure intelligible error names even if the class name gets\n * // mangled by a minifier\n * name = \"MissingRootError\"\n * }\n * ```\n * @virtual\n */\nexport class GOVUKFrontendError extends Error {\n name = 'GOVUKFrontendError'\n}\n\n/**\n * Indicates that GOV.UK Frontend is not supported\n */\nexport class SupportError extends GOVUKFrontendError {\n name = 'SupportError'\n\n /**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support\n */\n constructor($scope = document.body) {\n const supportMessage =\n 'noModule' in HTMLScriptElement.prototype\n ? 'GOV.UK Frontend initialised without `<body class=\"govuk-frontend-supported\">` from template `<script>` snippet'\n : 'GOV.UK Frontend is not supported in this browser'\n\n super(\n $scope\n ? supportMessage\n : 'GOV.UK Frontend initialised without `<script type=\"module\">`'\n )\n }\n}\n\n/**\n * Indicates that a component has received an illegal configuration\n */\nexport class ConfigError extends GOVUKFrontendError {\n name = 'ConfigError'\n}\n\n/**\n * Indicates an issue with an element (possibly `null` or `undefined`)\n */\nexport class ElementError extends GOVUKFrontendError {\n name = 'ElementError'\n\n /**\n * @internal\n * @overload\n * @param {string} message - Element error message\n */\n\n /**\n * @internal\n * @overload\n * @param {ElementErrorOptions} options - Element error options\n */\n\n /**\n * @internal\n * @param {string | ElementErrorOptions} messageOrOptions - Element error message or options\n */\n constructor(messageOrOptions) {\n let message = typeof messageOrOptions === 'string' ? messageOrOptions : ''\n\n // Build message from options\n if (typeof messageOrOptions === 'object') {\n const { component, identifier, element, expectedType } = messageOrOptions\n\n message = identifier\n\n // Append reason\n message += element\n ? ` is not of type ${expectedType ?? 'HTMLElement'}`\n : ' not found'\n\n message = formatErrorMessage(component, message)\n }\n\n super(message)\n }\n}\n\n/**\n * Indicates that a component is already initialised\n */\nexport class InitError extends GOVUKFrontendError {\n name = 'InitError'\n\n /**\n * @internal\n * @param {ComponentWithModuleName | string} componentOrMessage - name of the component module\n */\n constructor(componentOrMessage) {\n const message =\n typeof componentOrMessage === 'string'\n ? componentOrMessage\n : formatErrorMessage(\n componentOrMessage,\n `Root element (\\`$root\\`) already initialised`\n )\n\n super(message)\n }\n}\n\n/**\n * Element error options\n *\n * @internal\n * @typedef {object} ElementErrorOptions\n * @property {string} identifier - An identifier that'll let the user understand which element has an error. This is whatever makes the most sense\n * @property {Element | null} [element] - The element in error\n * @property {string} [expectedType] - The type that was expected for the identifier\n * @property {ComponentWithModuleName} component - Component throwing the error\n */\n\n/**\n * @import { ComponentWithModuleName } from '../common/index.mjs'\n */\n","import { isInitialised, isSupported } from './common/index.mjs'\nimport { ElementError, InitError, SupportError } from './errors/index.mjs'\n\n/**\n * Base Component class\n *\n * Centralises the behaviours shared by our components\n *\n * @virtual\n * @template {Element} [RootElementType=HTMLElement]\n */\nexport class Component {\n /**\n * @type {typeof Element}\n */\n static elementType = HTMLElement\n\n // allows Typescript user to work around the lack of types\n // in GOVUKFrontend package, Typescript is not aware of $root\n // in components that extend GOVUKFrontendComponent\n /**\n * Returns the root element of the component\n *\n * @protected\n * @returns {RootElementType} - the root element of component\n */\n get $root() {\n return this._$root\n }\n\n /**\n * @protected\n * @type {RootElementType}\n */\n _$root\n\n /**\n * Constructs a new component, validating that GOV.UK Frontend is supported\n *\n * @internal\n * @param {Element | null} [$root] - HTML element to use for component\n */\n constructor($root) {\n const childConstructor = /** @type {ChildClassConstructor} */ (\n this.constructor\n )\n\n // TypeScript does not enforce that inheriting classes will define a `moduleName`\n // (even if we add a `@virtual` `static moduleName` property to this class).\n // While we trust users to do this correctly, we do a little check to provide them\n // a helpful error message.\n //\n // After this, we'll be sure that `childConstructor` has a `moduleName`\n // as expected of the `ChildClassConstructor` we've cast `this.constructor` to.\n if (typeof childConstructor.moduleName !== 'string') {\n throw new InitError(`\\`moduleName\\` not defined in component`)\n }\n\n if (!($root instanceof childConstructor.elementType)) {\n throw new ElementError({\n element: $root,\n component: childConstructor,\n identifier: 'Root element (`$root`)',\n expectedType: childConstructor.elementType.name\n })\n } else {\n this._$root = /** @type {RootElementType} */ ($root)\n }\n\n childConstructor.checkSupport()\n\n this.checkInitialised()\n\n const moduleName = childConstructor.moduleName\n\n this.$root.setAttribute(`data-${moduleName}-init`, '')\n }\n\n /**\n * Validates whether component is already initialised\n *\n * @private\n * @throws {InitError} when component is already initialised\n */\n checkInitialised() {\n const constructor = /** @type {ChildClassConstructor} */ (this.constructor)\n const moduleName = constructor.moduleName\n\n if (moduleName && isInitialised(this.$root, moduleName)) {\n throw new InitError(constructor)\n }\n }\n\n /**\n * Validates whether components are supported\n *\n * @throws {SupportError} when the components are not supported\n */\n static checkSupport() {\n if (!isSupported()) {\n throw new SupportError()\n }\n }\n}\n\n/**\n * @typedef ChildClass\n * @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component\n */\n\n/**\n * @typedef {typeof Component & ChildClass} ChildClassConstructor\n */\n","import { Component } from '../../component.mjs'\nimport { ElementError } from '../../errors/index.mjs'\n\n/**\n * Checkboxes component\n *\n * @preserve\n */\nexport class Checkboxes extends Component {\n /** @private */\n $inputs\n\n /**\n * Checkboxes can be associated with a 'conditionally revealed' content block\n * – for example, a checkbox for 'Phone' could reveal an additional form field\n * for the user to enter their phone number.\n *\n * These associations are made using a `data-aria-controls` attribute, which\n * is promoted to an aria-controls attribute during initialisation.\n *\n * We also need to restore the state of any conditional reveals on the page\n * (for example if the user has navigated back), and set up event handlers to\n * keep the reveal in sync with the checkbox state.\n *\n * @param {Element | null} $root - HTML element to use for checkboxes\n */\n constructor($root) {\n super($root)\n\n const $inputs = this.$root.querySelectorAll('input[type=\"checkbox\"]')\n if (!$inputs.length) {\n throw new ElementError({\n component: Checkboxes,\n identifier: 'Form inputs (`<input type=\"checkbox\">`)'\n })\n }\n\n this.$inputs = $inputs\n\n this.$inputs.forEach(($input) => {\n const targetId = $input.getAttribute('data-aria-controls')\n\n // Skip radios without data-aria-controls attributes\n if (!targetId) {\n return\n }\n\n // Throw if target conditional element does not exist.\n if (!document.getElementById(targetId)) {\n throw new ElementError({\n component: Checkboxes,\n identifier: `Conditional reveal (\\`id=\"${targetId}\"\\`)`\n })\n }\n\n // Promote the data-aria-controls attribute to a aria-controls attribute\n // so that the relationship is exposed in the AOM\n $input.setAttribute('aria-controls', targetId)\n $input.removeAttribute('data-aria-controls')\n })\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.syncAllConditionalReveals())\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 sync now too.\n this.syncAllConditionalReveals()\n\n // Handle events\n this.$root.addEventListener('click', (event) => this.handleClick(event))\n }\n\n /**\n * Sync the conditional reveal states for all checkboxes in this component.\n *\n * @private\n */\n syncAllConditionalReveals() {\n this.$inputs.forEach(($input) =>\n this.syncConditionalRevealWithInputState($input)\n )\n }\n\n /**\n * Sync conditional reveal with the input state\n *\n * Synchronise the visibility of the conditional reveal, and its accessible\n * state, with the input's checked state.\n *\n * @private\n * @param {HTMLInputElement} $input - Checkbox input\n */\n syncConditionalRevealWithInputState($input) {\n const targetId = $input.getAttribute('aria-controls')\n if (!targetId) {\n return\n }\n\n const $target = document.getElementById(targetId)\n if ($target?.classList.contains('govuk-checkboxes__conditional')) {\n const inputIsChecked = $input.checked\n\n $input.setAttribute('aria-expanded', inputIsChecked.toString())\n $target.classList.toggle(\n 'govuk-checkboxes__conditional--hidden',\n !inputIsChecked\n )\n }\n }\n\n /**\n * Uncheck other checkboxes\n *\n * Find any other checkbox inputs with the same name value, and uncheck them.\n * This is useful for when a “None of these\" checkbox is checked.\n *\n * @private\n * @param {HTMLInputElement} $input - Checkbox input\n */\n unCheckAllInputsExcept($input) {\n const allInputsWithSameName = document.querySelectorAll(\n `input[type=\"checkbox\"][name=\"${$input.name}\"]`\n )\n\n allInputsWithSameName.forEach(($inputWithSameName) => {\n const hasSameFormOwner = $input.form === $inputWithSameName.form\n if (hasSameFormOwner && $inputWithSameName !== $input) {\n $inputWithSameName.checked = false\n this.syncConditionalRevealWithInputState($inputWithSameName)\n }\n })\n }\n\n /**\n * Uncheck exclusive checkboxes\n *\n * Find any checkbox inputs with the same name value and the 'exclusive'\n * behaviour, and uncheck them. This helps prevent someone checking both a\n * regular checkbox and a \"None of these\" checkbox in the same fieldset.\n *\n * @private\n * @param {HTMLInputElement} $input - Checkbox input\n */\n unCheckExclusiveInputs($input) {\n const allInputsWithSameNameAndExclusiveBehaviour =\n document.querySelectorAll(\n `input[data-behaviour=\"exclusive\"][type=\"checkbox\"][name=\"${$input.name}\"]`\n )\n\n allInputsWithSameNameAndExclusiveBehaviour.forEach(($exclusiveInput) => {\n const hasSameFormOwner = $input.form === $exclusiveInput.form\n if (hasSameFormOwner) {\n $exclusiveInput.checked = false\n this.syncConditionalRevealWithInputState($exclusiveInput)\n }\n })\n }\n\n /**\n * Click event handler\n *\n * Handle a click within the component root – if the click occurred on a checkbox,\n * sync the state of any associated conditional reveal with the checkbox\n * state.\n *\n * @private\n * @param {MouseEvent} event - Click event\n */\n handleClick(event) {\n const $clickedInput = event.target\n\n // Ignore clicks on things that aren't checkbox inputs\n if (\n !($clickedInput instanceof HTMLInputElement) ||\n $clickedInput.type !== 'checkbox'\n ) {\n return\n }\n\n // If the checkbox conditionally-reveals some content, sync the state\n const hasAriaControls = $clickedInput.getAttribute('aria-controls')\n if (hasAriaControls) {\n this.syncConditionalRevealWithInputState($clickedInput)\n }\n\n // No further behaviour needed for unchecking\n if (!$clickedInput.checked) {\n return\n }\n\n // Handle 'exclusive' checkbox behaviour (ie \"None of these\")\n const hasBehaviourExclusive =\n $clickedInput.getAttribute('data-behaviour') === 'exclusive'\n if (hasBehaviourExclusive) {\n this.unCheckAllInputsExcept($clickedInput)\n } else {\n this.unCheckExclusiveInputs($clickedInput)\n }\n }\n\n /**\n * Name for the component used when initialising using data-module attributes.\n */\n static moduleName = 'govuk-checkboxes'\n}\n"],"names":["isInitialised","$root","moduleName","HTMLElement","hasAttribute","isSupported","$scope","document","body","classList","contains","formatErrorMessage","Component","message","GOVUKFrontendError","Error","constructor","args","name","SupportError","supportMessage","HTMLScriptElement","prototype","ElementError","messageOrOptions","component","identifier","element","expectedType","InitError","componentOrMessage","_$root","childConstructor","elementType","checkSupport","checkInitialised","setAttribute","Checkboxes","$inputs","querySelectorAll","length","forEach","$input","targetId","getAttribute","getElementById","removeAttribute","window","addEventListener","syncAllConditionalReveals","event","handleClick","syncConditionalRevealWithInputState","$target","inputIsChecked","checked","toString","toggle","unCheckAllInputsExcept","allInputsWithSameName","$inputWithSameName","hasSameFormOwner","form","unCheckExclusiveInputs","allInputsWithSameNameAndExclusiveBehaviour","$exclusiveInput","$clickedInput","target","HTMLInputElement","type","hasAriaControls","hasBehaviourExclusive"],"mappings":";;;;;;EAqGO,SAASA,aAAaA,CAACC,KAAK,EAAEC,UAAU,EAAE;IAC/C,OACED,KAAK,YAAYE,WAAW,IAC5BF,KAAK,CAACG,YAAY,CAAC,CAAA,KAAA,EAAQF,UAAU,CAAA,KAAA,CAAO,CAAC;EAEjD;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACO,SAASG,WAAWA,CAACC,MAAM,GAAGC,QAAQ,CAACC,IAAI,EAAE;IAClD,IAAI,CAACF,MAAM,EAAE;EACX,IAAA,OAAO,KAAK;EACd;EAEA,EAAA,OAAOA,MAAM,CAACG,SAAS,CAACC,QAAQ,CAAC,0BAA0B,CAAC;EAC9D;EAiCO,SA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