govuk_publishing_components 65.2.2 → 66.0.1

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 (108) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/component_guide/accessibility-test.js +0 -2
  3. data/app/assets/javascripts/component_guide/application.js +1 -0
  4. data/app/assets/javascripts/component_guide/audit-filter.js +0 -3
  5. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-auto-tracker.js +0 -3
  6. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-copy-tracker.js +0 -4
  7. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +0 -3
  8. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-ecommerce-tracker.js +7 -12
  9. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-event-tracker.js +0 -3
  10. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-finder-tracker.js +2 -7
  11. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-focus-loss-tracker.js +0 -3
  12. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-change-tracker.js +0 -3
  13. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-tracker.js +6 -9
  14. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js +0 -3
  15. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js +0 -4
  16. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-print-intent-tracker.js +0 -4
  17. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-schemas.js +1 -6
  18. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-scroll-tracker.js +0 -3
  19. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-search-tracker.js +3 -3
  20. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-smart-answer-results-tracker.js +0 -2
  21. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-specialist-link-tracker.js +0 -4
  22. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-video-tracker.js +0 -4
  23. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/init-ga4.js +0 -5
  24. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/pii-remover.js +1 -5
  25. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +0 -2
  26. data/app/assets/javascripts/govuk_publishing_components/components/add-another.js +0 -3
  27. data/app/assets/javascripts/govuk_publishing_components/components/app-promo-banner.js +0 -3
  28. data/app/assets/javascripts/govuk_publishing_components/components/button.js +0 -2
  29. data/app/assets/javascripts/govuk_publishing_components/components/character-count.js +0 -2
  30. data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +0 -2
  31. data/app/assets/javascripts/govuk_publishing_components/components/contents-list-with-body.js +0 -3
  32. data/app/assets/javascripts/govuk_publishing_components/components/contextual-guidance.js +0 -3
  33. data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +0 -3
  34. data/app/assets/javascripts/govuk_publishing_components/components/copy-to-clipboard.js +0 -3
  35. data/app/assets/javascripts/govuk_publishing_components/components/cross-service-header.js +0 -3
  36. data/app/assets/javascripts/govuk_publishing_components/components/error-summary.js +0 -2
  37. data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +0 -2
  38. data/app/assets/javascripts/govuk_publishing_components/components/file-upload.js +0 -2
  39. data/app/assets/javascripts/govuk_publishing_components/components/global-banner.js +0 -2
  40. data/app/assets/javascripts/govuk_publishing_components/components/govspeak.js +0 -3
  41. data/app/assets/javascripts/govuk_publishing_components/components/intervention.js +0 -3
  42. data/app/assets/javascripts/govuk_publishing_components/components/layout-header.js +0 -2
  43. data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +0 -3
  44. data/app/assets/javascripts/govuk_publishing_components/components/metadata.js +0 -3
  45. data/app/assets/javascripts/govuk_publishing_components/components/modal-dialogue.js +0 -3
  46. data/app/assets/javascripts/govuk_publishing_components/components/option-select.js +0 -3
  47. data/app/assets/javascripts/govuk_publishing_components/components/password-input.js +0 -2
  48. data/app/assets/javascripts/govuk_publishing_components/components/print-link.js +0 -3
  49. data/app/assets/javascripts/govuk_publishing_components/components/radio.js +0 -2
  50. data/app/assets/javascripts/govuk_publishing_components/components/reorderable-list.js +0 -3
  51. data/app/assets/javascripts/govuk_publishing_components/components/search-with-autocomplete.js +0 -4
  52. data/app/assets/javascripts/govuk_publishing_components/components/select-with-search.js +0 -2
  53. data/app/assets/javascripts/govuk_publishing_components/components/service-navigation.js +0 -2
  54. data/app/assets/javascripts/govuk_publishing_components/components/single-page-notification-button.js +0 -3
  55. data/app/assets/javascripts/govuk_publishing_components/components/skip-link.js +0 -2
  56. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +0 -3
  57. data/app/assets/javascripts/govuk_publishing_components/components/table.js +0 -3
  58. data/app/assets/javascripts/govuk_publishing_components/components/tabs.js +0 -2
  59. data/app/assets/javascripts/govuk_publishing_components/dependencies.js +0 -3
  60. data/app/assets/javascripts/govuk_publishing_components/domain-config.js +0 -1
  61. data/app/assets/javascripts/govuk_publishing_components/initialise-vars.js +7 -0
  62. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +0 -1
  63. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-settings.js +0 -4
  64. data/app/assets/javascripts/govuk_publishing_components/lib/extend-object.js +0 -1
  65. data/app/assets/javascripts/govuk_publishing_components/lib/filter-list.js +0 -3
  66. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js +0 -2
  67. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +0 -2
  68. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +1 -3
  69. data/app/assets/javascripts/govuk_publishing_components/lib/initial-focus.js +0 -3
  70. data/app/assets/javascripts/govuk_publishing_components/lib/toggle-input-class-on-focus.js +0 -2
  71. data/app/assets/javascripts/govuk_publishing_components/lib/toggle.js +0 -2
  72. data/app/assets/javascripts/govuk_publishing_components/lib/trigger-event.js +0 -1
  73. data/app/assets/javascripts/govuk_publishing_components/load-analytics.js +1 -0
  74. data/app/assets/javascripts/govuk_publishing_components/modules.js +9 -10
  75. data/app/assets/stylesheets/component_guide/application.scss +65 -0
  76. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +13 -3
  77. data/app/controllers/govuk_publishing_components/applications_page_controller.rb +1 -1
  78. data/app/views/govuk_publishing_components/applications_page/show.html.erb +21 -18
  79. data/app/views/govuk_publishing_components/audit/_component_contents.html.erb +141 -139
  80. data/app/views/govuk_publishing_components/audit/show.html.erb +1 -0
  81. data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +16 -11
  82. data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +8 -6
  83. data/app/views/layouts/govuk_publishing_components/application.html.erb +1 -1
  84. data/config/locales/en.yml +1 -1
  85. data/lib/govuk_publishing_components/presenters/step_by_step_nav_helper.rb +2 -2
  86. data/lib/govuk_publishing_components/version.rb +1 -1
  87. data/node_modules/axe-core/axe.js +322 -248
  88. data/node_modules/axe-core/axe.min.js +2 -2
  89. data/node_modules/axe-core/locales/_template.json +7 -0
  90. data/node_modules/axe-core/package.json +1 -1
  91. data/node_modules/axe-core/sri-history.json +4 -0
  92. data/node_modules/choices.js/package.json +1 -1
  93. data/node_modules/choices.js/public/assets/scripts/choices.js +43 -15
  94. data/node_modules/choices.js/public/assets/scripts/choices.min.js +2 -2
  95. data/node_modules/choices.js/public/assets/scripts/choices.mjs +43 -15
  96. data/node_modules/choices.js/public/assets/scripts/choices.search-basic.js +43 -15
  97. data/node_modules/choices.js/public/assets/scripts/choices.search-basic.min.js +2 -2
  98. data/node_modules/choices.js/public/assets/scripts/choices.search-basic.mjs +43 -15
  99. data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.js +43 -15
  100. data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.min.js +2 -2
  101. data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.mjs +43 -15
  102. data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.js +43 -15
  103. data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.min.js +2 -2
  104. data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.mjs +43 -15
  105. data/node_modules/choices.js/public/types/src/scripts/components/input.d.ts +5 -2
  106. data/node_modules/choices.js/src/scripts/choices.ts +9 -4
  107. data/node_modules/choices.js/src/scripts/components/input.ts +39 -9
  108. metadata +3 -2
@@ -2,7 +2,6 @@
2
2
 
3
3
  (function (root) {
4
4
  'use strict'
5
- window.GOVUK = window.GOVUK || {}
6
5
 
7
6
  var DEFAULT_COOKIE_CONSENT = {
8
7
  essential: true,
@@ -1,6 +1,3 @@
1
- window.GOVUK = window.GOVUK || {}
2
- window.GOVUK.Modules = window.GOVUK.Modules || {};
3
-
4
1
  (function (Modules) {
5
2
  function CookieSettings ($module) {
6
3
  this.$module = $module
@@ -57,7 +54,6 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
57
54
 
58
55
  if (name === 'usage' && !value) {
59
56
  window.GOVUK.stopSendingAnalytics = true
60
- window.GOVUK.LUX = {}
61
57
  }
62
58
  }
63
59
  }
@@ -1,6 +1,5 @@
1
1
  (function (root) {
2
2
  'use strict'
3
- window.GOVUK = window.GOVUK || {}
4
3
 
5
4
  window.GOVUK.extendObject = function (obj) {
6
5
  obj = obj || {}
@@ -1,6 +1,3 @@
1
- window.GOVUK = window.GOVUK || {}
2
- window.GOVUK.Modules = window.GOVUK.Modules || {};
3
-
4
1
  (function (Modules) {
5
2
  'use strict'
6
3
 
@@ -1,7 +1,5 @@
1
1
  // = require govuk_publishing_components/lib/govspeak/magna-charta
2
2
 
3
- window.GOVUK = window.GOVUK || {};
4
-
5
3
  (function (GOVUK) {
6
4
  'use strict'
7
5
 
@@ -1,6 +1,4 @@
1
1
  // This is a non-jQuery version of Magna Charta: https://github.com/alphagov/magna-charta
2
- window.GOVUK = window.GOVUK || {}
3
- window.GOVUK.Modules = window.GOVUK.Modules || {};
4
2
 
5
3
  (function (Modules) {
6
4
  function MagnaCharta ($module, options) {
@@ -1,7 +1,5 @@
1
1
  (function () {
2
2
  'use strict'
3
- window.GOVUK = window.GOVUK || {}
4
- var GOVUK = window.GOVUK || {}
5
3
 
6
4
  var YoutubeLinkEnhancement = function ($element, $classOverride) {
7
5
  this.$element = $element
@@ -262,5 +260,5 @@
262
260
  }
263
261
  }
264
262
 
265
- GOVUK.GovspeakYoutubeLinkEnhancement = YoutubeLinkEnhancement
263
+ window.GOVUK.GovspeakYoutubeLinkEnhancement = YoutubeLinkEnhancement
266
264
  })()
@@ -1,6 +1,3 @@
1
- window.GOVUK = window.GOVUK || {}
2
- window.GOVUK.Modules = window.GOVUK.Modules || {};
3
-
4
1
  (function (Modules) {
5
2
  function InitialFocus ($module) {
6
3
  this.$module = $module
@@ -2,8 +2,6 @@
2
2
  Toggle the class 'focus' on input boxes on element focus/blur
3
3
  Used by the search component but generic enough for reuse
4
4
  */
5
- window.GOVUK = window.GOVUK || {}
6
- window.GOVUK.Modules = window.GOVUK.Modules || {};
7
5
 
8
6
  (function (Modules) {
9
7
  function GemToggleInputClassOnFocus ($module) {
@@ -67,8 +67,6 @@
67
67
  `data-controls` can contain more than one element, space
68
68
  separated.
69
69
  */
70
- window.GOVUK = window.GOVUK || {}
71
- window.GOVUK.Modules = window.GOVUK.Modules || {};
72
70
 
73
71
  (function (Modules) {
74
72
  function GemToggle ($module) {
@@ -1,7 +1,6 @@
1
1
  // see https://github.com/alphagov/govuk_publishing_components/blob/main/docs/lib/trigger_event.md
2
2
  (function (root) {
3
3
  'use strict'
4
- window.GOVUK = window.GOVUK || {}
5
4
 
6
5
  window.GOVUK.triggerEvent = function (element, eventName, parameters) {
7
6
  var params = parameters || {}
@@ -1,3 +1,4 @@
1
+ //= require govuk_publishing_components/initialise-vars
1
2
  //= require govuk_publishing_components/analytics-ga4
2
3
  //= require govuk_publishing_components/domain-config
3
4
 
@@ -1,10 +1,11 @@
1
+ // This initialises the window.GOVUK object for all GOVUK Modules in the gem.
2
+ // Technically this isn't needed as our GA4 script loads first and initialises things for us, but we should keep this here so that our modules can work independently of GA4.
3
+ //= require ./initialise-vars
4
+
1
5
  ;(function (global) {
2
6
  'use strict'
3
7
 
4
- var GOVUK = global.GOVUK || {}
5
- GOVUK.Modules = GOVUK.Modules || {}
6
-
7
- GOVUK.modules = {
8
+ window.GOVUK.modules = {
8
9
  find: function (container) {
9
10
  container = container || document
10
11
 
@@ -35,16 +36,16 @@
35
36
  for (var j = 0, k = moduleNames.length; j < k; j++) {
36
37
  var moduleName = camelCaseAndCapitalise(moduleNames[j])
37
38
  var started = element.getAttribute('data-' + moduleNames[j] + '-module-started')
38
- if (typeof GOVUK.Modules[moduleName] === 'function' && !started) {
39
+ if (typeof window.GOVUK.Modules[moduleName] === 'function' && !started) {
39
40
  try {
40
- if (GOVUK.Modules[moduleName].prototype.init) {
41
+ if (window.GOVUK.Modules[moduleName].prototype.init) {
41
42
  // Vanilla JavaScript GOV.UK Modules and GOV.UK Frontend V4 Modules
42
- new GOVUK.Modules[moduleName](element).init()
43
+ new window.GOVUK.Modules[moduleName](element).init()
43
44
  } else {
44
45
  // GOV.UK Frontend V5 Modules - removed component init() methods and initialise in constructor
45
46
  // https://github.com/alphagov/govuk-design-system-architecture/blob/main/decision-records/010-remove-init-method.md
46
47
  /* eslint-disable no-new */
47
- new GOVUK.Modules[moduleName](element)
48
+ new window.GOVUK.Modules[moduleName](element)
48
49
  }
49
50
  element.setAttribute('data-' + moduleNames[j] + '-module-started', true)
50
51
  } catch (e) {
@@ -73,6 +74,4 @@
73
74
  }
74
75
  }
75
76
  }
76
-
77
- global.GOVUK = GOVUK
78
77
  })(window)
@@ -477,6 +477,71 @@ $code-delete-bg: #fadddd;
477
477
  }
478
478
  }
479
479
 
480
+ .table-container {
481
+ container-type: inline-size;
482
+ container-name: page;
483
+ }
484
+
485
+ .table-wrapper {
486
+ .govuk-table {
487
+ display: block;
488
+ overflow-x: scroll;
489
+ }
490
+ }
491
+
492
+ @container page (width > 1040px) {
493
+ $w: 960px;
494
+
495
+ .table-wrapper {
496
+ position: relative;
497
+ z-index: 0;
498
+ box-sizing: border-box;
499
+ margin-left: calc(((-100cqw + $w) / 2) - 1px);
500
+ margin-right: calc(((-100cqw + $w) / 2) - 1px);
501
+ background: #ffffff;
502
+ padding: 15px;
503
+
504
+ .govuk-table {
505
+ width: auto;
506
+ display: table;
507
+ margin-left: auto;
508
+ margin-right: auto;
509
+ }
510
+ }
511
+ }
512
+
513
+ .govuk-tabs {
514
+ $w: 920px;
515
+
516
+ @container page (width > 1040px) {
517
+ .table-wrapper {
518
+ margin-left: calc(((-100cqw + $w) / 2) - 1px);
519
+ margin-right: calc(((-100cqw + $w) / 2) - 1px);
520
+
521
+ &::before,
522
+ &::after {
523
+ content: "";
524
+ z-index: -1;
525
+ position: absolute;
526
+ top: -1px;
527
+ bottom: -1px;
528
+ width: calc((100cqw - 960px) / 2);
529
+ box-sizing: border-box;
530
+ border-top: solid 1px $govuk-border-colour;
531
+ border-bottom: solid 1px $govuk-border-colour;
532
+ }
533
+
534
+ &::before {
535
+ left: 0;
536
+ }
537
+
538
+ &::after {
539
+ right: 0;
540
+ }
541
+ }
542
+ }
543
+ }
544
+
480
545
  // Note: This is a temporary override to ensure the background color on component preview
481
546
  // pages remains white, this can be removed once the --rebrand flag is removed from govuk-frontend
482
547
  .govuk-template--rebranded {
@@ -4,6 +4,9 @@ $feedback-prompt-border-top-colour: $govuk-blue-tint-50;
4
4
  .gem-c-feedback {
5
5
  background: govuk-colour("white");
6
6
  margin-top: govuk-spacing(6);
7
+ background-color: $feedback-prompt-background-colour;
8
+ color: govuk-colour("black");
9
+ border-top: 1px solid $feedback-prompt-border-top-colour;
7
10
 
8
11
  @include govuk-media-query($from: desktop) {
9
12
  margin-top: govuk-spacing(9);
@@ -27,9 +30,7 @@ $feedback-prompt-border-top-colour: $govuk-blue-tint-50;
27
30
  }
28
31
 
29
32
  .gem-c-feedback__prompt {
30
- background-color: $feedback-prompt-background-colour;
31
33
  color: govuk-colour("black");
32
- border-top: 1px solid $feedback-prompt-border-top-colour;
33
34
  outline: 0;
34
35
  }
35
36
 
@@ -201,10 +202,10 @@ $feedback-prompt-border-top-colour: $govuk-blue-tint-50;
201
202
 
202
203
  .gem-c-feedback__form {
203
204
  padding: govuk-spacing(3);
204
- border-top: 1px solid $govuk-border-colour;
205
205
 
206
206
  @include govuk-media-query($from: tablet) {
207
207
  padding: govuk-spacing(6);
208
+ padding-bottom: 0;
208
209
  }
209
210
  }
210
211
 
@@ -233,6 +234,15 @@ $feedback-prompt-border-top-colour: $govuk-blue-tint-50;
233
234
  }
234
235
  }
235
236
 
237
+ .gem-c-feedback__button-wrapper {
238
+ @include govuk-media-query($from: tablet) {
239
+ display: flex;
240
+ flex-direction: row;
241
+ align-items: flex-start;
242
+ gap: govuk-spacing(2);
243
+ }
244
+ }
245
+
236
246
  .gem-c-feedback__email-link {
237
247
  display: inline-block;
238
248
  margin-top: govuk-spacing(4);
@@ -4,7 +4,7 @@ module GovukPublishingComponents
4
4
  applications = [
5
5
  {
6
6
  type: "public-facing",
7
- apps: %w[collections email-alert-frontend feedback finder-frontend frontend smart-answers].sort,
7
+ apps: %w[collections email-alert-frontend feedback finder-frontend frontend govuk_publishing_components smart-answers].sort,
8
8
  },
9
9
  {
10
10
  type: "publishing",
@@ -1,4 +1,5 @@
1
1
  <% content_for :title, "Applications consistency" %>
2
+ <% content_for :body_classes, "table-container" %>
2
3
 
3
4
  <%= render "govuk_publishing_components/components/back_link", {
4
5
  href: "/component-guide",
@@ -16,22 +17,24 @@
16
17
  <% end %>
17
18
 
18
19
  <div data-module="filter-list">
19
- <table class="govuk-table">
20
- <thead class="govuk-table__head">
21
- <tr class="govuk-table__row">
22
- <th scope="col" class="govuk-table__header sticky-table-header">Application</th>
23
- <th scope="col" class="govuk-table__header sticky-table-header">Type</th>
24
- <th scope="col" class="govuk-table__header sticky-table-header">Source</th>
25
- <th scope="col" class="govuk-table__header sticky-table-header">Gem version</th>
26
- <th scope="col" class="govuk-table__header sticky-table-header">Sass version</th>
27
- <th scope="col" class="govuk-table__header sticky-table-header">Ruby version</th>
28
- <th scope="col" class="govuk-table__header sticky-table-header">Yarn version</th>
29
- </tr>
30
- </thead>
31
- <tbody class="govuk-table__body">
32
- <%= render "table-content", content: @applications_output.select { |a| a[:type] == "public-facing" }, type: "Public facing" %>
33
- <%= render "table-content", content: @applications_output.select { |a| a[:type] == "publishing" }, type: "Publishing" %>
34
- <%= render "table-content", content: @applications_output.select { |a| a[:type] == "utility" }, type: "Utility" %>
35
- </tbody>
36
- </table>
20
+ <div class="table-wrapper">
21
+ <table class="govuk-table">
22
+ <thead class="govuk-table__head">
23
+ <tr class="govuk-table__row">
24
+ <th scope="col" class="govuk-table__header sticky-table-header">Application</th>
25
+ <th scope="col" class="govuk-table__header sticky-table-header">Type</th>
26
+ <th scope="col" class="govuk-table__header sticky-table-header">Source</th>
27
+ <th scope="col" class="govuk-table__header sticky-table-header">Gem version</th>
28
+ <th scope="col" class="govuk-table__header sticky-table-header">Sass version</th>
29
+ <th scope="col" class="govuk-table__header sticky-table-header">Ruby version</th>
30
+ <th scope="col" class="govuk-table__header sticky-table-header">Yarn version</th>
31
+ </tr>
32
+ </thead>
33
+ <tbody class="govuk-table__body">
34
+ <%= render "table-content", content: @applications_output.select { |a| a[:type] == "public-facing" }, type: "Public facing" %>
35
+ <%= render "table-content", content: @applications_output.select { |a| a[:type] == "publishing" }, type: "Publishing" %>
36
+ <%= render "table-content", content: @applications_output.select { |a| a[:type] == "utility" }, type: "Utility" %>
37
+ </tbody>
38
+ </table>
39
+ </div>
37
40
  </div>
@@ -1,153 +1,155 @@
1
1
  <p class="govuk-body">
2
2
  Numbers in table headers show column totals. Numbers in table cells show number of lines in files. Note that component test files cannot currently be detected in applications that use minitest instead of Rspec.</p>
3
3
  </p>
4
- <table class="govuk-table">
5
- <thead class="govuk-table__head">
6
- <tr class="govuk-table__row" <% if show_application_name %> data-audit-headings<% end %>>
7
- <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="total">Component</th>
8
- <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="template" title="Component has a template">
9
- Template
10
- <% unless show_application_name %>
11
- <span class="component__count"><%= passed_components[:component_numbers][:template] %></span>
12
- <% end %>
13
- </th>
14
- <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="stylesheet" title="Component has a stylesheet">
15
- CSS
16
- <% unless show_application_name %>
17
- <span class="component__count"><%= passed_components[:component_numbers][:stylesheet] %></span>
18
- <% end %>
19
- </th>
20
- <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="print_stylesheet" title="Component has print styles">
21
- Print CSS
22
- <% unless show_application_name %>
23
- <span class="component__count"><%= passed_components[:component_numbers][:print_stylesheet] %></span>
24
- <% end %>
25
- </th>
26
- <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="javascript" title="Component has JavaScript">
27
- JS
28
- <% unless show_application_name %>
29
- <span class="component__count"><%= passed_components[:component_numbers][:javascript] %></span>
30
- <% end %>
31
- </th>
32
- <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="javascript_test" title="Component has a JavaScript test file">
33
- JS test
34
- <% unless show_application_name %>
35
- <span class="component__count"><%= passed_components[:component_numbers][:javascript_test] %></span>
36
- <% end %>
37
- </th>
38
- <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="uses-govuk-frontend-css" title="Component includes styles imported from govuk-frontend">
39
- GF CSS
40
- <% unless show_application_name %>
41
- <span class="component__count"><%= passed_components[:component_numbers][:uses_govuk_frontend_css] %></span>
42
- <% end %>
43
- </th>
44
- <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="uses-govuk-frontend-js" title="Component includes JavaScript imported from govuk-frontend">
45
- GF JS
46
- <% unless show_application_name %>
47
- <span class="component__count"><%= passed_components[:component_numbers][:uses_govuk_frontend_js] %></span>
48
- <% end %>
49
- </th>
50
- <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="test" title="Component has a test file">
51
- Test
52
- <% unless show_application_name %>
53
- <span class="component__count"><%= passed_components[:component_numbers][:test] %></span>
54
- <% end %>
55
- </th>
56
- <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="helper" title="Component has a helper file">
57
- Helper
58
- <% unless show_application_name %>
59
- <span class="component__count"><%= passed_components[:component_numbers][:helper] %></span>
60
- <% end %>
61
- </th>
62
- </tr>
63
- </thead>
64
- <tbody class="govuk-table__body" <% if show_application_name %> data-audit-list<% end %>>
65
- <% passed_components[:component_file_details].each do |component| %>
66
- <tr class="govuk-table__row" data-application="<%= component[:application] %>">
67
- <th scope="row" class="govuk-table__header" data-component-type="total">
68
- <% if component[:link] %>
69
- <a href="<%= component[:link] %>" class="govuk-link">
70
- <%= component[:name] %>
71
- </a>
72
- <% else %>
73
- <%= component[:name] %>
74
- <% end %>
75
- <% if show_application_name %>
76
- <span class="component__application-name">
77
- <%= component[:application] %>
78
- </span>
4
+ <div class="table-wrapper">
5
+ <table class="govuk-table">
6
+ <thead class="govuk-table__head">
7
+ <tr class="govuk-table__row" <% if show_application_name %> data-audit-headings<% end %>>
8
+ <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="total">Component</th>
9
+ <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="template" title="Component has a template">
10
+ Template
11
+ <% unless show_application_name %>
12
+ <span class="component__count"><%= passed_components[:component_numbers][:template] %></span>
79
13
  <% end %>
80
14
  </th>
81
- <td class="govuk-table__cell" data-component-type="template">
82
- <% if component[:template_exists] %>
83
- <a href="<%= component[:template_link] %>" class="govuk-link" title="This file has <%= component[:template_lines] %> lines">
84
- <%= component[:template_lines] %>
85
- <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> template</span>
86
- </a>
87
- <% end %>
88
- </td>
89
- <td class="govuk-table__cell" data-component-type="stylesheet">
90
- <% if component[:stylesheet_exists] %>
91
- <a href="<%= component[:stylesheet_link] %>" class="govuk-link" title="This file has <%= component[:stylesheet_lines] %> lines">
92
- <%= component[:stylesheet_lines] %>
93
- <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> stylesheet</span>
94
- </a>
15
+ <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="stylesheet" title="Component has a stylesheet">
16
+ CSS
17
+ <% unless show_application_name %>
18
+ <span class="component__count"><%= passed_components[:component_numbers][:stylesheet] %></span>
95
19
  <% end %>
96
- </td>
97
- <td class="govuk-table__cell" data-component-type="print_stylesheet">
98
- <% if component[:print_stylesheet_exists] %>
99
- <span title="This component has a print stylesheet">
100
- Yes
101
- </span>
20
+ </th>
21
+ <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="print_stylesheet" title="Component has print styles">
22
+ Print CSS
23
+ <% unless show_application_name %>
24
+ <span class="component__count"><%= passed_components[:component_numbers][:print_stylesheet] %></span>
102
25
  <% end %>
103
- </td>
104
- <td class="govuk-table__cell" data-component-type="javascript">
105
- <% if component[:javascript_exists] %>
106
- <a href="<%= component[:javascript_link] %>" class="govuk-link" title="This file has <%= component[:javascript_lines] %> lines">
107
- <%= component[:javascript_lines] %>
108
- <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> javascript</span>
109
- </a>
26
+ </th>
27
+ <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="javascript" title="Component has JavaScript">
28
+ JS
29
+ <% unless show_application_name %>
30
+ <span class="component__count"><%= passed_components[:component_numbers][:javascript] %></span>
110
31
  <% end %>
111
- </td>
112
- <td class="govuk-table__cell" data-component-type="javascript_test">
113
- <% if component[:javascript_test_exists] %>
114
- <a href="<%= component[:javascript_test_link] %>" class="govuk-link" title="This file has <%= component[:javascript_test_lines] %> lines">
115
- <%= component[:javascript_test_lines] %>
116
- <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> javascript test</span>
117
- </a>
32
+ </th>
33
+ <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="javascript_test" title="Component has a JavaScript test file">
34
+ JS test
35
+ <% unless show_application_name %>
36
+ <span class="component__count"><%= passed_components[:component_numbers][:javascript_test] %></span>
118
37
  <% end %>
119
- </td>
120
- <td class="govuk-table__cell" data-component-type="uses-govuk-frontend-css">
121
- <% if component[:uses_govuk_frontend_css] %>
122
- <span title="Component includes styles imported from govuk-frontend">
123
- Yes
124
- </span>
38
+ </th>
39
+ <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="uses-govuk-frontend-css" title="Component includes styles imported from govuk-frontend">
40
+ GF CSS
41
+ <% unless show_application_name %>
42
+ <span class="component__count"><%= passed_components[:component_numbers][:uses_govuk_frontend_css] %></span>
125
43
  <% end %>
126
- </td>
127
- <td class="govuk-table__cell" data-component-type="uses-govuk-frontend-js">
128
- <% if component[:uses_govuk_frontend_js] %>
129
- <span title="Component includes JavaScript imported from govuk-frontend">
130
- Yes
131
- </span>
44
+ </th>
45
+ <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="uses-govuk-frontend-js" title="Component includes JavaScript imported from govuk-frontend">
46
+ GF JS
47
+ <% unless show_application_name %>
48
+ <span class="component__count"><%= passed_components[:component_numbers][:uses_govuk_frontend_js] %></span>
132
49
  <% end %>
133
- </td>
134
- <td class="govuk-table__cell" data-component-type="test">
135
- <% if component[:test_exists] %>
136
- <a href="<%= component[:test_link] %>" class="govuk-link" title="This file has <%= component[:test_lines] %> lines">
137
- <%= component[:test_lines] %>
138
- <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> test</span>
139
- </a>
50
+ </th>
51
+ <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="test" title="Component has a test file">
52
+ Test
53
+ <% unless show_application_name %>
54
+ <span class="component__count"><%= passed_components[:component_numbers][:test] %></span>
140
55
  <% end %>
141
- </td>
142
- <td class="govuk-table__cell" data-component-type="helper">
143
- <% if component[:helper_exists] %>
144
- <a href="<%= component[:helper_link] %>" class="govuk-link" title="This file has <%= component[:helper_lines] %> lines">
145
- <%= component[:helper_lines] %>
146
- <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> helper</span>
147
- </a>
56
+ </th>
57
+ <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="helper" title="Component has a helper file">
58
+ Helper
59
+ <% unless show_application_name %>
60
+ <span class="component__count"><%= passed_components[:component_numbers][:helper] %></span>
148
61
  <% end %>
149
- </td>
62
+ </th>
150
63
  </tr>
151
- <% end %>
152
- </tbody>
153
- </table>
64
+ </thead>
65
+ <tbody class="govuk-table__body" <% if show_application_name %> data-audit-list<% end %>>
66
+ <% passed_components[:component_file_details].each do |component| %>
67
+ <tr class="govuk-table__row" data-application="<%= component[:application] %>">
68
+ <th scope="row" class="govuk-table__header" data-component-type="total">
69
+ <% if component[:link] %>
70
+ <a href="<%= component[:link] %>" class="govuk-link">
71
+ <%= component[:name] %>
72
+ </a>
73
+ <% else %>
74
+ <%= component[:name] %>
75
+ <% end %>
76
+ <% if show_application_name %>
77
+ <span class="component__application-name">
78
+ <%= component[:application] %>
79
+ </span>
80
+ <% end %>
81
+ </th>
82
+ <td class="govuk-table__cell" data-component-type="template">
83
+ <% if component[:template_exists] %>
84
+ <a href="<%= component[:template_link] %>" class="govuk-link" title="This file has <%= component[:template_lines] %> lines">
85
+ <%= component[:template_lines] %>
86
+ <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> template</span>
87
+ </a>
88
+ <% end %>
89
+ </td>
90
+ <td class="govuk-table__cell" data-component-type="stylesheet">
91
+ <% if component[:stylesheet_exists] %>
92
+ <a href="<%= component[:stylesheet_link] %>" class="govuk-link" title="This file has <%= component[:stylesheet_lines] %> lines">
93
+ <%= component[:stylesheet_lines] %>
94
+ <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> stylesheet</span>
95
+ </a>
96
+ <% end %>
97
+ </td>
98
+ <td class="govuk-table__cell" data-component-type="print_stylesheet">
99
+ <% if component[:print_stylesheet_exists] %>
100
+ <span title="This component has a print stylesheet">
101
+ Yes
102
+ </span>
103
+ <% end %>
104
+ </td>
105
+ <td class="govuk-table__cell" data-component-type="javascript">
106
+ <% if component[:javascript_exists] %>
107
+ <a href="<%= component[:javascript_link] %>" class="govuk-link" title="This file has <%= component[:javascript_lines] %> lines">
108
+ <%= component[:javascript_lines] %>
109
+ <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> javascript</span>
110
+ </a>
111
+ <% end %>
112
+ </td>
113
+ <td class="govuk-table__cell" data-component-type="javascript_test">
114
+ <% if component[:javascript_test_exists] %>
115
+ <a href="<%= component[:javascript_test_link] %>" class="govuk-link" title="This file has <%= component[:javascript_test_lines] %> lines">
116
+ <%= component[:javascript_test_lines] %>
117
+ <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> javascript test</span>
118
+ </a>
119
+ <% end %>
120
+ </td>
121
+ <td class="govuk-table__cell" data-component-type="uses-govuk-frontend-css">
122
+ <% if component[:uses_govuk_frontend_css] %>
123
+ <span title="Component includes styles imported from govuk-frontend">
124
+ Yes
125
+ </span>
126
+ <% end %>
127
+ </td>
128
+ <td class="govuk-table__cell" data-component-type="uses-govuk-frontend-js">
129
+ <% if component[:uses_govuk_frontend_js] %>
130
+ <span title="Component includes JavaScript imported from govuk-frontend">
131
+ Yes
132
+ </span>
133
+ <% end %>
134
+ </td>
135
+ <td class="govuk-table__cell" data-component-type="test">
136
+ <% if component[:test_exists] %>
137
+ <a href="<%= component[:test_link] %>" class="govuk-link" title="This file has <%= component[:test_lines] %> lines">
138
+ <%= component[:test_lines] %>
139
+ <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> test</span>
140
+ </a>
141
+ <% end %>
142
+ </td>
143
+ <td class="govuk-table__cell" data-component-type="helper">
144
+ <% if component[:helper_exists] %>
145
+ <a href="<%= component[:helper_link] %>" class="govuk-link" title="This file has <%= component[:helper_lines] %> lines">
146
+ <%= component[:helper_lines] %>
147
+ <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> helper</span>
148
+ </a>
149
+ <% end %>
150
+ </td>
151
+ </tr>
152
+ <% end %>
153
+ </tbody>
154
+ </table>
155
+ </div>
@@ -1,4 +1,5 @@
1
1
  <% content_for :title, "Component audit" %>
2
+ <% content_for :body_classes, "table-container" %>
2
3
 
3
4
  <%= render "govuk_publishing_components/components/back_link", {
4
5
  href: "/component-guide",