govuk_publishing_components 67.0.1 → 67.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99b5db78e9403ab8185c70ca380baef82323d8b796ff3004e02f0fbe720dc31f
4
- data.tar.gz: f7c44b0435078b223f65e05a4ea1923dcfb4bfe9e62f8fca42192771846f0ed6
3
+ metadata.gz: a12344674cf0cfd1049d50b15532e6d0f01031c754ac5d1331621917a2ccd695
4
+ data.tar.gz: 16356b2c3df1aefc42d7eeb114c0fb6180c102e680c5f271b8cb955caf51f8da
5
5
  SHA512:
6
- metadata.gz: b71db86bb78921c84cb12c66812fcc7c0165c209c555aab17fcf948f78842681ff60159b487093112c221dcbd1c64c94776b1b91924da235bf030fc2bedb42b1
7
- data.tar.gz: 19c4818c51a9cbfeeb67bfbcc9913aa0050b2114a0e2b013f278f32e9f6500b0e65d54fae811ee7ffc05b21be88db892711acc3a2bf8afe9fe4873968de373c1
6
+ metadata.gz: c84332e25080f8ca2998712a619160a5045a8bc15104f2c5f4373f9b1cd51fea0b092a2a5587f06e538a6d32d7f6f7e551363293feb806fa86f32c7713e31811
7
+ data.tar.gz: 5917c52f8b7ceb1ab7ba69a4fae8782624cac4e18027e661fe795dc7bd4662563a028a9dd1d82a0b940ccfb1e66c1124a952991e6cb5050d0386559cdf432ca9
@@ -4,7 +4,7 @@
4
4
  service_navigation_items ||= []
5
5
  %>
6
6
 
7
- <header class="gem-c-cross-service-header gem-c-rebranded-cross-service-header" data-module="cross-service-header">
7
+ <div class="gem-c-cross-service-header gem-c-rebranded-cross-service-header" data-module="cross-service-header">
8
8
  <%= render "govuk_publishing_components/components/cross_service_header/one_login_header", {
9
9
  one_login_navigation_items: one_login_navigation_items,
10
10
  } %>
@@ -12,4 +12,4 @@
12
12
  service_name: service_name,
13
13
  navigation_items: service_navigation_items,
14
14
  } %>
15
- </header>
15
+ </div>
@@ -81,27 +81,29 @@
81
81
  <% end %>
82
82
  <% end %>
83
83
  <% unless omit_header %>
