govuk_publishing_components 27.10.2 → 27.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/explicit-cross-domain-links.js +1 -1
  3. data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +1 -0
  4. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +543 -380
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_single-page-notification-button.scss +30 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-super-navigation-header.scss +2 -2
  8. data/app/models/govuk_publishing_components/shared_accessibility_criteria.rb +17 -0
  9. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +107 -89
  10. data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb +23 -0
  11. data/app/views/govuk_publishing_components/components/docs/layout_super_navigation_header.yml +12 -3
  12. data/app/views/govuk_publishing_components/components/docs/single_page_notification_button.yml +32 -0
  13. data/app/views/govuk_publishing_components/components/search/_search_icon.html.erb +5 -5
  14. data/config/locales/en.yml +7 -3
  15. data/lib/govuk_publishing_components/version.rb +1 -1
  16. data/node_modules/govuk-frontend/govuk/components/accordion/macro-options.json +2 -2
  17. data/node_modules/govuk-frontend/govuk/components/back-link/macro-options.json +3 -3
  18. data/node_modules/govuk-frontend/govuk/components/button/_index.scss +3 -4
  19. data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +9 -0
  20. data/node_modules/govuk-frontend/govuk/components/character-count/macro-options.json +6 -6
  21. data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +14 -0
  22. data/node_modules/govuk-frontend/govuk/components/checkboxes/macro-options.json +8 -8
  23. data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro-options.json +1 -1
  24. data/node_modules/govuk-frontend/govuk/components/date-input/macro-options.json +5 -5
  25. data/node_modules/govuk-frontend/govuk/components/details/_index.scss +2 -1
  26. data/node_modules/govuk-frontend/govuk/components/details/macro-options.json +2 -2
  27. data/node_modules/govuk-frontend/govuk/components/error-message/macro-options.json +3 -3
  28. data/node_modules/govuk-frontend/govuk/components/fieldset/macro-options.json +1 -1
  29. data/node_modules/govuk-frontend/govuk/components/file-upload/_index.scss +1 -0
  30. data/node_modules/govuk-frontend/govuk/components/file-upload/macro-options.json +4 -4
  31. data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +3 -0
  32. data/node_modules/govuk-frontend/govuk/components/footer/macro-options.json +2 -2
  33. data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +6 -6
  34. data/node_modules/govuk-frontend/govuk/components/hint/macro-options.json +1 -1
  35. data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +7 -7
  36. data/node_modules/govuk-frontend/govuk/components/inset-text/macro-options.json +1 -1
  37. data/node_modules/govuk-frontend/govuk/components/label/macro-options.json +1 -1
  38. data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +13 -1
  39. data/node_modules/govuk-frontend/govuk/components/panel/macro-options.json +1 -1
  40. data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +14 -0
  41. data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +8 -8
  42. data/node_modules/govuk-frontend/govuk/components/select/macro-options.json +3 -3
  43. data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +2 -2
  44. data/node_modules/govuk-frontend/govuk/components/summary-list/macro-options.json +7 -7
  45. data/node_modules/govuk-frontend/govuk/components/tabs/macro-options.json +4 -4
  46. data/node_modules/govuk-frontend/govuk/components/textarea/macro-options.json +5 -5
  47. data/node_modules/govuk-frontend/govuk/helpers/_colour.scss +2 -2
  48. data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +22 -4
  49. data/node_modules/govuk-frontend/govuk/overrides/_all.scss +1 -0
  50. data/node_modules/govuk-frontend/govuk/overrides/_text-align.scss +20 -0
  51. data/node_modules/govuk-frontend/package.json +1 -1
  52. metadata +20 -16
