govuk_publishing_components 21.5.0 → 21.6.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.
Files changed (23) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/govuk_publishing_components_manifest.js +1 -0
  3. data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +4 -0
  4. data/app/assets/stylesheets/govuk_publishing_components/_all_components_print.scss +11 -0
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +13 -0
  6. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +3 -3
  7. data/app/assets/stylesheets/govuk_publishing_components/components/print/_attachment.scss +3 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/components/print/_back-link.scss +3 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/print/_button.scss +12 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-footer.scss +6 -0
  11. data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-header.scss +3 -0
  12. data/app/assets/stylesheets/govuk_publishing_components/components/print/_metadata.scss +6 -0
  13. data/app/assets/stylesheets/govuk_publishing_components/components/print/_search.scss +3 -0
  14. data/app/assets/stylesheets/govuk_publishing_components/components/print/_skip-link.scss +3 -0
  15. data/app/assets/stylesheets/govuk_publishing_components/components/print/_subscription-links.scss +3 -0
  16. data/app/assets/stylesheets/govuk_publishing_components/components/print/_textarea.scss +13 -0
  17. data/app/assets/stylesheets/govuk_publishing_components/components/print/_translation-nav.scss +3 -0
  18. data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +1 -0
  19. data/app/views/govuk_publishing_components/components/_translation-nav.html.erb +1 -1
  20. data/app/views/govuk_publishing_components/components/docs/translation-nav.yml +27 -0
  21. data/lib/govuk_publishing_components/presenters/translation_nav_helper.rb +13 -1
  22. data/lib/govuk_publishing_components/version.rb +1 -1
  23. metadata +29 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a151a55dd93bf0dc6978eae16dfd6e4fc5b261de579dfa0a940eea3aa5cbb91
4
- data.tar.gz: 5b10dd771a7caf700747044981f71b818f22dc1393115c0535c41df5501d432d
3
+ metadata.gz: d1e7477bf9b4230069cb4ec962a278f7aade80da096685bdfd0cd079f8f9d340
4
+ data.tar.gz: 18813fe7d35957ba3570559316b2a011d7aa9a6957a91170d0270d60388ed727
5
5
  SHA512:
6
- metadata.gz: 67260c1a1ca4009a8eaf0f6e93368809e9e7be1c219eccb645f24d725743087b4d6c1beee607e8aff886546e51e9bfce212abd4bab40aff1d861a6bd3a95bd7c
7
- data.tar.gz: 27d04b9134b33a4106a9c6419424b0b865eb53fc399a170e5121e995d80b51c21d99fafd3fce4ee443b08c948e9e1d40696989b722620c9e32bb8681ba3d0fea
6
+ metadata.gz: 06fe4261e01378ca8423241d629157cfee60076a64287d668215601b8824ba4f3404be8dc181104e0292c4117a9b7d9366d70815c0e0f8eafdece4c693ac4fa9
7
+ data.tar.gz: a2584989288a53159c7c87116818e5c0835f1f637e0f2a1d1e0be73e0383b44cf38cac4e454c6b77ede4631dc8c742bd2560e2e8932aab614789da92f05a55a6
@@ -1,2 +1,3 @@
1
+ // JS and CSS bundles for the gem
1
2
  //= link_directory ../javascripts/govuk_publishing_components .js
2
3
  //= link_directory ../stylesheets/govuk_publishing_components .css
@@ -50,7 +50,11 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
50
50
  if (!window.GOVUK.cookie('cookie_policy')) {
51
51
  window.GOVUK.setDefaultConsentCookie()
52
52
  }
53
+ } else {
54
+ this.$module.style.display = 'none'
53
55
  }
56
+ } else {
57
+ this.$module.style.display = 'none'
54
58
  }
55
59
  }
56
60
 
@@ -4,11 +4,22 @@
4
4
  @import "components/helpers/govuk-frontend-settings";
5
5
 
6
6
  @import "components/print/accordion";
7
+ @import "components/print/attachment";
8
+ @import "components/print/back-link";
9
+ @import "components/print/button";
7
10
  @import "components/print/contents-list";
8
11
  @import "components/print/feedback";
9
12
  @import "components/print/govspeak-html-publication";
10
13
  @import "components/print/govspeak";
14
+ @import "components/print/layout-header";
15
+ @import "components/print/layout-footer";
16
+ @import "components/print/metadata";
17
+ @import "components/print/search";
11
18
  @import "components/print/share-links";
19
+ @import "components/print/skip-link";
12
20
  @import "components/print/step-by-step-nav-header";
13
21
  @import "components/print/step-by-step-nav";
22
+ @import "components/print/subscription-links";
23
+ @import "components/print/textarea";
14
24
  @import "components/print/title";
25
+ @import "components/print/translation-nav";
@@ -34,6 +34,19 @@
34
34
  @extend %govuk-link;
35
35
  }
36
36
 
37
+ .gem-c-translation-nav--inverse {
38
+ border-color: govuk-colour("white");
39
+
40
+ .gem-c-translation-nav__list-item,
41
+ .gem-c-translation-nav__link {
42
+ color: govuk-colour("white");
43
+
44
+ &:focus {
45
+ color: govuk-colour("black");
46
+ }
47
+ }
48
+ }
49
+
37
50
  .gem-c-translation-nav__list-item:last-child {
38
51
  border-right: 0;
39
52
  border-left: 0;
@@ -15,7 +15,7 @@
15
15
 
16
16
  &:hover,
17
17
  &:focus {
18
- color: govuk-colour("black");
18
+ color: $govuk-focus-text-colour;
19
19
  }
20
20
  }
21
21
 
@@ -46,7 +46,7 @@
46
46
 
47
47
  &:hover,
48
48
  &:focus {
49
- color: darken(govuk-organisation-colour("office-of-the-leader-of-the-house-of-commons"), 10%);
49
+ color: $govuk-focus-text-colour;
50
50
  }
51
51
  }
52
52
 
@@ -70,7 +70,7 @@
70
70
 
71
71
  &:hover,
72
72
  &:focus {
73
- color: darken(govuk-colour("bright-purple"), 10%);
73
+ color: $govuk-focus-text-colour;
74
74
  }
75
75
  }
76
76
 
@@ -0,0 +1,3 @@
1
+ .gem-c-attachment__thumbnail-image {
2
+ display: none;
3
+ }
@@ -0,0 +1,12 @@
1
+ .gem-c-button {
2
+ @include govuk-font(14);
3
+ display: inline-block;
4
+ padding: govuk-spacing(1);
5
+ border: solid 1px govuk-colour("black");
6
+ color: $govuk-text-colour;
7
+ text-decoration: none;
8
+ }
9
+
10
+ .govuk-button__start-icon {
11
+ display: none;
12
+ }
@@ -0,0 +1,6 @@
1
+ .gem-c-layout-footer {
2
+ .govuk-footer__inline-list,
3
+ .govuk-footer__section {
4
+ display: none;
5
+ }
6
+ }
@@ -0,0 +1,3 @@
1
+ .gem-c-header__menu-button {
2
+ display: none;
3
+ }
@@ -0,0 +1,6 @@
1
+ .gem-c-metadata {
2
+ .gem-c-metadata__definition-link,
3
+ .gem-c-metadata__toggle-wrap {
4
+ display: none;
5
+ }
6
+ }
@@ -0,0 +1,3 @@
1
+ .gem-c-subscription-links {
2
+ display: none;
3
+ }
@@ -0,0 +1,13 @@
1
+ .gem-c-textarea {
2
+ .gem-c-label,
3
+ .gem-c-error-message,
4
+ .govuk-hint,
5
+ .govuk-character-count__message {
6
+ display: block;
7
+ }
8
+
9
+ .govuk-textarea {
10
+ width: 400px;
11
+ height: 40px;
12
+ }
13
+ }
@@ -0,0 +1,3 @@
1
+ .gem-c-translation-nav {
2
+ display: none;
3
+ }
@@ -10,6 +10,7 @@
10
10
  <%= csrf_meta_tags %>
11
11
  <%= favicon_link_tag "govuk_publishing_components/favicon-#{environment}.png" %>
12
12
  <%= stylesheet_link_tag "application" %>
13
+ <%= stylesheet_link_tag "print", media: print %>
13
14
  <%= javascript_include_tag "govuk_publishing_components/vendor/modernizr" %>
14
15
  <%= yield :head %>
15
16
  </head>
@@ -5,7 +5,7 @@
5
5
  %>
6
6
  <% if translation_helper.has_translations? %>
7
7
  <nav role="navigation"
8
- class="gem-c-translation-nav <%= translation_helper.margin_class %> <%= brand_helper.brand_class %>"
8
+ class="gem-c-translation-nav <%= translation_helper.classes %> <%= brand_helper.brand_class %>"
9
9
  aria-label="<%= t("common.translations") %>"
10
10
  <%= "data-module=\"track-click\"" if translation_helper.tracking_is_present? %>
11
11
  >
@@ -107,4 +107,31 @@ examples:
107
107
  track_options:
108
108
  dimension28: 1
109
109
  dimension29: 'dimension29Welsh'
110
+ inverse:
111
+ data:
112
+ inverse: true
113
+ translations:
114
+ - locale: 'en'
115
+ base_path: '/en'
116
+ text: 'English'
117
+ active: true
118
+ data_attributes:
119
+ track_category: 'categoryEnglish'
120
+ track_action: 1.1
121
+ track_label: 'labelEnglish'
122
+ track_options:
123
+ dimension28: 1
124
+ dimension29: 'dimension29English'
125
+ - locale: 'cy'
126
+ base_path: '/cy'
127
+ text: 'Cymraeg'
128
+ data_attributes:
129
+ track_category: 'categoryWelsh'
130
+ track_action: 1.2
131
+ track_label: 'labelWelsh'
132
+ track_options:
133
+ dimension28: 1
134
+ dimension29: 'dimension29Welsh'
135
+ context:
136
+ dark_background: true
110
137
 
@@ -7,6 +7,7 @@ module GovukPublishingComponents
7
7
  @translations = []
8
8
  @translations = local_assigns[:translations] if local_assigns[:translations]
9
9
  @no_margin_top = local_assigns[:no_margin_top]
10
+ @inverse = local_assigns[:inverse]
10
11
  end
11
12
 
12
13
  def has_translations?
@@ -20,8 +21,19 @@ module GovukPublishingComponents
20
21
  false
21
22
  end
22
23
 
24
+ def classes
25
+ classes = %w(gem-c-translation-nav)
26
+ classes << inverse_class if @inverse
27
+ classes << margin_class if @no_margin_top
28
+ classes.join(" ")
29
+ end
30
+
31
+ def inverse_class
32
+ "gem-c-translation-nav--inverse"
33
+ end
34
+
23
35
  def margin_class
24
- "gem-c-translation-nav--no-margin-top" if @no_margin_top
36
+ "gem-c-translation-nav--no-margin-top"
25
37
  end
26
38
  end
27
39
  end
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '21.5.0'.freeze
2
+ VERSION = '21.6.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: 21.5.0
4
+ version: 21.6.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: 2019-10-08 00:00:00.000000000 Z
11
+ date: 2019-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gds-api-adapters
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: 2.0.1
125
+ - !ruby/object:Gem::Dependency
126
+ name: sprockets
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "<"
130
+ - !ruby/object:Gem::Version
131
+ version: '4'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "<"
137
+ - !ruby/object:Gem::Version
138
+ version: '4'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: capybara
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -140,14 +154,14 @@ dependencies:
140
154
  name: foreman
141
155
  requirement: !ruby/object:Gem::Requirement
142
156
  requirements:
143
- - - "~>"
157
+ - - '='
144
158
  - !ruby/object:Gem::Version
145
159
  version: '0.85'
146
160
  type: :development
147
161
  prerelease: false
148
162
  version_requirements: !ruby/object:Gem::Requirement
149
163
  requirements:
150
- - - "~>"
164
+ - - '='
151
165
  - !ruby/object:Gem::Version
152
166
  version: '0.85'
153
167
  - !ruby/object:Gem::Dependency
@@ -514,14 +528,25 @@ files:
514
528
  - app/assets/stylesheets/govuk_publishing_components/components/mixins/_margins.scss
515
529
  - app/assets/stylesheets/govuk_publishing_components/components/mixins/_media-down.scss
516
530
  - app/assets/stylesheets/govuk_publishing_components/components/print/_accordion.scss
531
+ - app/assets/stylesheets/govuk_publishing_components/components/print/_attachment.scss
532
+ - app/assets/stylesheets/govuk_publishing_components/components/print/_back-link.scss
533
+ - app/assets/stylesheets/govuk_publishing_components/components/print/_button.scss
517
534
  - app/assets/stylesheets/govuk_publishing_components/components/print/_contents-list.scss
518
535
  - app/assets/stylesheets/govuk_publishing_components/components/print/_feedback.scss
519
536
  - app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak-html-publication.scss
520
537
  - app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss
538
+ - app/assets/stylesheets/govuk_publishing_components/components/print/_layout-footer.scss
539
+ - app/assets/stylesheets/govuk_publishing_components/components/print/_layout-header.scss
540
+ - app/assets/stylesheets/govuk_publishing_components/components/print/_metadata.scss
541
+ - app/assets/stylesheets/govuk_publishing_components/components/print/_search.scss
521
542
  - app/assets/stylesheets/govuk_publishing_components/components/print/_share-links.scss
543
+ - app/assets/stylesheets/govuk_publishing_components/components/print/_skip-link.scss
522
544
  - app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav-header.scss
523
545
  - app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss
546
+ - app/assets/stylesheets/govuk_publishing_components/components/print/_subscription-links.scss
547
+ - app/assets/stylesheets/govuk_publishing_components/components/print/_textarea.scss
524
548
  - app/assets/stylesheets/govuk_publishing_components/components/print/_title.scss
549
+ - app/assets/stylesheets/govuk_publishing_components/components/print/_translation-nav.scss
525
550
  - app/controllers/govuk_publishing_components/application_controller.rb
526
551
  - app/controllers/govuk_publishing_components/component_guide_controller.rb
527
552
  - app/helpers/govuk_publishing_components/application_helper.rb