govuk_publishing_components 27.10.4 → 27.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) 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/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +1 -1
  5. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +6 -4
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak.scss +0 -1
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +246 -113
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_single-page-notification-button.scss +30 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_margins.scss +2 -2
  11. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_prefixed-transform.scss +5 -0
  12. data/app/assets/stylesheets/govuk_publishing_components/govuk_frontend_support.scss +9 -0
  13. data/app/models/govuk_publishing_components/shared_accessibility_criteria.rb +17 -0
  14. data/app/views/govuk_publishing_components/components/_input.html.erb +35 -22
  15. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +31 -43
  16. data/app/views/govuk_publishing_components/components/_metadata.html.erb +2 -0
  17. data/app/views/govuk_publishing_components/components/_search.html.erb +2 -1
  18. data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb +23 -0
  19. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +4 -5
  20. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +0 -6
  21. data/app/views/govuk_publishing_components/components/docs/input.yml +10 -0
  22. data/app/views/govuk_publishing_components/components/docs/metadata.yml +7 -0
  23. data/app/views/govuk_publishing_components/components/docs/single_page_notification_button.yml +32 -0
  24. data/app/views/govuk_publishing_components/components/search/_search_icon.html.erb +5 -5
  25. data/config/locales/ar.yml +0 -3
  26. data/config/locales/az.yml +0 -3
  27. data/config/locales/be.yml +0 -3
  28. data/config/locales/bg.yml +0 -3
  29. data/config/locales/bn.yml +0 -3
  30. data/config/locales/cs.yml +0 -3
  31. data/config/locales/cy.yml +0 -3
  32. data/config/locales/da.yml +0 -3
  33. data/config/locales/de.yml +0 -3
  34. data/config/locales/dr.yml +0 -3
  35. data/config/locales/el.yml +0 -3
  36. data/config/locales/en.yml +8 -9
  37. data/config/locales/es-419.yml +0 -3
  38. data/config/locales/es.yml +0 -3
  39. data/config/locales/et.yml +0 -3
  40. data/config/locales/fa.yml +0 -3
  41. data/config/locales/fi.yml +0 -3
  42. data/config/locales/fr.yml +0 -3
  43. data/config/locales/gd.yml +0 -3
  44. data/config/locales/gu.yml +0 -3
  45. data/config/locales/he.yml +0 -3
  46. data/config/locales/hi.yml +0 -3
  47. data/config/locales/hr.yml +0 -3
  48. data/config/locales/hu.yml +0 -3
  49. data/config/locales/hy.yml +0 -3
  50. data/config/locales/id.yml +0 -3
  51. data/config/locales/is.yml +0 -3
  52. data/config/locales/it.yml +0 -3
  53. data/config/locales/ja.yml +0 -3
  54. data/config/locales/ka.yml +0 -3
  55. data/config/locales/kk.yml +0 -3
  56. data/config/locales/ko.yml +0 -3
  57. data/config/locales/lt.yml +0 -3
  58. data/config/locales/lv.yml +0 -3
  59. data/config/locales/ms.yml +0 -3
  60. data/config/locales/mt.yml +0 -3
  61. data/config/locales/nl.yml +0 -3
  62. data/config/locales/no.yml +0 -3
  63. data/config/locales/pa-pk.yml +0 -3
  64. data/config/locales/pa.yml +0 -3
  65. data/config/locales/pl.yml +0 -3
  66. data/config/locales/ps.yml +0 -3
  67. data/config/locales/pt.yml +0 -3
  68. data/config/locales/ro.yml +0 -3
  69. data/config/locales/ru.yml +0 -3
  70. data/config/locales/si.yml +0 -3
  71. data/config/locales/sk.yml +0 -3
  72. data/config/locales/sl.yml +0 -3
  73. data/config/locales/so.yml +0 -3
  74. data/config/locales/sq.yml +0 -3
  75. data/config/locales/sr.yml +0 -3
  76. data/config/locales/sv.yml +0 -3
  77. data/config/locales/sw.yml +0 -3
  78. data/config/locales/ta.yml +0 -3
  79. data/config/locales/th.yml +0 -3
  80. data/config/locales/tk.yml +0 -3
  81. data/config/locales/tr.yml +0 -3
  82. data/config/locales/uk.yml +0 -3
  83. data/config/locales/ur.yml +0 -3
  84. data/config/locales/uz.yml +0 -3
  85. data/config/locales/vi.yml +0 -3
  86. data/config/locales/zh-hk.yml +0 -3
  87. data/config/locales/zh-tw.yml +0 -3
  88. data/config/locales/zh.yml +0 -3
  89. data/lib/govuk_publishing_components/presenters/button_helper.rb +1 -0
  90. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +15 -4
  91. data/lib/govuk_publishing_components/version.rb +1 -1
  92. data/lib/govuk_publishing_components.rb +0 -1
  93. data/node_modules/govuk-frontend/govuk/components/accordion/macro-options.json +2 -2
  94. data/node_modules/govuk-frontend/govuk/components/back-link/macro-options.json +3 -3
  95. data/node_modules/govuk-frontend/govuk/components/button/_index.scss +3 -4
  96. data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +9 -0
  97. data/node_modules/govuk-frontend/govuk/components/character-count/macro-options.json +6 -6
  98. data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +14 -0
  99. data/node_modules/govuk-frontend/govuk/components/checkboxes/macro-options.json +8 -8
  100. data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro-options.json +1 -1
  101. data/node_modules/govuk-frontend/govuk/components/date-input/macro-options.json +5 -5
  102. data/node_modules/govuk-frontend/govuk/components/details/_index.scss +2 -1
  103. data/node_modules/govuk-frontend/govuk/components/details/macro-options.json +2 -2
  104. data/node_modules/govuk-frontend/govuk/components/error-message/macro-options.json +3 -3
  105. data/node_modules/govuk-frontend/govuk/components/fieldset/macro-options.json +1 -1
  106. data/node_modules/govuk-frontend/govuk/components/file-upload/_index.scss +1 -0
  107. data/node_modules/govuk-frontend/govuk/components/file-upload/macro-options.json +4 -4
  108. data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +3 -0
  109. data/node_modules/govuk-frontend/govuk/components/footer/macro-options.json +2 -2
  110. data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +6 -6
  111. data/node_modules/govuk-frontend/govuk/components/hint/macro-options.json +1 -1
  112. data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +7 -7
  113. data/node_modules/govuk-frontend/govuk/components/inset-text/macro-options.json +1 -1
  114. data/node_modules/govuk-frontend/govuk/components/label/macro-options.json +1 -1
  115. data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +13 -1
  116. data/node_modules/govuk-frontend/govuk/components/panel/macro-options.json +1 -1
  117. data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +14 -0
  118. data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +8 -8
  119. data/node_modules/govuk-frontend/govuk/components/select/macro-options.json +3 -3
  120. data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +2 -2
  121. data/node_modules/govuk-frontend/govuk/components/summary-list/macro-options.json +7 -7
  122. data/node_modules/govuk-frontend/govuk/components/tabs/macro-options.json +4 -4
  123. data/node_modules/govuk-frontend/govuk/components/textarea/macro-options.json +5 -5
  124. data/node_modules/govuk-frontend/govuk/helpers/_colour.scss +2 -2
  125. data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +22 -4
  126. data/node_modules/govuk-frontend/govuk/overrides/_all.scss +1 -0
  127. data/node_modules/govuk-frontend/govuk/overrides/_text-align.scss +20 -0
  128. data/node_modules/govuk-frontend/package.json +1 -1
  129. metadata +7 -18
  130. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_summary.scss +0 -27
  131. data/lib/govuk_publishing_components/presenters/brexit_cta_helper.rb +0 -33