@@ -0,0 +1,30 @@
1
+ .gem-c-single-page-notification-button__submit {
2
+ padding: govuk-spacing(2);
3
+ margin: govuk-spacing(0);
4
+ border: 1px solid $govuk-border-colour;
5
+ color: $govuk-link-colour;
6
+ cursor: pointer;
7
+ background: none;
8
+
9
+ &:focus {
10
+ @include govuk-focused-text;
11
+ background-color: $govuk-focus-colour;
12
+ border-color: transparent;
13
+ box-shadow: 0 $govuk-focus-width $govuk-text-colour;
14
+ }
15
+
16
+ &:hover {
17
+ background-color: govuk-colour("light-grey");
18
+ color: $govuk-link-hover-colour;
19
+
20
+ &:focus {
21
+ color: $govuk-text-colour;
22
+ }
23
+ }
24
+ }
25
+
26
+ .gem-c-single-page-notification-button__icon {
27
+ color: govuk-colour("black");
28
+ vertical-align: top;
29
+ margin-right: govuk-spacing(1);
30
+ }
@@ -1,3 +1,3 @@
1
- .gem-c-super-navigation-header a:after {
2
- content: " ( " attr(href) " ) ";
1
+ .gem-c-layout-super-navigation-header__content {
2
+ display: none;
3
3
  }
@@ -4,6 +4,23 @@ module GovukPublishingComponents
4
4
  "
5
5
  Links in the component must:
6
6
 
7
+ - accept focus
8
+ - be focusable with a keyboard
9
+ - be usable with a keyboard
10
+ - indicate when they have focus
11
+ - change in appearance when touched (in the touch-down state)
12
+ - change in appearance when hovered
13
+ - be usable with touch
14
+ - be usable with [voice commands](https://www.w3.org/WAI/perspectives/voice.html)
15
+ - have visible text
16
+ - have meaningful text
17
+ "
18
+ end
19
+
20
+ def self.button
21
+ "
22
+ Buttons in the component must:
23
+
7
24
  - accept focus
8
25
  - be focusable with a keyboard
9
26
  - be usable with a keyboard
@@ -18,7 +18,8 @@
18
18
  <header role="banner" class="gem-c-layout-super-navigation-header">
19
19
  <div class="gem-c-layout-super-navigation-header__container govuk-width-container govuk-clearfix">
20
20
  <div class="gem-c-layout-super-navigation-header__header-logo">
21
- <a class="govuk-header__link govuk-header__link--homepage"
21
+ <a
22
+ class="govuk-header__link govuk-header__link--homepage"
22
23
  data-module="gem-track-click"
23
24
  data-track-action="logoLink"
24
25
  data-track-category="headerClicked"
@@ -27,26 +28,30 @@
27
28
  data-track-dimension-index="29"
28
29
  href="<%= logo_link %>"
29
30
  id="logo"
30
- title="<%= logo_link_title %>">
31
+ title="<%= logo_link_title %>"
32
+ >
31
33
  <span class="govuk-header__logotype">
32
- <svg aria-hidden="true"
34
+ <!--[if gt IE 8]><!-->
35
+ <svg
36
+ aria-hidden="true"
33
37
  class="govuk-header__logotype-crown gem-c-layout-super-navigation-header__logotype-crown"
34
38
  focusable="false"
35
39
  height="30"
36
40
  viewBox="0 0 132 97"
41
+ width="36"
37
42
  xmlns="http://www.w3.org/2000/svg"
38
- width="36">
39
- <path fill="currentColor"
43
+ >
44
+ <path
45
+ 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.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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">
48
+ >
42
49
  </path>
43
- <image class="govuk-header__logotype-crown-fallback-image"
44
- height="30"
45
- src="<%= asset_path('govuk-logotype-crown.png') %>"
46
- width="36"
47
- xlink:href="">
48
- </image>
49
50
  </svg>
51
+ <!--<![endif]-->
52
+ <!--[if IE 8]>
53
+ <img src="<%= asset_path('govuk-logotype-crown.png') %>" alt="" class="govuk-header__logotype-crown-fallback-image" width="36" height="32">
54
+ <![endif]-->
50
55
  <span class="govuk-header__logotype-text">
51
56
  <%= logo_text %>
52
57
  </span>
@@ -75,7 +80,9 @@
75
80
  id="super-navigation-menu-toggle"
76
81
  type="button"
77
82
  >
78
- Menu
83
+ <span class="gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner">
84
+ Menu
85
+ </span>
79
86
  </button>
80
87
  <ul id="super-navigation-menu" class="gem-c-layout-super-navigation-header__navigation-items">
81
88
  <% navigation_links.each_with_index do | link, index | %>
@@ -89,34 +96,38 @@
89
96
  tracking_label = link[:label].downcase.gsub(/\s+/, "")
90
97
  %>
91
98
  <%= tag.li class: li_classes do %>
92
- <%= link_to link[:label], link[:href], {
93
- class: "gem-c-layout-super-navigation-header__navigation-item-link",
94
- data: {
95
- module: "gem-track-click",
96
- track_action: "#{tracking_label}Link",
97
- track_category: "headerClicked",
98
- track_label: link[:href],
99
- track_dimension: link[:label],
100
- track_dimension_index: "29",
101
- }
102
- } %>
99
+ <div class="gem-c-layout-super-navigation-header__navigation-toggle-wrapper govuk-clearfix">
100
+ <%= link_to link[:label], link[:href], {
101
+ class: "gem-c-layout-super-navigation-header__navigation-item-link",
102
+ data: {
103
+ module: "gem-track-click",
104
+ track_action: "#{tracking_label}Link",
105
+ track_category: "headerClicked",
106
+ track_label: link[:href],
107
+ track_dimension: link[:label],
108
+ track_dimension_index: "29",
109
+ }
110
+ } %>
111
+ <%= content_tag(:button, link[:label], {
112
+ aria: {
113
+ controls: "super-navigation-menu__section-#{unique_id}",
114
+ expanded: false,
115
+ label: show_menu_text,
116
+ },
117
+ class: "gem-c-layout-super-navigation-header__navigation-second-toggle-button",
118
+ data: {
119
+ text_for_hide: hide_menu_text,
120
+ text_for_show: show_menu_text,
121
+ toggle_desktop_group: "top",
122
+ toggle_mobile_group: "second",
123
+ tracking_key: tracking_label,
124
+ },
125
+ hidden: true,
126
+ id: "super-navigation-menu__section-#{unique_id}-toggle",
127
+ type: "button",
128
+ }) if has_children %>
129
+ </div>
103
130
  <% if has_children %>
104
- <button
105
- aria-controls="super-navigation-menu__section-<%= unique_id %>"
106
- aria-expanded="false"
107
- aria-label="<%= show_menu_text %>"
108
- class="gem-c-layout-super-navigation-header__navigation-second-toggle-button"
109
- data-text-for-hide="<%= hide_menu_text %>"
110
- data-text-for-show="<%= show_menu_text %>"
111
- data-toggle-desktop-group="top"
112
- data-toggle-mobile-group="second"
113
- data-tracking-key="<%= tracking_label %>"
114
- hidden
115
- id="super-navigation-menu__section-<%= unique_id %>-toggle"
116
- type="button"
117
- >
118
- <%= link[:label] %>
119
- </button>
120
131
  <div
121
132
  hidden
122
133
  class="gem-c-layout-super-navigation-header__navigation-dropdown-menu"
@@ -131,8 +142,8 @@
131
142
  </p>
132
143
  <% end %>
133
144
  </div>
134
- <% if link[:menu_contents].present? %>
135
- <div class="govuk-grid-column-two-thirds-from-desktop">
145
+ <div class="govuk-grid-column-two-thirds-from-desktop">
146
+ <% if link[:menu_contents].present? %>
136
147
  <ul class="govuk-list gem-c-layout-super-navigation-header__navigation-second-items gem-c-layout-super-navigation-header__navigation-second-items--<%= link[:label].parameterize %>">
137
148
  <% link[:menu_contents].each do | item | %>
138
149
  <%
@@ -152,43 +163,36 @@
152
163
  track_dimension_index: "29",
153
164
  }
154
165
  } %>
155
- <%= tag.p item[:description], class: "govuk-body govuk-!-margin-0" if has_description %>
166
+ <%= tag.p item[:description], class: "govuk-body govuk-!-margin-0 govuk-!-margin-top-1" if has_description %>
156
167
  </li>
157
168
  <% end %>
158
169
  </ul>
159
- </div>
160
- <% end %>
161
- </div>
162
- <% if link[:footer_links].present? %>
163
- <div class="govuk-grid-row">
164
- <div class="govuk-grid-column-full">
165
- <div class="gem-c-layout-super-navigation-header__navigation-second-footer">
166
- <div class="govuk-grid-row">
167
- <ul class="gem-c-layout-super-navigation-header__navigation-second-footer-list">
168
- <% link[:footer_links].each do | item | %>
169
- <li class="gem-c-layout-super-navigation-header__navigation-second-footer-item">
170
- <%= link_to item[:label], item[:href], {
171
- class: [
172
- "govuk-link",
173
- "gem-c-layout-super-navigation-header__navigation-second-footer-link",
174
- ],
175
- data: {
176
- module: "gem-track-click",
177
- track_action: "#{tracking_label}Link",
178
- track_category: "headerClicked",
179
- track_label: item[:href],
180
- track_dimension: item[:label],
181
- track_dimension_index: "29",
182
- }
183
- } %>
184
- </li>
185
- <% end %>
186
- </ul>
187
- </div>
188
- </div>
189
- </div>
170
+ <% end %>
171
+ <% if link[:footer_links].present? %>
172
+ <hr class="gem-c-layout-super-navigation-header__navigation-second-footer-break govuk-section-break govuk-section-break--visible">
173
+ <ul class="gem-c-layout-super-navigation-header__navigation-second-footer-list">
174
+ <% link[:footer_links].each do | item | %>
175
+ <li class="gem-c-layout-super-navigation-header__navigation-second-footer-item">
176
+ <%= link_to item[:label], item[:href], {
177
+ class: [
178
+ "govuk-link",
179
+ "gem-c-layout-super-navigation-header__navigation-second-footer-link",
180
+ ],
181
+ data: {
182
+ module: "gem-track-click",
183
+ track_action: "#{tracking_label}Link",
184
+ track_category: "headerClicked",
185
+ track_label: item[:href],
186
+ track_dimension: item[:label],
187
+ track_dimension_index: "29",
188
+ }
189
+ } %>
190
+ </li>
191
+ <% end %>
192
+ </ul>
193
+ <% end %>
190
194
  </div>
