govuk_publishing_components 46.1.0 → 46.3.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: 83a3dfdc9379f4de2ca4154e431ce705e4981c3dd0f5e8a2b824891c071658ad
4
+ data.tar.gz: 1d3c875c0741f0445b07e48727c8e098f4d5f322d10daa45df32eda43e6090c5
5
5
  SHA512:
6
- metadata.gz: 7eede3b4acf9222bef3047b69fa3fe9c5190fb63277416188ed516990723ae35eec50fdc88594c6199e287500746fadf1181122f8bdbb95608382451a1f1f8ab
7
- data.tar.gz: fe53d16fc472cb5dbee4e80b76eb61b5619d16224afdfd7ea751514d30a6604a82aa4c84ed7c8e057268e66be6a500618c37c0e42a6d8db17b17b8a2bc2f60ff
6
+ metadata.gz: 4d3c513e69a24cda08fa258fe6c4dadc51262ef218784db2e2922bf672612ed83ef91b0640bcf7dd31a8af9773943f83baa584593d605278f5feb943668c6635
7
+ data.tar.gz: a1ecef4ece0afa905f15b37d6799300e516589f4f34297a7272ba4a6870f820d48a3115255467479b10b743b109fbb8eaece38a060b38f01a42812a13b48365a
@@ -93,7 +93,10 @@ $column-width: 9.5em;
93
93
  .gem-c-share-links__list-item {
94
94
  padding-left: 0;
95
95
  padding-right: 0;
96
- min-width: 180px;
96
+
97
+ @include govuk-media-query($until: tablet) {
98
+ min-width: 100%;
99
+ }
97
100
  }
98
101
 
99
102
  .gem-c-share-links__link-icon {
@@ -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",
@@ -15,6 +15,7 @@
15
15
 
16
16
  <%= render "govuk_publishing_components/components/button", {
17
17
  text: button_text,
18
+ type: "button",
18
19
  data_attributes: button_data_attributes,
19
20
  secondary_quiet: true,
20
21
  } %>
@@ -317,7 +317,7 @@
317
317
  label: "Site-wide",
318
318
  }
319
319
  ) do %>
320
- <%= render "govuk_publishing_components/components/search", {
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>
@@ -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,11 +3,13 @@
3
3
 
4
4
  items ||= []
5
5
  input_name ||= "ordering"
6
- data_attributes ||= {}
7
- data_attributes[:module] = "reorderable-list"
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 class: "gem-c-reorderable-list", data: data_attributes do %>
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
- classes = %w(gem-c-share-links govuk-!-display-none-print)
18
- classes << "gem-c-share-links--stacked" if stacked
19
- classes << "gem-c-share-links--columns" if columns
20
- classes << "gem-c-share-links--flexbox" if flexbox
21
- classes << "gem-c-share-links--square-icons" if square_icons
22
- classes << "gem-c-share-links--black-icons" if black_icons
23
- classes << "gem-c-share-links--black-links" if black_links
24
-
25
- data_attributes ||= {}
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(class: classes, data: data_attributes) do %>
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
- classes = %w(gem-c-signup-link govuk-!-display-none-print)
15
- classes << shared_helper.get_margin_bottom
16
- classes << "gem-c-signup-link--link-only" unless heading
17
- classes << "gem-c-signup-link--with-background-and-border" if background
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
- <div class="<%= classes.join(' ') %>">
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
- </div>
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:
@@ -17,6 +17,7 @@ body: |
17
17
  you'd receive a submission of `ordering[a]=1&ordering[b]=2`, which Rails can
18
18
  translate to `"ordering" => { "a" => "1", "b" => "2" }`.
19
19
 
20
+ uses_component_wrapper_helper: true
20
21
  accessibility_criteria: |
21
22
  Buttons in this component must:
22
23
 
@@ -13,6 +13,8 @@ body: |
13
13
 
14
14
  accessibility_criteria: |
15
15
  The share link icons must be presentational and ignored by screen readers.
16
+
17
+ uses_component_wrapper_helper: true
16
18
  shared_accessibility_criteria:
17
19
  - link
18
20
  examples:
@@ -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:
@@ -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.3.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.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-02 00:00:00.000000000 Z
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