govuk_publishing_components 35.16.1 → 35.18.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 (33) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/action-link-arrow--light.png +0 -0
  3. data/app/assets/images/govuk_publishing_components/action-link-arrow--light.svg +7 -0
  4. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +2 -5
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +18 -0
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +147 -11
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +24 -5
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +5 -0
  9. data/app/models/govuk_publishing_components/audit_applications.rb +4 -4
  10. data/app/models/govuk_publishing_components/audit_comparer.rb +5 -5
  11. data/app/views/govuk_publishing_components/components/_action_link.html.erb +2 -0
  12. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +2 -1
  13. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +11 -4
  14. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +154 -76
  15. data/app/views/govuk_publishing_components/components/_metadata.html.erb +1 -1
  16. data/app/views/govuk_publishing_components/components/_search.html.erb +3 -0
  17. data/app/views/govuk_publishing_components/components/_share_links.html.erb +9 -9
  18. data/app/views/govuk_publishing_components/components/docs/action_link.yml +5 -0
  19. data/app/views/govuk_publishing_components/components/docs/contents_list.yml +3 -4
  20. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +5 -0
  21. data/app/views/govuk_publishing_components/components/docs/layout_super_navigation_header.yml +29 -0
  22. data/app/views/govuk_publishing_components/components/docs/search.yml +11 -0
  23. data/app/views/govuk_publishing_components/components/layout_for_public/_layout_super_navigation_header_homepage.html.erb +11 -0
  24. data/lib/govuk_publishing_components/presenters/attachment_helper.rb +1 -1
  25. data/lib/govuk_publishing_components/presenters/checkboxes_helper.rb +1 -1
  26. data/lib/govuk_publishing_components/presenters/content_item.rb +1 -1
  27. data/lib/govuk_publishing_components/presenters/contents_list_helper.rb +6 -0
  28. data/lib/govuk_publishing_components/presenters/curated_taxonomy_sidebar_links.rb +0 -2
  29. data/lib/govuk_publishing_components/presenters/devolved_nations_helper.rb +2 -2
  30. data/lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb +1 -1
  31. data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +1 -1
  32. data/lib/govuk_publishing_components/version.rb +1 -1
  33. metadata +7 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f215a358b5348fe905ec3b11ba2d3301dd263bbe5fe6961cdab3586de5f11ead
4
- data.tar.gz: fee32e2c6b0b5a587b36577db5f51a731b8c3df67b5d7b30db4089650edf7efd
3
+ metadata.gz: 5ce473a1a45f47ae5cf925f4de375968f8ad75223ef70a38d442be0160a66172
4
+ data.tar.gz: 71574933e54084b2ecff4bce0fe09eda6e34003f55fcb7d470300580e35eb54f
5
5
  SHA512:
6
- metadata.gz: f687a3d509cc89bd128d4c696f8f504575188b3ade7b6e536587c09be27ce7d0a3733203c52acfb48252ba6655a99b020d64d8ae5d2afbb23994e0f16a6bc2ad
7
- data.tar.gz: 82488d3f778c9c3dc22f27eab581965780b695a43ff0585fd191771dbbf6aa05c165616c61d89873342755e9c90b13e638766f116fef25a72baf8c08a265362f
6
+ metadata.gz: d663be268de23349809eeec83badafb7c24298221b29168df805b332bd757f4fa70d4addc4cbb197f07af00e1ed5bd501060a5c00f918a6f77ddacd7273149f0
7
+ data.tar.gz: 2b7437b0e9e25cd57b04ffe2e014ce182649fabeb5eaf10d73110f782eb255c7420bd7814273f361e4373687aff2a82fe1049ea3f7d688b05f4b9009dff46673
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="27" height="27" viewBox="0 0 27 27" fill="none">
2
+ <circle cx="13.5" cy="13.5" r="13.5" fill="#EEEFEF"/>
3
+ <g transform="translate(5 3.5) scale(0.85)">
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M14.9429 11.7949L10.4402 7.29222L11.7327 5.99967L17.528 11.7949L11.7327 17.5902L10.4402 16.2976L14.9429 11.7949Z" fill="#000000"/>
5
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.95631 10.881L15.4414 10.881L15.4414 12.709L3.95631 12.709L3.95631 10.881Z" fill="#000000"/>
6
+ </g>
7
+ </svg>
@@ -288,11 +288,8 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
288
288
  return null
289
289
  }
290
290
 
291
- // In order to extract the number of results from resultCount (which is a string at this point (e.g. '12,345 results')), we remove the comma and
292
- // split string at the space character so it can be parsed as an integer
293
- resultCount = window.GOVUK.analyticsGa4.core.trackFunctions.removeLinesAndExtraSpaces(resultCount.textContent)
294
- resultCount = resultCount.replace(',', '')
295
- resultCount = resultCount.split(' ')[0]
291
+ // Remove anything that isn't a number from the result count heading. E.g. 'Results:' or the comma in '1,234'
292
+ resultCount = resultCount.textContent.replace(/[^0-9]+/g, '')
296
293
 
297
294
  return parseInt(resultCount)
298
295
  },
@@ -166,6 +166,24 @@
166
166
  }
167
167
  }
168
168
 
169
+ .gem-c-action-link--light-icon {
170
+ &::before {
171
+ width: 36px;
172
+ height: 28px;
173
+ background: image-url("govuk_publishing_components/action-link-arrow--light.png");
174
+ background: image-url("govuk_publishing_components/action-link-arrow--light.svg"), linear-gradient(transparent, transparent);
175
+ background-repeat: no-repeat;
176
+ background-size: 28px auto;
177
+ background-position: 0 0;
178
+
179
+ @include govuk-media-query($from: tablet) {
180
+ width: 45px;
181
+ height: 35px;
182
+ background-size: 35px auto;
183
+ }
184
+ }
185
+ }
186
+
169
187
  .gem-c-action-link--dark-icon,
170
188
  .gem-c-action-link--small-icon {
171
189
  max-width: none;
@@ -8,6 +8,10 @@ $search-width-or-height: $black-bar-height;
8
8
  $pseudo-underline-height: 3px;
9
9
  $button-pipe-colour: darken(govuk-colour("mid-grey"), 20%);
10
10
 
11
+ $large-navbar-height: 86px;
12
+
13
+ $pale-blue-colour: #d2e2f1;
14
+
11
15
  $after-link-padding: govuk-spacing(4);
12
16
  $after-button-padding-right: govuk-spacing(4);
13
17
  $after-button-padding-left: govuk-spacing(4);
@@ -89,6 +93,11 @@ $after-button-padding-left: govuk-spacing(4);
89
93
  }
90
94
  }
91
95
 