191
- <% end %>
195
+ </div>
192
196
  </div>
193
197
  </div>
194
198
  <% end %>
@@ -214,9 +218,17 @@
214
218
  <%= search_text %>
215
219
  </span>
216
220
  <%=
217
- render "govuk_publishing_components/components/search/search_icon",
218
- classes: %W[gem-c-layout-super-navigation-header__search-toggle-button-link-icon]
221
+ render "govuk_publishing_components/components/search/search_icon", {
222
+ classes: %w[gem-c-layout-super-navigation-header__search-toggle-button-link-icon],
223
+ }
219
224
  %>
225
+ <span
226
+ aria-hidden="true"
227
+ class="gem-c-layout-super-navigation-header__navigation-top-toggle-close-icon"
228
+ focusable="false"
229
+ >
230
+ &times;
231
+ </span>
220
232
  </button>
221
233
 
222
234
  <div id="super-search-menu" class="gem-c-layout-super-navigation-header__search-items">
@@ -243,14 +255,16 @@
243
255
  cy="10.0161"
244
256
  r="8.51613"
245
257
  stroke="currentColor"
246
- stroke-width="3" />
258
+ stroke-width="3"
259
+ />
247
260
  <line
248
261
  x1="15.8668"
249
262
  y1="16.3587"
250
263
  x2="25.4475"
251
264
  y2="25.9393"
252
265
  stroke="currentColor"
253
- stroke-width="3" />
266
+ stroke-width="3"
267
+ />
254
268
  </svg>
255
269
  </a>
256
270
  </div>
@@ -288,16 +302,20 @@
288
302
  <ul class="govuk-list">
289
303
  <% popular_links.each do | popular_link | %>
290
304
  <li class="gem-c-layout-super-navigation-header__popular-item">
291
- <a class="govuk-link gem-c-layout-super-navigation-header__popular-link"
292
- href="<%= popular_link[:href] %>"
293
- data-module="gem-track-click"
294
- data-track-action="popularLink"
295
- data-track-category="headerClicked"
296
- data-track-label="<%= popular_link[:href] %>"
297
- data-track-dimension="<%= popular_link[:label] %>"
298
- data-track-dimension-index="29">
299
- <%= popular_link[:label] %>
300
- </a>
305
+ <%= link_to popular_link[:label], popular_link[:href], {
306
+ class: [
307
+ "govuk-link",
308
+ "gem-c-layout-super-navigation-header__popular-link",
309
+ ],
310
+ data: {
311
+ module: "gem-track-click",
312
+ track_action: "popularLink",
313
+ track_category: "headerClicked",
314
+ track_label: popular_link[:href],
315
+ track_dimension: popular_link[:label],
316
+ track_dimension_index: "29",
317
+ }
318
+ } %>
301
319
  </li>
302
320
  <% end %>
303
321
  </ul>
@@ -0,0 +1,23 @@
1
+ <%
2
+ page ||= ''
3
+ data_attributes ||= {}
4
+ base_path ||= nil
5
+ local_assigns[:margin_bottom] ||= 3
6
+ already_subscribed ||= false
7
+ text ||= already_subscribed ? t('components.single_page_notification_button.unsubscribe_text') : t('components.single_page_notification_button.subscribe_text')
8
+
9
+ shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
10
+ wrapper_classes = %w(gem-c-single-page-notification-button govuk-!-display-none-print)
11
+ wrapper_classes << shared_helper.get_margin_bottom
12
+ classes = "govuk-body-s gem-c-single-page-notification-button__submit"
13
+ %>
14
+ <% button_text = capture do %>
15
+ <svg class="gem-c-single-page-notification-button__icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 459.334 459.334"><path fill="currentColor" d="M177.216 404.514c-.001.12-.009.239-.009.359 0 30.078 24.383 54.461 54.461 54.461s54.461-24.383 54.461-54.461c0-.12-.008-.239-.009-.359H175.216zM403.549 336.438l-49.015-72.002v-89.83c0-60.581-43.144-111.079-100.381-122.459V24.485C254.152 10.963 243.19 0 229.667 0s-24.485 10.963-24.485 24.485v27.663c-57.237 11.381-100.381 61.879-100.381 122.459v89.83l-49.015 72.002a24.76 24.76 0 0 0 20.468 38.693H383.08a24.761 24.761 0 0 0 20.469-38.694z"/></svg><%= text %>
16
+ <% end %>
17
+ <%= tag.form class: wrapper_classes, action: "/email/subscriptions/single-page/new", method: "POST", data: data_attributes do %>
18
+ <input type="hidden" name="base_path" value="<%= base_path %>">
19
+ <%= content_tag(:button, button_text, {
20
+ class: classes,
21
+ type: "submit",
22
+ }) %>
23
+ <% end if base_path.presence %>
@@ -16,12 +16,21 @@ accessibility_criteria: |
16
16
 
17
17
  * have a role of banner at the root of the component (<header>) (ARIA 1.1)
18
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
19
+ # The header element can not be top level in the examples.
20
+ - landmark-banner-is-top-level
21
+ # Banners will be duplicated in component examples list.
22
+ - duplicate-id
23
+ - duplicate-id-active
24
+ - duplicate-id-aria
25
+ - landmark-no-duplicate-banner
26
+ - landmark-unique
21
27
  examples:
22
28
  default:
23
29
  with_custom_logo_link:
24
- description: The header logo links to root by default. This option allows us to override that in certain instances. Remember to change the title, as the default is "Go to the GOV.UK homepage".
30
+ description: |
31
+ The header logo links to root by default. This option allows us to override that in certain instances.
32
+
33
+ Remember to update the title, as the default is "Go to the GOV.UK homepage".
25
34
  data:
26
35
  logo_link: "https://www.example.com"
27
36
  logo_link_title: "Go to example"
