govuk_publishing_components 61.4.1 → 62.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 (193) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/option-select.js +4 -3
  3. data/app/assets/javascripts/govuk_publishing_components/lib/filter-list.js +48 -0
  4. data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +373 -245
  5. data/app/assets/stylesheets/component_guide/application.scss +1 -42
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +5 -1
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +6 -11
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +14 -2
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_option-select.scss +2 -2
  10. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +6 -38
  11. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +2 -3
  12. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +6 -1
  13. data/app/controllers/govuk_publishing_components/applications_page_controller.rb +50 -0
  14. data/app/models/govuk_publishing_components/applications_page.rb +64 -0
  15. data/app/views/govuk_publishing_components/applications_page/_table-content.html.erb +39 -0
  16. data/app/views/govuk_publishing_components/applications_page/show.html.erb +37 -0
  17. data/app/views/govuk_publishing_components/audit/show.html.erb +5 -1
  18. data/app/views/govuk_publishing_components/component_guide/_component_list.html.erb +14 -0
  19. data/app/views/govuk_publishing_components/component_guide/example.html.erb +3 -3
  20. data/app/views/govuk_publishing_components/component_guide/index.html.erb +50 -75
  21. data/app/views/govuk_publishing_components/component_guide/show.html.erb +7 -7
  22. data/app/views/govuk_publishing_components/components/_inverse_header.html.erb +1 -0
  23. data/app/views/govuk_publishing_components/components/contextual_sidebar/_ukraine_cta.html.erb +27 -25
  24. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +6 -0
  25. data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +19 -19
  26. data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +7 -1
  27. data/config/routes.rb +1 -0
  28. data/lib/govuk_publishing_components/minitest/component_guide_test.rb +1 -1
  29. data/lib/govuk_publishing_components/presenters/organisation_logo_helper.rb +7 -1
  30. data/lib/govuk_publishing_components/version.rb +1 -1
  31. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +37 -133
  32. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -1
  33. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +37 -133
  34. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -1
  35. data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
  36. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +4 -4
  37. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss.map +1 -1
  38. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +1 -126
  39. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js.map +1 -1
  40. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +1 -126
  41. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs.map +1 -1
  42. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss +1 -1
  43. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss.map +1 -1
  44. data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss +2 -2
  45. data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss.map +1 -1
  46. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +1 -126
  47. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js.map +1 -1
  48. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +1 -126
  49. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs.map +1 -1
  50. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/fixtures.json +34 -29
  51. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/macro-options.json +1 -1
  52. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-default.html +23 -23
  53. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-conditional-reveal.html +21 -21
  54. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-divider-and-none.html +30 -30
  55. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-error.html +26 -26
  56. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-hint.html +25 -25
  57. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-long-text.html +23 -23
  58. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small.html +23 -23
  59. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-conditional-items.html +35 -35
  60. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-and-none.html +30 -30
  61. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-none-and-conditional-items.html +40 -40
  62. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-error-message.html +32 -32
  63. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-hint.html +25 -25
  64. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-hints-on-items.html +21 -21
  65. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-legend-as-a-page-heading.html +27 -27
  66. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-optional-form-group-classes-showing-group-error.html +36 -36
  67. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-pre-checked-values.html +35 -35
  68. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-very-long-option-text.html +25 -25
  69. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template.njk +1 -1
  70. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss +1 -1
  71. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss.map +1 -1
  72. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +1 -126
  73. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js.map +1 -1
  74. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +1 -126
  75. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs.map +1 -1
  76. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +2 -1
  77. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss.map +1 -1
  78. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js +36 -132
  79. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js.map +1 -1
  80. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs +36 -132
  81. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs.map +1 -1
  82. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs +35 -6
  83. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs.map +1 -1
  84. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/fixtures.json +17 -0
  85. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-multiple-files.html +10 -0
  86. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +4 -4
  87. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss.map +1 -1
  88. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +20 -20
  89. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +1 -1
  90. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +7 -15
  91. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss.map +1 -1
  92. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +2 -2
  93. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss.map +1 -1
  94. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +4 -2
  95. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss.map +1 -1
  96. data/node_modules/govuk-frontend/dist/govuk/components/pagination/fixtures.json +1 -1
  97. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-many-pages.html +2 -2
  98. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template.njk +1 -1
  99. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +2 -2
  100. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss.map +1 -1
  101. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss +2 -2
  102. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss.map +1 -1
  103. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +1 -126
  104. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js.map +1 -1
  105. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +1 -126
  106. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs.map +1 -1
  107. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +1 -1
  108. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss.map +1 -1
  109. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +1 -1
  110. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss.map +1 -1
  111. data/node_modules/govuk-frontend/dist/govuk/components/radios/fixtures.json +36 -31
  112. data/node_modules/govuk-frontend/dist/govuk/components/radios/macro-options.json +3 -3
  113. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-default.html +17 -17
  114. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-inline.html +19 -19
  115. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-inline.html +23 -23
  116. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-a-divider.html +24 -24
  117. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-conditional-reveal.html +27 -27
  118. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-error.html +26 -26
  119. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-hint.html +25 -25
  120. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-long-text.html +23 -23
  121. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small.html +23 -23
  122. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-a-divider.html +24 -24
  123. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-item-checked.html +35 -35
  124. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items-and-pre-checked-value.html +35 -35
  125. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items.html +35 -35
  126. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-fieldset-and-error-message.html +20 -20
  127. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-hint.html +19 -19
  128. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-hints-on-items.html +23 -23
  129. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-legend-as-page-heading.html +21 -21
  130. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-optional-form-group-classes-showing-group-error.html +36 -36
  131. data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-very-long-option-text.html +28 -28
  132. data/node_modules/govuk-frontend/dist/govuk/components/radios/template.njk +1 -1
  133. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +1 -7
  134. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss.map +1 -1
  135. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +5 -5
  136. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss.map +1 -1
  137. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +16 -16
  138. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss.map +1 -1
  139. data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss +1 -1
  140. data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss.map +1 -1
  141. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss +1 -1
  142. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss.map +1 -1
  143. data/node_modules/govuk-frontend/dist/govuk/components/task-list/fixtures.json +46 -0
  144. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-forced-hover-state.html +37 -0
  145. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +1 -7
  146. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss.map +1 -1
  147. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +1 -1
  148. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss.map +1 -1
  149. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +1 -1
  150. data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss +2 -2
  151. data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss.map +1 -1
  152. data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss +3 -3
  153. data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss.map +1 -1
  154. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
  155. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
  156. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
  157. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -1
  158. data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +34 -0
  159. data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss.map +1 -1
  160. data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss +1 -1
  161. data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss.map +1 -1
  162. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +1 -1
  163. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss.map +1 -1
  164. data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss +172 -33
  165. data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss.map +1 -1
  166. data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss +1 -1
  167. data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss.map +1 -1
  168. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +4 -4
  169. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss.map +1 -1
  170. data/node_modules/govuk-frontend/dist/govuk/i18n.mjs +1 -126
  171. data/node_modules/govuk-frontend/dist/govuk/i18n.mjs.map +1 -1
  172. data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.scss +1 -1
  173. data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.scss.map +1 -1
  174. data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.scss +1 -1
  175. data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.scss.map +1 -1
  176. data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss +1 -1
  177. data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss.map +1 -1
  178. data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss +2 -2
  179. data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss.map +1 -1
  180. data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss +1 -1
  181. data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss.map +1 -1
  182. data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss +5 -5
  183. data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss.map +1 -1
  184. data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss +7 -0
  185. data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss.map +1 -1
  186. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss +4 -2
  187. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss.map +1 -1
  188. data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +1 -1
  189. data/node_modules/govuk-frontend/package.json +9 -8
  190. metadata +9 -4
  191. data/app/assets/javascripts/component_guide/filter-components.js +0 -35
  192. data/node_modules/govuk-frontend/dist/govuk/vendor/_sass-mq.scss +0 -349
  193. data/node_modules/govuk-frontend/dist/govuk/vendor/_sass-mq.scss.map +0 -1
