govuk_publishing_components 46.1.0 → 46.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f03b029ded187ef6bc1d3636720d1b32d082a568588faeccb69723311c06360
4
- data.tar.gz: 197e40d2e9dbc9ef47e76ae1c72b7d63a7b4255fdbb01f31dcc21bd234bb6099
3
+ metadata.gz: 8a75bcb074cc5edf15955ec4a071e6d74e6984ee21d6d3e72293d587427da46a
4
+ data.tar.gz: 52fa477353b3ea17d59cb2c0ab27fef05a84b8850b3161faf68502d5e7873393
5
5
  SHA512:
6
- metadata.gz: 7eede3b4acf9222bef3047b69fa3fe9c5190fb63277416188ed516990723ae35eec50fdc88594c6199e287500746fadf1181122f8bdbb95608382451a1f1f8ab
7
- data.tar.gz: fe53d16fc472cb5dbee4e80b76eb61b5619d16224afdfd7ea751514d30a6604a82aa4c84ed7c8e057268e66be6a500618c37c0e42a6d8db17b17b8a2bc2f60ff
6
+ metadata.gz: bc69bdcd45eaa41ee2a5a9bd42b969b8d1344e0eb232d09268d93da2ff28eb57737c8baaa127531fe9763cd4fb29e94ad609ec538ca99c37512d609604adbcdf
7
+ data.tar.gz: ba7b791951b7fe631e8ededa5309fcf5caf0d43a2481b15bce8a308c9f22b04db24e54048fca93ac0c740a0f55ecd6136a30a8cbecad8c004a163a58f79b6394
@@ -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",
@@ -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
- <nav
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
- </nav>
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(class: "gem-c-related-navigation govuk-!-display-none-print", data: data) do %>
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,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")
@@ -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:
@@ -70,9 +70,9 @@ cy:
70
70
  devolved_nations:
71
71
  applies_to: Yn berthnasol i
72
72
  connectors:
73
- last_word:
74
- two_words:
75
- england:
73
+ last_word: " a "
74
+ two_words: " a "
75
+ england: Loegr
76
76
  northern_ireland:
77
77
  scotland:
78
78
  type:
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "46.1.0".freeze
2
+ VERSION = "46.2.0".freeze
3
3
  end
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.1.0
4
+ version: 46.2.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-02 00:00:00.000000000 Z
11
+ date: 2024-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chartkick