govuk_publishing_components 54.0.0 → 55.0.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 (138) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/lib/sticky-element-container.js +117 -0
  3. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +5 -0
  4. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +6 -12
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +13 -9
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_back-to-top-link.scss +15 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list-with-body.scss +58 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_figure.scss +46 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +1 -21
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_published-dates.scss +57 -0
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +0 -74
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_summary-banner.scss +33 -0
  13. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_legislative-list.scss +5 -0
  14. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_sticky-element-container.scss +23 -0
  15. data/app/controllers/govuk_publishing_components/component_guide_controller.rb +1 -1
  16. data/app/models/govuk_publishing_components/audit_applications.rb +1 -1
  17. data/app/models/govuk_publishing_components/audit_comparer.rb +1 -1
  18. data/app/models/govuk_publishing_components/audit_components.rb +1 -1
  19. data/app/models/govuk_publishing_components/component_doc.rb +1 -1
  20. data/app/views/govuk_publishing_components/components/_attachment.html.erb +2 -0
  21. data/app/views/govuk_publishing_components/components/_back_to_top_link.html.erb +19 -0
  22. data/app/views/govuk_publishing_components/components/_contents_list_with_body.html.erb +27 -0
  23. data/app/views/govuk_publishing_components/components/_feedback.html.erb +2 -6
  24. data/app/views/govuk_publishing_components/components/_figure.html.erb +28 -0
  25. data/app/views/govuk_publishing_components/components/_heading.html.erb +0 -1
  26. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +0 -1
  27. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +0 -6
  28. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +0 -1
  29. data/app/views/govuk_publishing_components/components/_metadata.html.erb +0 -3
  30. data/app/views/govuk_publishing_components/components/_published_dates.html.erb +50 -0
  31. data/app/views/govuk_publishing_components/components/_radio.html.erb +0 -1
  32. data/app/views/govuk_publishing_components/components/_search.html.erb +1 -4
  33. data/app/views/govuk_publishing_components/components/_summary_banner.html.erb +27 -0
  34. data/app/views/govuk_publishing_components/components/docs/back_to_top_link.yml +19 -0
  35. data/app/views/govuk_publishing_components/components/docs/contents_list_with_body.yml +90 -0
  36. data/app/views/govuk_publishing_components/components/docs/figure.yml +43 -0
  37. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +7 -4
  38. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +0 -1
  39. data/app/views/govuk_publishing_components/components/docs/layout_header.yml +0 -3
  40. data/app/views/govuk_publishing_components/components/docs/published_dates.yml +43 -0
  41. data/app/views/govuk_publishing_components/components/docs/search.yml +0 -9
  42. data/app/views/govuk_publishing_components/components/docs/summary_banner.yml +28 -0
  43. data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +0 -4
  44. data/config/locales/ar.yml +11 -4
  45. data/config/locales/az.yml +11 -4
  46. data/config/locales/be.yml +11 -4
  47. data/config/locales/bg.yml +11 -4
  48. data/config/locales/bn.yml +11 -4
  49. data/config/locales/cs.yml +11 -4
  50. data/config/locales/cy.yml +11 -4
  51. data/config/locales/da.yml +11 -4
  52. data/config/locales/de.yml +11 -4
  53. data/config/locales/dr.yml +11 -4
  54. data/config/locales/el.yml +11 -4
  55. data/config/locales/en.yml +17 -10
  56. data/config/locales/es-419.yml +12 -5
  57. data/config/locales/es.yml +12 -5
  58. data/config/locales/et.yml +11 -4
  59. data/config/locales/fa.yml +11 -4
  60. data/config/locales/fi.yml +11 -4
  61. data/config/locales/fr.yml +11 -4
  62. data/config/locales/gd.yml +11 -4
  63. data/config/locales/gu.yml +11 -4
  64. data/config/locales/he.yml +11 -4
  65. data/config/locales/hi.yml +11 -4
  66. data/config/locales/hr.yml +11 -4
  67. data/config/locales/hu.yml +11 -4
  68. data/config/locales/hy.yml +11 -4
  69. data/config/locales/id.yml +11 -4
  70. data/config/locales/is.yml +11 -4
  71. data/config/locales/it.yml +11 -4
  72. data/config/locales/ja.yml +11 -4
  73. data/config/locales/ka.yml +11 -4
  74. data/config/locales/kk.yml +11 -4
  75. data/config/locales/ko.yml +11 -4
  76. data/config/locales/lt.yml +11 -4
  77. data/config/locales/lv.yml +11 -4
  78. data/config/locales/ms.yml +11 -4
  79. data/config/locales/mt.yml +11 -4
  80. data/config/locales/ne.yml +224 -0
  81. data/config/locales/nl.yml +11 -4
  82. data/config/locales/no.yml +11 -4
  83. data/config/locales/pa-pk.yml +11 -4
  84. data/config/locales/pa.yml +11 -4
  85. data/config/locales/pl.yml +11 -4
  86. data/config/locales/ps.yml +11 -4
  87. data/config/locales/pt.yml +11 -4
  88. data/config/locales/ro.yml +11 -4
  89. data/config/locales/ru.yml +11 -4
  90. data/config/locales/si.yml +11 -4
  91. data/config/locales/sk.yml +11 -4
  92. data/config/locales/sl.yml +11 -4
  93. data/config/locales/so.yml +11 -4
  94. data/config/locales/sq.yml +11 -4
  95. data/config/locales/sr.yml +11 -4
  96. data/config/locales/sv.yml +11 -4
  97. data/config/locales/sw.yml +11 -4
  98. data/config/locales/ta.yml +11 -4
  99. data/config/locales/th.yml +11 -4
  100. data/config/locales/tk.yml +11 -4
  101. data/config/locales/tr.yml +11 -4
  102. data/config/locales/uk.yml +11 -4
  103. data/config/locales/ur.yml +11 -4
  104. data/config/locales/uz.yml +11 -4
  105. data/config/locales/vi.yml +11 -4
  106. data/config/locales/zh-hk.yml +11 -4
  107. data/config/locales/zh-tw.yml +11 -4
  108. data/config/locales/zh.yml +11 -4
  109. data/lib/govuk_publishing_components/app_helpers/asset_helper.rb +35 -26
  110. data/lib/govuk_publishing_components/config.rb +3 -0
  111. data/lib/govuk_publishing_components/presenters/attachment_helper.rb +2 -6
  112. data/lib/govuk_publishing_components/presenters/checkboxes_helper.rb +2 -2
  113. data/lib/govuk_publishing_components/presenters/component_wrapper_helper.rb +14 -14
  114. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_organisations.rb +1 -1
  115. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_taxons.rb +1 -1
  116. data/lib/govuk_publishing_components/presenters/content_item.rb +1 -3
  117. data/lib/govuk_publishing_components/presenters/machine_readable/article_schema.rb +1 -1
  118. data/lib/govuk_publishing_components/presenters/machine_readable/government_service_schema.rb +2 -2
  119. data/lib/govuk_publishing_components/presenters/machine_readable/organisation_schema.rb +3 -3
  120. data/lib/govuk_publishing_components/presenters/meta_tags.rb +2 -2
  121. data/lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb +1 -1
  122. data/lib/govuk_publishing_components/version.rb +1 -1
  123. data/node_modules/axe-core/README.md +2 -2
  124. data/node_modules/axe-core/axe.js +63 -46
  125. data/node_modules/axe-core/axe.min.js +3 -3
  126. data/node_modules/axe-core/locales/_template.json +1 -1
  127. data/node_modules/axe-core/locales/de.json +19 -19
  128. data/node_modules/axe-core/locales/ko.json +4 -4
  129. data/node_modules/axe-core/package.json +4 -3
  130. data/node_modules/axe-core/sri-history.json +4 -0
  131. metadata +20 -9
  132. data/app/assets/images/govuk_publishing_components/action-link-arrow--dark.png +0 -0
  133. data/app/assets/images/govuk_publishing_components/action-link-arrow--light.png +0 -0
  134. data/app/assets/images/govuk_publishing_components/action-link-arrow--simple-light.png +0 -0
  135. data/app/assets/images/govuk_publishing_components/action-link-arrow--simple.png +0 -0
  136. data/app/assets/images/govuk_publishing_components/action-link-arrow.png +0 -0
  137. data/app/assets/images/govuk_publishing_components/search-button.png +0 -0
  138. data/app/views/govuk_publishing_components/components/layout_header/_search.html.erb +0 -29
