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 +4 -4
- data/README.md +1 -1
- data/app/components/govuk_component/header_component.rb +6 -0
- data/app/components/govuk_component/summary_list_component/card_component.html.erb +1 -1
- data/app/components/govuk_component/summary_list_component/card_component.rb +9 -2
- data/lib/govuk/components/version.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d34fcc2705a109d7ac1675b9e27e0f1b0c7672e1926516c96f9da3309ff9a661
|
4
|
+
data.tar.gz: 48b66febcb4ae274be569a55ed93cf1dc978e42a2580040d2bbfec7a48b137b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abd7d44e3c988fbbd8bc4095c1a96f5529ec73ff4b0c56f8a8016933409bd40aa6cb8287c826ed4b3275cc3b32acc69c51b161d7bef110472aeffb7998172e8f
|
7
|
+
data.tar.gz: df6781cfbd9f951a2158a9f5c3b52851cb1987e769b85d10e9f3bee30f5be093a6a0be91eef9a6065c1115260c84d844028814cd9777effe4fba1cc7d23de521
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
[](https://rubygems.org/gems/govuk-components)
|
7
7
|
[](https://codeclimate.com/github/x-govuk/govuk-components/test_coverage)
|
8
8
|
[](https://github.com/x-govuk/govuk-components/blob/main/LICENSE.txt)
|
9
|
-
[](https://design-system.service.gov.uk)
|
10
10
|
[](https://viewcomponent.org/)
|
11
11
|
[](https://weblog.rubyonrails.org/releases/)
|
12
12
|
[](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
|
-
<%=
|
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
|
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.
|
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:
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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: []
|