govuk_publishing_components 35.17.0 → 35.19.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/analytics-ga4/ga4-core.js +5 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-tracker.js +2 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js +14 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +154 -11
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +1 -0
- data/app/models/govuk_publishing_components/audit_applications.rb +4 -4
- data/app/models/govuk_publishing_components/audit_comparer.rb +5 -5
- data/app/views/govuk_publishing_components/components/_contents_list.html.erb +4 -2
- data/app/views/govuk_publishing_components/components/_govspeak.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +11 -4
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +154 -76
- data/app/views/govuk_publishing_components/components/docs/contents_list.yml +3 -4
- data/app/views/govuk_publishing_components/components/docs/image_card.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +5 -0
- data/app/views/govuk_publishing_components/components/docs/layout_super_navigation_header.yml +29 -0
- data/app/views/govuk_publishing_components/components/layout_for_public/_layout_super_navigation_header_homepage.html.erb +11 -0
- data/lib/govuk_publishing_components/presenters/attachment_helper.rb +1 -1
- data/lib/govuk_publishing_components/presenters/checkboxes_helper.rb +1 -1
- data/lib/govuk_publishing_components/presenters/content_item.rb +1 -1
- data/lib/govuk_publishing_components/presenters/contents_list_helper.rb +6 -0
- data/lib/govuk_publishing_components/presenters/curated_taxonomy_sidebar_links.rb +0 -2
- data/lib/govuk_publishing_components/presenters/devolved_nations_helper.rb +2 -2
- data/lib/govuk_publishing_components/presenters/image_card_helper.rb +6 -2
- data/lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb +1 -1
- data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +1 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/axe-core/axe.js +679 -11
- data/node_modules/axe-core/axe.min.js +2 -2
- data/node_modules/axe-core/locales/ja.json +12 -12
- data/node_modules/axe-core/package.json +1 -1
- data/node_modules/axe-core/sri-history.json +4 -0
- metadata +5 -4
data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb
CHANGED
@@ -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
|
-
|
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
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
data
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
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
|
-
|
52
|
-
aria
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
width
|
58
|
-
|
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
|
-
|
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
|
-
|
72
|
-
|
73
|
-
|
136
|
+
<% unless hide_logo_text %>
|
137
|
+
<span class="govuk-header__logotype-text">
|
138
|
+
<%= logo_text %>
|
139
|
+
</span>
|
140
|
+
<% end %>
|
74
141
|
</span>
|
75
|
-
|
76
|
-
|
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
|
-
|
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:
|
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
|
-
|
177
|
+
<% content_tag(:span, {
|
178
|
+
class: item_link_inner_classes
|
179
|
+
}) do %>
|
109
180
|
<%= link[:label] %>
|
110
|
-
|
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:
|
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:
|
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
|
-
|
147
|
-
|
148
|
-
|
149
|
-
aria
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
data
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
"
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
"
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
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
|
×
|
184
260
|
</span>
|
185
|
-
|
261
|
+
<% end %>
|
186
262
|
|
187
|
-
|
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
|
-
|
274
|
+
<% end %>
|
197
275
|
</div>
|
198
|
-
|
276
|
+
<% end %>
|
199
277
|
</div>
|
200
278
|
|
201
279
|
<div
|
@@ -336,4 +414,4 @@
|
|
336
414
|
</div>
|
337
415
|
</nav>
|
338
416
|
</div>
|
339
|
-
|
417
|
+
<% end %>
|
@@ -197,18 +197,17 @@ examples:
|
|
197
197
|
data:
|
198
198
|
ga4_tracking: true
|
199
199
|
contents:
|
200
|
-
- href: "
|
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
|
-
-
|
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: "
|
212
|
+
- href: "https://www.gov.uk/browse"
|
214
213
|
text: 2. Nested Item
|
@@ -206,11 +206,11 @@ examples:
|
|
206
206
|
<%= component %>
|
207
207
|
</div>
|
208
208
|
two_thirds_column:
|
209
|
-
description: This variant is used for the featured section on the homepage
|
209
|
+
description: This variant is used for the featured section on the homepage, the aspect ratio used is 1:1
|
210
210
|
data:
|
211
211
|
two_thirds: true
|
212
212
|
href: "/still-not-a-page"
|
213
|
-
image_src: "https://
|
213
|
+
image_src: "https://www.gov.uk/assets/static/govuk-apple-touch-icon-180x180-026deaa34fa328ae5f1f519a37dbd15e6555c5086e1ba83986cd0827a7209902.png"
|
214
214
|
image_alt: "some meaningful alt text please"
|
215
215
|
heading_text: "Something has happened nearby possibly"
|
216
216
|
description: "Following a news report that something has happened, further details are emerging of the thing that has happened and what that means for you."
|
@@ -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:
|
data/app/views/govuk_publishing_components/components/docs/layout_super_navigation_header.yml
CHANGED
@@ -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
|
@@ -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:
|
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
|
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
|
@@ -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:
|
46
|
+
I18n.t("components.devolved_nations.type.#{@type}", nation:)
|
47
47
|
else
|
48
|
-
I18n.t("components.devolved_nations.type.publication", nation:
|
48
|
+
I18n.t("components.devolved_nations.type.publication", nation:)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
@@ -63,6 +63,10 @@ module GovukPublishingComponents
|
|
63
63
|
def image
|
64
64
|
classes = %w[gem-c-image-card__image-wrapper]
|
65
65
|
classes << "gem-c-image-card__image-wrapper--one-third" if @two_thirds
|
66
|
+
height = 200
|
67
|
+
width = 300
|
68
|
+
height = 90 if @two_thirds
|
69
|
+
width = 90 if @two_thirds
|
66
70
|
|
67
71
|
if @image_src
|
68
72
|
content_tag(:figure, class: classes) do
|
@@ -73,8 +77,8 @@ module GovukPublishingComponents
|
|
73
77
|
loading: @image_loading,
|
74
78
|
sizes: @sizes,
|
75
79
|
srcset: @srcset,
|
76
|
-
height
|
77
|
-
width
|
80
|
+
height:,
|
81
|
+
width:,
|
78
82
|
)
|
79
83
|
end
|
80
84
|
end
|