govuk-components 2.1.6 → 3.0.0b1
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/app/components/govuk_component/back_link_component.rb +2 -2
- data/app/components/govuk_component/cookie_banner_component.rb +1 -1
- data/app/components/govuk_component/details_component.rb +1 -1
- data/app/components/govuk_component/footer_component.html.erb +3 -1
- data/app/components/govuk_component/header_component.html.erb +5 -5
- data/app/components/govuk_component/phase_banner_component.rb +1 -1
- data/app/components/govuk_component/warning_text_component.rb +4 -4
- data/lib/govuk/components/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9916c5fc5a9e7cc9929b62cb227c0a0b39fdf5cb5d3c9108fc95cb6184ce3ea8
|
4
|
+
data.tar.gz: 6b9da5d40f0966423d06e68c948cb71d8ead87335dbcb5ce4f8a9131bd8980a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
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
|
-
|
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
|
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,14 +36,14 @@
|
|
36
36
|
<% end %>
|
37
37
|
|
38
38
|
<% if navigation_items.any? %>
|
39
|
-
<%= tag.
|
40
|
-
|
41
|
-
|
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
|
-
|
46
|
-
|
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"
|
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
|
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,
|
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
|
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
|
|
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:
|
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:
|
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.
|
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.
|
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:
|
236
|
+
version: 1.3.1
|
237
237
|
requirements: []
|
238
|
-
rubygems_version: 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
|