govuk_publishing_components 66.1.0 → 66.3.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 (32) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/init-ga4.js +15 -9
  3. data/app/assets/javascripts/govuk_publishing_components/initialise-vars.js +1 -0
  4. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +1 -1
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +9 -0
  6. data/app/controllers/govuk_publishing_components/component_guide_controller.rb +1 -3
  7. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +2 -0
  8. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +2 -0
  9. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +7 -0
  10. data/app/views/govuk_publishing_components/components/docs/layout_header.yml +11 -0
  11. data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +0 -1
  12. data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +9 -0
  13. data/lib/govuk_publishing_components/version.rb +1 -1
  14. data/node_modules/axe-core/axe.js +7 -4
  15. data/node_modules/axe-core/axe.min.js +2 -2
  16. data/node_modules/axe-core/package.json +1 -1
  17. data/node_modules/axe-core/sri-history.json +4 -0
  18. data/node_modules/choices.js/package.json +1 -1
  19. data/node_modules/choices.js/public/assets/scripts/choices.js +17 -9
  20. data/node_modules/choices.js/public/assets/scripts/choices.min.js +2 -2
  21. data/node_modules/choices.js/public/assets/scripts/choices.mjs +17 -9
  22. data/node_modules/choices.js/public/assets/scripts/choices.search-basic.js +17 -9
  23. data/node_modules/choices.js/public/assets/scripts/choices.search-basic.min.js +2 -2
  24. data/node_modules/choices.js/public/assets/scripts/choices.search-basic.mjs +17 -9
  25. data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.js +17 -9
  26. data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.min.js +2 -2
  27. data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.mjs +17 -9
  28. data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.js +17 -9
  29. data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.min.js +2 -2
  30. data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.mjs +17 -9
  31. data/node_modules/choices.js/src/scripts/components/input.ts +17 -11
  32. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a39e0c1d59ff325efc8299c1fc22cb9360558ec3e2d58c31a4fd429714252d80
4
- data.tar.gz: d9e8ca8ec4e6f5c947392c2657875d3f3a4b865f3441b13da8f684eec3cf7296
3
+ metadata.gz: cc3ef8ff8392927e31bf3958896fec3586bc86c3ae8bce1dc9095a05905d9933
4
+ data.tar.gz: 015ccdd4c183f254539d0770068caab00e05a0d40eb80a5c7a62c7bb9ec55741
5
5
  SHA512:
6
- metadata.gz: 88a1fecfcb9af9aebec91df7acf461e4f7e036710e25faaffb54203266f2f31ed0b893378815ff9b0075705531af1c715ab5ce682cb6db7d1d5b18056baef9c3
7
- data.tar.gz: 1c2d941efc1618698c4928c7fa95ac96b6da9941cf5a58f21ace50783bc6efc7d570793b7a9b7a52070158f5827a0c7ed29a03ed59b1c7788bcddcc2554a7739
6
+ metadata.gz: 76ac1ee03256eb413747840e7e6943d8770a2c346d30d28b4de2a04a72b10d92a574ec2dab4dc37bda6e3ce065fcdbe6961fb6f828d4bb280d2054682384c4e1
7
+ data.tar.gz: 16419ad32e7670da648c76e49e110cf3199e2c53f1e7a0adb253f049be96b34bba7ab775f4297baf4c9fa05ccb5d4b83a2b8552d0d8b8165fa0ad0b8f32bfa36
@@ -6,17 +6,23 @@ var initFunction = function () {
6
6
  window.GOVUK.analyticsGa4.vars.internalDomains.push(window.GOVUK.analyticsGa4.core.trackFunctions.getHostname())
7
7
  window.GOVUK.analyticsGa4.core.trackFunctions.appendDomainsWithoutWWW(window.GOVUK.analyticsGa4.vars.internalDomains)
8
8
  window.GOVUK.analyticsGa4.core.load()
9
- var analyticsModules = window.GOVUK.analyticsGa4.analyticsModules
10
- for (var property in analyticsModules) {
11
- var module = analyticsModules[property]
12
- if (typeof module.init === 'function') {
13
- try {
14
- module.init()
15
- } catch (e) {
16
- // if there's a problem with the module, catch the error to allow other modules to start
17
- console.warn('Error starting analytics module ' + property + ': ' + e.message, window.location)
9
+
10
+ if (!window.GOVUK.analyticsGa4.analyticsModulesStarted) {
11
+ // Initialise analytics modules that start on page load
12
+ // https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/analytics.md#code-structure
13
+ var analyticsModules = window.GOVUK.analyticsGa4.analyticsModules
14
+ for (var property in analyticsModules) {
15
+ var module = analyticsModules[property]
16
+ if (typeof module.init === 'function') {
17
+ try {
18
+ module.init()
19
+ } catch (e) {
20
+ // if there's a problem with the module, catch the error to allow other modules to start
21
+ console.warn('Error starting analytics module ' + property + ': ' + e.message, window.location)
22
+ }
18
23
  }
19
24
  }
25
+ window.GOVUK.analyticsGa4.analyticsModulesStarted = true
20
26
  }
21
27
  } else {
22
28
  window.addEventListener('cookie-consent', window.GOVUK.analyticsGa4.init)
@@ -5,3 +5,4 @@ window.GOVUK = window.GOVUK || {}
5
5
  window.GOVUK.Modules = window.GOVUK.Modules || {}
6
6
  window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {}
7
7
  window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analyticsModules || {}
8
+ window.GOVUK.analyticsGa4.analyticsModulesStarted = false
@@ -194,7 +194,7 @@
194
194
 
195
195
  window.GOVUK.expireCookie = function (cookie, value = '') {
196
196
  // We need to handle deleting cookies on the domain and the .domain
197
- var thePast = new Date(0) // 0 = 0 seconds since UTC started (1970/01/01)
197
+ var thePast = new Date(0).toUTCString() // 0 = 0 seconds since UTC started (1970/01/01)
198
198
  document.cookie = cookie + '=' + value + ';expires=' + thePast + ';'
199
199
  document.cookie = cookie + '=' + value + ';expires=' + thePast + ';domain=' + window.location.hostname + ';path=/'
200
200
  }
@@ -59,11 +59,20 @@
59
59
  display: flex;
60
60
  flex-wrap: wrap;
61
61
  row-gap: govuk-spacing(2);
62
+
63
+ &:has(+ .gem-c-header__content) {
64
+ @include govuk-grid-column(three-quarters);
65
+ padding: govuk-spacing(3) 0 govuk-spacing(2);
66
+ }
62
67
  }
63
68
 
64
69
  .gem-c-header__content.govuk-header__content {
65
70
  width: auto;
66
71
 
72
+ @include govuk-media-query($from: mobile) {
73
+ @include govuk-responsive-padding(3, "bottom");
74
+ }
75
+
67
76
  @include govuk-media-query($from: desktop) {
68
77
  float: right;
69
78
  }
@@ -45,9 +45,7 @@ module GovukPublishingComponents
45
45
  end
46
46
 
47
47
  def components_in_use_sass
48
- additional_files = "@import 'govuk_publishing_components/govuk_frontend_support';\n"
49
- additional_files << "@import 'govuk_publishing_components/component_support';\n"
50
-
48
+ additional_files = "@import 'govuk_publishing_components/specific-components';\n"
51
49
  components = find_all_partials_in(get_used_component_names)
52
50
 
53
51
  components.map { |component|
@@ -18,6 +18,7 @@
18
18
  draft_watermark ||= false
19
19
  title ||= "GOV.UK - The best place to find government services and information"
20
20
  title_lang ||= nil
21
+ body_classes ||= nil
21
22
 
22
23
  show_account_layout ||= false
23
24
  account_nav_location ||= nil
@@ -27,6 +28,7 @@
27
28
  body_css_classes = %w(gem-c-layout-for-public govuk-template__body)
28
29
  body_css_classes << "gem-c-layout-for-public--draft" if draft_watermark
29
30
  body_css_classes << "global-banner-present" if global_banner.present?
31
+ body_css_classes << body_classes if body_classes
30
32
  -%>
31
33
  <!DOCTYPE html>
32
34
  <html class="govuk-template govuk-template--rebranded" lang="<%= html_lang %>">
@@ -1,6 +1,7 @@
1
1
  <%
2
2
  environment ||= nil
3
3
  full_width ||= false
4
+ signout_link ||= false
4
5
  navigation_aria_label ||= t("components.layout_header.top_level")
5
6
  navigation_items ||= []
6
7
  product_name ||= nil
@@ -22,6 +23,7 @@
22
23
  environment:,
23
24
  logo_link:,
24
25
  product_name:,
26
+ signout_link:,
25
27
  } %>
26
28
  </div>
27
29
  <% if navigation_items.any? %>
@@ -116,3 +116,10 @@ examples:
116
116
  title_lang: 'cy'
117
117
  block: |
118
118
  <h1>Page content goes here</h1>
119
+ with_body_classes:
120
+ description: Allows a class to be passed to the body element. Note that this does not work in preview in this guide.
121
+ data:
122
+ title: 'Example layout'
123
+ body_classes: 'example__class'
124
+ block: |
125
+ <h1>Page content goes here</h1>
@@ -31,6 +31,17 @@ examples:
31
31
  data:
32
32
  environment: production
33
33
  product_name: Product
34
+ with_signout_link:
35
+ description: Adds a "signout" link. For use across publishing apps.
36
+ data:
37
+ environment: production
38
+ signout_link: true
39
+ with_signout_link and product name:
40
+ description: Adds a "signout" link for use across publishing apps and a product name
41
+ data:
42
+ environment: production
43
+ signout_link: true
44
+ product_name: Component Guide 999.9.9
34
45
  with_navigation:
35
46
  description: Note that [remove_bottom_border](#no_bottom_border) automatically gets set to true on the header when navigation items are added.
36
47
  data:
@@ -39,7 +39,6 @@
39
39
  class: "gem-c-feedback__prompt-link",
40
40
  role: "button",
41
41
  hidden: "hidden",
42
- 'aria-hidden': "true",
43
42
  } do %>
44
43
  <%= t("components.feedback.maybe") %>
45
44
  <% end %>
@@ -9,6 +9,7 @@
9
9
 
10
10
  environment_exists = environment.present?
11
11
  deprecated_navigation ||= false
12
+ signout_link ||= false
12
13
  %>
13
14
 
14
15
  <% if environment_exists && deprecated_navigation %>
@@ -32,3 +33,11 @@
32
33
  </div>
33
34
  <% end %>
34
35
  </div>
36
+
37
+ <% if signout_link %>
38
+ <div class="govuk-header__content gem-c-header__content">
39
+ <nav class="gem-c-header__nav govuk-header__navigation">
40
+ <a class="govuk-header__link govuk-!-font-weight-bold" href="/auth/gds/sign_out">Sign out</a>
41
+ </nav>
42
+ </div>
43
+ <% end %>
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "66.1.0".freeze
2
+ VERSION = "66.3.0".freeze
3
3
  end
@@ -1,4 +1,4 @@
1
- /*! axe v4.11.3
1
+ /*! axe v4.11.4
2
2
  * Copyright (c) 2015 - 2026 Deque Systems, Inc.
3
3
  *
4
4
  * Your use of this Source Code Form is subject to the terms of the Mozilla Public
@@ -22,7 +22,7 @@
22
22
  }, _typeof(o);
23
23
  }
24
24
  var axe = axe || {};
25
- axe.version = '4.11.3';
25
+ axe.version = '4.11.4';
26
26
  if (typeof define === 'function' && define.amd) {
27
27
  define('axe-core', [], function() {
28
28
  return axe;
@@ -10991,7 +10991,7 @@
10991
10991
  return Array.from(doc.querySelectorAll(selector));
10992
10992
  });
10993
10993
  function generateAncestry(node) {
10994
- var nodeName2 = node.nodeName.toLowerCase();
10994
+ var nodeName2 = escape_selector_default(node.nodeName.toLowerCase());
10995
10995
  var parentElement = node.parentElement;
10996
10996
  var parentNode = node.parentNode;
10997
10997
  var nthChild = '';
@@ -16968,7 +16968,10 @@
16968
16968
  if (!virtualNode) {
16969
16969
  return false;
16970
16970
  }
16971
- if (virtualNode.props.nodeType !== 1 || context.includeHidden) {
16971
+ if (context.includeHidden && !nativelyHidden(virtualNode)) {
16972
+ return false;
16973
+ }
16974
+ if (virtualNode.props.nodeType !== 1) {
16972
16975
  return false;
16973
16976
  }
16974
16977
  return !_isVisibleToScreenReaders(virtualNode);