govuk_publishing_components 23.12.3 → 24.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) 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/cookie-banner.js +0 -4
  6. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +44 -39
  7. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +0 -1
  8. data/app/assets/stylesheets/govuk_publishing_components/component_support.scss +0 -2
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +34 -17
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +14 -8
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +4 -4
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +35 -44
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +112 -47
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +8 -8
  15. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +0 -5
  16. data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss +2 -2
  17. data/app/models/govuk_publishing_components/component_doc.rb +1 -1
  18. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +2 -8
  19. data/app/views/govuk_publishing_components/components/_document_list.html.erb +12 -2
  20. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +9 -4
  21. data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +2 -2
  22. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +21 -0
  23. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +65 -1
  24. data/app/views/govuk_publishing_components/components/docs/document_list.yml +50 -7
  25. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +3 -3
  26. data/app/views/govuk_publishing_components/components/docs/layout_header.yml +11 -0
  27. data/app/views/govuk_publishing_components/components/docs/meta_tags.yml +99 -1
  28. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +9 -4
  29. data/config/initializers/assets.rb +3 -1
  30. data/config/locales/cy.yml +6 -1
  31. data/config/locales/en.yml +8 -3
  32. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +183 -2
  33. data/lib/govuk_publishing_components/presenters/meta_tags.rb +2 -0
  34. data/lib/govuk_publishing_components/version.rb +1 -1
  35. data/node_modules/govuk-frontend/govuk/all.js +58 -1
  36. data/node_modules/govuk-frontend/govuk/components/_all.scss +2 -0
  37. data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +25 -10
  38. data/node_modules/govuk-frontend/govuk/components/back-link/fixtures.json +12 -6
  39. data/node_modules/govuk-frontend/govuk/components/back-link/macro-options.json +4 -4
  40. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +34 -13
  41. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/macro-options.json +1 -0
  42. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/template.njk +2 -2
  43. data/node_modules/govuk-frontend/govuk/components/button/_index.scss +2 -0
  44. data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +74 -31
  45. data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +1 -0
  46. data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +1 -1
  47. data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +85 -15
  48. data/node_modules/govuk-frontend/govuk/components/character-count/macro-options.json +1 -1
  49. data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +145 -52
  50. data/node_modules/govuk-frontend/govuk/components/checkboxes/macro-options.json +2 -2
  51. data/node_modules/govuk-frontend/govuk/components/cookie-banner/_cookie-banner.scss +2 -0
  52. data/node_modules/govuk-frontend/govuk/components/cookie-banner/_index.scss +51 -0
  53. data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +425 -0
  54. data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro-options.json +132 -0
  55. data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro.njk +3 -0
  56. data/node_modules/govuk-frontend/govuk/components/cookie-banner/template.njk +63 -0
  57. data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +84 -34
  58. data/node_modules/govuk-frontend/govuk/components/date-input/macro-options.json +1 -1
  59. data/node_modules/govuk-frontend/govuk/components/date-input/template.njk +1 -1
  60. data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +35 -15
  61. data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +21 -10
  62. data/node_modules/govuk-frontend/govuk/components/error-message/macro-options.json +1 -0
  63. data/node_modules/govuk-frontend/govuk/components/error-summary/_index.scss +2 -12
  64. data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +86 -25
  65. data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +20 -10
  66. data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +60 -13
  67. data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +37 -18
  68. data/node_modules/govuk-frontend/govuk/components/footer/macro-options.json +8 -5
  69. data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +36 -18
  70. data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +2 -2
  71. data/node_modules/govuk-frontend/govuk/components/header/template.njk +4 -4
  72. data/node_modules/govuk-frontend/govuk/components/hint/fixtures.json +17 -8
  73. data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +130 -40
  74. data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +1 -1
  75. data/node_modules/govuk-frontend/govuk/components/inset-text/fixtures.json +17 -8
  76. data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +20 -11
  77. data/node_modules/govuk-frontend/govuk/components/label/macro-options.json +1 -1
  78. data/node_modules/govuk-frontend/govuk/components/notification-banner/README.md +15 -0
  79. data/node_modules/govuk-frontend/govuk/components/notification-banner/_index.scss +89 -0
  80. data/node_modules/govuk-frontend/govuk/components/notification-banner/_notification-banner.scss +2 -0
  81. data/node_modules/govuk-frontend/govuk/components/notification-banner/fixtures.json +212 -0
  82. data/node_modules/govuk-frontend/govuk/components/notification-banner/macro-options.json +68 -0
  83. data/node_modules/govuk-frontend/govuk/components/notification-banner/macro.njk +3 -0
  84. data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +61 -0
  85. data/node_modules/govuk-frontend/govuk/components/notification-banner/template.njk +47 -0
  86. data/node_modules/govuk-frontend/govuk/components/panel/fixtures.json +30 -13
  87. data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +20 -9
  88. data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +167 -50
  89. data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +97 -18
  90. data/node_modules/govuk-frontend/govuk/components/select/macro-options.json +1 -1
  91. data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +21 -9
  92. data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +118 -25
  93. data/node_modules/govuk-frontend/govuk/components/table/_index.scss +21 -0
  94. data/node_modules/govuk-frontend/govuk/components/table/fixtures.json +92 -22
  95. data/node_modules/govuk-frontend/govuk/components/table/macro-options.json +2 -2
  96. data/node_modules/govuk-frontend/govuk/components/tabs/fixtures.json +75 -18
  97. data/node_modules/govuk-frontend/govuk/components/tabs/macro-options.json +1 -1
  98. data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +28 -14
  99. data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +68 -17
  100. data/node_modules/govuk-frontend/govuk/components/warning-text/fixtures.json +19 -14
  101. data/node_modules/govuk-frontend/govuk/helpers/_links.scss +94 -0
  102. data/node_modules/govuk-frontend/govuk/objects/_all.scss +1 -0
  103. data/node_modules/govuk-frontend/govuk/objects/_button-group.scss +94 -0
  104. data/node_modules/govuk-frontend/govuk/settings/_colours-applied.scss +9 -0
  105. data/node_modules/govuk-frontend/govuk/settings/_typography-font.scss +3 -0
  106. data/node_modules/govuk-frontend/package.json +1 -1
  107. metadata +20 -18
  108. data/app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small-focus.svg +0 -4
  109. data/app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small.svg +0 -4
  110. data/app/assets/javascripts/govuk_publishing_components/components/header.js +0 -8
  111. data/app/assets/javascripts/govuk_publishing_components/lib/auto-track-event.js +0 -31
  112. data/app/assets/stylesheets/govuk_publishing_components/components/_chevron-banner.scss +0 -138
  113. data/app/assets/stylesheets/govuk_publishing_components/components/_list.scss +0 -1
  114. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_variables.scss +0 -27
  115. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_back-arrow.scss +0 -13
  116. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_clearfix.scss +0 -8
  117. data/app/views/govuk_publishing_components/components/_chevron_banner.html.erb +0 -19
  118. data/app/views/govuk_publishing_components/components/_subscription-links.html.erb +0 -85
  119. data/app/views/govuk_publishing_components/components/_translation-nav.html.erb +0 -33
  120. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_related_links.html.erb +0 -6
  121. data/app/views/govuk_publishing_components/components/docs/chevron_banner.yml +0 -33
  122. data/app/views/govuk_publishing_components/components/docs/subscription-links.yml +0 -103
  123. data/app/views/govuk_publishing_components/components/docs/translation-nav.yml +0 -139
@@ -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="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 %>
@@ -24,8 +24,8 @@
24
24
  <%= "data-id=#{tracking_id}" if tracking_id %>
25
25
  data-show-text="<%= t("govuk_component.step_by_step_nav.show", default: "show") %>"
26
26
  data-hide-text="<%= t("govuk_component.step_by_step_nav.hide", default: "hide") %>"
27
- data-show-all-text="<%= t("govuk_component.step_by_step_nav.show_all", default: "Show all") %>"
28
- data-hide-all-text="<%= t("govuk_component.step_by_step_nav.hide_all", default: "Hide all") %>"
27
+ data-show-all-text="<%= t("govuk_component.step_by_step_nav.show_all", default: "Show all steps") %>"
28
+ data-hide-all-text="<%= t("govuk_component.step_by_step_nav.hide_all", default: "Hide all steps") %>"
29
29
  >
30
30
  <ol class="gem-c-step-nav__steps">
31
31
  <% steps.each_with_index do |step, step_index| %>
@@ -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 %>
@@ -72,6 +72,11 @@ examples:
72
72
  - text: Check what age you can drive
73
73
  href: "/vehicles-can-drive"
74
74
  optional: false
75
+ - title: Testing the and
76
+ logic: and
77
+ contents:
78
+ - type: paragraph
79
+ text: hello hello what's UP
75
80
  - title: Driving lessons and practice
