govuk_publishing_components 46.1.0 → 46.3.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/stylesheets/govuk_publishing_components/components/_share-links.scss +4 -1
- data/app/models/govuk_publishing_components/audit_components.rb +0 -6
- data/app/views/govuk_publishing_components/components/_copy_to_clipboard.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +9 -1
- data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +8 -9
- data/app/views/govuk_publishing_components/components/_related_navigation.html.erb +5 -3
- data/app/views/govuk_publishing_components/components/_reorderable_list.html.erb +5 -3
- data/app/views/govuk_publishing_components/components/_search.html.erb +0 -1
- data/app/views/govuk_publishing_components/components/_share_links.html.erb +10 -11
- data/app/views/govuk_publishing_components/components/_signup_link.html.erb +7 -7
- data/app/views/govuk_publishing_components/components/docs/previous_and_next_navigation.yml +1 -0
- data/app/views/govuk_publishing_components/components/docs/related_navigation.yml +1 -0
- data/app/views/govuk_publishing_components/components/docs/reorderable_list.yml +1 -0
- data/app/views/govuk_publishing_components/components/docs/share_links.yml +2 -0
- data/app/views/govuk_publishing_components/components/docs/signup_link.yml +1 -0
- data/config/locales/cy.yml +3 -3
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83a3dfdc9379f4de2ca4154e431ce705e4981c3dd0f5e8a2b824891c071658ad
|
4
|
+
data.tar.gz: 1d3c875c0741f0445b07e48727c8e098f4d5f322d10daa45df32eda43e6090c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d3c513e69a24cda08fa258fe6c4dadc51262ef218784db2e2922bf672612ed83ef91b0640bcf7dd31a8af9773943f83baa584593d605278f5feb943668c6635
|
7
|
+
data.tar.gz: a1ecef4ece0afa905f15b37d6799300e516589f4f34297a7272ba4a6870f820d48a3115255467479b10b743b109fbb8eaece38a060b38f01a42812a13b48365a
|
@@ -262,12 +262,6 @@ module GovukPublishingComponents
|
|
262
262
|
match: /(GovukPublishingComponents::Presenters::ComponentWrapperHelper.new)/,
|
263
263
|
used_by: [],
|
264
264
|
},
|
265
|
-
{
|
266
|
-
name: "Heading helper",
|
267
|
-
link: "lib/govuk_publishing_components/presenters/heading_helper.rb",
|
268
|
-
match: /(GovukPublishingComponents::Presenters::HeadingHelper.new)/,
|
269
|
-
used_by: [],
|
270
|
-
},
|
271
265
|
{
|
272
266
|
name: "Shared helper",
|
273
267
|
link: "lib/govuk_publishing_components/presenters/shared_helper.rb",
|
data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb
CHANGED
@@ -317,7 +317,7 @@
|
|
317
317
|
label: "Site-wide",
|
318
318
|
}
|
319
319
|
) do %>
|
320
|
-
|
320
|
+
<% search_options = {
|
321
321
|
name: "keywords",
|
322
322
|
inline_label: false,
|
323
323
|
label_size: "m",
|
@@ -327,6 +327,14 @@
|
|
327
327
|
margin_bottom: 0,
|
328
328
|
disable_corrections: true,
|
329
329
|
} %>
|
330
|
+
<% if ENV["GOVUK_DISABLE_SEARCH_AUTOCOMPLETE"] %>
|
331
|
+
<%= render "govuk_publishing_components/components/search", search_options %>
|
332
|
+
<% else %>
|
333
|
+
<%= render "govuk_publishing_components/components/search_with_autocomplete", search_options.merge({
|
334
|
+
source_url: [Plek.new.website_root, "/api/search/autocomplete.json"].join,
|
335
|
+
source_key: "suggestions",
|
336
|
+
}) %>
|
337
|
+
<% end %>
|
330
338
|
<% end %>
|
331
339
|
</div>
|
332
340
|
</div>
|
data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb
CHANGED
@@ -2,16 +2,15 @@
|
|
2
2
|
add_gem_component_stylesheet("previous-and-next-navigation")
|
3
3
|
disable_ga4 ||= false
|
4
4
|
|
5
|
+
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
6
|
+
component_helper.add_class("govuk-pagination govuk-pagination--block")
|
7
|
+
component_helper.add_role("navigation")
|
8
|
+
component_helper.add_aria_attribute({ label: t("components.previous_and_next_navigation.pagination") })
|
9
|
+
component_helper.add_data_attribute({ module: "ga4-link-tracker" }) unless disable_ga4
|
10
|
+
|
5
11
|
if local_assigns.include?(:next_page) || local_assigns.include?(:previous_page)
|
6
12
|
%>
|
7
|
-
|
8
|
-
class="govuk-pagination govuk-pagination--block"
|
9
|
-
role="navigation"
|
10
|
-
aria-label="<%= t("components.previous_and_next_navigation.pagination") %>"
|
11
|
-
<% unless disable_ga4 %>
|
12
|
-
data-module="ga4-link-tracker"
|
13
|
-
<% end %>
|
14
|
-
>
|
13
|
+
<%= tag.nav(**component_helper.all_attributes) do %>
|
15
14
|
<% if local_assigns.include?(:previous_page) %>
|
16
15
|
<%
|
17
16
|
title = previous_page[:title] || t("components.previous_and_next_navigation.previous")
|
@@ -73,5 +72,5 @@
|
|
73
72
|
</a>
|
74
73
|
</div>
|
75
74
|
<% end %>
|
76
|
-
|
75
|
+
<% end %>
|
77
76
|
<% end %>
|
@@ -3,16 +3,18 @@
|
|
3
3
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
4
4
|
disable_ga4 ||= false
|
5
5
|
ga4_type = local_assigns[:context] == :footer ? "contextual footer" : "related content"
|
6
|
-
data = {}
|
7
|
-
data[:module] = "ga4-link-tracker" unless disable_ga4
|
8
6
|
ga4_tracking_counts ||= OpenStruct.new(index_section_count: 0)
|
9
7
|
ga4_tracking_counts.index_section_count += related_nav_helper.index_section_count
|
10
8
|
|
9
|
+
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
10
|
+
component_helper.add_class("gem-c-related-navigation govuk-!-display-none-print")
|
11
|
+
component_helper.add_data_attribute({ module: "ga4-link-tracker" }) unless disable_ga4
|
12
|
+
|
11
13
|
add_gem_component_stylesheet("related-navigation")
|
12
14
|
%>
|
13
15
|
<% if related_nav_helper.related_navigation? %>
|
14
16
|
<% random = SecureRandom.hex(4) %>
|
15
|
-
<%= tag.div(
|
17
|
+
<%= tag.div(**component_helper.all_attributes) do %>
|
16
18
|
<% if local_assigns[:context] != :footer %>
|
17
19
|
<h2 id="related-nav-related_items-<%= random %>"
|
18
20
|
class="gem-c-related-navigation__main-heading"
|
@@ -3,11 +3,13 @@
|
|
3
3
|
|
4
4
|
items ||= []
|
5
5
|
input_name ||= "ordering"
|
6
|
-
|
7
|
-
|
6
|
+
|
7
|
+
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
8
|
+
component_helper.add_class("gem-c-reorderable-list")
|
9
|
+
component_helper.add_data_attribute({ module: "reorderable-list" })
|
8
10
|
%>
|
9
11
|
|
10
|
-
<%= tag.ol
|
12
|
+
<%= tag.ol(**component_helper.all_attributes) do %>
|
11
13
|
<% items.each_with_index do |item, index| %>
|
12
14
|
<%= tag.li class: "gem-c-reorderable-list__item" do %>
|
13
15
|
<%= tag.div class: "gem-c-reorderable-list__wrapper" do %>
|
@@ -3,7 +3,6 @@
|
|
3
3
|
add_gem_component_stylesheet("label")
|
4
4
|
|
5
5
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
6
|
-
heading_helper = GovukPublishingComponents::Presenters::HeadingHelper.new(local_assigns)
|
7
6
|
|
8
7
|
aria_controls ||= nil
|
9
8
|
button_text ||= t("components.search_box.search_button")
|
@@ -14,19 +14,18 @@
|
|
14
14
|
black_icons ||= false
|
15
15
|
black_links ||= false
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
((data_attributes[:module] ||= "") << " " << "ga4-link-tracker").strip! if track_as_sharing || track_as_follow
|
17
|
+
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
18
|
+
component_helper.add_class("gem-c-share-links govuk-!-display-none-print")
|
19
|
+
component_helper.add_class("gem-c-share-links--stacked") if stacked
|
20
|
+
component_helper.add_class("gem-c-share-links--columns") if columns
|
21
|
+
component_helper.add_class("gem-c-share-links--flexbox") if flexbox
|
22
|
+
component_helper.add_class("gem-c-share-links--square-icons") if square_icons
|
23
|
+
component_helper.add_class("gem-c-share-links--black-icons") if black_icons
|
24
|
+
component_helper.add_class("gem-c-share-links--black-links") if black_links
|
25
|
+
component_helper.add_data_attribute({ module: "ga4-link-tracker" }) if track_as_sharing || track_as_follow
|
27
26
|
%>
|
28
27
|
<% if links.any? %>
|
29
|
-
<%= tag.div(
|
28
|
+
<%= tag.div(**component_helper.all_attributes) do %>
|
30
29
|
<% if title %>
|
31
30
|
<h2 class="govuk-heading-s"><%= title %></h2>
|
32
31
|
<% end %>
|
@@ -10,14 +10,14 @@
|
|
10
10
|
data ||= false
|
11
11
|
|
12
12
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
14
|
+
component_helper.add_class("gem-c-signup-link govuk-!-display-none-print")
|
15
|
+
component_helper.add_class(shared_helper.get_margin_bottom)
|
16
|
+
component_helper.add_class("gem-c-signup-link--link-only") unless heading
|
17
|
+
component_helper.add_class("gem-c-signup-link--with-background-and-border") if background
|
18
18
|
%>
|
19
19
|
<% if link_text && link_href %>
|
20
|
-
|
20
|
+
<%= tag.div(**component_helper.all_attributes) do %>
|
21
21
|
<div class="gem-c-signup-link__inner govuk-width-container">
|
22
22
|
<svg class="gem-c-signup-link__icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 459.334 459.334">
|
23
23
|
<path fill="black" d="M177.216 404.514c-.001.12-.009.239-.009.359 0 30.078 24.383 54.461 54.461 54.461s54.461-24.383 54.461-54.461c0-.12-.008-.239-.009-.359H175.216zM403.549 336.438l-49.015-72.002v-89.83c0-60.581-43.144-111.079-100.381-122.459V24.485C254.152 10.963 243.19 0 229.667 0s-24.485 10.963-24.485 24.485v27.663c-57.237 11.381-100.381 61.879-100.381 122.459v89.83l-49.015 72.002a24.76 24.76 0 0 0 20.468 38.693H383.08a24.761 24.761 0 0 0 20.469-38.694z"/>
|
@@ -28,5 +28,5 @@
|
|
28
28
|
data: data
|
29
29
|
}) %>
|
30
30
|
</div>
|
31
|
-
|
31
|
+
<% end %>
|
32
32
|
<% end %>
|
@@ -19,6 +19,7 @@ accessibility_criteria: |
|
|
19
19
|
- identify itself as pagination navigation
|
20
20
|
- provide a distinction between the navigation text and label text of the links both visually and for screenreaders
|
21
21
|
|
22
|
+
uses_component_wrapper_helper: true
|
22
23
|
shared_accessibility_criteria:
|
23
24
|
- link
|
24
25
|
accessibility_excluded_rules:
|
@@ -3,6 +3,7 @@ description: Component showing related content, including topics, guidance and c
|
|
3
3
|
accessibility_criteria: |
|
4
4
|
- Should have a role of 'navigation' on any navigation elements inside the component
|
5
5
|
- Should be marked up as navigation and not as tangential content
|
6
|
+
uses_component_wrapper_helper: true
|
6
7
|
shared_accessibility_criteria:
|
7
8
|
- link
|
8
9
|
accessibility_excluded_rules:
|
@@ -4,6 +4,7 @@ accessibility_criteria: |
|
|
4
4
|
- the component must use the correct heading level for the page
|
5
5
|
- text should have a text contrast ratio higher than 4.5:1 against the background colour to meet WCAG AA
|
6
6
|
- the icon must not be focusable or shown to screenreaders
|
7
|
+
uses_component_wrapper_helper: true
|
7
8
|
shared_accessibility_criteria:
|
8
9
|
- link
|
9
10
|
examples:
|
data/config/locales/cy.yml
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_publishing_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 46.
|
4
|
+
version: 46.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chartkick
|
@@ -164,6 +164,20 @@ dependencies:
|
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: climate_control
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
182
|
name: dartsass-rails
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|