@@ -0,0 +1,5 @@
1
+ @mixin prefixed-transform($translateY: 0, $rotate: 0, $scale: 1) {
2
+ -webkit-transform: translateY($translateY) rotate($rotate) scale($scale);
3
+ -ms-transform: translateY($translateY) rotate($rotate) scale($scale);
4
+ transform: translateY($translateY) rotate($rotate) scale($scale);
5
+ }
@@ -17,3 +17,12 @@ $gem-quiet-button-colour: govuk-colour("dark-grey", $legacy: "grey-1");
17
17
  $gem-quiet-button-hover-colour: darken($gem-quiet-button-colour, 5%);
18
18
 
19
19
  $gem-hover-dark-background: #dddcdb;
20
+
21
+ $govuk-colours-organisations: map-merge(
22
+ $govuk-colours-organisations,
23
+ (
24
+ "department-for-levelling-up-housing-and-communities": (
25
+ colour: #012169,
26
+ ),
27
+ )
28
+ );
@@ -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
@@ -1,13 +1,16 @@
1
1
  <%
2
2
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
3
3
 
4
- id ||= "input-#{SecureRandom.hex(4)}"
5
- value ||= nil
6
- type ||= "text"
7
- describedby ||= nil
4
+ autocomplete ||= nil
8
5
  controls ||= nil
9
6
  data ||= nil
10
- autocomplete ||= nil
7
+ describedby ||= nil
8
+ enterkeyhint ||= nil
9
+ id ||= "input-#{SecureRandom.hex(4)}"
10
+ type ||= "text"
11
+ value ||= nil
12
+ inputmode ||= nil
13
+ pattern ||= nil
11
14
 
12
15
  label ||= nil
13
16
  hint ||= nil
@@ -32,6 +35,7 @@
32
35
  css_classes << "govuk-input--error" if has_error
33
36
  css_classes << "govuk-input--width-#{width}" if [2, 3, 4, 5, 10, 20, 30].include?(width)
34
37
  css_classes << "gem-c-input--with-search-icon" if search_icon
38
+
35
39
  form_group_css_classes = %w(govuk-form-group)
36
40
  form_group_css_classes << "govuk-form-group--error" if has_error && !grouped
37
41
 
@@ -44,14 +48,21 @@
44
48
  aria_described_by = aria_described_by.join(" ")
45
49
  end
46
50
 
51
+ checked_enterkeyhint = enterkeyhint if [
52
+ "done",
53
+ "enter",
54
+ "go",
55
+ "next",
56
+ "previous",
57
+ "search",
58
+ "send",
59
+ ].include?(enterkeyhint)
60
+
47
61
  if type == "number"
48
62
  type = "text"
49
63
  inputmode = "numeric"
50
64
  pattern = "[0-9]*"
51
65
  end
52
-
53
- inputmode ||= nil
54
- pattern ||= nil
55
66
  %>
56
67
 
57
68
  <%= content_tag :div, class: form_group_css_classes do %>
@@ -87,24 +98,26 @@
87
98
  } %>
88
99
  <% end %>
89
100
 
90
- <% input_tag = tag.input name: name,
91
- value: value,
92
- class: css_classes,
93
- id: id,
94
- type: type,
95
- data: data,
101
+ <% input_tag = tag.input({
102
+ aria: {
103
+ describedby: aria_described_by,
104
+ controls: controls
105
+ },
96
106
  autocomplete: autocomplete,
97
- tabindex: tabindex,
98
107
  autofocus: autofocus,
99
- readonly: readonly,
100
- maxlength: maxlength,
108
+ class: css_classes,
109
+ data: data,
110
+ enterkeyhint: checked_enterkeyhint,
111
+ id: id,
101
112
  inputmode: inputmode,
113
+ maxlength: maxlength,
114
+ name: name,
102
115
  pattern: pattern,
103
- aria: {
104
- describedby: aria_described_by,
105
- controls: controls
106
- }
107
- %>
116
+ readonly: readonly,
117
+ tabindex: tabindex,
118
+ type: type,
119
+ value: value,
120
+ }) %>
108
121
 
109
122
  <% if prefix && suffix %>
110
123
  <%= tag.div class: "govuk-input__wrapper" do %>
@@ -80,13 +80,8 @@
80
80
  id="super-navigation-menu-toggle"
81
81
  type="button"
82
82
  >
83
- Menu
84
- <span
85
- aria-hidden="true"
86
- class="gem-c-layout-super-navigation-header__navigation-top-toggle-close-icon"
87
- focusable="false"
88
- >
89
- &times;
83
+ <span class="gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner">
84
+ Menu
90
85
  </span>
91
86
  </button>
92
87
  <ul id="super-navigation-menu" class="gem-c-layout-super-navigation-header__navigation-items">
@@ -138,7 +133,7 @@
138
133
  class="gem-c-layout-super-navigation-header__navigation-dropdown-menu"
139
134
  id="super-navigation-menu__section-<%= unique_id %>"
140
135
  >
141
- <div class="govuk-width-container">
136
+ <div class="govuk-width-container gem-c-layout-super-navigation-header__width-container">
142
137
  <div class="govuk-grid-row">
143
138
  <div class="govuk-grid-column-one-third-from-desktop">
144
139
  <% if link[:description].present? %>
@@ -147,8 +142,8 @@
147
142
  </p>
