govuk_publishing_components 27.8.1 → 27.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/components/intervention.js +1 -0
- data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +18 -40
- data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +13 -10
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss +0 -12
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +431 -363
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +17 -10
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-super-navigation-header.scss +2 -2
- data/app/views/govuk_publishing_components/components/_intervention.html.erb +39 -26
- data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +1 -4
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +80 -74
- data/app/views/govuk_publishing_components/components/_search.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/docs/intervention.yml +45 -6
- data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +0 -8
- data/app/views/govuk_publishing_components/components/docs/layout_super_navigation_header.yml +12 -3
- data/app/views/govuk_publishing_components/components/docs/title.yml +0 -11
- data/app/views/govuk_publishing_components/components/layout_for_public/_account-layout.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/layout_for_public/_account-navigation.html.erb +0 -9
- data/app/views/govuk_publishing_components/components/search/_search_icon.html.erb +28 -0
- data/config/locales/en.yml +3 -14
- data/lib/govuk_publishing_components/presenters/intervention_helper.rb +19 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/lib/govuk_publishing_components.rb +1 -0
- metadata +4 -3
- 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
|
-
|
103
|
-
|
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
|
-
|
228
|
-
|
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-
|
2
|
-
|
1
|
+
.gem-c-layout-super-navigation-header__content {
|
2
|
+
display: none;
|
3
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
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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
|
-
|
19
|
-
|
20
|
-
</p>
|
27
|
+
<% end %>
|
28
|
+
</p>
|
21
29
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
-
<%
|
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>
|
data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb
CHANGED
@@ -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
|
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
|
-
|
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
|
-
|
39
|
-
<path
|
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.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"
|
46
|
+
fill="currentColor"
|
40
47
|
fill-rule="evenodd"
|
41
|
-
|
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
|
+
×
|
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
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
</
|
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
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
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
|
-
|
227
|
-
|
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
|
+
×
|
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
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
data
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
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
|
-
|
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:
|
data/app/views/govuk_publishing_components/components/docs/layout_super_navigation_header.yml
CHANGED
@@ -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
|
-
|
20
|
-
- landmark-
|
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:
|
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.
|
data/app/views/govuk_publishing_components/components/layout_for_public/_account-navigation.html.erb
CHANGED
@@ -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>
|
data/config/locales/en.yml
CHANGED
@@ -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
|
-
|
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
|
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
|