@@ -64,18 +64,18 @@
64
64
  } %>
65
65
  </div>
66
66
 
67
- <h2 class="component-doc-h2" id="how-it-looks">
67
+ <h2 class="govuk-heading-m" id="how-it-looks">
68
68
  <a href="<%= component_example_path(@component_doc.id, "default") %>" class="govuk-link">How it looks</a>
69
- <small>(<a href="<%= component_preview_path(@component_doc.id, "default") %>" class="govuk-link">preview</a>)</small>
70
- <small>(<a href="<%= component_preview_all_path(@component_doc.id) %>" class="govuk-link">preview all</a>)</small>
69
+ <small class="govuk-!-font-size-16">(<a href="<%= component_preview_path(@component_doc.id, "default") %>" class="govuk-link">preview</a>)</small>
70
+ <small class="govuk-!-font-size-16">(<a href="<%= component_preview_all_path(@component_doc.id) %>" class="govuk-link">preview all</a>)</small>
71
71
  </h2>
72
72
  <%= render "govuk_publishing_components/component_guide/component_doc/preview", component_doc: @component_doc, example: @component_doc.example %>
73
73
 
74
- <h2 class="component-doc-h2" id="how-to-call-this-component">How to call this component</h2>
74
+ <h2 class="govuk-heading-m govuk-!-margin-top-4" id="how-to-call-this-component">How to call this component</h2>
75
75
  <%= render "govuk_publishing_components/component_guide/component_doc/call", component_doc: @component_doc, example: @component_doc.example %>
