govuk_publishing_components 29.13.0 → 29.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/action-link-arrow--white.png +0 -0
  3. data/app/assets/images/govuk_publishing_components/action-link-arrow--white.svg +1 -0
  4. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/gtm-page-views.js +5 -3
  5. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/pii-remover.js +135 -0
  6. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4.js +2 -0
  7. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +10 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +7 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +1 -92
  10. data/app/views/govuk_publishing_components/components/_action_link.html.erb +2 -0
  11. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +33 -36
  12. data/app/views/govuk_publishing_components/components/docs/accordion.yml +2 -1
  13. data/app/views/govuk_publishing_components/components/docs/action_link.yml +8 -0
  14. data/app/views/govuk_publishing_components/components/docs/previous_and_next_navigation.yml +1 -1
  15. data/config/locales/ar.yml +2 -0
  16. data/config/locales/az.yml +2 -0
  17. data/config/locales/be.yml +2 -0
  18. data/config/locales/bg.yml +2 -0
  19. data/config/locales/bn.yml +2 -0
  20. data/config/locales/cs.yml +2 -0
  21. data/config/locales/cy.yml +2 -0
  22. data/config/locales/da.yml +2 -0
  23. data/config/locales/de.yml +2 -0
  24. data/config/locales/dr.yml +2 -0
  25. data/config/locales/el.yml +2 -0
  26. data/config/locales/en.yml +2 -0
  27. data/config/locales/es-419.yml +2 -0
  28. data/config/locales/es.yml +2 -0
  29. data/config/locales/et.yml +2 -0
  30. data/config/locales/fa.yml +2 -0
  31. data/config/locales/fi.yml +2 -0
  32. data/config/locales/fr.yml +2 -0
  33. data/config/locales/gd.yml +2 -0
  34. data/config/locales/gu.yml +2 -0
  35. data/config/locales/he.yml +2 -0
  36. data/config/locales/hi.yml +2 -0
  37. data/config/locales/hr.yml +2 -0
  38. data/config/locales/hu.yml +2 -0
  39. data/config/locales/hy.yml +2 -0
  40. data/config/locales/id.yml +2 -0
  41. data/config/locales/is.yml +2 -0
  42. data/config/locales/it.yml +2 -0
  43. data/config/locales/ja.yml +2 -0
  44. data/config/locales/ka.yml +2 -0
  45. data/config/locales/kk.yml +2 -0
  46. data/config/locales/ko.yml +2 -0
  47. data/config/locales/lt.yml +2 -0
  48. data/config/locales/lv.yml +2 -0
  49. data/config/locales/ms.yml +2 -0
  50. data/config/locales/mt.yml +2 -0
  51. data/config/locales/nl.yml +2 -0
  52. data/config/locales/no.yml +2 -0
  53. data/config/locales/pa-pk.yml +2 -0
  54. data/config/locales/pa.yml +2 -0
  55. data/config/locales/pl.yml +2 -0
  56. data/config/locales/ps.yml +2 -0
  57. data/config/locales/pt.yml +2 -0
  58. data/config/locales/ro.yml +2 -0
  59. data/config/locales/ru.yml +2 -0
  60. data/config/locales/si.yml +2 -0
  61. data/config/locales/sk.yml +2 -0
  62. data/config/locales/sl.yml +2 -0
  63. data/config/locales/so.yml +2 -0
  64. data/config/locales/sq.yml +2 -0
  65. data/config/locales/sr.yml +2 -0
  66. data/config/locales/sv.yml +2 -0
  67. data/config/locales/sw.yml +2 -0
  68. data/config/locales/ta.yml +2 -0
  69. data/config/locales/th.yml +2 -0
  70. data/config/locales/tk.yml +2 -0
  71. data/config/locales/tr.yml +2 -0
  72. data/config/locales/uk.yml +2 -0
  73. data/config/locales/ur.yml +2 -0
  74. data/config/locales/uz.yml +2 -0
  75. data/config/locales/vi.yml +2 -0
  76. data/config/locales/zh-hk.yml +2 -0
  77. data/config/locales/zh-tw.yml +2 -0
  78. data/config/locales/zh.yml +2 -0
  79. data/lib/govuk_publishing_components/version.rb +1 -1
  80. data/node_modules/govuk-frontend/govuk/components/_all.scss +1 -0
  81. data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +1 -0
  82. data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +2 -1
  83. data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +102 -44
  84. data/node_modules/govuk-frontend/govuk/components/checkboxes/macro-options.json +7 -1
  85. data/node_modules/govuk-frontend/govuk/components/checkboxes/template.njk +3 -2
  86. data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +10 -10
  87. data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +92 -1
  88. data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +2 -1
  89. data/node_modules/govuk-frontend/govuk/components/header/_index.scss +3 -0
  90. data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +14 -6
  91. data/node_modules/govuk-frontend/govuk/components/header/template.njk +9 -3
  92. data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +2 -1
  93. data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +1 -1
  94. data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +76 -1
  95. data/node_modules/govuk-frontend/govuk/components/pagination/README.md +15 -0
  96. data/node_modules/govuk-frontend/govuk/components/pagination/_index.scss +244 -0
  97. data/node_modules/govuk-frontend/govuk/components/pagination/_pagination.scss +2 -0
  98. data/node_modules/govuk-frontend/govuk/components/pagination/fixtures.json +300 -0
  99. data/node_modules/govuk-frontend/govuk/components/pagination/macro-options.json +128 -0
  100. data/node_modules/govuk-frontend/govuk/components/pagination/macro.njk +3 -0
  101. data/node_modules/govuk-frontend/govuk/components/pagination/template.njk +62 -0
  102. data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +147 -43
  103. data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +7 -1
  104. data/node_modules/govuk-frontend/govuk/components/radios/template.njk +3 -2
  105. data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +56 -2
  106. data/node_modules/govuk-frontend/govuk/components/select/macro-options.json +7 -1
  107. data/node_modules/govuk-frontend/govuk/components/select/template.njk +1 -1
  108. data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +2 -1
  109. data/node_modules/govuk-frontend/govuk-esm/all.mjs +12 -12
  110. data/node_modules/govuk-frontend/govuk-esm/components/accordion/accordion.mjs +3 -3
  111. data/node_modules/govuk-frontend/govuk-esm/components/button/button.mjs +2 -2
  112. data/node_modules/govuk-frontend/govuk-esm/components/character-count/character-count.mjs +3 -3
  113. data/node_modules/govuk-frontend/govuk-esm/components/checkboxes/checkboxes.mjs +4 -4
  114. data/node_modules/govuk-frontend/govuk-esm/components/details/details.mjs +3 -3
  115. data/node_modules/govuk-frontend/govuk-esm/components/error-summary/error-summary.mjs +3 -3
  116. data/node_modules/govuk-frontend/govuk-esm/components/header/header.mjs +3 -3
  117. data/node_modules/govuk-frontend/govuk-esm/components/notification-banner/notification-banner.mjs +1 -1
  118. data/node_modules/govuk-frontend/govuk-esm/components/radios/radios.mjs +4 -4
  119. data/node_modules/govuk-frontend/govuk-esm/components/skip-link/skip-link.mjs +3 -3
  120. data/node_modules/govuk-frontend/govuk-esm/components/tabs/tabs.mjs +6 -6
  121. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{DOMTokenList.js → DOMTokenList.mjs} +0 -0
  122. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Document.js → Document.mjs} +0 -0
  123. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{classList.js → classList.mjs} +4 -4
  124. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{closest.js → closest.mjs} +1 -1
  125. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{matches.js → matches.mjs} +0 -0
  126. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{nextElementSibling.js → nextElementSibling.mjs} +2 -2
  127. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{previousElementSibling.js → previousElementSibling.mjs} +2 -2
  128. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Element.js → Element.mjs} +1 -1
  129. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Event.js → Event.mjs} +3 -3
  130. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Function/prototype/{bind.js → bind.mjs} +1 -1
  131. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Object/{defineProperty.js → defineProperty.mjs} +0 -0
  132. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Window.js → Window.mjs} +0 -0
  133. data/node_modules/govuk-frontend/package.json +8 -2
  134. metadata +24 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dafa42cbe074f0cac7f3d82ad2475eee0cbd895e755279ff94a0fb8862d0f7c2
4
- data.tar.gz: 2b06381bc10381652f927ce42a46dc3d1a008b3e78c26646816b6f4809bd2605
3
+ metadata.gz: ea69ac62517f1d199c528b86f901ea00cf09b7d09b9c4b7c6550af866ad67cea
4
+ data.tar.gz: f92c94a1bad3f1516e4cdc4e415202c72e027b42990ed3e1c9c5eacebe389d14
5
5
  SHA512:
6
- metadata.gz: f5adab3000ea81b5eaae1506a4d2070ac0e35bf499e4d4ca2500534a087fb67b8e79ac6012faae9590142122f432f7ea36d3c90db819a515d2b623d570e6cb70
7
- data.tar.gz: 278fabdee01f0785b2fc2b26dfc07f9c122cd640cf78a8666a846d54d3b44b5e009544c1428d4ed7a24e3ea8af07cfa9d440710e8606bf19e3bc94b46d7e0b2b
6
+ metadata.gz: e4a5fa8f083422f90461f0473ebe979d1240a5b0a0f4a0a56f19a24936eb33c70f18216b4e29bb43140f945c9985e5da738299563b0ceab1a40932c2cb85b138
7
+ data.tar.gz: 3ab97ddb79f5ed2a1494c9fa63868573b4bc18d8ba067343d4acc035b5602f90ab6a47b089a36b8590f77b5d45e9cc70084001b355cc458dbe2326346ec63073
@@ -0,0 +1 @@
1
+ <svg width="39" height="39" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M17.01 6.818l-2.828 2.828 7.853 7.854-22 .066L0 21.5h22.035l-7.853 7.854 2.828 2.828L29.69 19.5zM39 19.5C39 30.27 30.27 39 19.5 39 9.373 39 1.05 31.28.092 21.405A19.737 19.737 0 010 19.5C0 8.73 8.73 0 19.5 0S39 8.73 39 19.5z" fill="#fff"/></svg>
@@ -4,6 +4,8 @@
4
4
  var GOVUK = global.GOVUK || {}
5
5
 
6
6
  GOVUK.Gtm = {
7
+ PIIRemover: new GOVUK.analyticsGA4.PIIRemover(), // imported in analytics-ga4.js
8
+
7
9
  sendPageView: function () {
8
10
  if (window.dataLayer) {
9
11
  var data = {
@@ -48,15 +50,15 @@
48
50
  },
49
51
 
50
52
  getLocation: function () {
51
- return document.location.href
53
+ return this.PIIRemover.stripPII(document.location.href)
52
54
  },
53
55
 
54
56
  getReferrer: function () {
55
- return document.referrer
57
+ return this.PIIRemover.stripPIIWithOverride(document.referrer, true, true)
56
58
  },
57
59
 
58
60
  getTitle: function () {
59
- return document.title
61
+ return this.PIIRemover.stripPII(document.title)
60
62
  },
61
63
 
62
64
  // window.httpStatusCode is set in the source of the error page in static
@@ -0,0 +1,135 @@
1
+ ;(function (global) {
2
+ 'use strict'
3
+
4
+ var GOVUK = global.GOVUK || {}
5
+ var EMAIL_PATTERN = /[^\s=/?&#]+(?:@|%40)[^\s=/?&]+/g
6
+ var POSTCODE_PATTERN = /\b[A-PR-UWYZ][A-HJ-Z]?[0-9][0-9A-HJKMNPR-Y]?(?:[\s+]|%20)*[0-9](?!refund)[ABD-HJLNPQ-Z]{2,3}\b/gi
7
+ var DATE_PATTERN = /\d{4}(-?)\d{2}(-?)\d{2}/g
8
+ var ESCAPE_REGEX_PATTERN = /[|\\{}()[\]^$+*?.]/g
9
+
10
+ // specific URL parameters to be redacted from accounts URLs
11
+ var RESET_PASSWORD_TOKEN_PATTERN = /reset_password_token=[a-zA-Z0-9-]+/g
12
+ var UNLOCK_TOKEN_PATTERN = /unlock_token=[a-zA-Z0-9-]+/g
13
+ var STATE_PATTERN = /state=.[^&]+/g
14
+
15
+ function shouldStripDates () {
16
+ var metas = document.querySelectorAll('meta[name="govuk:static-analytics:strip-dates"]')
17
+ return metas.length > 0
18
+ }
19
+
20
+ function shouldStripPostcodes () {
21
+ var metas = document.querySelectorAll('meta[name="govuk:static-analytics:strip-postcodes"]')
22
+ return metas.length > 0
23
+ }
24
+
25
+ function queryStringParametersToStrip () {
26
+ var meta = document.querySelector('meta[name="govuk:static-analytics:strip-query-string-parameters"]')
27
+ var value = false
28
+ if (meta) {
29
+ value = meta.getAttribute('content')
30
+ }
31
+ var parameters = []
32
+
33
+ if (value) {
34
+ var split = value.split(',')
35
+ for (var i = 0; i < split.length; i++) {
36
+ parameters.push(split[i].trim())
37
+ }
38
+ }
39
+
40
+ return parameters
41
+ }
42
+
43
+ var PIIRemover = function () {
44
+ this.stripDatePII = shouldStripDates()
45
+ this.stripPostcodePII = shouldStripPostcodes()
46
+ this.queryStringParametersToStrip = queryStringParametersToStrip()
47
+ }
48
+
49
+ PIIRemover.prototype.PIISafe = function (value) {
50
+ this.value = value
51
+ }
52
+
53
+ PIIRemover.prototype.stripPII = function (value) {
54
+ if (typeof value === 'string') {
55
+ return this.stripPIIFromString(value)
56
+ } else if (Object.prototype.toString.call(value) === '[object Array]' || Object.prototype.toString.call(value) === '[object Arguments]') {
57
+ return this.stripPIIFromArray(value)
58
+ } else if (typeof value === 'object') {
59
+ return this.stripPIIFromObject(value)
60
+ } else {
61
+ return value
62
+ }
63
+ }
64
+
65
+ PIIRemover.prototype.stripPIIWithOverride = function (value, enableDateStripping, enablePostcodeStripping) {
66
+ var oldStripDatePII = this.stripDatePII
67
+ var oldPostcodePII = this.stripPostcodePII
68
+
69
+ this.stripDatePII = enableDateStripping
70
+ this.stripPostcodePII = enablePostcodeStripping
71
+
72
+ var strippedValue = this.stripPII(value)
73
+
74
+ this.stripDatePII = oldStripDatePII
75
+ this.stripPostcodePII = oldPostcodePII
76
+
77
+ return strippedValue
78
+ }
79
+
80
+ PIIRemover.prototype.stripPIIFromString = function (string) {
81
+ var stripped = string.replace(EMAIL_PATTERN, '[email]')
82
+ stripped = stripped.replace(RESET_PASSWORD_TOKEN_PATTERN, 'reset_password_token=[reset_password_token]')
83
+ stripped = stripped.replace(UNLOCK_TOKEN_PATTERN, 'unlock_token=[unlock_token]')
84
+ stripped = stripped.replace(STATE_PATTERN, 'state=[state]')
85
+ stripped = this.stripQueryStringParameters(stripped)
86
+
87
+ if (this.stripDatePII === true) {
88
+ stripped = stripped.replace(DATE_PATTERN, '[date]')
89
+ }
90
+ if (this.stripPostcodePII === true) {
91
+ stripped = stripped.replace(POSTCODE_PATTERN, '[postcode]')
92
+ }
93
+ return stripped
94
+ }
95
+
96
+ PIIRemover.prototype.stripPIIFromObject = function (object) {
97
+ if (object) {
98
+ if (object instanceof this.PIISafe) {
99
+ return object.value
100
+ } else {
101
+ for (var property in object) {
102
+ var value = object[property]
103
+
104
+ object[property] = this.stripPII(value)
105
+ }
106
+ return object
107
+ }
108
+ }
109
+ }
110
+
111
+ PIIRemover.prototype.stripPIIFromArray = function (array) {
112
+ for (var i = 0, l = array.length; i < l; i++) {
113
+ var elem = array[i]
114
+
115
+ array[i] = this.stripPII(elem)
116
+ }
117
+ return array
118
+ }
119
+
120
+ PIIRemover.prototype.stripQueryStringParameters = function (string) {
121
+ for (var i = 0; i < this.queryStringParametersToStrip.length; i++) {
122
+ var parameter = this.queryStringParametersToStrip[i]
123
+ var escaped = parameter.replace(ESCAPE_REGEX_PATTERN, '\\$&')
124
+ var regexp = new RegExp('((?:\\?|&)' + escaped + '=)(?:[^&#\\s]*)', 'g')
125
+ string = string.replace(regexp, '$1[' + parameter + ']')
126
+ }
127
+
128
+ return string
129
+ }
130
+
131
+ GOVUK.analyticsGA4 = GOVUK.analyticsGA4 || {}
132
+ GOVUK.analyticsGA4.PIIRemover = PIIRemover
133
+
134
+ global.GOVUK = GOVUK
135
+ })(window)
@@ -1,3 +1,5 @@
1
+ // The following modules are imported in a specific order
2
+ //= require ./analytics-ga4/pii-remover
1
3
  //= require ./analytics-ga4/gtm-page-views
2
4
  //= require ./analytics-ga4/gtm-click-tracking
3
5
 
@@ -124,6 +124,16 @@ window.GOVUK.Modules.GovukAccordion = window.GOVUKFrontend.Accordion;
124
124
  var label = expanded ? 'Show all sections' : 'Hide all sections'
125
125
  var action = expanded ? 'accordionOpened' : 'accordionClosed'
126
126
  var options = { transport: 'beacon', label: label }
127
+
128
+ var extraOptions = event.target && event.target.getAttribute('data-track-options')
129
+
130
+ // this uses the same logic as track-click.js handleClick
131
+ // means we can add a custom dimensions on click
132
+ if (extraOptions) {
133
+ extraOptions = JSON.parse(extraOptions)
134
+ for (var k in extraOptions) options[k] = extraOptions[k]
135
+ }
136
+
127
137
  if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
128
138
  window.GOVUK.analytics.trackEvent('pageElementInteraction', action, options)
129
139
  }
@@ -92,6 +92,13 @@
92
92
  }
93
93
  }
94
94
 
95
+ .gem-c-action-link--white-arrow {
96
+ &:before {
97
+ background-image: image-url("govuk_publishing_components/action-link-arrow--white.png");
98
+ background-image: image-url("govuk_publishing_components/action-link-arrow--white.svg"), linear-gradient(transparent, transparent);
99
+ }
100
+ }
101
+
95
102
  .gem-c-action-link--blue-arrow {
96
103
  &:before {
97
104
  width: 36px;
@@ -1,92 +1 @@
1
- .gem-c-pagination {
2
- display: block;
3
- margin: govuk-spacing(8) 0;
4
- }
5
-
6
- .gem-c-pagination__list {
7
- margin: 0;
8
- padding: 0;
9
- }
10
-
11
- .gem-c-pagination__item {
12
- @include govuk-font($size: 19);
13
- list-style: none;
14
-
15
- &:first-child {
16
- margin-bottom: govuk-spacing(4);
17
- }
18
- }
19
-
20
- .gem-c-pagination__link {
21
- display: block;
22
- text-decoration: none;
23
- padding-bottom: govuk-spacing(4);
24
-
25
- &:hover,
26
- &:active,
27
- &:visited {
28
- color: $govuk-link-colour;
29
- }
30
-
31
- &:hover,
32
- &:active {
33
- background-color: govuk-colour("light-grey", $legacy: "grey-4");
34
-
35
- // Add govuk-link hover decoration to title if no label present
36
- .gem-c-pagination__link-text--decorated {
37
- @include govuk-link-decoration;
38
- }
39
-
40
- .gem-c-pagination__link-label,
41
- .gem-c-pagination__link-text--decorated {
42
- @include govuk-link-hover-decoration;
43
- }
44
- }
45
-
46
- &:focus {
47
- @include govuk-focused-text;
48
-
49
- .gem-c-pagination__link-title {
50
- border-top-color: transparent;
51
- }
52
-
53
- .gem-c-pagination__link-icon {
54
- fill: $govuk-text-colour;
55
- }
56
- }
57
- }
58
-
59
- .gem-c-pagination__link-title {
60
- display: block;
61
- border-top: 1px solid $govuk-border-colour;
62
- padding-top: govuk-spacing(3);
63
- }
64
-
65
- .gem-c-pagination__link-divider {
66
- @include govuk-visually-hidden;
67
- }
68
-
69
- .gem-c-pagination__link-text {
70
- @include govuk-font(19, $weight: bold);
71
- margin-left: govuk-spacing(2);
72
- }
73
-
74
- .gem-c-pagination__link-icon {
75
- @include govuk-font($size: 24, $line-height: (33.75 / 27));
76
- display: inline-block;
77
- margin-bottom: 1px;
78
- height: .482em;
79
- width: .63em;
80
- fill: govuk-colour("dark-grey", $legacy: "grey-1");
81
- }
82
-
83
- .gem-c-pagination__link-label {
84
- display: inline-block;
85
- margin-top: .1em;
86
- margin-left: govuk-spacing(5);
87
- @include govuk-link-decoration;
88
-
89
- @include govuk-media-query($from: tablet) {
90
- margin-left: govuk-spacing(6);
91
- }
92
- }
1
+ @import "govuk/components/pagination/pagination";
@@ -10,6 +10,7 @@
10
10
  mobile_subtext ||= false
11
11
  light_text ||= false
12
12
  blue_arrow ||= false
13
+ white_arrow ||= false
13
14
  simple ||= false
14
15
  simple_light ||= false
15
16
  dark_icon ||= false
@@ -29,6 +30,7 @@
29
30
  css_classes << "gem-c-action-link--nhs" if nhs_icon
30
31
  css_classes << "gem-c-action-link--brexit" if brexit_icon
31
32
  css_classes << "gem-c-action-link--blue-arrow" if blue_arrow
33
+ css_classes << "gem-c-action-link--white-arrow" if white_arrow
32
34
  css_classes << "gem-c-action-link--simple" if simple
33
35
  css_classes << "gem-c-action-link--simple-light" if simple_light
34
36
  css_classes << "gem-c-action-link--with-subtext" if subtext
@@ -1,18 +1,18 @@
1
1
  <% if local_assigns.include?(:next_page) || local_assigns.include?(:previous_page) %>
2
- <nav
3
- class="gem-c-pagination"
4
- role="navigation"
5
- aria-label="<%= t("components.previous_and_next_navigation.pagination") %>"
6
- >
7
- <ul class="gem-c-pagination__list" data-module="gem-track-click">
2
+ <nav
3
+ class="govuk-pagination govuk-pagination--block"
4
+ role="navigation"
5
+ aria-label="<%= t("components.previous_and_next_navigation.pagination") %>"
6
+ >
8
7
  <% if local_assigns.include?(:previous_page) %>
9
8
  <%
10
- link_text_classes = %w[gem-c-pagination__link-text]
11
- link_text_classes << "gem-c-pagination__link-text--decorated" unless previous_page[:label].present?
9
+ title = previous_page[:title] || t("components.previous_and_next_navigation.previous")
10
+ link_text_classes = %w[govuk-pagination__link-title]
11
+ link_text_classes << "govuk-pagination__link-title--decorated" unless previous_page[:label].present?
12
12
  %>
13
- <li class="gem-c-pagination__item gem-c-pagination__item--previous">
14
- <a href="<%= previous_page[:url] %>"
15
- class="govuk-link gem-c-pagination__link"
13
+ <div class="govuk-pagination__prev">
14
+ <a class="govuk-link govuk-pagination__link"
15
+ href="<%= previous_page[:url] %>"
16
16
  rel="prev"
17
17
  data-track-category="contentsClicked"
18
18
  data-track-action="previous"
@@ -20,27 +20,27 @@
20
20
  data-track-dimension="previous"
21
21
  data-track-dimension-index="29"
22
22
  >
23
- <span class="gem-c-pagination__link-title">
24
- <svg class="gem-c-pagination__link-icon" xmlns="http://www.w3.org/2000/svg" height="13" width="17" viewBox="0 0 17 13">
25
- <path d="m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z"/>
26
- </svg>
27
- <%= tag.span(previous_page[:title], class: link_text_classes) %>
28
- </span>
23
+ <svg class="govuk-pagination__icon govuk-pagination__icon--prev" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13">
24
+ <path d="m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z"></path>
25
+ </svg>
26
+ <%= tag.span(title, class: link_text_classes) %>
29
27
  <% if previous_page[:label].present? %>
30
- <span class="gem-c-pagination__link-divider visually-hidden">:</span>
31
- <span class="gem-c-pagination__link-label"><%= previous_page[:label] %></span>
28
+ <span class="govuk-visually-hidden">:</span>
29
+ <span class="govuk-pagination__link-label"><%= previous_page[:label] %></span>
32
30
  <% end %>
33
31
  </a>
34
- </li>
32
+ </div>
35
33
  <% end %>
34
+
36
35
  <% if local_assigns.include?(:next_page) %>
37
36
  <%
38
- link_text_classes = %w[gem-c-pagination__link-text]
39
- link_text_classes << "gem-c-pagination__link-text--decorated" unless next_page[:label].present?
37
+ title = next_page[:title] || t("components.previous_and_next_navigation.next")
38
+ link_text_classes = %w[govuk-pagination__link-title]
39
+ link_text_classes << "govuk-pagination__link-title--decorated" unless next_page[:label].present?
40
40
  %>
41
- <li class="gem-c-pagination__item gem-c-pagination__item--next">
42
- <a href="<%= next_page[:url] %>"
43
- class="govuk-link gem-c-pagination__link"
41
+ <div class="govuk-pagination__next">
42
+ <a class="govuk-link govuk-pagination__link"
43
+ href="<%= next_page[:url] %>"
44
44
  rel="next"
45
45
  data-track-category="contentsClicked"
46
46
  data-track-action="next"
@@ -48,19 +48,16 @@
48
48
  data-track-dimension="next"
49
49
  data-track-dimension-index="29"
50
50
  >
51
- <span class="gem-c-pagination__link-title">
52
- <svg class="gem-c-pagination__link-icon" xmlns="http://www.w3.org/2000/svg" height="13" width="17" viewBox="0 0 17 13">
53
- <path d="m10.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z"/>
54
- </svg>
55
- <%= tag.span(next_page[:title], class: link_text_classes) %>
56
- </span>
51
+ <svg class="govuk-pagination__icon govuk-pagination__icon--next" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13">
52
+ <path d="m8.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z"></path>
53
+ </svg>
54
+ <%= tag.span(title, class: link_text_classes) %>
57
55
  <% if next_page[:label].present? %>
58
- <span class="gem-c-pagination__link-divider visually-hidden">:</span>
59
- <span class="gem-c-pagination__link-label"><%= next_page[:label] %></span>
56
+ <span class="govuk-visually-hidden">:</span>
57
+ <span class="govuk-pagination__link-label"><%= next_page[:label] %></span>
60
58
  <% end %>
61
59
  </a>
62
- </li>
60
+ </div>
63
61
  <% end %>
64
- </ul>
65
- </nav>
62
+ </nav>
66
63
  <% end %>
@@ -189,7 +189,7 @@ examples:
189
189
 
190
190
  Each item can also have a `data_attributes` hash. These `data_attributes` are placed on the `button` that triggers the opening and closing - useful for differentiating between each section of the accordion.
191
191
 
192
- Data attributes can also be added to the 'Show/hide all' link using the `data_attributes_show_all` option, primarily where custom tracking is required. These attributes are read from the accordion markup and then added to the link by JavaScript (which is how the link is created).
192
+ Data attributes can also be added to the 'Show/hide all' link using the `data_attributes_show_all` option, primarily where custom tracking is required. These attributes are read from the accordion markup and then added to the link by JavaScript (which is how the link is created). If `track_options` within `data_attributes_show_all` is set, then it is possible to pass a custom dimension when 'Show/Hide all' is clicked.
193
193
  data:
194
194
  data_attributes:
195
195
  gtm: gtm-accordion
@@ -197,6 +197,7 @@ examples:
197
197
  data_attributes_show_all:
198
198
  gtm-event-name: example
199
199
  gtm-attributes: "{ 'ui': { 'type': 'type value', 'section': 'section value' } }"
200
+ tracking-options: "{ 'dimension114': 1 }"
200
201
  items:
201
202
  - heading:
202
203
  text: Writing well for the web
@@ -78,6 +78,14 @@ examples:
78
78
  light_text: true
79
79
  context:
80
80
  dark_background: true
81
+ white_arrow:
82
+ data:
83
+ text: Find out how to stay safe and help prevent the spread
84
+ href: "/something"
85
+ white_arrow: true
86
+ light_text: true
87
+ context:
88
+ dark_background: true
81
89
  blue_arrow:
82
90
  data:
83
91
  text: Find out how to stay safe and help prevent the spread
@@ -22,7 +22,7 @@ accessibility_criteria: |
22
22
  shared_accessibility_criteria:
23
23
  - link
24
24
  examples:
25
- only_previous:
25
+ default:
26
26
  data:
27
27
  previous_page:
28
28
  url: previous-page
@@ -135,7 +135,9 @@ ar:
135
135
  organisation_schema:
136
136
  all_content_search_description: العثور عن كل المحتوى من %{organisation}
137
137
  previous_and_next_navigation:
138
+ next:
138
139
  pagination: ترقيم الصفحات
140
+ previous:
139
141
  print_link:
140
142
  text: طباعة هذه الصفحة
141
143
  radio:
@@ -131,7 +131,9 @@ az:
131
131
  organisation_schema:
132
132
  all_content_search_description: "%{organisation}-dan bütün məzmunu tap"
133
133
  previous_and_next_navigation:
134
+ next:
134
135
  pagination: Səhifələrə bölmə
136
+ previous:
135
137
  print_link:
136
138
  text: Bu səhifəni çap et
137
139
  radio:
@@ -138,7 +138,9 @@ be:
138
138
  organisation_schema:
139
139
  all_content_search_description: Шукаць увесь змест з %{organisation}
140
140
  previous_and_next_navigation:
141
+ next:
141
142
  pagination: Месцаванне старонак
143
+ previous:
142
144
  print_link:
143
145
  text: Надрукаваць гэтую странiцу
144
146
  radio:
@@ -136,7 +136,9 @@ bg:
136
136
  organisation_schema:
137
137
  all_content_search_description: Намиране на цялото съдържание от %{organisation}
138
138
  previous_and_next_navigation:
139
+ next:
139
140
  pagination: Страниране
141
+ previous:
140
142
  print_link:
141
143
  text: Отпечатване на страницата
142
144
  radio:
@@ -133,7 +133,9 @@ bn:
133
133
  organisation_schema:
134
134
  all_content_search_description: "%{organisation}-এর সকল বিষয়বস্তু খুঁজে বের করুন"
135
135
  previous_and_next_navigation:
136
+ next:
136
137
  pagination: পেজিনেশন
138
+ previous:
137
139
  print_link:
138
140
  text: এই পৃষ্ঠাটি প্রিন্ট করুন
139
141
  radio:
@@ -137,7 +137,9 @@ cs:
137
137
  organisation_schema:
138
138
  all_content_search_description: Najít veškerý obsah z %{organisation}
139
139
  previous_and_next_navigation:
140
+ next:
140
141
  pagination: Stránkování
142
+ previous:
141
143
  print_link:
142
144
  text: Vytisknout tuto stránku
143
145
  radio:
@@ -136,7 +136,9 @@ cy:
136
136
  organisation_schema:
137
137
  all_content_search_description: Dod o hyd i'r holl gynnwys gan %{organisation}
138
138
  previous_and_next_navigation:
139
+ next:
139
140
  pagination: Tudalennu
141
+ previous:
140
142
  print_link:
141
143
  text: Argraffu'r dudalen hon
142
144
  radio:
@@ -133,7 +133,9 @@ da:
133
133
  organisation_schema:
134
134
  all_content_search_description: Find alt indhold fra %{organisation}
135
135
  previous_and_next_navigation:
136
+ next:
136
137
  pagination: Paginering
138
+ previous:
137
139
  print_link:
138
140
  text: Udskriv denne side
139
141
  radio:
@@ -136,7 +136,9 @@ de:
136
136
  organisation_schema:
137
137
  all_content_search_description: Alle Inhalte von %{organisation} finden
138
138
  previous_and_next_navigation:
139
+ next:
139
140
  pagination: Seitenzahlen
141
+ previous:
140
142
  print_link:
141
143
  text: Diese Seite drucken
142
144
  radio:
@@ -134,7 +134,9 @@ dr:
134
134
  organisation_schema:
135
135
  all_content_search_description: تمام محتویات را از اینجا بدست بیاورید %{organisation}
136
136
  previous_and_next_navigation:
137
+ next:
137
138
  pagination: صفحه گذاری
139
+ previous:
138
140
  print_link:
139
141
  text: این صفحه را پرنت نمایید
140
142
  radio:
@@ -132,7 +132,9 @@ el:
132
132
  organisation_schema:
133
133
  all_content_search_description: Εύρεση όλου του περιεχομένου από τον οργανισμό %{Organization}
134
134
  previous_and_next_navigation:
135
+ next:
135
136
  pagination: Σελιδοποίηση
137
+ previous:
136
138
  print_link:
137
139
  text: Εκτύπωση αυτής της σελίδας
138
140
  radio:
@@ -256,7 +256,9 @@ en:
256
256
  organisation_schema:
257
257
  all_content_search_description: Find all content from %{organisation}
258
258
  previous_and_next_navigation:
259
+ next: Next
259
260
  pagination: Pagination
261
+ previous: Previous
260
262
  print_link:
261
263
  text: Print this page
262
264
  radio:
@@ -132,7 +132,9 @@ es-419:
132
132
  organisation_schema:
133
133
  all_content_search_description: Buscar todo el contenido de %{organisation}
134
134
  previous_and_next_navigation:
135
+ next:
135
136
  pagination: Paginación
137
+ previous:
136
138
  print_link:
137
139
  text: Imprimir esta página
138
140
  radio:
@@ -132,7 +132,9 @@ es:
132
132
  organisation_schema:
133
133
  all_content_search_description: Buscar todo el contenido de %{organization}
134
134
  previous_and_next_navigation:
135
+ next:
135
136
  pagination: Paginación
137
+ previous:
136
138
  print_link:
137
139
  text: Imprimir esta página
138
140
  radio:
@@ -135,7 +135,9 @@ et:
135
135
  organisation_schema:
136
136
  all_content_search_description: Leidke kogu ettevõtte %{organization} sisu
137
137
  previous_and_next_navigation:
138
+ next:
138
139
  pagination: Lehekülgede jaotus
140
+ previous:
139
141
  print_link:
140
142
  text: Prindi see leht
141
143
  radio:
@@ -130,7 +130,9 @@ fa:
130
130
  organisation_schema:
131
131
  all_content_search_description: یافتن تمام محتوا از %{organisation}
132
132
  previous_and_next_navigation:
133
+ next:
133
134
  pagination: صفحه‌بندی
135
+ previous:
134
136
  print_link:
135
137
  text: چاپ این صفحه
136
138
  radio: