govuk_publishing_components 24.19.0 → 25.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics.js +2 -0
  3. data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +59 -91
  4. data/app/assets/javascripts/govuk_publishing_components/{lib → analytics}/track-click.js +0 -0
  5. data/app/assets/javascripts/govuk_publishing_components/{lib/select.js → analytics/track-select-change.js} +0 -0
  6. data/app/assets/javascripts/govuk_publishing_components/components/intervention.js +16 -0
  7. data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +71 -0
  8. data/app/assets/javascripts/govuk_publishing_components/lib/trigger-event.js +13 -2
  9. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/_all_components_print.scss +1 -0
  11. data/app/assets/stylesheets/govuk_publishing_components/component_support.scss +0 -1
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +7 -9
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +12 -10
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +125 -0
  15. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +9 -0
  16. data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-super-navigation-header.scss +3 -0
  17. data/app/views/govuk_publishing_components/components/_document_list.html.erb +3 -3
  18. data/app/views/govuk_publishing_components/components/_govspeak.html.erb +2 -0
  19. data/app/views/govuk_publishing_components/components/_intervention.html.erb +26 -8
  20. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +19 -13
  21. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +121 -0
  22. data/app/views/govuk_publishing_components/components/_radio.html.erb +2 -3
  23. data/app/views/govuk_publishing_components/components/_title.html.erb +1 -4
  24. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +9 -0
  25. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +4 -0
  26. data/app/views/govuk_publishing_components/components/docs/layout_super_navigation_header.yml +22 -0
  27. data/app/views/govuk_publishing_components/components/docs/radio.yml +4 -15
  28. data/app/views/govuk_publishing_components/components/docs/title.yml +0 -12
  29. data/config/initializers/assets.rb +0 -1
  30. data/config/locales/ar.yml +8 -0
  31. data/config/locales/az.yml +8 -0
  32. data/config/locales/be.yml +8 -0
  33. data/config/locales/bg.yml +8 -0
  34. data/config/locales/bn.yml +8 -0
  35. data/config/locales/cs.yml +8 -0
  36. data/config/locales/cy.yml +8 -0
  37. data/config/locales/da.yml +8 -0
  38. data/config/locales/de.yml +8 -0
  39. data/config/locales/dr.yml +8 -0
  40. data/config/locales/el.yml +8 -0
  41. data/config/locales/en.yml +87 -1
  42. data/config/locales/es-419.yml +8 -0
  43. data/config/locales/es.yml +8 -0
  44. data/config/locales/et.yml +8 -0
  45. data/config/locales/fa.yml +8 -0
  46. data/config/locales/fi.yml +8 -0
  47. data/config/locales/fr.yml +8 -0
  48. data/config/locales/gd.yml +8 -0
  49. data/config/locales/gu.yml +8 -0
  50. data/config/locales/he.yml +8 -0
  51. data/config/locales/hi.yml +8 -0
  52. data/config/locales/hr.yml +8 -0
  53. data/config/locales/hu.yml +8 -0
  54. data/config/locales/hy.yml +8 -0
  55. data/config/locales/id.yml +8 -0
  56. data/config/locales/is.yml +8 -0
  57. data/config/locales/it.yml +8 -0
  58. data/config/locales/ja.yml +8 -0
  59. data/config/locales/ka.yml +8 -0
  60. data/config/locales/kk.yml +8 -0
  61. data/config/locales/ko.yml +8 -0
  62. data/config/locales/lt.yml +8 -0
  63. data/config/locales/lv.yml +8 -0
  64. data/config/locales/ms.yml +8 -0
  65. data/config/locales/mt.yml +8 -0
  66. data/config/locales/nl.yml +8 -0
  67. data/config/locales/no.yml +8 -0
  68. data/config/locales/pa-pk.yml +8 -0
  69. data/config/locales/pa.yml +8 -0
  70. data/config/locales/pl.yml +8 -0
  71. data/config/locales/ps.yml +8 -0
  72. data/config/locales/pt.yml +8 -0
  73. data/config/locales/ro.yml +8 -0
  74. data/config/locales/ru.yml +8 -0
  75. data/config/locales/si.yml +8 -0
  76. data/config/locales/sk.yml +8 -0
  77. data/config/locales/sl.yml +8 -0
  78. data/config/locales/so.yml +8 -0
  79. data/config/locales/sq.yml +8 -0
  80. data/config/locales/sr.yml +8 -0
  81. data/config/locales/sv.yml +8 -0
  82. data/config/locales/sw.yml +8 -0
  83. data/config/locales/ta.yml +8 -0
  84. data/config/locales/th.yml +8 -0
  85. data/config/locales/tk.yml +8 -0
  86. data/config/locales/tr.yml +8 -0
  87. data/config/locales/uk.yml +8 -0
  88. data/config/locales/ur.yml +8 -0
  89. data/config/locales/uz.yml +8 -0
  90. data/config/locales/vi.yml +8 -0
  91. data/config/locales/zh-hk.yml +8 -0
  92. data/config/locales/zh-tw.yml +8 -0
  93. data/config/locales/zh.yml +8 -0
  94. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +32 -11
  95. data/lib/govuk_publishing_components/presenters/meta_tags.rb +11 -4
  96. data/lib/govuk_publishing_components/version.rb +1 -1
  97. metadata +10 -16
  98. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_px-to-em.scss +0 -12
  99. data/app/assets/stylesheets/govuk_publishing_components/components/print/_attachment.scss +0 -2
  100. data/app/assets/stylesheets/govuk_publishing_components/components/print/_back-link.scss +0 -2
  101. data/app/assets/stylesheets/govuk_publishing_components/components/print/_feedback.scss +0 -2
  102. data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-footer.scss +0 -2
  103. data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-header.scss +0 -2
  104. data/app/assets/stylesheets/govuk_publishing_components/components/print/_metadata.scss +0 -2
  105. data/app/assets/stylesheets/govuk_publishing_components/components/print/_search.scss +0 -2
  106. data/app/assets/stylesheets/govuk_publishing_components/components/print/_share-links.scss +0 -2
  107. data/app/assets/stylesheets/govuk_publishing_components/components/print/_skip-link.scss +0 -2
  108. data/app/assets/stylesheets/govuk_publishing_components/components/print/_subscription-links.scss +0 -2
  109. data/app/assets/stylesheets/govuk_publishing_components/components/print/_translation-nav.scss +0 -2
@@ -99,3 +99,12 @@
99
99
  font-weight: inherit;
100
100
  }
101
101
  }
102
+
103
+ .gem-c-govspeak--inverse {
104
+ color: govuk-colour('white');
105
+
106
+ a {
107
+ @include govuk-link-common;
108
+ @include govuk-link-style-inverse;
109
+ }
110
+ }
@@ -0,0 +1,3 @@
1
+ .gem-c-super-navigation-header a:after {
2
+ content: " ( " attr(href) " ) ";
3
+ }
@@ -41,7 +41,7 @@
41
41
  item[:link][:text],
42
42
  item[:link][:path],
43
43
  data: item[:link][:data_attributes],
44
- class: "#{item_classes} gem-c-document-list__item-link",
44
+ class: "#{item_classes} govuk-link",
45
45
  lang: item[:link][:locale].presence,
46
46
  rel: rel,
47
47
  )
@@ -65,7 +65,7 @@
65
65
 
66
66
  <% if item[:metadata] %>
67
67
  <ul class="gem-c-document-list__item-metadata">
68
- <% item[:metadata].compact.each do |item_metadata_key, item_metadata_value| %>
68
+ <% item[:metadata].compact.each do |item_metadata_key, item_metadata_value| %>
69
69
  <% if !item_metadata_key.to_s.eql?("locale") %>
70
70
  <% lang = item[:metadata][:locale].present? && item[:metadata][:locale][item_metadata_key].present? ? item[:metadata][:locale][item_metadata_key] : nil %>
71
71
 
@@ -101,7 +101,7 @@
101
101
  part[:link][:text],
102
102
  part[:link][:path],
103
103
  data: part[:link][:data_attributes],
104
- class: "gem-c-document-list-child__heading #{brand_helper.color_class} gem-c-document-list-child__link",
104
+ class: "gem-c-document-list-child__heading #{brand_helper.color_class} govuk-link gem-c-document-list-child__link",
105
105
  )
106
106
  else
107
107
  content_tag(
@@ -1,10 +1,12 @@
1
1
  <%
2
+ inverse ||= false
2
3
  direction_class = "direction-#{direction}" if local_assigns.include?(:direction)
3
4
  disable_youtube_expansions = local_assigns.fetch(:disable_youtube_expansions) if local_assigns.include?(:disable_youtube_expansions)
4
5
 
5
6
  classes = []
6
7
  classes << direction_class if direction_class
7
8
  classes << "disable-youtube" if disable_youtube_expansions
9
+ classes << "gem-c-govspeak--inverse" if inverse
8
10
  %>
9
11
 
10
12
  <div class="gem-c-govspeak govuk-govspeak <%= classes.join(" ") %>" data-module="govspeak">
@@ -1,15 +1,33 @@
1
- <%= tag.section class: "gem-c-intervention", role: "region" do %>
2
- <h2 class="gem-c-intervention__title">
3
- <a class="govuk-link" href="/next-steps-for-your-business">
4
- <%= t("components.intervention.title") %>
5
- </a>
1
+ <%
2
+ data_attributes ||= {}
3
+ data_attributes[:module] = 'intervention'
4
+ %>
5
+
6
+ <%= tag.section class: "gem-c-intervention", role: "region", data: data_attributes do %>
7
+ <h2 class="gem-c-intervention__title govuk-heading-s">
8
+ <a class="govuk-link" href="/next-steps-for-your-business"
9
+ data-module="gem-track-click"
10
+ data-track-category="interventionBanner"
11
+ data-track-action="interventionClicked"
12
+ data-track-dimension="<%= t("components.intervention.title") %>"
13
+ data-track-dimension-index="29"
14
+ data-track-label="/next-steps-for-your-business">
15
+ <%= t("components.intervention.title") %></a>
6
16
  </h2>
7
17
 
8
- <p class="gem-c-intervention__paragraph">
18
+ <p class="govuk-body">
9
19
  <%= t("components.intervention.description") %>
10
20
  </p>
11
21
 
12
- <p class="gem-c-intervention__paragraph">
13
- <%= t("components.intervention.dismiss_html") %>
22
+ <p class="govuk-body">
23
+ <a class="govuk-link" href="?hide-intervention=true"
24
+ data-module="gem-track-click"
25
+ data-track-category="interventionBanner"
26
+ data-track-action="interventionDismissed"
27
+ data-track-label="?hide-intervention=true"
28
+ data-track-dimension="<%= t("components.intervention.dismiss_link_text") %>"
29
+ data-track-dimension-index="29">
30
+ <%= t("components.intervention.dismiss_link_text") %></a>
31
+ <%= t("components.intervention.dismiss_post_link") %>
14
32
  </p>
15
33
  <% end %>
@@ -1,14 +1,16 @@
1
1
  <%
2
- omit_feedback_form ||= false
3
2
  emergency_banner ||= nil
4
3
  full_width ||= false
5
4
  global_bar ||= nil
6
- product_name ||= nil
7
5
  html_lang ||= "en"
8
6
  layout_helper = GovukPublishingComponents::Presenters::PublicLayoutHelper.new(local_assigns)
9
7
  logo_link ||= "/"
10
8
  navigation_items ||= []
9
+ omit_feedback_form ||= false
10
+ omit_footer_navigation ||= false
11
11
  omit_header ||= false
12
+ product_name ||= nil
13
+ show_explore_header ||= false
12
14
  show_search = local_assigns.include?(:show_search) ? local_assigns[:show_search] : true
13
15
  title ||= "GOV.UK - The best place to find government services and information"
14
16
 
@@ -75,16 +77,20 @@
75
77
  <%= render "govuk_publishing_components/components/cookie_banner" %>
76
78
 
77
79
  <% unless omit_header %>
78
- <%= render "govuk_publishing_components/components/layout_header", {
79
- search: show_search,
80
- logo_link: logo_link,
81
- navigation_items: navigation_items,
82
- product_name: product_name,
83
-
84
- # The (blue) bottom border needs to be underneath the emergency banner -
85
- # so it has been turned off and added in manually.
86
- remove_bottom_border: true,
87
- } %>
80
+ <% if show_explore_header %>
81
+ <%= render "govuk_publishing_components/components/layout_super_navigation_header" %>
82
+ <% else %>
83
+ <%= render "govuk_publishing_components/components/layout_header", {
84
+ search: show_search,
85
+ logo_link: logo_link,
86
+ navigation_items: navigation_items,
87
+ product_name: product_name,
88
+
89
+ # The (blue) bottom border needs to be underneath the emergency banner -
90
+ # so it has been turned off and added in manually.
91
+ remove_bottom_border: true,
92
+ } %>
93
+ <% end %>
88
94
  <% end %>
89
95
 
90
96
  <%= raw(emergency_banner) %>
@@ -117,7 +123,7 @@
117
123
  <% unless local_assigns[:hide_footer_links] %>
118
124
  <%= render "govuk_publishing_components/components/layout_footer", {
119
125
  with_border: true,
120
- navigation: layout_helper.footer_navigation,
126
+ navigation: omit_footer_navigation ? nil : layout_helper.footer_navigation,
121
127
  meta: layout_helper.footer_meta,
122
128
  } %>
123
129
  <% end %>
@@ -0,0 +1,121 @@
1
+ <%
2
+ logo_link = "https://www.gov.uk/"
3
+ logo_link_title = t("components.layout_super_navigation_header.logo_link_title")
4
+ logo_text = t("components.layout_super_navigation_header.logo_text")
5
+ navigation_links = t("components.layout_super_navigation_header.navigation_links")
6
+ navigation_menu_heading = t("components.layout_super_navigation_header.navigation_menu_heading")
7
+ popular_links = t("components.layout_super_navigation_header.popular_links")
8
+ popular_links_heading = t("components.layout_super_navigation_header.popular_links_heading")
9
+ search_text= t("components.layout_super_navigation_header.search_text")
10
+ %>
11
+ <header role="banner" class="gem-c-layout-super-navigation-header">
12
+ <div class="gem-c-layout-super-navigation-header__container govuk-width-container govuk-clearfix">
13
+ <div class="gem-c-layout-super-navigation-header__header-logo">
14
+ <a class="govuk-header__link govuk-header__link--homepage"
15
+ data-module="gem-track-click"
16
+ data-track-action="homeHeader"
17
+ data-track-category="homeLinkClicked"
18
+ href="<%= logo_link %>"
19
+ id="logo"
20
+ title="<%= logo_link_title %>">
21
+ <span class="govuk-header__logotype">
22
+ <svg aria-hidden="true"
23
+ class="govuk-header__logotype-crown gem-c-layout-super-navigation-header__logotype-crown"
24
+ focusable="false"
25
+ height="30"
26
+ viewBox="0 0 132 97"
27
+ xmlns="http://www.w3.org/2000/svg"
28
+ width="36">
29
+ <path fill="currentColor"
30
+ fill-rule="evenodd"
31
+ 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">
32
+ </path>
33
+ <image class="govuk-header__logotype-crown-fallback-image"
34
+ height="30"
35
+ src="<%= asset_path('govuk-logotype-crown.png') %>"
36
+ width="36"
37
+ xlink:href="">
38
+ </image>
39
+ </svg>
40
+ <span class="govuk-header__logotype-text">
41
+ <%= logo_text %>
42
+ </span>
43
+ </span>
44
+ </a>
45
+ </div>
46
+ <nav
47
+ aria-labelledby="super-navigation-menu-heading"
48
+ class="gem-c-layout-super-navigation-header__content"
49
+ data-module="super-navigation-toggle"
50
+ data-text-for-button="Menu"
51
+ data-text-for-show-menu="Show navigation menu"
52
+ data-text-for-hide-menu="Hide navigation menu"
53
+ >
54
+ <h2 id="super-navigation-menu-heading" class="govuk-visually-hidden"><%= navigation_menu_heading %></h2>
55
+ <ul id="super-navigation-menu" class="gem-c-layout-super-navigation-header__items">
56
+ <% navigation_links.each do | link | %>
57
+ <li class="govuk-header__navigation-item gem-c-layout-super-navigation-header__item">
58
+ <a class="govuk-header__link gem-c-layout-super-navigation-header__item-link" href="<%= link[:href] %>">
59
+ <%= link[:label] %>
60
+ </a>
61
+ <% if link[:menu_contents].present? or link[:footer_links].present? %>
62
+ <div class="gem-c-layout-super-navigation-header__dropdown-menu">
63
+ <% if link[:menu_contents].present? %>
64
+ <ul class="govuk-list">
65
+ <% link[:menu_contents].each do | item | %>
66
+ <li class="gem-c-layout-super-navigation-header__dropdown-list-item">
67
+ <a class="govuk-link gem-c-layout-super-navigation-header__dropdown-list-item-link" href="<%= item[:href] %>">
68
+ <%= item[:label] %>
69
+ </a>
70
+ <%= tag.p item[:description], class: "govuk-body-s gem-c-layout-super-navigation-header__dropdown-list-item-description" if item[:description].present? %>
71
+ </li>
72
+ <% end %>
73
+ </ul>
74
+ <% end %>
75
+ <% if link[:footer_links].present? %>
76
+ <ul class="govuk-list">
77
+ <% link[:footer_links].each do | item | %>
78
+ <li class="gem-c-layout-super-navigation-header__dropdown-list-item">
79
+ <a class="govuk-link gem-c-layout-super-navigation-header__dropdown-list-item-link" href="<%= item[:href] %>">
80
+ <%= item[:label] %>
81
+ </a>
82
+ </li>
83
+ <% end %>
84
+ </ul>
85
+ <% end %>
86
+ </div>
87
+ <% end %>
88
+ </li>
89
+ <% end %>
90
+ <li class="govuk-header__navigation-item gem-c-layout-super-navigation-header__item gem-c-layout-super-navigation-header__item--search">
91
+ <a class="govuk-header__link gem-c-layout-super-navigation-header__item-link gem-c-layout-super-navigation-header__item-link--search" href="/search">
92
+ <span class="gem-c-layout-super-navigation-header__item-link-text--search"><%= search_text %></span>
93
+ <svg class="gem-c-layout-super-navigation-header__item-link-icon--search" width="27" height="27" viewBox="0 0 27 27" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
94
+ <circle cx="10.0161" cy="10.0161" r="8.51613" stroke="currentColor" stroke-width="3" />
95
+ <line x1="15.8668" y1="16.3587" x2="25.4475" y2="25.9393" stroke="currentColor" stroke-width="3" />
96
+ </svg>
97
+ </a>
98
+ <div class="gem-c-layout-super-navigation-header__dropdown-menu">
99
+ <form id="search" action="/search" method="get" role="search" aria-label="Site-wide">
100
+ <%= render "govuk_publishing_components/components/search", {
101
+ inline_label: false,
102
+ label_text: raw("<h2 class=\"govuk-heading-m\">#{search_text}</h2>"),
103
+ size: "large",
104
+ } %>
105
+ </form>
106
+ <h2 class="govuk-heading-m"><%= popular_links_heading %></h2>
107
+ <ul class="govuk-list">
108
+ <% popular_links.each do | popular_link | %>
109
+ <li class="gem-c-layout-super-navigation-header__dropdown-list-item">
110
+ <a class="govuk-link gem-c-layout-super-navigation-header__dropdown-list-item-link" href="<%= popular_link[:href] %>">
111
+ <%= popular_link[:label] %>
112
+ </a>
113
+ </li>
114
+ <% end %>
115
+ </ul>
116
+ </div>
117
+ </li>
118
+ </ul>
119
+ </nav>
120
+ </div>
121
+ </header>
@@ -11,14 +11,13 @@
11
11
  heading_size ||= nil
12
12
  small ||= false
13
13
  inline ||= false
14
- is_page_heading ||= false
15
- heading_level = is_page_heading ? 'h1' : shared_helper.get_heading_level
14
+ heading_level = shared_helper.get_heading_level
16
15
  heading_classes = %w(govuk-fieldset__heading)
17
16
  heading_classes << "gem-c-radio__heading-text" if heading_level == 'h1'
18
17
 
19
18
  if ['s', 'm', 'l', 'xl'].include?(heading_size)
20
19
  size = heading_size
21
- elsif is_page_heading
20
+ elsif heading_level == 'h1'
22
21
  size = 'xl'
23
22
  else
24
23
  size = 'm'
@@ -3,9 +3,6 @@
3
3
 
4
4
  context ||= false
5
5
  context_locale ||= false
6
- context_text = context.is_a?(Hash) ? context[:text] : context
7
- context_href = context.is_a?(Hash) ? context[:href] : false
8
- context_data = context.is_a?(Hash) ? context[:data] : false
9
6
 
10
7
  inverse ||= false
11
8
  local_assigns[:margin_top] ||= 8
@@ -24,7 +21,7 @@
24
21
  <%= content_tag(:div, class: classes) do %>
25
22
  <% if context %>
26
23
  <span class="govuk-caption-xl gem-c-title__context" <%= "lang=#{context_locale}" if context_locale.present? %>>
27
- <%= context_href ? link_to(context_text, context_href, class: 'gem-c-title__context-link govuk-link', data: context_data) : context_text %>
24
+ <%= context %>
28
25
  </span>
29
26
  <% end %>
30
27
  <h1 class="<%= heading_classes.join(" ") %>">
@@ -25,6 +25,15 @@ examples:
25
25
  block: |
26
26
  <h2>This is a title</h2>
27
27
  <p>This is some body text with <a href="https://example.com">a link</a>.</p>
28
+ inverted:
29
+ description: This option currently supports basic inversion of only headings, paragraphs and links.
30
+ data:
31
+ inverse: true
32
+ block: |
33
+ <h2>This is a title</h2>
34
+ <p>This is some body text with <a href="https://example.com">a link</a>.</p>
35
+ context:
36
+ dark_background: true
28
37
  heading_levels:
29
38
  data:
30
39
  block: |
@@ -31,6 +31,10 @@ examples:
31
31
  description: This allows the feedback form to be omitted
32
32
  data:
33
33
  omit_feedback_form: true
34
+ omit_footer_navigation:
35
+ description: This allows the footer navigation to be omitted
36
+ data:
37
+ omit_footer_navigation: true
34
38
  navigation:
35
39
  description: Passes the navigation through to the [header component](/component-guide/layout_header/).
36
40
  data:
@@ -0,0 +1,22 @@
1
+ name: Layout super navigation header
2
+ description: The super navigation header provides a consistent header across GOV.UK.
3
+ body: |
4
+ shared_accessibility_criteria:
5
+ - link
6
+ accessibility_criteria: |
7
+ The component must:
8
+
9
+ * have a text contrast ratio higher than 4.5:1 against the background colour to meet WCAG AA
10
+
11
+ Images in the super navigation header must:
12
+
13
+ * be presentational when linked to from accompanying text (crown icon).
14
+
15
+ Landmarks and Roles in the super navigation header should:
16
+
17
+ * have a role of banner at the root of the component (<header>) (ARIA 1.1)
18
+ accessibility_excluded_rules:
19
+ - landmark-banner-is-top-level # The header element can not be top level in the examples
20
+ - landmark-no-duplicate-banner # banners will be duplicated in component examples list
21
+ examples:
22
+ default:
@@ -107,17 +107,6 @@ examples:
107
107
  text: "Green"
108
108
  - value: "blue"
109
109
  text: "Blue"
110
- with_page_heading:
111
- description: This adds a H1 element containing the text supplied.
112
- data:
113
- name: "radio-group-heading"
114
- heading: "Is it raining?"
115
- is_page_heading: true
116
- items:
117
- - value: "yes"
118
- text: "Yes"
119
- - value: "no"
120
- text: "No"
121
110
  with_page_header_and_caption:
122
111
  description: |
123
112
  If a caption text is provided with a page heading, it will be displayed above the heading.
@@ -127,7 +116,7 @@ examples:
127
116
  name: "radio-group-heading"
128
117
  heading: "Is it snowing?"
129
118
  heading_caption: "Question 3 of 9"
130
- is_page_heading: true
119
+ heading_level: 1
131
120
  items:
132
121
  - value: "yes"
133
122
  text: "Yes"
@@ -137,7 +126,7 @@ examples:
137
126
  data:
138
127
  name: "radio-group-heading"
139
128
  heading: "Is it snowing?"
140
- is_page_heading: true
129
+ heading_level: 1
141
130
  hint: "Sleet or hail doesn’t count."
142
131
  items:
143
132
  - value: "yes"
@@ -179,7 +168,7 @@ examples:
179
168
  data:
180
169
  name: "radio-group-description"
181
170
  heading: "What is your favourite colour?"
182
- is_page_heading: true
171
+ heading_level: 1
183
172
  description: |
184
173
  Skittles consist of hard sugar shells imprinted with the letter "S".
185
174
  The interior consists mainly of sugar, corn syrup, and hydrogenated
@@ -196,7 +185,7 @@ examples:
196
185
  description: |
197
186
  This allows the size of the legend to be changed. Valid options are s, m, l, xl, defaulting to m if no option is passed.
198
187
 
199
- If the is_page_heading option is true and heading_size is not set, the text size will be xl.
188
+ If heading_level is 1 and heading_size is not set, the text size will be xl.
200
189
  data:
201
190
  name: "radio-group-description"
202
191
  heading: "What is your favourite colour?"
@@ -33,18 +33,6 @@ examples:
33
33
  context: Publication
34
34
  context_locale: en
35
35
  title: My page title
36
- with_context_link:
37
- description: |
38
- It’s unclear if links in the context of a title are useful and are being clicked by users. Data attributes are included to track this behaviour.
39
-
40
- Context links are used on [topic pages](https://www.gov.uk/topic/business-tax/vat) where there is also a breadcrumb.
41
- data:
42
- context:
43
- text: Publication
44
- href: '/link'
45
- data:
46
- some_tracking_parameter: 'tracking-param'
47
- title: My page title
48
36
  long_title_with_context:
49
37
  data:
50
38
  context: Publication