govuk_publishing_components 23.0.0 → 23.1.0
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/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +0 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +7 -1
- data/app/views/govuk_publishing_components/components/_print_link.html.erb +18 -11
- data/app/views/govuk_publishing_components/components/docs/print_link.yml +5 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20fcbde55a95f5ca3e7ac5744c94f69b573b563e9c5df919681864c6662dff16
|
4
|
+
data.tar.gz: 9d65b762cc90d4e8bfa3ba37b2c811778af94f55a3d88d0e45ca0ed7f0d0161a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10d6c20ed45850b0bc92826e009dd10d8cbc5a6e09368ad9822e33d97a7bf6b8b59b43c50b18cf630e109455df35e4b993b6c1e497d0eeb94adc2081b128da41
|
7
|
+
data.tar.gz: b3fdb29493b563ef3893f1c2d33f21feb2f9817d38952cff97091e6b318bd0d11c2ddd3c85ba08f0baf80560a30150651ed283fbaf06700b4045d161cb187740
|
@@ -36,7 +36,6 @@ $large-input-size: 50px;
|
|
36
36
|
|
37
37
|
.gem-c-search__input[type="search"] { // overly specific to prevent some overrides from outside
|
38
38
|
@include govuk-font($size: 19, $line-height: (28 / 19));
|
39
|
-
|
40
39
|
padding: 6px;
|
41
40
|
margin: 0;
|
42
41
|
width: 100%;
|
@@ -71,6 +70,13 @@ $large-input-size: 50px;
|
|
71
70
|
}
|
72
71
|
}
|
73
72
|
|
73
|
+
@include govuk-compatibility(govuk_template) {
|
74
|
+
// ultra specific rule overrides focus styling from govuk_template
|
75
|
+
#global-header .gem-c-search__input[type="search"]:focus { // stylelint-disable selector-max-id
|
76
|
+
@extend .gem-c-search__input[type="search"]:focus; // stylelint-disable scss/at-extend-no-missing-placeholder
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
74
80
|
.gem-c-search__submit {
|
75
81
|
border: 0;
|
76
82
|
cursor: pointer;
|
@@ -3,33 +3,40 @@
|
|
3
3
|
href ||= nil
|
4
4
|
data_attributes ||= {}
|
5
5
|
require_js ||= href.nil?
|
6
|
+
margin_top ||= 3
|
7
|
+
margin_bottom ||= 3
|
6
8
|
|
7
|
-
data_attributes[:module] =
|
9
|
+
data_attributes[:module] = require_js ? "print-link" : "button"
|
10
|
+
|
11
|
+
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new({
|
12
|
+
margin_top: margin_top,
|
13
|
+
margin_bottom: margin_bottom
|
14
|
+
})
|
15
|
+
|
16
|
+
wrapper_classes = %w(gem-c-print-link)
|
17
|
+
wrapper_classes << "gem-c-print-link--show-without-js" unless require_js
|
18
|
+
wrapper_classes << (shared_helper.get_margin_top)
|
19
|
+
wrapper_classes << (shared_helper.get_margin_bottom)
|
8
20
|
|
9
21
|
classes = %w(govuk-link)
|
10
22
|
classes << "gem-c-print-link__button" if href.nil?
|
11
23
|
classes << "gem-c-print-link__link govuk-link--no-visited-state" if href.present?
|
12
24
|
%>
|
13
25
|
|
14
|
-
|
15
|
-
|
26
|
+
<%= tag.div class: wrapper_classes do %>
|
27
|
+
<% if require_js %>
|
16
28
|
<%= content_tag(:button, text, {
|
17
29
|
class: classes,
|
18
30
|
data: data_attributes
|
19
31
|
}) %>
|
20
|
-
|
21
|
-
<% else %>
|
22
|
-
<div class="gem-c-print-link gem-c-print-link--show-without-js">
|
32
|
+
<% else %>
|
23
33
|
<%= link_to(
|
24
34
|
text,
|
25
35
|
href,
|
26
36
|
class: classes,
|
27
37
|
rel: "alternate",
|
28
38
|
data: data_attributes,
|
29
|
-
role: "button"
|
30
|
-
data: {
|
31
|
-
module: "button",
|
32
|
-
},
|
39
|
+
role: "button"
|
33
40
|
) %>
|
34
|
-
|
41
|
+
<% end %>
|
35
42
|
<% end %>
|
@@ -22,3 +22,8 @@ examples:
|
|
22
22
|
track-category: "printButton"
|
23
23
|
track-action: "clicked"
|
24
24
|
track-label: "Print this page"
|
25
|
+
with_custom_margins:
|
26
|
+
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 margin level 3 on top and bottom.
|
27
|
+
data:
|
28
|
+
margin_top: 0
|
29
|
+
margin_bottom: 4
|
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: 23.
|
4
|
+
version: 23.1.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-10-
|
11
|
+
date: 2020-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|