govuk_publishing_components 37.1.1 → 37.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +6 -0
  3. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-schemas.js +2 -2
  4. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-settings.js +109 -0
  5. data/app/assets/javascripts/govuk_publishing_components/load-analytics.js +83 -60
  6. data/app/assets/stylesheets/component_guide/application.scss +1 -1
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +1 -1
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +3 -3
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_modal-dialogue.scss +1 -1
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +2 -2
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +1 -1
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +1 -1
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +10 -10
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +1 -1
  15. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +2 -2
  16. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +1 -1
  17. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_grid-helper.scss +1 -1
  18. data/app/models/govuk_publishing_components/audit_applications.rb +1 -1
  19. data/app/models/govuk_publishing_components/component_docs.rb +1 -1
  20. data/app/views/govuk_publishing_components/components/_details.html.erb +18 -2
  21. data/app/views/govuk_publishing_components/components/_image_card.html.erb +11 -11
  22. data/app/views/govuk_publishing_components/components/docs/details.yml +21 -0
  23. data/app/views/govuk_publishing_components/components/docs/image_card.yml +18 -11
  24. data/lib/govuk_publishing_components/version.rb +1 -1
  25. data/node_modules/axe-core/axe.js +604 -440
  26. data/node_modules/axe-core/axe.min.js +2 -2
  27. data/node_modules/axe-core/package.json +1 -1
  28. data/node_modules/axe-core/sri-history.json +4 -0
  29. metadata +4 -3
@@ -61,6 +61,27 @@ examples:
61
61
  tracking: GTM-123AB
62
62
  block: |
63
63
  We need to know your nationality so we can work out which elections you’re entitled to vote in. If you can’t provide your nationality, you’ll have to send copies of identity documents through the post.
64
+ with_ga4_tracking:
65
+ description: |
66
+ GA4 tracking is mostly handled internally by the component, apart from the required attribute `index_section_count`. This records the number of details components on the page and must be passed by the hosting application. Other GA4 attributes can also be passed if required, including to override attributes set by the component (for some reason this doesn't work in the component guide but works in applications).
67
+
68
+ The tracking automatically includes `index_section` as the index of the component on the page compared with other instances of the component that are also being tracked, e.g. the first details component on a page will be `index_section` 1, the second `index_section` 2, etc.
69
+
70
+ Link tracking for the contents of the details component is not included due to varying tracking requirements. If you need to track links in the component, wrap it in the application with the [GA4 link tracker](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-link-tracker.md).
71
+ data:
72
+ title: What did the ground say to the train?
73
+ ga4_attributes: {
74
+ index_section_count: 6,
75
+ type: "not the default"
76
+ }
77
+ block: |
78
+ Between you and me, I've been tracked.
79
+ disable_ga4_tracking:
80
+ description: Disables GA4 tracking on the component. Tracking is enabled by default.
81
+ data:
82
+ title: No tracking here
83
+ disable_ga4: true
84
+ block: Or here, but thanks for looking.
64
85
  open:
65
86
  data:
66
87
  title: Help with nationality
@@ -12,6 +12,7 @@ accessibility_criteria: |
12
12
  - include alt text for images when present
13
13
  - not have duplicate links for the image and the text
14
14
  - if the contents of the component are in a different language than the rest of the document, include an appropriate `lang` attribute to correctly identify the language used in the component
15
+ uses_component_wrapper_helper: true
15
16
  shared_accessibility_criteria:
16
17
  - link
17
18
  embed: |
@@ -276,6 +277,23 @@ examples:
276
277
  }
277
278
  }
278
279
  ]
280
+ with_ga4_tracking:
281
+ description: The component does not include an option for GA4 tracking, but data attributes to enable the [GA4 link tracker](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-link-tracker.md) can be passed as shown.
282
+ data:
283
+ href: "/not-a-page"
284
+ image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
285
+ image_alt: "some meaningful alt text please"
286
+ heading_text: "News headline"
287
+ data_attributes:
288
+ module: "ga4-link-tracker"
289
+ ga4_link:
290
+ event_name: "navigation"
291
+ type: "homepage"
292
+ index_section: 1
293
+ index_link: 1
294
+ index_section_count: 1
295
+ index_total: 1
296
+ section: "homepage"
279
297
  with_metadata:
280
298
  description: Can be used for links to people pages to indicate payment type
281
299
  data:
@@ -293,17 +311,6 @@ examples:
293
311
  }
294
312
  ]
295
313
  extra_details_no_indent: true
296
- with_lang:
297
- description: |
298
- Pass through an appropriate `lang` to set a HTML lang attribute for the component.
299
-
300
- The `lang` attribute **must** be set to a [valid BCP47 string](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang#Language_tag_syntax). A valid code can be the two or three letter language code - for example, English is `en` or `eng`, Korean is `ko` or `kor` - but if in doubt please check.
301
- data:
302
- href: "/not-a-page"
303
- image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
304
- image_alt: "some meaningful alt text please"
305
- heading_text: Yr hyn rydym ni'n ei wneud
306
- lang: cy
307
314
  with_sizes_attribute:
308
315
  description: |
309
316
  `sizes` is an attribute that makes use of html's native responsive images functionality.
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "37.1.1".freeze
2
+ VERSION = "37.2.0".freeze
3
3
  end