148
143
  <% end %>
149
144
  </div>
150
- <% if link[:menu_contents].present? %>
151
- <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? %>
152
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 %>">
153
148
  <% link[:menu_contents].each do | item | %>
154
149
  <%
@@ -168,43 +163,36 @@
168
163
  track_dimension_index: "29",
169
164
  }
170
165
  } %>
171
- <%= tag.p item[:description], class: "govuk-body govuk-!-margin-0 govuk-!-margin-top-1" if has_description %>
166
+ <%= tag.p item[:description], class: "gem-c-layout-super-navigation-header__navigation-second-item-description" if has_description %>
172
167
  </li>
173
168
  <% end %>
174
169
  </ul>
175
- </div>
176
- <% end %>
177
- </div>
178
- <% if link[:footer_links].present? %>
179
- <div class="govuk-grid-row">
180
- <div class="govuk-grid-column-full">
181
- <div class="gem-c-layout-super-navigation-header__navigation-second-footer">
182
- <div class="govuk-grid-row">
183
- <ul class="gem-c-layout-super-navigation-header__navigation-second-footer-list">
184
- <% link[:footer_links].each do | item | %>
185
- <li class="gem-c-layout-super-navigation-header__navigation-second-footer-item">
186
- <%= link_to item[:label], item[:href], {
187
- class: [
188
- "govuk-link",
189
- "gem-c-layout-super-navigation-header__navigation-second-footer-link",
190
- ],
191
- data: {
192
- module: "gem-track-click",
193
- track_action: "#{tracking_label}Link",
194
- track_category: "headerClicked",
195
- track_label: item[:href],
196
- track_dimension: item[:label],
197
- track_dimension_index: "29",
198
- }
199
- } %>
200
- </li>
201
- <% end %>
202
- </ul>
203
- </div>
204
- </div>
205
- </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 %>
206
194
  </div>
207
- <% end %>
195
+ </div>
208
196
  </div>
209
197
  </div>
210
198
  <% end %>
@@ -11,9 +11,11 @@
11
11
  direction_class = ""
12
12
  direction_class = " direction-#{direction}" if local_assigns.include?(:direction)
13
13
 
14
+ shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
14
15
  classes = %w(gem-c-metadata)
15
16
  classes << "direction-#{direction}" if local_assigns.include?(:direction)
16
17
  classes << "gem-c-metadata--inverse" if inverse
18
+ classes << shared_helper.get_margin_bottom if local_assigns[:margin_bottom]
17
19
  %>
18
20
  <%= content_tag :div, class: classes, data: { module: "gem-toggle" } do %>
19
21
  <dl data-module="gem-track-click">
@@ -43,6 +43,7 @@
43
43
  aria: {
44
44
  controls: aria_controls,
45
45
  },
46
+ enterkeyhint: "search",
46
47
  class: "gem-c-search__item gem-c-search__input js-class-toggle",
47
48
  id: id,
48
49
  name: name,
@@ -51,7 +52,7 @@
51
52
  value: value,
52
53
  ) %>
53
54
  <div class="gem-c-search__item gem-c-search__submit-wrapper">
54
- <%= tag.button class: "gem-c-search__submit", type: "submit", data: data_attributes do %>
55
+ <%= tag.button class: "gem-c-search__submit", type: "submit", data: data_attributes, enterkeyhint: "search" do %>
55
56
  <%= button_text %>
56
57
  <%= render "govuk_publishing_components/components/search/search_icon" %>
57
58
  <% end %>
@@ -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 %>
@@ -1,10 +1,9 @@
1
1
  <% shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns) %>
2
- <% cta_helper = GovukPublishingComponents::Presenters::BrexitCtaHelper.new(content_item) %>
3
2
  <%
4
- title = t(cta_helper.title_key)
5
- link_text = t(cta_helper.link_text_key)
6
- link_path = t(cta_helper.link_path_key)
7
- lang = shared_helper.t_locale(cta_helper.title_key)
3
+ title = t("components.related_navigation.transition.title")
4
+ link_text = t("components.related_navigation.transition.link_text")
5
+ link_path = t("components.related_navigation.transition.link_path")
6
+ lang = shared_helper.t_locale("components.related_navigation.transition.title")
8
7
  %>
9
8
 
10
9
  <% data_attributes = {
@@ -811,12 +811,6 @@ examples:
811
811
  <div class="place">
812
812
  <p>This is a place</p>
813
813
  </div>
814
- summary:
815
- data:
816
- block: |
817
- <div class="summary">
818
- <p>This is a summary</p>
819
- </div>
820
814
  buttons:
821
815
  data:
822
816
  block: |
@@ -170,3 +170,13 @@ examples:
170
170
  name: "lead-times"
171
171
  width: 10
172
172
  suffix: "days"
173
+ with_enterhintkey_attribute:
174
+ description: |
175
+ To help users with virtual keyboards this changes the "enter" key to be a word that's more descriptive of the action.
176
+
177
+ Must be one of `enter`, `done`, `go`, `next`, `previous`, `search`, or `send`. See the [list of values and descriptions on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint#values).
178
+ data:
179
+ label:
180
+ text: "Given name"
181
+ name: given-name
182
+ enterkeyhint: "next"
@@ -357,3 +357,10 @@ examples:
357
357
  Applies to: England, Scotland, and Wales (see detailed guidance for <a href="http://www.dardni.gov.uk/news-dard-pa022-a-13-new-procedure-for" rel="external">Northern Ireland</a>)
358
358
  context:
359
359
  dark_background: true
360
+ with_custom_margin_bottom:
361
+ description: |
362
+ 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 the `margin-bottom` values defined in the [responsive-bottom-margin mixin](https://github.com/alphagov/govuk_publishing_components/blob/master/app/assets/stylesheets/govuk_publishing_components/components/mixins/_margins.scss#L1)
363
+ data:
364
+ first_published: 14 June 2014
365
+ last_updated: 10 September 2015
366
+ margin_bottom: 2
@@ -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" />
@@ -166,9 +166,6 @@ ar:
166
166
  topical_events:
167
167
  topics:
168
168
  transition:
169
- hub_page_link_path:
170
- hub_page_link_text:
171
- hub_page_title:
172
169
  link_path:
173
170
  link_text:
174
171
  title:
@@ -166,9 +166,6 @@ az:
166
166
  topical_events:
167
167
  topics:
168
168
  transition:
169
- hub_page_link_path:
170
- hub_page_link_text:
171
- hub_page_title:
172
169
  link_path:
173
170
  link_text:
174
171
  title:
@@ -166,9 +166,6 @@ be:
166
166
  topical_events:
167
167
  topics:
168
168
  transition:
169
- hub_page_link_path:
170
- hub_page_link_text:
171
- hub_page_title:
172
169
  link_path:
173
170
  link_text:
174
171
  title:
@@ -166,9 +166,6 @@ bg:
166
166
  topical_events:
167
167
  topics:
168
168
  transition:
169
- hub_page_link_path:
170
- hub_page_link_text:
171
- hub_page_title:
172
169
  link_path:
173
170
  link_text:
174
171
  title:
@@ -166,9 +166,6 @@ bn:
166
166
  topical_events:
167
167
  topics:
168
168
  transition:
169
- hub_page_link_path:
170
- hub_page_link_text:
171
- hub_page_title:
172
169
  link_path:
173
170
  link_text:
174
171
  title:
@@ -166,9 +166,6 @@ cs:
166
166
  topical_events:
167
167
  topics:
168
168
  transition:
169
- hub_page_link_path:
170
- hub_page_link_text:
171
- hub_page_title:
172
169
  link_path:
173
170
  link_text:
174
171
  title:
@@ -166,9 +166,6 @@ cy:
166
166
  topical_events:
167
167
  topics: Archwilio’r pwnc
168
168
  transition:
169
- hub_page_link_path:
170
- hub_page_link_text:
171
- hub_page_title: Gwiriwr Brexit
172
169
  link_path: "/brexit.cy"
173
170
  link_text: Cael rhestr bersonol o gamau gweithredu
174
171
  title: Brexit
@@ -166,9 +166,6 @@ da:
166
166
  topical_events:
167
167
  topics:
168
168
  transition:
169
- hub_page_link_path:
170
- hub_page_link_text:
171
- hub_page_title:
172
169
  link_path:
173
170
  link_text:
174
171
  title:
@@ -166,9 +166,6 @@ de:
166
166
  topical_events:
167
167
  topics:
168
168
  transition:
169
- hub_page_link_path:
170
- hub_page_link_text:
171
- hub_page_title:
172
169
  link_path:
173
170
  link_text:
174
171
  title:
@@ -166,9 +166,6 @@ dr:
166
166
  topical_events:
167
167
  topics:
168
168
  transition:
169
- hub_page_link_path:
170
- hub_page_link_text:
171
- hub_page_title:
172
169
  link_path:
173
170
  link_text:
174
171
  title:
@@ -166,9 +166,6 @@ el:
166
166
  topical_events:
167
167
  topics:
168
168
  transition:
169
- hub_page_link_path:
170
- hub_page_link_text:
171
- hub_page_title:
172
169
  link_path:
173
170
  link_text:
174
171
  title:
@@ -125,8 +125,6 @@ en:
125
125
  href: "/browse/benefits"
126
126
  - label: Births, death, marriages and care
127
127
  href: "/browse/births-deaths-marriages"
128
- - label: Brexit
129
- href: "/brexit"
130
128
  - label: Business and self-employed
131
129
  href: "/browse/business"
132
130
  - label: Childcare and parenting
@@ -157,13 +155,14 @@ en:
157
155
  href: "/browse/visas-immigration"
158
156
  - label: Working, jobs and pensions
159
157
  href: "/browse/working"
160
- - label: Departments
161
- href: "/government/organisations"
162
158
  - label: Government activity
163
159
  href: "/search/news-and-communications"
164
- description: Find out what the government is doing
160
+ description: Search for a department and find out what the government is doing
165
161
  menu_contents: # If adding or removing items, remember to update the
166
162
  # `columns` in the layout-super-navigation-header SCSS.
163
+ - label: Departments
164
+ href: "/government/organisations"
165
+ description: Departments, agencies and public bodies
167
166
  - label: News
168
167
  href: "/search/news-and-communications"
169
168
  description: News stories, speeches, letters and notices
@@ -178,7 +177,7 @@ en:
178
177
  description: Consultations and strategy
179
178
  - label: Transparency
180
179
  href: "/search/transparency-and-freedom-of-information-releases"
181
- description: Government data, Freedom of Information releases and corporate reports
180
+ description: Data, Freedom of Information releases and corporate reports
182
181
  footer_links:
183
182
  - label: How government works
184
183
  href: "/government/how-government-works"
@@ -239,9 +238,6 @@ en:
239
238
  topical_events: Topical event
240
239
  topics: Explore the topic
241
240
  transition:
242
- hub_page_link_path: "/transition-check/questions"
243
- hub_page_link_text: Get a personalised list of actions
244
- hub_page_title: Brexit checker
245
241
  link_path: "/brexit"
246
242
  link_text: Check what you need to do
247
243
  title: Brexit
@@ -257,6 +253,9 @@ en:
257
253
  hide_password: Hide password
258
254
  show: Show
259
255
  show_password: Show password
256
+ single_page_notification_button:
257
+ subscribe_text: Get emails about this page
258
+ unsubscribe_text: Stop getting emails about this page
260
259
  skip_link:
261
260
  text: Skip to main content
262
261
  step_by_step_nav:
@@ -166,9 +166,6 @@ es-419:
166
166
  topical_events:
167
167
  topics:
168
168
  transition:
169
- hub_page_link_path:
170
- hub_page_link_text:
171
- hub_page_title:
172
169
  link_path:
173
170
  link_text:
174
171
  title:
@@ -166,9 +166,6 @@ es:
166
166
  topical_events:
167
167
  topics:
168
168
  transition:
169
- hub_page_link_path:
170
- hub_page_link_text:
171
- hub_page_title:
172
169
  link_path:
173
170
  link_text:
174
171
  title:
@@ -166,9 +166,6 @@ et:
166
166
  topical_events:
167
167
  topics:
168
168
  transition:
169
- hub_page_link_path:
170
- hub_page_link_text:
171
- hub_page_title:
172
169
  link_path:
173
170
  link_text:
174
171
  title:
@@ -166,9 +166,6 @@ fa:
166
166
  topical_events:
167
167
  topics:
168
168
  transition:
169
- hub_page_link_path:
170
- hub_page_link_text:
171
- hub_page_title:
172
169
  link_path:
173
170
  link_text:
174
171
  title:
@@ -166,9 +166,6 @@ fi:
166
166
  topical_events:
167
167
  topics:
168
168
  transition:
169
- hub_page_link_path:
170
- hub_page_link_text:
171
- hub_page_title:
172
169
  link_path:
173
170
  link_text:
174
171
  title: