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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +5 -0
  3. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-tracker.js +2 -1
  4. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js +14 -1
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +2 -2
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +154 -11
  7. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +1 -0
  8. data/app/models/govuk_publishing_components/audit_applications.rb +4 -4
  9. data/app/models/govuk_publishing_components/audit_comparer.rb +5 -5
  10. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +4 -2
  11. data/app/views/govuk_publishing_components/components/_govspeak.html.erb +1 -0
  12. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +11 -4
  13. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +154 -76
  14. data/app/views/govuk_publishing_components/components/docs/contents_list.yml +3 -4
  15. data/app/views/govuk_publishing_components/components/docs/image_card.yml +2 -2
  16. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +5 -0
  17. data/app/views/govuk_publishing_components/components/docs/layout_super_navigation_header.yml +29 -0
  18. data/app/views/govuk_publishing_components/components/layout_for_public/_layout_super_navigation_header_homepage.html.erb +11 -0
  19. data/lib/govuk_publishing_components/presenters/attachment_helper.rb +1 -1
  20. data/lib/govuk_publishing_components/presenters/checkboxes_helper.rb +1 -1
  21. data/lib/govuk_publishing_components/presenters/content_item.rb +1 -1
  22. data/lib/govuk_publishing_components/presenters/contents_list_helper.rb +6 -0
  23. data/lib/govuk_publishing_components/presenters/curated_taxonomy_sidebar_links.rb +0 -2
  24. data/lib/govuk_publishing_components/presenters/devolved_nations_helper.rb +2 -2
  25. data/lib/govuk_publishing_components/presenters/image_card_helper.rb +6 -2
  26. data/lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb +1 -1
  27. data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +1 -1
  28. data/lib/govuk_publishing_components/version.rb +1 -1
  29. data/node_modules/axe-core/axe.js +679 -11
  30. data/node_modules/axe-core/axe.min.js +2 -2
  31. data/node_modules/axe-core/locales/ja.json +12 -12
  32. data/node_modules/axe-core/package.json +1 -1
  33. data/node_modules/axe-core/sri-history.json +4 -0
  34. metadata +5 -4
@@ -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
- <header role="banner" class="gem-c-layout-super-navigation-header" data-module="gem-track-click ga4-event-tracker ga4-link-tracker" data-track-links-only data-ga4-expandable>
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
- <div class="gem-c-layout-super-navigation-header__header-logo">
25
- <a
26
- class="govuk-header__link govuk-header__link--homepage"
27
- data-track-action="logoLink"
28
- data-track-category="headerClicked"
29
- data-track-label="<%= logo_link %>"
30
- data-track-dimension="<%= logo_text %>"
31
- data-track-dimension-index="29"
32
- href="<%= logo_link %>"
33
- id="logo"
34
- title="<%= logo_link_title %>"
35
- data-ga4-link="<%= {
36
- "event_name": "navigation",
37
- "type": "header menu bar",
38
- "external": "false",
39
- "text": "GOV.UK",
40
- "section": "Logo",
41
- "index": {
42
- "index_link": 1,
43
- "index_section": 0,
44
- "index_section_count": 2,
45
- },
46
- "index_total": 1
47
- }.to_json %>"
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
- <svg
52
- aria-hidden="true"
53
- class="govuk-header__logotype-crown gem-c-layout-super-navigation-header__logotype-crown"
54
- focusable="false"
55
- height="30"
56
- viewBox="0 0 132 97"
57
- width="36"
58
- xmlns="http://www.w3.org/2000/svg"
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
- </svg>
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
- <span class="govuk-header__logotype-text">
72
- <%= logo_text %>
73
- </span>
136
+ <% unless hide_logo_text %>
137
+ <span class="govuk-header__logotype-text">
138
+ <%= logo_text %>
139
+ </span>
140
+ <% end %>
74
141
  </span>
75
- </a>
76
- </div>
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
- <div class="gem-c-layout-super-navigation-header__button-container">
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: "gem-c-layout-super-navigation-header__navigation-item-link",
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
- <span class="gem-c-layout-super-navigation-header__navigation-item-link-inner">
177
+ <% content_tag(:span, {
178
+ class: item_link_inner_classes
179
+ }) do %>
109
180
  <%= link[:label] %>
