govuk_publishing_components 27.19.0 → 27.20.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/_all_components.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_signup-link.scss +34 -0
- data/app/views/govuk_publishing_components/components/_signup_link.html.erb +30 -0
- data/app/views/govuk_publishing_components/components/docs/signup_link.yml +39 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abe5f80412062a42d0581b1137f85d3c6932cb23e20d840d08a345b642133e65
|
4
|
+
data.tar.gz: 6b46ff356ab253ec47fb4ed7d67f4cd8b40c0024bedf4511e03e4416b2ee519d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92c367ffdd7fc084e3b68fac798c1e1e51f3c37b361e6003c877b4c8839c40eaecb98ecbf20e5d65de3fe1aa8926167c557d6ef767516d3d9deacc64f32113c4
|
7
|
+
data.tar.gz: 971c347b11fdb3d12302e44deaa3bb77406b6b76d15c78e4af44c415b950aabfa688a1e9708de04eea09bf274b0484c30c27c2917392d862a1af10b013549380
|
@@ -68,6 +68,7 @@ $govuk-new-link-styles: true;
|
|
68
68
|
@import "components/select";
|
69
69
|
@import "components/share-links";
|
70
70
|
@import "components/show-password";
|
71
|
+
@import "components/signup-link";
|
71
72
|
@import "components/single-page-notification-button";
|
72
73
|
@import "components/skip-link";
|
73
74
|
@import "components/step-by-step-nav-header";
|
@@ -0,0 +1,34 @@
|
|
1
|
+
.gem-c-signup-link__link {
|
2
|
+
@include govuk-font($size: 19);
|
3
|
+
}
|
4
|
+
|
5
|
+
.gem-c-signup-link__inner {
|
6
|
+
position: relative;
|
7
|
+
}
|
8
|
+
|
9
|
+
.gem-c-signup-link__icon {
|
10
|
+
position: absolute;
|
11
|
+
|
12
|
+
@include govuk-media-query($from: tablet) {
|
13
|
+
top: 2px;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
.gem-c-signup-link__title {
|
18
|
+
margin-bottom: govuk-spacing(2);
|
19
|
+
margin-left: govuk-spacing(5);
|
20
|
+
}
|
21
|
+
|
22
|
+
.gem-c-signup-link--with-background-and-border {
|
23
|
+
padding: govuk-spacing(6);
|
24
|
+
background-color: govuk-colour("light-grey");
|
25
|
+
border: 1px solid $govuk-border-colour;
|
26
|
+
}
|
27
|
+
|
28
|
+
.gem-c-signup-link--link-only .gem-c-signup-link__link {
|
29
|
+
display: inline-block;
|
30
|
+
vertical-align: top;
|
31
|
+
font-weight: bold;
|
32
|
+
margin-left: govuk-spacing(5);
|
33
|
+
margin-bottom: 0;
|
34
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<%
|
2
|
+
local_assigns[:heading_level] ||= 3
|
3
|
+
local_assigns[:margin_bottom] ||= 0
|
4
|
+
link_text ||= false
|
5
|
+
link_href ||= false
|
6
|
+
heading ||= false
|
7
|
+
background ||= false
|
8
|
+
data ||= false
|
9
|
+
|
10
|
+
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
11
|
+
|
12
|
+
classes = %w(gem-c-signup-link govuk-!-display-none-print)
|
13
|
+
classes << shared_helper.get_margin_bottom
|
14
|
+
classes << "gem-c-signup-link--link-only" unless heading
|
15
|
+
classes << "gem-c-signup-link--with-background-and-border" if background
|
16
|
+
%>
|
17
|
+
<% if link_text && link_href %>
|
18
|
+
<div class="<%= classes.join(' ') %>">
|
19
|
+
<div class="gem-c-signup-link__inner govuk-width-container">
|
20
|
+
<svg class="gem-c-signup-link__icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 459.334 459.334">
|
21
|
+
<path fill="black" d="M177.216 404.514c-.001.12-.009.239-.009.359 0 30.078 24.383 54.461 54.461 54.461s54.461-24.383 54.461-54.461c0-.12-.008-.239-.009-.359H175.216zM403.549 336.438l-49.015-72.002v-89.83c0-60.581-43.144-111.079-100.381-122.459V24.485C254.152 10.963 243.19 0 229.667 0s-24.485 10.963-24.485 24.485v27.663c-57.237 11.381-100.381 61.879-100.381 122.459v89.83l-49.015 72.002a24.76 24.76 0 0 0 20.468 38.693H383.08a24.761 24.761 0 0 0 20.469-38.694z"/>
|
22
|
+
</svg>
|
23
|
+
<%= content_tag(shared_helper.get_heading_level, heading, class: "govuk-heading-s gem-c-signup-link__title") if heading %>
|
24
|
+
<%= link_to( link_text, link_href, {
|
25
|
+
class: "govuk-link gem-c-signup-link__link",
|
26
|
+
data: data
|
27
|
+
}) %>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
<% end %>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
name: Signup link
|
2
|
+
description: Renders a box with a link to sign up for email notifications
|
3
|
+
accessibility_criteria: |
|
4
|
+
- the component must use the correct heading level for the page
|
5
|
+
- text should have a text contrast ratio higher than 4.5:1 against the background colour to meet WCAG AA
|
6
|
+
- the icon must not be focusable or shown to screenreaders
|
7
|
+
shared_accessibility_criteria:
|
8
|
+
- link
|
9
|
+
examples:
|
10
|
+
default:
|
11
|
+
data:
|
12
|
+
heading: 'Sign up for email notifications'
|
13
|
+
link_text: 'Click right here to sign up!!'
|
14
|
+
link_href: '/this-signs-you-up'
|
15
|
+
with_background_and_border:
|
16
|
+
data:
|
17
|
+
heading: 'Sign up for email notifications'
|
18
|
+
link_text: 'Click right here to sign up!!'
|
19
|
+
link_href: '/this-signs-you-up'
|
20
|
+
background: true
|
21
|
+
link_only:
|
22
|
+
description: If no heading text is passed through, a more compact, link only version is rendered.
|
23
|
+
data:
|
24
|
+
link_text: 'Click right here to sign up!!'
|
25
|
+
link_href: '/this-signs-you-up'
|
26
|
+
with_custom_margin_bottom:
|
27
|
+
description: The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having no margin bottom.
|
28
|
+
data:
|
29
|
+
heading: 'Sign up for email notifications'
|
30
|
+
link_text: 'Click right here to sign up!!'
|
31
|
+
link_href: '/this-signs-you-up'
|
32
|
+
margin_bottom: 8
|
33
|
+
with_custom_heading_level:
|
34
|
+
description: Override default heading level by passing through `heading_level` parameter (defaults to `h3`).
|
35
|
+
data:
|
36
|
+
heading: 'Sign up for email notifications'
|
37
|
+
link_text: 'Click right here to sign up!!'
|
38
|
+
link_href: '/this-signs-you-up'
|
39
|
+
heading_level: 1
|
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: 27.
|
4
|
+
version: 27.20.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: 2021-12-
|
11
|
+
date: 2021-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|
@@ -597,6 +597,7 @@ files:
|
|
597
597
|
- app/assets/stylesheets/govuk_publishing_components/components/_select.scss
|
598
598
|
- app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss
|
599
599
|
- app/assets/stylesheets/govuk_publishing_components/components/_show-password.scss
|
600
|
+
- app/assets/stylesheets/govuk_publishing_components/components/_signup-link.scss
|
600
601
|
- app/assets/stylesheets/govuk_publishing_components/components/_single-page-notification-button.scss
|
601
602
|
- app/assets/stylesheets/govuk_publishing_components/components/_skip-link.scss
|
602
603
|
- app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss
|
@@ -744,6 +745,7 @@ files:
|
|
744
745
|
- app/views/govuk_publishing_components/components/_select.html.erb
|
745
746
|
- app/views/govuk_publishing_components/components/_share_links.html.erb
|
746
747
|
- app/views/govuk_publishing_components/components/_show_password.html.erb
|
748
|
+
- app/views/govuk_publishing_components/components/_signup_link.html.erb
|
747
749
|
- app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb
|
748
750
|
- app/views/govuk_publishing_components/components/_skip_link.html.erb
|
749
751
|
- app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb
|
@@ -829,6 +831,7 @@ files:
|
|
829
831
|
- app/views/govuk_publishing_components/components/docs/select.yml
|
830
832
|
- app/views/govuk_publishing_components/components/docs/share_links.yml
|
831
833
|
- app/views/govuk_publishing_components/components/docs/show_password.yml
|
834
|
+
- app/views/govuk_publishing_components/components/docs/signup_link.yml
|
832
835
|
- app/views/govuk_publishing_components/components/docs/single_page_notification_button.yml
|
833
836
|
- app/views/govuk_publishing_components/components/docs/skip_link.yml
|
834
837
|
- app/views/govuk_publishing_components/components/docs/step_by_step_nav.yml
|