96
+ .gem-c-layout-super-navigation-header--blue-background {
97
+ background: $govuk-brand-colour;
98
+ border-top: 1px solid $govuk-brand-colour;
99
+ }
100
+
92
101
  .gem-c-layout-super-navigation-header__container {
93
102
  position: relative;
94
103
  }
@@ -128,7 +137,6 @@ $after-button-padding-left: govuk-spacing(4);
128
137
 
129
138
  .gem-c-layout-super-navigation-header__navigation-item,
130
139
  .gem-c-layout-super-navigation-header__search-item {
131
- background: govuk-colour("black");
132
140
  display: block;
133
141
  float: left;
134
142
  margin: 0;
@@ -205,6 +213,17 @@ $after-button-padding-left: govuk-spacing(4);
205
213
  }
206
214
  }
207
215
 
216
+ &.gem-c-layout-super-navigation-header__navigation-item-link--blue-background,
217
+ &.gem-c-layout-super-navigation-header__search-item-link--blue-background {
218
+ &:hover {
219
+ color: govuk-colour("white");
220
+
221
+ &::after {
222
+ background: govuk-colour("white");
223
+ }
224
+ }
225
+ }
226
+
208
227
  @include focus-and-focus-visible {
209
228
  .gem-c-layout-super-navigation-header__navigation-item-link-inner {
210
229
  border-color: $govuk-focus-colour;
@@ -267,6 +286,17 @@ $after-button-padding-left: govuk-spacing(4);
267
286
  }
268
287
  }
269
288
 
