design_system 0.10.0 → 0.12.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 (292) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/components/_index.scss +36 -20
  3. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/action-link/_action-link.scss +3 -0
  4. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/action-link/_index.scss +84 -0
  5. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/back-link/_back-link.scss +3 -0
  6. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/back-link/_index.scss +56 -0
  7. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/breadcrumb/_breadcrumb.scss +3 -0
  8. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/breadcrumb/_index.scss +103 -0
  9. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/button/_button.scss +3 -0
  10. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/button/_index.scss +207 -0
  11. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/card/_card.scss +3 -0
  12. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/card/_index.scss +526 -0
  13. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/character-count/_character-count.scss +3 -0
  14. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/character-count/_index.scss +54 -0
  15. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/checkboxes/_checkboxes.scss +3 -0
  16. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/checkboxes/_index.scss +337 -0
  17. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/contents-list/_contents-list.scss +3 -0
  18. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/contents-list/_index.scss +32 -0
  19. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/date-input/_date-input.scss +3 -0
  20. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/date-input/_index.scss +40 -0
  21. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/details/_details.scss +3 -0
  22. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/details/_index.scss +374 -0
  23. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/do-dont-list/_do-dont-list.scss +3 -0
  24. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/do-dont-list/_index.scss +37 -0
  25. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/error-message/_error-message.scss +3 -0
  26. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/error-message/_index.scss +22 -0
  27. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/error-summary/_error-summary.scss +3 -0
  28. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/error-summary/_index.scss +75 -0
  29. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/fieldset/_fieldset.scss +3 -0
  30. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/fieldset/_index.scss +81 -0
  31. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/file-upload/_file-upload.scss +3 -0
  32. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/file-upload/_index.scss +251 -0
  33. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/footer/_footer.scss +3 -0
  34. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/footer/_index.scss +64 -0
  35. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/header/_header.scss +3 -0
  36. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/header/_index.scss +783 -0
  37. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/hero/_hero.scss +3 -0
  38. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/hero/_index.scss +205 -0
  39. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/hint/_hint.scss +3 -0
  40. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/hint/_index.scss +53 -0
  41. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/images/_images.scss +3 -0
  42. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/images/_index.scss +53 -0
  43. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/input/_index.scss +184 -0
  44. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/input/_input.scss +3 -0
  45. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/inset-text/_index.scss +34 -0
  46. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/inset-text/_inset-text.scss +3 -0
  47. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/label/_index.scss +53 -0
  48. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/label/_label.scss +3 -0
  49. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/notification-banner/_index.scss +100 -0
  50. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/notification-banner/_notification-banner.scss +3 -0
  51. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/pagination/_index.scss +261 -0
  52. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/pagination/_pagination.scss +3 -0
  53. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/panel/_index.scss +99 -0
  54. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/panel/_panel.scss +3 -0
  55. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/password-input/_index.scss +37 -0
  56. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/password-input/_password-input.scss +3 -0
  57. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/radios/_index.scss +354 -0
  58. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/radios/_radios.scss +3 -0
  59. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/select/_index.scss +63 -0
  60. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/select/_select.scss +3 -0
  61. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/skip-link/_index.scss +48 -0
  62. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/skip-link/_skip-link.scss +3 -0
  63. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/summary-list/_index.scss +215 -0
  64. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/summary-list/_summary-list.scss +3 -0
  65. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/tables/_index.scss +205 -0
  66. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/tables/_tables.scss +3 -0
  67. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/tabs/_index.scss +138 -0
  68. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/tabs/_tabs.scss +3 -0
  69. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/tag/_index.scss +101 -0
  70. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/tag/_tag.scss +3 -0
  71. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/task-list/_index.scss +111 -0
  72. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/task-list/_task-list.scss +3 -0
  73. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/textarea/_index.scss +52 -0
  74. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/textarea/_textarea.scss +3 -0
  75. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/warning-callout/_index.scss +22 -0
  76. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/components/warning-callout/_warning-callout.scss +3 -0
  77. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/_index.scss +4 -0
  78. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/_nhsuk-frontend-properties.scss +28 -0
  79. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/all.scss +3 -1
  80. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/elements/_forms.scss +4 -2
  81. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/elements/_index.scss +2 -0
  82. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/elements/_links.scss +3 -2
  83. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/elements/_page.scss +66 -0
  84. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/elements/_table.scss +6 -5
  85. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/generic/_box-sizing.scss +2 -4
  86. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/generic/_font-face.scss +29 -15
  87. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/generic/_index.scss +2 -0
  88. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/helpers/_colour.scss +106 -0
  89. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/helpers/_index.scss +7 -0
  90. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/objects/_button-group.scss +124 -0
  91. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/objects/_form-group.scss +47 -0
  92. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/objects/_grid.scss +5 -3
  93. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/objects/_index.scss +4 -0
  94. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/objects/_input-wrapper.scss +81 -0
  95. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/objects/_main-wrapper.scss +66 -0
  96. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/objects/_width-container.scss +98 -0
  97. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/settings/_all.scss +3 -1
  98. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/settings/_breakpoints.scss +35 -0
  99. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/settings/_colours-applied.scss +326 -0
  100. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/settings/_colours-deprecated.scss +116 -0
  101. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/settings/_colours-palette.scss +41 -0
  102. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/settings/_colours.scss +12 -0
  103. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/settings/_globals.scss +214 -0
  104. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/settings/_index.scss +5 -1
  105. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/settings/_spacing.scss +3 -3
  106. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/settings/_typography.scss +15 -34
  107. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/settings/_warnings.scss +11 -5
  108. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/styles/_icons.scss +45 -0
  109. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/styles/_index.scss +2 -0
  110. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/styles/_lists.scss +15 -10
  111. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/styles/_section-break.scss +4 -2
  112. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/styles/_typography.scss +34 -39
  113. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/tools/_all.scss +3 -1
  114. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/tools/_buttons.scss +85 -0
  115. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/tools/_exports.scss +1 -11
  116. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/tools/_focused.scss +134 -0
  117. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/tools/_functions.scss +81 -0
  118. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/tools/_grid.scss +74 -0
  119. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/tools/_index.scss +5 -1
  120. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/tools/_links.scss +234 -0
  121. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/tools/_mixins.scss +168 -118
  122. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/tools/_sass-mq.scss +9 -11
  123. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/tools/_shape-arrow.scss +14 -20
  124. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/tools/_shape-chevron.scss +65 -0
  125. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/tools/_shape-dash.scss +31 -0
  126. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/tools/_spacing.scss +25 -14
  127. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/tools/_typography.scss +71 -25
  128. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/utilities/_clearfix.scss +2 -0
  129. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/utilities/_display.scss +2 -0
  130. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/utilities/_float.scss +2 -0
  131. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/utilities/_grid-widths.scss +19 -20
  132. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/utilities/_index.scss +2 -0
  133. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/utilities/_link-nowrap.scss +2 -0
  134. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/utilities/_list-border.scss +6 -2
  135. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/utilities/_reading-width.scss +2 -0
  136. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/utilities/_spacing.scss +6 -0
  137. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/utilities/_text-align.scss +2 -0
  138. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/core/utilities/_typography.scss +52 -0
  139. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/utilities/_visually-hidden.scss +2 -0
  140. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/utilities/_widths.scss +2 -0
  141. data/app/assets/stylesheets/design_system/{nhsuk-frontend-9.6.4 → nhsuk-frontend-10.3.1}/core/vendor/sass-mq.scss +4 -2
  142. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/index.scss +4 -0
  143. data/app/assets/stylesheets/design_system/nhsuk-frontend-10.3.1/nhsuk.scss +3 -0
  144. data/app/assets/stylesheets/design_system/nhsuk.scss +2 -2
  145. data/app/helpers/design_system_helper.rb +8 -4
  146. data/app/views/layouts/govuk/application.html.erb +1 -0
  147. data/app/views/layouts/nhsuk/application.html.erb +52 -59
  148. data/app/views/nhsuk/_navigation.html.erb +9 -13
  149. data/lib/design_system/engine.rb +1 -1
  150. data/lib/design_system/generic/builders/action_link.rb +17 -0
  151. data/lib/design_system/generic/builders/elements/backlink.rb +30 -0
  152. data/lib/design_system/generic/builders/fixed_elements.rb +4 -0
  153. data/lib/design_system/generic/builders/link.rb +9 -0
  154. data/lib/design_system/generic/builders/notification.rb +10 -6
  155. data/lib/design_system/generic/builders/pagination_renderer.rb +4 -9
  156. data/lib/design_system/govuk/builders/action_link.rb +17 -0
  157. data/lib/design_system/govuk/form_builder.rb +6 -2
  158. data/lib/design_system/govuk/test_helpers/form_builder_testable.rb +14 -0
  159. data/lib/design_system/nhsuk/builders/action_link.rb +30 -0
  160. data/lib/design_system/nhsuk/builders/elements/breadcrumbs.rb +12 -16
  161. data/lib/design_system/nhsuk/builders/notification.rb +0 -6
  162. data/lib/design_system/version.rb +1 -1
  163. data/lib/tasks/nhsuk.rake +10 -5
  164. data/public/design_system/static/{nhsuk-frontend-9.6.4/favicons → nhsuk-frontend-10.3.1/images}/favicon.ico +0 -0
  165. data/public/design_system/static/nhsuk-frontend-10.3.1/images/favicon.svg +4 -0
  166. data/public/design_system/static/nhsuk-frontend-10.3.1/images/nhsuk-icon-180.png +0 -0
  167. data/public/design_system/static/nhsuk-frontend-10.3.1/images/nhsuk-icon-192.png +0 -0
  168. data/public/design_system/static/nhsuk-frontend-10.3.1/images/nhsuk-icon-512.png +0 -0
  169. data/public/design_system/static/nhsuk-frontend-10.3.1/images/nhsuk-icon-mask.svg +3 -0
  170. data/public/design_system/static/nhsuk-frontend-10.3.1/images/nhsuk-opengraph-image.png +0 -0
  171. data/public/design_system/static/nhsuk-frontend-10.3.1/manifest.json +39 -0
  172. data/public/design_system/static/nhsuk-frontend-10.3.1/nhsuk-frontend.min.js +1 -0
  173. data/public/design_system/static/nhsuk-frontend-10.3.1/nhsuk-frontend.min.js.map +1 -0
  174. data/public/design_system/static/nhsuk-frontend-10.3.1/nhsuk.js +7 -0
  175. metadata +159 -161
  176. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/action-link/_action-link.scss +0 -1
  177. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/action-link/_index.scss +0 -73
  178. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/back-link/_back-link.scss +0 -1
  179. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/back-link/_index.scss +0 -66
  180. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/breadcrumb/_breadcrumb.scss +0 -1
  181. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/breadcrumb/_index.scss +0 -138
  182. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/button/_button.scss +0 -1
  183. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/button/_index.scss +0 -257
  184. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/card/_card.scss +0 -1
  185. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/card/_index.scss +0 -321
  186. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/character-count/_character-count.scss +0 -1
  187. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/character-count/_index.scss +0 -19
  188. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/checkboxes/_checkboxes.scss +0 -1
  189. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/checkboxes/_index.scss +0 -155
  190. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/contents-list/_contents-list.scss +0 -1
  191. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/contents-list/_index.scss +0 -40
  192. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/date-input/_date-input.scss +0 -1
  193. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/date-input/_index.scss +0 -29
  194. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/details/_details.scss +0 -1
  195. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/details/_index.scss +0 -211
  196. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/do-dont-list/_do-dont-list.scss +0 -1
  197. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/do-dont-list/_index.scss +0 -23
  198. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/error-message/_error-message.scss +0 -1
  199. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/error-message/_index.scss +0 -17
  200. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/error-summary/_error-summary.scss +0 -1
  201. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/error-summary/_index.scss +0 -72
  202. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/fieldset/_fieldset.scss +0 -1
  203. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/fieldset/_index.scss +0 -65
  204. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/footer/_footer.scss +0 -1
  205. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/footer/_index.scss +0 -87
  206. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_header-base.scss +0 -495
  207. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_header-organisation.scss +0 -126
  208. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_header-service.scss +0 -60
  209. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_header-transactional.scss +0 -61
  210. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_header-white.scss +0 -117
  211. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_header.scss +0 -1
  212. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_index.scss +0 -5
  213. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/hero/_hero.scss +0 -1
  214. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/hero/_index.scss +0 -187
  215. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/hint/_hint.scss +0 -1
  216. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/hint/_index.scss +0 -51
  217. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/images/_images.scss +0 -1
  218. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/images/_index.scss +0 -48
  219. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/input/_index.scss +0 -149
  220. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/input/_input.scss +0 -1
  221. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/inset-text/_index.scss +0 -28
  222. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/inset-text/_inset-text.scss +0 -1
  223. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/label/_index.scss +0 -53
  224. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/label/_label.scss +0 -1
  225. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/pagination/_index.scss +0 -95
  226. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/pagination/_pagination.scss +0 -1
  227. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/panel/_index.scss +0 -57
  228. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/panel/_panel.scss +0 -1
  229. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/radios/_index.scss +0 -180
  230. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/radios/_radios.scss +0 -1
  231. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/select/_index.scss +0 -44
  232. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/select/_select.scss +0 -1
  233. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/skip-link/_index.scss +0 -34
  234. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/skip-link/_skip-link.scss +0 -1
  235. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/summary-list/_index.scss +0 -183
  236. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/summary-list/_summary-list.scss +0 -1
  237. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/tables/_index.scss +0 -181
  238. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/tables/_tables.scss +0 -1
  239. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/tabs/_index.scss +0 -120
  240. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/tabs/_tabs.scss +0 -1
  241. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/tag/_index.scss +0 -92
  242. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/tag/_tag.scss +0 -1
  243. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/task-list/_index.scss +0 -101
  244. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/task-list/_task-list.scss +0 -1
  245. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/textarea/_index.scss +0 -30
  246. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/textarea/_textarea.scss +0 -1
  247. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/warning-callout/_index.scss +0 -19
  248. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/warning-callout/_warning-callout.scss +0 -1
  249. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/elements/_page.scss +0 -43
  250. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/objects/_form-group.scss +0 -25
  251. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/objects/_main-wrapper.scss +0 -96
  252. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/objects/_width-container.scss +0 -63
  253. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/settings/_breakpoints.scss +0 -18
  254. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/settings/_colours.scss +0 -188
  255. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/settings/_globals.scss +0 -82
  256. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/styles/_icons.scss +0 -105
  257. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_focused.scss +0 -86
  258. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_functions.scss +0 -45
  259. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_grid.scss +0 -138
  260. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_ifff.scss +0 -19
  261. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_links.scss +0 -184
  262. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_typography.scss +0 -72
  263. data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/nhsuk.scss +0 -1
  264. data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/apple-touch-icon-180x180.png +0 -0
  265. data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/apple-touch-icon.png +0 -0
  266. data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/favicon-192x192.png +0 -0
  267. data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/favicon.png +0 -0
  268. data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/favicon.svg +0 -3
  269. data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/largetile-310x310.png +0 -0
  270. data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/mediumtile-144x144.png +0 -0
  271. data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/mediumtile-150x150.png +0 -0
  272. data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/smalltile-70x70.png +0 -0
  273. data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/widetile-310x150.png +0 -0
  274. data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-arrow-left.svg +0 -3
  275. data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-arrow-right-circle.svg +0 -4
  276. data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-arrow-right.svg +0 -3
  277. data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-chevron-left.svg +0 -3
  278. data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-chevron-right.svg +0 -3
  279. data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-close.svg +0 -3
  280. data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-cross.svg +0 -4
  281. data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-emdash-small.svg +0 -3
  282. data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-emdash.svg +0 -3
  283. data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-minus.svg +0 -4
  284. data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-plus.svg +0 -4
  285. data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-search.svg +0 -3
  286. data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-tick.svg +0 -3
  287. data/public/design_system/static/nhsuk-frontend-9.6.4/logos/logo-nhs.svg +0 -5
  288. data/public/design_system/static/nhsuk-frontend-9.6.4/logos/nhs-logo.png +0 -0
  289. data/public/design_system/static/nhsuk-frontend-9.6.4/logos/open-graph.png +0 -0
  290. data/public/design_system/static/nhsuk-frontend-9.6.4/nhsuk.js +0 -4
  291. data/public/design_system/static/nhsuk-frontend-9.6.4/nhsuk.min.js +0 -1
  292. /data/public/design_system/static/{design_system-0.10.0 → design_system-0.12.0}/design_system.js +0 -0