76
76
 
77
77
  <% if @component_doc.govuk_frontend_components.any? %>
78
- <h2 class="component-doc-h2" id="govuk-design-system">GOV.UK Design System</h2>
78
+ <h2 class="govuk-heading-m" id="govuk-design-system">GOV.UK Design System</h2>
79
79
  <div class="component-markdown">
80
80
  <p>This component incorporates components from the <%= link_to "GOV.UK Design System", "https://design-system.service.gov.uk" %>:</p>
81
81
 
@@ -90,7 +90,7 @@
90
90
  <% if @component_doc.accessibility_criteria.present? %>
91
91
  <div class="govuk-grid-row component-accessibility-criteria" id="accessibility-acceptance-criteria">
92
92
  <div class="govuk-grid-column-two-thirds">
93
- <h2 class="component-doc-h2">Accessibility acceptance criteria</h2>
93
+ <h2 class="govuk-heading-m">Accessibility acceptance criteria</h2>
94
94
  <div class="component-markdown">
95
95
  <%= raw(@component_doc.html_accessibility_criteria) %>
96
96
  </div>
@@ -100,7 +100,7 @@
100
100
 
101
101
  <% if @component_doc.other_examples.any? or @component_doc.uses_component_wrapper_helper? %>
102
102
  <div class="examples">
103
- <h2 class="component-doc-h2" id="other-examples">Other examples</h2>
103
+ <h2 class="govuk-heading-m" id="other-examples">Other examples</h2>
104
104
 
105
105
  <% if @component_doc.uses_component_wrapper_helper? %>
106
106
  <div class="component-example" id="standard-options">
@@ -8,6 +8,7 @@
8
8
  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
9
9
  component_helper.add_class("gem-c-inverse-header")
10
10
  component_helper.add_class("gem-c-inverse-header--full-width") if local_assigns[:full_width]
11
+ component_helper.add_class("gem-c-inverse-header--html-publication-header") if local_assigns[:html_publication_header]
11
12
  component_helper.add_class("govuk-!-padding-top-#{padding_top}") if [*0..9].include?(padding_top)
12
13
  component_helper.add_class("govuk-!-padding-bottom-#{padding_bottom}") if [*0..9].include?(padding_bottom)
13
14
  %>
@@ -4,31 +4,33 @@
4
4
  lang = shared_helper.t_locale("components.related_navigation.ukraine.title")
5
5
  data_module = "ga4-link-tracker" unless disable_ga4