289
+ // to stop the black underline appearing underneath the menu
290
+ // after it has been toggled closed if the blue background has
291
+ // been enabled
292
+ .gem-c-layout-super-navigation-header__navigation-top-toggle-button.gem-c-layout-super-navigation-header__navigation-top-toggle-button--blue-background {
293
+ &:focus:not(:focus-visible) {
294
+ &::after {
295
+ background: none;
296
+ }
297
+ }
298
+ }
299
+
270
300
  .gem-c-layout-super-navigation-header__navigation-item-link {
271
301
  @include govuk-media-query($from: "desktop") {
272
302
  padding: govuk-spacing(3) 0;
@@ -279,11 +309,15 @@ $after-button-padding-left: govuk-spacing(4);
279
309
  }
280
310
 
281
311
  .gem-c-layout-super-navigation-header__navigation-item-link-inner {
282
- background-color: govuk-colour("black");
283
312
  border-left: 1px solid $button-pipe-colour;
284
313
  padding: govuk-spacing(1) $after-link-padding;
285
314
  }
286
315
 
316
+ .gem-c-layout-super-navigation-header__navigation-item-link-inner--blue-background {
317
+ border-left: 0;
318
+ border-right: 1px solid $pale-blue-colour;
319
+ }
320
+
287
321
  // Search link and dropdown.
288
322
  .gem-c-layout-super-navigation-header__search-item-link {
289
323
  padding: govuk-spacing(3);
@@ -297,8 +331,6 @@ $after-button-padding-left: govuk-spacing(4);
297
331
  background: $govuk-brand-colour;
298
332
 
299
333
  &:hover {
300
- background: govuk-colour("black");
301
-
302
334
  &::before {
303
335
  left: 0;
304
336
  right: 0;
@@ -321,10 +353,6 @@ $after-button-padding-left: govuk-spacing(4);
321
353
 
322
354
  @include focus-not-focus-visible {
323
355
  background: $govuk-link-colour;
324
-
325
- &:hover {
326
- background: govuk-colour("black");
327
- }
328
356
  }
329
357
 
330
358
  @include focus-and-focus-visible {
@@ -347,6 +375,10 @@ $after-button-padding-left: govuk-spacing(4);
347
375
  width: 21px;
348
376
  }
349
377
 
378
+ .gem-c-layout-super-navigation-header__open-button .gem-c-layout-super-navigation-header__search-toggle-button-link-icon {
379
+ display: none;
380
+ }
381
+
350
382
  // Search and popular content dropdown.
351
383
  .gem-c-layout-super-navigation-header__search-and-popular {
352
384
  display: none;
@@ -472,15 +504,23 @@ $after-button-padding-left: govuk-spacing(4);
472
504
  .gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner {
473
505
  border-color: $button-pipe-colour;
474
506
 
507
+ &.gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner--blue-background {
508
+ border-color: $pale-blue-colour;
509
+ }
510
+
475
511
  @include govuk-media-query($from: 360px) {
476
512
  &::before {
477
513
  @include chevron(govuk-colour("white"), true);
478
514
  }
479
515
  }
480
516
  }
517
+
481
518
  // stylelint-enable max-nesting-depth
482
519
  }
520
+ }
483
521
 
522
+ .gem-c-layout-super-navigation-header__navigation-top-toggle-button.gem-c-layout-super-navigation-header__navigation-top-toggle-button--blue-background,
523
+ .gem-c-layout-super-navigation-header__navigation-top-toggle-button {
484
524
  // Open button modifier
485
525
  &.gem-c-layout-super-navigation-header__open-button {
486
526
  // stylelint-disable max-nesting-depth
@@ -528,6 +568,24 @@ $after-button-padding-left: govuk-spacing(4);
528
568
  }
529
569
  }
530
570
 
571
+ .gem-c-layout-super-navigation-header__navigation-top-toggle-button--blue-background {
572
+ @include focus-not-focus-visible {
573
+ &:hover {
574
+ &::after {
575
+ background: govuk-colour("white");
576
+ }
577
+
578
+ .gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner {
579
+ color: govuk-colour("white");
580
+
581
+ &::before {
582
+ border-color: govuk-colour("white");
583
+ }
584
+ }
585
+ }
586
+ }
587
+ }
588
+
531
589
  .gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner {
532
590
  display: inline-block;
533
591
  border-left: 1px solid govuk-colour("white");
@@ -542,6 +600,10 @@ $after-button-padding-left: govuk-spacing(4);
542
600
  }
543
601
  }
544
602
 
603
+ .gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner--no-left-border {
604
+ border-left: 0;
605
+ }
606
+
545
607
  // Styles for search toggle button.
546
608
  .gem-c-layout-super-navigation-header__search-toggle-button {
547
609
  @include govuk-font($size: 19, $weight: "bold", $line-height: 20px);
@@ -580,11 +642,32 @@ $after-button-padding-left: govuk-spacing(4);
580
642
  }
581
643
 
582
644
  &:hover {
583
- background: govuk-colour("black");
584
645
  border-bottom: $pseudo-underline-height solid govuk-colour("mid-grey");
585
646
  color: govuk-colour("mid-grey");
586
647
  }
587
648
 
649
+ &.gem-c-layout-super-navigation-header__search-toggle-button--blue-background {
650
+ &:hover {
651
+ border-bottom: $pseudo-underline-height solid govuk-colour("white");
652
+ color: govuk-colour("white");
653
+ }
654
+
655
+ // stylelint-disable max-nesting-depth
656
+ @include focus-not-focus-visible {
657
+ border-bottom: none;
658
+ }
659
+ // stylelint-enable max-nesting-depth
660
+ }
661
+
662
+ &:focus-visible {
663
+ &.gem-c-layout-super-navigation-header__search-toggle-button--blue-background {
664
+ &:hover {
665
+ border-bottom: $pseudo-underline-height solid $govuk-focus-colour;
666
+ color: govuk-colour("black");
667
+ }
668
+ }
669
+ }
670
+
588
671
  @include focus-and-focus-visible {
589
672
  @include govuk-focused-text;
590
673
  border-bottom-color: $govuk-focus-colour;
@@ -594,6 +677,13 @@ $after-button-padding-left: govuk-spacing(4);
594
677
 
595
678
  // Open button modifier
596
679
  &.gem-c-layout-super-navigation-header__open-button {
680
+ &.gem-c-layout-super-navigation-header__search-toggle-button--blue-background {
681
+ &:hover {
682
+ border-bottom: $pseudo-underline-height solid govuk-colour("white");
683
+ color: govuk-colour("white");
684
+ }
685
+ }
686
+
597
687
  @include focus-and-focus-visible {
598
688
  @include govuk-focused-text;
599
689
  border-color: $govuk-focus-colour;
@@ -625,9 +715,7 @@ $after-button-padding-left: govuk-spacing(4);
625
715
  font-weight: normal;
626
716
  left: 0;
627
717
  line-height: 22px;
628
- padding: govuk-spacing(3) 0;
629
718
  pointer-events: none;
630
- position: absolute;
631
719
  right: 0;
632
720
  text-align: center;
633
721
  top: 0;
@@ -788,3 +876,51 @@ $after-button-padding-left: govuk-spacing(4);
788
876
  display: none;
789
877
  }
790
878
  }
879
+
880
+ @include govuk-media-query($from: desktop) {
881
+ // can't use govuk-spacing here because the navbar height
882
+ // isn't a multiple of 5 :(
883
+ .gem-c-layout-super-navigation-header__navigation-item-link--large-navbar,
884
+ .gem-c-layout-super-navigation-header__search-item-link--large-navbar {
885
+ padding-top: 33px;
886
+ padding-bottom: 33px;
887
+ }
888
+
889
+ .gem-c-layout-super-navigation-header__logotype-crown--large-navbar {
890
+ height: 36px;
891
+ width: 49px;
892
+ }
893
+
894
+ .gem-c-header__link--large-navbar:focus {
895
+ box-shadow: 0 -4px 0 18px $govuk-focus-colour;
896
+ border-bottom: $govuk-focus-width solid govuk-colour("black");
897
+ padding-bottom: 10px;
898
+ }
899
+
900
+ .gem-c-header__link--large-navbar:hover {
901
+ padding-bottom: 10px;
902
+ }
903
+
904
+ .gem-c-layout-super-navigation-header__header-logo--large-navbar {
905
+ height: 35px;
906
+ padding-bottom: govuk-spacing(5);
907
+ padding-top: govuk-spacing(5);
908
+ }
909
+
910
+ .gem-c-layout-super-navigation-header__search-toggle-button--large-navbar {
911
+ height: $large-navbar-height;
912
+ }
913
+
914
+ // to stop the search icon moving on hover
915
+ .gem-c-layout-super-navigation-header__search-toggle-button--large-navbar:hover {
916
+ padding-bottom: 12px;
917
+ }
918
+
919
+ .gem-c-layout-super-navigation-header__button-container--large-navbar {
920
+ top: -$large-navbar-height;
921
+ }
922
+
923
+ .gem-c-layout-super-navigation-header__navigation-top-toggle-button--large-navbar {
924
+ height: $large-navbar-height;
925
+ }
926
+ }
@@ -55,7 +55,7 @@ $large-input-size: 50px;
55
55
  }
56
56
  }
57
57
 
58
- %gem-c-search-input-focus {
58
+ @mixin gem-c-search-input-focus {
59
59
  outline: $govuk-focus-width solid $govuk-focus-colour;
60
60
  // Ensure outline appears outside of the element
61
61
  outline-offset: 0;
@@ -89,7 +89,7 @@ $large-input-size: 50px;
89
89
  }
90
90
 
91
91
  &:focus {
92
- @extend %gem-c-search-input-focus;
92
+ @include gem-c-search-input-focus;
93
93
  }
94
94
  }
95
95
 
@@ -168,10 +168,9 @@ $large-input-size: 50px;
168
168
  // Ensure outline appears outside of the element
169
169
  outline-offset: 0;
170
170
 
171
- // no need for black outline as there is enough contrast
172
- // with the blue background
173
171
  &:focus {
174
- box-shadow: none;
172
+ @include gem-c-search-input-focus;
173
+ box-shadow: inset 0 0 0 4px;
175
174
  }
176
175
  }
177
176
 
@@ -191,6 +190,17 @@ $large-input-size: 50px;
191
190
  }
192
191
  }
193
192
 
193
+ .gem-c-search--homepage {
194
+ .gem-c-search__submit {
195
+ background-color: #d2e2f1;
196
+ color: govuk-colour("blue");
197
+
198
+ &:hover {
199
+ background-color: lighten(#d2e2f1, 5%);
200
+ }
201
+ }
202
+ }
203
+
194
204
  .gem-c-search--on-white {
195
205
  .gem-c-search__submit {
196
206
  background-color: govuk-colour("blue");
@@ -211,6 +221,10 @@ $large-input-size: 50px;
211
221
  }
212
222
  }
213
223
 
224
+ .gem-c-search__label--white {
225
+ color: govuk-colour("white");
226
+ }
227
+
214
228
  .gem-c-search--no-border {
215
229
  .gem-c-search__label {
216
230
  color: govuk-colour("white");
@@ -218,6 +232,11 @@ $large-input-size: 50px;
218
232
 
219
233
  .gem-c-search__input[type="search"] {
220
234
  border: 0;
235
+
236
+ &:focus {
237
+ @include gem-c-search-input-focus;
238
+ box-shadow: inset 0 0 0 4px;
239
+ }
221
240
  }
222
241
 
223
242
  .js-enabled & {
@@ -37,6 +37,11 @@ $share-button-height: 30px;
37
37
  line-height: $share-button-height;
38
38
  }
39
39
 
40
+ .gem-c-share-links__svg {
41
+ width: 100%;
42
+ height: 100%;
43
+ }
44
+
40
45
  .direction-rtl {
41
46
  .gem-c-share-links__link {
42
47
  display: inline-block;
@@ -72,10 +72,10 @@ module GovukPublishingComponents
72
72
  end
73
73
 
74
74
  @data = {
75
- name: name,
76
- dir: dir,
77
- application_found: application_found,
78
- components_found: components_found,
75
+ name:,
76
+ dir:,
77
+ application_found:,
78
+ components_found:,
79
79
  gem_style_references: @gem_style_references.flatten.uniq.sort,
80
80
  jquery_references: @jquery_references.flatten.uniq.sort,
81
81
  component_locations: @component_locations,
@@ -95,8 +95,8 @@ module GovukPublishingComponents
95
95
  dir: result[:dir],
96
96
  application_found: result[:application_found],
97
97
  uses_static: application_uses_static,
98
- summary: summary,
99
- warnings: warnings,
98
+ summary:,
99
+ warnings:,
100
100
  warning_count: warnings.length,
101
101
  gem_style_references: result[:gem_style_references],
102
102
  jquery_references: result[:jquery_references],
@@ -126,8 +126,8 @@ module GovukPublishingComponents
126
126
 
127
127
  def create_warning(component, message)
128
128
  {
129
- component: component,
130
- message: message,
129
+ component:,
130
+ message:,
131
131
  }
132
132
  end
133
133
 
@@ -280,7 +280,7 @@ module GovukPublishingComponents
280
280
  results << {
281
281
  name: component_name,
282
282
  count: locations.length,
283
- locations: locations,
283
+ locations:,
284
284
  }
285
285
  end
286
286
 
@@ -17,6 +17,7 @@
17
17
  simple_light ||= false
18
18
  dark_icon ||= false
19
19
  dark_large_icon ||= false
20
+ light_icon ||= false
20
21
  small_icon ||= false
21
22
  nhs_icon ||= false
22
23
  brexit_icon ||= false
@@ -31,6 +32,7 @@
31
32
  css_classes << "gem-c-action-link--dark-large-icon" if dark_large_icon
32
33
  css_classes << "gem-c-action-link--small-icon" if small_icon
33
34
  css_classes << "gem-c-action-link--transparent-icon" if transparent_icon
35
+ css_classes << "gem-c-action-link--light-icon" if light_icon
34
36
  css_classes << "gem-c-action-link--nhs" if nhs_icon
35
37
  css_classes << "gem-c-action-link--brexit" if brexit_icon
36
38
  css_classes << "gem-c-action-link--blue-arrow" if blue_arrow
@@ -15,7 +15,6 @@
15
15
  ga4_tracking ||= false
16
16
  ga4_data = {
17
17
  event_name: "navigation",
18
- type: "contents list",
19
18
  section: t("components.contents_list.contents", locale: :en) || "",
20
19
  index_total: cl_helper.get_index_total
21
20
  } if ga4_tracking
@@ -46,6 +45,7 @@
46
45
  ga4_data[:index] = {
47
46
  "index_link": index_link,
48
47
  }
48
+ ga4_data[:type] = cl_helper.get_ga4_type(contents_item[:href]) if contents_item[:href]
49
49
  end
50
50
  %>
51
51
  <%= link_to_if !contents_item[:active], link_text, contents_item[:href],
@@ -70,6 +70,7 @@
70
70
  ga4_data[:index] = {
71
71
  "index_link": index_link,
72
72
  }
73
+ ga4_data[:type] = cl_helper.get_ga4_type(nested_contents_item[:href]) if nested_contents_item[:href]
73
74
  end
74
75
  %>
75
76
  <%= link_to_if !nested_contents_item[:active], nested_contents_item[:text], nested_contents_item[:href],
@@ -6,6 +6,7 @@
6
6
  blue_bar ||= local_assigns.include?(:blue_bar) ? local_assigns[:blue_bar] : !full_width
7
7
  global_bar ||= nil
8
8
  html_lang ||= "en"
9
+ homepage ||= false
9
10
  layout_helper = GovukPublishingComponents::Presenters::PublicLayoutHelper.new(local_assigns)
10
11
  blue_bar_background_colour = layout_helper.blue_bar_background_colours.include?(blue_bar_background_colour) ? blue_bar_background_colour : nil
11
12
  logo_link ||= "/"
@@ -103,9 +104,15 @@
103
104
 
104
105
  <% unless omit_header %>
105
106
  <% if show_explore_header %>
106
- <%= render "govuk_publishing_components/components/layout_super_navigation_header", {
107
- logo_link: logo_link,
108
- } %>
107
+ <% if homepage %>
108
+ <%= render "govuk_publishing_components/components/layout_for_public/layout_super_navigation_header_homepage", {
109
+ logo_link: logo_link,
110
+ } %>
111
+ <% else %>
112
+ <%= render "govuk_publishing_components/components/layout_super_navigation_header", {
113
+ logo_link: logo_link,
114
+ } %>
115
+ <% end %>
109
116
  <% else %>
110
117
  <%= render "govuk_publishing_components/components/layout_header", {
111
118
  search: show_search,
@@ -122,7 +129,7 @@
122
129
 
123
130
  <%= raw(emergency_banner) %>
124
131
 
125
- <% if (blue_bar && !global_bar.present?) || (blue_bar_dedupe) %>
132
+ <% if (blue_bar && !global_bar.present? && !homepage) || (blue_bar_dedupe) %>
126
133
  <%= content_tag(:div, class: blue_bar_wrapper_classes) do %>
127
134
  <div class="gem-c-layout-for-public__blue-bar govuk-width-container"></div>
128
135
  <% end %>
@@ -5,6 +5,12 @@
5
5
  logo_link ||= "https://www.gov.uk/"
6
6
  logo_link_title ||= t("components.layout_super_navigation_header.logo_link_title")
7
7
  logo_text = t("components.layout_super_navigation_header.logo_text")
8
+
9
+ hide_logo_text ||= false
10
+ hide_button_left_border ||= false
11
+ blue_background ||= false
12
+ large_navbar ||= false
13
+
8
14
  navigation_links_columns = t("components.layout_super_navigation_header.navigation_links_columns")
9
15
  navigation_menu_heading = t("components.layout_super_navigation_header.navigation_menu_heading")
10
16
  navigation_search_heading = t("components.layout_super_navigation_header.navigation_search_heading")
@@ -17,63 +23,124 @@
17
23
  show_search_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.show", :label => "search")
18
24
  hide_navigation_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.hide", :label => "navigation")
19
25
  show_navigation_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.show", :label => "navigation")
26
+
27
+ top_toggle_button_classes = %w(gem-c-layout-super-navigation-header__navigation-top-toggle-button
28
+ )
29
+ top_toggle_button_classes << "gem-c-layout-super-navigation-header__navigation-top-toggle-button--blue-background" if blue_background
30
+ top_toggle_button_classes << "gem-c-layout-super-navigation-header__navigation-top-toggle-button--large-navbar" if large_navbar
31
+
32
+ top_toggle_button_inner_classes = %w(gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner)
33
+ top_toggle_button_inner_classes << "gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner--no-left-border" if hide_button_left_border
34
+ top_toggle_button_inner_classes << "gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner--blue-background" if blue_background
35
+
36
+ search_toggle_button_classes = %w(gem-c-layout-super-navigation-header__search-toggle-button)
37
+ search_toggle_button_classes << "gem-c-layout-super-navigation-header__search-toggle-button--blue-background" if blue_background
38
+ search_toggle_button_classes << "gem-c-layout-super-navigation-header__search-toggle-button--large-navbar" if large_navbar
39
+
40
+ layout_super_navigation_header_classes = %w(gem-c-layout-super-navigation-header)
41
+ layout_super_navigation_header_classes << "gem-c-layout-super-navigation-header--blue-background" if blue_background
42
+
43
+ item_link_classes = %w(gem-c-layout-super-navigation-header__navigation-item-link)
44
+ item_link_classes << "gem-c-layout-super-navigation-header__navigation-item-link--blue-background" if blue_background
45
+ item_link_classes << "gem-c-layout-super-navigation-header__navigation-item-link--large-navbar" if large_navbar
46
+
47
+ item_link_inner_classes = %w(
48
+ gem-c-layout-super-navigation-header__navigation-item-link-inner
49
+ )
50
+ item_link_inner_classes << "gem-c-layout-super-navigation-header__navigation-item-link-inner--blue-background" if blue_background
51
+
52
+ search_item_link_classes = %w(gem-c-layout-super-navigation-header__search-item-link)
53
+ search_item_link_classes << "gem-c-layout-super-navigation-header__search-item-link--blue-background" if blue_background
54
+ search_item_link_classes << "gem-c-layout-super-navigation-header__search-item-link--large-navbar" if large_navbar
55
+
56
+ header_logo_classes = %w(gem-c-layout-super-navigation-header__header-logo)
57
+ header_logo_classes << "gem-c-layout-super-navigation-header__header-logo--large-navbar" if large_navbar
58
+
59
+ logotype_classes = %w(govuk-header__logotype-crown gem-c-layout-super-navigation-header__logotype-crown)
60
+ logotype_classes << "gem-c-layout-super-navigation-header__logotype-crown--large-navbar" if large_navbar
61
+
62
+ header_link_classes = %w(govuk-header__link govuk-header__link--homepage)
63
+ header_link_classes << "gem-c-header__link--large-navbar" if large_navbar
64
+
65
+ button_container_classes = %w(gem-c-layout-super-navigation-header__button-container)
66
+ button_container_classes << "gem-c-layout-super-navigation-header__button-container--large-navbar" if large_navbar
67
+
68
+
20
69
  %>
21
- <header role="banner" class="gem-c-layout-super-navigation-header" data-module="gem-track-click ga4-event-tracker ga4-link-tracker" data-track-links-only data-ga4-expandable>
70
+ <%= content_tag("header",
71
+ {
72
+ role: "banner",
73
+ class: layout_super_navigation_header_classes,
74
+ data: {
75
+ module: "gem-track-click ga4-event-tracker ga4-link-tracker",
76
+ "track-links-only": '',
77
+ "ga4-expandable": '',
78
+ }
79
+ }) do %>
22
80
  <div class="gem-c-layout-super-navigation-header__container govuk-clearfix">
23
81
  <div class="govuk-width-container">
24
- <div class="gem-c-layout-super-navigation-header__header-logo">
25
- <a
26
- class="govuk-header__link govuk-header__link--homepage"
27
- data-track-action="logoLink"
28
- data-track-category="headerClicked"
29
- data-track-label="<%= logo_link %>"
30
- data-track-dimension="<%= logo_text %>"
31
- data-track-dimension-index="29"
32
- href="<%= logo_link %>"
33
- id="logo"
34
- title="<%= logo_link_title %>"
35
- data-ga4-link="<%= {
36
- "event_name": "navigation",
37
- "type": "header menu bar",
38
- "external": "false",
39
- "text": "GOV.UK",
40
- "section": "Logo",
41
- "index": {
42
- "index_link": 1,
43
- "index_section": 0,
44
- "index_section_count": 2,
45
- },
46
- "index_total": 1
47
- }.to_json %>"
48
- >
82
+ <%= content_tag(:div, {
83
+ class: header_logo_classes
84
+ }) do %>
85
+ <%= link_to logo_link, {
86
+ class: header_link_classes,
87
+ data: {
88
+ "track-action": "logoLink",
89
+ "track-category": "headerClicked",
90
+ "track-label": logo_link,
91
+ "track-dimension": logo_text,
92
+ "track-dimension-index": "29",
93
+ "ga4-link": {
94
+ "event_name": "navigation",
95
+ "type": "header menu bar",
96
+ "external": "false",
97
+ "text": "GOV.UK",
98
+ "section": "Logo",
99
+ "index": {
100
+ "index_link": 1,
101
+ "index_section": 0,
102
+ "index_section_count": 2,
103
+ },
104
+ "index_total": 1
105
+ }.to_json
106
+ },
107
+ id: "logo",
108
+ aria: {
109
+ label: logo_link_title,
110
+ }
111
+ } do %>
49
112
  <span class="govuk-header__logotype">
50
113
  <!--[if gt IE 8]><!-->
51
- <svg
52
- aria-hidden="true"
53
- class="govuk-header__logotype-crown gem-c-layout-super-navigation-header__logotype-crown"
54
- focusable="false"
55
- height="30"
56
- viewBox="0 0 132 97"
57
- width="36"
58
- xmlns="http://www.w3.org/2000/svg"
59
- >
114
+ <%= content_tag(:svg, {
115
+ aria: {
116
+ hidden: true,
117
+ },
118
+ class: logotype_classes,
119
+ height: "30",
120
+ width: "36",
121
+ focusable: "false",
122
+ viewBox: "0 0 132 97",
123
+ xmlns: "http://www.w3.org/2000/svg",
124
+ }) do %>
60
125
  <path
61
126
  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"
62
127
  fill="currentColor"
63
128
  fill-rule="evenodd"
64
129
  >
65
130
  </path>
66
- </svg>
131
+ <% end %>
67
132
  <!--<![endif]-->
68
133
  <!--[if IE 8]>
69
134
  <img src="<%= asset_path('govuk-logotype-crown.png') %>" alt="" class="govuk-header__logotype-crown-fallback-image" width="36" height="32">
70
135
  <![endif]-->
71
- <span class="govuk-header__logotype-text">
72
- <%= logo_text %>
73
- </span>
136
+ <% unless hide_logo_text %>
137
+ <span class="govuk-header__logotype-text">
138
+ <%= logo_text %>
139
+ </span>
140
+ <% end %>
74
141
  </span>
75
- </a>
76
- </div>
142
+ <% end %>
143
+ <% end %>
77
144
  </div>
78
145
  <nav
79
146
  aria-labelledby="super-navigation-menu-heading"
@@ -93,10 +160,12 @@
93
160
  %>
94
161
 
95
162
  <div class="govuk-width-container gem-c-layout-super-navigation-header__button-width-container">
96
- <div class="gem-c-layout-super-navigation-header__button-container">
163
+ <%= content_tag(:div, {
164
+ class: button_container_classes
165
+ }) do %>
97
166
  <div class="gem-c-layout-super-navigation-header__navigation-item">
98
167
  <%= link_to link[:href], {
99
- class: "gem-c-layout-super-navigation-header__navigation-item-link",
168
+ class: item_link_classes,
100
169
  data: {
101
170
  track_action: "#{tracking_label}Link",
102
171
  track_category: "headerClicked",
@@ -105,9 +174,11 @@
105
174
  track_dimension_index: "29",
106
175
  }
107
176
  } do %>
108
- <span class="gem-c-layout-super-navigation-header__navigation-item-link-inner">
177
+ <% content_tag(:span, {
178
+ class: item_link_inner_classes
179
+ }) do %>
109
180
  <%= link[:label] %>
110
- </span>
181
+ <% end %>
111
182
  <% end %>
112
183
 
113
184
  <%= content_tag(:button, {
@@ -116,7 +187,7 @@
116
187
  expanded: false,
117
188
  label: show_menu_text,
118
189
  },
119
- class: "gem-c-layout-super-navigation-header__navigation-top-toggle-button",
190
+ class: top_toggle_button_classes,
120
191
  data: {
121
192
  text_for_hide: hide_menu_text,
122
193
  text_for_show: show_menu_text,
@@ -138,35 +209,40 @@
138
209
  id: "super-navigation-menu-#{unique_id}-toggle",
139
210
  type: "button",
140
211
  }) do %>
141
- <%= tag.span link[:label], class: "gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner" %>
212
+ <%= tag.span link[:label], class: top_toggle_button_inner_classes %>
142
213
  <% end %>
143
214
  </div>
144
215
 
145
216
  <div class="gem-c-layout-super-navigation-header__search-item">
146
- <button
147
- aria-controls="super-search-menu"
148
- aria-expanded="true"
149
- aria-label="<%= hide_search_menu_text %>"
150
- class="gem-c-layout-super-navigation-header__search-toggle-button"
151
- data-text-for-hide="<%= hide_search_menu_text %>"
152
- data-text-for-show="<%= show_search_menu_text %>"
153
- data-toggle-mobile-group="top"
154
- data-toggle-desktop-group="top"
155
- data-tracking-key="search"
156
- hidden
157
- id="super-search-menu-toggle"
158
- type="button"
159
- data-ga4-event="<%= {
160
- "event_name": "select_content",
161
- "type": "header menu bar",
162
- "text": "Search",
163
- "index": {
164
- "index_section": 2,
165
- "index_section_count": 2,
166
- },
167
- "section": "Search"
168
- }.to_json %>"
169
- >
217
+ <%= content_tag(:button, {
218
+ id: "super-search-menu-toggle",
219
+ class: search_toggle_button_classes,
220
+ aria: {
221
+ controls: "super-search-menu",
222
+ expanded: "true",
223
+ label: hide_search_menu_text,
224
+ },
225
+ data: {
226
+ "text-for-hide": hide_search_menu_text,
227
+ "text-for-show": show_search_menu_text,
228
+ "toggle-mobile-group": "top",
229
+ "toggle-desktop-group": "top",
230
+ "tracking-key": "search",
231
+ "ga4-event": "#{{
232
+ "event_name": "select_content",
233
+ "type": "header menu bar",
234
+ "text": "Search",
235
+ "index": {
236
+ "index_section": 2,
237
+ "index_section_count": 2,
238
+ },
239
+ "section": "Search"
240
+ }.to_json
241
+ }"
242
+ },
243
+ hidden: true,
244
+ type: "button",
245
+ }) do %>
170
246
  <span class="govuk-visually-hidden">
171
247
  <%= search_text %>
172
248
  </span>
@@ -182,9 +258,11 @@
182
258
  >
183
259
  &times;
184
260
  </span>
185
- </button>
261
+ <% end %>
186
262
 
187
- <a class="gem-c-layout-super-navigation-header__search-item-link" href="/search">
263
+ <%= link_to "/search", {
264
+ class: search_item_link_classes
265
+ } do %>
188
266
  <span class="govuk-visually-hidden">
189
267
  <%= search_text %>
190
268
  </span>
@@ -193,9 +271,9 @@
193
271
  classes: %w[gem-c-layout-super-navigation-header__search-item-link-icon],
194
272
  }
195
273
  %>
196
- </a>
274
+ <% end %>
197
275
  </div>
198
- </div>
276
+ <% end %>
199
277
  </div>
200
278
 
201
279
  <div
@@ -336,4 +414,4 @@
336
414
  </div>
337
415
  </nav>
338
416
  </div>
339
- </header>
417
+ <% end %>
@@ -22,7 +22,7 @@
22
22
  ga4_tracking ||= false
23
23
  ga4_object = {
24
24
  event_name: "navigation",
25
- type: "content",
25
+ type: "content history",
26
26
  section: "Top",
27
27
  action: "opened"
28
28
  }.to_json
@@ -12,6 +12,7 @@
12
12
  label_size ||= nil
13
13
  label_text ||= t("components.search_box.label")
14
14
  name ||= "q"
15
+ homepage ||= false
15
16
  no_border ||= false
16
17
  size ||= ""
17
18
  value ||= ""
@@ -24,6 +25,7 @@
24
25
  classes << shared_helper.get_margin_bottom if local_assigns[:margin_bottom]
25
26
  classes << "gem-c-search--large" if size == "large"
26
27
  classes << "gem-c-search--large-on-mobile" if size == "large-mobile"
28
+ classes << "gem-c-search--homepage" if homepage
27
29
  classes << "gem-c-search--no-border" if no_border
28
30
  if local_assigns[:on_govuk_blue].eql?(true)
29
31
  classes << "gem-c-search--on-govuk-blue"
@@ -35,6 +37,7 @@
35
37
  label_classes = []
36
38
  if (shared_helper.valid_heading_size?(label_size))
37
39
  label_classes << "govuk-label govuk-label--#{label_size}"
40
+ label_classes << "gem-c-search__label--white" if no_border || homepage
38
41
  else
39
42
  label_classes << "gem-c-search__label"
40
43
  end
@@ -86,39 +86,39 @@
86
86
  class: "govuk-link govuk-link--no-underline gem-c-share-links__link #{brand_helper.color_class}" do %>
87
87
  <span class="gem-c-share-links__link-icon">
88
88
  <% if link[:icon] == 'facebook' %>
89
- <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
89
+ <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
90
90
  <path fill="currentColor" d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/>
91
91
  </svg>
92
92
  <% elsif link[:icon] == 'twitter' %>
93
- <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
93
+ <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
94
94
  <path fill="currentColor" d="M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085 4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z"/>
95
95
  </svg>
96
96
  <% elsif link[:icon] == 'email' %>
97
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 73.84 73.84" aria-hidden="true" focusable="false">
97
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 73.84 73.84" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
98
98
  <path fill="currentColor" d="M36.92,0A36.92,36.92,0,1,0,73.84,36.92,36.92,36.92,0,0,0,36.92,0ZM58.37,21,36.92,39.45,15.47,21ZM11.65,23.66,26.27,36.23,11.65,49.9ZM15.1,52.83,29.7,39.18l7.22,6.21,7.22-6.21,14.6,13.65ZM62.19,49.9,47.57,36.23,62.19,23.66Z"/>
99
99
  </svg>
100
100
  <% elsif link[:icon] == 'flickr' %>
101
- <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
101
+ <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
102
102
  <path fill="currentColor" d="M5.334 6.666C2.3884 6.666 0 9.055 0 12c0 2.9456 2.3884 5.334 5.334 5.334 2.9456 0 5.332-2.3884 5.332-5.334 0-2.945-2.3864-5.334-5.332-5.334zm13.332 0c-2.9456 0-5.332 2.389-5.332 5.334 0 2.9456 2.3864 5.334 5.332 5.334C21.6116 17.334 24 14.9456 24 12c0-2.945-2.3884-5.334-5.334-5.334Z"/>
103
103
  </svg>
104
104
  <% elsif link[:icon] == 'instagram' %>
105
- <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
105
+ <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
106
106
  <path fill="currentColor" d="M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06l.045.03zm0 3.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z"/>
107
107
  </svg>
108
108
  <% elsif link[:icon] == 'linkedin' %>
109
- <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
109
+ <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
110
110
  <path fill="currentColor" d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/>
111
111
  </svg>
112
112
  <% elsif link[:icon] == 'youtube' %>
113
- <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
113
+ <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
114
114
  <path fill="currentColor" d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/>
115
115
  </svg>
116
116
  <% elsif link[:icon] == 'whatsapp' %>
117
- <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
117
+ <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
118
118
  <path fill="currentColor" d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"/>
119
119
  </svg>
120
120
  <% else %>
121
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 73.84 73.84" aria-hidden="true" focusable="false">
121
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 73.84 73.84" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
122
122
  <path fill="currentColor" d="M36.92,0A36.92,36.92,0,1,0,73.84,36.92,36.92,36.92,0,0,0,36.92,0ZM56.3,48.27a1.42,1.42,0,0,1-1.42,1.42h-19v9.18l-9.18-9.18H19a1.43,1.43,0,0,1-1.43-1.43V20.52A1.43,1.43,0,0,1,19,19.09H54.88a1.43,1.43,0,0,1,1.42,1.42Z"/>
123
123
  </svg>
124
124
  <% end %>
@@ -120,6 +120,11 @@ examples:
120
120
  text: Coronavirus (COVID-19)
121
121
  href: "/my-test-page"
122
122
  dark_large_icon: true
123
+ with_light_icon:
124
+ data:
125
+ text: Coronavirus (COVID-19)
126
+ href: "/my-test-page"
127
+ light_icon: true
123
128
  with_brexit_icon_and_custom_font_size:
124
129
  data:
125
130
  text: Guidance for businesses
@@ -197,18 +197,17 @@ examples:
197
197
  data:
198
198
  ga4_tracking: true
199
199
  contents:
200
- - href: "#first-thing"
200
+ - href: "https://www.gov.uk"
201
201
  text: 1. First thing
202
202
  items:
203
203
  - href: "#second-thing"
204
204
  text: 1. Nested Item
205
- - href: "#third-thing"
206
- text: 2. Nested Item
205
+ - text: 2. Nested Item
207
206
  active: true
208
207
  - href: "#first-thing"
209
208
  text: 2. Second thing
210
209
  items:
211
210
  - href: "#second-thing"
212
211
  text: 1. Nested Item
213
- - href: "#third-thing"
212
+ - href: "https://www.gov.uk/browse"
214
213
  text: 2. Nested Item
@@ -37,6 +37,11 @@ examples:
37
37
  description: This allows the feedback form to be omitted
38
38
  data:
39
39
  omit_feedback_form: true
40
+ homepage:
41
+ description: This allows for rendering the layout super navigation header in a different way for only the homepage.
42
+ data:
43
+ homepage: true
44
+ show_explore_header: true
40
45
  omit_footer_navigation:
41
46
  description: This allows the footer navigation to be omitted
42
47
  data:
@@ -34,3 +34,32 @@ examples:
34
34
  data:
35
35
  logo_link: "https://www.example.com"
36
36
  logo_link_title: "Go to example"
37
+ homepage:
38
+ description: |
39
+ This variant is used for the homepage. It toggles the following attributes: hide_button_left_border, hide_logo_text and blue_background
40
+ data:
41
+ hide_logo_text: true
42
+ hide_button_left_border: true
43
+ blue_background: true
44
+ large_navbar: true
45
+ hide_logo_text:
46
+ description: |
47
+ Logo text is shown by default. This option allows us to hide the text for the homepage.
48
+ data:
49
+ hide_logo_text: true
50
+ remove_left_button_border:
51
+ description: |
52
+ The left border for the toggle button is shown by default. This option allows us to hide the text for the homepage.
53
+ data:
54
+ hide_button_left_border: true
55
+ blue_blackground_colour:
56
+ description: |
57
+ The black background is shown by default. This option allows us to change the background colour for the homepage.
58
+ data:
59
+ blue_background: true
60
+ large_navbar:
61
+ description: |
62
+ Make the links and buttons large on desktop only. Used for the homepage.
63
+ data:
64
+ large_navbar: true
65
+ hide_logo_text: true
@@ -35,6 +35,17 @@ examples:
35
35
  on_govuk_blue: true
36
36
  context:
37
37
  dark_background: true
38
+ homepage:
39
+ description: For use on the homepage.
40
+ data:
41
+ label_text: "Search"
42
+ inline_label: false
43
+ on_govuk_blue: true
44
+ label_size: "s"
45
+ homepage: true
46
+ size: "large"
47
+ context:
48
+ dark_background: true
38
49
  change_label_text:
39
50
  data:
40
51
  label_text: "Search"
@@ -0,0 +1,11 @@
1
+ <% logo_link ||= "/" %>
2
+
3
+ <%= render "govuk_publishing_components/components/layout_super_navigation_header",
4
+ {
5
+ hide_logo_text: true,
6
+ logo_link: logo_link,
7
+ blue_background: true,
8
+ hide_button_left_border: true,
9
+ large_navbar: true,
10
+ }
11
+ %>
@@ -119,7 +119,7 @@ module GovukPublishingComponents
119
119
  def self.find(content_type, extension = nil)
120
120
  matching_types = TYPES.select { |type| type[:content_type] == content_type }
121
121
 
122
- return UnsupportedContentType.new(content_type: content_type) if matching_types.empty?
122
+ return UnsupportedContentType.new(content_type:) if matching_types.empty?
123
123
 
124
124
  extension_match = if matching_types.length > 1
125
125
  matching_types.find { |type| type[:extension] == extension }
@@ -98,7 +98,7 @@ module GovukPublishingComponents
98
98
  data[:behaviour] = "exclusive" if checkbox[:exclusive]
99
99
 
100
100
  capture do
101
- concat check_box_tag checkbox_name, checkbox[:value], checked, class: "govuk-checkboxes__input", id: checkbox_id, data: data
101
+ concat check_box_tag(checkbox_name, checkbox[:value], checked, class: "govuk-checkboxes__input", id: checkbox_id, data:)
102
102
  concat content_tag(:label, checkbox[:label], for: checkbox_id, class: "govuk-label govuk-checkboxes__label")
103
103
  concat content_tag(:span, checkbox[:hint], id: "#{checkbox_id}-item-hint", class: "govuk-hint govuk-checkboxes__hint") if checkbox[:hint]
104
104
  end
@@ -119,7 +119,7 @@ module GovukPublishingComponents
119
119
 
120
120
  def as_taxonomy_sidebar_link
121
121
  {
122
- title: title,
122
+ title:,
123
123
  link: base_path,
124
124
  }
125
125
  end
@@ -48,6 +48,12 @@ module GovukPublishingComponents
48
48
  total
49
49
  end
50
50
 
51
+ def get_ga4_type(link)
52
+ return "select content" if link.start_with?("#")
53
+
54
+ "contents list"
55
+ end
56
+
51
57
  private
52
58
 
53
59
  def parent_modifier
@@ -1,5 +1,3 @@
1
- require "set"
2
-
3
1
  module GovukPublishingComponents
4
2
  module Presenters
5
3
  # @private
@@ -43,9 +43,9 @@ module GovukPublishingComponents
43
43
  nation = I18n.t("components.devolved_nations.#{name}")
44
44
 
45
45
  if I18n.exists?("components.devolved_nations.type.#{@type}")
46
- I18n.t("components.devolved_nations.type.#{@type}", nation: nation)
46
+ I18n.t("components.devolved_nations.type.#{@type}", nation:)
47
47
  else
48
- I18n.t("components.devolved_nations.type.publication", nation: nation)
48
+ I18n.t("components.devolved_nations.type.publication", nation:)
49
49
  end
50
50
  end
51
51
  end
@@ -88,7 +88,7 @@ module GovukPublishingComponents
88
88
  title: current_step_nav.title,
89
89
  path: current_step_nav.base_path,
90
90
  tracking_id: current_step_nav.content_id,
91
- ga4_tracking: ga4_tracking,
91
+ ga4_tracking:,
92
92
  }
93
93
  else
94
94
  {}
@@ -77,7 +77,7 @@ module GovukPublishingComponents
77
77
  def generate_data_attribute(link, track_action)
78
78
  {
79
79
  track_category: "footerClicked",
80
- track_action: track_action,
80
+ track_action:,
81
81
  track_label: link[:href],
82
82
  track_options: {
83
83
  dimension29: link[:text],
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "35.16.1".freeze
2
+ VERSION = "35.18.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 35.16.1
4
+ version: 35.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-26 00:00:00.000000000 Z
11
+ date: 2023-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -349,6 +349,8 @@ files:
349
349
  - app/assets/images/govuk_publishing_components/action-link-arrow--brexit.svg
350
350
  - app/assets/images/govuk_publishing_components/action-link-arrow--dark.png
351
351
  - app/assets/images/govuk_publishing_components/action-link-arrow--dark.svg
352
+ - app/assets/images/govuk_publishing_components/action-link-arrow--light.png
353
+ - app/assets/images/govuk_publishing_components/action-link-arrow--light.svg
352
354
  - app/assets/images/govuk_publishing_components/action-link-arrow--simple-light.png
353
355
  - app/assets/images/govuk_publishing_components/action-link-arrow--simple-light.svg
354
356
  - app/assets/images/govuk_publishing_components/action-link-arrow--simple.png
@@ -836,6 +838,7 @@ files:
836
838
  - app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb
837
839
  - app/views/govuk_publishing_components/components/layout_for_public/_account-layout.html.erb
838
840
  - app/views/govuk_publishing_components/components/layout_for_public/_account-navigation.html.erb
841
+ - app/views/govuk_publishing_components/components/layout_for_public/_layout_super_navigation_header_homepage.html.erb
839
842
  - app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb
840
843
  - app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
841
844
  - app/views/govuk_publishing_components/components/layout_header/_search.html.erb
@@ -1466,14 +1469,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
1466
1469
  requirements:
1467
1470
  - - ">="
1468
1471
  - !ruby/object:Gem::Version
1469
- version: '3.0'
1472
+ version: '3.1'
1470
1473
  required_rubygems_version: !ruby/object:Gem::Requirement
1471
1474
  requirements:
1472
1475
  - - ">="
1473
1476
  - !ruby/object:Gem::Version
1474
1477
  version: '0'
1475
1478
  requirements: []
1476
- rubygems_version: 3.4.19
1479
+ rubygems_version: 3.4.20
1477
1480
  signing_key:
1478
1481
  specification_version: 4
1479
1482
  summary: A gem to document components in GOV.UK frontend applications