@@ -0,0 +1,39 @@
1
+ {
2
+ "icons": [
3
+ {
4
+ "src": "images/favicon.ico",
5
+ "type": "image/x-icon",
6
+ "sizes": "48x48"
7
+ },
8
+ {
9
+ "src": "images/favicon.svg",
10
+ "type": "image/svg+xml",
11
+ "sizes": "150x150",
12
+ "purpose": "any"
13
+ },
14
+ {
15
+ "src": "images/nhsuk-icon-180.png",
16
+ "type": "image/png",
17
+ "sizes": "180x180",
18
+ "purpose": "maskable"
19
+ },
20
+ {
21
+ "src": "images/nhsuk-icon-192.png",
22
+ "type": "image/png",
23
+ "sizes": "192x192",
24
+ "purpose": "maskable"
25
+ },
26
+ {
27
+ "src": "images/nhsuk-icon-512.png",
28
+ "type": "image/png",
29
+ "sizes": "512x512",
30
+ "purpose": "maskable"
31
+ },
32
+ {
33
+ "src": "images/nhsuk-icon-mask.svg",
34
+ "type": "image/svg+xml",
35
+ "sizes": "150x150",
36
+ "purpose": "monochrome"
37
+ }
38
+ ]
39
+ }
@@ -0,0 +1 @@
1
+ function closestAttributeValue(e,t){const n=e.closest(`[${t}]`);return n?n.getAttribute(t):null}const version="10.3.1";function toggleConditionalInput(e,t){if(!(e&&e instanceof HTMLInputElement&&t))return;const n=e.getAttribute("aria-controls");if(!n)return;const s=document.getElementById(n);s&&(e.setAttribute("aria-expanded",e.checked.toString()),s.classList.toggle(t,!e.checked))}function getBreakpoint(e){const t=`--nhsuk-breakpoint-${e}`;return{property:t,value:window.getComputedStyle(document.documentElement).getPropertyValue(t)||void 0}}function setFocus(e,t={}){const n=e.getAttribute("tabindex");function onBlur(){e.removeEventListener("blur",onBlur),t.onBlur&&t.onBlur.call(e),n||e.removeAttribute("tabindex")}n||e.setAttribute("tabindex","-1"),e.addEventListener("focus",(function onFocus(){e.removeEventListener("focus",onFocus),e.addEventListener("blur",onBlur)})),t.onBeforeFocus&&t.onBeforeFocus.call(e),e.focus()}function isInitialised(e,t){return e instanceof HTMLElement&&e.hasAttribute(`data-${t}-init`)}function isSupported(e=document.body){return!!e&&e.classList.contains("nhsuk-frontend-supported")}function isObject(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function isScope(e){return!!e&&(e instanceof Element||e instanceof Document)}function formatErrorMessage(Component,e){return`${Component.moduleName}: ${e}`}function normaliseString(e,t){if(!isValid(e))return;const n=e.toString().trim();let s,i=null==t?void 0:t.type;switch(i||(["true","false"].includes(n)&&(i="boolean"),n.length>0&&isFinite(Number(n))&&(i="number")),i){case"boolean":s="true"===n;break;case"number":s=Number(n);break;default:s=e}return s}function normaliseArray(e){let t=Array.isArray(e)?e:[];if("string"==typeof e)try{var n;t=null!=(n=JSON.parse(decodeURIComponent(e),getArrayValue))?n:[]}catch(s){return[]}return t.map((e=>normaliseString(e))).filter((e=>void 0!==e))}function getArrayValue(e,t){return isValid(t)||""===e&&Array.isArray(t)?t:void 0}function isValid(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e}function extractConfigByNamespace(e,t,n){const s=e.properties[n];if("object"!==(null==s?void 0:s.type))return;const i={[n]:{}};for(const[o,r]of Object.entries(t)){let e=i;const t=o.split(".");for(const[s,i]of t.entries())isObject(e)&&(s<t.length-1?(isObject(e[i])||(e[i]={}),e=e[i]):o!==n&&(e[i]=normaliseString(r)))}return i[n]}function mergeConfigs(...e){const t={};for(const n of e)for(const e of Object.keys(n)){const s=t[e],i=n[e];isObject(s)&&isObject(i)?t[e]=mergeConfigs(s,i):t[e]=i}return t}class NHSUKFrontendError extends Error{constructor(...e){super(...e),this.name="NHSUKFrontendError"}}class SupportError extends NHSUKFrontendError{constructor(e=document.body){const t="noModule"in HTMLScriptElement.prototype?'NHS.UK frontend initialised without `<body class="nhsuk-frontend-supported">` from template `<script>` snippet':"NHS.UK frontend is not supported in this browser";super(e?t:'NHS.UK frontend initialised without `<script type="module">`'),this.name="SupportError"}}class ConfigError extends NHSUKFrontendError{constructor(...e){super(...e),this.name="ConfigError"}}class ElementError extends NHSUKFrontendError{constructor(e){const{component:t,identifier:n,element:s,expectedType:i}=e;let o=n;o+=s?` is not of type ${null!=i?i:"HTMLElement"}`:" not found",t&&(o=formatErrorMessage(t,o)),super(o),this.name="ElementError"}}class InitError extends NHSUKFrontendError{constructor(e){super("string"==typeof e?e:formatErrorMessage(e,"Root element (`$root`) already initialised")),this.name="InitError"}}function normaliseOptions(e){let t,n=document;if(isObject(e)){const s=e;(isScope(s.scope)||null===s.scope)&&(n=s.scope),"function"==typeof s.onError&&(t=s.onError)}return isScope(e)?n=e:null===e?n=null:"function"==typeof e&&(t=e),{scope:n,onError:t}}const e="undefined"!=typeof globalThis?globalThis:self;class Component{constructor(e){this.$root=void 0;const t=this.constructor;if(!(e&&e instanceof t.elementType))throw new ElementError({element:e,component:t,identifier:"Root element (`$root`)",expectedType:t.elementType.name});this.$root=e,t.checkSupport(),this.checkInitialised();const{moduleName:n}=t;this.$root.setAttribute(`data-${n}-init`,"")}checkInitialised(){const e=this.constructor;if(isInitialised(this.$root,e.moduleName))throw new InitError(e)}static checkSupport(){if(!isSupported())throw new SupportError}}Component.elementType=e.HTMLElement,Component.moduleName="nhsuk-component";class ConfigurableComponent extends Component{constructor(e,t){super(e),this.config=void 0;const n=this.constructor;if(!isObject(n.defaults))throw new ConfigError(formatErrorMessage(n,"Config passed as parameter into constructor but no defaults defined"));const s=function(Component,e){if(!isObject(Component.schema))throw new ConfigError(formatErrorMessage(Component,"Config passed as parameter into constructor but no schema defined"));const t={},n=Object.entries(Component.schema.properties);for(const s of n){const[n,i]=s,o=n.toString();o in e&&(t[o]="array"===(null==i?void 0:i.type)?normaliseArray(e[o]):normaliseString(e[o],i)),"object"===(null==i?void 0:i.type)&&(t[o]=extractConfigByNamespace(Component.schema,e,n))}return t}(n,this.$root.dataset);this.config=mergeConfigs(n.defaults,null!=t?t:{}),this.config=mergeConfigs(this.config,this.configOverride(s),s)}configOverride(e={}){return{}}}class Button extends ConfigurableComponent{constructor(e,t={}){super(e,t),this.debounceFormSubmitTimer=null,this.$root.addEventListener("keydown",(e=>this.handleKeyDown(e))),this.$root.addEventListener("click",(e=>this.debounce(e)))}handleKeyDown(e){const t=e.target;" "===e.key&&t instanceof HTMLElement&&"button"===t.getAttribute("role")&&(e.preventDefault(),t.click())}debounce(e){if(this.config.preventDoubleClick)return this.debounceFormSubmitTimer?(e.preventDefault(),!1):void(this.debounceFormSubmitTimer=window.setTimeout((()=>{this.debounceFormSubmitTimer=null}),1e3))}}function initButtons(e){const{scope:t}=normaliseOptions(e),n=null==t?void 0:t.querySelectorAll(`[data-module="${Button.moduleName}"]`);null==n||n.forEach((t=>{new Button(t,e)}))}Button.moduleName="nhsuk-button",Button.defaults=Object.freeze({preventDoubleClick:!1}),Button.schema=Object.freeze({properties:{preventDoubleClick:{type:"boolean"}}});class I18n{constructor(e={},t={}){var n;this.translations=e,this.locale=null!=(n=t.locale)?n:document.documentElement.lang||"en"}t(e,t){if(!e)throw new Error("i18n: lookup key missing");let n=this.translations[e];if("number"==typeof(null==t?void 0:t.count)&&isObject(n)){const s=n[this.getPluralSuffix(e,t.count)];s&&(n=s)}if("string"==typeof n){if(n.match(/%{(.\S+)}/)){if(!t)throw new Error("i18n: cannot replace placeholders in string if no option data provided");return this.replacePlaceholders(n,t)}return n}return e}replacePlaceholders(e,t){const n=Intl.NumberFormat.supportedLocalesOf(this.locale).length?new Intl.NumberFormat(this.locale):void 0;return e.replace(/%{(.\S+)}/g,(function(e,s){if(Object.prototype.hasOwnProperty.call(t,s)){const e=t[s];return!1===e||"number"!=typeof e&&"string"!=typeof e?"":"number"==typeof e?n?n.format(e):`${e}`:e}throw new Error(`i18n: no data found to replace ${e} placeholder in string`)}))}hasIntlPluralRulesSupport(){return Boolean("PluralRules"in window.Intl&&Intl.PluralRules.supportedLocalesOf(this.locale).length)}getPluralSuffix(e,t){if(t=Number(t),!isFinite(t))return"other";const n=this.translations[e],s=this.hasIntlPluralRulesSupport()?new Intl.PluralRules(this.locale).select(t):"other";if(isObject(n)){if(s in n)return s;if("other"in n)return console.warn(`i18n: Missing plural form ".${s}" for "${this.locale}" locale. Falling back to ".other".`),"other"}throw new Error(`i18n: Plural form ".other" is required for "${this.locale}" locale`)}}class CharacterCount extends ConfigurableComponent{constructor(e,t={}){var n;super(e,t),this.lastInputTimestamp=null,this.lastInputValue="",this.valueChecker=null;const s=this.$root.querySelector(".nhsuk-js-character-count");if(!(s instanceof HTMLTextAreaElement||s instanceof HTMLInputElement))throw new ElementError({component:CharacterCount,element:s,expectedType:"HTMLTextareaElement or HTMLInputElement",identifier:"Form field (`.nhsuk-js-character-count`)"});const i=function(e,t){const n=[];for(const[s,i]of Object.entries(e)){const e=[];if(Array.isArray(i)){for(const{required:n,errorMessage:s}of i)n.every((e=>!!t[e]))||e.push(s);"anyOf"!==s||i.length-e.length>=1||n.push(...e)}}return n}(CharacterCount.schema,this.config);if(i[0])throw new ConfigError(formatErrorMessage(CharacterCount,i[0]));const{i18n:o,maxwords:r,maxlength:a,screenReaderCountMessageClass:l,textareaDescriptionClass:u,visibleCountMessageClass:c}=this.config;this.i18n=new I18n(o,{locale:closestAttributeValue(this.$root,"lang")}),this.maxLength=null!=(n=null!=r?r:a)?n:1/0,this.$textarea=s;const h=`${this.$textarea.id}-info`,d=document.getElementById(h);if(!d)throw new ElementError({component:CharacterCount,element:d,identifier:`Count message (\`id="${h}"\`)`});this.$errorMessage=this.$root.querySelector(".nhsuk-error-message"),/^\s*$/.exec(d.textContent)&&(d.textContent=this.i18n.t("textareaDescription",{count:this.maxLength})),this.$textarea.insertAdjacentElement("afterend",d),this.$screenReaderCountMessage=document.createElement("div"),this.$screenReaderCountMessage.setAttribute("aria-live","polite"),this.$screenReaderCountMessage.classList.add(l,"nhsuk-u-visually-hidden"),d.insertAdjacentElement("afterend",this.$screenReaderCountMessage),this.$visibleCountMessage=document.createElement("div"),this.$visibleCountMessage.setAttribute("aria-hidden","true"),this.$visibleCountMessage.className=d.className,this.$visibleCountMessage.classList.add(c),this.$visibleCountMessage.classList.remove(u),d.insertAdjacentElement("afterend",this.$visibleCountMessage),d.classList.add("nhsuk-u-visually-hidden"),this.$textarea.removeAttribute("maxlength"),this.bindChangeEvents(),window.addEventListener("pageshow",(()=>this.updateCountMessage())),this.updateCountMessage()}configOverride(e){let t={};return("maxwords"in e||"maxlength"in e)&&(t={maxlength:void 0,maxwords:void 0}),t}count(e){if(this.config.maxwords){var t;return(null!=(t=e.match(/\S+/g))?t:[]).length}return e.length}bindChangeEvents(){this.$textarea.addEventListener("keyup",(()=>this.handleKeyUp())),this.$textarea.addEventListener("focus",(()=>this.handleFocus())),this.$textarea.addEventListener("blur",(()=>this.handleBlur()))}checkIfValueChanged(){this.$textarea.value!==this.lastInputValue&&(this.lastInputValue=this.$textarea.value,this.updateCountMessage())}updateCountMessage(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()}updateVisibleCountMessage(){const e=this.maxLength-this.count(this.$textarea.value)<0;this.$visibleCountMessage.classList.toggle(`${this.config.visibleCountMessageClass}--disabled`,!this.isOverThreshold()),this.$errorMessage||this.$textarea.classList.toggle("nhsuk-textarea--error",e),this.$visibleCountMessage.classList.toggle("nhsuk-error-message",e),this.$visibleCountMessage.classList.toggle("nhsuk-hint",!e),this.$visibleCountMessage.textContent=this.formattedUpdateMessage()}updateScreenReaderCountMessage(){this.isOverThreshold()?this.$screenReaderCountMessage.removeAttribute("aria-hidden"):this.$screenReaderCountMessage.setAttribute("aria-hidden","true"),this.$screenReaderCountMessage.textContent=this.formattedUpdateMessage()}formattedUpdateMessage(){const e=this.maxLength-this.count(this.$textarea.value),t=this.config.maxwords?"words":"characters";return this.formatCountMessage(e,t)}formatCountMessage(e,t){if(0===e)return this.i18n.t(`${t}AtLimit`);const n=e<0?"OverLimit":"UnderLimit";return this.i18n.t(`${t}${n}`,{count:Math.abs(e)})}isOverThreshold(){if(!this.config.threshold)return!0;const e=this.count(this.$textarea.value);return this.maxLength*this.config.threshold/100<=e}handleKeyUp(){this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()}handleFocus(){this.valueChecker=window.setInterval((()=>{(!this.lastInputTimestamp||Date.now()-500>=this.lastInputTimestamp)&&this.checkIfValueChanged()}),1e3)}handleBlur(){this.valueChecker&&window.clearInterval(this.valueChecker)}}function initCharacterCounts(e){const{scope:t}=normaliseOptions(e),n=null==t?void 0:t.querySelectorAll(`[data-module="${CharacterCount.moduleName}"]`);null==n||n.forEach((t=>{new CharacterCount(t,e)}))}CharacterCount.moduleName="nhsuk-character-count",CharacterCount.defaults=Object.freeze({threshold:0,textareaDescriptionClass:"nhsuk-character-count__message",visibleCountMessageClass:"nhsuk-character-count__status",screenReaderCountMessageClass:"nhsuk-character-count__sr-status",i18n:{charactersUnderLimit:{one:"You have %{count} character remaining",other:"You have %{count} characters remaining"},charactersAtLimit:"You have 0 characters remaining",charactersOverLimit:{one:"You have %{count} character too many",other:"You have %{count} characters too many"},wordsUnderLimit:{one:"You have %{count} word remaining",other:"You have %{count} words remaining"},wordsAtLimit:"You have 0 words remaining",wordsOverLimit:{one:"You have %{count} word too many",other:"You have %{count} words too many"},textareaDescription:{other:""}}}),CharacterCount.schema=Object.freeze({properties:{maxwords:{type:"number"},maxlength:{type:"number"},threshold:{type:"number"},textareaDescriptionClass:{type:"string"},visibleCountMessageClass:{type:"string"},screenReaderCountMessageClass:{type:"string"},i18n:{type:"object"}},anyOf:[{required:["maxwords"],errorMessage:'Either "maxlength" or "maxwords" must be provided'},{required:["maxlength"],errorMessage:'Either "maxlength" or "maxwords" must be provided'}]});class Checkboxes extends ConfigurableComponent{constructor(e,t){super(e,t);const n=this.$root.querySelectorAll('input[type="checkbox"]');if(!n.length)throw new ElementError({component:Checkboxes,identifier:'Form inputs (`<input type="checkbox">`)'});this.$inputs=n,this.$inputs.forEach((e=>{var t;const n=null!=(t=e.dataset.ariaControls)?t:e.getAttribute("aria-controls");if(n){if(!document.getElementById(n))throw new ElementError({component:Checkboxes,identifier:`Conditional reveal (\`id="${n}"\`)`});e.hasAttribute("aria-controls")||(e.setAttribute("aria-controls",n),delete e.dataset.ariaControls)}})),window.addEventListener("pageshow",(()=>this.syncAllConditionalReveals())),this.syncAllConditionalReveals(),this.$root.addEventListener("click",(e=>this.handleClick(e)))}syncAllConditionalReveals(){this.$inputs.forEach((e=>this.syncConditionalRevealWithInputState(e)))}syncConditionalRevealWithInputState(e){const{conditionalClass:t}=this.config;toggleConditionalInput(e,`${t}--hidden`)}unCheckAllInputsExcept(e){const{checkboxExclusiveGroup:t}=e.dataset,n=t?`[data-checkbox-exclusive-group="${t}"]`:`[name="${e.name}"]`;document.querySelectorAll(`input[type="checkbox"]${n}`).forEach((n=>{e.form===n.form&&n!==e&&this.setInputState(n,!1,t)}))}unCheckExclusiveInputs(e){const{checkboxExclusiveGroup:t}=e.dataset,n=t?`[data-checkbox-exclusive-group="${t}"]`:`[name="${e.name}"]`;document.querySelectorAll(`input[type="checkbox"][data-checkbox-exclusive]${n}`).forEach((n=>{e.form===n.form&&this.setInputState(n,!1,t)}))}setInputState(e,t,n){const{checkboxExclusiveGroup:s}=e.dataset;n&&s&&s!==n||(e.checked=t,this.syncConditionalRevealWithInputState(e))}handleClick(e){const t=e.target;if(!(t instanceof HTMLInputElement)||"checkbox"!==t.type)return;t.getAttribute("aria-controls")&&this.syncConditionalRevealWithInputState(t),t.checked&&("checkboxExclusive"in t.dataset?this.unCheckAllInputsExcept(t):this.unCheckExclusiveInputs(t))}}function initCheckboxes(e){const{scope:t}=normaliseOptions(e),n=null==t?void 0:t.querySelectorAll(`[data-module="${Checkboxes.moduleName}"]`);null==n||n.forEach((t=>{new Checkboxes(t,e)}))}Checkboxes.moduleName="nhsuk-checkboxes",Checkboxes.defaults=Object.freeze({conditionalClass:"nhsuk-checkboxes__conditional"}),Checkboxes.schema=Object.freeze({properties:{conditionalClass:{type:"string"}}});class ErrorSummary extends ConfigurableComponent{constructor(e,t={}){super(e,t),this.config.disableAutoFocus||setFocus(this.$root),this.$root.addEventListener("click",(e=>this.handleClick(e)))}configOverride(e){let t={};return"focusOnPageLoad"in this.config&&(console.warn(formatErrorMessage(ErrorSummary,"Option `focusOnPageLoad` is deprecated. Use `disableAutoFocus` instead.")),t.disableAutoFocus=!this.config.focusOnPageLoad),t}getAssociatedLegendOrLabel(e){var t;const n=e.closest("fieldset");if(n){const t=n.getElementsByTagName("legend");if(t.length){const n=t[0];if(e instanceof HTMLInputElement&&("checkbox"===e.type||"radio"===e.type))return n;const s=n.getBoundingClientRect().top,i=e.getBoundingClientRect();if(i.height&&window.innerHeight){if(i.top+i.height-s<window.innerHeight/2)return n}}}return null!=(t=document.querySelector(`label[for='${e.getAttribute("id")}']`))?t:e.closest("label")}focusTarget(e){if(!(e instanceof HTMLAnchorElement))return!1;const t=e.hash.replace("#","");if(!t)return!1;const n=document.getElementById(t);if(!n)return!1;const s=this.getAssociatedLegendOrLabel(n);return!!s&&(s.scrollIntoView(),n.focus({preventScroll:!0}),!0)}handleClick(e){const t=e.target;t&&this.focusTarget(t)&&e.preventDefault()}}function initErrorSummary(e){const{scope:t}=normaliseOptions(e),n=null==t?void 0:t.querySelector(`[data-module="${ErrorSummary.moduleName}"]`);n&&new ErrorSummary(n,e)}ErrorSummary.moduleName="nhsuk-error-summary",ErrorSummary.defaults=Object.freeze({disableAutoFocus:!1}),ErrorSummary.schema=Object.freeze({properties:{focusOnPageLoad:{type:"boolean"},disableAutoFocus:{type:"boolean"}}});class FileUpload extends ConfigurableComponent{constructor(e,t={}){super(e,t),this.enteredAnotherElement=void 0;const n=this.$root.querySelector("input");if(!(n instanceof HTMLInputElement))throw new ElementError({component:FileUpload,element:n,expectedType:"HTMLInputElement",identifier:"Form field (`<input>`)"});if("file"!==n.type)throw new ElementError({component:FileUpload,element:n,identifier:"Form field (`<input>`)",expectedType:'HTMLInputElement with attribute (`type="file"`)'});if(this.$input=n,!this.$input.id)throw new ElementError({component:FileUpload,identifier:'File input (`<input type="file">`) attribute (`id`)'});this.id=this.$input.id;const{i18n:s,dropZoneClass:i,dropButtonClass:o,dropButtonGroupClass:r,dropInstructionClass:a,chooseFilesButtonClass:l,chooseFilesButtonClassList:u,announcementsClass:c,statusClass:h}=this.config;this.i18n=new I18n(s,{locale:closestAttributeValue(this.$root,"lang")});const d=this.findLabel();d.id||(d.id=`${this.id}-label`),this.$input.id=`${this.id}-input`,this.$input.setAttribute("hidden",""),this.$dropZone=this.$root.classList.contains(i)?this.$root:document.createElement("div"),this.$root!==this.$dropZone&&this.$dropZone.classList.add(i),this.$dropButton=document.createElement("button"),this.$dropButton.classList.add(o),this.$dropButton.type="button",this.$dropButton.id=this.id,this.$dropButton.classList.add(`${o}--empty`);const p=this.$input.getAttribute("aria-describedby");p&&this.$dropButton.setAttribute("aria-describedby",p),this.$status=document.createElement("span"),this.$status.classList.add("nhsuk-body",h),this.$status.setAttribute("aria-live","polite"),this.$status.innerText=this.formatStatusMessage(0),this.$dropButton.appendChild(this.$status);const m=document.createElement("span");m.classList.add("nhsuk-u-visually-hidden"),m.innerText=", ",m.id=`${this.id}-comma`,this.$dropButton.appendChild(m);const f=document.createElement("span");f.classList.add(r);const g=document.createElement("span");g.classList.add("nhsuk-button",l,...u),g.innerText=this.i18n.t("chooseFilesButton"),f.appendChild(g),f.append(" ");const b=document.createElement("span");var $;(b.classList.add("nhsuk-body",a),b.innerText=this.i18n.t("dropInstruction"),f.appendChild(b),this.$dropButton.appendChild(f),this.$dropButton.setAttribute("aria-labelledby",`${d.id} ${m.id} ${this.$dropButton.id}`),this.$dropButton.addEventListener("click",this.onClick.bind(this)),this.$dropButton.addEventListener("dragover",(e=>{e.preventDefault()})),this.$dropZone.parentElement)||(null==($=this.$input.parentElement)||$.insertBefore(this.$dropZone,this.$input),this.$dropZone.appendChild(this.$input));this.$dropZone.insertAdjacentElement("afterbegin",this.$dropButton),this.$input.setAttribute("tabindex","-1"),this.$input.setAttribute("aria-hidden","true"),this.$input.addEventListener("change",this.onChange.bind(this)),this.updateDisabledState(),this.observeDisabledState(),this.$announcements=document.createElement("span"),this.$announcements.classList.add(c,"nhsuk-u-visually-hidden"),this.$announcements.setAttribute("aria-live","assertive"),this.$dropZone.insertAdjacentElement("afterend",this.$announcements),this.$dropButton.addEventListener("drop",this.onDrop.bind(this)),document.addEventListener("dragenter",this.updateDropzoneVisibility.bind(this)),document.addEventListener("dragenter",(()=>{this.enteredAnotherElement=!0})),document.addEventListener("dragleave",(()=>{this.enteredAnotherElement||this.$dropButton.disabled||(this.hideDraggingState(),this.$announcements.innerText=this.i18n.t("leftDropZone")),this.enteredAnotherElement=!1}))}updateDropzoneVisibility(e){if(this.$dropButton.disabled)return;const{dropButtonClass:t}=this.config;e.target instanceof Node&&(this.$dropZone.contains(e.target)?e.dataTransfer&&this.canDrop(e.dataTransfer)&&(this.$dropButton.classList.contains(`${t}--dragging`)||(this.showDraggingState(),this.$announcements.innerText=this.i18n.t("enteredDropZone"))):this.$dropButton.classList.contains(`${t}--dragging`)&&(this.hideDraggingState(),this.$announcements.innerText=this.i18n.t("leftDropZone")))}showDraggingState(){const{dropButtonClass:e}=this.config;this.$dropButton.classList.add(`${e}--dragging`)}hideDraggingState(){const{dropButtonClass:e}=this.config;this.$dropButton.classList.remove(`${e}--dragging`)}onDrop(e){e.preventDefault(),e.dataTransfer&&this.canFillInput(e.dataTransfer)&&(this.$input.files=e.dataTransfer.files,this.$input.dispatchEvent(new CustomEvent("change")),this.hideDraggingState())}canFillInput(e){return this.matchesInputCapacity(e.files.length)}canDrop(e){return e.items.length?this.matchesInputCapacity(function(e){let t=0;for(let n=0;n<e.length;n++)"file"===e[n].kind&&t++;return t}(e.items)):!e.types.length||e.types.includes("Files")}matchesInputCapacity(e){return this.$input.multiple?e>0:1===e}onChange(){const{dropButtonClass:e}=this.config,{files:t}=this.$input;null!=t&&t.length?(1===t.length?this.$status.innerText=t[0].name:this.$status.innerText=this.formatStatusMessage(t.length),this.$dropButton.classList.remove(`${e}--empty`)):(this.$status.innerText=this.formatStatusMessage(0),this.$dropButton.classList.add(`${e}--empty`))}formatStatusMessage(e){return 0===e?this.i18n.t("noFileChosen"):this.i18n.t("multipleFilesChosen",{count:e})}findLabel(){const e=document.querySelector(`label[for="${this.$input.id}"]`);if(!e)throw new ElementError({component:FileUpload,identifier:`Field label (\`<label for=${this.$input.id}>\`)`});return e}onClick(){this.$input.click()}observeDisabledState(){new MutationObserver((e=>{for(const t of e)"attributes"===t.type&&"disabled"===t.attributeName&&this.updateDisabledState()})).observe(this.$input,{attributes:!0})}updateDisabledState(){const{dropZoneClass:e}=this.config,t=this.$root.classList.contains(e)?`${e}--disabled`:`${FileUpload.moduleName}--disabled`;this.$dropButton.disabled=this.$input.disabled,this.$root.classList.toggle(t,this.$dropButton.disabled)}}function initFileUploads(e){const{scope:t}=normaliseOptions(e),n=null==t?void 0:t.querySelectorAll(`[data-module="${FileUpload.moduleName}"]`);null==n||n.forEach((t=>{new FileUpload(t,e)}))}FileUpload.moduleName="nhsuk-file-upload",FileUpload.defaults=Object.freeze({dropZoneClass:"nhsuk-file-upload__drop-zone",dropButtonClass:"nhsuk-file-upload__drop-button",dropButtonGroupClass:"nhsuk-file-upload__drop-button-group",dropInstructionClass:"nhsuk-file-upload__drop-instruction",chooseFilesButtonClass:"nhsuk-file-upload__choose-files-button",chooseFilesButtonClassList:["nhsuk-button--secondary"],announcementsClass:"nhsuk-file-upload__announcements",statusClass:"nhsuk-file-upload__status",i18n:{chooseFilesButton:"Choose file",dropInstruction:"or drop file",noFileChosen:"No file chosen",multipleFilesChosen:{one:"%{count} file chosen",other:"%{count} files chosen"},enteredDropZone:"Entered drop zone",leftDropZone:"Left drop zone"}}),FileUpload.schema=Object.freeze({properties:{dropZoneClass:{type:"string"},dropButtonClass:{type:"string"},dropButtonGroupClass:{type:"string"},dropInstructionClass:{type:"string"},chooseFilesButtonClass:{type:"string"},chooseFilesButtonClassList:{type:"array"},announcementsClass:{type:"string"},statusClass:{type:"string"},i18n:{type:"object"}}});class Header extends ConfigurableComponent{constructor(e,t){super(e,t),this.$navigation=null,this.$navigationList=null,this.$navigationItems=null,this.$menu=null,this.$menuToggle=null,this.$menuList=null,this.width=0,this.breakpoints=[],this.updateNavigationTimer=null,this.menuIsEnabled=!1,this.menuIsOpen=!1;const{navigationClass:n,navigationListClass:s,navigationItemClass:i,menuClass:o,menuToggleClass:r}=this.config,a=this.$root.querySelector(`.${n}`),l=this.$root.querySelector(`.${s}`),u=this.$root.querySelectorAll(`.${i}`),c=this.$root.querySelector(`.${o}`),h=this.$root.querySelector(`.${r}`);if(a){if(!(a instanceof HTMLElement))throw new ElementError({component:Header,identifier:`Navigation (\`<nav class="${n}">\`)`});if(!(l&&l instanceof HTMLElement))throw new ElementError({component:Header,identifier:`List (\`<ul class="${s}">\`)`});if(!u.length)throw new ElementError({component:Header,identifier:`List items (\`<li class="${i}">\`)`});if(!(c&&c instanceof HTMLElement))throw new ElementError({component:Header,identifier:`Menu item (\`<li class="${o}" hidden>\`)`});if(!(h&&h instanceof HTMLButtonElement))throw new ElementError({component:Header,identifier:`Menu button (\`<button class="${r}">\`)`,expectedType:"HTMLButtonElement"});this.$navigation=a,this.$navigationList=l,this.$navigationItems=u,this.$menu=c,this.$menuToggle=h,this.$menuList=document.createElement("ul")}this.handleEscapeKey=this.onEscapeKey.bind(this),this.handleUpdateNavigation=this.updateNavigation.bind(this),this.handleToggleMenu=this.toggleMenu.bind(this),this.setupNavigation(),this.updateNavigation()}resetNavigation(){const{$menu:e,$navigationList:t}=this;if(!e||!t)return;let n=0;this.breakpoints.forEach((s=>{t.insertBefore(s.element,e),n+=s.element.offsetWidth,s.right=n})),this.width=t.offsetWidth}setupNavigation(){const{$navigationItems:e}=this;e&&(e.forEach((e=>{this.breakpoints.push({element:e,right:0})})),window.addEventListener("resize",(()=>{this.updateNavigationTimer&&window.clearTimeout(this.updateNavigationTimer),this.updateNavigationTimer=window.setTimeout(this.handleUpdateNavigation,100)})))}setupMenu(){const{$menu:e,$menuList:t}=this,{menuListClass:n}=this.config;e&&t&&!t.parentElement&&(t.classList.add(n),t.setAttribute("hidden",""),e.appendChild(t))}enableMenu(){const{$menu:e,$menuToggle:t}=this;e&&t&&!this.menuIsEnabled&&(this.menuIsEnabled=!0,e.removeAttribute("hidden"),t.addEventListener("click",this.handleToggleMenu))}disableMenu(){const{$menu:e,$menuToggle:t}=this;e&&t&&this.menuIsEnabled&&(this.closeMenu(),this.menuIsEnabled=!1,e.setAttribute("hidden",""),t.removeEventListener("click",this.handleToggleMenu))}closeMenu(){const{$menuList:e,$menuToggle:t,$navigation:n}=this;n&&e&&t&&this.menuIsEnabled&&this.menuIsOpen&&(this.menuIsOpen=!1,e.setAttribute("hidden",""),t.setAttribute("aria-expanded","false"),n.style.removeProperty("border-bottom-width"),document.removeEventListener("keydown",this.handleEscapeKey))}onEscapeKey(e){"Escape"===e.key&&this.closeMenu()}openMenu(){const{$menuList:e,$menuToggle:t,$navigation:n}=this;n&&e&&t&&this.menuIsEnabled&&!this.menuIsOpen&&(this.menuIsOpen=!0,e.removeAttribute("hidden"),t.setAttribute("aria-expanded","true"),n.style.setProperty("border-bottom-width",`${e.offsetHeight}px`),document.addEventListener("keydown",this.handleEscapeKey))}toggleMenu(){this.menuIsEnabled&&(this.menuIsOpen?this.closeMenu():this.openMenu())}updateNavigation(){if(this.resetNavigation(),!this.breakpoints.filter((e=>e.right>this.width)).length)return void this.disableMenu();this.setupMenu(),this.enableMenu();const{$menu:e,$menuList:t,$navigation:n}=this;e&&t&&n&&(this.width-=e.offsetWidth,this.breakpoints.forEach((e=>{e.right>this.width&&t.insertAdjacentElement("beforeend",e.element)})),this.menuIsOpen&&n.style.setProperty("border-bottom-width",`${t.offsetHeight}px`))}}function initHeader(e){const{scope:t}=normaliseOptions(e),n=null==t?void 0:t.querySelector(`[data-module="${Header.moduleName}"]`);n&&new Header(n,e)}Header.moduleName="nhsuk-header",Header.defaults=Object.freeze({navigationClass:"nhsuk-header__navigation",navigationListClass:"nhsuk-header__navigation-list",navigationItemClass:"nhsuk-header__navigation-item",menuClass:"nhsuk-header__menu",menuToggleClass:"nhsuk-header__menu-toggle",menuListClass:"nhsuk-header__menu-list"}),Header.schema=Object.freeze({properties:{navigationClass:{type:"string"},navigationListClass:{type:"string"},navigationItemClass:{type:"string"},menuClass:{type:"string"},menuToggleClass:{type:"string"},menuListClass:{type:"string"}}});class NotificationBanner extends ConfigurableComponent{constructor(e,t={}){super(e,t),"alert"!==this.$root.getAttribute("role")||this.config.disableAutoFocus||setFocus(this.$root)}}function initNotificationBanners(e){const{scope:t}=normaliseOptions(e),n=null==t?void 0:t.querySelectorAll(`[data-module="${NotificationBanner.moduleName}"]`);null==n||n.forEach((t=>{new NotificationBanner(t,e)}))}NotificationBanner.moduleName="nhsuk-notification-banner",NotificationBanner.defaults=Object.freeze({disableAutoFocus:!1}),NotificationBanner.schema=Object.freeze({properties:{disableAutoFocus:{type:"boolean"}}});class PasswordInput extends ConfigurableComponent{constructor(e,t={}){super(e,t);const n=this.$root.querySelector(".nhsuk-js-password-input-input");if(!(n instanceof HTMLInputElement))throw new ElementError({component:PasswordInput,element:n,expectedType:"HTMLInputElement",identifier:"Form field (`.nhsuk-js-password-input-input`)"});if("password"!==n.type)throw new ElementError({component:PasswordInput,element:n,expectedType:'HTMLInputElement with attribute (`type="password"`)',identifier:"Form field (`.nhsuk-js-password-input-input`)"});const s=this.$root.querySelector(".nhsuk-js-password-input-toggle");if(!(s instanceof HTMLButtonElement))throw new ElementError({component:PasswordInput,element:s,expectedType:"HTMLButtonElement",identifier:"Button (`.nhsuk-js-password-input-toggle`)"});if("button"!==s.type)throw new ElementError({component:PasswordInput,element:s,expectedType:'HTMLButtonElement with type="button"',identifier:"Button (`.nhsuk-js-password-input-toggle`)"});this.$input=n,this.$showHideButton=s;const{i18n:i,screenReaderStatusMessageClass:o}=this.config;this.i18n=new I18n(i,{locale:closestAttributeValue(this.$root,"lang")}),this.$showHideButton.removeAttribute("hidden"),this.$screenReaderStatusMessage=document.createElement("div"),this.$screenReaderStatusMessage.setAttribute("aria-live","polite"),this.$screenReaderStatusMessage.classList.add(o,"nhsuk-u-visually-hidden"),this.$input.insertAdjacentElement("afterend",this.$screenReaderStatusMessage),this.$showHideButton.addEventListener("click",this.toggle.bind(this)),this.$input.form&&this.$input.form.addEventListener("submit",(()=>this.hide())),window.addEventListener("pageshow",(e=>{e.persisted&&"password"!==this.$input.type&&this.hide()})),this.hide()}toggle(e){e.preventDefault(),"password"!==this.$input.type?this.hide():this.show()}show(){this.setType("text")}hide(){this.setType("password")}setType(e){if(e===this.$input.type)return;this.$input.setAttribute("type",e);const t="password"===e,n=t?"show":"hide",s=t?"passwordHidden":"passwordShown";this.$showHideButton.innerText=this.i18n.t(`${n}Password`),this.$showHideButton.setAttribute("aria-label",this.i18n.t(`${n}PasswordAriaLabel`)),this.$screenReaderStatusMessage.innerText=this.i18n.t(`${s}Announcement`)}}function initPasswordInputs(e){const{scope:t}=normaliseOptions(e),n=null==t?void 0:t.querySelectorAll(`[data-module="${PasswordInput.moduleName}"]`);null==n||n.forEach((t=>{new PasswordInput(t,e)}))}PasswordInput.moduleName="nhsuk-password-input",PasswordInput.defaults=Object.freeze({screenReaderStatusMessageClass:"nhsuk-password-input__sr-status",i18n:{showPassword:"Show",hidePassword:"Hide",showPasswordAriaLabel:"Show password",hidePasswordAriaLabel:"Hide password",passwordShownAnnouncement:"Your password is visible",passwordHiddenAnnouncement:"Your password is hidden"}}),PasswordInput.schema=Object.freeze({properties:{screenReaderStatusMessageClass:{type:"string"},i18n:{type:"object"}}});class Radios extends ConfigurableComponent{constructor(e,t){super(e,t);const n=this.$root.querySelectorAll('input[type="radio"]');if(!n.length)throw new ElementError({component:Radios,identifier:'Form inputs (`<input type="radio">`)'});this.$inputs=n,this.$inputs.forEach((e=>{var t;const n=null!=(t=e.dataset.ariaControls)?t:e.getAttribute("aria-controls");if(n){if(!document.getElementById(n))throw new ElementError({component:Radios,identifier:`Conditional reveal (\`id="${n}"\`)`});e.hasAttribute("aria-controls")||(e.setAttribute("aria-controls",n),delete e.dataset.ariaControls)}})),window.addEventListener("pageshow",(()=>this.syncAllConditionalReveals())),this.syncAllConditionalReveals(),this.$root.addEventListener("click",(e=>this.handleClick(e)))}syncAllConditionalReveals(){this.$inputs.forEach((e=>this.syncConditionalRevealWithInputState(e)))}syncConditionalRevealWithInputState(e){const{conditionalClass:t}=this.config;toggleConditionalInput(e,`${t}--hidden`)}handleClick(e){const t=e.target;if(!(t instanceof HTMLInputElement)||"radio"!==t.type)return;const n=document.querySelectorAll('input[type="radio"][aria-controls]'),s=t.form,i=t.name;n.forEach((e=>{const t=e.form===s;e.name===i&&t&&this.syncConditionalRevealWithInputState(e)}))}}function initRadios(e){const{scope:t}=normaliseOptions(e),n=null==t?void 0:t.querySelectorAll(`[data-module="${Radios.moduleName}"]`);null==n||n.forEach((t=>{new Radios(t,e)}))}Radios.moduleName="nhsuk-radios",Radios.defaults=Object.freeze({conditionalClass:"nhsuk-radios__conditional"}),Radios.schema=Object.freeze({properties:{conditionalClass:{type:"string"}}});const t="undefined"!=typeof globalThis?globalThis:self;class SkipLink extends ConfigurableComponent{constructor(e,t){var n;super(e,t);const s=this.$root.hash,i=null!=(n=this.$root.getAttribute("href"))?n:"";if(this.$root.origin!==window.location.origin||this.$root.pathname!==window.location.pathname)return;const o=s.replace("#","");if(!o)throw new ElementError({component:SkipLink,identifier:`Target link (\`href="${i}"\`) hash fragment`});const r=document.getElementById(o);if(!r)throw new ElementError({component:SkipLink,element:r,identifier:`Target content (\`id="${o}"\`)`});this.$root.addEventListener("click",(()=>{const{focusedElementClassList:e}=this.config;setFocus(r,{onBeforeFocus(){r.classList.add(...e)},onBlur(){r.classList.remove(...e)}})}))}}function initSkipLinks(e){const{scope:t}=normaliseOptions(e),n=null==t?void 0:t.querySelectorAll(`[data-module="${SkipLink.moduleName}"]`);null==n||n.forEach((t=>{new SkipLink(t,e)}))}SkipLink.elementType=t.HTMLAnchorElement,SkipLink.moduleName="nhsuk-skip-link",SkipLink.defaults=Object.freeze({focusedElementClassList:["nhsuk-skip-link-focused-element"]}),SkipLink.schema=Object.freeze({properties:{focusedElementClassList:{type:"array"}}});class Tabs extends ConfigurableComponent{constructor(e,t={}){super(e,t),this.changingHash=!1,this.jsHiddenClass=void 0,this.mql=null;const{listClass:n,listItemClass:s,tabClass:i}=this.config,o=this.$root.querySelectorAll(`a.${i}`);if(!o.length)throw new ElementError({component:Tabs,identifier:`Links (\`<a class="${i}">\`)`});this.$tabs=o,this.boundTabClick=this.onTabClick.bind(this),this.boundTabKeydown=this.onTabKeydown.bind(this),this.boundOnHashChange=this.onHashChange.bind(this);const r=this.$root.querySelector(`ul.${n}`),a=this.$root.querySelectorAll(`li.${s}`);if(!r)throw new ElementError({component:Tabs,identifier:`List (\`<ul class="${n}">\`)`});if(!a.length)throw new ElementError({component:Tabs,identifier:`List items (\`<li class="${s}">\`)`});this.$tabList=r,this.$tabListItems=a,this.setupResponsiveChecks()}setupResponsiveChecks(){const e=getBreakpoint("tablet");if(!e.value)throw new ElementError({component:Tabs,identifier:`CSS custom property (\`${e.property}\`) on pseudo-class \`:root\``});this.mql=window.matchMedia(`(min-width: ${e.value})`),"addEventListener"in this.mql?this.mql.addEventListener("change",(()=>this.checkMode())):this.mql.addListener((()=>this.checkMode())),this.checkMode()}checkMode(){var e;null!=(e=this.mql)&&e.matches?this.setup():this.teardown()}setup(){var e;this.$tabList.setAttribute("role","tablist"),this.$tabListItems.forEach((e=>{e.setAttribute("role","presentation")})),this.$tabs.forEach((e=>{this.setAttributes(e),e.addEventListener("click",this.boundTabClick,!0),e.addEventListener("keydown",this.boundTabKeydown,!0),this.hideTab(e)}));const t=null!=(e=this.getTab(window.location.hash))?e:this.$tabs[0];this.showTab(t),window.addEventListener("hashchange",this.boundOnHashChange,!0)}teardown(){this.$tabList.removeAttribute("role"),this.$tabListItems.forEach((e=>{e.removeAttribute("role")})),this.$tabs.forEach((e=>{e.removeEventListener("click",this.boundTabClick,!0),e.removeEventListener("keydown",this.boundTabKeydown,!0),this.unsetAttributes(e)})),window.removeEventListener("hashchange",this.boundOnHashChange,!0)}onHashChange(){const{hash:e}=window.location,t=this.getTab(e);if(!t)return;if(this.changingHash)return void(this.changingHash=!1);const n=this.getCurrentTab();n&&(this.hideTab(n),this.showTab(t),t.focus())}hideTab(e){this.unhighlightTab(e),this.hidePanel(e)}showTab(e){this.highlightTab(e),this.showPanel(e)}getTab(e){const{tabClass:t}=this.config;return this.$root.querySelector(`a.${t}[href="${e}"]`)}setAttributes(e){var t;const n=e.hash.replace("#","");if(!n)return;e.setAttribute("id",`tab_${n}`),e.setAttribute("role","tab"),e.setAttribute("aria-controls",n),e.setAttribute("aria-selected","false"),e.setAttribute("tabindex","-1");const s=this.getPanel(e);if(!s)return;const{panelClass:i}=this.config;s.setAttribute("role","tabpanel"),s.setAttribute("aria-labelledby",e.id),s.classList.add(null!=(t=this.jsHiddenClass)?t:`${i}--hidden`)}unsetAttributes(e){var t;e.removeAttribute("id"),e.removeAttribute("role"),e.removeAttribute("aria-controls"),e.removeAttribute("aria-selected"),e.removeAttribute("tabindex");const n=this.getPanel(e);if(!n)return;const{panelClass:s}=this.config;n.removeAttribute("role"),n.removeAttribute("aria-labelledby"),n.classList.remove(null!=(t=this.jsHiddenClass)?t:`${s}--hidden`)}onTabClick(e){const t=this.getCurrentTab(),n=e.currentTarget;t&&n instanceof HTMLAnchorElement&&(e.preventDefault(),this.hideTab(t),this.showTab(n),this.createHistoryEntry(n))}createHistoryEntry(e){const t=this.getPanel(e);if(!t)return;const n=t.id;t.id="",this.changingHash=!0,window.location.hash=n,t.id=n}onTabKeydown(e){switch(e.key){case"ArrowLeft":case"Left":this.activatePreviousTab(),e.preventDefault();break;case"ArrowRight":case"Right":this.activateNextTab(),e.preventDefault()}}activateNextTab(){const e=this.getCurrentTab();if(null==e||!e.parentElement)return;const t=e.parentElement.nextElementSibling;if(!t)return;const{tabClass:n}=this.config,s=t.querySelector(`a.${n}`);s&&(this.hideTab(e),this.showTab(s),s.focus(),this.createHistoryEntry(s))}activatePreviousTab(){const e=this.getCurrentTab();if(null==e||!e.parentElement)return;const t=e.parentElement.previousElementSibling;if(!t)return;const{tabClass:n}=this.config,s=t.querySelector(`a.${n}`);s&&(this.hideTab(e),this.showTab(s),s.focus(),this.createHistoryEntry(s))}getPanel(e){const t=e.hash.replace("#","");return t?this.$root.querySelector(`#${t}`):null}showPanel(e){var t;const n=this.getPanel(e);if(!n)return;const{panelClass:s}=this.config;n.classList.remove(null!=(t=this.jsHiddenClass)?t:`${s}--hidden`)}hidePanel(e){var t;const n=this.getPanel(e);if(!n)return;const{panelClass:s}=this.config;n.classList.add(null!=(t=this.jsHiddenClass)?t:`${s}--hidden`)}unhighlightTab(e){if(!e.parentElement)return;const{listItemClass:t}=this.config;e.setAttribute("aria-selected","false"),e.parentElement.classList.remove(`${t}--selected`),e.setAttribute("tabindex","-1")}highlightTab(e){if(!e.parentElement)return;const{listItemClass:t}=this.config;e.setAttribute("aria-selected","true"),e.parentElement.classList.add(`${t}--selected`),e.setAttribute("tabindex","0")}getCurrentTab(){const{listItemClass:e,tabClass:t}=this.config;return this.$root.querySelector(`.${e}--selected a.${t}`)}}function initTabs(e){const{scope:t}=normaliseOptions(e),n=null==t?void 0:t.querySelectorAll(`[data-module="${Tabs.moduleName}"]`);null==n||n.forEach((t=>{new Tabs(t,e)}))}function initAll(e={}){const t=isObject(e)?e:{},n=normaliseOptions(e);try{if(!isSupported())throw new SupportError;if(null===n.scope)throw new ElementError({element:n.scope,identifier:"NHS.UK frontend scope element (`$scope`)"})}catch(s){return void(n.onError?n.onError(s,{config:t}):console.log(s))}[[Button,t.button],[CharacterCount,t.characterCount],[Checkboxes,t.checkboxes],[ErrorSummary,t.errorSummary],[FileUpload,t.fileUpload],[Header,t.header],[NotificationBanner,t.notificationBanner],[PasswordInput,t.passwordInput],[Radios,t.radios],[SkipLink,t.skipLink],[Tabs,t.tabs]].forEach((([Component,e])=>{createAll(Component,e,n)}))}function createAll(Component,e,t){let n;const s=normaliseOptions(t);try{var i;if(!isSupported())throw new SupportError;if(null===s.scope)throw new ElementError({element:s.scope,component:Component,identifier:"Scope element (`$scope`)"});n=null==(i=s.scope)?void 0:i.querySelectorAll(`[data-module="${Component.moduleName}"]`)}catch(o){return s.onError?s.onError(o,{component:Component,config:e}):console.log(o),[]}return Array.from(null!=n?n:[]).map((t=>{try{return e&&"defaults"in Component?new Component(t,e):new Component(t)}catch(o){return s.onError?s.onError(o,{element:t,component:Component,config:e}):console.log(o),null}})).filter((e=>!!e))}Tabs.moduleName="nhsuk-tabs",Tabs.defaults=Object.freeze({panelClass:"nhsuk-tabs__panel",listClass:"nhsuk-tabs__list",listItemClass:"nhsuk-tabs__list-item",tabClass:"nhsuk-tabs__tab"}),Tabs.schema=Object.freeze({properties:{panelClass:{type:"string"},listClass:{type:"string"},listItemClass:{type:"string"},tabClass:{type:"string"}}});export{Button,CharacterCount,Checkboxes,Component,ConfigError,ConfigurableComponent,ElementError,ErrorSummary,FileUpload,Header,I18n,InitError,NHSUKFrontendError,NotificationBanner,PasswordInput,Radios,SkipLink,SupportError,Tabs,closestAttributeValue,createAll,formatErrorMessage,getBreakpoint,initAll,initButtons,initCharacterCounts,initCheckboxes,initErrorSummary,initFileUploads,initHeader,initNotificationBanners,initPasswordInputs,initRadios,initSkipLinks,initTabs,isInitialised,isObject,isScope,isSupported,setFocus,toggleConditionalInput,version};//# sourceMappingURL=nhsuk-frontend.min.js.map