govuk_publishing_components 21.55.4 → 21.56.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/govuk_publishing_components/component_support.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_summary-list.scss +18 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_link.scss +17 -0
- data/app/views/govuk_publishing_components/components/_summary_list.html.erb +34 -14
- data/app/views/govuk_publishing_components/components/docs/summary_list.yml +27 -0
- data/config/locales/en.yml +3 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3773fbe78d9426cfe8fc0d8356057ac637399673ed546c07eb436a3500e4728a
|
4
|
+
data.tar.gz: dafffb370895b4a7d26cba3e3ebe5b0345d178f3e32e3c3a1e3c1f4370ce71a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25c2b1ec246ffc2315f37dd9cc929f42404ed1c338e5e80f927ae045785f501af00537463ca6d91e6559dab5f265bf2d482eaed337412c47bf361a7f213fe3db
|
7
|
+
data.tar.gz: 462df79e0ff9bf3dad96caf7d10f594ae6049c96b145b0c7f8788fedc75995f9f71689ca93d7bbb2eefd4f78e7f00aebf7cff77f60fe19b0a350c0ccbddede07
|
@@ -8,6 +8,7 @@
|
|
8
8
|
|
9
9
|
@import "govuk_publishing_components/components/helpers/variables";
|
10
10
|
@import "govuk_publishing_components/components/helpers/brand-colours";
|
11
|
+
@import "govuk_publishing_components/components/helpers/link";
|
11
12
|
@import "govuk_publishing_components/components/mixins/govuk-template-link-focus-override";
|
12
13
|
@import "govuk_publishing_components/components/mixins/media-down";
|
13
14
|
@import "govuk_publishing_components/components/mixins/margins";
|
@@ -1,7 +1,6 @@
|
|
1
1
|
@import "govuk/components/summary-list/summary-list";
|
2
2
|
|
3
3
|
.gem-c-summary-list {
|
4
|
-
position: relative;
|
5
4
|
border-bottom: 1px solid $govuk-border-colour;
|
6
5
|
|
7
6
|
@include govuk-font(19);
|
@@ -14,12 +13,26 @@
|
|
14
13
|
&:nth-last-of-type(1) {
|
15
14
|
border-bottom: 0;
|
16
15
|
}
|
16
|
+
|
17
|
+
.govuk-summary-list {
|
18
|
+
clear: both;
|
19
|
+
}
|
17
20
|
}
|
18
21
|
|
19
|
-
.gem-c-summary-
|
20
|
-
|
21
|
-
|
22
|
-
|
22
|
+
.gem-c-summary-list__group-title {
|
23
|
+
@include govuk-media-query($from: tablet) {
|
24
|
+
display: inline-block;
|
25
|
+
margin-right: govuk-spacing(3);
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
.gem-c-summary-list__group-actions-list {
|
30
|
+
margin-bottom: govuk-spacing(3);
|
31
|
+
|
32
|
+
@include govuk-media-query($from: tablet) {
|
33
|
+
float: right;
|
34
|
+
width: auto;
|
35
|
+
}
|
23
36
|
}
|
24
37
|
|
25
38
|
.gem-c-summary__block {
|
@@ -0,0 +1,17 @@
|
|
1
|
+
.gem-link--destructive {
|
2
|
+
@include govuk-font(19);
|
3
|
+
|
4
|
+
&:link {
|
5
|
+
color: $govuk-error-colour;
|
6
|
+
}
|
7
|
+
|
8
|
+
&:visited,
|
9
|
+
&:hover,
|
10
|
+
&:active {
|
11
|
+
color: darken($govuk-error-colour, 5%);
|
12
|
+
}
|
13
|
+
|
14
|
+
&:focus {
|
15
|
+
color: $govuk-focus-text-colour;
|
16
|
+
}
|
17
|
+
}
|
@@ -1,23 +1,42 @@
|
|
1
1
|
<%
|
2
|
+
local_assigns[:heading_level] ||= 3
|
3
|
+
heading_size = 'm' unless ['s', 'm', 'l', 'xl'].include?(heading_size)
|
4
|
+
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
5
|
+
|
2
6
|
id ||= nil
|
3
7
|
title ||= nil
|
4
8
|
borderless ||= false
|
5
9
|
edit ||= {}
|
10
|
+
delete ||= {}
|
6
11
|
items ||= []
|
7
12
|
block ||= yield
|
8
13
|
%>
|
9
14
|
<% if title || items.any? %>
|
10
15
|
<%= tag.div class: "gem-c-summary-list #{"govuk-summary-list--no-border" if borderless}", id: id do %>
|
11
16
|
<% if title %>
|
12
|
-
<%=
|
13
|
-
<% if edit.any? %>
|
14
|
-
<%= tag.ul class: "govuk-summary-list__actions-list" do %>
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
<%= content_tag(shared_helper.get_heading_level, title, class: "govuk-heading-#{heading_size} gem-c-summary-list__group-title") %>
|
18
|
+
<% if edit.any? || delete.any? %>
|
19
|
+
<%= tag.ul class: "govuk-summary-list__actions-list gem-c-summary-list__group-actions-list" do %>
|
20
|
+
<%- if edit.any? %>
|
21
|
+
<% edit_section_link_text = edit[:link_text] || t("components.summary_list.edit") %>
|
22
|
+
<%= tag.li class: "govuk-summary-list__actions-list-item" do -%>
|
23
|
+
<%= link_to edit.fetch(:href),
|
24
|
+
class: "govuk-link",
|
25
|
+
title: "#{edit_section_link_text} #{title}",
|
26
|
+
data: edit.fetch(:data_attributes, {}) do %>
|
27
|
+
<%= edit_section_link_text %><%= tag.span " #{title}", class: "govuk-visually-hidden" -%>
|
28
|
+
<% end %>
|
29
|
+
<% end %>
|
30
|
+
<% end %>
|
31
|
+
<% if delete.any? %>
|
32
|
+
<% delete_section_link_text = delete[:link_text] || t("components.summary_list.delete") %>
|
33
|
+
<%= tag.li class: "govuk-summary-list__actions-list-item" do -%>
|
34
|
+
<%= link_to delete.fetch(:href),
|
35
|
+
class: "govuk-link gem-link--destructive",
|
36
|
+
title: "#{delete_section_link_text} #{title}",
|
37
|
+
data: delete.fetch(:data_attributes, {}) do %>
|
38
|
+
<%= delete_section_link_text %><%= tag.span " #{title}", class: "govuk-visually-hidden" -%>
|
39
|
+
<% end %>
|
21
40
|
<% end %>
|
22
41
|
<% end %>
|
23
42
|
<% end %>
|
@@ -37,22 +56,23 @@
|
|
37
56
|
<%= tag.ul class: "govuk-summary-list__actions-list" do %>
|
38
57
|
<% if item.fetch(:edit, {}).any? %>
|
39
58
|
<%= tag.li class: "govuk-summary-list__actions-list-item" do %>
|
40
|
-
<% edit_link_text = item[:edit][:link_text] || "
|
59
|
+
<% edit_link_text = item[:edit][:link_text] || t("components.summary_list.edit") %>
|
41
60
|
<%= link_to item[:edit].fetch(:href),
|
42
61
|
class: "govuk-link",
|
43
62
|
title: "#{edit_link_text} #{item[:field]}",
|
44
63
|
data: item[:edit].fetch(:data_attributes, {}) do %>
|
45
|
-
<%= edit_link_text %><%= tag.span " #{item[:field]}", class: "govuk-visually-hidden"
|
64
|
+
<%= edit_link_text %><%= tag.span " #{item[:field]}", class: "govuk-visually-hidden" -%>
|
65
|
+
<% end %>
|
46
66
|
<% end %>
|
47
67
|
<% end %>
|
48
68
|
<% if item.fetch(:delete, {}).any? %>
|
49
69
|
<%= tag.li class: "govuk-summary-list__actions-list-item" do %>
|
50
|
-
<% delete_link_text = item[:delete][:link_text] || "
|
70
|
+
<% delete_link_text = item[:delete][:link_text] || t("components.summary_list.delete") %>
|
51
71
|
<%= link_to item[:delete].fetch(:href),
|
52
|
-
class: "govuk-link",
|
72
|
+
class: "govuk-link gem-link--destructive",
|
53
73
|
title: "#{delete_link_text} #{item[:field]}",
|
54
74
|
data: item[:delete].fetch(:data_attributes, {}) do %>
|
55
|
-
<%= delete_link_text %><%= tag.span " #{item[:field]}", class: "govuk-visually-hidden"
|
75
|
+
<%= delete_link_text %><%= tag.span " #{item[:field]}", class: "govuk-visually-hidden" -%>
|
56
76
|
<% end %>
|
57
77
|
<% end %>
|
58
78
|
<% end %>
|
@@ -1,5 +1,6 @@
|
|
1
1
|
name: Summary list
|
2
2
|
description: Use the summary list to summarise information, for example, a user’s responses at the end of a form.
|
3
|
+
body: This component extends the [Summary list component in the Design System](https://design-system.service.gov.uk/components/summary-list/) allowing the rendering of multiple groups of lists, and actions at the group level.
|
3
4
|
accessibility_criteria: |
|
4
5
|
Action links in the component must:
|
5
6
|
|
@@ -41,6 +42,32 @@ examples:
|
|
41
42
|
data_attributes:
|
42
43
|
gtm: "edit-title-summary-body"
|
43
44
|
|
45
|
+
with_delete_on_section:
|
46
|
+
data:
|
47
|
+
<<: *default-example-data
|
48
|
+
delete:
|
49
|
+
href: "delete-title-summary-body"
|
50
|
+
data_attributes:
|
51
|
+
gtm: "delete-title-summary-body"
|
52
|
+
|
53
|
+
with_edit_and_delete_on_section:
|
54
|
+
data:
|
55
|
+
<<: *default-example-data
|
56
|
+
edit:
|
57
|
+
href: "edit-title-summary-body"
|
58
|
+
data_attributes:
|
59
|
+
gtm: "edit-title-summary-body"
|
60
|
+
delete:
|
61
|
+
href: "delete-title-summary-body"
|
62
|
+
data_attributes:
|
63
|
+
gtm: "delete-title-summary-body"
|
64
|
+
|
65
|
+
with_custom_section_heading:
|
66
|
+
data:
|
67
|
+
<<: *default-example-data
|
68
|
+
heading_level: 2
|
69
|
+
heading_size: l
|
70
|
+
|
44
71
|
with_custom_link_on_section:
|
45
72
|
description: |
|
46
73
|
Take care that the provided `link_text` still makes sense to screen readers when combined with the title.
|
data/config/locales/en.yml
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_publishing_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 21.
|
4
|
+
version: 21.56.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gds-api-adapters
|
@@ -548,6 +548,7 @@ files:
|
|
548
548
|
- app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss
|
549
549
|
- app/assets/stylesheets/govuk_publishing_components/components/helpers/_contents-list-helper.scss
|
550
550
|
- app/assets/stylesheets/govuk_publishing_components/components/helpers/_govuk-frontend-settings.scss
|
551
|
+
- app/assets/stylesheets/govuk_publishing_components/components/helpers/_link.scss
|
551
552
|
- app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss
|
552
553
|
- app/assets/stylesheets/govuk_publishing_components/components/helpers/_px-to-em.scss
|
553
554
|
- app/assets/stylesheets/govuk_publishing_components/components/helpers/_variables.scss
|