govuk_publishing_components 27.8.0 → 27.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/google-analytics-universal-tracker.js +9 -0
  3. data/app/assets/javascripts/govuk_publishing_components/analytics/init.js +12 -8
  4. data/app/assets/javascripts/govuk_publishing_components/components/intervention.js +1 -0
  5. data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +20 -40
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +13 -10
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss +0 -12
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +434 -366
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +17 -10
  10. data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-super-navigation-header.scss +2 -2
  11. data/app/assets/stylesheets/govuk_publishing_components/components/print/_organisation-logo.scss +3 -0
  12. data/app/views/govuk_publishing_components/components/_intervention.html.erb +39 -26
  13. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +1 -4
  14. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +80 -74
  15. data/app/views/govuk_publishing_components/components/_search.html.erb +1 -0
  16. data/app/views/govuk_publishing_components/components/docs/intervention.yml +45 -6
  17. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +0 -8
  18. data/app/views/govuk_publishing_components/components/docs/layout_super_navigation_header.yml +12 -3
  19. data/app/views/govuk_publishing_components/components/docs/title.yml +0 -11
  20. data/app/views/govuk_publishing_components/components/layout_for_public/_account-layout.html.erb +1 -1
  21. data/app/views/govuk_publishing_components/components/layout_for_public/_account-navigation.html.erb +0 -9
  22. data/app/views/govuk_publishing_components/components/search/_search_icon.html.erb +28 -0
  23. data/config/locales/en.yml +3 -14
  24. data/lib/govuk_publishing_components/presenters/intervention_helper.rb +19 -0
  25. data/lib/govuk_publishing_components/version.rb +1 -1
  26. data/lib/govuk_publishing_components.rb +1 -0
  27. metadata +5 -3
  28. data/app/views/govuk_publishing_components/components/layout_for_public/_account-feedback-footer.html.erb +0 -18
@@ -85,6 +85,19 @@ $large-input-size: 50px;
85
85
  }
86
86
  }
87
87
 
