govuk_publishing_components 23.13.1 → 24.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/take-action-amber.svg +4 -0
  3. data/app/assets/images/govuk_publishing_components/take-action-green.svg +4 -0
  4. data/app/assets/images/govuk_publishing_components/take-action-red.svg +4 -0
  5. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +286 -4
  6. data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +0 -4
  7. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +23 -14
  8. data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills/common.js +8 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +0 -1
  10. data/app/assets/stylesheets/govuk_publishing_components/component_support.scss +0 -2
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +298 -14
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +34 -17
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +14 -8
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +4 -4
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +35 -44
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +21 -5
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +105 -48
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +8 -8
  19. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +0 -5
  20. data/app/assets/stylesheets/govuk_publishing_components/components/print/_accordion.scss +17 -9
  21. data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss +2 -2
  22. data/app/assets/stylesheets/govuk_publishing_components/govuk_frontend_support.scss +1 -11
  23. data/app/models/govuk_publishing_components/audit_applications.rb +1 -1
  24. data/app/models/govuk_publishing_components/component_doc.rb +1 -1
  25. data/app/views/govuk_publishing_components/audit/show.html.erb +26 -26
  26. data/app/views/govuk_publishing_components/components/_accordion.html.erb +13 -20
  27. data/app/views/govuk_publishing_components/components/_attachment.html.erb +3 -3
  28. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +2 -8
  29. data/app/views/govuk_publishing_components/components/_document_list.html.erb +12 -2
  30. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +9 -4
  31. data/app/views/govuk_publishing_components/components/attachment/{_thumbnail_document.svg → _thumbnail_document.html.erb} +0 -0
  32. data/app/views/govuk_publishing_components/components/attachment/{_thumbnail_generic.svg → _thumbnail_generic.html.erb} +0 -0
  33. data/app/views/govuk_publishing_components/components/attachment/{_thumbnail_spreadsheet.svg → _thumbnail_spreadsheet.html.erb} +0 -0
  34. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +21 -0
  35. data/app/views/govuk_publishing_components/components/docs/accordion.yml +8 -3
  36. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +65 -1
  37. data/app/views/govuk_publishing_components/components/docs/document_list.yml +50 -7
  38. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +3 -3
  39. data/app/views/govuk_publishing_components/components/docs/layout_header.yml +11 -0
  40. data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +1 -1
  41. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +9 -4
  42. data/config/initializers/assets.rb +3 -1
  43. data/config/locales/cy.yml +6 -1
  44. data/config/locales/en.yml +6 -1
  45. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +183 -2
  46. data/lib/govuk_publishing_components/version.rb +1 -1
  47. data/node_modules/govuk-frontend/govuk/all.js +1 -1
  48. data/node_modules/govuk-frontend/govuk/components/_all.scss +1 -0
  49. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +10 -10
  50. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/template.njk +2 -2
  51. data/node_modules/govuk-frontend/govuk/components/button/_index.scss +2 -0
  52. data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +1 -0
  53. data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +1 -1
  54. data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +13 -0
  55. data/node_modules/govuk-frontend/govuk/components/cookie-banner/_cookie-banner.scss +2 -0
  56. data/node_modules/govuk-frontend/govuk/components/cookie-banner/_index.scss +51 -0
  57. data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +425 -0
  58. data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro-options.json +132 -0
  59. data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro.njk +3 -0
  60. data/node_modules/govuk-frontend/govuk/components/cookie-banner/template.njk +63 -0
  61. data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +2 -2
  62. data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +18 -18
  63. data/node_modules/govuk-frontend/govuk/components/header/template.njk +4 -4
  64. data/node_modules/govuk-frontend/govuk/components/table/_index.scss +21 -0
  65. data/node_modules/govuk-frontend/govuk/components/table/macro-options.json +2 -2
  66. data/node_modules/govuk-frontend/govuk/objects/_all.scss +1 -0
  67. data/node_modules/govuk-frontend/govuk/objects/_button-group.scss +94 -0
  68. data/node_modules/govuk-frontend/package.json +1 -1
  69. metadata +16 -21
  70. data/app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small-focus.svg +0 -4
  71. data/app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small.svg +0 -4
  72. data/app/assets/javascripts/govuk_publishing_components/components/header.js +0 -8
  73. data/app/assets/javascripts/govuk_publishing_components/lib/auto-track-event.js +0 -31
  74. data/app/assets/stylesheets/govuk_publishing_components/components/_chevron-banner.scss +0 -138
  75. data/app/assets/stylesheets/govuk_publishing_components/components/_list.scss +0 -1
  76. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_variables.scss +0 -27
  77. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_back-arrow.scss +0 -13
  78. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_clearfix.scss +0 -8
  79. data/app/views/govuk_publishing_components/components/_chevron_banner.html.erb +0 -19
  80. data/app/views/govuk_publishing_components/components/_subscription-links.html.erb +0 -85
  81. data/app/views/govuk_publishing_components/components/_translation-nav.html.erb +0 -33
  82. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_related_links.html.erb +0 -6
  83. data/app/views/govuk_publishing_components/components/docs/chevron_banner.yml +0 -33
  84. data/app/views/govuk_publishing_components/components/docs/subscription-links.yml +0 -103
  85. data/app/views/govuk_publishing_components/components/docs/translation-nav.yml +0 -139
@@ -1,12 +1,12 @@
1
1
  .gem-c-success-alert {
2
- color: $gem-text-colour;
3
- padding: $gem-spacing-scale-3;
4
- border: $gem-border-width-mobile solid $gem-success-colour;
2
+ color: $govuk-text-colour;
3
+ padding: govuk-spacing(3);
4
+ border: $govuk-border-width-narrow solid $govuk-success-colour;
5
5
  @include govuk-responsive-margin(8, "bottom");
6
6
 
7
7
  @include govuk-media-query($from: tablet) {
8
- padding: $gem-spacing-scale-4;
9
- border-width: $gem-border-width-tablet;
8
+ padding: govuk-spacing(4);
9
+ border-width: $govuk-border-width;
10
10
  }
11
11
  }
12
12
 
@@ -17,10 +17,10 @@
17
17
 
18
18
  .gem-c-success-summary__title {
19
19
  margin-top: 0;
20
- margin-bottom: $gem-spacing-scale-3;
20
+ margin-bottom: govuk-spacing(3);
21
21
 
22
22
  @include govuk-media-query($from: tablet) {
23
- margin-bottom: $gem-spacing-scale-4;
23
+ margin-bottom: govuk-spacing(4);
24
24
  }
25
25
 
26
26
  @include govuk-font(24, $weight: bold);
@@ -32,5 +32,5 @@
32
32
  }
33
33
 
34
34
  .gem-c-success-alert:focus {
35
- outline: $gem-focus-width solid $gem-focus-colour;
35
+ outline: $govuk-focus-width solid $govuk-focus-colour;
36
36
  }
@@ -25,11 +25,6 @@
25
25
  float: none;
26
26
  width: 100%;
27
27
 