76
81
  contents:
77
82
  - type: paragraph
@@ -144,7 +149,33 @@ examples:
144
149
  - text: Find out what you’ll get
145
150
  href: "/settled-status-eu-citizens-families/what-settled-and-presettled-status-means"
146
151
  optional: false
147
- transition_countdown_exception:
152
+ with_brexit_cta:
153
+ description: For documents tagged with certain taxons defined in `brexit_cta_taxon_allow_list` we show a custom Brexit call to action element.
154
+ data:
155
+ content_item:
156
+ title: "Transport news story"
157
+ content_id: "3c402d90-fe77-49b9-a8aa-1800d4fc2b3d"
158
+ links:
159
+ ordered_related_items:
160
+ - title: Find an apprenticeship
161
+ base_path: /apply-apprenticeship
162
+ - title: Training and study at work
163
+ base_path: /training-study-work-your-rights
164
+ - title: Careers helpline for teenagers
165
+ base_path: /careers-helpline-for-teenagers
166
+ document_collections:
167
+ - title: Recruit an apprentice (formerly apprenticeship vacancies)
168
+ base_path: /government/collections/apprenticeship-vacancies
169
+ document_type: document_collection
170
+ - title: The future of jobs and skills
171
+ base_path: /government/collections/the-future-of-jobs-and-skills
172
+ document_type: document_collection
173
+ taxons:
174
+ - content_id: "a4038b29-b332-4f13-98b1-1c9709e216bc"
175
+ title: "Transport"
176
+ phase: "live"
177
+ with_brexit_cta_document_exception:
178
+ description: Illustrates an exception to showing the custom Brexit call to action element as defined in `brexit_cta_document_type_exceptions`.
148
179
  data:
149
180
  content_item:
150
181
  title: "30 creative teams awarded up to £100,000 each for Festival UK* 2022 R&D project"
@@ -164,3 +195,36 @@ examples:
164
195
  - title: The future of jobs and skills
165
196
  base_path: /government/collections/the-future-of-jobs-and-skills
166
197
  document_type: document_collection
198
+ taxons:
199
+ - content_id: "e2ca2f1a-0ff3-43ce-b813-16645ff27904"
200
+ title: "Society and culture"
201
+ phase: "live"
202
+ with_brexit_cta_taxon_exception:
203
+ description: Illustrates an exception to showing the custom Brexit call to action element as defined in `brexit_cta_taxon_exception_list`.
204
+ data:
205
+ content_item:
206
+ title: "Local transport news story"
207
+ content_id: "5c82db20-7631-11e4-a3cb-005056011aef"
208
+ links:
209
+ ordered_related_items:
210
+ - title: Find an apprenticeship
211
+ base_path: /apply-apprenticeship
212
+ - title: Training and study at work
213
+ base_path: /training-study-work-your-rights
214
+ - title: Careers helpline for teenagers
215
+ base_path: /careers-helpline-for-teenagers
216
+ document_collections:
217
+ - title: Recruit an apprentice (formerly apprenticeship vacancies)
218
+ base_path: /government/collections/apprenticeship-vacancies
219
+ document_type: document_collection
220
+ - title: The future of jobs and skills
221
+ base_path: /government/collections/the-future-of-jobs-and-skills
222
+ document_type: document_collection
223
+ taxons:
224
+ - content_id: "3b4d6319-fcef-4637-b35a-e3df76321894"
225
+ title: "Local transport"
226
+ phase: "live"
227
+ links:
228
+ parent_taxons:
229
+ - content_id: "a4038b29-b332-4f13-98b1-1c9709e216bc"
230
+ title: "Transport"
@@ -1,16 +1,16 @@
1
1
  name: Document list
2
2
  description: An ordered list of documents including a document type, when updated and a link.
3
3
  body: |
4
- Outputs a list to documents, based on an array of document data. This may include:
4
+ Outputs a list to documents, based on an array of document data. A "document" in this context can be an asset (such as a ODT or other downloadable document) or a web page.
5
+
6
+ The component can display:
5
7
 
6
- * document title
7
- * link to the document
8
- * last updated date object
9
- * document type
8
+ * a document title
9
+ * a link to the document
10
+ * a last updated date object
11
+ * a document type
10
12
 
11
13
  Tracking can be added to the links by supplying optional data attributes for each.
12
-
13
- Documents are presented in an ordered list as the component expects that the ordering of the documents is relevant.
14
14
  accessibility_criteria: |
15
15
  The component must:
16
16
 
@@ -195,6 +195,23 @@ examples:
195
195
  public_updated_at: 2017-07-19 15:01:48
196
196
  document_type: 'Statistical data set'
197
197
  subtext: 'First published during the 1996 Conservative Government'
198
+ without_top_border_on_list_element:
199
+ description: Several interfaces across GOV.UK benefit from the semantics of the document list but have their own bespoke designs, sometimes meaning that the visual border element doesn't gel with said interface. Removing it using the below attribute allows for cleaner visual fidelity in this instances.
200
+ data:
201
+ remove_top_border: true
202
+ items:
203
+ - link:
204
+ text: 'Department for Education – Statistics at DfE'
205
+ path: '/government/organisations/department-for-education/about/statistics'
206
+ metadata:
207
+ public_updated_at: 2017-07-19 15:01:48
208
+ document_type: 'Corporate information'
209
+ - link:
210
+ text: 'State-funded school inspections and outcomes: management information'
211
+ path: '/government/organisations/department-for-education/about/statistics'
212
+ metadata:
213
+ public_updated_at: 2017-07-19 15:01:48
214
+ document_type: 'Statistical data set'
198
215
  highlighted_result:
199
216
  description: Highlight one or more of the items in the list. This is used on finders to provide a 'top result' for a search. The `highlight_text` parameter is optional.
200
217
  data:
@@ -280,3 +297,29 @@ examples:
280
297
  document_type: 'Data tryloywder'
281
298
  locale:
282
299
  document_type: 'cy'
300
+ with_full_size_description_text:
301
+ data:
302
+ items:
303
+ - link:
304
+ text: 'Become an apprentice'
305
+ path: '/become-an-apprentice'
306
+ description: 'Becoming an apprentice - what to expect, apprenticeship levels, pay and training, making an application, complaining about an apprenticeship.'
307
+ full_size_description: true
308
+ with_rel_link_attribute:
309
+ description: |
310
+ The [rel attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel) is an option attribute to dictate the relationship between the document being linked to and the current page. This is predominantly used by search engines to help index journeys through a website.
311
+
312
+ On GOV.UK, this is typically used to dictate an external website being linked to with `rel="external"`, however this component supports:
313
+
314
+ - external
315
+ - nofollow
316
+ - noopener
317
+ - noreferrer
318
+ - opener
319
+ data:
320
+ items:
321
+ - link:
322
+ text: 'Report Fraud'
323
+ path: 'https://www.actionfraud.police.uk/contact-us'
324
+ rel: 'external'
325
+ description: "Contact Action Fraud to report fraud and cyber crime, or to tell them you've been the victim of a scam."
@@ -312,8 +312,8 @@ examples:
312
312
  block: |
313
313
  <div class="contact" id="contact_1017">
314
314
  <div class="content">
315
- <h3>Media enquiries</h3>
316
315
  <div class="vcard contact-inner">
316
+ <p>Media enquiries</p>
317
317
  <p class="adr">
318
318
  <span class="street-address">2 Marsham Street<br>London</span><br>
319
319
  <span class="postal-code">SW1P 4DF</span>
@@ -332,8 +332,8 @@ examples:
332
332
  <h2>This is a title</h2>
333
333
  <div class="contact" id="contact_1018">
334
334
  <div class="content">
335
- <h3>Media enquiries</h3>
336
335
  <div class="vcard contact-inner">
336
+ <p>Media enquiries</p>
337
337
  <p class="adr">
338
338
  <span class="street-address">2 Marsham Street<br>London</span><br>
339
339
  <span class="postal-code">SW1P 4DF</span>
@@ -349,8 +349,8 @@ examples:
349
349
  <p>This is a paragraph.</p>
350
350
  <div class="contact" id="contact_1019">
351
351
  <div class="content">
352
- <h3>Media enquiries</h3>
353
352
  <div class="vcard contact-inner">
353
+ <p>Media enquiries</p>
354
354
  <p class="adr">
355
355
  <span class="street-address">2 Marsham Street<br>London</span><br>
356
356
  <span class="postal-code">SW1P 4DF</span>
@@ -81,6 +81,17 @@ examples:
81
81
  - text: News and communications
82
82
  href: "item-6"
83
83
  active: true
84
+ with_navigation_link_data_attributes:
85
+ description: Supports adding data attributes i.e for tracking
86
+ data:
87
+ navigation_items:
88
+ - text: Departments
89
+ href: "item-1"
90
+ data:
91
+ module: "a custom attribute"
92
+ something_else: "some other custom attribute"
93
+ - text: Worldwide
94
+ href: "item-2"
84
95
  full_width:
85
96
  description: |
86
97
  This is difficult to preview because the preview windows are constrained, but the header will stretch to the size of its container.
@@ -4,11 +4,43 @@ body: |
4
4
  This takes a content-store links hash like object which it can then turn into
5
5
  the correct analytics identifier metadata tags.
6
6
 
7
- The code which reads the meta tags can be found <a href="https://github.com/alphagov/static/blob/master/app/assets/javascripts/analytics/static-analytics.js#L76-L96">in static-analytics.js</a>.
7
+ These are additionally used by the <a href="https://github.com/alphagov/govuk-browser-extension">GOV.UK browser extension</a> to provide details about a given page.
8
+
9
+ The code which reads the meta tags can be found <a href="https://github.com/alphagov/govuk_publishing_components/blob/master/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js">in custom-dimensions.js</a>.
8
10
  accessibility_criteria: |
9
11
  The analytics meta tags component should not be visible to any users.
10
12
  display_html: true
11
13
  examples:
14
+ with_core_tags:
15
+ data:
16
+ content_item:
17
+ document_type: "html_publication"
18
+ publishing_app: "whitehall"
19
+ schema_name: "html_publication"
20
+ content_id: "00000000-0000-0000-0000-00000000000"
21
+ navigation_page_type: "Taxon Page"
22
+ section: "business tax"
23
+ withdrawn_notice: true
24
+ with_content_history_tags:
25
+ description: |
26
+ The tags in this object will generate the `content-has-history` tag, set to true. This tag is triggered when either, within `content_item`:
27
+
28
+ 1. `public_updated_at` and `first_public_at` within `details` are both present and they aren't the same value
29
+ 2. `change_history` within `details` is present and it has a value of more than 1
30
+
31
+ See below example for specific details.
32
+ data:
33
+ content_item:
34
+ public_updated_at: "2021-01-15T12:30:45.000+00:00"
35
+ details:
36
+ first_public_at: "2020-11-03T09:15:00.000+00:00"
37
+ change_history: "5"
38
+ with_date_and_postcode_stripping_for_static_analytics:
39
+ data:
40
+ content_item:
41
+ local_assigns:
42
+ strip_dates_pii: true
43
+ strip_postcodes_pii: true
12
44
  with_organisations:
13
45
  data:
14
46
  content_item:
@@ -24,3 +56,69 @@ examples:
24
56
  links:
25
57
  world_locations:
26
58
  - analytics_identifier: WL3
59
+ with_political_tags:
60
+ data:
61
+ content_item:
62
+ details:
63
+ political: true
64
+ government:
65
+ current: true
66
+ slug: "2010-to-2015-conservative-and-liberal-democrat-coalition-government"
67
+ with_historic_political_tags:
68
+ data:
69
+ content_item:
70
+ details:
71
+ political: true
72
+ government:
73
+ current: false
74
+ slug: "2010-to-2015-conservative-and-liberal-democrat-coalition-government"
75
+ with_non-political_tags:
76
+ data:
77
+ content_item:
78
+ details:
79
+ political: false
80
+ government:
81
+ slug: "2010-to-2015-conservative-and-liberal-democrat-coalition-government"
82
+ with_taxonomy_added_via_document_type:
83
+ description: |
84
+ You can trigger taxonomy tag rendering by either including a `document_type` attributes of "taxon" or including the `parent_taxons` or `taxons` attributes under the `links` attribute.
85
+ data:
86
+ content_item:
87
+ content_id: "00000000-0000-0000-0000-000000000000"
88
+ document_type: "taxon"
89
+ base_path: "/example-of-taxons"
90
+ with_taxonomy_added_via_links:
91
+ data:
92
+ content_item:
93
+ links:
94
+ taxons:
95
+ - content_id: "11111111-1111-1111-1111-111111111111"
96
+ document_type: "taxon"
97
+ base_path: "/disabilities-benefits"
98
+ - content_id: "22222222-2222-2222-2222-222222222222"
99
+ document_type: "taxon"
100
+ base_path: "/childcare-parenting/childrens-social-care-providers"
101
+ links:
102
+ parent_taxons:
103
+ - content_id: "33333333-3333-3333-3333-333333333333"
104
+ document_type: "taxon"
105
+ base_path: "/childcare-parenting"
106
+ with_multiple_step_by_step_tags:
107
+ data:
108
+ content_item:
109
+ links:
110
+ part_of_step_navs:
111
+ - content_id: "00000000-0000-0000-0000-000000000000"
112
+ - content_id: "11111111-1111-1111-1111-111111111111"
113
+ with_primary_step_by_step_tag:
114
+ data:
115
+ content_item:
116
+ links:
117
+ part_of_step_navs:
118
+ - content_id: "00000000-0000-0000-0000-000000000000"
119
+ with_secondary_step_by_step_tag:
120
+ data:
121
+ content_item:
122
+ links:
123
+ secondary_to_step_navs:
124
+ - content_id: "22222222-2222-2222-2222-222222222222"
@@ -1,16 +1,21 @@
1
1
  <% if navigation_items.any? %>
2
2
  <button role="button" class="govuk-header__menu-button gem-c-header__menu-button govuk-js-header-toggle" aria-controls="navigation" aria-label="Show or hide Top Level Navigation">Menu</button>
3
- <%= tag.nav(class: "gem-c-header__nav", 'aria-label': navigation_aria_label ? navigation_aria_label : nil ) do %>
3
+ <%= tag.nav class: "gem-c-header__nav", aria: { label: navigation_aria_label } do %>
4
4
  <ul id="navigation" class="govuk-header__navigation govuk-header__navigation--end">
5
5
  <% navigation_items.each_with_index do |item, index| %>
6
- <li class="govuk-header__navigation-item <%= "govuk-header__navigation-item--active" if item[:active] %>
7
- <%= "govuk-header__navigation-item--collapsed-menu-only" if item[:show_only_in_collapsed_menu] %>">
6
+ <%
7
+ li_classes = %w(govuk-header__navigation-item)
8
+ li_classes << "govuk-header__navigation-item--active" if item[:active]
9
+ li_classes << "govuk-header__navigation-item--collapsed-menu-only" if item[:show_only_in_collapsed_menu]
10
+ %>
11
+ <%= tag.li class: li_classes do %>
8
12
  <%= link_to(
9
13
  item[:text],
10
14
  item[:href],
11
15
  class: 'govuk-header__link',
16
+ data: item[:data],
12
17
  ) %>
13
- </li>
18
+ <% end %>
14
19
  <% end %>
15
20
  </ul>
16
21
  <% end %>
@@ -25,8 +25,10 @@ Rails.application.config.assets.precompile += %w[
25
25
  govuk_publishing_components/search-button.png
26
26
  govuk_publishing_components/icon-file-download.svg
27
27
  govuk_publishing_components/icon-important.svg
28
- govuk_publishing_components/chevron-banner/*.svg
29
28
  govuk_publishing_components/crests/*.png
29
+ govuk_publishing_components/take-action-amber.svg
30
+ govuk_publishing_components/take-action-green.svg
31
+ govuk_publishing_components/take-action-red.svg
30
32
  ]
31
33
 
32
34
  # GOV.UK Frontend assets
@@ -12,4 +12,9 @@ cy:
12
12
  transition:
13
13
  title: "Brexit"
14
14
  link_path: "/transition.cy"
15
- link_text: "Darganfyddwch sut mae’r rheolau Brexit newydd yn effeithio arnoch chi"
15
+ link_text: "Gwiriwch beth sydd angen i chi ei wneud"
16
+ take_action_list:
17
+ red: Gwiriwch
18
+ amber: Newidiwch
19
+ green: Ewch
20
+ aria_label: Ymgyrch slogan Brexit, Gwiriwch, Newidiwch, Ewch.