govuk-components 5.7.1 → 5.9.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: 06e7b7ec7e69c8ac85c8089e8740f61774d85a8f8b71057cbf0f8ce441917233
4
- data.tar.gz: 91475476b2227892e5067d94c5076ab5bcd95c9d912653129f187c8f4fd882b9
3
+ metadata.gz: d34fcc2705a109d7ac1675b9e27e0f1b0c7672e1926516c96f9da3309ff9a661
4
+ data.tar.gz: 48b66febcb4ae274be569a55ed93cf1dc978e42a2580040d2bbfec7a48b137b3
5
5
  SHA512:
6
- metadata.gz: 7692fc88efdfe35ab554887b4c43d5acc7959ed7a56b5251bc3478ce6427bd75ac1896b871c16fe1c92bda454e3e246d209b2e6b686e304bae4be4b4eae07c01
7
- data.tar.gz: 0c0ff6c2527c42319439a85b1ecd19e8a57d157ef38b95fce27a8e2316184272fdb8210ea99591d863838daaa7bd1048596a74a32f2bbe7cb49c3a59bc52e482
6
+ metadata.gz: abd7d44e3c988fbbd8bc4095c1a96f5529ec73ff4b0c56f8a8016933409bd40aa6cb8287c826ed4b3275cc3b32acc69c51b161d7bef110472aeffb7998172e8f
7
+ data.tar.gz: df6781cfbd9f951a2158a9f5c3b52851cb1987e769b85d10e9f3bee30f5be093a6a0be91eef9a6065c1115260c84d844028814cd9777effe4fba1cc7d23de521
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  [![Gem](https://img.shields.io/gem/dt/govuk-components?logo=rubygems)](https://rubygems.org/gems/govuk-components)
7
7
  [![Test coverage](https://api.codeclimate.com/v1/badges/cbcbc140f300b920d833/test_coverage)](https://codeclimate.com/github/x-govuk/govuk-components/test_coverage)
8
8
  [![Licence](https://img.shields.io/github/license/x-govuk/govuk-components)](https://github.com/x-govuk/govuk-components/blob/main/LICENSE.txt)
9
- [![GOV.UK Design System version](https://img.shields.io/badge/GOV.UK%20Design%20System-5.7.0-brightgreen)](https://design-system.service.gov.uk)
9
+ [![GOV.UK Design System version](https://img.shields.io/badge/GOV.UK%20Design%20System-5.9.0-brightgreen)](https://design-system.service.gov.uk)
10
10
  [![ViewComponent](https://img.shields.io/badge/ViewComponent-3.16.0-brightgreen)](https://viewcomponent.org/)
11
11
  [![Rails](https://img.shields.io/badge/Rails-7.1.5%20%E2%95%B1%207.2.2%20%E2%95%B1%208.0.0-E16D6D)](https://weblog.rubyonrails.org/releases/)
12
12
  [![Ruby](https://img.shields.io/badge/Ruby-3.1.6%20%20%E2%95%B1%203.2.6%20%20%E2%95%B1%203.3.6-E16D6D)](https://www.ruby-lang.org/en/downloads/)
@@ -35,6 +35,12 @@ class GovukComponent::HeaderComponent < GovukComponent::Base
35
35
  super(classes:, html_attributes:)
36
36
  end
37
37
 
38
+ def before_render
39
+ if service_name.present? || navigation_items.present?
40
+ Rails.logger.warn('Service name and navigation links are deprecated and will be removed in the next breaking release of GOV.UK Frontend. See https://github.com/alphagov/govuk-frontend/releases/tag/v5.9.0')
41
+ end
42
+ end
43
+
38
44
  private
39
45
 
40
46
  def default_attributes
@@ -1,6 +1,6 @@
1
1
  <%= tag.div(**html_attributes) do %>
2
2
  <div class="<%= brand %>-summary-card__title-wrapper">
3
- <%= tag.h2(title, class: "#{brand}-summary-card__title") %>
3
+ <%= content_tag(heading_level, title, class: "#{brand}-summary-card__title") %>
4
4
 
5
5
  <% if actions.any? %>
6
6
  <ul class="<%= brand %>-summary-card__actions">
@@ -1,11 +1,12 @@
1
1
  class GovukComponent::SummaryListComponent::CardComponent < GovukComponent::Base
2
- attr_reader :title
2
+ attr_reader :title, :heading_level
3
3
 
4
4
  renders_many :actions
5
5
  renders_one :summary_list, "GovukComponent::SummaryListComponent"
6
6
 
7
- def initialize(title:, actions: [], classes: [], html_attributes: {})
7
+ def initialize(title:, heading_level: 2, actions: [], classes: [], html_attributes: {})
8
8
  @title = title
9
+ @heading_level = heading_tag(heading_level)
9
10
  actions.each { |a| with_action { a } } if actions.any?
10
11
 
11
12
  super(classes:, html_attributes:)
@@ -17,6 +18,12 @@ private
17
18
  { class: "#{brand}-summary-card" }
18
19
  end
19
20
 
21
+ def heading_tag(level)
22
+ fail(ArgumentError, "heading_level must be 1-6") unless level.in?(1..6)
23
+
24
+ "h#{level}"
25
+ end
26
+
20
27
  def action_text(action)
21
28
  safe_join([action, tag.span(" (" + title + ")", class: "#{brand}-visually-hidden")])
22
29
  end
@@ -1,5 +1,5 @@
1
1
  module Govuk
2
2
  module Components
3
- VERSION = '5.7.1'.freeze
3
+ VERSION = '5.9.0'.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.7.1
4
+ version: 5.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - DfE developers
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-09 00:00:00.000000000 Z
11
+ date: 2025-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: html-attributes-utils
@@ -59,7 +59,7 @@ dependencies:
59
59
  version: '3.18'
60
60
  - - "<"
61
61
  - !ruby/object:Gem::Version
62
- version: '3.21'
62
+ version: '3.22'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
@@ -69,7 +69,7 @@ dependencies:
69
69
  version: '3.18'
70
70
  - - "<"
71
71
  - !ruby/object:Gem::Version
72
- version: '3.21'
72
+ version: '3.22'
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: deep_merge
75
75
  requirement: !ruby/object:Gem::Requirement
@@ -132,14 +132,14 @@ dependencies:
132
132
  requirements:
133
133
  - - '='
134
134
  - !ruby/object:Gem::Version
135
- version: 5.0.2
135
+ version: 5.0.7
136
136
  type: :development
137
137
  prerelease: false
138
138
  version_requirements: !ruby/object:Gem::Requirement
139
139
  requirements:
140
140
  - - '='
141
141
  - !ruby/object:Gem::Version
142
- version: 5.0.2
142
+ version: 5.0.7
143
143
  - !ruby/object:Gem::Dependency
144
144
  name: sassc-rails
145
145
  requirement: !ruby/object:Gem::Requirement
@@ -230,14 +230,14 @@ dependencies:
230
230
  requirements:
231
231
  - - "~>"
232
232
  - !ruby/object:Gem::Version
233
- version: 4.4.0
233
+ version: 4.5.1
234
234
  type: :development
235
235
  prerelease: false
236
236
  version_requirements: !ruby/object:Gem::Requirement
237
237
  requirements:
238
238
  - - "~>"
239
239
  - !ruby/object:Gem::Version
240
- version: 4.4.0
240
+ version: 4.5.1
241
241
  - !ruby/object:Gem::Dependency
242
242
  name: rubypants
243
243
  requirement: !ruby/object:Gem::Requirement
@@ -408,7 +408,7 @@ homepage: https://github.com/x-govuk/govuk-components
408
408
  licenses:
409
409
  - MIT
410
410
  metadata: {}
411
- post_install_message:
411
+ post_install_message:
412
412
  rdoc_options: []
413
413
  require_paths:
414
414
  - lib
@@ -424,7 +424,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
424
424
  version: '0'
425
425
  requirements: []
426
426
  rubygems_version: 3.3.27
427
- signing_key:
427
+ signing_key:
428
428
  specification_version: 4
429
429
  summary: GOV.UK Components for Ruby on Rails
430
430
  test_files: []