govuk_publishing_components 23.0.0 → 23.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a8babc3aada8e54a5f1f5b5af0c1806df1dbebb0d0905d259ae826a0d17b58a
4
- data.tar.gz: '09903013a6e5a36e5ea2c732b0c12e33c73a4decd7f509ba54c2257257c465c8'
3
+ metadata.gz: 20fcbde55a95f5ca3e7ac5744c94f69b573b563e9c5df919681864c6662dff16
4
+ data.tar.gz: 9d65b762cc90d4e8bfa3ba37b2c811778af94f55a3d88d0e45ca0ed7f0d0161a
5
5
  SHA512:
6
- metadata.gz: b192ee804bbf98365593eacdf0eeaaa99d47050421777d1ed5d70305ecd7adcbf74ff52b6234325c204a099cbd9288fcd78921f906701c0447676e91d79f025d
7
- data.tar.gz: 8e31289db6b9f096191eed89dce37599edc713f8c4b5c78661fbd030ca370b6f83648ae8dc651265aa8dc2e3a4e3ceef7361f6b08cd59b1d73c1eb78d54c08c9
6
+ metadata.gz: 10d6c20ed45850b0bc92826e009dd10d8cbc5a6e09368ad9822e33d97a7bf6b8b59b43c50b18cf630e109455df35e4b993b6c1e497d0eeb94adc2081b128da41
7
+ data.tar.gz: b3fdb29493b563ef3893f1c2d33f21feb2f9817d38952cff97091e6b318bd0d11c2ddd3c85ba08f0baf80560a30150651ed283fbaf06700b4045d161cb187740
@@ -3,8 +3,6 @@ $gem-c-print-link-background-height: 18px;
3
3
 
4
4
  .gem-c-print-link {
5
5
  display: none;
6
- margin-bottom: 2em;
7
- margin-top: 2em;
8
6
  }
9
7
 
10
8
  .gem-c-print-link.gem-c-print-link--show-without-js {
@@ -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] = 'print-link' if require_js
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
- <% if require_js %>
15
- <div class="gem-c-print-link" >
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
- </div>
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
- </div>
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
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "23.0.0".freeze
2
+ VERSION = "23.1.0".freeze
3
3
  end
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.0.0
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-26 00:00:00.000000000 Z
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