28
- h3 {
29
- @include govuk-font($size: 19, $weight: bold);
30
- margin-bottom: 5px;
31
- }
32
-
33
28
  .email-url-number {
34
29
  .email {
35
30
  word-wrap: break-word;
@@ -2,30 +2,38 @@
2
2
  //
3
3
  // TODO: Replace with the print styles that will come from GOV.UK Frontend.
4
4
 
5
+ @import "govuk_publishing_components/component_support";
5
6
  @import "../accordion";
6
7
 
7
8
  // Open all of the accordion sections.
8
- .govuk-accordion__section-content {
9
+ .gem-c-accordion__section-content {
9
10
  display: block !important; // stylelint-disable-line declaration-no-important
10
11
  }
11
12
 
12
13
  // Change the colour from the blue link colour to black.
13
- .govuk-accordion__section-button {
14
+ .gem-c-accordion__section-button {
14
15
  color: govuk-colour("black") !important; // stylelint-disable-line declaration-no-important
15
16
  }
16
17
 
18
+ // Removing spacing
19
+ .gem-c-accordion__section-header {
20
+ padding-bottom: govuk-spacing(1);
21
+ }
22
+
17
23
  // Change the summary subheading size.
18
- .govuk-accordion__section-summary {
24
+ .gem-c-accordion__section-summary {
19
25
  @include govuk-typography-common;
20
26
  @include govuk-typography-responsive($size: 16, $important: true);
27
+ }
21
28
 
22
- .govuk-accordion--condensed & {
23
- @include govuk-typography-responsive($size: 14, $important: true);
24
- }
29
+ // Hide the unusable "Show all sections" button and the "Chevron" icons.
30
+ .gem-c-accordion__open-all,
31
+ .gem-c-accordion__icon,
32
+ .gem-c-accordion__toggle-link {
33
+ display: none !important; // stylelint-disable-line declaration-no-important
25
34
  }
26
35
 
27
- // Hide the unusable "Open all" button and the "+" icons.
28
- .govuk-accordion__open-all,
29
- .govuk-accordion__icon {
36
+ // Hide all hidden content
37
+ .gem-c-accordion .govuk-visually-hidden {
30
38
  display: none !important; // stylelint-disable-line declaration-no-important
31
39
  }
@@ -1,7 +1,7 @@
1
1
  $grey-2: #bfc1c3;
2
2
  $white: #ffffff;
3
3
  $number-circle-size: 35px;
4
- $stroke-width: 3px;
4
+ $stroke-width: 1px;
5
5
 
6
6
  .gem-c-step-nav:not(.gem-c-step-nav--large),
7
7
  .gem-c-step-nav__controls,
@@ -63,7 +63,7 @@ $stroke-width: 3px;
63
63
  }
64
64
 
65
65
  .gem-c-step-nav__circle--number {
66
- border: solid 3px $grey-2;
66
+ border: solid 1px $grey-2;
67
67
  }
68
68
 
69
69
  .gem-c-step-nav__step,
@@ -1,14 +1,4 @@
1
1
  // This file should be included in an application prior to specific components
2
2
  // It provides govuk-frontend but adds no weight to the compiled CSS
3
3
  @import "components/helpers/govuk-frontend-settings";
4
- @import "govuk/settings/all";
5
- @import "govuk/tools/all";
6
- @import "govuk/helpers/all";
7
- $govuk-colours-organisations: map-merge(
8
- $govuk-colours-organisations,
9
- (
10
- "foreign-commonwealth-development-office": (
11
- colour: #012169
12
- )
13
- )
14
- );
4
+ @import "govuk/base";
@@ -14,7 +14,7 @@ module GovukPublishingComponents
14
14
  stylesheets = Dir["#{path}/app/assets/stylesheets/**/*.scss"]
15
15
  javascripts = Dir["#{path}/app/assets/javascripts/**/*.js"]
16
16
 
17
- find_components = /(?<=govuk_publishing_components\/components\/)[\/a-zA-Z_-]+(?=['"])/
17
+ find_components = /(?<=govuk_publishing_components\/components\/)[a-zA-Z_-]+(?=['"])/
18
18
 
19
19
  @find_all_stylesheets = /@import ["']{1}govuk_publishing_components\/all_components/
20
20
  find_stylesheets = /(?<=@import ["']{1}govuk_publishing_components\/components\/)(?!print\/)+[a-zA-Z_-]+(?=['"])/
@@ -69,7 +69,7 @@ module GovukPublishingComponents
69
69
  end
70
70
 
71
71
  def github_search_url
72
- params = { q: "org:alphagov #{partial_path}", type: "Code" }
72
+ params = { q: "org:alphagov components/components/#{id}", type: "Code" }
73
73
  "https://github.com/search?#{params.to_query}"
74
74
  end
75
75
 
@@ -39,16 +39,16 @@
39
39
  </div>
40
40
  </details>
41
41
 
42
- <div class="govuk-accordion" data-module="govuk-accordion" id="accordion-with-summary-sections">
42
+ <div class="gem-c-accordion" data-module="gem-c-accordion" id="accordion-with-summary-sections">
43
43
  <% @applications.each_with_index do |application, index| %>
44
- <div class="govuk-accordion__section ">
45
- <div class="govuk-accordion__section-header">
46
- <h2 class="govuk-accordion__section-heading">
47
- <span class="govuk-accordion__section-button" id="accordion-with-summary-sections-heading-<%= index %>">
44
+ <div class="gem-c-accordion__section ">
45
+ <div class="gem-c-accordion__section-header">
46
+ <h2 class="gem-c-accordion__section-heading">
47
+ <span class="gem-c-accordion__section-button" id="accordion-with-summary-sections-heading-<%= index %>">
48
48
  <%= application[:name] %>
49
49
  </span>
50
50
  </h2>
51
- <div class="govuk-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-<%= index %>">
51
+ <div class="gem-c-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-<%= index %>">
52
52
  <% if application[:application_found] %>
53
53
  Warnings:
54
54
  <% if application[:warning_count] > 0 %>
@@ -61,7 +61,7 @@
61
61
  <% end %>
62
62
  </div>
63
63
  </div>
64
- <div id="accordion-with-summary-sections-content-<%= index %>" class="govuk-accordion__section-content" aria-labelledby="accordion-with-summary-sections-heading-<%= index %>">
64
+ <div id="accordion-with-summary-sections-content-<%= index %>" class="gem-c-accordion__section-content" aria-labelledby="accordion-with-summary-sections-heading-<%= index %>">
65
65
  <% if application[:application_found] %>
66
66
  <% application[:warnings].each do |warning| %>
67
67
  <p class="govuk-body">
@@ -144,19 +144,19 @@
144
144
  } %>
145
145
 
146
146
  <% if @components.any? %>
147
- <div class="govuk-accordion" data-module="govuk-accordion" id="accordion-default">
148
- <div class="govuk-accordion__section ">
149
- <div class="govuk-accordion__section-header">
150
- <h2 class="govuk-accordion__section-heading">
151
- <span class="govuk-accordion__section-button" id="accordion-default-heading-1">
147
+ <div class="gem-c-accordion" data-module="gem-c-accordion" id="accordion-default">
148
+ <div class="gem-c-accordion__section ">
149
+ <div class="gem-c-accordion__section-header">
150
+ <h2 class="gem-c-accordion__section-heading">
151
+ <span class="gem-c-accordion__section-button" id="accordion-default-heading-1">
152
152
  Component files
153
153
  </span>
154
154
  </h2>
155
- <div class="govuk-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-1">
155
+ <div class="gem-c-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-1">
156
156
  Lists what files each component has
157
157
  </div>
158
158
  </div>
159
- <div id="accordion-default-content-1" class="govuk-accordion__section-content" aria-labelledby="accordion-default-heading-1">
159
+ <div id="accordion-default-content-1" class="gem-c-accordion__section-content" aria-labelledby="accordion-default-heading-1">
160
160
  <table class="govuk-table">
161
161
  <thead class="govuk-table__head">
162
162
  <tr class="govuk-table__row">
@@ -206,18 +206,18 @@
206
206
  </div>
207
207
  </div>
208
208
 
209
- <div class="govuk-accordion__section ">
210
- <div class="govuk-accordion__section-header">
211
- <h2 class="govuk-accordion__section-heading">
212
- <span class="govuk-accordion__section-button" id="accordion-default-heading-2">
209
+ <div class="gem-c-accordion__section ">
210
+ <div class="gem-c-accordion__section-header">
211
+ <h2 class="gem-c-accordion__section-heading">
212
+ <span class="gem-c-accordion__section-button" id="accordion-default-heading-2">
213
213
  Components containing components
214
214
  </span>
215
215
  </h2>
216
- <div class="govuk-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-2">
216
+ <div class="gem-c-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-2">
217
217
  Shows which components contain other components
218
218
  </div>
219
219
  </div>
220
- <div id="accordion-default-content-2" class="govuk-accordion__section-content" aria-labelledby="accordion-default-heading-2">
220
+ <div id="accordion-default-content-2" class="gem-c-accordion__section-content" aria-labelledby="accordion-default-heading-2">
221
221
  <dl class="govuk-summary-list">
222
222
  <% @components[:components_containing_components].each do |component| %>
223
223
  <div class="govuk-summary-list__row">
@@ -232,18 +232,18 @@
232
232
  </dl>
233
233
  </div>
234
234
  </div>
235
- <div class="govuk-accordion__section ">
236
- <div class="govuk-accordion__section-header">
237
- <h2 class="govuk-accordion__section-heading">
238
- <span class="govuk-accordion__section-button" id="accordion-default-heading-2">
235
+ <div class="gem-c-accordion__section ">
236
+ <div class="gem-c-accordion__section-header">
237
+ <h2 class="gem-c-accordion__section-heading">
238
+ <span class="gem-c-accordion__section-button" id="accordion-default-heading-2">
239
239
  Components by application
240
240
  </span>
241
241
  </h2>
242
- <div class="govuk-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-2">
242
+ <div class="gem-c-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-2">
243
243
  Shows which applications use each component
244
244
  </div>
245
245
  </div>
246
- <div id="accordion-default-content-2" class="govuk-accordion__section-content" aria-labelledby="accordion-default-heading-2">
246
+ <div id="accordion-default-content-2" class="gem-c-accordion__section-content" aria-labelledby="accordion-default-heading-2">
247
247
  <% if @components[:components_by_application].any? %>
248
248
  <dl class="govuk-summary-list">
249
249
  <% @components[:components_by_application].each do |component| %>
@@ -6,42 +6,35 @@
6
6
  items ||= []
7
7
  condensed ||= false
8
8
 
9
- accordion_classes = %w(gem-c-accordion govuk-accordion)
10
- accordion_classes << 'govuk-accordion--condensed' if condensed
9
+ accordion_classes = %w(gem-c-accordion)
10
+ accordion_classes << 'gem-c-accordion--condensed' if condensed
11
11
  accordion_classes << (shared_helper.get_margin_bottom)
12
12
 
13
13
  data_attributes ||= {}
14
- data_attributes[:module] = 'govuk-accordion'
14
+ data_attributes[:module] = 'gem-accordion'
15
15
  %>
16
16
  <% if items.any? %>
17
17
  <%= tag.div(class: accordion_classes, id: id, data: data_attributes) do %>
18
18
  <% items.each_with_index do |item, i| %>
19
19
  <%
20
- # Nunjucks starts a loop on 1 and the client side JavaScript also
21
- # adopts this behaviour. To prevent things from breaking, the index
22
- # here also need to be increase by one. (Nunjucks is used by GOV.UK
23
- # Frontend, which this component is based on.)
24
20
  index = i + 1
25
21
 
26
22
  item[:data_attributes] ||= nil
27
23
 
28
- section_classes = %w(govuk-accordion__section)
29
- section_classes << 'govuk-accordion__section--expanded' if item[:expanded]
24
+ section_classes = %w(gem-c-accordion__section)
25
+ section_classes << 'gem-c-accordion__section--expanded' if item[:expanded]
30
26
 
31
- summary_classes = %w(govuk-accordion__section-summary govuk-body)
27
+ summary_classes = %w(gem-c-accordion__section-summary govuk-body)
32
28
  %>
33
- <%= tag.div(class: section_classes) do %>
34
- <div class="govuk-accordion__section-header">
35
- <%=
36
- content_tag(
37
- shared_helper.get_heading_level,
38
- content_tag('span', item[:heading][:text], class: "govuk-accordion__section-button", id: "#{id}-heading-#{index}", data: item[:data_attributes]),
39
- class: 'govuk-accordion__section-heading'
40
- )
41
- %>
29
+
30
+ <%= tag.section(class: section_classes) do %>
31
+ <div class="gem-c-accordion__section-header">
32
+ <%= content_tag(shared_helper.get_heading_level, class: 'gem-c-accordion__section-heading') do %>
33
+ <%= tag.span(item[:heading][:text], id: "#{id}-heading-#{index}", data: item[:data_attributes], class: 'gem-c-accordion__section-button') %>
34
+ <% end %>
42
35
  <%= tag.div(item[:summary][:text], id: "#{id}-summary-#{index}", class: summary_classes) if item[:summary].present? %>
43
36
  </div>
44
- <%= tag.div(item[:content][:html], id: "#{id}-content-#{index}", class: "govuk-accordion__section-content", 'aria-labelledby': "#{id}-heading-#{index}") %>
37
+ <%= tag.div(item[:content][:html], id: "#{id}-content-#{index}", class: "gem-c-accordion__section-content", 'aria-label': "#{item[:heading][:text]}") %>
45
38
  <% end %>
46
39
  <% end %>
47
40
  <% end %>
@@ -41,11 +41,11 @@
41
41
  "aria-hidden": true,
42
42
  data: data_attributes do %>
43
43
  <% if attachment.document? %>
44
- <%= render "govuk_publishing_components/components/attachment/thumbnail_document.svg" %>
44
+ <%= render "govuk_publishing_components/components/attachment/thumbnail_document" %>
45
45
  <% elsif attachment.spreadsheet? %>
46
- <%= render "govuk_publishing_components/components/attachment/thumbnail_spreadsheet.svg" %>
46
+ <%= render "govuk_publishing_components/components/attachment/thumbnail_spreadsheet" %>
47
47
  <% else %>
48
- <%= render "govuk_publishing_components/components/attachment/thumbnail_generic.svg" %>
48
+ <%= render "govuk_publishing_components/components/attachment/thumbnail_generic" %>
49
49
  <% end %>
50
50
  <% end %>
51
51
  <% end %>
@@ -2,12 +2,6 @@
2
2
  <% shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns) %>
3
3
 
4
4
  <div class="gem-c-contextual-sidebar">
5
- <% if navigation.show_brexit_related_links? && navigation.step_by_step_count.zero? %>
6
- <%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_related_links' %>
7
- <% elsif navigation.step_by_step_count.zero? && !navigation.transition_countdown_exception? %>
8
- <%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta' %>
9
- <% end %>
10
-
11
5
  <% if navigation.content_tagged_to_a_reasonable_number_of_step_by_steps? %>
12
6
  <%# Rendering step by step related items because there are a few but not too many of them %>
13
7
  <%= render 'govuk_publishing_components/components/step_by_step_nav_related', links: navigation.step_nav_helper.related_links %>
@@ -30,7 +24,7 @@
30
24
  } %>
31
25
  <% end %>
32
26
 
33
- <% if navigation.show_brexit_related_links? && navigation.step_by_step_count > 0 %>
34
- <%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_related_links' %>
27
+ <% if navigation.show_brexit_cta? || navigation.show_brexit_related_links? %>
28
+ <%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta' %>
35
29
  <% end %>
36
30
  </div>
@@ -5,6 +5,7 @@
5
5
  classes << " gem-c-document-list--top-margin" if local_assigns[:margin_top]
6
6
  classes << " gem-c-document-list--bottom-margin" if local_assigns[:margin_bottom]
7
7
  classes << " gem-c-document-list--no-underline" if local_assigns[:remove_underline]
8
+ classes << " gem-c-document-list--no-top-border" if local_assigns[:remove_top_border]
8
9
 
9
10
  within_multitype_list ||= false
10
11
  within_multitype_list_class = " gem-c-document-list__multi-list" if within_multitype_list
@@ -28,12 +29,21 @@
28
29
  item_classes = "gem-c-document-list__item-title #{brand_helper.color_class} #{title_with_context_class if item[:link][:context]}"
29
30
 
30
31
  if item[:link][:path]
32
+ rel = [
33
+ "external",
34
+ "nofollow",
35
+ "noopener",
36
+ "noreferrer",
37
+ "opener",
38
+ ].include?(item[:link][:rel]) ? item[:link][:rel] : nil
39
+
31
40
  link_to(
32
41
  item[:link][:text],
33
42
  item[:link][:path],
34
43
  data: item[:link][:data_attributes],
35
44
  class: "#{item_classes} gem-c-document-list__item-link",
36
- lang: item[:link][:locale].presence
45
+ lang: item[:link][:locale].presence,
46
+ rel: rel,
37
47
  )
38
48
  else
39
49
  content_tag(
@@ -50,7 +60,7 @@
50
60
  <% end %>
51
61
 
52
62
  <% if item[:link][:description] %>
53
- <p class="gem-c-document-list__item-description" ><%= item[:link][:description] %></p>
63
+ <p class="gem-c-document-list__item-description <%= "gem-c-document-list__item-description--full-size" if item[:link][:full_size_description] %>"><%= item[:link][:description] %></p>
54
64
  <% end %>
55
65
 
56
66
  <% if item[:metadata] %>
@@ -2,9 +2,11 @@
2
2
  meta ||= []
3
3
  navigation ||= []
4
4
  with_border ||= false
5
+ classes = %w(gem-c-layout-footer govuk-footer)
6
+ classes << "gem-c-layout-footer--border" if with_border
5
7
  %>
6
- <footer class="gem-c-layout-footer govuk-footer <%= "gem-c-layout-footer--border" if with_border %> role="contentinfo">
7
- <div class="govuk-width-container ">
8
+ <%= tag.footer class: classes, role: "contentinfo" do %>
9
+ <div class="govuk-width-container" data-module="gem-track-click">
8
10
  <% if navigation.any? %>
9
11
  <div class="govuk-footer__navigation">
10
12
  <% navigation.each do |item| %>
@@ -29,7 +31,10 @@
29
31
  <% if item[:href] && item[:text] %>
30
32
  <li class="govuk-footer__list-item">
31
33
  <%
32
- attributes = { class: "govuk-footer__link" }.merge(item.fetch(:attributes, {}))
34
+ attributes = {
35
+ class: "govuk-footer__link",
36
+ "data-track-category": "footerClicked"
37
+ }.merge(item.fetch(:attributes, {}))
33
38
  attributes[:rel] = "noopener" if attributes[:target] == "_blank" && !attributes[:rel]
34
39
  %>
35
40
  <%= link_to item[:text], item[:href], attributes %>
@@ -80,4 +85,4 @@
80
85
  </div>
81
86
  </div>
82
87
  </div>
83
- </footer>
88
+ <% end %>
@@ -14,7 +14,28 @@
14
14
  <%= link_to link_path,
15
15
  class: "govuk-link gem-c-contextual-sidebar__brexit-cta",
16
16
  data: data_attributes,
17
+ aria: { label: "#{t("components.related_navigation.take_action_list.aria_label")} #{link_text}" },
17
18
  lang: shared_helper.t_locale("components.related_navigation.transition.title") do %>
18
19
  <h2 class="gem-c-contextual-sidebar__brexit-heading"><%= t("components.related_navigation.transition.title") %></h2>
20
+ <ul class="govuk-list gem-c-contextual-sidebar__take-action-traffic-lights">
21
+ <li>
22
+ <%= image_tag 'govuk_publishing_components/take-action-red.svg', class: "gem-c-contextual-sidebar__take-action-traffic-lists-icon", alt: "" %>
23
+ <span class="gem-c-contextual-sidebar__take-action-traffic-lists-text">
24
+ <%= t("components.related_navigation.take_action_list.red") %>
25
+ </span>
26
+ </li>
27
+ <li>
28
+ <%= image_tag 'govuk_publishing_components/take-action-amber.svg', class: "gem-c-contextual-sidebar__take-action-traffic-lists-icon", alt: "" %>
29
+ <span class="gem-c-contextual-sidebar__take-action-traffic-lists-text">
30
+ <%= t("components.related_navigation.take_action_list.amber") %>
31
+ </span>
32
+ </li>
33
+ <li>
34
+ <%= image_tag 'govuk_publishing_components/take-action-green.svg', class: "gem-c-contextual-sidebar__take-action-traffic-lists-icon", alt: "" %>
35
+ <span class="gem-c-contextual-sidebar__take-action-traffic-lists-text">
36
+ <%= t("components.related_navigation.take_action_list.green") %>
37
+ </span>
38
+ </li>
39
+ </ul>
19
40
  <p class="gem-c-contextual-sidebar__brexit-text"><%= link_text %></p>
20
41
  <% end %>