govuk_publishing_components 35.22.0 → 36.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) 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-auto-tracker.js +1 -5
  4. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +29 -41
  5. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-event-tracker.js +6 -10
  6. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-tracker.js +1 -4
  7. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js +1 -5
  8. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js +6 -17
  9. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-print-intent-tracker.js +1 -3
  10. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-schemas.js +4 -20
  11. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-scroll-tracker.js +1 -3
  12. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-specialist-link-tracker.js +1 -5
  13. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-video-tracker.js +1 -4
  14. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/pii-remover.js +22 -4
  15. data/app/assets/javascripts/govuk_publishing_components/components/cross-service-header.js +78 -0
  16. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +3 -79
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_cross-service-header.scss +430 -0
  19. data/app/views/govuk_publishing_components/components/_action_link.html.erb +2 -19
  20. data/app/views/govuk_publishing_components/components/_cross_service_header.html.erb +19 -0
  21. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +9 -0
  22. data/app/views/govuk_publishing_components/components/cross_service_header/_one_login_header.html.erb +97 -0
  23. data/app/views/govuk_publishing_components/components/cross_service_header/_service_header.html.erb +49 -0
  24. data/app/views/govuk_publishing_components/components/docs/action_link.yml +1 -52
  25. data/app/views/govuk_publishing_components/components/docs/cross_service_header.yml +64 -0
  26. data/lib/govuk_publishing_components/app_helpers/asset_helper.rb +1 -0
  27. data/lib/govuk_publishing_components/presenters/component_wrapper_helper.rb +1 -1
  28. data/lib/govuk_publishing_components/presenters/meta_tags.rb +21 -0
  29. data/lib/govuk_publishing_components/version.rb +1 -1
  30. metadata +8 -10
  31. data/app/assets/images/govuk_publishing_components/action-link--nhs.png +0 -0
  32. data/app/assets/images/govuk_publishing_components/action-link--nhs.svg +0 -1
  33. data/app/assets/images/govuk_publishing_components/action-link-arrow--blue.png +0 -0
  34. data/app/assets/images/govuk_publishing_components/action-link-arrow--blue.svg +0 -9
  35. data/app/assets/images/govuk_publishing_components/action-link-arrow--brexit.svg +0 -3
  36. data/app/assets/images/govuk_publishing_components/action-link-arrow--transparent.svg +0 -1
  37. data/app/assets/images/govuk_publishing_components/action-link-arrow--white.png +0 -0
  38. data/app/assets/images/govuk_publishing_components/action-link-arrow--white.svg +0 -1
@@ -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
@@ -11,32 +11,17 @@
11
11
  subtext_href ||= false
12
12
  mobile_subtext ||= false
13
13
  light_text ||= false
14
- blue_arrow ||= false
15
- white_arrow ||= false
16
14
  simple ||= false
17
15
  simple_light ||= false
18
16
  dark_icon ||= false
19
17
  dark_large_icon ||= false
20
18
  light_icon ||= false
21
- small_icon ||= false
22
- nhs_icon ||= false
23
- brexit_icon ||= false
24
- transparent_icon ||= false
25
- data ||= nil
26
- classes ||= nil
27
- font_size ||= nil
28
19
 
29
20
  css_classes = %w(gem-c-action-link)
30
21
  css_classes << "gem-c-action-link--light-text" if light_text
31
22
  css_classes << "gem-c-action-link--dark-icon" if dark_icon
32
23
  css_classes << "gem-c-action-link--dark-large-icon" if dark_large_icon
33
- css_classes << "gem-c-action-link--small-icon" if small_icon
34
- css_classes << "gem-c-action-link--transparent-icon" if transparent_icon
35
24
  css_classes << "gem-c-action-link--light-icon" if light_icon
36
- css_classes << "gem-c-action-link--nhs" if nhs_icon
37
- css_classes << "gem-c-action-link--brexit" if brexit_icon
38
- css_classes << "gem-c-action-link--blue-arrow" if blue_arrow
39
- css_classes << "gem-c-action-link--white-arrow" if white_arrow
40
25
  css_classes << "gem-c-action-link--simple" if simple
41
26
  css_classes << "gem-c-action-link--simple-light" if simple_light
42
27
  css_classes << "gem-c-action-link--with-subtext" if subtext
@@ -44,9 +29,7 @@
44
29
  css_classes << shared_helper.get_margin_bottom
45
30
 
46
31
  link_classes = %w(govuk-link gem-c-action-link__link)
47
- link_classes << shared_helper.classes if classes
48
32
  link_classes << "govuk-link--inverse" if light_text
49
- link_classes << shared_helper.get_heading_size(font_size, 'm') if font_size
50
33
 
51
34
  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
52
35
  component_helper.add_class(css_classes.join(" "))
@@ -61,7 +44,7 @@
61
44
  <% end %>
62
45
 
63
46
  <% if href.present? %>
64
- <%= link_to href, class: link_classes, data: data do %>
47
+ <%= link_to href, class: link_classes do %>
65
48
  <%= main_text %>
66
49
  <% end %>
67
50
  <% else %>
@@ -73,7 +56,7 @@
73
56
  <span class="gem-c-action-link__subtext-wrapper">
74
57
  <% if subtext_href %>
75
58
  <%= content_tag(:span, subtext, class: "gem-c-action-link__subtext") do %>
76
- <%= link_to subtext, subtext_href, class: link_classes, data: data %>
59
+ <%= link_to subtext, subtext_href, class: link_classes %>
77
60
  <% end %>
78
61
  <% else %>
79
62
  <%= content_tag(:span, subtext, class: "gem-c-action-link__subtext") %>
@@ -0,0 +1,19 @@
1
+ <%
2
+ add_gem_component_stylesheet("cross-service-header")
3
+
4
+ product_name ||= nil
5
+ one_login_navigation_items ||= []
6
+ service_navigation_items ||= []
7
+ service_navigation_aria_label ||= "Service menu"
8
+ %>
9
+
10
+ <header class="gem-c-cross-service-header" role="banner" data-module="cross-service-header">
11
+ <%= render "govuk_publishing_components/components/cross_service_header/one_login_header", {
12
+ one_login_navigation_items: one_login_navigation_items,
13
+ } %>
14
+ <%= render "govuk_publishing_components/components/cross_service_header/service_header", {
15
+ service_navigation_aria_label: service_navigation_aria_label,
16
+ service_navigation_items: service_navigation_items,
17
+ product_name: product_name,
18
+ } %>
19
+ </header>
@@ -11,12 +11,15 @@
11
11
  blue_bar_background_colour = layout_helper.blue_bar_background_colours.include?(blue_bar_background_colour) ? blue_bar_background_colour : nil
12
12
  logo_link ||= "/"
13
13
  navigation_items ||= []
14
+ one_login_navigation_items ||= {}
15
+ service_navigation_items ||= []
14
16
  omit_feedback_form ||= false
15
17
  omit_footer_navigation ||= false
16
18
  omit_footer_border ||= false
17
19
  omit_header ||= false
18
20
  product_name ||= nil
19
21
  show_explore_header ||= false
22
+ show_cross_service_header ||= false
20
23
  draft_watermark ||= false
21
24
  show_search = local_assigns.include?(:show_search) ? local_assigns[:show_search] : true
22
25
  title ||= "GOV.UK - The best place to find government services and information"
@@ -113,6 +116,12 @@
113
116
  logo_link: logo_link,
114
117
  } %>
115
118
  <% end %>
119
+ <% elsif show_cross_service_header %>
120
+ <%= render "govuk_publishing_components/components/cross_service_header", {
121
+ one_login_navigation_items: one_login_navigation_items,
122
+ service_navigation_items: service_navigation_items,
123
+ product_name: product_name,
124
+ } %>
116
125
  <% else %>
