govuk-components 4.1.2 → 5.0.0b1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/app/components/govuk_component/details_component.rb +1 -1
- data/app/components/govuk_component/header_component.html.erb +17 -21
- data/app/components/govuk_component/header_component.rb +1 -18
- data/app/components/govuk_component/summary_list_component/action_component.rb +1 -1
- data/app/components/govuk_component/tag_component.rb +1 -1
- data/app/components/govuk_component/task_list_component/item_component.rb +77 -0
- data/app/components/govuk_component/task_list_component/status_component.rb +31 -0
- data/app/components/govuk_component/task_list_component/title_component.rb +53 -0
- data/app/components/govuk_component/task_list_component.rb +37 -0
- data/app/components/govuk_component/warning_text_component.rb +3 -3
- data/app/helpers/govuk_components_helper.rb +1 -0
- data/app/helpers/govuk_link_helper.rb +82 -106
- data/app/helpers/govuk_rails_compatibile_link_helper.rb +156 -0
- data/app/helpers/govuk_visually_hidden_helper.rb +13 -0
- data/lib/govuk/components/engine.rb +2 -4
- data/lib/govuk/components/version.rb +1 -1
- metadata +12 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71deff2fbc3e3456d59fe65244041e5b892a2c014967e11cf3a4f5e64a6da596
|
4
|
+
data.tar.gz: 756dfe3c9c96747e25d11e7175f6ae1b15b8cb9db0556f400ac00275c97dbd9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a62ba0fdd881023b79cff29398915f1b37d8b11057bc544fe5bc3df9c7c5336a0c6703360eac1d629ec0c7a7edf8fe1673195478424e86695ad6d273c66527ff
|
7
|
+
data.tar.gz: cbf84f6ea8a76973402d07375b4552661e7316267e1edfd89151f05dc74fe3de38366230c4e498cf66f03111ea180870b05439c79076c89c0fc4b9ca58d5d22d
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@
|
|
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
9
|
[![GOV.UK Design System version](https://img.shields.io/badge/GOV.UK%20Design%20System-4.7.0-brightgreen)](https://design-system.service.gov.uk)
|
10
10
|
[![ViewComponent](https://img.shields.io/badge/ViewComponent-3.3.0-brightgreen)](https://viewcomponent.org/)
|
11
|
-
[![Rails](https://img.shields.io/badge/Rails-
|
11
|
+
[![Rails](https://img.shields.io/badge/Rails-7.0.8%20%E2%95%B1%207.1.0-E16D6D)](https://weblog.rubyonrails.org/releases/)
|
12
12
|
[![Ruby](https://img.shields.io/badge/Ruby-3.0.6%20%20%E2%95%B1%203.1.4%20%20%E2%95%B1%203.2.2-E16D6D)](https://www.ruby-lang.org/en/downloads/)
|
13
13
|
|
14
14
|
This gem provides a suite of reusable components for the [GOV.UK Design System](https://design-system.service.gov.uk/). It is intended to provide a lightweight alternative to the [GOV.UK Publishing Components](https://github.com/alphagov/govuk_publishing_components) library and is built with GitHub’s [ViewComponent](https://github.com/github/view_component) framework.
|
@@ -46,6 +46,7 @@ The provided components are:
|
|
46
46
|
* [Tabs](https://govuk-components.netlify.app/components/tabs)
|
47
47
|
* [Tables](https://govuk-components.netlify.app/components/table)
|
48
48
|
* [Tags](https://govuk-components.netlify.app/components/tag)
|
49
|
+
* [Task list](https://govuk-components.netlify.app/components/task-list)
|
49
50
|
* [Warning text](https://govuk-components.netlify.app/components/warning-text)
|
50
51
|
|
51
52
|
This library also provides helpers for creating [links](https://govuk-components.netlify.app/helpers/link),
|
@@ -13,7 +13,7 @@ class GovukComponent::DetailsComponent < GovukComponent::Base
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def call
|
16
|
-
tag.details(
|
16
|
+
tag.details(id: id, open: open, **html_attributes) do
|
17
17
|
safe_join([summary, description])
|
18
18
|
end
|
19
19
|
end
|
@@ -2,27 +2,23 @@
|
|
2
2
|
<%= tag.div(**container_html_attributes) do %>
|
3
3
|
<div class="<%= brand %>-header__logo">
|
4
4
|
<%= link_to(homepage_url, class: ["#{brand}-header__link", "#{brand}-header__link--homepage"]) do %>
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
<%= tag.span(logotype, class: "#{brand}-header__logotype-text") %>
|
24
|
-
<% end %>
|
25
|
-
</span>
|
5
|
+
<% if custom_logo.present? %>
|
6
|
+
<%= custom_logo %>
|
7
|
+
<% else %>
|
8
|
+
<svg
|
9
|
+
focusable="false"
|
10
|
+
role="img"
|
11
|
+
class="<%= brand %>-header__logotype"
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
13
|
+
viewBox="0 0 152 30"
|
14
|
+
height="30"
|
15
|
+
width="152"
|
16
|
+
aria-label="GOV.UK"
|
17
|
+
>
|
18
|
+
<title>GOV.UK</title>
|
19
|
+
<path d="M6.7 12.2c1 .4 2.1-.1 2.5-1s-.1-2.1-1-2.5c-1-.4-2.1.1-2.5 1-.4 1 0 2.1 1 2.5m-4.3 2.5c1 .4 2.1-.1 2.5-1s-.1-2.1-1-2.5c-1-.4-2.1.1-2.5 1-.5 1 0 2.1 1 2.5m-1.3 4.8c1 .4 2.1-.1 2.5-1 .4-1-.1-2.1-1-2.5-1-.4-2.1.1-2.5 1-.4 1 0 2.1 1 2.5m10.4-5.8c1 .4 2.1-.1 2.5-1s-.1-2.1-1-2.5c-1-.4-2.1.1-2.5 1s0 2.1 1 2.5m17.4-1.5c-1 .4-2.1-.1-2.5-1s.1-2.1 1-2.5c1-.4 2.1.1 2.5 1 .5 1 0 2.1-1 2.5m4.3 2.5c-1 .4-2.1-.1-2.5-1s.1-2.1 1-2.5c1-.4 2.1.1 2.5 1 .5 1 0 2.1-1 2.5m1.3 4.8c-1 .4-2.1-.1-2.5-1-.4-1 .1-2.1 1-2.5 1-.4 2.1.1 2.5 1 .4 1 0 2.1-1 2.5m-10.4-5.8c-1 .4-2.1-.1-2.5-1s.1-2.1 1-2.5c1-.4 2.1.1 2.5 1s0 2.1-1 2.5m-5.3-4.9 2.4 1.3V6.5l-2.4.8c-.1-.1-.1-.2-.2-.2s1-3 1-3h-3.4l1 3c-.1.1-.2.1-.2.2-.1.1-2.4-.7-2.4-.7v3.5L17 8.8c-.1.1 0 .2.1.3l-1.4 4.2c-.1.2-.1.4-.1.7 0 1.1.8 2.1 1.9 2.2h.6C19.2 16 20 15.1 20 14c0-.2 0-.4-.1-.7l-1.4-4.2c.2-.1.3-.2.3-.3m-1 20.3c4.6 0 8.9.3 12.8.9 1.1-4.6 2.4-7.2 3.8-9.1l-2.6-.9c.3 1.3.3 1.9 0 2.8-.4-.4-.8-1.2-1.1-2.4l-1.2 4.2c.8-.5 1.4-.9 2-.9-1.2 2.6-2.7 3.2-3.6 3-1.2-.2-1.7-1.3-1.5-2.2.3-1.3 1.6-1.6 2.2-.1 1.2-2.4-.8-3.1-2.1-2.4 1.9-1.9 2.2-3.6.6-5.7-2.2 1.7-2.2 3.3-1.2 5.6-1.3-1.5-3.3-.7-2.5 1.7.9-1.4 2.1-.5 2 .8-.2 1.2-1.7 2.1-3.7 2-2.8-.2-3-2.2-3-3.7.7-.1 1.9.5 3 2l.4-4.4c-1.1 1.2-2.2 1.4-3.3 1.4.4-1.2 2.1-3.1 2.1-3.1h-5.5s1.8 2 2.1 3.1c-1.1 0-2.2-.3-3.3-1.4l.4 4.4c1.1-1.5 2.3-2.1 3-2-.1 1.6-.2 3.5-3 3.7-1.9.2-3.5-.8-3.7-2-.2-1.3 1-2.2 1.9-.8.7-2.4-1.3-3.1-2.6-1.7 1-2.3 1-4-1.2-5.6-1.6 2.1-1.3 3.8.6 5.7-1.3-.7-3.2 0-2.1 2.4.6-1.5 1.9-1.1 2.2.1.2.9-.4 1.9-1.5 2.2-1 .2-2.5-.5-3.7-3 .7 0 1.3.4 2 .9L5 20.4c-.3 1.2-.7 1.9-1.2 2.4-.3-.8-.2-1.5 0-2.8l-2.6.9C2.7 22.8 4 25.4 5.1 30c3.8-.5 8.2-.9 12.7-.9m30.5-11.5c0 .9.1 1.7.3 2.5.2.8.6 1.5 1 2.2.5.6 1 1.1 1.7 1.5.7.4 1.5.6 2.5.6.9 0 1.7-.1 2.3-.4s1.1-.7 1.5-1.1c.4-.4.6-.9.8-1.5.1-.5.2-1 .2-1.5v-.2h-5.3v-3.2h9.4V28H59v-2.5c-.3.4-.6.8-1 1.1-.4.3-.8.6-1.3.9-.5.2-1 .4-1.6.6s-1.2.2-1.8.2c-1.5 0-2.9-.3-4-.8-1.2-.6-2.2-1.3-3-2.3-.8-1-1.4-2.1-1.8-3.4-.3-1.4-.5-2.8-.5-4.3s.2-2.9.7-4.2c.5-1.3 1.1-2.4 2-3.4.9-1 1.9-1.7 3.1-2.3 1.2-.6 2.6-.8 4.1-.8 1 0 1.9.1 2.8.3.9.2 1.7.6 2.4 1s1.4.9 1.9 1.5c.6.6 1 1.3 1.4 2l-3.7 2.1c-.2-.4-.5-.9-.8-1.2-.3-.4-.6-.7-1-1-.4-.3-.8-.5-1.3-.7-.5-.2-1.1-.2-1.7-.2-1 0-1.8.2-2.5.6-.7.4-1.3.9-1.7 1.5-.5.6-.8 1.4-1 2.2-.3.8-.4 1.9-.4 2.7zm36.4-4.3c-.4-1.3-1.1-2.4-2-3.4-.9-1-1.9-1.7-3.1-2.3-1.2-.6-2.6-.8-4.2-.8s-2.9.3-4.2.8c-1.1.6-2.2 1.4-3 2.3-.9 1-1.5 2.1-2 3.4-.4 1.3-.7 2.7-.7 4.2s.2 2.9.7 4.2c.4 1.3 1.1 2.4 2 3.4.9 1 1.9 1.7 3.1 2.3 1.2.6 2.6.8 4.2.8 1.5 0 2.9-.3 4.2-.8 1.2-.6 2.3-1.3 3.1-2.3.9-1 1.5-2.1 2-3.4.4-1.3.7-2.7.7-4.2-.1-1.5-.3-2.9-.8-4.2zM81 17.6c0 1-.1 1.9-.4 2.7-.2.8-.6 1.6-1.1 2.2-.5.6-1.1 1.1-1.7 1.4-.7.3-1.5.5-2.4.5-.9 0-1.7-.2-2.4-.5s-1.3-.8-1.7-1.4c-.5-.6-.8-1.3-1.1-2.2-.2-.8-.4-1.7-.4-2.7v-.1c0-1 .1-1.9.4-2.7.2-.8.6-1.6 1.1-2.2.5-.6 1.1-1.1 1.7-1.4.7-.3 1.5-.5 2.4-.5.9 0 1.7.2 2.4.5s1.3.8 1.7 1.4c.5.6.8 1.3 1.1 2.2.2.8.4 1.7.4 2.7v.1zM92.9 28 87 7h4.7l4 15.7h.1l4-15.7h4.7l-5.9 21h-5.7zm28.8-3.6c.6 0 1.2-.1 1.7-.3.5-.2 1-.4 1.4-.8.4-.4.7-.8.9-1.4.2-.6.3-1.2.3-2v-13h4.1v13.6c0 1.2-.2 2.2-.6 3.1s-1 1.7-1.8 2.4c-.7.7-1.6 1.2-2.7 1.5-1 .4-2.2.5-3.4.5-1.2 0-2.4-.2-3.4-.5-1-.4-1.9-.9-2.7-1.5-.8-.7-1.3-1.5-1.8-2.4-.4-.9-.6-2-.6-3.1V6.9h4.2v13c0 .8.1 1.4.3 2 .2.6.5 1 .9 1.4.4.4.8.6 1.4.8.6.2 1.1.3 1.8.3zm13-17.4h4.2v9.1l7.4-9.1h5.2l-7.2 8.4L152 28h-4.9l-5.5-9.4-2.7 3V28h-4.2V7zm-27.6 16.1c-1.5 0-2.7 1.2-2.7 2.7s1.2 2.7 2.7 2.7 2.7-1.2 2.7-2.7-1.2-2.7-2.7-2.7z"></path>
|
20
|
+
</svg>
|
21
|
+
<% end %>
|
26
22
|
<% if product_name.present? %>
|
27
23
|
<%= product_name %>
|
28
24
|
<% end %>
|
@@ -3,10 +3,7 @@ class GovukComponent::HeaderComponent < GovukComponent::Base
|
|
3
3
|
renders_one :custom_logo
|
4
4
|
renders_one :product_name, "ProductName"
|
5
5
|
|
6
|
-
attr_reader :
|
7
|
-
:crown,
|
8
|
-
:crown_fallback_image_path,
|
9
|
-
:homepage_url,
|
6
|
+
attr_reader :homepage_url,
|
10
7
|
:service_name,
|
11
8
|
:service_url,
|
12
9
|
:menu_button_label,
|
@@ -16,9 +13,6 @@ class GovukComponent::HeaderComponent < GovukComponent::Base
|
|
16
13
|
|
17
14
|
def initialize(classes: [],
|
18
15
|
html_attributes: {},
|
19
|
-
logotype: config.default_header_logotype,
|
20
|
-
crown: true,
|
21
|
-
crown_fallback_image_path: nil,
|
22
16
|
homepage_url: config.default_header_homepage_url,
|
23
17
|
menu_button_label: config.default_header_menu_button_label,
|
24
18
|
navigation_classes: [],
|
@@ -27,9 +21,6 @@ class GovukComponent::HeaderComponent < GovukComponent::Base
|
|
27
21
|
service_url: config.default_header_service_url,
|
28
22
|
container_classes: nil)
|
29
23
|
|
30
|
-
@logotype = logotype
|
31
|
-
@crown = crown
|
32
|
-
@crown_fallback_image_path = crown_fallback_image_path
|
33
24
|
@homepage_url = homepage_url
|
34
25
|
@service_name = service_name
|
35
26
|
@service_url = service_url
|
@@ -57,14 +48,6 @@ private
|
|
57
48
|
{ class: ["#{brand}-header__container", "#{brand}-width-container"].append(custom_container_classes).compact }
|
58
49
|
end
|
59
50
|
|
60
|
-
def crown_fallback_image_attributes
|
61
|
-
{
|
62
|
-
class: "#{brand}-header__logotype-crown-fallback-image",
|
63
|
-
width: "36",
|
64
|
-
height: "32",
|
65
|
-
}
|
66
|
-
end
|
67
|
-
|
68
51
|
class NavigationItem < GovukComponent::Base
|
69
52
|
attr_reader :text, :href, :options, :active
|
70
53
|
|
@@ -27,7 +27,7 @@ class GovukComponent::SummaryListComponent::ActionComponent < GovukComponent::Ba
|
|
27
27
|
private
|
28
28
|
|
29
29
|
def default_attributes
|
30
|
-
link_classes = govuk_link_classes
|
30
|
+
link_classes = safe_join([govuk_link_classes, classes], " ")
|
31
31
|
|
32
32
|
{ class: link_classes }
|
33
33
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class GovukComponent::TagComponent < GovukComponent::Base
|
2
2
|
attr_reader :text, :colour
|
3
3
|
|
4
|
-
COLOURS = %w(grey green turquoise blue red purple pink orange yellow).freeze
|
4
|
+
COLOURS = %w(grey green turquoise blue light-blue red purple pink orange yellow).freeze
|
5
5
|
|
6
6
|
def initialize(text: nil, colour: config.default_tag_colour, classes: [], html_attributes: {})
|
7
7
|
@text = text
|
@@ -0,0 +1,77 @@
|
|
1
|
+
module GovukComponent
|
2
|
+
class TaskListComponent::ItemComponent < GovukComponent::Base
|
3
|
+
renders_one :status, ->(text: nil, classes: [], html_attributes: {}, &block) do
|
4
|
+
GovukComponent::TaskListComponent::StatusComponent.new(
|
5
|
+
id_prefix: @id_prefix,
|
6
|
+
count: @count,
|
7
|
+
text: text,
|
8
|
+
classes: classes,
|
9
|
+
html_attributes: html_attributes,
|
10
|
+
&block
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
renders_one :title, ->(text: nil, href: nil, hint: nil, classes: [], html_attributes: {}, &block) do
|
15
|
+
GovukComponent::TaskListComponent::TitleComponent.new(
|
16
|
+
id_prefix: @id_prefix,
|
17
|
+
count: @count,
|
18
|
+
text: text,
|
19
|
+
href: href,
|
20
|
+
hint: hint,
|
21
|
+
classes: classes,
|
22
|
+
html_attributes: html_attributes,
|
23
|
+
&block
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
attr_reader :raw_title, :hint, :href, :raw_status
|
28
|
+
attr_writer :count
|
29
|
+
|
30
|
+
def initialize(title: nil, href: nil, hint: nil, count: nil, id_prefix: nil, status: {}, classes: [], html_attributes: {})
|
31
|
+
@raw_title = title
|
32
|
+
@href = href
|
33
|
+
@hint = hint
|
34
|
+
@raw_status = status
|
35
|
+
@id_prefix = id_prefix
|
36
|
+
@count = count
|
37
|
+
|
38
|
+
super(classes: classes, html_attributes: html_attributes)
|
39
|
+
end
|
40
|
+
|
41
|
+
def call
|
42
|
+
adjusted_html_attributes = if href.present? || title&.href.present?
|
43
|
+
html_attributes_with_link_class
|
44
|
+
else
|
45
|
+
html_attributes
|
46
|
+
end
|
47
|
+
|
48
|
+
tag.li(safe_join([title_content, status_content].compact), **adjusted_html_attributes)
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
52
|
+
|
53
|
+
def title_content
|
54
|
+
title || with_title(**title_attributes)
|
55
|
+
end
|
56
|
+
|
57
|
+
def status_content
|
58
|
+
status || with_status(**status_attributes)
|
59
|
+
end
|
60
|
+
|
61
|
+
def default_attributes
|
62
|
+
{ class: 'govuk-task-list__item' }
|
63
|
+
end
|
64
|
+
|
65
|
+
def title_attributes
|
66
|
+
{ text: raw_title, href: href, hint: hint }
|
67
|
+
end
|
68
|
+
|
69
|
+
def html_attributes_with_link_class
|
70
|
+
html_attributes.tap { |h| h[:class].append("govuk-task-list__item--with-link") }
|
71
|
+
end
|
72
|
+
|
73
|
+
def status_attributes
|
74
|
+
raw_status.is_a?(String) ? { text: raw_status } : raw_status
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module GovukComponent
|
2
|
+
class TaskListComponent::StatusComponent < GovukComponent::Base
|
3
|
+
attr_reader :id_prefix, :text, :count
|
4
|
+
|
5
|
+
def initialize(text: nil, id_prefix: nil, count: nil, classes: [], html_attributes: {})
|
6
|
+
@text = text
|
7
|
+
@count = count
|
8
|
+
@id_prefix = id_prefix
|
9
|
+
|
10
|
+
super(classes: classes, html_attributes: html_attributes)
|
11
|
+
end
|
12
|
+
|
13
|
+
def call
|
14
|
+
tag.div(status_text, **html_attributes)
|
15
|
+
end
|
16
|
+
|
17
|
+
def render?
|
18
|
+
status_text.present?
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def default_attributes
|
24
|
+
{ class: %w(govuk-task-list__status), id: [id_prefix, count, "status"].compact.join("-") }
|
25
|
+
end
|
26
|
+
|
27
|
+
def status_text
|
28
|
+
text || content
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module GovukComponent
|
2
|
+
class TaskListComponent::TitleComponent < GovukComponent::Base
|
3
|
+
using HTMLAttributesUtils
|
4
|
+
|
5
|
+
attr_reader :id_prefix, :text, :href, :hint, :count
|
6
|
+
|
7
|
+
def initialize(text: nil, href: nil, hint: nil, id_prefix: nil, count: nil, classes: [], html_attributes: {})
|
8
|
+
@text = text
|
9
|
+
@href = href
|
10
|
+
@hint = hint
|
11
|
+
@id_prefix = id_prefix
|
12
|
+
@count = count
|
13
|
+
|
14
|
+
super(classes: classes, html_attributes: html_attributes)
|
15
|
+
end
|
16
|
+
|
17
|
+
def call
|
18
|
+
tag.div(**html_attributes) { safe_join([title_content, hint_content]) }
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def title_content
|
24
|
+
(href.present?) ? govuk_link_to(text, href, **link_attributes) : text
|
25
|
+
end
|
26
|
+
|
27
|
+
def hint_content
|
28
|
+
return if hint.blank?
|
29
|
+
|
30
|
+
tag.div(hint, class: "govuk-task-list__hint", id: hint_id)
|
31
|
+
end
|
32
|
+
|
33
|
+
def default_attributes
|
34
|
+
{ class: "govuk-task-list__name-and-hint" }
|
35
|
+
end
|
36
|
+
|
37
|
+
def link_attributes
|
38
|
+
{ class: "govuk-task-list__link", **aria_described_by_attributes }
|
39
|
+
end
|
40
|
+
|
41
|
+
def aria_described_by_attributes
|
42
|
+
{ aria: { describedby: [*status_id, *hint_id] } }
|
43
|
+
end
|
44
|
+
|
45
|
+
def hint_id
|
46
|
+
[id_prefix, count, "hint"].compact.join("-") if hint.present?
|
47
|
+
end
|
48
|
+
|
49
|
+
def status_id
|
50
|
+
[id_prefix, count, "status"].compact.join("-")
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module GovukComponent
|
2
|
+
class TaskListComponent < GovukComponent::Base
|
3
|
+
renders_many :items, ->(title: nil, href: nil, hint: nil, status: {}, classes: [], html_attributes: {}) do
|
4
|
+
GovukComponent::TaskListComponent::ItemComponent.new(
|
5
|
+
title: title,
|
6
|
+
href: href,
|
7
|
+
hint: hint,
|
8
|
+
id_prefix: @id_prefix,
|
9
|
+
count: @count,
|
10
|
+
status: status,
|
11
|
+
classes: classes,
|
12
|
+
html_attributes: html_attributes
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
def initialize(id_prefix: "task-list", classes: [], html_attributes: {})
|
17
|
+
@id_prefix = id_prefix
|
18
|
+
@count = 0
|
19
|
+
|
20
|
+
super(classes: classes, html_attributes: html_attributes)
|
21
|
+
end
|
22
|
+
|
23
|
+
def call
|
24
|
+
numbered_items = items.each.with_index(1) { |item, count| item.count = count }
|
25
|
+
|
26
|
+
tag.ul(**html_attributes) do
|
27
|
+
safe_join(numbered_items)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def default_attributes
|
34
|
+
{ class: 'govuk-task-list' }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -23,12 +23,12 @@ private
|
|
23
23
|
|
24
24
|
def warning_text
|
25
25
|
tag.strong(class: "#{brand}-warning-text__text") do
|
26
|
-
safe_join([
|
26
|
+
safe_join([visually_hidden_text, (content || text)])
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
31
|
-
tag.span(icon_fallback_text, class: "#{brand}-
|
30
|
+
def visually_hidden_text
|
31
|
+
tag.span(icon_fallback_text, class: "#{brand}-visually-hidden")
|
32
32
|
end
|
33
33
|
|
34
34
|
def default_attributes
|
@@ -20,6 +20,7 @@ module GovukComponentsHelper
|
|
20
20
|
govuk_table: 'GovukComponent::TableComponent',
|
21
21
|
govuk_tabs: 'GovukComponent::TabComponent',
|
22
22
|
govuk_tag: 'GovukComponent::TagComponent',
|
23
|
+
govuk_task_list: 'GovukComponent::TaskListComponent',
|
23
24
|
govuk_warning_text: 'GovukComponent::WarningTextComponent',
|
24
25
|
}.each do |name, klass|
|
25
26
|
define_method(name) do |*args, **kwargs, &block|
|
@@ -3,156 +3,132 @@ require "html_attributes_utils"
|
|
3
3
|
module GovukLinkHelper
|
4
4
|
using HTMLAttributesUtils
|
5
5
|
|
6
|
-
def
|
7
|
-
|
8
|
-
|
9
|
-
end
|
6
|
+
def govuk_link_to(name, href = nil, new_tab: false, inverse: false, muted: false, no_underline: false, no_visited_state: false, text_colour: false, visually_hidden_prefix: nil, visually_hidden_suffix: nil, **kwargs, &block)
|
7
|
+
link_args = extract_link_args(new_tab: new_tab, inverse: inverse, muted: muted, no_underline: no_underline, no_visited_state: no_visited_state, text_colour: text_colour, **kwargs)
|
8
|
+
link_text = build_text(name, visually_hidden_prefix: visually_hidden_prefix, visually_hidden_suffix: visually_hidden_suffix, &block)
|
10
9
|
|
11
|
-
|
10
|
+
link_to(link_text, href, **link_args)
|
12
11
|
end
|
13
12
|
|
14
|
-
def
|
15
|
-
|
16
|
-
|
17
|
-
end
|
13
|
+
def govuk_mail_to(email_address, name = nil, new_tab: false, inverse: false, muted: false, no_underline: false, no_visited_state: false, text_colour: false, visually_hidden_prefix: nil, visually_hidden_suffix: nil, **kwargs, &block)
|
14
|
+
link_args = extract_link_args(new_tab: new_tab, inverse: inverse, muted: muted, no_underline: no_underline, no_visited_state: no_visited_state, text_colour: text_colour, **kwargs)
|
15
|
+
link_text = build_text(name, visually_hidden_prefix: visually_hidden_prefix, visually_hidden_suffix: visually_hidden_suffix, &block)
|
18
16
|
|
19
|
-
|
17
|
+
mail_to(email_address, link_text, **link_args)
|
20
18
|
end
|
21
19
|
|
22
|
-
def
|
23
|
-
|
24
|
-
|
20
|
+
def govuk_button_to(name, href = nil, disabled: false, inverse: false, secondary: false, warning: false, visually_hidden_prefix: nil, visually_hidden_suffix: nil, **kwargs, &block)
|
21
|
+
button_args = extract_button_args(new_tab: false, disabled: disabled, inverse: inverse, secondary: secondary, warning: warning, **kwargs)
|
22
|
+
button_text = build_text(name, visually_hidden_prefix: visually_hidden_prefix, visually_hidden_suffix: visually_hidden_suffix, &block)
|
25
23
|
|
26
|
-
|
27
|
-
link_to(name, html_options, &block)
|
28
|
-
else
|
29
|
-
link_to(name, options, html_options)
|
30
|
-
end
|
24
|
+
button_to(button_text, href, **button_args)
|
31
25
|
end
|
32
26
|
|
33
|
-
def
|
34
|
-
|
35
|
-
|
27
|
+
def govuk_button_link_to(name, href = nil, new_tab: false, disabled: false, inverse: false, secondary: false, warning: false, visually_hidden_prefix: nil, visually_hidden_suffix: nil, **kwargs, &block)
|
28
|
+
button_args = extract_button_link_args(new_tab: new_tab, disabled: disabled, inverse: inverse, secondary: secondary, warning: warning, **kwargs)
|
29
|
+
button_text = build_text(name, visually_hidden_prefix: visually_hidden_prefix, visually_hidden_suffix: visually_hidden_suffix, &block)
|
36
30
|
|
37
|
-
|
38
|
-
mail_to(email_address, html_options, &block)
|
39
|
-
else
|
40
|
-
mail_to(email_address, name, html_options)
|
41
|
-
end
|
31
|
+
link_to(button_text, href, **button_args)
|
42
32
|
end
|
43
33
|
|
44
|
-
def
|
45
|
-
|
46
|
-
html_options = {
|
47
|
-
data: { module: "govuk-button" }
|
48
|
-
}
|
49
|
-
|
50
|
-
if extra_options && extra_options[:prevent_double_click]
|
51
|
-
html_options[:data]["prevent-double-click"] = "true"
|
52
|
-
extra_options = extra_options.except(:prevent_double_click)
|
53
|
-
end
|
54
|
-
|
55
|
-
html_options.merge! build_html_options(extra_options, style: :button)
|
34
|
+
def govuk_breadcrumb_link_to(name, href = nil, **kwargs, &block)
|
35
|
+
link_args = { class: "#{brand}-breadcrumbs--link" }.deep_merge_html_attributes(kwargs)
|
56
36
|
|
57
37
|
if block_given?
|
58
|
-
|
38
|
+
link_to(block.call, href, **link_args)
|
59
39
|
else
|
60
|
-
|
40
|
+
link_to(name, href, **link_args)
|
61
41
|
end
|
62
42
|
end
|
63
43
|
|
64
|
-
def
|
65
|
-
|
66
|
-
|
67
|
-
data: { module: "#{brand}-button" },
|
68
|
-
draggable: 'false',
|
69
|
-
role: 'button',
|
70
|
-
}.merge build_html_options(extra_options, style: :button)
|
71
|
-
|
72
|
-
if block_given?
|
73
|
-
link_to(name, html_options, &block)
|
74
|
-
else
|
75
|
-
link_to(name, options, html_options)
|
44
|
+
def govuk_link_classes(inverse: false, muted: false, no_underline: false, no_visited_state: false, text_colour: false)
|
45
|
+
if [text_colour, inverse, muted].count(true) > 1
|
46
|
+
fail("links can be only be one of text_colour, inverse or muted")
|
76
47
|
end
|
77
|
-
end
|
78
48
|
|
79
|
-
|
80
|
-
|
81
|
-
|
49
|
+
class_names(
|
50
|
+
"#{brand}-link",
|
51
|
+
"#{brand}-link--inverse" => inverse,
|
52
|
+
"#{brand}-link--muted" => muted,
|
53
|
+
"#{brand}-link--no-underline" => no_underline,
|
54
|
+
"#{brand}-link--no-visited-state" => no_visited_state,
|
55
|
+
"#{brand}-link--text-colour" => text_colour,
|
56
|
+
)
|
57
|
+
end
|
82
58
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
link_to(name, options, html_options)
|
59
|
+
def govuk_button_classes(inverse: false, secondary: false, warning: false)
|
60
|
+
if [inverse, secondary, warning].count(true) > 1
|
61
|
+
fail("buttons can only be one of inverse, secondary or warning")
|
87
62
|
end
|
63
|
+
|
64
|
+
class_names(
|
65
|
+
"#{brand}-button",
|
66
|
+
"#{brand}-button--inverse" => inverse,
|
67
|
+
"#{brand}-button--secondary" => secondary,
|
68
|
+
"#{brand}-button--warning" => warning,
|
69
|
+
)
|
88
70
|
end
|
89
71
|
|
90
72
|
private
|
91
73
|
|
92
|
-
def
|
93
|
-
|
94
|
-
end
|
95
|
-
|
96
|
-
def link_styles
|
97
|
-
{
|
98
|
-
inverse: "#{brand}-link--inverse",
|
99
|
-
muted: "#{brand}-link--muted",
|
100
|
-
no_underline: "#{brand}-link--no-underline",
|
101
|
-
no_visited_state: "#{brand}-link--no-visited-state",
|
102
|
-
text_colour: "#{brand}-link--text-colour",
|
103
|
-
}
|
74
|
+
def new_tab_args(new_tab)
|
75
|
+
new_tab ? { target: "_blank", rel: "noreferrer noopener" } : {}
|
104
76
|
end
|
105
77
|
|
106
|
-
def
|
107
|
-
{
|
108
|
-
disabled: "#{brand}-button--disabled",
|
109
|
-
secondary: "#{brand}-button--secondary",
|
110
|
-
warning: "#{brand}-button--warning",
|
111
|
-
inverse: "#{brand}-button--inverse",
|
112
|
-
}
|
78
|
+
def button_attributes(disabled)
|
79
|
+
disabled ? { disabled: true, aria: { disabled: true } } : {}
|
113
80
|
end
|
114
81
|
|
115
|
-
def
|
116
|
-
|
82
|
+
def extract_link_args(new_tab: false, inverse: false, muted: false, no_underline: false, no_visited_state: false, text_colour: false, **kwargs)
|
83
|
+
link_classes = extract_link_classes(inverse: inverse, muted: muted, no_underline: no_underline, no_visited_state: no_visited_state, text_colour: text_colour)
|
117
84
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
remaining_options = remove_styles_from_provided_options(element_styles, provided_options)
|
85
|
+
{ **link_classes, **new_tab_args(new_tab) }.deep_merge_html_attributes(kwargs)
|
86
|
+
end
|
122
87
|
|
123
|
-
|
88
|
+
def extract_button_link_args(new_tab: false, disabled: false, inverse: false, secondary: false, warning: false, **kwargs)
|
89
|
+
button_classes = extract_button_classes(inverse: inverse, secondary: secondary, warning: warning)
|
124
90
|
|
125
|
-
|
91
|
+
{ **button_classes, **button_attributes(disabled), **new_tab_args(new_tab) }.deep_merge_html_attributes(kwargs)
|
126
92
|
end
|
127
93
|
|
128
|
-
def
|
129
|
-
|
94
|
+
def extract_button_args(disabled: false, inverse: false, secondary: false, warning: false, **kwargs)
|
95
|
+
button_classes = extract_button_classes(inverse: inverse, secondary: secondary, warning: warning)
|
130
96
|
|
131
|
-
|
132
|
-
when :link then govuk_link_classes(*keys)
|
133
|
-
when :button then govuk_button_classes(*keys)
|
134
|
-
when :breadcrumb then "#{brand}-breadcrumbs__link"
|
135
|
-
end
|
97
|
+
{ **button_classes, **button_attributes(disabled) }.deep_merge_html_attributes(kwargs)
|
136
98
|
end
|
137
99
|
|
138
|
-
def
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
100
|
+
def extract_link_classes(inverse: false, muted: false, no_underline: false, no_visited_state: false, text_colour: false)
|
101
|
+
{
|
102
|
+
class: govuk_link_classes(
|
103
|
+
inverse: inverse,
|
104
|
+
muted: muted,
|
105
|
+
no_underline: no_underline,
|
106
|
+
no_visited_state: no_visited_state,
|
107
|
+
text_colour: text_colour,
|
108
|
+
)
|
109
|
+
}
|
144
110
|
end
|
145
111
|
|
146
|
-
def
|
147
|
-
|
112
|
+
def extract_button_classes(inverse: false, secondary: false, warning: false)
|
113
|
+
{
|
114
|
+
class: govuk_button_classes(
|
115
|
+
inverse: inverse,
|
116
|
+
secondary: secondary,
|
117
|
+
warning: warning
|
118
|
+
)
|
119
|
+
}
|
120
|
+
end
|
148
121
|
|
149
|
-
|
122
|
+
def brand
|
123
|
+
Govuk::Components.brand
|
150
124
|
end
|
151
125
|
|
152
|
-
def
|
153
|
-
|
126
|
+
def build_text(original, visually_hidden_prefix:, visually_hidden_suffix:, &block)
|
127
|
+
prefix = (visually_hidden_prefix.present?) ? visually_hidden_prefix + " " : nil
|
128
|
+
text = (block_given?) ? block.call : original
|
129
|
+
suffix = (visually_hidden_suffix.present?) ? " " + visually_hidden_suffix : nil
|
154
130
|
|
155
|
-
|
131
|
+
safe_join([govuk_visually_hidden(prefix), text, govuk_visually_hidden(suffix)].compact)
|
156
132
|
end
|
157
133
|
end
|
158
134
|
|
@@ -0,0 +1,156 @@
|
|
1
|
+
require "html_attributes_utils"
|
2
|
+
|
3
|
+
module GovukRailsCompatibileLinkHelper
|
4
|
+
using HTMLAttributesUtils
|
5
|
+
|
6
|
+
def govuk_link_classes(*styles, default_class: "#{brand}-link")
|
7
|
+
if (invalid_styles = (styles - link_styles.keys)) && invalid_styles.any?
|
8
|
+
fail(ArgumentError, "invalid styles #{invalid_styles.to_sentence}. Valid styles are #{link_styles.keys.to_sentence}")
|
9
|
+
end
|
10
|
+
|
11
|
+
[default_class] + link_styles.values_at(*styles).compact
|
12
|
+
end
|
13
|
+
|
14
|
+
def govuk_button_classes(*styles, default_class: "#{brand}-button")
|
15
|
+
if (invalid_styles = (styles - button_styles.keys)) && invalid_styles.any?
|
16
|
+
fail(ArgumentError, "invalid styles #{invalid_styles.to_sentence}. Valid styles are #{button_styles.keys.to_sentence}")
|
17
|
+
end
|
18
|
+
|
19
|
+
[default_class] + button_styles.values_at(*styles).compact
|
20
|
+
end
|
21
|
+
|
22
|
+
def govuk_link_to(name = nil, options = nil, extra_options = {}, &block)
|
23
|
+
extra_options = options if block_given?
|
24
|
+
html_options = build_html_options(extra_options)
|
25
|
+
|
26
|
+
if block_given?
|
27
|
+
link_to(name, html_options, &block)
|
28
|
+
else
|
29
|
+
link_to(name, options, html_options)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def govuk_mail_to(email_address, name = nil, extra_options = {}, &block)
|
34
|
+
extra_options = name if block_given?
|
35
|
+
html_options = build_html_options(extra_options)
|
36
|
+
|
37
|
+
if block_given?
|
38
|
+
mail_to(email_address, html_options, &block)
|
39
|
+
else
|
40
|
+
mail_to(email_address, name, html_options)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def govuk_button_to(name = nil, options = nil, extra_options = {}, &block)
|
45
|
+
extra_options = options if block_given?
|
46
|
+
html_options = {
|
47
|
+
data: { module: "govuk-button" }
|
48
|
+
}
|
49
|
+
|
50
|
+
if extra_options && extra_options[:prevent_double_click]
|
51
|
+
html_options[:data]["prevent-double-click"] = "true"
|
52
|
+
extra_options = extra_options.except(:prevent_double_click)
|
53
|
+
end
|
54
|
+
|
55
|
+
html_options.merge! build_html_options(extra_options, style: :button)
|
56
|
+
|
57
|
+
if block_given?
|
58
|
+
button_to(options, html_options, &block)
|
59
|
+
else
|
60
|
+
button_to(name, options, html_options)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def govuk_button_link_to(name = nil, options = nil, extra_options = {}, &block)
|
65
|
+
extra_options = options if block_given?
|
66
|
+
html_options = {
|
67
|
+
data: { module: "#{brand}-button" },
|
68
|
+
draggable: 'false',
|
69
|
+
role: 'button',
|
70
|
+
}.merge build_html_options(extra_options, style: :button)
|
71
|
+
|
72
|
+
if block_given?
|
73
|
+
link_to(name, html_options, &block)
|
74
|
+
else
|
75
|
+
link_to(name, options, html_options)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def govuk_breadcrumb_link_to(name = nil, options = nil, extra_options = {}, &block)
|
80
|
+
extra_options = options if block_given?
|
81
|
+
html_options = build_html_options(extra_options, style: :breadcrumb)
|
82
|
+
|
83
|
+
if block_given?
|
84
|
+
link_to(name, html_options, &block)
|
85
|
+
else
|
86
|
+
link_to(name, options, html_options)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
private
|
91
|
+
|
92
|
+
def brand
|
93
|
+
Govuk::Components.brand
|
94
|
+
end
|
95
|
+
|
96
|
+
def link_styles
|
97
|
+
{
|
98
|
+
inverse: "#{brand}-link--inverse",
|
99
|
+
muted: "#{brand}-link--muted",
|
100
|
+
no_underline: "#{brand}-link--no-underline",
|
101
|
+
no_visited_state: "#{brand}-link--no-visited-state",
|
102
|
+
text_colour: "#{brand}-link--text-colour",
|
103
|
+
}
|
104
|
+
end
|
105
|
+
|
106
|
+
def button_styles
|
107
|
+
{
|
108
|
+
secondary: "#{brand}-button--secondary",
|
109
|
+
warning: "#{brand}-button--warning",
|
110
|
+
inverse: "#{brand}-button--inverse",
|
111
|
+
}
|
112
|
+
end
|
113
|
+
|
114
|
+
def build_html_options(provided_options, style: :link)
|
115
|
+
element_styles = { link: link_styles, button: button_styles }.fetch(style, {})
|
116
|
+
|
117
|
+
# we need to take a couple of extra steps here because we don't want the style
|
118
|
+
# params (inverse, muted, etc) to end up as extra attributes on the link.
|
119
|
+
|
120
|
+
remaining_options = remove_styles_from_provided_options(element_styles, provided_options)
|
121
|
+
|
122
|
+
style_classes = build_style_classes(style, extract_styles_from_provided_options(element_styles, provided_options))
|
123
|
+
|
124
|
+
combine_attributes(remaining_options, class_name: style_classes)
|
125
|
+
end
|
126
|
+
|
127
|
+
def build_style_classes(style, provided_options)
|
128
|
+
keys = *provided_options&.keys
|
129
|
+
|
130
|
+
case style
|
131
|
+
when :link then govuk_link_classes(*keys)
|
132
|
+
when :button then govuk_button_classes(*keys)
|
133
|
+
when :breadcrumb then "#{brand}-breadcrumbs__link"
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
def combine_attributes(attributes, class_name:)
|
138
|
+
attributes ||= {}
|
139
|
+
|
140
|
+
attributes.with_indifferent_access.tap do |attrs|
|
141
|
+
attrs[:class] = Array.wrap(attrs[:class]).prepend(class_name).flatten.join(" ")
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
def extract_styles_from_provided_options(styles, provided_options)
|
146
|
+
return {} if provided_options.blank?
|
147
|
+
|
148
|
+
provided_options.slice(*styles.keys)
|
149
|
+
end
|
150
|
+
|
151
|
+
def remove_styles_from_provided_options(styles, provided_options)
|
152
|
+
return {} if provided_options.blank?
|
153
|
+
|
154
|
+
provided_options&.except(*styles.keys)
|
155
|
+
end
|
156
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module GovukVisuallyHiddenHelper
|
2
|
+
def govuk_visually_hidden(text = nil, focusable: false, &block)
|
3
|
+
content = (block_given?) ? block.call : text
|
4
|
+
|
5
|
+
return if content.blank?
|
6
|
+
|
7
|
+
visually_hidden_class = focusable ? "govuk-visually-hidden-focusable" : "govuk-visually-hidden"
|
8
|
+
|
9
|
+
tag.span(content, class: visually_hidden_class)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
ActiveSupport.on_load(:action_view) { include GovukSkipLinkHelper }
|
@@ -47,14 +47,13 @@ module Govuk
|
|
47
47
|
# +:default_exit_this_page_press_one_more_time_text+ Text announced by screen readers when the user must press *Shift* one more time to activate the button. Default in govuk-frontend is 'Shift, press 1 more time to exit.' Defaults to nil so govuk-frontend value is used unless overridden.
|
48
48
|
# +:default_header_navigation_label+ 'Navigation menu'
|
49
49
|
# +:default_header_menu_button_label+ 'Show or hide navigation menu'
|
50
|
-
# +:default_header_logotype+ 'GOV.UK'
|
51
50
|
# +:default_header_homepage_url+ '/'
|
52
51
|
# +:default_header_service_name+ nil
|
53
52
|
# +:default_header_service_url+ '/'
|
54
53
|
# +:default_footer_meta_text+ nil
|
55
54
|
# +:default_footer_copyright_text+ '© Crown copyright'
|
56
55
|
# +:default_footer_copyright_url+ "https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/"
|
57
|
-
# +:default_pagination_landmark_label+ "
|
56
|
+
# +:default_pagination_landmark_label+ "Pagination"
|
58
57
|
# +:default_pagination_next_text+ Default 'next' text for pagination. An +Array+ where the first item is visible and the second visually hidden. Defaults to ["Next", "page"]
|
59
58
|
# +:default_pagination_previous_text+ Default 'previous' text for pagination. An +Array+ where the first item is visible and the second visually hidden. Defaults to ["Previous", "page"]
|
60
59
|
# +:default_phase_banner_tag+ nil
|
@@ -89,14 +88,13 @@ module Govuk
|
|
89
88
|
default_exit_this_page_press_one_more_time_text: nil,
|
90
89
|
default_header_navigation_label: 'Menu',
|
91
90
|
default_header_menu_button_label: 'Show or hide menu',
|
92
|
-
default_header_logotype: 'GOV.UK',
|
93
91
|
default_header_homepage_url: '/',
|
94
92
|
default_header_service_name: nil,
|
95
93
|
default_header_service_url: '/',
|
96
94
|
default_footer_meta_text: nil,
|
97
95
|
default_footer_copyright_text: '© Crown copyright',
|
98
96
|
default_footer_copyright_url: "https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/",
|
99
|
-
default_pagination_landmark_label: "
|
97
|
+
default_pagination_landmark_label: "Pagination",
|
100
98
|
default_pagination_next_text: %w(Next page),
|
101
99
|
default_pagination_previous_text: %w(Previous page),
|
102
100
|
default_phase_banner_tag: nil,
|
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: 5.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: 2023-11-
|
11
|
+
date: 2023-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: html-attributes-utils
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
version: '3.3'
|
54
54
|
- - "<"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: '3.
|
56
|
+
version: '3.8'
|
57
57
|
type: :runtime
|
58
58
|
prerelease: false
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -63,7 +63,7 @@ dependencies:
|
|
63
63
|
version: '3.3'
|
64
64
|
- - "<"
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: '3.
|
66
|
+
version: '3.8'
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
name: deep_merge
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -374,6 +374,10 @@ files:
|
|
374
374
|
- app/components/govuk_component/table_component/head_component.rb
|
375
375
|
- app/components/govuk_component/table_component/row_component.rb
|
376
376
|
- app/components/govuk_component/tag_component.rb
|
377
|
+
- app/components/govuk_component/task_list_component.rb
|
378
|
+
- app/components/govuk_component/task_list_component/item_component.rb
|
379
|
+
- app/components/govuk_component/task_list_component/status_component.rb
|
380
|
+
- app/components/govuk_component/task_list_component/title_component.rb
|
377
381
|
- app/components/govuk_component/traits.rb
|
378
382
|
- app/components/govuk_component/traits/custom_html_attributes.rb
|
379
383
|
- app/components/govuk_component/warning_text_component.rb
|
@@ -381,7 +385,9 @@ files:
|
|
381
385
|
- app/helpers/govuk_components_helper.rb
|
382
386
|
- app/helpers/govuk_exit_this_page_link_helper.rb
|
383
387
|
- app/helpers/govuk_link_helper.rb
|
388
|
+
- app/helpers/govuk_rails_compatibile_link_helper.rb
|
384
389
|
- app/helpers/govuk_skip_link_helper.rb
|
390
|
+
- app/helpers/govuk_visually_hidden_helper.rb
|
385
391
|
- app/helpers/title_with_error_prefix_helper.rb
|
386
392
|
- config/routes.rb
|
387
393
|
- lib/govuk/components.rb
|
@@ -404,9 +410,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
404
410
|
version: '0'
|
405
411
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
406
412
|
requirements:
|
407
|
-
- - "
|
413
|
+
- - ">"
|
408
414
|
- !ruby/object:Gem::Version
|
409
|
-
version:
|
415
|
+
version: 1.3.1
|
410
416
|
requirements: []
|
411
417
|
rubygems_version: 3.2.33
|
412
418
|
signing_key:
|