@@ -0,0 +1,32 @@
1
+ name: Single page notification button
2
+ description: A button that subscribes the user to email notifications to a page
3
+ body: |
4
+ By default, the component displays with the "Get emails about this page" state. The component does not render without the `base_path` parameter.
5
+
6
+ The `base_path` is necessary for [checking if an email subscription is active on page load](https://github.com/alphagov/account-api/blob/main/docs/api.md#get-apipersonalisationcheck-email-subscriptiontopic_slug) and the creation/deletion of an email notification subscription.
7
+
8
+ When the button is clicked, the `base_path` is submitted to an endpoint which proceeds to check the user's authentication status and whether they are already subscribed to the page or not. Depending on these factors, they will be routed accordingly.
9
+ accessibility_criteria: |
10
+ - The bell icon must be presentational and ignored by screen readers.
11
+ examples:
12
+ default:
13
+ description: By default this component prompts the user to subscribe to email notifications to this page.
14
+ data:
15
+ base_path: '/current-page-path'
16
+ already_subscribed:
17
+ description: If the user has already subscribed to email notifications about the current page, display the "Stop getting emails about this page" state.
18
+ data:
19
+ base_path: '/current-page-path'
20
+ already_subscribed: true
21
+ with_data_attributes:
22
+ description: The component accepts data attributes (for example, for analytics)
23
+ data:
24
+ base_path: '/current-page-path'
25
+ data_attributes:
26
+ category: fancyButtons
27
+ with_margin_bottom:
28
+ description: |
29
+ The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having a margin bottom of 15px.
30
+ data:
31
+ base_path: '/current-page-path'
32
+ margin_bottom: 5
@@ -13,15 +13,15 @@
13
13
  focusable="false"
14
14
  >
15
15
  <circle
16
- cx="10.0161"
17
- cy="10.0161"
16
+ cx="12.0161"
17
+ cy="11.0161"
18
18
  r="8.51613"
19
19
  stroke="currentColor"
20
20
  stroke-width="3" />
21
21
  <line
22
- x1="15.8668"
23
- y1="16.3587"
24
- x2="25.4475"
22
+ x1="17.8668"
23
+ y1="17.3587"
24
+ x2="26.4475"
25
25
  y2="25.9393"
26
26
  stroke="currentColor"
27
27
  stroke-width="3" />
@@ -157,13 +157,14 @@ en:
157
157
  href: "/browse/visas-immigration"
158
158
  - label: Working, jobs and pensions
159
159
  href: "/browse/working"
160
- - label: Departments
161
- href: "/government/organisations"
162
160
  - label: Government activity
163
161
  href: "/search/news-and-communications"
164
- description: Find out what the government is doing
162
+ description: Search for a department and find out what the government is doing
165
163
  menu_contents: # If adding or removing items, remember to update the
166
164
  # `columns` in the layout-super-navigation-header SCSS.
165
+ - label: Departments
166
+ href: "/government/organisations"
167
+ description: Departments, agencies and public bodies
167
168
  - label: News
168
169
  href: "/search/news-and-communications"
169
170
  description: News stories, speeches, letters and notices
@@ -257,6 +258,9 @@ en:
257
258
  hide_password: Hide password
258
259
  show: Show
259
260
  show_password: Show password
261
+ single_page_notification_button:
262
+ subscribe_text: Get emails about this page
263
+ unsubscribe_text: Stop getting emails about this page
260
264
  skip_link:
261
265
  text: Skip to main content
262
266
  step_by_step_nav:
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "27.10.2".freeze
2
+ VERSION = "27.11.0".freeze
3
3
  end
@@ -3,13 +3,13 @@
3
3
  "name": "id",
4
4
  "type": "string",
5
5
  "required": true,
6
- "description": "Must be **unique** across the domain of your service (as the expanded state of individual instances of the component persists across page loads using [`sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage)). Used as an `id` in the HTML for the accordion as a whole, and also as a prefix for the `id`s of the section contents and the buttons that open them, so that those `id`s can be the target of `aria-labelledby` and `aria-control` attributes."
6
+ "description": "Must be unique across the domain of your service (as the expanded state of individual instances of the component persists across page loads using [`sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage)). Used as an `id` in the HTML for the accordion as a whole, and also as a prefix for the `id`s of the section contents and the buttons that open them, so that those `id`s can be the target of `aria-labelledby` and `aria-control` attributes."
7
7
  },
8
8
  {
9
9
  "name": "headingLevel",
10
10
  "type": "integer",
11
11
  "required": false,
12
- "description": "Heading level, from 1 to 6. Default is `2`."
12
+ "description": "Heading level, from `1` to `6`. Default is `2`."
13
13
  },
14
14
  {
15
15
  "name": "classes",
@@ -3,19 +3,19 @@
3
3
  "name": "text",
4
4
  "type": "string",
5
5
  "required": false,
6
- "description": "Text to use within the back link component. If `html` is provided, the `text` argument will be ignored. Defaults to \"Back\"."
6
+ "description": "Text to use within the back link component. If `html` is provided, the `text` argument will be ignored. Defaults to 'Back'."
7
7
  },
8
8
  {
9
9
  "name": "html",
10
10
  "type": "string",
11
11
  "required": false,
12
- "description": "HTML to use within the back link component. If `html` is provided, the `text` argument will be ignored. Defaults to \"Back\"."
12
+ "description": "HTML to use within the back link component. If `html` is provided, the `text` argument will be ignored. Defaults to 'Back'."
13
13
  },
14
14
  {
15
15
  "name": "href",
16
16
  "type": "string",
17
17
  "required": true,
18
- "description": "The value of the link href attribute."
18
+ "description": "The value of the link's `href` attribute."
19
19
  },
20
20
  {
21
21
  "name": "classes",
@@ -158,10 +158,6 @@
158
158
  cursor: default;
159
159
  }
160
160
 
161
- &:focus {
162
- outline: none;
163
- }
164
-
165
161
  &:active {
166
162
  top: 0;
167
163
  box-shadow: 0 $button-shadow-size 0 $govuk-button-shadow-colour; // s0
@@ -270,6 +266,9 @@
270
266
  -webkit-align-self: center;
271
267
  -ms-flex-item-align: center;
272
268
  align-self: center;
269
+ // Work around SVGs not inheriting color from parent in forced color mode
270
+ // (https://github.com/w3c/csswg-drafts/issues/6310)
271
+ forced-color-adjust: auto;
273
272
  }
274
273
 
275
274
  @if $govuk-use-legacy-font {
@@ -37,6 +37,15 @@
37
37
  "html": "<a href=\"/\" role=\"button\" draggable=\"false\" class=\"govuk-button govuk-button--disabled\" data-module=\"govuk-button\">\n Disabled link button\n</a>",
38
38
  "hidden": false
39
39
  },
40
+ {
41
+ "name": "start",
42
+ "options": {
43
+ "text": "Start now button",
44
+ "isStartButton": true
45
+ },
46
+ "html": "<button class=\"govuk-button govuk-button--start\" data-module=\"govuk-button\">\n Start now button\n <svg class=\"govuk-button__start-icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"17.5\" height=\"19\" viewBox=\"0 0 33 40\" aria-hidden=\"true\" focusable=\"false\">\n <path fill=\"currentColor\" d=\"M0 0h13l20 20-20 20H0l20-20z\"/>\n </svg></button>",
47
+ "hidden": false
48
+ },
40
49
  {
41
50
  "name": "start link",
42
51
  "options": {
@@ -3,7 +3,7 @@
3
3
  "name": "id",
4
4
  "type": "string",
5
5
  "required": true,
6
- "description": "The id of the textarea."
6
+ "description": "The ID of the textarea."
7
7
  },
8
8
  {
9
9
  "name": "name",
@@ -66,13 +66,13 @@
66
66
  "name": "formGroup",
67
67
  "type": "object",
68
68
  "required": false,
69
- "description": "Options for the form-group wrapper",
69
+ "description": "Options for the form-group wrapper.",
70
70
  "params": [
71
71
  {
72
72
  "name": "classes",
73
73
  "type": "string",
74
74
  "required": false,
75
- "description": "Classes to add to the form group (for example to show error state for the whole group)"
75
+ "description": "Classes to add to the form group (for example to show error state for the whole group)."
76
76
  }
77
77
  ]
78
78
  },
@@ -92,19 +92,19 @@
92
92
  "name": "spellcheck",
93
93
  "type": "boolean",
94
94
  "required": false,
95
- "description": "Optional field to enable or disable the spellcheck attribute on the character count."
95
+ "description": "Optional field to enable or disable the `spellcheck` attribute on the character count."
96
96
  },
97
97
  {
98
98
  "name": "countMessage",
99
99
  "type": "object",
100
100
  "required": false,
101
- "description": "Options for the count message",
101
+ "description": "Options for the count message.",
102
102
  "params": [
103
103
  {
104
104
  "name": "classes",
105
105
  "type": "string",
106
106
  "required": false,
107
- "description": "Classes to add to the count message"
107
+ "description": "Classes to add to the count message."
108
108
  }
109
109
  ]
110
110
  }
@@ -127,6 +127,20 @@
127
127
  // Focused state
128
128
  .govuk-checkboxes__input:focus + .govuk-checkboxes__label:before {
129
129
  border-width: 4px;
130
+
131
+ // When colours are overridden, the yellow box-shadow becomes invisible
132
+ // which means the focus state is less obvious. By adding a transparent
133
+ // outline, which becomes solid (text-coloured) in that context, we ensure
134
+ // the focus remains clearly visible.
135
+ outline: $govuk-focus-width solid transparent;
136
+ outline-offset: 1px;
137
+
138
+ // When in an explicit forced-color mode, we can use the Highlight system
139
+ // color for the outline to better match focus states of native controls
140
+ @media screen and (forced-colors: active), (-ms-high-contrast: active) {
141
+ outline-color: Highlight;
142
+ }
143
+
130
144
  box-shadow: 0 0 0 $govuk-focus-width $govuk-focus-colour;
131
145
  }
132
146