govuk_publishing_components 35.21.4 → 35.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/govuk_publishing_components_manifest.js +1 -0
  3. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +2 -0
  4. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-video-tracker.js +9 -5
  5. data/app/assets/javascripts/govuk_publishing_components/components/cross-service-header.js +78 -0
  6. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_cross-service-header.scss +430 -0
  8. data/app/views/govuk_publishing_components/components/_accordion.html.erb +4 -4
  9. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +10 -10
  10. data/app/views/govuk_publishing_components/components/_contextual_breadcrumbs.html.erb +4 -4
  11. data/app/views/govuk_publishing_components/components/_contextual_footer.html.erb +2 -2
  12. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +6 -6
  13. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +5 -5
  14. data/app/views/govuk_publishing_components/components/_cross_service_header.html.erb +19 -0
  15. data/app/views/govuk_publishing_components/components/_devolved_nations.html.erb +2 -2
  16. data/app/views/govuk_publishing_components/components/_emergency_banner.html.erb +2 -4
  17. data/app/views/govuk_publishing_components/components/_intervention.html.erb +6 -6
  18. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +9 -0
  19. data/app/views/govuk_publishing_components/components/_metadata.html.erb +4 -4
  20. data/app/views/govuk_publishing_components/components/_phase_banner.html.erb +2 -2
  21. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +4 -4
  22. data/app/views/govuk_publishing_components/components/_related_navigation.html.erb +3 -3
  23. data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +5 -5
  24. data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +4 -4
  25. data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +4 -4
  26. data/app/views/govuk_publishing_components/components/_tabs.html.erb +9 -9
  27. data/app/views/govuk_publishing_components/components/contextual_sidebar/_ukraine_cta.html.erb +2 -2
  28. data/app/views/govuk_publishing_components/components/cross_service_header/_one_login_header.html.erb +97 -0
  29. data/app/views/govuk_publishing_components/components/cross_service_header/_service_header.html.erb +49 -0
  30. data/app/views/govuk_publishing_components/components/docs/accordion.yml +4 -4
  31. data/app/views/govuk_publishing_components/components/docs/contents_list.yml +3 -3
  32. data/app/views/govuk_publishing_components/components/docs/contextual_breadcrumbs.yml +3 -4
  33. data/app/views/govuk_publishing_components/components/docs/contextual_footer.yml +3 -3
  34. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +9 -9
  35. data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +3 -3
  36. data/app/views/govuk_publishing_components/components/docs/cross_service_header.yml +64 -0
  37. data/app/views/govuk_publishing_components/components/docs/devolved_nations.yml +4 -4
  38. data/app/views/govuk_publishing_components/components/docs/emergency_banner.yml +3 -3
  39. data/app/views/govuk_publishing_components/components/docs/intervention.yml +8 -8
  40. data/app/views/govuk_publishing_components/components/docs/metadata.yml +3 -3
  41. data/app/views/govuk_publishing_components/components/docs/phase_banner.yml +3 -3
  42. data/app/views/govuk_publishing_components/components/docs/previous_and_next_navigation.yml +3 -3
  43. data/app/views/govuk_publishing_components/components/docs/related_navigation.yml +3 -4
  44. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav.yml +7 -11
  45. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml +3 -3
  46. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_related.yml +4 -4
  47. data/app/views/govuk_publishing_components/components/docs/tabs.yml +5 -5
  48. data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +3 -3
  49. data/lib/govuk_publishing_components/app_helpers/asset_helper.rb +1 -0
  50. data/lib/govuk_publishing_components/presenters/breadcrumb_selector.rb +3 -3
  51. data/lib/govuk_publishing_components/version.rb +1 -1
  52. metadata +8 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '09872f8fc97beac2824b83f22c6a74adda184c945984bb878d899452192052ce'
4
- data.tar.gz: 9f7689553e25cb9e72e7de26935311ea1ae95bee9327c09cd9e374bbe437c972
3
+ metadata.gz: e557b51d72b7858a00cdad6c54582292ea879bc1946dfd8270c6b511bfad6733
4
+ data.tar.gz: 83254be91d64c54e216e34d56a4412014e6e89865decb03ac3e67dfec7a6d7a9
5
5
  SHA512:
6
- metadata.gz: 215a4cce5c28672ef092448b974f1fc2ab5f54292f0559f2fe916417c446664a02f4e315ba94ae12eb6a3e41fb21a1ecbfc6088fd47190746753a4c0e9d85012
7
- data.tar.gz: a7911d856eef0bf64ebaa5d8198a2673dda51c3c76ae496c6546cac7ee26ba72d740fcaec92b70c9461d515d871ef54a9a2694f8da360d47039fe92390532cd4
6
+ metadata.gz: 587ee2f4ef4387524b0343c1f0f08b8157a5c7820eb36d7fbfe89567708e2e1d7f9626a63a88eb88c6bf35b4e32a705bcf7f979ad8a2b7cfd9d569dd7dc72110
7
+ data.tar.gz: 5e2ce07e04779116ad682cd59139abbc04c4a8cc46832dedc66b5b7937bd5db0dd5949a0c89ceacbdacc29a17ce9ec24b688652a796175754124bbee6ab10fe7
@@ -30,6 +30,7 @@
30
30
  //= link govuk_publishing_components/components/_contextual-sidebar.css
31
31
  //= link govuk_publishing_components/components/_cookie-banner.css
32
32
  //= link govuk_publishing_components/components/_copy-to-clipboard.css
33
+ //= link govuk_publishing_components/components/_cross-service-header.css
33
34
  //= link govuk_publishing_components/components/_date-input.css
34
35
  //= link govuk_publishing_components/components/_details.css
35
36
  //= link govuk_publishing_components/components/_devolved-nations.css
@@ -135,6 +135,8 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
135
135
  return 'command/win click'
136
136
  } else if (event.shiftKey) {
137
137
  return 'shift click'
138
+ } else if (event.altKey) {
139
+ return 'alt/option click'
138
140
  } else {
139
141
  return 'primary click'
140
142
  }
@@ -13,7 +13,7 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics
13
13
  configureVideo: function (event) {
14
14
  var player = event.target
15
15
  var videoId = player.id
16
- var duration = player.getDuration()
16
+ var duration = Math.ceil(player.getDuration())
17
17
  var percentages = [25, 50, 75]
18
18
 
19
19
  for (var i = 0; i < percentages.length; i++) {
@@ -23,6 +23,10 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics
23
23
  // interval is once a second, so end point must be at least one second beyond begin point
24
24
  this.handlers['video-' + videoId + '-' + percent + '-percent-end'] = position + 2
25
25
  }
26
+ // store all these values otherwise we have to get them for every event
27
+ this.handlers['video-' + videoId + '-duration'] = duration // store initially, as number returned from API varies
28
+ this.handlers['video-' + videoId + '-title'] = player.videoTitle
29
+ this.handlers['video-' + videoId + '-url'] = this.cleanVideoUrl(player.getVideoUrl())
26
30
  },
27
31
 
28
32
  trackVideo: function (event, state) {
@@ -68,13 +72,13 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics
68
72
 
69
73
  sendData: function (player, event, position) {
70
74
  var data = {}
75
+ data.action = event
71
76
  data.event_name = 'video_' + event
72
77
  data.type = 'video'
73
- data.url = this.cleanVideoUrl(player.getVideoUrl())
74
- data.text = player.videoTitle
75
- data.action = event
78
+ data.url = this.handlers['video-' + player.id + '-url']
79
+ data.text = this.handlers['video-' + player.id + '-title']
76
80
  data.video_current_time = Math.round(player.getCurrentTime())
77
- data.video_duration = Math.ceil(player.getDuration()) // number returned from the API varies, so round up
81
+ data.video_duration = this.handlers['video-' + player.id + '-duration']
78
82
  data.video_percent = position
79
83
 
80
84
  var schemas = new window.GOVUK.analyticsGa4.Schemas()
@@ -0,0 +1,78 @@
1
+ window.GOVUK = window.GOVUK || {}
2
+ window.GOVUK.Modules = window.GOVUK.Modules || {};
3
+
4
+ (function (Modules) {
5
+ /**
6
+ * A modified adaptation of the Design System header script
7
+ * To initialise the One Login header, run:
8
+ * new window.CrossServiceHeader(document.querySelector("[data-module='one-login-header']")).init();
9
+ */
10
+ function CrossServiceHeader ($module) {
11
+ this.$header = $module
12
+ this.$navigation = $module && $module.querySelectorAll('[data-one-login-header-nav]')
13
+ this.$numberOfNavs = this.$navigation && this.$navigation.length
14
+ if (this.$header) {
15
+ this.$header.classList.add('js-enabled')
16
+ }
17
+ }
18
+ /**
19
+ * Initialise header
20
+ *
21
+ * Check for the presence of the header, menu and menu button – if any are
22
+ * missing then there's nothing to do so return early.
23
+ */
24
+ CrossServiceHeader.prototype.init = function () {
25
+ if (!this.$header && !this.$numberOfNavs) {
26
+ return
27
+ }
28
+ /**
29
+ * The header can render with one or two navigation elements which collapse
30
+ * into dropdowns on the mobile variation. This initialises the dropdown
31
+ * functionality for all navs that have a menu button which has:
32
+ * 1. a class of .js-x-header-toggle
33
+ * 2. an aria-controls attribute which can be mapped to the ID of the element
34
+ * that should be hidden on mobile
35
+ */
36
+ for (var i = 0; i < this.$numberOfNavs; i++) {
37
+ var $nav = this.$navigation[i]
38
+ $nav.$menuButton = $nav.querySelector('.js-x-header-toggle')
39
+
40
+ $nav.$menu = $nav.$menuButton && $nav.querySelector(
41
+ '#' + $nav.$menuButton.getAttribute('aria-controls')
42
+ )
43
+ if (!$nav.$menuButton || !$nav.$menu) {
44
+ return
45
+ }
46
+ $nav.$menuOpenClass = $nav.$menu && $nav.$menu.dataset.openClass
47
+ $nav.$menuButtonOpenClass = $nav.$menuButton && $nav.$menuButton.dataset.openClass
48
+ $nav.$menuButtonOpenLabel = $nav.$menuButton && $nav.$menuButton.dataset.labelForShow
49
+ $nav.$menuButtonCloseLabel = $nav.$menuButton && $nav.$menuButton.dataset.labelForHide
50
+ $nav.$menuButtonOpenText = $nav.$menuButton && $nav.$menuButton.dataset.textForShow
51
+ $nav.$menuButtonCloseText = $nav.$menuButton && $nav.$menuButton.dataset.textForHide
52
+ $nav.isOpen = false
53
+
54
+ $nav.$menuButton.addEventListener('click', this.handleMenuButtonClick.bind($nav))
55
+ }
56
+ }
57
+
58
+ /**
59
+ * Handle menu button click
60
+ *
61
+ * When the menu button is clicked, change the visibility of the menu and then
62
+ * sync the accessibility state and menu button state
63
+ */
64
+ CrossServiceHeader.prototype.handleMenuButtonClick = function () {
65
+ this.isOpen = !this.isOpen
66
+ this.$menuOpenClass && this.$menu.classList.toggle(this.$menuOpenClass, this.isOpen)
67
+ this.$menuButtonOpenClass && this.$menuButton.classList.toggle(this.$menuButtonOpenClass, this.isOpen)
68
+ this.$menuButton.setAttribute('aria-expanded', this.isOpen)
69
+ if (this.$menuButtonCloseLabel && this.$menuButtonOpenLabel) {
70
+ this.$menuButton.setAttribute('aria-label', (this.isOpen ? this.$menuButtonCloseLabel : this.$menuButtonOpenLabel))
71
+ }
72
+ if (this.$menuButtonCloseText && this.$menuButtonOpenText) {
73
+ this.$menuButton.innerHTML = this.isOpen ? this.$menuButtonCloseText : this.$menuButtonOpenText
74
+ }
75
+ }
76
+
77
+ Modules.CrossServiceHeader = CrossServiceHeader
78
+ })(window.GOVUK.Modules)
@@ -27,6 +27,7 @@ $govuk-new-link-styles: true;
27
27
  @import "components/contextual-sidebar";
28
28
  @import "components/cookie-banner";
29
29
  @import "components/copy-to-clipboard";
30
+ @import "components/cross-service-header";
30
31
  @import "components/date-input";
31
32
  @import "components/details";
32
33
  @import "components/devolved-nations";
@@ -0,0 +1,430 @@
1
+ @import "govuk_publishing_components/individual_component_support";
2
+
3
+ // start mixins and variables
4
+ $govuk-header-link-underline-thickness: 3px;
5
+
6
+ @mixin toggle-button-focus($default-text-colour) {
7
+ color: $default-text-colour;
8
+ // apply focus style on :focus for browsers which support :focus but not :focus-visible
9
+ &:focus {
10
+ @include govuk-focused-text;
11
+
12
+ // overwrite previous styles for browsers which support :focus-visible
13
+ &:not(:focus-visible) {
14
+ outline: none;
15
+ color: $default-text-colour;
16
+ background: none;
17
+ box-shadow: none;
18
+ }
19
+
20
+ // apply focus style on :focus-visible for browsers which support :focus-visible
21
+ &-visible {
22
+ @include govuk-focused-text;
23
+ }
24
+ }
25
+ }
26
+
27
+ @mixin nav-style($nav-open-class) {
28
+ display: block;
29
+ // if JS is unavailable, the nav links are expanded and the toggle button is hidden
30
+ .gem-c-cross-service-header.js-enabled & {
31
+ display: none;
32
+
33
+ &#{$nav-open-class} {
34
+ display: block;
35
+ }
36
+
37
+ @include govuk-media-query($from: tablet) {
38
+ display: block;
39
+ }
40
+ }
41
+
42
+ @include govuk-media-query($until: tablet) {
43
+ width: 100%;
44
+ }
45
+ }
46
+ // end mixins and variables
47
+
48
+ .gem-c-cross-service-header__button {
49
+ display: none;
50
+
51
+ .gem-c-cross-service-header.js-enabled & {
52
+ display: inline;
53
+ display: flex;
54
+
55
+ @include govuk-media-query($from: tablet) {
56
+ display: none;
57
+ }
58
+ }
59
+
60
+ @include govuk-font($size: 19, $weight: bold);
61
+ position: relative;
62
+ align-items: center;
63
+ cursor: pointer;
64
+ min-width: 240px;
65
+ min-width: max-content;
66
+ border: 0;
67
+ margin: 0;
68
+ padding: govuk-spacing(2) 0 govuk-spacing(1) govuk-spacing(4);
69
+ background: none;
70
+
71
+ &::before {
72
+ content: "";
73
+ position: absolute;
74
+ left: 0.15rem;
75
+ top: 50%;
76
+ box-sizing: border-box;
77
+ display: inline-block;
78
+ width: 0.6rem;
79
+ height: 0.6rem;
80
+ transform: translateY(-65%) rotate(135deg);
81
+ border-top: 0.15rem solid;
82
+ border-right: 0.15rem solid;
83
+ }
84
+
85
+ &.gem-c-cross-service-header__button--open {
86
+ &::before {
87
+ transform: translateY(-15%) rotate(-45deg);
88
+ }
89
+ }
90
+
91
+ &.gem-c-cross-service-header__button--service-header {
92
+ @include toggle-button-focus($govuk-link-colour);
93
+ }
94
+
95
+ &.gem-c-cross-service-header__button--one-login {
96
+ @include toggle-button-focus(govuk-colour("white"));
97
+ }
98
+ }
99
+
100
+ .gem-c-cross-service-header__button-icon {
101
+ margin-left: govuk-spacing(2);
102
+ font-size: 0;
103
+
104
+ &.gem-c-cross-service-header__button-icon--focus {
105
+ display: none;
106
+ }
107
+
108
+ // apply focus style on :focus for browsers which support :focus but not :focus-visible
109
+ .gem-c-cross-service-header__button:focus & {
110
+ &.gem-c-cross-service-header__button-icon--default {
111
+ display: none;
112
+ }
113
+
114
+ &.gem-c-cross-service-header__button-icon--focus {
115
+ display: inline;
116
+ }
117
+ }
118
+
119
+ // overwrite previous styles for browsers which support :focus-visible
120
+ .gem-c-cross-service-header__button:focus:not(:focus-visible) & {
121
+ &.gem-c-cross-service-header__button-icon--default {
122
+ display: inline;
123
+ }
124
+
125
+ &.gem-c-cross-service-header__button-icon--focus {
126
+ display: none;
127
+ }
128
+ }
129
+
130
+ // apply focus style on :focus-visible for browsers which support :focus-visible
131
+ .gem-c-cross-service-header__button:focus-visible & {
132
+ &.gem-c-cross-service-header__button-icon--default {
133
+ display: none;
134
+ }
135
+
136
+ &.gem-c-cross-service-header__button-icon--focus {
137
+ display: inline;
138
+ }
139
+ }
140
+ }
141
+
142
+ // start One Login header styles
143
+ .gem-c-one-login-header {
144
+ @include govuk-font($size: 19);
145
+ color: govuk-colour("white");
146
+ background: govuk-colour("black");
147
+ border-bottom: govuk-spacing(2) solid $govuk-link-colour;
148
+ position: relative;
149
+ }
150
+
151
+ .gem-c-one-login-header__container {
152
+ display: flex;
153
+ position: relative;
154
+ justify-content: space-between;
155
+ align-items: center;
156
+ flex-wrap: wrap;
157
+ }
158
+
159
+ .gem-c-one-login-header__logo {
160
+ min-width: max-content;
161
+ padding-top: govuk-spacing(2);
162
+ padding-bottom: govuk-spacing(2);
163
+ max-width: 33.33%;
164
+ @include govuk-media-query($from: desktop) {
165
+ width: 33.33%;
166
+ padding-right: govuk-spacing(3);
167
+ }
168
+ }
169
+
170
+ .gem-c-one-login-header__link,
171
+ .gem-c-one-login-header__nav__link {
172
+ &:link,
173
+ &:visited {
174
+ @include govuk-typography-common;
175
+ @include govuk-link-style-inverse;
176
+ text-decoration: none;
177
+
178
+ &:hover {
179
+ text-decoration: underline;
180
+ text-decoration-thickness: $govuk-header-link-underline-thickness;
181
+
182
+ @if $govuk-link-underline-offset {
183
+ text-underline-offset: $govuk-link-underline-offset;
184
+ }
185
+ }
186
+
187
+ &:focus {
188
+ @include govuk-focused-text;
189
+ }
190
+ }
191
+ }
192
+
193
+ .gem-c-one-login-header__logotype {
194
+ display: inline-block;
195
+
196
+ // Add a gap after the logo in case it's followed by a product name. This
197
+ // gets removed later if the logotype is a :last-child.
198
+ margin-right: govuk-spacing(1);
199
+
200
+ // Prevent readability backplate from obscuring underline in Windows High
201
+ // Contrast Mode
202
+ @media (forced-colors: active) {
203
+ forced-color-adjust: none;
204
+ color: linktext;
205
+ }
206
+
207
+ // Remove the gap after the logo if there's no product name to keep hover
208
+ // and focus states neat
209
+ &:last-child {
210
+ margin-right: 0;
211
+ }
212
+ }
213
+
214
+ .gem-c-one-login-header__logotype-crown {
215
+ position: relative;
216
+ top: -1px;
217
+ margin-right: 1px;
218
+ fill: currentcolor;
219
+ vertical-align: top;
220
+ }
221
+
222
+ .gem-c-one-login-header__logotype-crown-fallback-image {
223
+ width: 36px;
224
+ height: 32px;
225
+ border: 0;
226
+ vertical-align: bottom;
227
+ }
228
+
229
+ .gem-c-one-login-header__link--homepage {
230
+ // Font size needs to be set on the link so that the box sizing is correct
231
+ // in Firefox
232
+ @include govuk-font($size: false, $weight: bold);
233
+
234
+ display: inline-block;
235
+ margin-right: govuk-spacing(2);
236
+ font-size: 30px; // We don't have a mixin that produces 30px font size
237
+ line-height: 1;
238
+
239
+ @include govuk-media-query($from: tablet) {
240
+ display: inline;
241
+
242
+ &:focus {
243
+ // Replicate the focus box shadow but without the -2px y-offset of the first yellow shadow
244
+ // This is to stop the logo getting cut off by the box shadow when focused on above a product name
245
+ box-shadow: 0 0 $govuk-focus-colour;
246
+ }
247
+ }
248
+
249
+ &:link,
250
+ &:visited {
251
+ text-decoration: none;
252
+ }
253
+
254
+ &:hover,
255
+ &:active {
256
+ // Negate the added border
257
+ margin-bottom: $govuk-header-link-underline-thickness * -1;
258
+ // Omitting colour will use default value of currentColor – if we
259
+ // specified currentColor explicitly IE8 would ignore this rule.
260
+ border-bottom: $govuk-header-link-underline-thickness solid;
261
+ }
262
+
263
+ // Remove any borders that show when focused and hovered.
264
+ &:focus {
265
+ margin-bottom: 0;
266
+ border-bottom: 0;
267
+ }
268
+ }
269
+
270
+ .gem-c-one-login-header__nav {
271
+ @include nav-style(".gem-c-one-login-header__nav--open");
272
+ @include govuk-media-query($from: tablet) {
273
+ max-width: 66%;
274
+ }
275
+ }
276
+
277
+ .gem-c-one-login-header__nav__list {
278
+ margin: 0;
279
+ padding: 0;
280
+ list-style: none;
281
+
282
+ @include govuk-media-query($from: tablet) {
283
+ padding: govuk-spacing(2) 0;
284
+ display: flex;
285
+ align-items: center;
286
+ }
287
+ }
288
+
289
+ .gem-c-one-login-header__nav__list-item {
290
+ display: inline-block;
291
+ padding: govuk-spacing(2) 0;
292
+
293
+ @include govuk-media-query($from: tablet) {
294
+ padding: govuk-spacing(2) 0 govuk-spacing(2) govuk-spacing(6);
295
+ border-left: 1px solid $govuk-border-colour;
296
+ align-self: stretch;
297
+
298
+ &:not(:last-child) {
299
+ margin-right: govuk-spacing(4);
300
+ }
301
+ }
302
+
303
+ @include govuk-media-query($until: tablet) {
304
+ width: 100%;
305
+
306
+ &:not(:last-child) {
307
+ border-bottom: 1px solid $govuk-border-colour;
308
+ }
309
+ }
310
+ }
311
+
312
+ .gem-c-one-login-header__nav__link {
313
+ font-weight: bold;
314
+
315
+ &.gem-c-one-login-header__nav__link--one-login {
316
+ @include govuk-media-query($from: tablet) {
317
+ display: flex;
318
+ justify-content: center;
319
+
320
+ // stylelint-disable max-nesting-depth
321
+ &:focus {
322
+ .gem-c-cross-service-header__button-icon {
323
+ display: none;
324
+ }
325
+
326
+ .gem-c-cross-service-header__button-icon--focus {
327
+ display: inline;
328
+ }
329
+ }
330
+ }
331
+
332
+ @include govuk-media-query($until: tablet) {
333
+ .gem-c-cross-service-header__button-icon {
334
+ display: none;
335
+ }
336
+ }
337
+ }
338
+ }
339
+ // end One Login header styles
340
+
341
+ // start service navigation styles
342
+ .gem-c-service-header {
343
+ background-color: govuk-colour("light-grey");
344
+ border-bottom: 1px solid govuk-colour("mid-grey");
345
+ }
346
+
347
+ .gem-c-service-header__container {
348
+ padding-top: govuk-spacing(1);
349
+
350
+ @include govuk-media-query ($until: tablet) {
351
+ margin-bottom: govuk-spacing(1);
352
+ }
353
+
354
+ @include govuk-media-query ($from: tablet) {
355
+ display: flex;
356
+ flex-wrap: wrap;
357
+ }
358
+ }
359
+
360
+ .gem-c-service-header__heading {
361
+ @include govuk-font($size: 24, $weight: bold);
362
+ color: $govuk-text-colour;
363
+ padding: govuk-spacing(3) 0;
364
+ margin: 0;
365
+ flex-grow: 1;
366
+
367
+ @include govuk-media-query($until: tablet) {
368
+ padding: govuk-spacing(1) 0;
369
+ }
370
+ }
371
+
372
+ .gem-c-service-header__nav {
373
+ @include nav-style(".gem-c-service-header__nav--open");
374
+ }
375
+
376
+ .gem-c-service-header__nav-list {
377
+ @include govuk-font($size: 19, $weight: bold);
378
+ list-style: none;
379
+ margin: 0;
380
+ padding: 0;
381
+
382
+ @include govuk-media-query($from: tablet) {
383
+ @include govuk-font($size: 19, $weight: bold);
384
+ }
385
+ }
386
+
387
+ .gem-c-service-header__nav-list-item {
388
+ margin: govuk-spacing(3) 0 govuk-spacing(4);
389
+
390
+ &.gem-c-service-header__nav-list-item--active {
391
+ padding-left: govuk-spacing(3);
392
+ border-left: govuk-spacing(1) solid $govuk-link-colour;
393
+ }
394
+
395
+ @include govuk-media-query($from: tablet) {
396
+ display: inline-block;
397
+ margin: 0 govuk-spacing(6) 0 0;
398
+ border-bottom: govuk-spacing(1) solid transparent;
399
+
400
+ &:last-of-type {
401
+ margin: 0;
402
+ }
403
+
404
+ &.gem-c-service-header__nav-list-item--active {
405
+ border-left: 0;
406
+ padding-left: 0;
407
+ border-bottom: govuk-spacing(1) solid $govuk-link-colour;
408
+ }
409
+ }
410
+ }
411
+
412
+ .gem-c-service-header__nav-list-item-link {
413
+ @include govuk-link-common;
414
+ @include govuk-link-style-default;
415
+ @include govuk-link-style-no-visited-state;
416
+
417
+ &:not(:hover) {
418
+ text-decoration: none;
419
+ }
420
+
421
+ @include govuk-media-query($from: tablet) {
422
+ display: inline-block;
423
+ padding: govuk-spacing(3) 0 govuk-spacing(3);
424
+
425
+ &:focus {
426
+ box-shadow: 0 (-(govuk-spacing(1))) $govuk-focus-colour, 0 govuk-spacing(1) $govuk-focus-text-colour;
427
+ }
428
+ }
429
+ }
430
+ // end service navigation styles
@@ -10,7 +10,7 @@
10
10
  anchor_navigation ||= false
11
11
  track_show_all_clicks ||= false
12
12
  track_sections ||= false
13
- ga4_tracking ||= false
13
+ disable_ga4 ||= false
14
14
  data_attributes_show_all ||= nil
15
15
 
16
16
  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
@@ -19,8 +19,8 @@
19
19
  component_helper.add_class(shared_helper.get_margin_bottom)
20
20
 
21
21
  component_helper.add_data_attribute({ module: "govuk-accordion gem-accordion" })
22
- component_helper.add_data_attribute({ module: "ga4-event-tracker" }) if ga4_tracking
23
- component_helper.add_data_attribute({ ga4_expandable: "" }) if ga4_tracking
22
+ component_helper.add_data_attribute({ module: "ga4-event-tracker" }) unless disable_ga4
23
+ component_helper.add_data_attribute({ ga4_expandable: "" }) unless disable_ga4
24
24
  component_helper.add_data_attribute({ anchor_navigation: anchor_navigation }) if anchor_navigation
25
25
  component_helper.add_data_attribute({ track_show_all_clicks: track_show_all_clicks }) if track_show_all_clicks
26
26
  component_helper.add_data_attribute({ track_sections: track_sections }) if track_sections
@@ -39,7 +39,7 @@
39
39
  item[:data_attributes] ||= nil
40
40
  ga4_link_data_attributes ||= nil
41
41
 
42
- if ga4_tracking
42
+ unless disable_ga4
43
43
  heading_text = Nokogiri::HTML(item[:heading][:text]).text
44
44
  item[:data_attributes] ||= {}
45
45
  item[:data_attributes][:ga4_event] = {
@@ -12,18 +12,18 @@
12
12
  link_classes << brand_helper.color_class
13
13
  link_classes << "govuk-link--no-underline" unless underline_links
14
14
 
15
- ga4_tracking ||= false
15
+ disable_ga4 ||= false
16
16
  ga4_data = {
17
17
  event_name: "navigation",
18
18
  section: t("components.contents_list.contents", locale: :en) || "",
19
19
  type: "contents list",
20
20
  index_total: cl_helper.get_index_total,
21
- } if ga4_tracking
21
+ } unless disable_ga4
22
22
  local_assigns[:aria] ||= {}
23
23
  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
24
24
  component_helper.add_class("gem-c-contents-list #{brand_helper.brand_class}")
25
25
  component_helper.add_data_attribute({ module: "gem-track-click" })
26
- component_helper.add_data_attribute({ module: "ga4-link-tracker" }) if ga4_tracking
26
+ component_helper.add_data_attribute({ module: "ga4-link-tracker" }) unless disable_ga4
27
27
  component_helper.add_aria_attribute({ label: t("components.contents_list.contents") }) unless local_assigns[:aria][:label]
28
28
  component_helper.add_role("navigation")
29
29
  -%>
@@ -38,11 +38,11 @@
38
38
  <% end %>
39
39
 
40
40
  <ol class="gem-c-contents-list__list">
41
- <% index_link = 1 if ga4_tracking %>
41
+ <% index_link = 1 unless disable_ga4 %>
42
42
  <% contents.each.with_index(1) do |contents_item, position| %>
43
43
  <li class="<%= cl_helper.list_item_classes(contents_item, false) %>" <%= "aria-current=true" if contents_item[:active] %>>
44
44
  <% link_text = format_numbers ? cl_helper.wrap_numbers_with_spans(contents_item[:text]) : contents_item[:text]
45
- if ga4_tracking
45
+ unless disable_ga4
46
46
  ga4_data[:event_name] = cl_helper.get_ga4_event_name(contents_item[:href]) if contents_item[:href]
47
47
  ga4_data[:index_link] = index_link
48
48
  end
@@ -56,16 +56,16 @@
56
56
  track_options: {
57
57
  dimension29: contents_item[:text]
58
58
  },
59
- ga4_link: (ga4_tracking ? ga4_data.to_json : nil)
59
+ ga4_link: (!disable_ga4 ? ga4_data.to_json : nil)
60
60
  }
61
61
  %>
62
- <% index_link += 1 if ga4_tracking %>
62
+ <% index_link += 1 unless disable_ga4 %>
63
63
  <% if contents_item[:items] && contents_item[:items].any? %>
64
64
  <ol class="gem-c-contents-list__nested-list">
65
65
  <% contents_item[:items].each.with_index(1) do |nested_contents_item, nested_position| %>
66
66
  <li class="<%= cl_helper.list_item_classes(nested_contents_item, true) %>" <%= "aria-current=true" if nested_contents_item[:active] %>>
67
67
  <%
68
- if ga4_tracking
68
+ unless disable_ga4
69
69
  ga4_data[:event_name] = cl_helper.get_ga4_event_name(nested_contents_item[:href]) if nested_contents_item[:href]
70
70
  ga4_data[:index_link] = index_link
71
71
  end
@@ -79,11 +79,11 @@
79
79
  track_options: {
80
80
  dimension29: nested_contents_item[:text]
81
81
  },
82
- ga4_link: (ga4_tracking ? ga4_data.to_json : nil)
82
+ ga4_link: (!disable_ga4 ? ga4_data.to_json : nil)
83
83
  }
84
84
  %>
85
85
  </li>
86
- <% index_link += 1 if ga4_tracking %>
86
+ <% index_link += 1 unless disable_ga4 %>
87
87
  <% end %>
88
88
  </ol>
89
89
  <% end %>