84
- <% if show_cross_service_header %>
85
- <%= render "govuk_publishing_components/components/cross_service_header", {
86
- one_login_navigation_items: one_login_navigation_items,
87
- service_navigation_items: service_navigation_items,
88
- service_name: service_name,
89
- } %>
90
- <% else %>
91
- <% I18n.with_locale(:en) do %>
92
- <%= render "govuk_publishing_components/components/layout_super_navigation_header", {
93
- homepage:,
94
- logo_link:,
95
- phase_banner:,
84
+ <%= tag.header do %>
85
+ <% if show_cross_service_header %>
86
+ <%= render "govuk_publishing_components/components/cross_service_header", {
87
+ one_login_navigation_items: one_login_navigation_items,
88
+ service_navigation_items: service_navigation_items,
89
+ service_name: service_name,
96
90
  } %>
91
+ <% else %>
92
+ <% I18n.with_locale(:en) do %>
93
+ <%= render "govuk_publishing_components/components/layout_super_navigation_header", {
94
+ homepage:,
95
+ logo_link:,
96
+ phase_banner:,
97
+ } %>
98
+ <% end %>
97
99
  <% end %>
98
- <% end %>
99
- <% end %>
100
100
 
101
- <%= raw(emergency_banner) %>
101
+ <%= raw(emergency_banner) %>
102
102
 
103
- <% if global_banner.present? %>
104
- <%= raw(global_banner) %>
103
+ <% if global_banner.present? %>
104
+ <%= raw(global_banner) %>
105
+ <% end %>
106
+ <% end %>
105
107
  <% end %>
106
108
 
107
109
  <% if show_account_layout %>
@@ -38,7 +38,7 @@
38
38
  component_helper.add_class("gem-c-layout-super-navigation-header")
39
39
  component_helper.add_data_attribute({ module: "ga4-event-tracker ga4-link-tracker", ga4_expandable: "" })
40
40
  %>
41
- <%= tag.header(**component_helper.all_attributes) do %>
41
+ <%= tag.div(**component_helper.all_attributes) do %>
42
42
  <div class="gem-c-layout-super-navigation-header__nav-wrapper">
43
43
  <div class="gem-c-layout-super-navigation-header__container govuk-width-container">
44
44
  <nav
@@ -1,3 +1,3 @@
1
- <svg class="gem-c-attachment__thumbnail-image gem-c-attachment__thumbnail-image--external" version="1.1" viewBox="0 0 99 140" aria-hidden="true">
1
+ <svg class="gem-c-attachment__thumbnail-image gem-c-attachment__thumbnail-image--external" version="1.1" viewBox="0 0 99 140" width="99" height="140" aria-hidden="true">
2
2
  <path fill-rule="evenodd" clip-rule="evenodd" d="M21 59H12V68H21V59ZM30 86V77H69V86H30ZM87 104H30V95H87V104ZM78 122H30V113H78V122ZM21 86H12V77H21V86ZM21 122H12V113H21V122ZM21 104H12V95H21V104ZM87 68H30V59H87V68ZM87 39V12H12V39H87ZM77.9699 29.2919H77.9202L75.2756 17H71.2279L68.5088 29.2919H68.4591L66.1249 17H62.2014L66.1746 34.8047H70.5699L73.2145 22.0409L75.9088 34.8047H80.3289L84.3021 17H80.391L77.9699 29.2919ZM53.8195 29.2919H53.8692L56.2903 17H60.2014L56.2282 34.8047H51.8081L49.1138 22.0409L46.4692 34.8047H42.0739L38.1007 17H42.0242L44.3584 29.2919H44.4081L47.1272 17H51.1749L53.8195 29.2919ZM29.7684 29.2919H29.7188L27.0742 17H23.0265L20.3074 29.2919H20.2577L17.9235 17H14L17.9732 34.8047H22.3685L25.0131 22.0409L27.7074 34.8047H32.1275L36.1007 17H32.1896L29.7684 29.2919Z" />
3
3
  </svg>
@@ -1,3 +1,3 @@
1
- <svg class="gem-c-attachment__thumbnail-image gem-c-attachment__thumbnail-image--pdf" version="1.1" viewBox="0 0 99 140">
1
+ <svg class="gem-c-attachment__thumbnail-image gem-c-attachment__thumbnail-image--pdf" version="1.1" viewBox="0 0 99 140" width="99" height="140" aria-hidden="true">
2
2
  <path d="M12,59h9v9h-9v-9ZM30,77v9h39v-9H30ZM30,104h57v-9H30v9ZM30,122h48v-9H30v9ZM12,86h9v-9h-9v9ZM12,122h9v-9h-9v9ZM12,104h9v-9h-9v9ZM30,68h57v-9H30v9ZM35.2,21c-.3-.2-.6-.4-1-.5s-.8-.2-1.3-.2h-2.6v5.5h2.6c.5,0,1,0,1.3-.2s.7-.3,1-.5c.3-.2.5-.5.7-.8s.2-.7.2-1.1h0c0-.5,0-.9-.2-1.2-.2-.3-.4-.6-.7-.8h0ZM52.4,21.9c-.4-.5-1-.9-1.6-1.1-.7-.3-1.5-.4-2.4-.4h-2.7v11.5h2.7c.9,0,1.7-.1,2.4-.4s1.2-.7,1.6-1.1c.4-.5.7-1.1.9-1.7.2-.7.3-1.4.3-2.1v-.7c0-.8,0-1.5-.3-2.1-.2-.6-.5-1.2-.9-1.7h0ZM87,12v27H12V12h75ZM39.8,23c0-.9-.1-1.6-.4-2.4-.3-.7-.7-1.4-1.2-1.9-.5-.5-1.2-1-1.9-1.2-.8-.3-1.6-.5-2.5-.5h-7.2v17.9h3.6v-6h3.2c.9,0,1.8-.1,2.6-.5.8-.3,1.4-.7,2-1.2.5-.5,1-1.2,1.3-1.9.3-.7.5-1.5.5-2.4h0ZM57.4,26c0-1.3-.2-2.6-.5-3.7s-.9-2-1.6-2.8c-.7-.8-1.6-1.4-2.7-1.8-1.1-.4-2.3-.6-3.8-.6h-6.6v17.9h6.6c1.5,0,2.7-.2,3.8-.6,1.1-.4,2-1,2.7-1.8.7-.8,1.3-1.7,1.6-2.8.4-1.1.5-2.3.5-3.7h0ZM72.4,17.1h-12.1v17.9h3.6v-7.5h7.8v-3.3h-7.8v-3.8h8.4s0-3.3,0-3.3Z" />
3
3
  </svg>
@@ -25,7 +25,6 @@ accessibility_criteria:
25
25
  govuk_frontend_components:
26
26
  - service-navigation
27
27
  accessibility_excluded_rules:
28
- - landmark-banner-is-top-level
29
28
  - duplicate-id-aria
30
29
  - landmark-no-duplicate-banner
31
30
  - landmark-unique
@@ -12,6 +12,7 @@ accessibility_criteria: |
12
12
  * have a `lang` attribute
13
13
  * contain a [skip link](/component-guide/skip_link)
14
14
  * have a sensible page `<title>`
15
+ * contain a `<header>` element
15
16
  examples:
16
17
  default:
17
18
  data:
@@ -47,11 +48,11 @@ examples:
47
48
  href: "item-3"
48
49
  show_only_in_collapsed_menu: true
49
50
  with_global_banner:
50
- description: This allows the HTML for the global banner to be added to the page. This is only the slot for the global banner - the markup for the banner needs to be passed in.
51
+ description: This allows the HTML for the global banner to be added to the page within the header element. This is only the slot for the global banner - the markup for the banner needs to be passed in.
51
52
  data:
52
53
  global_banner: <div class="govuk-!-padding-top-5 govuk-!-padding-bottom-3">This is the global banner slot</div>
53
54
  with_emergency_banner:
54
- description: This allows the HTML for the emergency banner to be added to the page in the correct place. This is only the slot for the emergency banner - the markup for the banner needs to be passed in.
55
+ description: This allows the HTML for the emergency banner to be added to the page within the header element. This is only the slot for the emergency banner - the markup for the banner needs to be passed in.
55
56
  data:
56
57
  emergency_banner: <div class="govuk-!-padding-top-3 govuk-!-padding-bottom-3">This is the emergency banner slot</div>
57
58
  with_phase_banner:
@@ -61,13 +62,33 @@ examples:
61
62
  phase: "beta"
62
63
  message: "This is a custom test message for the public layout phase banner."
63
64
  with_all_banners:
64
- description: The phase banner, global banner and emergency banner should be usable together.
65
+ description: The phase banner, global banner and emergency banner should be usable together within the header element.
65
66
  data:
66
67
  phase_banner:
67
68
  phase: "beta"
68
69
  message: "This is the phase banner banner"
69
70
  emergency_banner: <div class="govuk-!-padding-top-3 govuk-!-padding-bottom-3">This is the emergency banner slot</div>
70
71
  global_banner: <div class="govuk-!-padding-top-5 govuk-!-padding-bottom-3">This is the global banner slot</div>
72
+ with_cross_service_header:
73
+ description: Passes the navigation through to the [cross service header](/component-guide/cross_service_header/).
74
+ data:
75
+ show_cross_service_header: true
76
+ service_name: "My Service Name"
77
+ one_login_navigation_items:
78
+ one_login_home:
79
+ href: "#"
80
+ one_login_sign_out:
81
+ href: "#"
82
+ navigation_items: []
83
+ service_navigation_items:
84
+ - text: Navigation item 1
85
+ href: "item-1"
86
+ active: true
87
+ - text: Navigation item 2
88
+ href: "item-2"
89
+ - text: Hidden on desktop
90
+ href: "item-3"
91
+ show_only_in_collapsed_menu: true
71
92
  with_account_layout_enabled:
72
93
  description: Adds account layout wrapper around the content passed in to the component
73
94
  data:
@@ -16,10 +16,8 @@ accessibility_criteria: |
16
16
 
17
17
  Landmarks and Roles in the super navigation header should:
18
18
 
19
- * have a role of banner at the root of the component (<header>) (ARIA 1.1)
19
+ * sit within the primary header element (<header>) provided by the page layout
20
20
  accessibility_excluded_rules:
21
- # The header element can not be top level in the examples.
22
- - landmark-banner-is-top-level
23
21
  # Banners will be duplicated in component examples list.
24
22
  - duplicate-id
25
23
  - duplicate-id-active
@@ -80,15 +80,15 @@ cy:
80
80
  aria_label:
81
81
  england:
82
82
  end: " a Lloegr"
83
- middle: ", Lloegr"
83
+ middle: "Lloegr"
84
84
  start: Loegr
85
85
  northern_ireland:
86
86
  end: " a Gogledd Iwerddon"
87
- middle: ", Gogledd Iwerddon"
87
+ middle: "Gogledd Iwerddon"
88
88
  start: Ogledd Iwerddon
89
89
  scotland:
90
90
  end: " a'r Alban"
91
- middle: ", yr Alban"
91
+ middle: "yr Alban"
92
92
  start: "'r Alban"
93
93
  type:
94
94
  consultation: Ymgynghoriad ar gyfer %{nation}
@@ -97,7 +97,7 @@ cy:
97
97
  publication: Cyhoeddiad ar gyfer %{nation}
98
98
  wales:
99
99
  end: " a Chymru"
100
- middle: ", Cymru"
100
+ middle: "Cymru"
101
101
  start: Gymru
102
102
  feedback:
103
103
  close: Cau
@@ -75,15 +75,15 @@ en:
75
75
  aria_label: Nation
76
76
  england:
77
77
  end: " and England"
78
- middle: ", England"
78
+ middle: "England"
79
79
  start: England
80
80
  northern_ireland:
81
81
  end: " and Northern Ireland"
82
- middle: ", Northern Ireland"
82
+ middle: "Northern Ireland"
83
83
  start: Northern Ireland
84
84
  scotland:
85
85
  end: " and Scotland"
86
- middle: ", Scotland"
86
+ middle: "Scotland"
87
87
  start: Scotland
88
88
  type:
89
89
  consultation: Consultation for %{nation}
@@ -92,7 +92,7 @@ en:
92
92
  publication: Publication for %{nation}
93
93
  wales:
94
94
  end: " and Wales"
95
- middle: ", Wales"
95
+ middle: "Wales"
96
96
  start: Wales
97
97
  feedback:
98
98
  close: Cancel
@@ -15,15 +15,16 @@ module GovukPublishingComponents
15
15
  nation_keys.each_with_index.map { |k, i| name_for_position(k, i, nation_keys.count, use_english_translation) }.join
16
16
  end
17
17
 
18
- def name_for_position(nation, position, total, use_english_translation)
18
+ def name_for_position(nation, position, total, use_english_translation, cy_initial_mutation: true)
19
19
  key = if position.zero?
20
- :start
20
+ cy_initial_mutation ? :start : :middle
21
21
  elsif position == (total - 1)
22
22
  :end
23
23
  else
24
24
  :middle
25
25
  end
26
- I18n.t("components.devolved_nations.#{nation}.#{key}", locale: use_english_translation ? :en : nil)
26
+ name = I18n.t("components.devolved_nations.#{nation}.#{key}", locale: use_english_translation ? :en : nil)
27
+ position.zero? || position == (total - 1) ? name : ", #{name}"
27
28
  end
28
29
 
29
30
  def ga4_applicable_nations_title_text(remove_connector_word = nil)
@@ -41,7 +42,7 @@ module GovukPublishingComponents
41
42
 
42
43
  url_to_nation_keys.transform_values do |nation_keys|
43
44
  nations_text = nation_keys.each_with_index.map { |key, index|
44
- name_for_position(key, index, nation_keys.count, true)
45
+ name_for_position(key, index, nation_keys.count, false, cy_initial_mutation: false)
45
46
  }.join
46
47
 
47
48
  alternative_content_text(nations_text)
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "67.0.1".freeze
2
+ VERSION = "67.1.0".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 67.0.1
4
+ version: 67.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev