govuk_publishing_components 62.0.0 → 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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/components/option-select.js +4 -3
- data/app/assets/javascripts/govuk_publishing_components/lib/filter-list.js +48 -0
- data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +373 -245
- data/app/assets/stylesheets/component_guide/application.scss +1 -42
- data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +5 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +6 -11
- data/app/assets/stylesheets/govuk_publishing_components/components/_option-select.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +6 -38
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +2 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +6 -1
- data/app/controllers/govuk_publishing_components/applications_page_controller.rb +50 -0
- data/app/models/govuk_publishing_components/applications_page.rb +64 -0
- data/app/views/govuk_publishing_components/applications_page/_table-content.html.erb +39 -0
- data/app/views/govuk_publishing_components/applications_page/show.html.erb +37 -0
- data/app/views/govuk_publishing_components/audit/show.html.erb +5 -1
- data/app/views/govuk_publishing_components/component_guide/_component_list.html.erb +14 -0
- data/app/views/govuk_publishing_components/component_guide/example.html.erb +3 -3
- data/app/views/govuk_publishing_components/component_guide/index.html.erb +50 -75
- data/app/views/govuk_publishing_components/component_guide/show.html.erb +7 -7
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_ukraine_cta.html.erb +27 -25
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +6 -0
- data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +7 -1
- data/config/routes.rb +1 -0
- data/lib/govuk_publishing_components/minitest/component_guide_test.rb +1 -1
- data/lib/govuk_publishing_components/presenters/organisation_logo_helper.rb +7 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +37 -133
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +37 -133
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +4 -4
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +1 -126
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +1 -126
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +1 -126
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +1 -126
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/fixtures.json +34 -29
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/macro-options.json +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-default.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-conditional-reveal.html +21 -21
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-divider-and-none.html +30 -30
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-error.html +26 -26
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-hint.html +25 -25
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-long-text.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-conditional-items.html +35 -35
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-and-none.html +30 -30
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-none-and-conditional-items.html +40 -40
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-error-message.html +32 -32
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-hint.html +25 -25
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-hints-on-items.html +21 -21
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-legend-as-a-page-heading.html +27 -27
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-optional-form-group-classes-showing-group-error.html +36 -36
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-pre-checked-values.html +35 -35
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-very-long-option-text.html +25 -25
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template.njk +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +1 -126
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +1 -126
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +2 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js +36 -132
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs +36 -132
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs +35 -6
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/fixtures.json +17 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-multiple-files.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +4 -4
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +20 -20
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +7 -15
- data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +4 -2
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/fixtures.json +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-many-pages.html +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template.njk +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +1 -126
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +1 -126
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/fixtures.json +36 -31
- data/node_modules/govuk-frontend/dist/govuk/components/radios/macro-options.json +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-default.html +17 -17
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-inline.html +19 -19
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-inline.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-a-divider.html +24 -24
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-conditional-reveal.html +27 -27
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-error.html +26 -26
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-hint.html +25 -25
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-long-text.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-a-divider.html +24 -24
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-item-checked.html +35 -35
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items-and-pre-checked-value.html +35 -35
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items.html +35 -35
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-fieldset-and-error-message.html +20 -20
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-hint.html +19 -19
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-hints-on-items.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-legend-as-page-heading.html +21 -21
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-optional-form-group-classes-showing-group-error.html +36 -36
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-very-long-option-text.html +28 -28
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template.njk +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +1 -7
- data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +5 -5
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +16 -16
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/fixtures.json +46 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-forced-hover-state.html +37 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +1 -7
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss +3 -3
- data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +34 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss +172 -33
- data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +4 -4
- data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/i18n.mjs +1 -126
- data/node_modules/govuk-frontend/dist/govuk/i18n.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss +5 -5
- data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss +7 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss +4 -2
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss.map +1 -1
- data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +1 -1
- data/node_modules/govuk-frontend/package.json +9 -8
- metadata +9 -4
- data/app/assets/javascripts/component_guide/filter-components.js +0 -35
- data/node_modules/govuk-frontend/dist/govuk/vendor/_sass-mq.scss +0 -349
- data/node_modules/govuk-frontend/dist/govuk/vendor/_sass-mq.scss.map +0 -1
data/app/views/govuk_publishing_components/components/contextual_sidebar/_ukraine_cta.html.erb
CHANGED
|
@@ -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
|
-
|
|
8
|
-
<%= tag.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
link[:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
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:
|
|
@@ -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:
|
|
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, ".
|
|
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
|
|
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
|
|
@@ -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.
|
|
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) :
|
|
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 &&
|
|
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 &&
|
|
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
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
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
|
/**
|