88
+ @mixin icon-positioning($container-size) {
89
+ $icon-dimension: 20px;
90
+ $icon-position: ($container-size - $icon-dimension) / 2;
91
+
92
+ display: block;
93
+ pointer-events: none;
94
+ position: absolute;
95
+ height: $icon-dimension;
96
+ width: $icon-dimension;
97
+ top: $icon-position;
98
+ left: $icon-position;
99
+ }
100
+
88
101
  .gem-c-search__submit {
89
102
  border: 0;
90
103
  cursor: pointer;
@@ -93,15 +106,11 @@ $large-input-size: 50px;
93
106
  padding: 0;
94
107
  width: $input-size;
95
108
  height: $input-size;
96
- background-image: image-url("govuk_publishing_components/search-button.png");
97
- background-repeat: no-repeat;
98
- background-position: 2px 50%;
99
109
  text-indent: -5000px;
100
110
  overflow: hidden;
101
111
 
102
- @include govuk-device-pixel-ratio {
103
- background-size: 52.5px auto;
104
- background-position: 115% 50%;
112
+ .gem-c-search__icon {
113
+ @include icon-positioning($input-size);
105
114
  }
106
115
 
107
116
  &:focus {
@@ -222,11 +231,9 @@ $large-input-size: 50px;
222
231
  .gem-c-search__submit {
223
232
  width: $large-input-size;
224
233
  height: $large-input-size;
225
- background-position: 8px 50%;
226
234
 
227
- @include govuk-device-pixel-ratio {
228
- background-size: 60px auto;
229
- background-position: 160% 50%;
235
+ .gem-c-search__icon {
236
+ @include icon-positioning($large-input-size);
230
237
  }
231
238
  }
232
239
  }
@@ -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
  }
@@ -0,0 +1,3 @@
1
+ .gem-c-organisation-logo__image {
2
+ max-width: 100%;
3
+ }
@@ -1,33 +1,46 @@
1
1
  <%
2
+ dismiss_text ||= false
3
+ suggestion_link_text ||= false
4
+ suggestion_link_url ||= false
5
+ suggestion_text ||= nil
6
+
2
7
  data_attributes ||= {}
3
8
  data_attributes[:module] = 'intervention'
4
- %>
9
+ suggestion_data_attributes ||= {}
10
+ dismiss_data_attributes ||= {}
11
+
12
+ aria_attributes ||= {}
13
+ aria_attributes[:label] = 'Intervention'
5
14
 
6
- <%= tag.section class: "gem-c-intervention", role: "region", data: data_attributes do %>
7
- <h2 class="gem-c-intervention__title govuk-heading-s">
8
- <a class="govuk-link" href="/next-steps-for-your-business"
9
- data-module="gem-track-click"
10
- data-track-category="interventionBanner"
11
- data-track-action="interventionClicked"
12
- data-track-dimension="<%= t("components.intervention.title") %>"
13
- data-track-dimension-index="29"
14
- data-track-label="/next-steps-for-your-business">
15
- <%= t("components.intervention.title") %></a>
16
- </h2>
15
+ local_assigns[:query_string] ||= request.query_string
16
+
17
+ intervention_helper = GovukPublishingComponents::Presenters::InterventionHelper.new(local_assigns)
18
+ dismiss_href = intervention_helper.dismiss_link
19
+ %>
20
+ <% if suggestion_text or (suggestion_link_text and suggestion_link_text) %>
21
+ <%= tag.section class: "gem-c-intervention", role: "region", aria: aria_attributes, data: data_attributes do %>
22
+ <p class="govuk-body">
23
+ <%= tag.span suggestion_text, class: "gem-c-intervention__textwrapper" if suggestion_text %>
24
+ <% if suggestion_link_text and suggestion_link_url %>
25
+ <%= tag.a suggestion_link_text, class: "govuk-link gem-c-intervention__suggestion-link", href: suggestion_link_url, data: suggestion_data_attributes %>
17
26
 
18
- <p class="govuk-body">
19
- <%= t("components.intervention.description") %>
20
- </p>
27
+ <% end %>
28
+ </p>
21
29
 
22
- <p class="govuk-body">
23
- <a class="govuk-link" href="?hide-intervention=true"
24
- data-module="gem-track-click"
25
- data-track-category="interventionBanner"
26
- data-track-action="interventionDismissed"
27
- data-track-label="?hide-intervention=true"
28
- data-track-dimension="<%= t("components.intervention.dismiss_link_text") %>"
29
- data-track-dimension-index="29">
30
- <%= t("components.intervention.dismiss_link_text") %></a>
31
- <%= t("components.intervention.dismiss_post_link") %>
32
- </p>
30
+ <% if dismiss_text %>
31
+ <p class="govuk-body">
32
+ <%= tag.a class: "govuk-link gem-c-intervention__dismiss", href: dismiss_href, data: dismiss_data_attributes do %>
33
+ <svg class="gem-c-intervention__dismiss-icon"
34
+ width="19" height="19" viewBox="0 0 19 19"
35
+ aria-hidden="true"
36
+ fill="none" stroke="currentColor">
37
+ <path d="M0.499997 9.5C0.499997 4.52944 4.52944 0.499999 9.5 0.499999C14.4706 0.5 18.5 4.52944 18.5 9.5C18.5 14.4706 14.4706 18.5 9.5 18.5C4.52943 18.5 0.499997 14.4706 0.499997 9.5Z"/>
38
+ <path d="M13.3477 5.4209L9.67383 9.09473L6 5.4209"/>
39
+ <path d="M6 13.4209L9.67383 9.74707L13.3477 13.4209"/>
40
+ </svg>
41
+ <%= dismiss_text %>
42
+ <% end %>
43
+ </p>
44
+ <% end %>
45
+ <% end %>
33
46
  <% end %>
@@ -17,7 +17,6 @@
17
17
 
18
18
  show_account_layout ||= false
19
19
  account_nav_location ||= nil
20
- omit_account_feedback_footer ||= false
21
20
  omit_account_navigation ||= false
22
21
  omit_account_phase_banner ||= false
23
22
 
@@ -136,9 +135,7 @@
136
135
  </div>
137
136
  <% end %>
138
137
 
139
- <% if show_account_layout && !omit_account_feedback_footer %>
140
- <%= render "govuk_publishing_components/components/layout_for_public/account-feedback-footer" %>
141
- <% elsif !omit_feedback_form %>
138
+ <% unless omit_feedback_form %>
142
139
  <div class="govuk-width-container">
143
140
  <%= render "govuk_publishing_components/components/feedback" %>
144
141
  </div>
@@ -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.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3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.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>
@@ -76,6 +81,13 @@
76
81
  type="button"
77
82
  >
78
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;
90
+ </span>
79
91
  </button>
80
92
  <ul id="super-navigation-menu" class="gem-c-layout-super-navigation-header__navigation-items">
81
93
  <% navigation_links.each_with_index do | link, index | %>
@@ -89,34 +101,34 @@
89
101
  tracking_label = link[:label].downcase.gsub(/\s+/, "")
90
102
  %>
91
103
  <%= 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
- } %>
103
- <% 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>
104
+ <div class="gem-c-layout-super-navigation-header__navigation-toggle-wrapper govuk-clearfix">
105
+ <%= link_to link[:label], link[:href], {
106
+ class: "gem-c-layout-super-navigation-header__navigation-item-link",
107
+ data: {
108
+ module: "gem-track-click",
109
+ track_action: "#{tracking_label}Link",
110
+ track_category: "headerClicked",
111
+ track_label: link[:href],
112
+ track_dimension: link[:label],
113
+ track_dimension_index: "29",
114
+ }
115
+ } %>
116
+ <% if has_children %>
117
+ <button
118
+ aria-controls="super-navigation-menu__section-<%= unique_id %>"
119
+ aria-expanded="false"
120
+ aria-label="<%= show_menu_text %>"
121
+ class="gem-c-layout-super-navigation-header__navigation-second-toggle-button"
122
+ data-text-for-hide="<%= hide_menu_text %>"
123
+ data-text-for-show="<%= show_menu_text %>"
124
+ data-toggle-desktop-group="top"
125
+ data-toggle-mobile-group="second"
126
+ data-tracking-key="<%= tracking_label %>"
127
+ hidden
128
+ id="super-navigation-menu__section-<%= unique_id %>-toggle"
129
+ type="button"
130
+ ><%= link[:label] %></button>
131
+ </div>
120
132
  <div
121
133
  hidden
122
134
  class="gem-c-layout-super-navigation-header__navigation-dropdown-menu"
@@ -152,7 +164,7 @@
152
164
  track_dimension_index: "29",
153
165
  }
154
166
  } %>
155
- <%= tag.p item[:description], class: "govuk-body govuk-!-margin-0" if has_description %>
167
+ <%= tag.p item[:description], class: "govuk-body govuk-!-margin-0 govuk-!-margin-top-1" if has_description %>
156
168
  </li>
157
169
  <% end %>
158
170
  </ul>
@@ -213,30 +225,18 @@
213
225
  <span class="govuk-visually-hidden">
214
226
  <%= search_text %>
215
227
  </span>
216
- <svg
217
- class="gem-c-layout-super-navigation-header__search-toggle-button-link-icon"
218
- width="27"
219
- height="27"
220
- viewBox="0 0 27 27"
221
- fill="none"
222
- xmlns="http://www.w3.org/2000/svg"
228
+ <%=
229
+ render "govuk_publishing_components/components/search/search_icon", {
230
+ classes: %w[gem-c-layout-super-navigation-header__search-toggle-button-link-icon],
231
+ }
232
+ %>
233
+ <span
223
234
  aria-hidden="true"
235
+ class="gem-c-layout-super-navigation-header__navigation-top-toggle-close-icon"
224
236
  focusable="false"
225
237
  >
226
- <circle
227
- cx="10.0161"
228
- cy="10.0161"
229
- r="8.51613"
230
- stroke="currentColor"
231
- stroke-width="3" />
232
- <line
233
- x1="15.8668"
234
- y1="16.3587"
235
- x2="25.4475"
236
- y2="25.9393"
237
- stroke="currentColor"
238
- stroke-width="3" />
239
- </svg>
238
+ &times;
239
+ </span>
240
240
  </button>
241
241
 
242
242
  <div id="super-search-menu" class="gem-c-layout-super-navigation-header__search-items">
@@ -263,14 +263,16 @@
263
263
  cy="10.0161"
264
264
  r="8.51613"
265
265
  stroke="currentColor"
266
- stroke-width="3" />
266
+ stroke-width="3"
267
+ />
267
268
  <line
268
269
  x1="15.8668"
269
270
  y1="16.3587"
270
271
  x2="25.4475"
271
272
  y2="25.9393"
272
273
  stroke="currentColor"
273
- stroke-width="3" />
274
+ stroke-width="3"
275
+ />
274
276
  </svg>
275
277
  </a>
276
278
  </div>
@@ -308,16 +310,20 @@
308
310
  <ul class="govuk-list">
309
311
  <% popular_links.each do | popular_link | %>
310
312
  <li class="gem-c-layout-super-navigation-header__popular-item">
311
- <a class="govuk-link gem-c-layout-super-navigation-header__popular-link"
312
- href="<%= popular_link[:href] %>"
313
- data-module="gem-track-click"
314
- data-track-action="popularLink"
315
- data-track-category="headerClicked"
316
- data-track-label="<%= popular_link[:href] %>"
317
- data-track-dimension="<%= popular_link[:label] %>"
318
- data-track-dimension-index="29">
319
- <%= popular_link[:label] %>
320
- </a>
313
+ <%= link_to popular_link[:label], popular_link[:href], {
314
+ class: [
315
+ "govuk-link",
316
+ "gem-c-layout-super-navigation-header__popular-link",
317
+ ],
318
+ data: {
319
+ module: "gem-track-click",
320
+ track_action: "popularLink",
321
+ track_category: "headerClicked",
322
+ track_label: popular_link[:href],
323
+ track_dimension: popular_link[:label],
324
+ track_dimension_index: "29",
325
+ }
326
+ } %>
321
327
  </li>
322
328
  <% end %>
323
329
  </ul>
@@ -53,6 +53,7 @@
53
53
  <div class="gem-c-search__item gem-c-search__submit-wrapper">
54
54
  <%= tag.button class: "gem-c-search__submit", type: "submit", data: data_attributes do %>
55
55
  <%= button_text %>
56
+ <%= render "govuk_publishing_components/components/search/search_icon" %>
56
57
  <% end %>
57
58
  </div>
58
59
  </div>
@@ -6,19 +6,58 @@ body: |
6
6
  that would be useful to them. This component would be used to add this personalised content and would
7
7
  indicate to the user that this is not normally part of the page, but has been added for them specifically.
8
8
 
9
- Right now the contents of the component are static, as the MVP of personalised content is only for Start a Business.
10
- Since many pages will use this component with the same text, we hard-code it here for now.
9
+ The dismiss link points to the current URL with the "hide-intervention" query string parameter set to "true". The backend should check for this string in order to render the same page without the intervention.
11
10
 
12
- The dismiss link will reload the page but the `hide-intervention` query string parameter will cause the
13
- backed not to show the intervention again. Some progressive enhancement will be added in later to avoid
14
- reloading the page if JavaScript is available.
15
11
  accessibility_criteria: |
16
12
  The intervention component must:
17
13
 
18
14
  - have a border colour contrast ratio of more than 4.5:1 with its background to be visually distinct
15
+ - prevent screen readers from announcing the dismiss link icon
16
+
19
17
 
20
- - always render headings with associated description content, so there are no isolated heading elements inside the component
21
18
  shared_accessibility_criteria:
22
19
  - link
23
20
  examples:
24
21
  default:
22
+ data:
23
+ suggestion_text: "You should renew your permit every 6 months."
24
+
25
+ with_suggestion_link:
26
+ data:
27
+ suggestion_text: "Based on your browsing you might be interested in"
28
+ suggestion_link_text: "Travel abroad: step by step"
29
+ suggestion_link_url: "/travel-abroad"
30
+
31
+ with_dismiss_link:
32
+ data:
33
+ suggestion_text: "You should renew your permit every 6 months."
34
+ dismiss_text: "Hide this suggestion"
35
+
36
+ with_suggestion_link_only:
37
+ data:
38
+ suggestion_link_text: "You can now apply for a permit online."
39
+ suggestion_link_url: "/permit"
40
+
41
+ with_data_attributes:
42
+ description: |
43
+ This example shows the use of `suggestion_data_attributes` and
44
+ `dismiss_data_attributes` for click tracking.
45
+ data:
46
+ suggestion_text: "Based on your browsing you might be interested in"
47
+ suggestion_link_text: "Travel abroad: step by step"
48
+ suggestion_link_url: "/travel-abroad"
49
+ suggestion_data_attributes:
50
+ module: "gem-track-click"
51
+ track-category: "interventionBanner"
52
+ track-action: "interventionClicked"
53
+ track-dimension: "Travel abroad: step by step"
54
+ track-dimension-index: "29"
55
+ track-label: "clicked suggestion"
56
+ dismiss_text: "Hide this suggestion"
57
+ dismiss_data_attributes:
58
+ module: "gem-track-click"
59
+ track-category: "interventionBanner"
60
+ track-action: "interventionDismissed"
61
+ track-dimension: "Hide this suggestion"
62
+ track-dimension-index: "29"
63
+ track-label: "hid the intervention"
@@ -68,14 +68,6 @@ examples:
68
68
  block: |
69
69
  <h2 class="govuk-heading-l">This is a title</h2>
70
70
  <p class="govuk-body">This is some body text with <a href="https://example.com">a link</a>.
71
- with_account_layout_but_without_account_feedback_footer:
72
- description: The account layout renders with an account-specific feedback banner by default. This flag allows this banner to be omitted.
73
- data:
74
- show_account_layout: true
75
- omit_account_feedback_footer: true
76
- block: |
77
- <h2 class="govuk-heading-l">This is a title</h2>
78
- <p class="govuk-body">This is some body text with <a href="https://example.com">a link</a>.</p>
79
71
  with_current_account_navigation:
80
72
  description: "The account layout renders with an account-specific nav to help users navigate different areas of their account. This flag is here to allow control over which option in the nav is highlighted as `current`. Valid options are currently `your-account`, `manage`, and `security`."
81
73
  data:
@@ -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"
@@ -62,17 +62,6 @@ examples:
62
62
  margin_bottom: 0
63
63
  context:
64
64
  dark_background: true
65
- in_html_publication_with_context_link:
66
- description: Page titles are used in HTML Publications ([see example](https://www.gov.uk/government/publications/fees-for-civil-and-family-courts/court-fees-for-the-high-court-county-court-and-family-court))
67
- data:
68
- context:
69
- text: Publication
70
- href: '/link'
71
- title: HTML publication page title
72
- inverse: true
73
- margin_bottom: 0
74
- context:
75
- dark_background: true
76
65
  using_design_system_template:
77
66
  description: |
78
67
  This option allows the removal of top margin from the component so that it works within a [Design System page template](https://design-system.service.gov.uk/styles/page-template/default/index.html), where spacing above the title is already provided by padding on the wrapping div.
@@ -8,7 +8,7 @@
8
8
  <% end %>
9
9
 
10
10
  <%= render "govuk_publishing_components/components/phase_banner", {
11
- phase: "alpha",
11
+ phase: "beta",
12
12
  message: message
13
13
  } unless omit_account_phase_banner %>
14
14
 
@@ -19,14 +19,5 @@
19
19
  data: { module: "explicit-cross-domain-links" },
20
20
  ) %>
21
21
  </li>
22
- <li class="gem-c-layout-for-public-account-menu__item <%= "gem-c-layout-for-public-account-menu__item--current" if page_is == "security" %>">
23
- <%= link_to(
24
- t("components.layout_for_public.account_layout.navigation.menu_bar.security.link_text"),
25
- GovukPersonalisation::Urls.security,
26
- class: 'gem-c-layout-for-public-account-menu__link govuk-link govuk-link--no-visited-state',
27
- 'aria-current': page_is == "security" ? "page" : nil,
28
- data: { module: "explicit-cross-domain-links" },
29
- ) %>
30
- </li>
31
22
  </ul>
32
23
  </nav>
@@ -0,0 +1,28 @@
1
+ <%
2
+ classes ||= %w[gem-c-search__icon]
3
+ %>
4
+
5
+ <svg
6
+ class="<%= classes.join(" ") %>"
7
+ width="27"
8
+ height="27"
9
+ viewBox="0 0 27 27"
10
+ fill="none"
11
+ xmlns="http://www.w3.org/2000/svg"
12
+ aria-hidden="true"
13
+ focusable="false"
14
+ >
15
+ <circle
16
+ cx="10.0161"
17
+ cy="10.0161"
18
+ r="8.51613"
19
+ stroke="currentColor"
20
+ stroke-width="3" />
21
+ <line
22
+ x1="15.8668"
23
+ y1="16.3587"
24
+ x2="25.4475"
25
+ y2="25.9393"
26
+ stroke="currentColor"
27
+ stroke-width="3" />
28
+ </svg>
@@ -53,7 +53,7 @@ en:
53
53
  two_words: " and "
54
54
  type:
55
55
  consultation: Consultation for %{nation}
56
- detailed_guide: Guidance for %{nation}
56
+ detailed_guide: Guidance for %{nation}
57
57
  guidance: Guidance for %{nation}
58
58
  publication: Publication for %{nation}
59
59
  england: England
@@ -86,11 +86,6 @@ en:
86
86
  news_and_communications: News and communications
87
87
  statistics: Statistics
88
88
  worldwide: Worldwide
89
- intervention:
90
- title: Check the next steps for your limited company
91
- description: You might be interested in this because you’ve been browsing guidance relevant to starting a limited company.
92
- dismiss_link_text: Hide this suggestion
93
- dismiss_post_link: if it’s not relevant to you
94
89
  layout_footer:
95
90
  copyright_html: <a class="govuk-footer__link govuk-footer__copyright-logo" href="http://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/copyright-and-re-use/crown-copyright/">© Crown copyright</a>
96
91
  licence_html: All content is available under the <a class="govuk-footer__link" href="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/" rel="license">Open Government Licence v3.0</a>, except where otherwise stated
@@ -99,13 +94,9 @@ en:
99
94
  account_layout:
100
95
  feedback:
101
96
  banners:
102
- footer_intro: We’re trialling GOV.UK accounts.
103
- footer_link: Give feedback
104
- footer_outro: on your experience so we can make them better.
105
- phase_intro: We’re trialling GOV.UK accounts - your
97
+ phase_intro: This is a new service – your
106
98
  phase_link: feedback
107
- phase_outro: will help us improve them.
108
- title: Help improve GOV.UK accounts
99
+ phase_outro: will help us to improve it.
109
100
  navigation:
110
101
  destroy_user_session: Sign out
111
102
  menu_bar:
@@ -113,8 +104,6 @@ en:
113
104
  link_text: Your account
114
105
  manage:
115
106
  link_text: Manage your account
116
- security:
117
- link_text: Security and privacy
118
107
  user_root_path: Account
119
108
  layout_header:
120
109
  hide_button: Hide search
@@ -0,0 +1,19 @@
1
+ module GovukPublishingComponents
2
+ module Presenters
3
+ class InterventionHelper
4
+ attr_reader :query_string
5
+
6
+ def initialize(local_assigns)
7
+ @query_string = local_assigns[:query_string]
8
+ end
9
+
10
+ def dismiss_link
11
+ if @query_string.present?
12
+ "#{@query_string}&hide-intervention=true"
13
+ else
14
+ "?hide-intervention=true"
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end