govuk-components 5.2.0 → 5.2.1

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: f49a8caa87e838e21d85b219d5344a50aa8d8ce70145d7c209c11f29d1fc96df
4
- data.tar.gz: 468c1bb30d836cbff55c1407f6fd83378ba384f9430e90e93fad94b48853b1b2
3
+ metadata.gz: aa5e94a9160f8896885ff9a35d00d091c9fa26a70f7a818214ffea37347e4736
4
+ data.tar.gz: 40fb13fe108b13896ae68a27e59da95b1861b85c2eb9bfdc9d9756229d132542
5
5
  SHA512:
6
- metadata.gz: fa4e8e53212aa8b898954585dc9c96076499343325d967aea5896eb8c3e68b89ca3c56e1c8d0788b0d2a71a5b1aa1316bbb9b3cb4112d69ed4f6b2f1e3c16f2b
7
- data.tar.gz: 1fcaf8d663e7021a99bb4d55077772e5e33c9c10a0baad938d8895f504c191c6600b807ad30506fd9394ef404daf0210fae07c7dd756e007ab020748608738df
6
+ metadata.gz: 6fee19918f8ce6482e387bac2265f1ab64906daad807296fd1094728440adebc0ce79bbdcc42752ef3ebe4e8525022fea2fd8c7bd383a4e053a24439dd9b7a24
7
+ data.tar.gz: 1f3746438b6497191b42980a341a9caafc17d46651d22a4c2137c818fd8ac87b20c234f65633d826587e8ef2b37b6f3f14c9096ccf20f6550cc5a7858d17ad37
@@ -5,7 +5,7 @@
5
5
  <%= navigation %>
6
6
  </div>
7
7
 
8
- <hr class="<% brand %>-footer__section-break">
8
+ <%= tag.hr(class: "#{brand}-footer__section-break") %>
9
9
  <% end %>
10
10
 
11
11
  <%= tag.div(class: meta_classes, **meta_html_attributes) do %>
@@ -25,6 +25,12 @@
25
25
  </ul>
26
26
  <% end %>
27
27
 
28
+ <% if meta_content.present? %>
29
+ <div class="<%= brand %>-footer__meta-custom">
30
+ <%= meta_content %>
31
+ </div>
32
+ <% end %>
33
+
28
34
  <% if meta_licence.nil? %>
29
35
  <svg aria-hidden="true" focusable="false" class="<%= brand %>-footer__licence-logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 483.2 195.7" height="17" width="41">
30
36
  <path fill="currentColor" d="M421.5 142.8V.1l-50.7 32.3v161.1h112.4v-50.7zm-122.3-9.6A47.12 47.12 0 0 1 221 97.8c0-26 21.1-47.1 47.1-47.1 16.7 0 31.4 8.7 39.7 21.8l42.7-27.2A97.63 97.63 0 0 0 268.1 0c-36.5 0-68.3 20.1-85.1 49.7A98 98 0 0 0 97.8 0C43.9 0 0 43.9 0 97.8s43.9 97.8 97.8 97.8c36.5 0 68.3-20.1 85.1-49.7a97.76 97.76 0 0 0 149.6 25.4l19.4 22.2h3v-87.8h-80l24.3 27.5zM97.8 145c-26 0-47.1-21.1-47.1-47.1s21.1-47.1 47.1-47.1 47.2 21 47.2 47S123.8 145 97.8 145" />
@@ -34,12 +40,6 @@
34
40
  <% elsif meta_licence.present? %>
35
41
  <%= tag.span(meta_licence, class: "#{brand}-footer__licence-description") %>
36
42
  <% end %>
37
-
38
- <% if meta_content.present? %>
39
- <div class="<%= brand %>-footer__meta-custom">
40
- <%= meta_content %>
41
- </div>
42
- <% end %>
43
43
  </div>
44
44
 
45
45
  <%= tag.div(copyright, class: "#{brand}-footer__meta-item") %>
@@ -67,9 +67,9 @@ private
67
67
 
68
68
  case links
69
69
  when Array
70
- links.map { |link| raw(link_to(link[:text], link[:href], class: "#{brand}-footer__link", **link.fetch(:attr, {}))) }
70
+ links.map { |link| govuk_footer_link_to(link[:text], link[:href], **link.fetch(:attr, {})) }
71
71
  when Hash
72
- links.map { |text, href| raw(link_to(text, href, class: "#{brand}-footer__link")) }
72
+ links.map { |text, href| govuk_footer_link_to(text, href) }
73
73
  else
74
74
  fail(ArgumentError, 'meta links must be a hash or array of hashes') unless links.is_a?(Hash)
75
75
  end
@@ -57,6 +57,12 @@ module GovukLinkHelper
57
57
  link_to(name, href, **link_args, &block)
58
58
  end
59
59
 
60
+ def govuk_footer_link_to(name, href = nil, **kwargs, &block)
61
+ link_args = { class: "#{brand}-footer__link" }.deep_merge_html_attributes(kwargs)
62
+
63
+ link_to(name, href, **link_args, &block)
64
+ end
65
+
60
66
  def govuk_link_classes(inverse: false, muted: false, no_underline: false, no_visited_state: false, text_colour: false)
61
67
  if [text_colour, inverse, muted].count(true) > 1
62
68
  fail("links can be only be one of text_colour, inverse or muted")
@@ -1,5 +1,5 @@
1
1
  module Govuk
2
2
  module Components
3
- VERSION = '5.2.0'.freeze
3
+ VERSION = '5.2.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk-components
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.0
4
+ version: 5.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - DfE developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-22 00:00:00.000000000 Z
11
+ date: 2024-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: html-attributes-utils