govuk_publishing_components 35.3.2 → 35.3.3

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: 66ace2c61b08a0641bc1234bf1e1b34e3e2e184ad07f554bde39c60280e58dd5
4
- data.tar.gz: fb3dbf387e8e668bf81b2b13c8c73a5152d3d4c2e570f7b2743e96f424b70680
3
+ metadata.gz: 0a65b99aa87692b87b842da1d33c81240ab4632d1ee1e5344d28b368a8a4eddf
4
+ data.tar.gz: cc9f77e7bae24a5a43a8ba7c49be27e3811306b90ad4c82bc9df33b1bffdc08c
5
5
  SHA512:
6
- metadata.gz: da81d3abeeb7d15ea0c74d1f428df7a9d7856ce078a50e63c8e66da7e244dea937f6600a457592c5ebafc1615dd623a8cc81e578e2a8eae4de97e7fa8fb7b779
7
- data.tar.gz: c2dcc61e03d0999871fca19f559833717892cb67ab16ed198eb8266fe06fe0d58a6465d65eae4e62c3aa84865732216ffeb8e224b2cb9f84fb8a2ae5ef089491
6
+ metadata.gz: 95655b6b6deff43a8665714a161b925059d60da25f1d63a39004a5b460dcaa860dbc9eeffd02e2f086b09cb810e61e9dde6eb30db91f68f4e356d88cf0d8ae48
7
+ data.tar.gz: bc259ebde3123faf6e41cd55cdec44ec13d98c30627ac40fd4336b7ccc06349a672712380d120d1194e3b0c7d086c16f947c8c3c636134dbdab2e0cb374ce8af
@@ -76,7 +76,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
76
76
 
77
77
  CookieBanner.prototype.setCookieConsent = function () {
78
78
  if (this.$acceptCookiesButton.getAttribute('data-cookie-types') === 'all') {
79
- this.$module.querySelector('.gem-c-cookie-banner__confirmation-message__accepted').hidden = false
79
+ this.$module.querySelector('.gem-c-cookie-banner__confirmation-message--accepted').hidden = false
80
80
  }
81
81
  window.GOVUK.approveAllCookieTypes()
82
82
  this.$module.showConfirmationMessage()
@@ -92,7 +92,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
92
92
  }
93
93
 
94
94
  CookieBanner.prototype.rejectCookieConsent = function () {
95
- this.$module.querySelector('.gem-c-cookie-banner__confirmation-message__rejected').hidden = false
95
+ this.$module.querySelector('.gem-c-cookie-banner__confirmation-message--rejected').hidden = false
96
96
  this.$module.showConfirmationMessage()
97
97
  this.$module.cookieBannerConfirmationMessage.focus()
98
98
  window.GOVUK.cookie('cookies_preferences_set', 'true', { days: 365 })
@@ -100,11 +100,17 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
100
100
  }
101
101
 
102
102
  CookieBanner.prototype.showConfirmationMessage = function () {
103
- this.$cookieBannerMainContent = document.querySelector('.js-banner-wrapper')
103
+ this.$cookieBannerHeader = document.querySelector('.govuk-cookie-banner__heading')
104
+ this.$cookieBannerHeader.hidden = true
104
105
 
106
+ this.$cookieBannerMainContent = document.querySelector('.gem-c-cookie-banner__content')
105
107
  this.$cookieBannerMainContent.hidden = true
106
- this.$module.cookieBannerConfirmationMessage.style.display = 'block'
107
- this.$module.cookieBannerConfirmationMessage.hidden = false
108
+
109
+ this.$cookieBannerConfirmationButtons = document.querySelector('.js-confirmation-buttons')
110
+ this.$cookieBannerConfirmationButtons.hidden = true
111
+
112
+ this.$cookieBannerHideButton = document.querySelector('.js-hide-button')
113
+ this.$cookieBannerHideButton.hidden = false
108
114
  }
109
115
 