@@ -1,5 +1,5 @@
1
- /*! axe v4.10.2
2
- * Copyright (c) 2015 - 2024 Deque Systems, Inc.
1
+ /*! axe v4.10.3
2
+ * Copyright (c) 2015 - 2025 Deque Systems, Inc.
3
3
  *
4
4
  * Your use of this Source Code Form is subject to the terms of the Mozilla Public
5
5
  * License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -22,7 +22,7 @@
22
22
  }, _typeof(o);
23
23
  }
24
24
  var axe = axe || {};
25
- axe.version = '4.10.2';
25
+ axe.version = '4.10.3';
26
26
  if (typeof define === 'function' && define.amd) {
27
27
  define('axe-core', [], function() {
28
28
  return axe;
@@ -6943,6 +6943,9 @@
6943
6943
  parseStylesheet: function parseStylesheet() {
6944
6944
  return parse_stylesheet_default;
6945
6945
  },
6946
+ parseTabindex: function parseTabindex() {
6947
+ return parse_tabindex_default;
6948
+ },
6946
6949
  performanceTimer: function performanceTimer() {
6947
6950
  return performance_timer_default;
6948
6951
  },
@@ -10299,9 +10302,8 @@
10299
10302
  var nodeAndDescendents = query_selector_all_default(virtualNode, '*');
10300
10303
  var tabbableElements = nodeAndDescendents.filter(function(vNode) {
10301
10304
  var isFocusable2 = vNode.isFocusable;
10302
- var tabIndex = vNode.actualNode.getAttribute('tabindex');
10303
- tabIndex = tabIndex && !isNaN(parseInt(tabIndex, 10)) ? parseInt(tabIndex) : null;
10304
- return tabIndex ? isFocusable2 && tabIndex >= 0 : isFocusable2;
10305
+ var tabIndex = parse_tabindex_default(vNode.actualNode.getAttribute('tabindex'));
10306
+ return tabIndex !== null ? isFocusable2 && tabIndex >= 0 : isFocusable2;
10305
10307
  });
10306
10308
  return tabbableElements;
10307
10309
  }
@@ -10344,18 +10346,15 @@
10344
10346
  } else if (is_natively_focusable_default(vNode)) {
10345
10347
  return true;
10346
10348
  }
10347
- var tabindex = vNode.attr('tabindex');
10348
- if (tabindex && !isNaN(parseInt(tabindex, 10))) {
10349
- return true;
10350
- }
10351
- return false;
10349
+ var tabindex = parse_tabindex_default(vNode.attr('tabindex'));
10350
+ return tabindex !== null;
10352
10351
  }
10353
10352
  function _isInTabOrder(el) {
10354
10353
  var _nodeLookup6 = _nodeLookup(el), vNode = _nodeLookup6.vNode;
10355
10354
  if (vNode.props.nodeType !== 1) {
10356
10355
  return false;
10357
10356
  }
10358
- var tabindex = parseInt(vNode.attr('tabindex', 10));
10357
+ var tabindex = parse_tabindex_default(vNode.attr('tabindex'));
10359
10358
  if (tabindex <= -1) {
10360
10359
  return false;
10361
10360
  }
@@ -11256,7 +11255,7 @@
11256
11255
  superclassRole: [ 'composite' ]
11257
11256
  },
11258
11257
  tabpanel: {
11259
- type: 'widget',
11258
+ type: 'structure',
11260
11259
  allowedAttrs: [ 'aria-expanded' ],
11261
11260
  superclassRole: [ 'section' ],
11262
11261
  accessibleNameRequired: false
@@ -11835,7 +11834,7 @@
11835
11834
  }, {
11836
11835
  hasAccessibleName: true
11837
11836
  } ],
11838
- allowedRoles: [ 'button', 'checkbox', 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'meter', 'option', 'progressbar', 'radio', 'scrollbar', 'separator', 'slider', 'switch', 'tab', 'treeitem', 'doc-cover' ]
11837
+ allowedRoles: [ 'button', 'checkbox', 'link', 'math', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'meter', 'option', 'progressbar', 'radio', 'scrollbar', 'separator', 'slider', 'switch', 'tab', 'treeitem', 'doc-cover' ]
11839
11838
  },
11840
11839
  usemap: {
11841
11840
  matches: '[usemap]',
@@ -13893,7 +13892,7 @@
13893
13892
  });
13894
13893
  }
13895
13894
  function insertedIntoFocusOrder(el) {
13896
- var tabIndex = parseInt(el.getAttribute('tabindex'), 10);
13895
+ var tabIndex = parse_tabindex_default(el.getAttribute('tabindex'));
13897
13896
  return tabIndex > -1 && _isFocusable(el) && !is_natively_focusable_default(el);
13898
13897
  }
13899
13898
  var inserted_into_focus_order_default = insertedIntoFocusOrder;
@@ -18616,12 +18615,8 @@
18616
18615
  };
18617
18616
  }
18618
18617
  function frameFocusable(frame) {
18619
- var tabIndex = frame.getAttribute('tabindex');
18620
- if (!tabIndex) {
18621
- return true;
18622
- }
18623
- var _int = parseInt(tabIndex, 10);
18624
- return isNaN(_int) || _int >= 0;
18618
+ var tabIndex = parse_tabindex_default(frame.getAttribute('tabindex'));
18619
+ return tabIndex === null || tabIndex >= 0;
18625
18620
  }
18626
18621
  function getBoundingSize(domNode) {
18627
18622
  var width = parseInt(domNode.getAttribute('width'), 10);
@@ -19196,6 +19191,17 @@
19196
19191
  });
19197
19192
  }
19198
19193
  var parse_crossorigin_stylesheet_default = parseCrossOriginStylesheet;
19194
+ function parseTabindex(value) {
19195
+ if (typeof value !== 'string') {
19196
+ return null;
19197
+ }
19198
+ var match = value.trim().match(/^([-+]?\d+)/);
19199
+ if (match) {
19200
+ return Number(match[1]);
19201
+ }
19202
+ return null;
19203
+ }
19204
+ var parse_tabindex_default = parseTabindex;
19199
19205
  var performanceTimer = function() {
19200
19206
  function now() {
19201
19207
  if (window.performance && window.performance) {
@@ -19501,8 +19507,14 @@
19501
19507
  }
19502
19508
  function preloadMedia(_ref74) {
19503
19509
  var _ref74$treeRoot = _ref74.treeRoot, treeRoot = _ref74$treeRoot === void 0 ? axe._tree[0] : _ref74$treeRoot;
19504
- var mediaVirtualNodes = query_selector_all_filter_default(treeRoot, 'video, audio', function(_ref75) {
19510
+ var mediaVirtualNodes = query_selector_all_filter_default(treeRoot, 'video[autoplay], audio[autoplay]', function(_ref75) {
19505
19511
  var actualNode = _ref75.actualNode;
19512
+ if (actualNode.preload === 'none' && actualNode.readyState === 0 && actualNode.networkState !== actualNode.NETWORK_LOADING) {
19513
+ return false;
19514
+ }
19515
+ if (actualNode.hasAttribute('paused') || actualNode.hasAttribute('muted')) {
19516
+ return false;
19517
+ }
19506
19518
  if (actualNode.hasAttribute('src')) {
19507
19519
  return !!actualNode.getAttribute('src');
19508
19520
  }
@@ -24858,16 +24870,20 @@
24858
24870
  }
24859
24871
  var css_orientation_lock_evaluate_default = cssOrientationLockEvaluate;
24860
24872
  function noAutoplayAudioEvaluate(node, options) {
24873
+ var hasControls = node.hasAttribute('controls');
24874
+ if (node.hasAttribute('loop')) {
24875
+ return hasControls;
24876
+ }
24861
24877
  if (!node.duration) {
24862
24878
  console.warn('axe.utils.preloadMedia did not load metadata');
24863
24879
  return void 0;
24864
24880
  }
24865
24881
  var _options$allowedDurat = options.allowedDuration, allowedDuration = _options$allowedDurat === void 0 ? 3 : _options$allowedDurat;
24866
24882
  var playableDuration = getPlayableDuration(node);
24867
- if (playableDuration <= allowedDuration && !node.hasAttribute('loop')) {
24883
+ if (playableDuration <= allowedDuration) {
24868
24884
  return true;
24869
24885
  }
24870
- if (!node.hasAttribute('controls')) {
24886
+ if (!hasControls) {
24871
24887
  return false;
24872
24888
  }
24873
24889
  return true;
@@ -25422,8 +25438,8 @@
25422
25438
  }
25423
25439
  var alt_space_value_evaluate_default = altSpaceValueEvaluate;
25424
25440
  function tabindexEvaluate(node, options, virtualNode) {
25425
- var tabIndex = parseInt(virtualNode.attr('tabindex'), 10);
25426
- return isNaN(tabIndex) ? true : tabIndex <= 0;
25441
+ var tabIndex = parse_tabindex_default(virtualNode.attr('tabindex'));
25442
+ return tabIndex === null || tabIndex <= 0;
25427
25443
  }
25428
25444
  var tabindex_evaluate_default = tabindexEvaluate;
25429
25445
  function noFocusableContentEvaluate(node, options, virtualNode) {
@@ -25467,8 +25483,8 @@
25467
25483
  return retVal;
25468
25484
  }
25469
25485
  function usesUnreliableHidingStrategy(vNode) {
25470
- var tabIndex = parseInt(vNode.attr('tabindex'), 10);
25471
- return !isNaN(tabIndex) && tabIndex < 0;
25486
+ var tabIndex = parse_tabindex_default(vNode.attr('tabindex'));
25487
+ return tabIndex !== null && tabIndex < 0;
25472
25488
  }
25473
25489
  function landmarkIsTopLevelEvaluate(node) {
25474
25490
  var landmarks = get_aria_roles_by_type_default('landmark');
@@ -25540,9 +25556,7 @@
25540
25556
  }
25541
25557
  var focusable_not_tabbable_evaluate_default = focusableNotTabbableEvaluate;
25542
25558
  function focusableNoNameEvaluate(node, options, virtualNode) {
25543
- var tabIndex = virtualNode.attr('tabindex');
25544
- var inFocusOrder = _isFocusable(virtualNode) && tabIndex > -1;
25545
- if (!inFocusOrder) {
25559
+ if (!_isInTabOrder(virtualNode)) {
25546
25560
  return false;
25547
25561
  }
25548
25562
  try {
@@ -26104,7 +26118,8 @@
26104
26118
  navigation: true,
26105
26119
  region: true,
26106
26120
  search: false,
26107
- status: true
26121
+ status: true,
26122
+ tabpanel: true
26108
26123
  };
26109
26124
  function validScrollableTagName(node) {
26110
26125
  var nodeName2 = node.nodeName.toUpperCase();
@@ -27007,8 +27022,8 @@
27007
27022
  }
27008
27023
  var no_role_matches_default = noRoleMatches;
27009
27024
  function noNegativeTabindexMatches(node, virtualNode) {
27010
- var tabindex = parseInt(virtualNode.attr('tabindex'), 10);
27011
- return isNaN(tabindex) || tabindex >= 0;
27025
+ var tabindex = parse_tabindex_default(virtualNode.attr('tabindex'));
27026
+ return tabindex === null || tabindex >= 0;
27012
27027
  }
27013
27028
  var no_negative_tabindex_matches_default = noNegativeTabindexMatches;
27014
27029
  function noNamingMethodMatches(node, virtualNode) {
@@ -27338,14 +27353,14 @@
27338
27353
  return false;
27339
27354
  }
27340
27355
  var role = virtualNode.attr('role');
27341
- var tabIndex = virtualNode.attr('tabindex');
27342
- if (tabIndex === '-1' && role) {
27356
+ var tabIndex = parse_tabindex_default(virtualNode.attr('tabindex'));
27357
+ if (tabIndex < 0 && role) {
27343
27358
  var roleDef = standards_default.ariaRoles[role];
27344
27359
  if (roleDef === void 0 || roleDef.type !== 'widget') {
27345
27360
  return false;
27346
27361
  }
27347
27362
  }
27348
- if (tabIndex === '-1' && virtualNode.actualNode && !_isVisibleOnScreen(virtualNode) && !_isVisibleToScreenReaders(virtualNode)) {
27363
+ if (tabIndex < 0 && virtualNode.actualNode && !_isVisibleOnScreen(virtualNode) && !_isVisibleToScreenReaders(virtualNode)) {
27349
27364
  return false;
27350
27365
  }
27351
27366
  return true;
@@ -27836,16 +27851,18 @@
27836
27851
  });
27837
27852
  });
27838
27853
  });
27839
- q.defer(function(res) {
27840
- return setTimeout(res, 0);
27841
- });
27842
- if (options.performanceTimer) {
27843
- this._logRulePerformance();
27844
- }
27845
27854
  q.then(function() {
27846
- return resolve(ruleResult);
27855
+ if (options.performanceTimer) {
27856
+ _this9._logRulePerformance();
27857
+ }
27858
+ setTimeout(function() {
27859
+ resolve(ruleResult);
27860
+ }, 0);
27847
27861
  })['catch'](function(error) {
27848
- return reject(error);
27862
+ if (options.performanceTimer) {
27863
+ _this9._logRulePerformance();
27864
+ }
27865
+ reject(error);
27849
27866
  });
27850
27867
  };
27851
27868
  Rule.prototype.runSync = function runSync2(context) {
@@ -30260,7 +30277,7 @@
30260
30277
  impact: 'critical',
30261
30278
  messages: {
30262
30279
  pass: 'The multimedia element has a captions track',
30263
- incomplete: 'Check that captions is available for the element'
30280
+ incomplete: 'Check that captions are available for the element'
30264
30281
  }
30265
30282
  },
30266
30283
  'frame-tested': {