117
126
  <%= render "govuk_publishing_components/components/layout_header", {
118
127
  search: show_search,
@@ -0,0 +1,97 @@
1
+ <% one_login_home = one_login_navigation_items[:one_login_home] %>
2
+ <% one_login_sign_out = one_login_navigation_items[:one_login_sign_out] %>
3
+
4
+ <div class="gem-c-one-login-header" data-one-login-header-nav>
5
+ <div class="gem-c-one-login-header__container govuk-width-container">
6
+ <div class="gem-c-one-login-header__logo">
7
+ <a href="https://www.gov.uk/" class="gem-c-one-login-header__link gem-c-one-login-header__link--homepage">
8
+ <span class="gem-c-one-login-header__logotype">
9
+ <!--[if gt IE 8]><!-->
10
+ <svg aria-hidden="true" focusable="false" class="gem-c-one-login-header__logotype-crown" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 132 97" height="30" width="36">
11
+ <path fill="currentColor" fill-rule="evenodd" d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM9 39.5c3.6 1.5 7.8-.2 9.2-3.7 1.5-3.6-.2-7.8-3.9-9.1-3.6-1.5-7.6.2-9.1 3.8-1.4 3.5.3 7.5 3.8 9zM4.4 57.2c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.5-1.5-7.6.3-9.1 3.8-1.4 3.5.3 7.6 3.9 9.1zm38.3-21.4c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.6-1.5-7.6.3-9.1 3.8-1.3 3.6.4 7.7 3.9 9.1zm64.4-5.6c-3.6 1.5-7.8-.2-9.1-3.7-1.5-3.6.2-7.8 3.8-9.2 3.6-1.4 7.7.3 9.2 3.9 1.3 3.5-.4 7.5-3.9 9zm15.9 9.3c-3.6 1.5-7.7-.2-9.1-3.7-1.5-3.6.2-7.8 3.7-9.1 3.6-1.5 7.7.2 9.2 3.8 1.5 3.5-.3 7.5-3.8 9zm4.7 17.7c-3.6 1.5-7.8-.2-9.2-3.8-1.5-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.3 3.5-.4 7.6-3.9 9.1zM89.3 35.8c-3.6 1.5-7.8-.2-9.2-3.8-1.4-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.4 3.6-.3 7.7-3.9 9.1zM69.7 17.7l8.9 4.7V9.3l-8.9 2.8c-.2-.3-.5-.6-.9-.9L72.4 0H59.6l3.5 11.2c-.3.3-.6.5-.9.9l-8.8-2.8v13.1l8.8-4.7c.3.3.6.7.9.9l-5 15.4v.1c-.2.8-.4 1.6-.4 2.4 0 4.1 3.1 7.5 7 8.1h.2c.3 0 .7.1 1 .1.4 0 .7 0 1-.1h.2c4-.6 7.1-4.1 7.1-8.1 0-.8-.1-1.7-.4-2.4V34l-5.1-15.4c.4-.2.7-.6 1-.9zM66 92.8c16.9 0 32.8 1.1 47.1 3.2 4-16.9 8.9-26.7 14-33.5l-9.6-3.4c1 4.9 1.1 7.2 0 10.2-1.5-1.4-3-4.3-4.2-8.7L108.6 76c2.8-2 5-3.2 7.5-3.3-4.4 9.4-10 11.9-13.6 11.2-4.3-.8-6.3-4.6-5.6-7.9 1-4.7 5.7-5.9 8-.5 4.3-8.7-3-11.4-7.6-8.8 7.1-7.2 7.9-13.5 2.1-21.1-8 6.1-8.1 12.3-4.5 20.8-4.7-5.4-12.1-2.5-9.5 6.2 3.4-5.2 7.9-2 7.2 3.1-.6 4.3-6.4 7.8-13.5 7.2-10.3-.9-10.9-8-11.2-13.8 2.5-.5 7.1 1.8 11 7.3L80.2 60c-4.1 4.4-8 5.3-12.3 5.4 1.4-4.4 8-11.6 8-11.6H55.5s6.4 7.2 7.9 11.6c-4.2-.1-8-1-12.3-5.4l1.4 16.4c3.9-5.5 8.5-7.7 10.9-7.3-.3 5.8-.9 12.8-11.1 13.8-7.2.6-12.9-2.9-13.5-7.2-.7-5 3.8-8.3 7.1-3.1 2.7-8.7-4.6-11.6-9.4-6.2 3.7-8.5 3.6-14.7-4.6-20.8-5.8 7.6-5 13.9 2.2 21.1-4.7-2.6-11.9.1-7.7 8.8 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"></path>
12
+ </svg>
13
+ <!--<![endif]-->
14
+ <span>
15
+ GOV.UK
16
+ </span>
17
+ </span>
18
+ </a>
19
+ </div>
20
+
21
+ <button type="button"
22
+ aria-controls="one-login-header__nav"
23
+ aria-label="Show GOV.UK One Login menu"
24
+ data-open-class="gem-c-cross-service-header__button--open"
25
+ data-label-for-show="Show GOV.UK One Login menu"
26
+ data-label-for-hide="Hide GOV.UK One Login menu"
27
+ aria-expanded="false"
28
+ class="gem-c-cross-service-header__button gem-c-cross-service-header__button--one-login js-x-header-toggle">
29
+ <span class="gem-c-cross-service-header__button-content">One Login</span>
30
+
31
+ <!--[if gt IE 8]><!-->
32
+ <span class="gem-c-cross-service-header__button-icon gem-c-cross-service-header__button-icon--default">
33
+ <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true">
34
+ <circle cx="11" cy="11" r="11" fill="white"/>
35
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.29297 18.8487C4.23255 15.4753 7.32741 13 11.0004 13C14.6731 13 17.7678 15.4749 18.7076 18.848C17.8058 19.7338 16.752 20.4654 15.5889 21H11.0004H6.41097C5.24819 20.4655 4.19463 19.7342 3.29297 18.8487Z" fill="#1D70B8"/>
36
+ <circle cx="11" cy="7.75" r="3.75" fill="#1D70B8"/>
37
+ <circle cx="11" cy="11" r="10" stroke="white" stroke-width="2"/>
38
+ </svg>
39
+ </span>
40
+ <!--<![endif]-->
41
+
42
+ <!--[if gt IE 8]><!-->
43
+ <span class="gem-c-cross-service-header__button-icon gem-c-cross-service-header__button-icon--focus">
44
+ <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true">
45
+ <circle cx="11" cy="11" r="11" fill="black"/>
46
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.29297 18.8487C4.23255 15.4753 7.32741 13 11.0004 13C14.6731 13 17.7678 15.4749 18.7076 18.848C17.8058 19.7338 16.752 20.4654 15.5889 21H11.0004H6.41097C5.24819 20.4655 4.19463 19.7342 3.29297 18.8487Z" fill="white"/>
47
+ <circle cx="11" cy="7.75" r="3.75" fill="white"/>
48
+ <circle cx="11" cy="11" r="10" stroke="black" stroke-width="2"/>
49
+ </svg>
50
+ </span>
51
+ <!--<![endif]-->
52
+ </button>
53
+
54
+ <nav aria-label="GOV.UK One Login menu" class="gem-c-one-login-header__nav" data-open-class="gem-c-one-login-header__nav--open" id="one-login-header__nav">
55
+ <ul class="gem-c-one-login-header__nav__list">
56
+ <li class="gem-c-one-login-header__nav__list-item">
57
+ <%= link_to one_login_home[:href], class: "gem-c-one-login-header__nav__link gem-c-one-login-header__nav__link--one-login", data: one_login_home[:data] do %>
58
+ <span class="gem-c-one-login-header__nav__link-content">
59
+ GOV.UK One Login
60
+ </span>
61
+
62
+ <!--[if gt IE 8]><!-->
63
+ <span class="gem-c-cross-service-header__button-icon gem-c-cross-service-header__button-icon--default">
64
+ <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true">
65
+ <circle cx="11" cy="11" r="11" fill="white"/>
66
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.29297 18.8487C4.23255 15.4753 7.32741 13 11.0004 13C14.6731 13 17.7678 15.4749 18.7076 18.848C17.8058 19.7338 16.752 20.4654 15.5889 21H11.0004H6.41097C5.24819 20.4655 4.19463 19.7342 3.29297 18.8487Z" fill="#1D70B8"/>
67
+ <circle cx="11" cy="7.75" r="3.75" fill="#1D70B8"/>
68
+ <circle cx="11" cy="11" r="10" stroke="white" stroke-width="2"/>
69
+ </svg>
70
+ </span>
71
+ <!--<![endif]-->
72
+
73
+ <!--[if gt IE 8]><!-->
74
+ <span class="gem-c-cross-service-header__button-icon gem-c-cross-service-header__button-icon--focus">
75
+ <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true">
76
+ <circle cx="11" cy="11" r="11" fill="black"/>
77
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.29297 18.8487C4.23255 15.4753 7.32741 13 11.0004 13C14.6731 13 17.7678 15.4749 18.7076 18.848C17.8058 19.7338 16.752 20.4654 15.5889 21H11.0004H6.41097C5.24819 20.4655 4.19463 19.7342 3.29297 18.8487Z" fill="white"/>
78
+ <circle cx="11" cy="7.75" r="3.75" fill="white"/>
79
+ <circle cx="11" cy="11" r="10" stroke="black" stroke-width="2"/>
80
+ </svg>
81
+ </span>
82
+ <!--<![endif]-->
83
+ <% end %>
84
+ </li>
85
+ <li class="gem-c-one-login-header__nav__list-item">
86
+ <%= link_to(
87
+ one_login_sign_out[:text],
88
+ one_login_sign_out[:href],
89
+ class: 'gem-c-one-login-header__nav__link',
90
+ data: one_login_sign_out[:data],
91
+ ) %>
92
+ </li>
93
+ </ul>
94
+ </nav>
95
+ </div>
96
+ </div>
97
+
@@ -0,0 +1,49 @@
1
+ <% service_navigation_aria_label ||= "Service menu" %>
2
+
3
+ <% if product_name %>
4
+ <div class="gem-c-service-header" data-one-login-header-nav>
5
+ <div class="govuk-width-container">
6
+ <div class="gem-c-service-header__container">
7
+ <!-- The name of your service goes here -->
8
+ <h2 class="gem-c-service-header__heading"><%= product_name %></h2>
9
+ <% if service_navigation_items.any? %>
10
+ <div>
11
+ <button type="button"
12
+ aria-controls="service-header__nav"
13
+ data-open-class="gem-c-cross-service-header__button--open"
14
+ aria-label="Show service navigation menu"
15
+ data-label-for-show="Show service navigation menu"
16
+ data-label-for-hide="Hide service navigation menu"
17
+ data-text-for-show="Menu"
18
+ data-text-for-hide="Close"
19
+ aria-expanded="false"
20
+ class="gem-c-cross-service-header__button gem-c-cross-service-header__button--gem-c-service-header js-x-header-toggle">
21
+ <span class="gem-c-service-header__button-content">Menu</span>
22
+ </button>
23
+ <!-- Important! Label your navigation appropriately! When there are multiple navigation landmarks on a page, additional labelling is required to provide support for screen reader users -->
24
+ <nav aria-label="<%= service_navigation_aria_label %>">
25
+ <ul class="gem-c-service-header__nav-list gem-c-service-header__nav" id="service-header__nav" data-open-class="gem-c-service-header__nav--open">
26
+ <% service_navigation_items.each_with_index do |item, index| %>
27
+ <%
28
+ li_classes = %w(gem-c-service-header__nav-list-item)
29
+ li_classes << "gem-c-service-header__nav-list-item--active" if item[:active]
30
+ aria_current = item[:active] ? "page" : nil
31
+ %>
32
+ <%= tag.li class: li_classes do %>
33
+ <%= link_to(
34
+ item[:text],
35
+ item[:href],
36
+ class: 'gem-c-service-header__nav-list-item-link',
37
+ data: item[:data],
38
+ aria: { current: aria_current }
39
+ ) %>
40
+ <% end %>
41
+ <% end %>
42
+ </ul>
43
+ </nav>
44
+ </div>
45
+ <% end %>
46
+ </div>
47
+ </div>
48
+ </div>
49
+ <% end %>