110
116
  CookieBanner.prototype.isInCookiesPage = function () {
@@ -1,6 +1,13 @@
1
1
  @import "govuk_publishing_components/individual_component_support";
2
2
  @import "govuk/components/cookie-banner/cookie-banner";
3
- $govuk-cookie-banner-background: govuk-colour("light-grey", "grey-4");
3
+
4
+ .gem-c-cookie-banner .govuk-button-group[hidden] {
5
+ display: none;
6
+ }
7
+
8
+ .govuk-cookie-banner .govuk-cookie-banner__heading[hidden] {
9
+ display: none;
10
+ }
4
11
 
5
12
  .js-enabled {
6
13
  .gem-c-cookie-banner {
@@ -8,20 +15,12 @@ $govuk-cookie-banner-background: govuk-colour("light-grey", "grey-4");
8
15
  }
9
16
  }
10
17
 
11
- .gem-c-cookie-banner {
12
- background-color: $govuk-cookie-banner-background;
13
- }
14
-
15
18
  // can't be used without js so implement there
16
19
  .gem-c-cookie-banner .gem-c-button {
17
20
  display: none;
18
21
  }
19
22
 
20
23
  .gem-c-cookie-banner__confirmation {
21
- display: none;
22
- position: relative;
23
- padding: govuk-spacing(1);
24
-
25
24
  // This element is focused using JavaScript so that it's being read out by screen readers
26
25
  // for this reason we don't want to show the default outline or emphasise it visually using `govuk-focused-text`
27
26
  &:focus {
@@ -29,56 +28,6 @@ $govuk-cookie-banner-background: govuk-colour("light-grey", "grey-4");
29
28
  }
30
29
  }
31
30
 
32
- .gem-c-cookie-banner__confirmation-message,
33
- .gem-c-cookie-banner__hide-button {
34
- display: block;
35
-
36
- @include govuk-media-query($from: desktop) {
37
- display: inline-block;
38
- }
39
- }
40
-
41
- .gem-c-cookie-banner__confirmation-message {
42
- margin-right: govuk-spacing(4);
43
-
44
- @include govuk-media-query($from: desktop) {
45
- max-width: 90%;
46
- margin-bottom: 0;
47
- }
48
- }
49
-
50
- // Override style from design system so we can have consistent
51
- // padding on the the banner and the confirmation
52
-
53
- .govuk-cookie-banner {
54
- padding-top: 0;
55
- }
56
-
57
- // Override the styles from govuk_template
58
- // stylelint-disable selector-max-id
59
- .gem-c-cookie-banner#global-cookie-message {
60
- background-color: $govuk-cookie-banner-background;
61
- padding: govuk-spacing(3) 0 0 0;
62
- box-sizing: border-box;
63
-
64
- .gem-c-cookie-banner__message,
65
- .gem-c-cookie-banner__buttons,
66
- .gem-c-cookie-banner__confirmation,
67
- .gem-c-cookie-banner__confirmation-message {
68
- @include govuk-font($size: 19);
69
- }
70
-
71
- p {
72
- @include govuk-font($size: 19);
73
- margin: 0 0 govuk-spacing(2) 0;
74
- }
75
-
76
- .gem-c-cookie-banner__message,
77
- .gem-c-cookie-banner__confirmation {
78
- margin-bottom: - govuk-spacing(2);
79
- }
80
- }
81
-
82
31
  @include govuk-media-query($media-type: print) {
83
32
  .gem-c-cookie-banner {
84
33
  display: none !important; // stylelint-disable-line declaration-no-important
@@ -96,3 +96,27 @@
96
96
  border-color: #045f71;
97
97
  }
98
98
  }
99
+
100
+ // This change should be removed after relevant govuk-frontend release
101
+
102
+ .brand--department-for-business-and-trade {
103
+ .brand__color {
104
+ color: #cf102d;
105
+
106
+ &:link,
107
+ &:visited,
108
+ &:active {
109
+ color: #cf102d;
110
+ }
111
+
112
+ &:hover,
113
+ &:focus {
114
+ color: $govuk-focus-text-colour;
115
+ }
116
+ }
117
+
118
+ &.brand__border-color,
119
+ .brand__border-color {
120
+ border-color: #cf102d;
121
+ }
122
+ }
@@ -28,71 +28,63 @@
28
28
  },
29
29
  )))
30
30
  services_cookies ||= nil
31
- css_classes = %w(gem-c-cookie-banner govuk-clearfix)
31
+ css_classes = %w(gem-c-cookie-banner govuk-clearfix govuk-cookie-banner js-banner-wrapper)
32
32
  css_classes << "gem-c-cookie-banner--services" if services_cookies
33
33
  %>
34
+
34
35
  <div id="<%= id %>" class="<%= css_classes.join(' ') %>" data-module="cookie-banner" data-nosnippet role="region" aria-label="<%= title %>">
35
- <div class="govuk-cookie-banner js-banner-wrapper">
36
- <div class="gem-c-cookie-banner__message govuk-cookie-banner__message govuk-width-container">
37
- <div class="govuk-grid-row">
38
- <div class="govuk-grid-column-two-thirds">
39
- <h2 class="govuk-cookie-banner__heading govuk-heading-m"><%= title %></h2>
40
- <div class="govuk-cookie-banner__content">
41
- <%= text %>
42
- </div>
36
+ <div class="govuk-cookie-banner__message govuk-width-container">
37
+ <div class="govuk-grid-row">
38
+ <div class="govuk-grid-column-two-thirds">
39
+ <h2 class="govuk-cookie-banner__heading govuk-heading-m"><%= title %></h2>
40
+ <div tabindex="-1" class="govuk-cookie-banner__content gem-c-cookie-banner__confirmation">
41
+ <span class="gem-c-cookie-banner__content"><%= text %></span>
42
+ <p class="gem-c-cookie-banner__confirmation-message--accepted govuk-body" hidden><%= t("components.cookie_banner.confirmation_message.accepted") %>. <span class="gem-c-cookie-banner__confirmation-message"><%= confirmation_message %></span></p>
43
+ <p class="gem-c-cookie-banner__confirmation-message--rejected govuk-body" hidden><%= t("components.cookie_banner.confirmation_message.rejected") %>. <span class="gem-c-cookie-banner__confirmation-message"><%= confirmation_message %></span></p>
43
44
  </div>
44
45
  </div>
46
+ </div>
47
+ <div class="js-confirmation-buttons govuk-button-group">
45
48
  <% if services_cookies %>
46
- <div class="govuk-button-group">
47
- <%= render "govuk_publishing_components/components/button", {
48
- name: "cookies",
49
- text: services_cookies.dig(:yes, :text) || "Yes",
50
- data_attributes: { module: "gem-track-click", "accept-cookies": "true", }.merge(services_cookies.dig(:yes, :data_attributes) || {})
51
- } %>
52
- <%= render "govuk_publishing_components/components/button", {
53
- name: "cookies",
54
- text: services_cookies.dig(:no, :text) || "No",
55
- data_attributes: { module: "gem-track-click", "reject-cookies": "true", }.merge(services_cookies.dig(:no, :data_attributes) || {})
56
- } %>
57
- <% if services_cookies[:cookie_preferences] %>
58
- <%= link_to services_cookies.dig(:cookie_preferences, :text), services_cookies.dig(:cookie_preferences, :href), class: "govuk-link" %>
59
- <% end %>
60
- </div>
61
- <% else %>
62
- <div class="govuk-button-group">
63
- <%= render "govuk_publishing_components/components/button", {
64
- name: "cookies",
65
- text: t("components.cookie_banner.buttons.accept_cookies"),
66
- data_attributes: {
67
- module: "gem-track-click",
68
- "accept-cookies": "true",
69
- "track-category": "cookieBanner",
70
- "track-action": "Cookie banner accepted",
71
- "cookie-types": "all",
72
- }
73
- } %>
74
- <%= render "govuk_publishing_components/components/button", {
75
- name: "cookies",
76
- text: t("components.cookie_banner.buttons.reject_cookies"),
77
- data_attributes: {
78
- module: "gem-track-click",
79
- "reject-cookies": "true",
80
- "track-category": "cookieBanner",
81
- "track-action": "Cookie banner rejected",
82
- }
83
- } %>
84
- <a class="govuk-link" href="<%= cookie_preferences_href %>"><%= t("components.cookie_banner.buttons.view_cookies") %></a>
85
- </div>
49
+ <%= render "govuk_publishing_components/components/button", {
50
+ name: "cookies",
51
+ text: services_cookies.dig(:yes, :text) || "Yes",
52
+ data_attributes: { module: "gem-track-click", "accept-cookies": "true", }.merge(services_cookies.dig(:yes, :data_attributes) || {})
53
+ } %>
54
+ <%= render "govuk_publishing_components/components/button", {
55
+ name: "cookies",
56
+ text: services_cookies.dig(:no, :text) || "No",
57
+ data_attributes: { module: "gem-track-click", "reject-cookies": "true", }.merge(services_cookies.dig(:no, :data_attributes) || {})
58
+ } %>
59
+ <% if services_cookies[:cookie_preferences] %>
60
+ <%= link_to services_cookies.dig(:cookie_preferences, :text), services_cookies.dig(:cookie_preferences, :href), class: "govuk-link" %>
86
61
  <% end %>
62
+ <% else %>
63
+ <%= render "govuk_publishing_components/components/button", {
64
+ name: "cookies",
65
+ text: t("components.cookie_banner.buttons.accept_cookies"),
66
+ data_attributes: {
67
+ module: "gem-track-click",
68
+ "accept-cookies": "true",
69
+ "track-category": "cookieBanner",
70
+ "track-action": "Cookie banner accepted",
71
+ "cookie-types": "all",
72
+ }
73
+ } %>
74
+ <%= render "govuk_publishing_components/components/button", {
75
+ name: "cookies",
76
+ text: t("components.cookie_banner.buttons.reject_cookies"),
77
+ data_attributes: {
78
+ module: "gem-track-click",
79
+ "reject-cookies": "true",
80
+ "track-category": "cookieBanner",
81
+ "track-action": "Cookie banner rejected",
82
+ }
83
+ } %>
84
+ <a class="govuk-link" href="<%= cookie_preferences_href %>"><%= t("components.cookie_banner.buttons.view_cookies") %></a>
85
+ <% end %>
87
86
  </div>
88
- </div>
89
- <div class="gem-c-cookie-banner__confirmation govuk-width-container" tabindex="-1" hidden>
90
- <p class="gem-c-cookie-banner__confirmation-message" role="alert">
91
- <span class="gem-c-cookie-banner__confirmation-message__accepted" hidden><%= t("components.cookie_banner.confirmation_message.accepted") %>. </span>
92
- <span class="gem-c-cookie-banner__confirmation-message__rejected" hidden><%= t("components.cookie_banner.confirmation_message.rejected") %>. </span>
93
- <%= confirmation_message %>
94
- </p>
95
- <div class="govuk-button-group">
87
+ <div hidden class="js-hide-button govuk-button-group">
96
88
  <button class="gem-c-cookie-banner__hide-button govuk-button" data-hide-cookie-banner="true" data-module="gem-track-click" data-track-category="cookieBanner" data-track-action="Hide cookie banner"><%= t("components.cookie_banner.hide") %></button>
97
89
  </div>
98
90
  </div>
@@ -270,7 +270,7 @@
270
270
  class="gem-c-layout-super-navigation-header__search-form"
271
271
  id="search"
272
272
  data-module="ga4-form-tracker"
273
- data-ga4-form='{ "event_name": "search", "type": "header menu bar", "section": "Search GOV.UK", "action": "Search", "url": "/search/all" }'
273
+ data-ga4-form='{ "event_name": "search", "type": "header menu bar", "section": "Search GOV.UK", "action": "search", "url": "/search/all" }'
274
274
  data-ga4-form-include-text
275
275
  action="/search"
276
276
  method="get"
@@ -176,7 +176,7 @@ cy:
176
176
  label: Chwilio ar GOV.UK
177
177
  search_button: Chwilio
178
178
  share_links:
179
- all_opens_in_new_tab:
179
+ all_opens_in_new_tab: Bydd rhannu yn agor y dudalen hon mewn tab newydd
180
180
  opens_in_new_tab:
181
181
  show_password:
182
182
  announce_hide: Mae eich cyfrinair wedi'i guddio
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "35.3.2".freeze
2
+ VERSION = "35.3.3".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: 35.3.2
4
+ version: 35.3.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: 2023-04-25 00:00:00.000000000 Z
11
+ date: 2023-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config