govuk_publishing_components 24.9.2 → 24.10.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/pii.js +1 -1
  3. data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +13 -248
  4. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +1 -2
  5. data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +1 -0
  6. data/app/assets/javascripts/govuk_publishing_components/components/show-password.js +12 -0
  7. data/app/assets/javascripts/govuk_publishing_components/lib/trigger-event.js +18 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +34 -34
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +0 -37
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak.scss +1 -0
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +15 -18
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +4 -2
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +4 -4
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +20 -20
  15. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_advisory.scss +27 -24
  16. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +1 -1
  17. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +1 -0
  18. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_call-to-action.scss +1 -0
  19. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +1 -0
  20. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +1 -0
  21. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_example.scss +1 -0
  22. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +1 -0
  23. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_form-download.scss +19 -16
  24. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_fraction.scss +1 -0
  25. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +30 -27
  26. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_images.scss +1 -0
  27. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_information-callout.scss +1 -0
  28. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_legislative-list.scss +1 -0
  29. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +26 -21
  30. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss +1 -0
  31. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_steps.scss +19 -16
  32. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_summary.scss +21 -18
  33. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +1 -0
  34. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +1 -0
  35. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +1 -0
  36. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_px-to-em.scss +2 -0
  37. data/app/views/govuk_publishing_components/components/_government_navigation.html.erb +7 -7
  38. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +1 -1
  39. data/app/views/govuk_publishing_components/components/_metadata.html.erb +9 -8
  40. data/app/views/govuk_publishing_components/components/_notice.html.erb +1 -1
  41. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +1 -1
  42. data/app/views/govuk_publishing_components/components/_radio.html.erb +6 -11
  43. data/app/views/govuk_publishing_components/components/_show_password.html.erb +2 -0
  44. data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +4 -4
  45. data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +1 -1
  46. data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +1 -1
  47. data/app/views/govuk_publishing_components/components/_success_alert.html.erb +1 -1
  48. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +9 -27
  49. data/app/views/govuk_publishing_components/components/docs/show_password.yml +10 -0
  50. data/app/views/govuk_publishing_components/components/docs/success_alert.yml +5 -0
  51. data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +1 -1
  52. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +1 -1
  53. data/app/views/govuk_publishing_components/components/metadata/_sentence.html.erb +2 -2
  54. data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +4 -3
  55. data/config/locales/cy.yml +0 -5
  56. data/config/locales/en.yml +12 -9
  57. data/lib/govuk_publishing_components/presenters/breadcrumb_selector.rb +5 -0
  58. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +4 -0
  59. data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +0 -1
  60. data/lib/govuk_publishing_components/version.rb +1 -1
  61. metadata +17 -3
  62. data/app/assets/javascripts/component_guide/visual-regression.js +0 -71
@@ -1,71 +0,0 @@
1
- (function (window, document) {
2
- window.GOVUK = window.GOVUK || {}
3
-
4
- window.GOVUK.VisualDiffTool = function (currentWindowLocation) {
5
- var visualDiffSelector = 'visual-diff'
6
- var existingIframe = document.getElementById(visualDiffSelector)
7
- var windowLocation = currentWindowLocation || window.location
8
-
9
- if (existingIframe) {
10
- existingIframe.parentNode.removeChild(existingIframe)
11
- document.body.style.filter = null
12
- } else {
13
- var iframe = document.createElement('iframe')
14
- iframe.id = visualDiffSelector
15
- iframe.setAttribute('scrolling', 'no')
16
- _setElementStyles(iframe, {
17
- width: '100%',
18
- height: document.body.scrollHeight + 'px',
19
- position: 'absolute',
20
- top: '0',
21
- 'pointer-events': 'none',
22
- border: '0'
23
- })
24
- iframe.style.setProperty('z-index', '999', 'important')
25
-
26
- // For browsers that support it, do mix-blend-mode diff
27
- if ('mix-blend-mode' in document.body.style) {
28
- _setElementStyles(iframe, { 'mix-blend-mode': 'difference' })
29
- document.body.style.filter = 'invert(100%)'
30
- } else {
31
- // Else do a simple overlay of the live page for comparison (IE and Edge)
32
- _setElementStyles(iframe, { opacity: '0.7' })
33
- }
34
-
35
- iframe.src = _processComparisonURL(windowLocation)
36
-
37
- if (iframe.src) {
38
- document.body.appendChild(iframe)
39
- console.log('comparing to ' + iframe.src)
40
- }
41
- }
42
- }
43
-
44
- var _processComparisonURL = function (url) {
45
- var appName
46
- var href = url.href
47
- var host = url.host
48
-
49
- if (href.includes('dev.gov.uk/component-guide')) {
50
- appName = host.split('.')[0]
51
- return _forceHTTPS(href.replace(host, appName + '.herokuapp.com'))
52
- } else if (href.includes('dev.gov.uk')) {
53
- return _forceHTTPS(href.replace(host, 'www.gov.uk'))
54
- } else if (href.includes('-pr-')) {
55
- appName = host.split('-pr')[0]
56
- return _forceHTTPS(href.replace(host, appName + '.herokuapp.com'))
57
- } else {
58
- throw new Error('Visual Diff Tool: You need to run this tool against a page running on your local dev environment')
59
- }
60
- }
61
-
62
- var _forceHTTPS = function (href) {
63
- return href.replace('http://', 'https://')
64
- }
65
-
66
- var _setElementStyles = function (element, styles) {
67
- for (var style in styles) {
68
- element.style[style] = styles[style]
69
- }
70
- }
71
- })(window, document)