govuk_publishing_components 25.1.0 → 25.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +234 -40
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +6 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +580 -41
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +5 -0
- data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +244 -63
- data/config/locales/ar.yml +5 -3
- data/config/locales/az.yml +5 -3
- data/config/locales/be.yml +5 -3
- data/config/locales/bg.yml +5 -3
- data/config/locales/bn.yml +5 -3
- data/config/locales/cs.yml +5 -3
- data/config/locales/cy.yml +8 -6
- data/config/locales/da.yml +5 -3
- data/config/locales/de.yml +5 -3
- data/config/locales/dr.yml +5 -3
- data/config/locales/el.yml +5 -3
- data/config/locales/en.yml +87 -83
- data/config/locales/es-419.yml +5 -3
- data/config/locales/es.yml +5 -3
- data/config/locales/et.yml +5 -3
- data/config/locales/fa.yml +5 -3
- data/config/locales/fi.yml +5 -3
- data/config/locales/fr.yml +5 -3
- data/config/locales/gd.yml +5 -3
- data/config/locales/gu.yml +5 -3
- data/config/locales/he.yml +5 -3
- data/config/locales/hi.yml +5 -3
- data/config/locales/hr.yml +5 -3
- data/config/locales/hu.yml +5 -3
- data/config/locales/hy.yml +5 -3
- data/config/locales/id.yml +5 -3
- data/config/locales/is.yml +5 -3
- data/config/locales/it.yml +5 -3
- data/config/locales/ja.yml +5 -3
- data/config/locales/ka.yml +5 -3
- data/config/locales/kk.yml +5 -3
- data/config/locales/ko.yml +5 -3
- data/config/locales/lt.yml +5 -3
- data/config/locales/lv.yml +5 -3
- data/config/locales/ms.yml +5 -3
- data/config/locales/mt.yml +5 -3
- data/config/locales/nl.yml +5 -3
- data/config/locales/no.yml +5 -3
- data/config/locales/pa-pk.yml +5 -3
- data/config/locales/pa.yml +5 -3
- data/config/locales/pl.yml +5 -3
- data/config/locales/ps.yml +5 -3
- data/config/locales/pt.yml +5 -3
- data/config/locales/ro.yml +5 -3
- data/config/locales/ru.yml +5 -3
- data/config/locales/si.yml +5 -3
- data/config/locales/sk.yml +5 -3
- data/config/locales/sl.yml +5 -3
- data/config/locales/so.yml +5 -3
- data/config/locales/sq.yml +5 -3
- data/config/locales/sr.yml +5 -3
- data/config/locales/sv.yml +5 -3
- data/config/locales/sw.yml +5 -3
- data/config/locales/ta.yml +5 -3
- data/config/locales/th.yml +5 -3
- data/config/locales/tk.yml +5 -3
- data/config/locales/tr.yml +5 -3
- data/config/locales/uk.yml +5 -3
- data/config/locales/ur.yml +5 -3
- data/config/locales/uz.yml +5 -3
- data/config/locales/vi.yml +5 -3
- data/config/locales/zh-hk.yml +5 -3
- data/config/locales/zh-tw.yml +5 -3
- data/config/locales/zh.yml +5 -3
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +2 -2
@@ -279,6 +279,11 @@
|
|
279
279
|
padding: govuk-spacing(2);
|
280
280
|
background-color: govuk-colour("white");
|
281
281
|
|
282
|
+
&:hover {
|
283
|
+
background-color: govuk-colour("light-grey");
|
284
|
+
color: $govuk-link-hover-colour;
|
285
|
+
}
|
286
|
+
|
282
287
|
&:focus {
|
283
288
|
@include govuk-focused-text;
|
284
289
|
background-color: $govuk-focus-colour;
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# This is a hack - but it's the only way I can find to not have two blue bars on
|
18
18
|
# constrained width layouts.
|
19
19
|
#
|
20
|
-
# The full width layout hides the blue bar underneath the
|
20
|
+
# The full width layout hides the blue bar underneath the black header bar - so
|
21
21
|
# full width pages won't see the blue bar unless it's added by another component
|
22
22
|
# - and for most pages that component is the global banner.
|
23
23
|
#
|
data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb
CHANGED
@@ -4,17 +4,28 @@ logo_link_title = t("components.layout_super_navigation_header.logo_link_title")
|
|
4
4
|
logo_text = t("components.layout_super_navigation_header.logo_text")
|
5
5
|
navigation_links = t("components.layout_super_navigation_header.navigation_links")
|
6
6
|
navigation_menu_heading = t("components.layout_super_navigation_header.navigation_menu_heading")
|
7
|
+
navigation_search_heading = t("components.layout_super_navigation_header.navigation_search_heading")
|
8
|
+
navigation_search_subheading = t("components.layout_super_navigation_header.navigation_search_subheading")
|
7
9
|
popular_links = t("components.layout_super_navigation_header.popular_links")
|
8
10
|
popular_links_heading = t("components.layout_super_navigation_header.popular_links_heading")
|
9
|
-
search_text= t("components.layout_super_navigation_header.search_text")
|
11
|
+
search_text = t("components.layout_super_navigation_header.search_text")
|
12
|
+
|
13
|
+
hide_search_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.hide", :label => "search")
|
14
|
+
show_search_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.show", :label => "search")
|
15
|
+
hide_navigation_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.hide", :label => "navigation")
|
16
|
+
show_navigation_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.show", :label => "navigation")
|
17
|
+
|
10
18
|
%>
|
11
19
|
<header role="banner" class="gem-c-layout-super-navigation-header">
|
12
20
|
<div class="gem-c-layout-super-navigation-header__container govuk-width-container govuk-clearfix">
|
13
21
|
<div class="gem-c-layout-super-navigation-header__header-logo">
|
14
22
|
<a class="govuk-header__link govuk-header__link--homepage"
|
15
23
|
data-module="gem-track-click"
|
16
|
-
data-track-action="
|
17
|
-
data-track-category="
|
24
|
+
data-track-action="logoLink"
|
25
|
+
data-track-category="headerClicked"
|
26
|
+
data-track-label="<%= logo_link %>"
|
27
|
+
data-track-dimension="<%= logo_text %>"
|
28
|
+
data-track-dimension-index="29"
|
18
29
|
href="<%= logo_link %>"
|
19
30
|
id="logo"
|
20
31
|
title="<%= logo_link_title %>">
|
@@ -46,76 +57,246 @@ search_text= t("components.layout_super_navigation_header.search_text")
|
|
46
57
|
<nav
|
47
58
|
aria-labelledby="super-navigation-menu-heading"
|
48
59
|
class="gem-c-layout-super-navigation-header__content"
|
49
|
-
data-module="super-navigation-
|
50
|
-
data-text-for-button="Menu"
|
51
|
-
data-text-for-show-menu="Show navigation menu"
|
52
|
-
data-text-for-hide-menu="Hide navigation menu"
|
60
|
+
data-module="super-navigation-mega-menu"
|
53
61
|
>
|
54
|
-
<h2 id="super-navigation-menu-heading" class="govuk-visually-hidden"
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
62
|
+
<h2 id="super-navigation-menu-heading" class="govuk-visually-hidden">
|
63
|
+
<%= navigation_menu_heading %>
|
64
|
+
</h2>
|
65
|
+
<button
|
66
|
+
aria-controls="super-navigation-menu"
|
67
|
+
aria-expanded="true"
|
68
|
+
aria-label="<%= hide_navigation_menu_text %>"
|
69
|
+
class="gem-c-layout-super-navigation-header__navigation-top-toggle-button"
|
70
|
+
data-text-for-hide="<%= hide_navigation_menu_text %>"
|
71
|
+
data-text-for-show="<%= show_navigation_menu_text %>"
|
72
|
+
data-toggle-desktop-group="hidden"
|
73
|
+
data-toggle-mobile-group="top"
|
74
|
+
data-tracking-key="menu"
|
75
|
+
hidden
|
76
|
+
id="super-navigation-menu-toggle"
|
77
|
+
type="button"
|
78
|
+
>
|
79
|
+
Menu
|
80
|
+
</button>
|
81
|
+
<ul id="super-navigation-menu" class="gem-c-layout-super-navigation-header__navigation-items">
|
82
|
+
<% navigation_links.each_with_index do | link, index | %>
|
83
|
+
<%
|
84
|
+
has_children = (link[:menu_contents].present? or link[:footer_links].present?)
|
85
|
+
li_classes = %w[gem-c-layout-super-navigation-header__navigation-item]
|
86
|
+
li_classes << "gem-c-layout-super-navigation-header__navigation-item--with-children" if has_children
|
87
|
+
unique_id = SecureRandom.hex(4)
|
88
|
+
show_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.show", :label => link[:label])
|
89
|
+
hide_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.hide", :label => link[:label])
|
90
|
+
tracking_label = link[:label].downcase.gsub(/\s+/, "")
|
91
|
+
%>
|
92
|
+
<%= tag.li class: li_classes do %>
|
93
|
+
<a class="gem-c-layout-super-navigation-header__navigation-item-link" href="<%= link[:href] %>">
|
59
94
|
<%= link[:label] %>
|
60
95
|
</a>
|
61
|
-
<% if
|
62
|
-
<
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
96
|
+
<% if has_children %>
|
97
|
+
<button
|
98
|
+
aria-controls="super-navigation-menu__section-<%= unique_id %>"
|
99
|
+
aria-expanded="false"
|
100
|
+
aria-label="<%= show_menu_text %>"
|
101
|
+
class="gem-c-layout-super-navigation-header__navigation-second-toggle-button"
|
102
|
+
data-text-for-hide="<%= hide_menu_text %>"
|
103
|
+
data-text-for-show="<%= show_menu_text %>"
|
104
|
+
data-toggle-desktop-group="top"
|
105
|
+
data-toggle-mobile-group="second"
|
106
|
+
data-tracking-key="<%= tracking_label %>"
|
107
|
+
hidden
|
108
|
+
id="super-navigation-menu__section-<%= unique_id %>-toggle"
|
109
|
+
type="button"
|
110
|
+
>
|
111
|
+
<%= link[:label] %>
|
112
|
+
</button>
|
113
|
+
<div
|
114
|
+
hidden
|
115
|
+
class="gem-c-layout-super-navigation-header__navigation-dropdown-menu"
|
116
|
+
id="super-navigation-menu__section-<%= unique_id %>"
|
117
|
+
>
|
118
|
+
<div class="govuk-width-container">
|
119
|
+
<div class="govuk-grid-row">
|
120
|
+
<div class="govuk-grid-column-one-third-from-desktop">
|
121
|
+
<% if link[:description].present? %>
|
122
|
+
<p class="govuk-body-l gem-c-layout-super-navigation-header__menu-description">
|
123
|
+
<%= link[:description] %>
|
124
|
+
</p>
|
125
|
+
<% end %>
|
126
|
+
</div>
|
127
|
+
<% if link[:menu_contents].present? %>
|
128
|
+
<div class="govuk-grid-column-two-thirds-from-desktop">
|
129
|
+
<ul class="govuk-list gem-c-layout-super-navigation-header__navigation-second-items">
|
130
|
+
<% link[:menu_contents].each do | item | %>
|
131
|
+
<%
|
132
|
+
has_description = item[:description].present?
|
133
|
+
link_classes = %w[govuk-link gem-c-layout-super-navigation-header__navigation-second-item-link]
|
134
|
+
link_classes << "gem-c-layout-super-navigation-header__navigation-second-item-link--with-description" if has_description
|
135
|
+
%>
|
136
|
+
<li class="gem-c-layout-super-navigation-header__dropdown-list-item">
|
137
|
+
<%= link_to item[:label], item[:href], { class: link_classes } %>
|
138
|
+
<%= tag.p item[:description], class: "govuk-body govuk-!-margin-0" if has_description %>
|
139
|
+
</li>
|
140
|
+
<% end %>
|
141
|
+
</ul>
|
142
|
+
</div>
|
72
143
|
<% end %>
|
73
|
-
</
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
144
|
+
</div>
|
145
|
+
<% if link[:footer_links].present? %>
|
146
|
+
<div class="govuk-grid-row">
|
147
|
+
<div class="govuk-grid-column-full">
|
148
|
+
<div class="gem-c-layout-super-navigation-header__navigation-second-footer">
|
149
|
+
<div class="govuk-grid-row">
|
150
|
+
<ul class="gem-c-layout-super-navigation-header__navigation-second-footer-list">
|
151
|
+
<% link[:footer_links].each do | item | %>
|
152
|
+
<li class="gem-c-layout-super-navigation-header__navigation-second-footer-item">
|
153
|
+
<a class="govuk-link gem-c-layout-super-navigation-header__navigation-second-footer-link" href="<%= item[:href] %>">
|
154
|
+
<%= item[:label] %>
|
155
|
+
</a>
|
156
|
+
</li>
|
157
|
+
<% end %>
|
158
|
+
</ul>
|
159
|
+
</div>
|
160
|
+
</div>
|
161
|
+
</div>
|
162
|
+
</div>
|
163
|
+
<% end %>
|
164
|
+
</div>
|
86
165
|
</div>
|
87
166
|
<% end %>
|
88
|
-
|
167
|
+
<% end %>
|
89
168
|
<% end %>
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
169
|
+
</ul>
|
170
|
+
|
171
|
+
<button
|
172
|
+
aria-controls="super-search-menu"
|
173
|
+
aria-expanded="true"
|
174
|
+
aria-label="<%= hide_search_menu_text %>"
|
175
|
+
class="gem-c-layout-super-navigation-header__search-toggle-button"
|
176
|
+
data-text-for-hide="<%= hide_search_menu_text %>"
|
177
|
+
data-text-for-show="<%= show_search_menu_text %>"
|
178
|
+
data-toggle-mobile-group="top"
|
179
|
+
data-toggle-desktop-group="top"
|
180
|
+
data-tracking-key="search"
|
181
|
+
hidden
|
182
|
+
id="super-search-menu-toggle"
|
183
|
+
type="button"
|
184
|
+
>
|
185
|
+
<span class="govuk-visually-hidden">
|
186
|
+
<%= search_text %>
|
187
|
+
</span>
|
188
|
+
<svg
|
189
|
+
class="gem-c-layout-super-navigation-header__search-toggle-button-link-icon"
|
190
|
+
width="27"
|
191
|
+
height="27"
|
192
|
+
viewBox="0 0 27 27"
|
193
|
+
fill="none"
|
194
|
+
xmlns="http://www.w3.org/2000/svg"
|
195
|
+
aria-hidden="true"
|
196
|
+
focusable="false"
|
197
|
+
>
|
198
|
+
<circle
|
199
|
+
cx="10.0161"
|
200
|
+
cy="10.0161"
|
201
|
+
r="8.51613"
|
202
|
+
stroke="currentColor"
|
203
|
+
stroke-width="3" />
|
204
|
+
<line
|
205
|
+
x1="15.8668"
|
206
|
+
y1="16.3587"
|
207
|
+
x2="25.4475"
|
208
|
+
y2="25.9393"
|
209
|
+
stroke="currentColor"
|
210
|
+
stroke-width="3" />
|
211
|
+
</svg>
|
212
|
+
</button>
|
213
|
+
|
214
|
+
<div id="super-search-menu" class="gem-c-layout-super-navigation-header__search-items">
|
215
|
+
<h3 class="govuk-visually-hidden">
|
216
|
+
<%= navigation_search_subheading %>
|
217
|
+
</h3>
|
218
|
+
<div class="gem-c-layout-super-navigation-header__search-item">
|
219
|
+
<a class="gem-c-layout-super-navigation-header__search-item-link" href="/search">
|
220
|
+
<span class="gem-c-layout-super-navigation-header__search-item-link-text">
|
221
|
+
<%= search_text %>
|
222
|
+
</span>
|
223
|
+
<svg
|
224
|
+
class="gem-c-layout-super-navigation-header__search-item-link-icon"
|
225
|
+
width="27"
|
226
|
+
height="27"
|
227
|
+
viewBox="0 0 27 27"
|
228
|
+
fill="none"
|
229
|
+
xmlns="http://www.w3.org/2000/svg"
|
230
|
+
aria-hidden="true"
|
231
|
+
focusable="false"
|
232
|
+
>
|
233
|
+
<circle
|
234
|
+
cx="10.0161"
|
235
|
+
cy="10.0161"
|
236
|
+
r="8.51613"
|
237
|
+
stroke="currentColor"
|
238
|
+
stroke-width="3" />
|
239
|
+
<line
|
240
|
+
x1="15.8668"
|
241
|
+
y1="16.3587"
|
242
|
+
x2="25.4475"
|
243
|
+
y2="25.9393"
|
244
|
+
stroke="currentColor"
|
245
|
+
stroke-width="3" />
|
96
246
|
</svg>
|
97
247
|
</a>
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
248
|
+
</div>
|
249
|
+
|
250
|
+
<div class="govuk-width-container gem-c-layout-super-navigation-header__search-and-popular">
|
251
|
+
<div class="govuk-grid-row">
|
252
|
+
<div class="govuk-grid-column-full">
|
253
|
+
<form
|
254
|
+
class="gem-c-layout-super-navigation-header__search-form"
|
255
|
+
id="search"
|
256
|
+
action="/search"
|
257
|
+
method="get"
|
258
|
+
role="search"
|
259
|
+
aria-label="Site-wide"
|
260
|
+
>
|
261
|
+
<%= render "govuk_publishing_components/components/search", {
|
262
|
+
inline_label: false,
|
263
|
+
label_size: "m",
|
264
|
+
label_text: search_text,
|
265
|
+
size: "large",
|
266
|
+
data_attributes: {
|
267
|
+
track_category: "headerClicked",
|
268
|
+
track_action: "searchSubmitted",
|
269
|
+
track_label: "/search/all",
|
270
|
+
track_dimension: t("components.search_box.label"),
|
271
|
+
track_dimension_index: 29,
|
272
|
+
},
|
273
|
+
} %>
|
274
|
+
</form>
|
275
|
+
</div>
|
116
276
|
</div>
|
117
|
-
|
118
|
-
|
277
|
+
<div class="govuk-grid-row">
|
278
|
+
<div class="govuk-grid-column-full">
|
279
|
+
<h3 class="govuk-heading-m"><%= popular_links_heading %></h3>
|
280
|
+
<ul class="govuk-list">
|
281
|
+
<% popular_links.each do | popular_link | %>
|
282
|
+
<li class="gem-c-layout-super-navigation-header__popular-item">
|
283
|
+
<a class="govuk-link gem-c-layout-super-navigation-header__popular-link"
|
284
|
+
href="<%= popular_link[:href] %>"
|
285
|
+
data-module="gem-track-click"
|
286
|
+
data-track-action="popularLink"
|
287
|
+
data-track-category="headerClicked"
|
288
|
+
data-track-label="<%= popular_link[:href] %>"
|
289
|
+
data-track-dimension="<%= popular_link[:label] %>"
|
290
|
+
data-track-dimension-index="29">
|
291
|
+
<%= popular_link[:label] %>
|
292
|
+
</a>
|
293
|
+
</li>
|
294
|
+
<% end %>
|
295
|
+
</ul>
|
296
|
+
</div>
|
297
|
+
</div>
|
298
|
+
</div>
|
299
|
+
</div>
|
119
300
|
</nav>
|
120
301
|
</div>
|
121
302
|
</header>
|
data/config/locales/ar.yml
CHANGED
@@ -82,11 +82,13 @@ ar:
|
|
82
82
|
layout_super_navigation_header:
|
83
83
|
logo_link_title:
|
84
84
|
logo_text:
|
85
|
+
navigation_links:
|
85
86
|
navigation_menu_heading:
|
86
|
-
|
87
|
-
|
87
|
+
navigation_search_heading:
|
88
|
+
navigation_search_subheading:
|
88
89
|
popular_links:
|
89
|
-
|
90
|
+
popular_links_heading:
|
91
|
+
search_text:
|
90
92
|
metadata:
|
91
93
|
from:
|
92
94
|
history:
|
data/config/locales/az.yml
CHANGED
@@ -82,11 +82,13 @@ az:
|
|
82
82
|
layout_super_navigation_header:
|
83
83
|
logo_link_title:
|
84
84
|
logo_text:
|
85
|
+
navigation_links:
|
85
86
|
navigation_menu_heading:
|
86
|
-
|
87
|
-
|
87
|
+
navigation_search_heading:
|
88
|
+
navigation_search_subheading:
|
88
89
|
popular_links:
|
89
|
-
|
90
|
+
popular_links_heading:
|
91
|
+
search_text:
|
90
92
|
metadata:
|
91
93
|
from:
|
92
94
|
history:
|
data/config/locales/be.yml
CHANGED
@@ -82,11 +82,13 @@ be:
|
|
82
82
|
layout_super_navigation_header:
|
83
83
|
logo_link_title:
|
84
84
|
logo_text:
|
85
|
+
navigation_links:
|
85
86
|
navigation_menu_heading:
|
86
|
-
|
87
|
-
|
87
|
+
navigation_search_heading:
|
88
|
+
navigation_search_subheading:
|
88
89
|
popular_links:
|
89
|
-
|
90
|
+
popular_links_heading:
|
91
|
+
search_text:
|
90
92
|
metadata:
|
91
93
|
from:
|
92
94
|
history:
|
data/config/locales/bg.yml
CHANGED
@@ -82,11 +82,13 @@ bg:
|
|
82
82
|
layout_super_navigation_header:
|
83
83
|
logo_link_title:
|
84
84
|
logo_text:
|
85
|
+
navigation_links:
|
85
86
|
navigation_menu_heading:
|
86
|
-
|
87
|
-
|
87
|
+
navigation_search_heading:
|
88
|
+
navigation_search_subheading:
|
88
89
|
popular_links:
|
89
|
-
|
90
|
+
popular_links_heading:
|
91
|
+
search_text:
|
90
92
|
metadata:
|
91
93
|
from:
|
92
94
|
history:
|
data/config/locales/bn.yml
CHANGED
@@ -82,11 +82,13 @@ bn:
|
|
82
82
|
layout_super_navigation_header:
|
83
83
|
logo_link_title:
|
84
84
|
logo_text:
|
85
|
+
navigation_links:
|
85
86
|
navigation_menu_heading:
|
86
|
-
|
87
|
-
|
87
|
+
navigation_search_heading:
|
88
|
+
navigation_search_subheading:
|
88
89
|
popular_links:
|
89
|
-
|
90
|
+
popular_links_heading:
|
91
|
+
search_text:
|
90
92
|
metadata:
|
91
93
|
from:
|
92
94
|
history:
|