110
- </span>
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: "gem-c-layout-super-navigation-header__navigation-top-toggle-button",
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: "gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner" %>
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
- <button
147
- aria-controls="super-search-menu"
148
- aria-expanded="true"
149
- aria-label="<%= hide_search_menu_text %>"
150
- class="gem-c-layout-super-navigation-header__search-toggle-button"
151
- data-text-for-hide="<%= hide_search_menu_text %>"
152
- data-text-for-show="<%= show_search_menu_text %>"
153
- data-toggle-mobile-group="top"
154
- data-toggle-desktop-group="top"
155
- data-tracking-key="search"
156
- hidden
157
- id="super-search-menu-toggle"
158
- type="button"
159
- data-ga4-event="<%= {
160
- "event_name": "select_content",
161
- "type": "header menu bar",
162
- "text": "Search",
163
- "index": {
164
- "index_section": 2,
165
- "index_section_count": 2,
166
- },
167
- "section": "Search"
168
- }.to_json %>"
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
  &times;
184
260
  </span>
185
- </button>
261
+ <% end %>
186
262
 
187
- <a class="gem-c-layout-super-navigation-header__search-item-link" href="/search">
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
- </a>
274
+ <% end %>
197
275
  </div>
198
- </div>
276
+ <% end %>
199
277
  </div>
200
278
 
201
279
  <div
@@ -336,4 +414,4 @@
336
414
  </div>
337
415
  </nav>
338
416
  </div>
339
- </header>
417
+ <% end %>
@@ -197,18 +197,17 @@ examples:
197
197
  data:
198
198
  ga4_tracking: true
199
199
  contents:
200
- - href: "#first-thing"
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
- - href: "#third-thing"
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: "#third-thing"
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://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/91397/s712_SG_Swear_in_1_.jpg"
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:
@@ -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
@@ -0,0 +1,11 @@
1
+ <% logo_link ||= "/" %>
2
+
3
+ <%= render "govuk_publishing_components/components/layout_super_navigation_header",
4
+ {
5
+ hide_logo_text: true,
6
+ logo_link: logo_link,
7
+ blue_background: true,
8
+ hide_button_left_border: true,
9
+ large_navbar: true,
10
+ }
11
+ %>
@@ -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: content_type) if matching_types.empty?
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 checkbox_name, checkbox[:value], checked, class: "govuk-checkboxes__input", id: checkbox_id, data: data
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
@@ -119,7 +119,7 @@ module GovukPublishingComponents
119
119
 
120
120
  def as_taxonomy_sidebar_link
121
121
  {
122
- title: title,
122
+ title:,
123
123
  link: base_path,
124
124
  }
125
125
  end
@@ -48,6 +48,12 @@ module GovukPublishingComponents
48
48
  total
49
49
  end
50
50
 
51
+ def get_ga4_event_name(link)
52
+ return "select_content" if link.start_with?("#")
53
+
54
+ "navigation"
55
+ end
56
+
51
57
  private
52
58
 
53
59
  def parent_modifier
@@ -1,5 +1,3 @@
1
- require "set"
2
-
3
1
  module GovukPublishingComponents
4
2
  module Presenters
5
3
  # @private
@@ -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: nation)
46
+ I18n.t("components.devolved_nations.type.#{@type}", nation:)
47
47
  else
48
- I18n.t("components.devolved_nations.type.publication", nation: 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: 200,
77
- width: 300,
80
+ height:,
81
+ width:,
78
82
  )
79
83
  end
80
84
  end
@@ -88,7 +88,7 @@ module GovukPublishingComponents
88
88
  title: current_step_nav.title,
89
89
  path: current_step_nav.base_path,
90
90
  tracking_id: current_step_nav.content_id,
91
- ga4_tracking: ga4_tracking,
91
+ ga4_tracking:,
92
92
  }
93
93
  else
94
94
  {}
@@ -77,7 +77,7 @@ module GovukPublishingComponents
77
77
  def generate_data_attribute(link, track_action)
78
78
  {
79
79
  track_category: "footerClicked",
80
- track_action: track_action,
80
+ track_action:,
81
81
  track_label: link[:href],
82
82
  track_options: {
83
83
  dimension29: link[:text],
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "35.17.0".freeze
2
+ VERSION = "35.19.0".freeze
3
3
  end