govuk_publishing_components 46.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8a75bcb074cc5edf15955ec4a071e6d74e6984ee21d6d3e72293d587427da46a
4
- data.tar.gz: 52fa477353b3ea17d59cb2c0ab27fef05a84b8850b3161faf68502d5e7873393
3
+ metadata.gz: 83a3dfdc9379f4de2ca4154e431ce705e4981c3dd0f5e8a2b824891c071658ad
4
+ data.tar.gz: 1d3c875c0741f0445b07e48727c8e098f4d5f322d10daa45df32eda43e6090c5
5
5
  SHA512:
6
- metadata.gz: bc69bdcd45eaa41ee2a5a9bd42b969b8d1344e0eb232d09268d93da2ff28eb57737c8baaa127531fe9763cd4fb29e94ad609ec538ca99c37512d609604adbcdf
7
- data.tar.gz: ba7b791951b7fe631e8ededa5309fcf5caf0d43a2481b15bce8a308c9f22b04db24e54048fca93ac0c740a0f55ecd6136a30a8cbecad8c004a163a58f79b6394
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 {
@@ -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>
@@ -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 %>
@@ -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 %>
@@ -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:
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "46.2.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.2.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-04 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