6
6
  %>
7
- <%= tag.div class: "gem-c-contextual-sidebar__cta gem-c-contextual-sidebar__cta--ukraine", data: { module: data_module } do %>
8
- <%= tag.h2 title, class: "gem-c-contextual-sidebar__heading govuk-heading-s" %>
9
- <%= tag.ul class: "gem-c-contextual-sidebar__list" do %>
10
- <% index_total = t("components.related_navigation.ukraine.links").length %>
11
- <% t("components.related_navigation.ukraine.links").each_with_index do |link, index| %>
12
- <%= tag.li class: "gem-c-contextual-sidebar__text govuk-body" do %>
13
- <%
14
- ga4_attributes = {
15
- event_name: "navigation",
16
- type: "related content",
17
- index_section: "#{ga4_tracking_counts.index_section_count}",
18
- index_link: "#{index + 1}",
19
- index_section_count: "#{ga4_tracking_counts.index_section_count}",
20
- index_total: "#{index_total}",
21
- section: title,
22
- } unless disable_ga4
23
- %>
24
- <%= link_to link[:label],
25
- link[:href],
26
- class: "govuk-link",
27
- data: {
28
- ga4_link: ga4_attributes,
29
- },
30
- lang: lang %>
7
+ <div class="gem-c-contextual-sidebar__cta-ukraine">
8
+ <%= tag.div class: "gem-c-contextual-sidebar__cta", data: { module: data_module } do %>
9
+ <%= tag.h2 title, class: "gem-c-contextual-sidebar__heading govuk-heading-s" %>
10
+ <%= tag.ul class: "gem-c-contextual-sidebar__list" do %>
11
+ <% index_total = t("components.related_navigation.ukraine.links").length %>
12
+ <% t("components.related_navigation.ukraine.links").each_with_index do |link, index| %>
13
+ <%= tag.li class: "gem-c-contextual-sidebar__text govuk-body" do %>
14
+ <%
15
+ ga4_attributes = {
16
+ event_name: "navigation",
17
+ type: "related content",
18
+ index_section: "#{ga4_tracking_counts.index_section_count}",
19
+ index_link: "#{index + 1}",
20
+ index_section_count: "#{ga4_tracking_counts.index_section_count}",
21
+ index_total: "#{index_total}",
22
+ section: title,
23
+ } unless disable_ga4
24
+ %>
25
+ <%= link_to link[:label],
26
+ link[:href],
27
+ class: "govuk-link",
28
+ data: {
29
+ ga4_link: ga4_attributes,
30
+ },
31
+ lang: lang %>
32
+ <% end %>
31
33
  <% end %>
32
34
  <% end %>
33
35
  <% end %>
34
- <% end %>
36
+ </div>
@@ -874,6 +874,12 @@ examples:
874
874
  <li>two</li>
875
875
  <li>three</li>
876
876
  </ul>
877
+ <h2>unordered list without bullets:</h2>
878
+ <ul class="list-no-bullets">
879
+ <li>one</li>
880
+ <li>two</li>
881
+ <li>three</li>
882
+ </ul>
877
883
  legislative_lists:
878
884
  description: Example taken from [GOV.UK Immigration rules](https://www.gov.uk/guidance/immigration-rules/immigration-rules-introduction)
879
885
  data:
@@ -1,9 +1,9 @@
1
1
  name: Inverse header
2
- description: A wrapper to contain header content in white text
2
+ description: A wrapper to contain header content
3
3
  body: |
4
- This component can be passed a block of template code and will wrap it in a blue header. White text is enforced on content and would need to be overridden where unwanted. Implemented to accommodate topic and list page headings but unopinionated about its contents.
4
+ This component can be passed a block of template code and will wrap it in a light blue header. Implemented to accommodate topic and list page headings but unopinionated about its contents.
5
5
 
6
- If passing links to the block make sure to add [the inverse modifier](https://design-system.service.gov.uk/styles/links/#links-on-dark-backgrounds).
6
+ If passing links to the block make sure to add [the inverse link style](#with_paragraph_and_link), or in the case of the html publication header variant, [the inverse modifier](https://design-system.service.gov.uk/styles/links/#links-on-dark-backgrounds).
7
7
  uses_component_wrapper_helper: true
8
8
  accessibility_criteria: |
9
9
  The component must:
@@ -17,7 +17,6 @@ examples:
17
17
  <%= render "govuk_publishing_components/components/heading", {
18
18
  text: "Education, Training and Skills",
19
19
  font_size: "xl",
20
- inverse: true,
21
20
  padding: true,
22
21
  } %>
23
22
  <!-- end of example content -->
@@ -30,7 +29,6 @@ examples:
30
29
  <!-- example content -->
31
30
  <%= render "govuk_publishing_components/components/heading", {
32
31
  text: "Education, Training and Skills",
33
- inverse: true,
34
32
  margin_bottom: 0
35
33
  } %>
36
34
  <!-- end of example content -->
@@ -43,38 +41,40 @@ examples:
43
41
  <%= render "govuk_publishing_components/components/heading", {
44
42
  text: "Education, Training and Skills",
45
43
  font_size: "xl",
46
- inverse: true,
47
44
  padding: true,
48
45
  } %>
49
46
  <!-- end of example content -->
50
- with_subtext:
47
+ html_publication_header:
48
+ description: "The html publication header with a blue background is used on HTML publications and CSV previews. [See example of a HTML publication on GOV.UK here](https://www.gov.uk/government/publications/ln5-0at-jackson-homes-scopwick-ltd-environmental-permit-application-advertisement/ln5-0at-jackson-homes-scopwick-ltd-environmental-permit-application), and [an example of a CSV preview on GOV.UK here](https://www.gov.uk/csv-preview/6756eeb07ec19a3516f79a3d/Malpractice_in_VTQ_-_Example_CSV_File.csv)"
51
49
  data:
52
- subtext: This is some text
50
+ html_publication_header: true
53
51
  block: |
54
52
  <!-- example content -->
55
53
  <%= render "govuk_publishing_components/components/heading", {
56
- text: "Education, Training and Skills",
54
+ text: "LN5 0AT, Jackson Homes (Scopwick) Ltd: environmental permit application",
57
55
  inverse: true,
58
- margin_bottom: 0
56
+ context: "Notice",
57
+ padding: true,
58
+ font_size: "xl"
59
59
  } %>
60
+ <p class="publication-header__last-changed">Published 22 April 2016</p>
60
61
  <!-- end of example content -->
61
- html_publication_header:
62
- description: "The inverse header component is used on HTML publications. [See example on GOV.UK here](https://www.gov.uk/government/publications/ln5-0at-jackson-homes-scopwick-ltd-environmental-permit-application-advertisement/ln5-0at-jackson-homes-scopwick-ltd-environmental-permit-application)"
62
+ html_publication_header_with_subtext:
63
+ description: "The white subtext can be used with the html publication header variant. We don't currently support black subtext to be used with the default variant as it's not in use on GOV.UK. If you need this please add it as a variant to the component."
63
64
  data:
65
+ subtext: This is some text
66
+ html_publication_header: true
64
67
  block: |
65
68
  <!-- example content -->
66
69
  <%= render "govuk_publishing_components/components/heading", {
67
- text: "LN5 0AT, Jackson Homes (Scopwick) Ltd: environmental permit application",
70
+ text: "Education, Training and Skills",
68
71
  inverse: true,
69
- context: "Notice",
70
- padding: true,
71
- font_size: "xl"
72
+ margin_bottom: 0
72
73
  } %>
73
- <p class="publication-header__last-changed">Published 22 April 2016</p>
74
74
  <!-- end of example content -->
75
75
  with_paragraph_and_link:
76
76
  data:
77
77
  block: |
78
- <p class="gem-c-lead-paragraph gem-c-lead-paragraph--inverse">
79
- Schools and academies, further and higher education, apprenticeships and <a href="#other-skills" class="govuk-link govuk-link--inverse">other skills</a> training, student funding, early years.
78
+ <p class="gem-c-lead-paragraph">
79
+ Schools and academies, further and higher education apprenticeships and <a href="#other-skills" class="govuk-link gem-c-inverse-header__link">other skills</a> training, student funding, early years.
80
80
  </p>
@@ -28,6 +28,12 @@ examples:
28
28
  name: 'Single Identity'
29
29
  url: 'http://www.gov.uk'
30
30
  crest: 'single-identity'
31
+ no_identity:
32
+ data:
33
+ organisation:
34
+ name: 'No Identity'
35
+ url: 'http://www.gov.uk'
36
+ crest: 'no-identity'
31
37
  attorney_generals_office:
32
38
  data:
33
39
  organisation:
@@ -139,7 +145,7 @@ examples:
139
145
  name: 'Land Registry'
140
146
  url: '/government/organisations/land-registry'
141
147
  brand: 'department-for-business-innovation-skills'
142
- crest: null
148
+ crest: "custom"
143
149
  image:
144
150
  url: 'https://assets.publishing.service.gov.uk/government/uploads/system/uploads/organisation/logo/69/HMLR_logo.png'
145
151
  alt_text: 'Land Registry'
data/config/routes.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  GovukPublishingComponents::Engine.routes.draw do
2
2
  get "/audit" => "audit#show", as: :audit
3
+ get "/applications" => "applications_page#show", as: :apps
3
4
  root to: "component_guide#index", as: :component_guide
4
5
  get ":component/preview" => "component_guide#preview", as: :component_preview_all
5
6
  get ":component/:example/preview" => "component_guide#preview", as: :component_preview
@@ -11,7 +11,7 @@ module GovukPublishingComponents
11
11
  assert_equal "function", evaluate_script("typeof window.GOVUK.AccessibilityTest"), "AccessibilityTest JavaScript isn’t available"
12
12
  assert_equal "string", evaluate_script("typeof window.axe.version"), "aXe accessibility test library isn’t available"
13
13
 
14
- all(:css, ".component-list a").map { |el| "#{el[:href]}/preview" }.each do |component|
14
+ all(:css, ".govuk-list.govuk-list--bullet a").map { |el| "#{el[:href]}/preview" }.each do |component|
15
15
  visit component
16
16
  assert page.has_css?(".js-test-a11y-finished"), "Accessibility test did not run on #{component}"
17
17
  assert page.has_css?(".js-test-a11y-success"), "Accessibility test found violations on #{component}"
@@ -30,9 +30,15 @@ module GovukPublishingComponents
30
30
  logo_class = "gem-c-organisation-logo__container"
31
31
  logo_class = "#{logo_class} gem-c-organisation-logo__link" if url
32
32
  logo_class = "#{logo_class} gem-c-organisation-logo__link-hide-underline" if hide_underline
33
- logo_class = "#{logo_class} gem-c-organisation-logo__crest gem-c-organisation-logo__crest--#{crest}" if crest
33
+ logo_class = "#{logo_class} gem-c-organisation-logo__crest gem-c-organisation-logo__crest--#{crest}" if crest_has_visual_identity?
34
34
  logo_class
35
35
  end
36
+
37
+ private
38
+
39
+ def crest_has_visual_identity?
40
+ crest.present? && !%w[no-identity custom].include?(crest)
41
+ end
36
42
  end
37
43
  end
38
44
  end
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "61.4.1".freeze
2
+ VERSION = "62.1.0".freeze
3
3
  end
@@ -4,7 +4,7 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.GOVUKFrontend = global.GOVUKFrontend || {}));
5
5
  })(this, (function (exports) { 'use strict';
6
6
 
7
- const version = '5.11.2';
7
+ const version = '5.13.0';
8
8
 
9
9
  function getBreakpoint(name) {
10
10
  const property = `--govuk-breakpoint-${name}`;
@@ -429,7 +429,7 @@
429
429
  return 'other';
430
430
  }
431
431
  const translation = this.translations[lookupKey];
432
- const preferredForm = this.hasIntlPluralRulesSupport() ? new Intl.PluralRules(this.locale).select(count) : this.selectPluralFormUsingFallbackRules(count);
432
+ const preferredForm = this.hasIntlPluralRulesSupport() ? new Intl.PluralRules(this.locale).select(count) : 'other';
433
433
  if (isObject(translation)) {
434
434
  if (preferredForm in translation) {
435
435
  return preferredForm;
@@ -440,132 +440,7 @@
440
440
  }
441
441
  throw new Error(`i18n: Plural form ".other" is required for "${this.locale}" locale`);
442
442
  }
443
- selectPluralFormUsingFallbackRules(count) {
444
- count = Math.abs(Math.floor(count));
445
- const ruleset = this.getPluralRulesForLocale();
446
- if (ruleset) {
447
- return I18n.pluralRules[ruleset](count);
448
- }
449
- return 'other';
450
- }
451
- getPluralRulesForLocale() {
452
- const localeShort = this.locale.split('-')[0];
453
- for (const pluralRule in I18n.pluralRulesMap) {
454
- const languages = I18n.pluralRulesMap[pluralRule];
455
- if (languages.includes(this.locale) || languages.includes(localeShort)) {
456
- return pluralRule;
457
- }
458
- }
459
- }
460
443
  }
461
- I18n.pluralRulesMap = {
462
- arabic: ['ar'],
463
- chinese: ['my', 'zh', 'id', 'ja', 'jv', 'ko', 'ms', 'th', 'vi'],
464
- french: ['hy', 'bn', 'fr', 'gu', 'hi', 'fa', 'pa', 'zu'],
465
- german: ['af', 'sq', 'az', 'eu', 'bg', 'ca', 'da', 'nl', 'en', 'et', 'fi', 'ka', 'de', 'el', 'hu', 'lb', 'no', 'so', 'sw', 'sv', 'ta', 'te', 'tr', 'ur'],
466
- irish: ['ga'],
467
- russian: ['ru', 'uk'],
468
- scottish: ['gd'],
469
- spanish: ['pt-PT', 'it', 'es'],
470
- welsh: ['cy']
471
- };
472
- I18n.pluralRules = {
473
- arabic(n) {
474
- if (n === 0) {
475
- return 'zero';
476
- }
477
- if (n === 1) {
478
- return 'one';
479
- }
480
- if (n === 2) {
481
- return 'two';
482
- }
483
- if (n % 100 >= 3 && n % 100 <= 10) {
484
- return 'few';
485
- }
486
- if (n % 100 >= 11 && n % 100 <= 99) {
487
- return 'many';
488
- }
489
- return 'other';
490
- },
491
- chinese() {
492
- return 'other';
493
- },
494
- french(n) {
495
- return n === 0 || n === 1 ? 'one' : 'other';
496
- },
497
- german(n) {
498
- return n === 1 ? 'one' : 'other';
499
- },
500
- irish(n) {
501
- if (n === 1) {
502
- return 'one';
503
- }
504
- if (n === 2) {
505
- return 'two';
506
- }
507
- if (n >= 3 && n <= 6) {
508
- return 'few';
509
- }
510
- if (n >= 7 && n <= 10) {
511
- return 'many';
512
- }
513
- return 'other';
514
- },
515
- russian(n) {
516
- const lastTwo = n % 100;
517
- const last = lastTwo % 10;
518
- if (last === 1 && lastTwo !== 11) {
519
- return 'one';
520
- }
521
- if (last >= 2 && last <= 4 && !(lastTwo >= 12 && lastTwo <= 14)) {
522
- return 'few';
523
- }
524
- if (last === 0 || last >= 5 && last <= 9 || lastTwo >= 11 && lastTwo <= 14) {
525
- return 'many';
526
- }
527
- return 'other';
528
- },
529
- scottish(n) {
530
- if (n === 1 || n === 11) {
531
- return 'one';
532
- }
533
- if (n === 2 || n === 12) {
534
- return 'two';
535
- }
536
- if (n >= 3 && n <= 10 || n >= 13 && n <= 19) {
537
- return 'few';
538
- }
539
- return 'other';
540
- },
541
- spanish(n) {
542
- if (n === 1) {
543
- return 'one';
544
- }
545
- if (n % 1000000 === 0 && n !== 0) {
546
- return 'many';
547
- }
548
- return 'other';
549
- },
550
- welsh(n) {
551
- if (n === 0) {
552
- return 'zero';
553
- }
554
- if (n === 1) {
555
- return 'one';
556
- }
557
- if (n === 2) {
558
- return 'two';
559
- }
560
- if (n === 3) {
561
- return 'few';
562
- }
563
- if (n === 6) {
564
- return 'many';
565
- }
566
- return 'other';
567
- }
568
- };
569
444
 
570
445
  /**
571
446
  * Accordion component
@@ -1801,7 +1676,7 @@
1801
1676
  if (this.$button.disabled) return;
1802
1677
  if (event.target instanceof Node) {
1803
1678
  if (this.$root.contains(event.target)) {
1804
- if (event.dataTransfer && isContainingFiles(event.dataTransfer)) {
1679
+ if (event.dataTransfer && this.canDrop(event.dataTransfer)) {
1805
1680
  if (!this.$button.classList.contains('govuk-file-upload-button--dragging')) {
1806
1681
  this.showDraggingState();
1807
1682
  this.$announcements.innerText = this.i18n.t('enteredDropZone');
@@ -1823,12 +1698,30 @@
1823
1698
  }
1824
1699
  onDrop(event) {
1825
1700
  event.preventDefault();
1826
- if (event.dataTransfer && isContainingFiles(event.dataTransfer)) {
1701
+ if (event.dataTransfer && this.canFillInput(event.dataTransfer)) {
1827
1702
  this.$input.files = event.dataTransfer.files;
1828
1703
  this.$input.dispatchEvent(new CustomEvent('change'));
1829
1704
  this.hideDraggingState();
1830
1705
  }
1831
1706
  }
1707
+ canFillInput(dataTransfer) {
1708
+ return this.matchesInputCapacity(dataTransfer.files.length);
1709
+ }
1710
+ canDrop(dataTransfer) {
1711
+ if (dataTransfer.items.length) {
1712
+ return this.matchesInputCapacity(countFileItems(dataTransfer.items));
1713
+ }
1714
+ if (dataTransfer.types.length) {
1715
+ return dataTransfer.types.includes('Files');
1716
+ }
1717
+ return true;
1718
+ }
1719
+ matchesInputCapacity(numberOfFiles) {
1720
+ if (this.$input.multiple) {
1721
+ return numberOfFiles > 0;
1722
+ }
1723
+ return numberOfFiles === 1;
1724
+ }
1832
1725
  onChange() {
1833
1726
  const fileCount = this.$input.files.length;
1834
1727
  if (fileCount === 0) {
@@ -1875,6 +1768,13 @@
1875
1768
  this.$root.classList.toggle('govuk-drop-zone--disabled', this.$button.disabled);
1876
1769
  }
1877
1770
  }
1771
+
1772
+ /**
1773
+ * Counts the number of `DataTransferItem` whose kind is `file`
1774
+ *
1775
+ * @param {DataTransferItemList} list - The list
1776
+ * @returns {number} - The number of items whose kind is `file` in the list
1777
+ */
1878
1778
  FileUpload.moduleName = 'govuk-file-upload';
1879
1779
  FileUpload.defaults = Object.freeze({
1880
1780
  i18n: {
@@ -1896,10 +1796,14 @@
1896
1796
  }
1897
1797
  }
1898
1798
  });
1899
- function isContainingFiles(dataTransfer) {
1900
- const hasNoTypesInfo = dataTransfer.types.length === 0;
1901
- const isDraggingFiles = dataTransfer.types.some(type => type === 'Files');
1902
- return hasNoTypesInfo || isDraggingFiles;
1799
+ function countFileItems(list) {
1800
+ let result = 0;
1801
+ for (let i = 0; i < list.length; i++) {
1802
+ if (list[i].kind === 'file') {
1803
+ result++;
1804
+ }
1805
+ }
1806
+ return result;
1903
1807
  }
1904
1808
 
1905
1809
  /**