govuk_publishing_components 40.1.0 → 41.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +1 -79
  3. data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +1 -34
  4. data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +0 -17
  5. data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +0 -6
  6. data/app/assets/javascripts/govuk_publishing_components/components/single-page-notification-button.js +0 -7
  7. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +8 -74
  8. data/app/assets/javascripts/govuk_publishing_components/dependencies.js +0 -4
  9. data/app/assets/javascripts/govuk_publishing_components/domain-config.js +0 -8
  10. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +0 -4
  11. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-settings.js +0 -14
  12. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +0 -20
  13. data/app/assets/javascripts/govuk_publishing_components/lib/toggle.js +0 -33
  14. data/app/assets/javascripts/govuk_publishing_components/load-analytics.js +0 -25
  15. data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +192 -171
  16. data/app/assets/stylesheets/component_guide/application.scss +10 -11
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +1 -1
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +2 -3
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +3 -3
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_big-number.scss +1 -1
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +2 -2
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_cards.scss +47 -22
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +3 -3
  24. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-guidance.scss +1 -3
  25. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +2 -1
  26. data/app/assets/stylesheets/govuk_publishing_components/components/_cross-service-header.scss +19 -19
  27. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +14 -10
  28. data/app/assets/stylesheets/govuk_publishing_components/components/_emergency-banner.scss +3 -3
  29. data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +2 -2
  30. data/app/assets/stylesheets/govuk_publishing_components/components/_error-summary.scss +1 -1
  31. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +8 -8
  32. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +16 -10
  33. data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +2 -2
  34. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +2 -2
  35. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +33 -35
  36. data/app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss +3 -3
  37. data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +1 -1
  38. data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +1 -1
  39. data/app/assets/stylesheets/govuk_publishing_components/components/_option-select.scss +3 -3
  40. data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +13 -3
  41. data/app/assets/stylesheets/govuk_publishing_components/components/_panel.scss +1 -1
  42. data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +6 -6
  43. data/app/assets/stylesheets/govuk_publishing_components/components/_reorderable-list.scss +2 -3
  44. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +4 -3
  45. data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +2 -3
  46. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +3 -4
  47. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +3 -3
  48. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +10 -10
  49. data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +1 -1
  50. data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +1 -1
  51. data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +3 -3
  52. data/app/assets/stylesheets/govuk_publishing_components/components/_warning-text.scss +1 -1
  53. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +5 -4
  54. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +1 -1
  55. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +2 -2
  56. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss +2 -2
  57. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +1 -1
  58. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +1 -1
  59. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +5 -5
  60. data/app/views/govuk_publishing_components/components/_accordion.html.erb +1 -8
  61. data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +1 -1
  62. data/app/views/govuk_publishing_components/components/_cards.html.erb +6 -11
  63. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +2 -15
  64. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +3 -19
  65. data/app/views/govuk_publishing_components/components/_details.html.erb +9 -11
  66. data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -5
  67. data/app/views/govuk_publishing_components/components/_intervention.html.erb +4 -4
  68. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +7 -21
  69. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +1 -26
  70. data/app/views/govuk_publishing_components/components/_metadata.html.erb +2 -5
  71. data/app/views/govuk_publishing_components/components/_organisation_logo.html.erb +2 -7
  72. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +0 -10
  73. data/app/views/govuk_publishing_components/components/_related_navigation.html.erb +1 -3
  74. data/app/views/govuk_publishing_components/components/_search.html.erb +0 -1
  75. data/app/views/govuk_publishing_components/components/_select.html.erb +1 -2
  76. data/app/views/govuk_publishing_components/components/_share_links.html.erb +1 -10
  77. data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb +0 -1
  78. data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +1 -1
  79. data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +1 -24
  80. data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +1 -14
  81. data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +1 -4
  82. data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +0 -1
  83. data/app/views/govuk_publishing_components/components/contextual_sidebar/_ukraine_cta.html.erb +1 -7
  84. data/app/views/govuk_publishing_components/components/docs/accordion.yml +1 -60
  85. data/app/views/govuk_publishing_components/components/docs/big_number.yml +2 -6
  86. data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +0 -1
  87. data/app/views/govuk_publishing_components/components/docs/button.yml +1 -1
  88. data/app/views/govuk_publishing_components/components/docs/cards.yml +41 -20
  89. data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +0 -33
  90. data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +2 -2
  91. data/app/views/govuk_publishing_components/components/docs/details.yml +0 -15
  92. data/app/views/govuk_publishing_components/components/docs/document_list.yml +11 -18
  93. data/app/views/govuk_publishing_components/components/docs/error_alert.yml +1 -1
  94. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +0 -11
  95. data/app/views/govuk_publishing_components/components/docs/image_card.yml +0 -31
  96. data/app/views/govuk_publishing_components/components/docs/intervention.yml +0 -26
  97. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +2 -2
  98. data/app/views/govuk_publishing_components/components/docs/meta_tags.yml +0 -2
  99. data/app/views/govuk_publishing_components/components/docs/option_select.yml +4 -16
  100. data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +0 -15
  101. data/app/views/govuk_publishing_components/components/docs/print_link.yml +2 -9
  102. data/app/views/govuk_publishing_components/components/docs/select.yml +0 -36
  103. data/app/views/govuk_publishing_components/components/docs/share_links.yml +2 -4
  104. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav.yml +2 -25
  105. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml +0 -23
  106. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_related.yml +0 -10
  107. data/app/views/govuk_publishing_components/components/docs/subscription_links.yml +3 -15
  108. data/app/views/govuk_publishing_components/components/docs/table.yml +1 -1
  109. data/app/views/govuk_publishing_components/components/docs/tabs.yml +1 -1
  110. data/app/views/govuk_publishing_components/components/docs/translation_nav.yml +3 -27
  111. data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +1 -5
  112. data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +0 -2
  113. data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +0 -10
  114. data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +1 -1
  115. data/app/views/govuk_publishing_components/components/layout_header/_search.html.erb +0 -5
  116. data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +0 -7
  117. data/lib/govuk_publishing_components/presenters/breadcrumbs_helper.rb +1 -19
  118. data/lib/govuk_publishing_components/presenters/image_card_helper.rb +1 -15
  119. data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +2 -24
  120. data/lib/govuk_publishing_components/presenters/select_helper.rb +0 -4
  121. data/lib/govuk_publishing_components/presenters/single_page_notification_button_helper.rb +0 -5
  122. data/lib/govuk_publishing_components/presenters/translation_nav_helper.rb +0 -7
  123. data/lib/govuk_publishing_components/version.rb +1 -1
  124. metadata +4 -26
  125. data/app/assets/javascripts/govuk_publishing_components/analytics/analytics.js +0 -92
  126. data/app/assets/javascripts/govuk_publishing_components/analytics/auto-scroll-tracker.js +0 -221
  127. data/app/assets/javascripts/govuk_publishing_components/analytics/auto-track-event.js +0 -30
  128. data/app/assets/javascripts/govuk_publishing_components/analytics/cross-domain-tracking.js +0 -55
  129. data/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js +0 -133
  130. data/app/assets/javascripts/govuk_publishing_components/analytics/download-link-tracker.js +0 -46
  131. data/app/assets/javascripts/govuk_publishing_components/analytics/ecommerce.js +0 -101
  132. data/app/assets/javascripts/govuk_publishing_components/analytics/error-tracking.js +0 -51
  133. data/app/assets/javascripts/govuk_publishing_components/analytics/explicit-cross-domain-links.js +0 -88
  134. data/app/assets/javascripts/govuk_publishing_components/analytics/external-link-tracker.js +0 -68
  135. data/app/assets/javascripts/govuk_publishing_components/analytics/google-analytics-universal-tracker.js +0 -220
  136. data/app/assets/javascripts/govuk_publishing_components/analytics/init.js +0 -60
  137. data/app/assets/javascripts/govuk_publishing_components/analytics/linked-domains.js +0 -135
  138. data/app/assets/javascripts/govuk_publishing_components/analytics/mailto-link-tracker.js +0 -43
  139. data/app/assets/javascripts/govuk_publishing_components/analytics/page-content.js +0 -160
  140. data/app/assets/javascripts/govuk_publishing_components/analytics/pii.js +0 -115
  141. data/app/assets/javascripts/govuk_publishing_components/analytics/print-intent.js +0 -39
  142. data/app/assets/javascripts/govuk_publishing_components/analytics/static-analytics.js +0 -132
  143. data/app/assets/javascripts/govuk_publishing_components/analytics/track-click.js +0 -75
  144. data/app/assets/javascripts/govuk_publishing_components/analytics/track-select-change.js +0 -56
  145. data/app/assets/javascripts/govuk_publishing_components/analytics.js +0 -23
  146. data/app/assets/javascripts/govuk_publishing_components/components/details.js +0 -48
@@ -1,75 +0,0 @@
1
- //= require ../vendor/polyfills/closest.js
2
-
3
- window.GOVUK = window.GOVUK || {}
4
- window.GOVUK.Modules = window.GOVUK.Modules || {};
5
-
6
- (function (Modules) {
7
- function GemTrackClick ($module) {
8
- this.$module = $module
9
- }
10
-
11
- GemTrackClick.prototype.init = function () {
12
- this.$module.handleClick = this.handleClick.bind(this)
13
- var trackLinksOnly = this.$module.hasAttribute('data-track-links-only')
14
- var limitToElementClass = this.$module.getAttribute('data-limit-to-element-class')
15
-
16
- var that = this
17
- // add a listener to the whole element
18
- this.$module.addEventListener('click', function (e) {
19
- var target = e.target
20
- if (!trackLinksOnly) {
21
- that.$module.handleClick(target)
22
- } else if (trackLinksOnly && target.closest('a')) {
23
- if (!limitToElementClass) {
24
- that.$module.handleClick(target)
25
- } else if (limitToElementClass && target.closest('.' + limitToElementClass)) {
26
- that.$module.handleClick(target)
27
- }
28
- }
29
- })
30
- }
31
-
32
- GemTrackClick.prototype.handleClick = function (target) {
33
- var options = { transport: 'beacon' }
34
- var linkUrl
35
-
36
- // if clicked element hasn't got the right attributes, look for a parent that matches
37
- if (!target.hasAttribute('data-track-category') && !target.hasAttribute('data-track-action')) {
38
- linkUrl = target.getAttribute('href')
39
- target = target.closest('[data-track-category][data-track-action]')
40
- }
41
-
42
- if (target) {
43
- var category = target.getAttribute('data-track-category')
44
- var action = target.getAttribute('data-track-action')
45
- var label = target.getAttribute('data-track-label') || linkUrl
46
- var value = target.getAttribute('data-track-value')
47
- var dimension = target.getAttribute('data-track-dimension')
48
- var dimensionIndex = target.getAttribute('data-track-dimension-index')
49
- var extraOptions = target.getAttribute('data-track-options')
50
-
51
- if (label) {
52
- options.label = label
53
- }
54
-
55
- if (value) {
56
- options.value = value
57
- }
58
-
59
- if (dimension && dimensionIndex) {
60
- options['dimension' + dimensionIndex] = dimension
61
- }
62
-
63
- if (extraOptions) {
64
- extraOptions = JSON.parse(extraOptions)
65
- for (var k in extraOptions) options[k] = extraOptions[k]
66
- }
67
-
68
- if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
69
- window.GOVUK.analytics.trackEvent(category, action, options)
70
- }
71
- }
72
- }
73
-
74
- Modules.GemTrackClick = GemTrackClick
75
- })(window.GOVUK.Modules)
@@ -1,56 +0,0 @@
1
- window.GOVUK = window.GOVUK || {}
2
- window.GOVUK.Modules = window.GOVUK.Modules || {};
3
-
4
- (function (Modules) {
5
- function TrackSelectChange ($module) {
6
- this.$module = $module
7
- }
8
-
9
- TrackSelectChange.prototype.init = function ($module) {
10
- this.$module.trackChange = this.trackChange.bind(this)
11
- this.$module.fireTrackingChange = this.fireTrackingChange.bind(this)
12
- this.$module.addEventListener('change', this.trackChange)
13
- }
14
-
15
- TrackSelectChange.prototype.trackChange = function () {
16
- var selectedOption = this.options[this.selectedIndex]
17
-
18
- if (selectedOption.hasAttribute('data-track-category') && selectedOption.hasAttribute('data-track-action')) {
19
- this.fireTrackingChange(selectedOption)
20
- }
21
- }
22
-
23
- TrackSelectChange.prototype.fireTrackingChange = function (selectedOption) {
24
- var options = { transport: 'beacon' }
25
- var category = selectedOption.getAttribute('data-track-category')
26
- var action = selectedOption.getAttribute('data-track-action')
27
- var label = selectedOption.getAttribute('data-track-label')
28
- var value = selectedOption.getAttribute('data-track-value')
29
- var dimension = selectedOption.getAttribute('data-track-dimension')
30
- var dimensionIndex = selectedOption.getAttribute('data-track-dimension-index')
31
- var extraOptions = selectedOption.getAttribute('data-track-options')
32
-
33
- if (label) {
34
- options.label = label
35
- }
36
-
37
- if (value) {
38
- options.value = value
39
- }
40
-
41
- if (dimension && dimensionIndex) {
42
- options['dimension' + dimensionIndex] = dimension
43
- }
44
-
45
- if (extraOptions) {
46
- extraOptions = JSON.parse(extraOptions)
47
- for (var k in extraOptions) options[k] = extraOptions[k]
48
- }
49
-
50
- if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
51
- window.GOVUK.analytics.trackEvent(category, action, options)
52
- }
53
- }
54
-
55
- Modules.TrackSelectChange = TrackSelectChange
56
- })(window.GOVUK.Modules)
@@ -1,23 +0,0 @@
1
- // these scripts are specifically ordered
2
-
3
- //= require govuk_publishing_components/lib/cookie-functions
4
- //= require govuk_publishing_components/lib/extend-object
5
- //= require ./analytics/pii
6
- //= require ./analytics/google-analytics-universal-tracker
7
- //= require ./analytics/analytics
8
- //= require ./analytics/print-intent
9
- //= require ./analytics/error-tracking
10
- //= require ./analytics/mailto-link-tracker
11
- //= require ./analytics/external-link-tracker
12
- //= require ./analytics/download-link-tracker
13
- //= require ./analytics/auto-track-event
14
- //= require ./analytics/page-content
15
- //= require ./analytics/custom-dimensions
16
- //= require ./analytics/static-analytics
17
- //= require ./analytics/ecommerce
18
- //= require ./analytics/init
19
- //= require ./analytics/auto-scroll-tracker
20
- //= require ./analytics/explicit-cross-domain-links
21
- //= require ./analytics/track-click
22
- //= require ./analytics/track-select-change
23
- //= require ./analytics/cross-domain-tracking
@@ -1,48 +0,0 @@
1
- window.GOVUK = window.GOVUK || {}
2
- window.GOVUK.Modules = window.GOVUK.Modules || {};
3
-
4
- (function (Modules) {
5
- function GemDetails ($module) {
6
- this.$module = $module
7
- this.$summary = this.$module.querySelector('.govuk-details__summary')
8
-
9
- this.customTrackLabel = this.$summary.getAttribute('data-track-label')
10
- this.detailsClick = this.$module.querySelector('[data-details-track-click]')
11
- }
12
-
13
- GemDetails.prototype.init = function () {
14
- if (this.customTrackLabel) { // If a custom label has been provided, we can simply call the tracking module
15
- var trackDetails = new window.GOVUK.Modules.GemTrackClick(this.$summary)
16
- trackDetails.init()
17
- } else if (this.detailsClick) { // If no custom label is set, we use the open/close status as the label
18
- this.detailsClick.addEventListener('click', function (event) {
19
- this.trackDefault(this.$summary)
20
- }.bind(this))
21
- }
22
- }
23
-
24
- GemDetails.prototype.trackDefault = function (element) {
25
- if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
26
- var componentStatus = (this.$module.getAttribute('open') == null) ? 'open' : 'closed'
27
- var trackCategory = element.getAttribute('data-track-category')
28
- var trackAction = element.getAttribute('data-track-action')
29
- var trackOptions = element.getAttribute('data-track-options')
30
-
31
- if (trackOptions) {
32
- trackOptions = JSON.parse(trackOptions)
33
- }
34
-
35
- if (typeof trackOptions !== 'object' || trackOptions === null) {
36
- trackOptions = {}
37
- }
38
-
39
- trackOptions.label = componentStatus
40
-
41
- if (trackAction && trackCategory) {
42
- window.GOVUK.analytics.trackEvent(trackCategory, trackAction, trackOptions)
43
- }
44
- }
45
- }
46
-
47
- Modules.GemDetails = GemDetails
48
- })(window.GOVUK.Modules)