govuk_publishing_components 34.0.0 → 34.1.1
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/analytics-ga4/ga4-core.js +16 -27
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-event-tracker.js +2 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js +4 -4
- data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +12 -69
- data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +14 -13
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +247 -412
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +2 -2
- data/app/controllers/govuk_publishing_components/audit_controller.rb +1 -1
- data/app/models/govuk_publishing_components/audit_comparer.rb +1 -1
- data/app/models/govuk_publishing_components/audit_components.rb +103 -82
- data/app/views/govuk_publishing_components/audit/_applications.html.erb +1 -1
- data/app/views/govuk_publishing_components/audit/_component_contents.html.erb +47 -39
- data/app/views/govuk_publishing_components/audit/_components.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_label.html.erb +3 -2
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +94 -143
- data/app/views/govuk_publishing_components/components/docs/label.yml +6 -0
- data/config/locales/ar.yml +4 -1
- data/config/locales/az.yml +4 -1
- data/config/locales/be.yml +4 -1
- data/config/locales/bg.yml +4 -1
- data/config/locales/bn.yml +4 -1
- data/config/locales/cs.yml +4 -1
- data/config/locales/cy.yml +4 -1
- data/config/locales/da.yml +4 -1
- data/config/locales/de.yml +4 -1
- data/config/locales/dr.yml +4 -1
- data/config/locales/el.yml +4 -1
- data/config/locales/en.yml +6 -10
- data/config/locales/es-419.yml +4 -1
- data/config/locales/es.yml +4 -1
- data/config/locales/et.yml +4 -1
- data/config/locales/fa.yml +4 -1
- data/config/locales/fi.yml +4 -1
- data/config/locales/fr.yml +4 -1
- data/config/locales/gd.yml +4 -1
- data/config/locales/gu.yml +4 -1
- data/config/locales/he.yml +4 -1
- data/config/locales/hi.yml +4 -1
- data/config/locales/hr.yml +4 -1
- data/config/locales/hu.yml +4 -1
- data/config/locales/hy.yml +4 -1
- data/config/locales/id.yml +4 -1
- data/config/locales/is.yml +4 -1
- data/config/locales/it.yml +4 -1
- data/config/locales/ja.yml +4 -1
- data/config/locales/ka.yml +4 -1
- data/config/locales/kk.yml +4 -1
- data/config/locales/ko.yml +4 -1
- data/config/locales/lt.yml +4 -1
- data/config/locales/lv.yml +4 -1
- data/config/locales/ms.yml +4 -1
- data/config/locales/mt.yml +4 -1
- data/config/locales/nl.yml +4 -1
- data/config/locales/no.yml +4 -1
- data/config/locales/pa-pk.yml +4 -1
- data/config/locales/pa.yml +4 -1
- data/config/locales/pl.yml +4 -1
- data/config/locales/ps.yml +4 -1
- data/config/locales/pt.yml +4 -1
- data/config/locales/ro.yml +4 -1
- data/config/locales/ru.yml +4 -1
- data/config/locales/si.yml +4 -1
- data/config/locales/sk.yml +4 -1
- data/config/locales/sl.yml +4 -1
- data/config/locales/so.yml +4 -1
- data/config/locales/sq.yml +4 -1
- data/config/locales/sr.yml +4 -1
- data/config/locales/sv.yml +4 -1
- data/config/locales/sw.yml +4 -1
- data/config/locales/ta.yml +4 -1
- data/config/locales/th.yml +4 -1
- data/config/locales/tk.yml +4 -1
- data/config/locales/tr.yml +4 -1
- data/config/locales/uk.yml +4 -1
- data/config/locales/ur.yml +4 -1
- data/config/locales/uz.yml +4 -1
- data/config/locales/vi.yml +4 -1
- data/config/locales/zh-hk.yml +4 -1
- data/config/locales/zh-tw.yml +4 -1
- data/config/locales/zh.yml +4 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/axe-core/axe.d.ts +76 -24
- data/node_modules/axe-core/axe.js +4765 -4555
- data/node_modules/axe-core/axe.min.js +2 -2
- data/node_modules/axe-core/package.json +2 -2
- data/node_modules/axe-core/sri-history.json +8 -0
- metadata +2 -2
data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
logo_link ||= "https://www.gov.uk/"
|
3
3
|
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_columns = t("components.layout_super_navigation_header.navigation_links_columns")
|
6
6
|
navigation_menu_heading = t("components.layout_super_navigation_header.navigation_menu_heading")
|
7
7
|
navigation_search_heading = t("components.layout_super_navigation_header.navigation_search_heading")
|
8
8
|
navigation_search_subheading = t("components.layout_super_navigation_header.navigation_search_subheading")
|
@@ -65,140 +65,93 @@
|
|
65
65
|
<h2 id="super-navigation-menu-heading" class="govuk-visually-hidden">
|
66
66
|
<%= navigation_menu_heading %>
|
67
67
|
</h2>
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
>
|
90
|
-
<span class="gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner">
|
91
|
-
Menu
|
68
|
+
|
69
|
+
<%
|
70
|
+
link = t("components.layout_super_navigation_header.navigation_link")
|
71
|
+
unique_id = SecureRandom.hex(4)
|
72
|
+
show_menu_text = show_navigation_menu_text
|
73
|
+
hide_menu_text = hide_navigation_menu_text
|
74
|
+
tracking_label = link[:label].downcase.gsub(/\s+/, "")
|
75
|
+
%>
|
76
|
+
|
77
|
+
<%= link_to link[:href], {
|
78
|
+
class: "gem-c-layout-super-navigation-header__navigation-item-link",
|
79
|
+
data: {
|
80
|
+
track_action: "#{tracking_label}Link",
|
81
|
+
track_category: "headerClicked",
|
82
|
+
track_label: link[:href],
|
83
|
+
track_dimension: link[:label],
|
84
|
+
track_dimension_index: "29",
|
85
|
+
}
|
86
|
+
} do %>
|
87
|
+
<span class="gem-c-layout-super-navigation-header__navigation-item-link-inner">
|
88
|
+
<%= link[:label] %>
|
92
89
|
</span>
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
id="super-navigation-menu__section-<%= unique_id %>"
|
157
|
-
>
|
158
|
-
<div class="govuk-width-container gem-c-layout-super-navigation-header__width-container">
|
159
|
-
<div class="govuk-grid-row">
|
160
|
-
<div class="govuk-grid-column-one-third-from-desktop">
|
161
|
-
<% if link[:description].present? %>
|
162
|
-
<h3 class="govuk-body-l gem-c-layout-super-navigation-header__menu-description">
|
163
|
-
<%= link[:description] %>
|
164
|
-
</h3>
|
165
|
-
<% end %>
|
166
|
-
</div>
|
167
|
-
<div class="govuk-grid-column-two-thirds-from-desktop">
|
168
|
-
<% if link[:menu_contents].present? %>
|
169
|
-
<ul class="gem-c-layout-super-navigation-header__navigation-second-items gem-c-layout-super-navigation-header__navigation-second-items--<%= link[:label].parameterize %>">
|
170
|
-
<% link[:menu_contents].each do | item | %>
|
171
|
-
<%
|
172
|
-
has_description = item[:description].present?
|
173
|
-
link_classes = %w[govuk-link gem-c-layout-super-navigation-header__navigation-second-item-link]
|
174
|
-
link_classes << "gem-c-layout-super-navigation-header__navigation-second-item-link--with-description" if has_description
|
175
|
-
%>
|
176
|
-
<li class="gem-c-layout-super-navigation-header__dropdown-list-item">
|
177
|
-
<%= link_to item[:label], item[:href], {
|
178
|
-
class: link_classes,
|
179
|
-
data: {
|
180
|
-
track_action: "#{tracking_label}Link",
|
181
|
-
track_category: "headerClicked",
|
182
|
-
track_label: item[:href],
|
183
|
-
track_dimension: item[:label],
|
184
|
-
track_dimension_index: "29",
|
185
|
-
}
|
186
|
-
} %>
|
187
|
-
<%= tag.p item[:description], class: "gem-c-layout-super-navigation-header__navigation-second-item-description" if has_description %>
|
188
|
-
</li>
|
189
|
-
<% end %>
|
190
|
-
</ul>
|
191
|
-
<% end %>
|
192
|
-
<% if link[:footer_links].present? %>
|
193
|
-
<hr class="gem-c-layout-super-navigation-header__navigation-second-footer-break govuk-section-break govuk-section-break--visible">
|
194
|
-
<ul class="gem-c-layout-super-navigation-header__navigation-second-footer-list">
|
195
|
-
<% link[:footer_links].each do | item | %>
|
196
|
-
<li class="gem-c-layout-super-navigation-header__navigation-second-footer-item">
|
90
|
+
<% end %>
|
91
|
+
|
92
|
+
<%= content_tag(:button, {
|
93
|
+
aria: {
|
94
|
+
controls: "super-navigation-menu-#{unique_id}",
|
95
|
+
expanded: false,
|
96
|
+
label: show_menu_text,
|
97
|
+
},
|
98
|
+
class: "gem-c-layout-super-navigation-header__navigation-top-toggle-button",
|
99
|
+
data: {
|
100
|
+
text_for_hide: hide_menu_text,
|
101
|
+
text_for_show: show_menu_text,
|
102
|
+
toggle_desktop_group: "top",
|
103
|
+
toggle_mobile_group: "top",
|
104
|
+
tracking_key: tracking_label,
|
105
|
+
ga4_event: {
|
106
|
+
event_name: "select_content",
|
107
|
+
type: "header menu bar",
|
108
|
+
text: link[:label],
|
109
|
+
index: 1,
|
110
|
+
index_total: 2,
|
111
|
+
section: link[:label]
|
112
|
+
}
|
113
|
+
},
|
114
|
+
hidden: true,
|
115
|
+
id: "super-navigation-menu-#{unique_id}-toggle",
|
116
|
+
type: "button",
|
117
|
+
}) do %>
|
118
|
+
<%= tag.span link[:label], class: "gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner" %>
|
119
|
+
<% end %>
|
120
|
+
<%= tag.div class: "gem-c-layout-super-navigation-header__navigation-items" do %>
|
121
|
+
<div
|
122
|
+
id="super-navigation-menu-<%= unique_id %>" hidden
|
123
|
+
class="gem-c-layout-super-navigation-header__navigation-dropdown-menu"
|
124
|
+
>
|
125
|
+
<div class="gem-c-layout-super-navigation-header__width-container">
|
126
|
+
<div class="govuk-grid-row">
|
127
|
+
|
128
|
+
<% navigation_links_columns.each_with_index do | column, index | %>
|
129
|
+
<%
|
130
|
+
case column[:size]
|
131
|
+
when 2
|
132
|
+
width_class = "govuk-grid-column-two-thirds-from-desktop"
|
133
|
+
when 3
|
134
|
+
width_class = "govuk-grid-column-full-from-desktop"
|
135
|
+
else
|
136
|
+
width_class = "govuk-grid-column-one-third-from-desktop"
|
137
|
+
end
|
138
|
+
%>
|
139
|
+
|
140
|
+
<div class="<%= width_class %> gem-c-layout-super-navigation-header__column--<%= column[:label].downcase.sub(" ", "-") %>">
|
141
|
+
<h3 class="govuk-heading-m gem-c-layout-super-navigation-header__column-header">
|
142
|
+
<%= column[:label] %>
|
143
|
+
</h3>
|
144
|
+
<ul class="gem-c-layout-super-navigation-header__navigation-second-items gem-c-layout-super-navigation-header__navigation-second-items--<%= column[:label].downcase.sub(" ", "-") %>">
|
145
|
+
<% column[:menu_contents].each do | item | %>
|
146
|
+
<%
|
147
|
+
has_description = item[:description].present?
|
148
|
+
link_classes = %w[govuk-link gem-c-layout-super-navigation-header__navigation-second-item-link]
|
149
|
+
link_classes << "gem-c-layout-super-navigation-header__navigation-second-item-link--with-description" if has_description
|
150
|
+
tracking_label = column[:label].downcase.gsub(/\s+/, "")
|
151
|
+
%>
|
152
|
+
<li class="gem-c-layout-super-navigation-header__dropdown-list-item">
|
197
153
|
<%= link_to item[:label], item[:href], {
|
198
|
-
class:
|
199
|
-
"govuk-link",
|
200
|
-
"gem-c-layout-super-navigation-header__navigation-second-footer-link",
|
201
|
-
],
|
154
|
+
class: link_classes,
|
202
155
|
data: {
|
203
156
|
track_action: "#{tracking_label}Link",
|
204
157
|
track_category: "headerClicked",
|
@@ -207,18 +160,16 @@
|
|
207
160
|
track_dimension_index: "29",
|
208
161
|
}
|
209
162
|
} %>
|
163
|
+
<%= tag.p item[:description], class: "gem-c-layout-super-navigation-header__navigation-second-item-description" if has_description %>
|
210
164
|
</li>
|
211
|
-
|
212
|
-
|
213
|
-
<% end %>
|
165
|
+
<% end %>
|
166
|
+
</ul>
|
214
167
|
</div>
|
215
|
-
|
168
|
+
<% end %>
|
216
169
|
</div>
|
217
170
|
</div>
|
218
|
-
|
219
|
-
<% end %>
|
171
|
+
</div>
|
220
172
|
<% end %>
|
221
|
-
</ul>
|
222
173
|
|
223
174
|
<button
|
224
175
|
aria-controls="super-search-menu"
|
@@ -237,8 +188,8 @@
|
|
237
188
|
"event_name": "select_content",
|
238
189
|
"type": "header menu bar",
|
239
190
|
"text": "Search",
|
240
|
-
"index":
|
241
|
-
"index_total":
|
191
|
+
"index": 2,
|
192
|
+
"index_total": 2,
|
242
193
|
"section": "Search"
|
243
194
|
}.to_json %>"
|
244
195
|
>
|
@@ -265,7 +216,7 @@
|
|
265
216
|
</h3>
|
266
217
|
<div class="gem-c-layout-super-navigation-header__search-item">
|
267
218
|
<a class="gem-c-layout-super-navigation-header__search-item-link" href="/search">
|
268
|
-
<span class="
|
219
|
+
<span class="govuk-visually-hidden">
|
269
220
|
<%= search_text %>
|
270
221
|
</span>
|
271
222
|
<svg
|
@@ -59,3 +59,9 @@ examples:
|
|
59
59
|
html_for: "id-radio"
|
60
60
|
hint_id: "id-radio"
|
61
61
|
hint_text: "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’."
|
62
|
+
with_id:
|
63
|
+
description:
|
64
|
+
data:
|
65
|
+
text: "Label with an ID"
|
66
|
+
id: "id-for-the-label"
|
67
|
+
html_for: "id-that-matches-input-6"
|
data/config/locales/ar.yml
CHANGED
data/config/locales/az.yml
CHANGED
data/config/locales/be.yml
CHANGED
data/config/locales/bg.yml
CHANGED
data/config/locales/bn.yml
CHANGED
data/config/locales/cs.yml
CHANGED
data/config/locales/cy.yml
CHANGED
data/config/locales/da.yml
CHANGED
data/config/locales/de.yml
CHANGED
data/config/locales/dr.yml
CHANGED
data/config/locales/el.yml
CHANGED
data/config/locales/en.yml
CHANGED
@@ -162,10 +162,12 @@ en:
|
|
162
162
|
menu_toggle_label:
|
163
163
|
hide: Hide %{label} menu
|
164
164
|
show: Show %{label} menu
|
165
|
-
|
166
|
-
- label: Topics
|
165
|
+
navigation_link:
|
167
166
|
href: "/browse"
|
168
|
-
|
167
|
+
label: Menu
|
168
|
+
navigation_links_columns:
|
169
|
+
- label: Topics
|
170
|
+
size: 2
|
169
171
|
menu_contents:
|
170
172
|
- label: Benefits
|
171
173
|
href: "/browse/benefits"
|
@@ -202,8 +204,7 @@ en:
|
|
202
204
|
- label: Working, jobs and pensions
|
203
205
|
href: "/browse/working"
|
204
206
|
- label: Government activity
|
205
|
-
|
206
|
-
description: Search for a department and find out what the government is doing
|
207
|
+
column_size: 1
|
207
208
|
menu_contents:
|
208
209
|
- label: Departments
|
209
210
|
href: "/government/organisations"
|
@@ -223,11 +224,6 @@ en:
|
|
223
224
|
- label: Transparency
|
224
225
|
href: "/search/transparency-and-freedom-of-information-releases"
|
225
226
|
description: Data, Freedom of Information releases and corporate reports
|
226
|
-
footer_links:
|
227
|
-
- label: How government works
|
228
|
-
href: "/government/how-government-works"
|
229
|
-
- label: Get involved
|
230
|
-
href: "/government/get-involved"
|
231
227
|
navigation_menu_heading: Navigation menu
|
232
228
|
navigation_search_heading: Search and popular pages
|
233
229
|
navigation_search_subheading: Search
|
data/config/locales/es-419.yml
CHANGED
data/config/locales/es.yml
CHANGED
data/config/locales/et.yml
CHANGED
data/config/locales/fa.yml
CHANGED
data/config/locales/fi.yml
CHANGED
data/config/locales/fr.yml
CHANGED
data/config/locales/gd.yml
CHANGED
data/config/locales/gu.yml
CHANGED
data/config/locales/he.yml
CHANGED
data/config/locales/hi.yml
CHANGED
data/config/locales/hr.yml
CHANGED
data/config/locales/hu.yml
CHANGED
data/config/locales/hy.yml
CHANGED