govuk_publishing_components 9.2.2 → 9.2.3
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/_all_components_print.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +8 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +19 -14
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_share-links.scss +3 -0
- data/app/views/govuk_publishing_components/components/_image_card.html.erb +4 -0
- data/app/views/govuk_publishing_components/components/_share_links.html.erb +4 -4
- data/app/views/govuk_publishing_components/components/docs/image_card.yml +17 -0
- data/app/views/govuk_publishing_components/components/docs/share_links.yml +6 -6
- data/lib/govuk_publishing_components/presenters/image_card_helper.rb +2 -1
- 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: 0fc6dff922e3390e5524bfb6f64add4318f4bd2060c3a887ee6b14cfdfd5c67c
|
4
|
+
data.tar.gz: f074caee44d79da8468a60979857911b2e3cabdf268ab6be5bb919fe31ce92e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb41b96036995bef9b65594c414bdb31452eca07c1dded3ad5d19817260bc6ddb5857f17023c1d800b1e817d57e4320da2ccfff7d116c4ad8f8e4259996f70ff
|
7
|
+
data.tar.gz: 7f5c8b126419fa13aa54a5751751d6bbee420b81fa4eca1e35021f239131b16b2f4f0076a5dfd6a54b29ceecb72c79ff658f54070f5516eff5580c92f69aa1ed
|
@@ -11,6 +11,7 @@
|
|
11
11
|
@import "components/print/feedback";
|
12
12
|
@import "components/print/govspeak-html-publication";
|
13
13
|
@import "components/print/govspeak";
|
14
|
+
@import "components/print/share-links";
|
14
15
|
@import "components/print/step-by-step-nav-header";
|
15
16
|
@import "components/print/step-by-step-nav";
|
16
17
|
@import "components/print/title";
|
@@ -36,6 +36,12 @@
|
|
36
36
|
}
|
37
37
|
|
38
38
|
.gem-c-image-card__title-link {
|
39
|
+
text-decoration: none;
|
40
|
+
|
41
|
+
&:hover {
|
42
|
+
text-decoration: underline;
|
43
|
+
}
|
44
|
+
|
39
45
|
// the after element extends the link to cover the image, removing the
|
40
46
|
// need for a duplicate link. Other elements apart from the image are given
|
41
47
|
// position relative and a higher z-index to put them above the after element
|
@@ -58,7 +64,8 @@
|
|
58
64
|
z-index: 2;
|
59
65
|
}
|
60
66
|
|
61
|
-
.gem-c-image-card__context
|
67
|
+
.gem-c-image-card__context,
|
68
|
+
.gem-c-image-card__metadata {
|
62
69
|
@include core-14;
|
63
70
|
color: $grey-1;
|
64
71
|
}
|
@@ -6,13 +6,18 @@ $share-button-height: 32px;
|
|
6
6
|
}
|
7
7
|
|
8
8
|
.gem-c-share-links__list-item {
|
9
|
+
@include box-sizing(border-box);
|
10
|
+
position: relative;
|
9
11
|
display: inline-block;
|
12
|
+
min-height: $share-button-height;
|
13
|
+
padding-top: $share-button-height / 8;
|
14
|
+
padding-left: ($share-button-width + $gutter-one-third);
|
10
15
|
margin-bottom: $gutter-one-third;
|
11
16
|
}
|
12
17
|
|
13
18
|
.gem-c-share-links__link {
|
19
|
+
@include bold-16;
|
14
20
|
margin-right: $gutter;
|
15
|
-
@include bold-16($line-height: $share-button-height, $line-height-640: $share-button-height);
|
16
21
|
text-decoration: none;
|
17
22
|
}
|
18
23
|
|
@@ -20,30 +25,30 @@ $share-button-height: 32px;
|
|
20
25
|
margin-bottom: $gutter-one-third;
|
21
26
|
}
|
22
27
|
|
23
|
-
.gem-c-share-
|
24
|
-
|
28
|
+
.gem-c-share-links__link-icon {
|
29
|
+
position: absolute;
|
30
|
+
top: 0;
|
31
|
+
left: 0;
|
25
32
|
width: $share-button-width;
|
26
33
|
height: $share-button-height;
|
27
|
-
margin-right: $gutter-one-third;
|
28
34
|
vertical-align: top;
|
29
35
|
}
|
30
36
|
|
31
37
|
.direction-rtl {
|
32
38
|
.gem-c-share-links__link {
|
33
|
-
// By changing the link to inline-block the browser
|
34
|
-
// calculates the icon and the text as a single run of text
|
35
|
-
// rather than two. When they are considered to be two runs
|
36
|
-
// the browser splits the first link, putting the text before
|
37
|
-
// the second link, and the icon after the second link.
|
38
39
|
display: inline-block;
|
39
40
|
margin-right: 0;
|
40
41
|
margin-left: $gutter;
|
42
|
+
}
|
43
|
+
|
44
|
+
.gem-c-share-links__list-item {
|
45
|
+
padding-left: 0;
|
46
|
+
padding-right: ($share-button-width + $gutter-one-third);
|
47
|
+
}
|
41
48
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
vertical-align: middle;
|
46
|
-
}
|
49
|
+
.gem-c-share-links__link-icon {
|
50
|
+
left: auto;
|
51
|
+
right: 0;
|
47
52
|
}
|
48
53
|
}
|
49
54
|
|
@@ -8,7 +8,7 @@
|
|
8
8
|
brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
|
9
9
|
%>
|
10
10
|
<% if links.any? %>
|
11
|
-
<div class="gem-c-share-links
|
11
|
+
<div class="gem-c-share-links <%= brand_helper.brand_class %> <%= 'gem-c-share-links--stacked' if stacked %>" data-module="track-click">
|
12
12
|
<% if title %>
|
13
13
|
<h2 class="gem-c-share-links__title"><%= title %></h2>
|
14
14
|
<% end %>
|
@@ -27,14 +27,14 @@
|
|
27
27
|
%>
|
28
28
|
<%= link_to link[:href],
|
29
29
|
target: "_blank",
|
30
|
-
rel: "noopener noreferrer",
|
30
|
+
rel: "noopener noreferrer external",
|
31
31
|
data: {
|
32
32
|
'track-category': 'social media',
|
33
33
|
'track-action': link[:icon],
|
34
34
|
'track-options': track_options
|
35
35
|
},
|
36
36
|
class: "gem-c-share-links__link #{brand_helper.color_class}" do %>
|
37
|
-
<span class="gem-c-share-
|
37
|
+
<span class="gem-c-share-links__link-icon">
|
38
38
|
<% if link[:icon] == 'facebook' %>
|
39
39
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">
|
40
40
|
<path fill="currentColor" d="M31.006 0H.993A.997.997 0 0 0 0 .993v30.014c0 .55.452.993.993.993h30.013a.998.998 0 0 0 .994-.993V.993A.999.999 0 0 0 31.006 0z"/>
|
@@ -66,7 +66,7 @@
|
|
66
66
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="9 9 32 32"><path fill="currentColor" d="M9 9h32v32H9V9z"/><path fill="#FFF" d="M12.84 14.12v19.2h5.76l5.76 5.76v-5.76h12.8v-19.2H12.84zm3.2 8.32H28.2V25H16.04v-2.56zm16 7.68h-16v-2.56h16v2.56zm1.92-10.24H16.04v-2.56h17.92v2.56z"/></svg>
|
67
67
|
|
68
68
|
<% end %>
|
69
|
-
</span
|
69
|
+
</span><%= link[:text] %><% end %>
|
70
70
|
</li>
|
71
71
|
<% end %>
|
72
72
|
</ul>
|
@@ -158,3 +158,20 @@ examples:
|
|
158
158
|
}
|
159
159
|
}
|
160
160
|
]
|
161
|
+
with_metadata:
|
162
|
+
description: Can be used for links to people pages to indicate payment type
|
163
|
+
data:
|
164
|
+
href: "/government/people/"
|
165
|
+
image_src: "http://placekitten.com/215/140"
|
166
|
+
image_alt: "some meaningful alt text please"
|
167
|
+
context: "The Rt Hon"
|
168
|
+
heading_text: "John Whiskers MP"
|
169
|
+
metadata: "Unpaid"
|
170
|
+
extra_links: [
|
171
|
+
{
|
172
|
+
text: "Minister for Cats",
|
173
|
+
href: "/government/ministers/"
|
174
|
+
}
|
175
|
+
]
|
176
|
+
extra_links_no_indent: true
|
177
|
+
|
@@ -126,14 +126,14 @@ examples:
|
|
126
126
|
text: 'Linkedin',
|
127
127
|
icon: 'linkedin'
|
128
128
|
},
|
129
|
-
{
|
130
|
-
href: '/youtube-share-link',
|
131
|
-
text: 'YouTube',
|
132
|
-
icon: 'youtube'
|
133
|
-
},
|
134
129
|
{
|
135
130
|
href: '/other-share-link',
|
136
|
-
text: 'Anything else',
|
131
|
+
text: 'Anything else that might be included that could have quite a long name',
|
137
132
|
icon: 'other'
|
138
133
|
},
|
134
|
+
{
|
135
|
+
href: '/youtube-share-link',
|
136
|
+
text: 'YouTube',
|
137
|
+
icon: 'youtube'
|
138
|
+
}
|
139
139
|
]
|
@@ -4,7 +4,7 @@ module GovukPublishingComponents
|
|
4
4
|
include ActionView::Helpers
|
5
5
|
include ActionView::Context
|
6
6
|
|
7
|
-
attr_reader :href, :href_data_attributes, :extra_links, :large, :extra_links_no_indent, :heading_text
|
7
|
+
attr_reader :href, :href_data_attributes, :extra_links, :large, :extra_links_no_indent, :heading_text, :metadata
|
8
8
|
|
9
9
|
def initialize(local_assigns)
|
10
10
|
@href = local_assigns[:href]
|
@@ -18,6 +18,7 @@ module GovukPublishingComponents
|
|
18
18
|
@heading_text = local_assigns[:heading_text]
|
19
19
|
@heading_level = local_assigns[:heading_level]
|
20
20
|
@extra_links_no_indent = local_assigns[:extra_links_no_indent]
|
21
|
+
@metadata = local_assigns[:metadata]
|
21
22
|
end
|
22
23
|
|
23
24
|
def is_tracking?
|
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: 9.2.
|
4
|
+
version: 9.2.3
|
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: 2018-06-
|
11
|
+
date: 2018-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|
@@ -397,6 +397,7 @@ files:
|
|
397
397
|
- app/assets/stylesheets/govuk_publishing_components/components/print/_feedback.scss
|
398
398
|
- app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak-html-publication.scss
|
399
399
|
- app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss
|
400
|
+
- app/assets/stylesheets/govuk_publishing_components/components/print/_share-links.scss
|
400
401
|
- app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav-header.scss
|
401
402
|
- app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss
|
402
403
|
- app/assets/stylesheets/govuk_publishing_components/components/print/_title.scss
|