govuk-components 2.1.6 → 3.0.0b1

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: 14fa3254f2a6cfe00069f3342241b165dbf00f746a6bff31170f291977614f32
4
- data.tar.gz: a61d4942fa381ee173bc0f397517485f0b0617e5eff7b7a015bbdb9c7ab2fd5f
3
+ metadata.gz: 9916c5fc5a9e7cc9929b62cb227c0a0b39fdf5cb5d3c9108fc95cb6184ce3ea8
4
+ data.tar.gz: 6b9da5d40f0966423d06e68c948cb71d8ead87335dbcb5ce4f8a9131bd8980a2
5
5
  SHA512:
6
- metadata.gz: 163dc576f943962d3730e505b131a98963231b3ae95d3bfdf0d78409c5aa35f9198c518978dfbfc16e8dbadc99ae19fcde97a7b318e782fbb476190eb810dad1
7
- data.tar.gz: 05a0b60347a348e4f006d0c5e4dad3e2afe3a603b0a6fae3150d2ef34ff200f6f83ab6dce65bd009dcf897ca649aaaca1fc7e66ac59044ba1bd40c0aef884bf5
6
+ metadata.gz: d42827c400d5747af53352388f928d546919be9a74d88dcbcb657cbe12c8b7fb924c59df73bde3936760e4596cbacd62b23252a70b45574c3c27f216be0d5b55
7
+ data.tar.gz: ac8158fdd29aa936270a833ea3c351a6e8374dd932456610532b070fc70af4e8f1e0e22eff32a1c6d75dbdfa939269a1c9e297c52823c397bea1ea00c7fff858
@@ -1,7 +1,7 @@
1
1
  class GovukComponent::BackLinkComponent < GovukComponent::Base
2
2
  attr_reader :text, :href
3
3
 
4
- def initialize(href:, text: nil, classes: nil, html_attributes: {})
4
+ def initialize(href:, text: 'Back', classes: nil, html_attributes: {})
5
5
  super(classes: classes, html_attributes: html_attributes)
6
6
 
7
7
  @text = text
@@ -15,7 +15,7 @@ class GovukComponent::BackLinkComponent < GovukComponent::Base
15
15
  private
16
16
 
17
17
  def link_content
18
- text || content || fail(ArgumentError, "no text or content")
18
+ content || text || fail(ArgumentError, "no text or content")
19
19
  end
20
20
 
21
21
  def default_classes
@@ -12,7 +12,7 @@ class GovukComponent::CookieBannerComponent < GovukComponent::Base
12
12
  end
13
13
 
14
14
  def call
15
- tag.div(class: classes, role: "region", aria: { label: aria_label }, hidden: hidden, **html_attributes) do
15
+ tag.div(class: classes, role: "region", aria: { label: aria_label }, data: { nosnippet: true }, hidden: hidden, **html_attributes) do
16
16
  safe_join(messages)
17
17
  end
18
18
  end
@@ -3,7 +3,7 @@ class GovukComponent::DetailsComponent < GovukComponent::Base
3
3
 
4
4
  renders_one :summary_html
5
5
 
6
- def initialize(summary_text:, text: nil, classes: [], id: nil, open: nil, html_attributes: {})
6
+ def initialize(summary_text: nil, text: nil, classes: [], id: nil, open: nil, html_attributes: {})
7
7
  super(classes: classes, html_attributes: html_attributes)
8
8
 
9
9
  @summary_text = summary_text
@@ -36,7 +36,9 @@
36
36
  <% end %>
37
37
 
38
38
  <% if meta_content.present? %>
39
- <%= meta_content %>
39
+ <div class="govuk-footer__meta-custom">
40
+ <%= meta_content %>
41
+ </div>
40
42
  <% end %>
41
43
  </div>
42
44
 
@@ -36,14 +36,14 @@
36
36
  <% end %>
37
37
 
38
38
  <% if navigation_items.any? %>
39
- <%= tag.button("Menu", type: "button", class: %w(govuk-header__menu-button govuk-js-header-toggle), aria: { controls: "navigation", label: menu_button_label }) %>
40
- <nav>
41
- <%= tag.ul(class: navigation_classes, id: "navigation", aria: { label: navigation_label }) do %>
39
+ <%= tag.nav(class: navigation_classes, aria: { label: navigation_label }) do %>
40
+ <%= tag.button("Menu", type: "button", class: %w(govuk-header__menu-button govuk-js-header-toggle), aria: { controls: "navigation", label: menu_button_label }) %>
41
+ <ul id="navigation" class="govuk-header__navigation-list">
42
42
  <% navigation_items.each do |item| %>
43
43
  <%= item %>
44
44
  <% end %>
45
- <% end %>
46
- </nav>
45
+ </ul>
46
+ <% end %>
47
47
  <% end %>
48
48
  </div>
49
49
  <% end %>
@@ -9,7 +9,7 @@ class GovukComponent::PhaseBannerComponent < GovukComponent::Base
9
9
  end
10
10
 
11
11
  def phase_tag_component
12
- GovukComponent::TagComponent.new(classes: "govuk-phase-banner__content__tag", **phase_tag)
12
+ GovukComponent::TagComponent.new(**phase_tag.deep_merge(classes: "govuk-phase-banner__content__tag"))
13
13
  end
14
14
 
15
15
  private
@@ -3,7 +3,7 @@ class GovukComponent::WarningTextComponent < GovukComponent::Base
3
3
 
4
4
  ICON = '!'.freeze
5
5
 
6
- def initialize(text:, icon_fallback_text: 'Warning', classes: [], html_attributes: {})
6
+ def initialize(text: nil, icon_fallback_text: 'Warning', classes: [], html_attributes: {})
7
7
  super(classes: classes, html_attributes: html_attributes)
8
8
 
9
9
  @text = text
@@ -12,7 +12,7 @@ class GovukComponent::WarningTextComponent < GovukComponent::Base
12
12
 
13
13
  def call
14
14
  tag.div(class: classes, **html_attributes) do
15
- safe_join([icon, (content || strong)])
15
+ safe_join([icon, warning_text])
16
16
  end
17
17
  end
18
18
 
@@ -22,9 +22,9 @@ private
22
22
  tag.span(ICON, class: 'govuk-warning-text__icon', aria: { hidden: true })
23
23
  end
24
24
 
25
- def strong
25
+ def warning_text
26
26
  tag.strong(class: 'govuk-warning-text__text') do
27
- safe_join([assistive, text])
27
+ safe_join([assistive, (content || text)])
28
28
  end
29
29
  end
30
30
 
@@ -1,5 +1,5 @@
1
1
  module Govuk
2
2
  module Components
3
- VERSION = '2.1.6'.freeze
3
+ VERSION = '3.0.0b1'.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: 2.1.6
4
+ version: 3.0.0b1
5
5
  platform: ruby
6
6
  authors:
7
7
  - DfE developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-09 00:00:00.000000000 Z
11
+ date: 2021-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.49.1
47
+ version: 2.39.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 2.49.1
54
+ version: 2.39.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pry-byebug
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -231,11 +231,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
231
231
  version: '0'
232
232
  required_rubygems_version: !ruby/object:Gem::Requirement
233
233
  requirements:
234
- - - ">="
234
+ - - ">"
235
235
  - !ruby/object:Gem::Version
236
- version: '0'
236
+ version: 1.3.1
237
237
  requirements: []
238
- rubygems_version: 3.3.3
238
+ rubygems_version: 3.2.3
239
239
  signing_key:
240
240
  specification_version: 4
241
241
  summary: Lightweight set of reusable GOV.UK Design System components