govuk_publishing_components 43.1.0 → 43.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +2 -3
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js +8 -5
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/pii-remover.js +10 -3
- data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +7 -5
- data/app/assets/javascripts/govuk_publishing_components/lib/cookie-settings.js +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/component_support.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +19 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +0 -22
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +6 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_secondary-navigation.scss +94 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +7 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_advisory.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +9 -0
- data/app/assets/stylesheets/govuk_publishing_components/lib/_print_support.scss +27 -0
- data/app/views/govuk_publishing_components/components/_action_link.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_document_list.html.erb +3 -4
- data/app/views/govuk_publishing_components/components/_hint.html.erb +6 -7
- data/app/views/govuk_publishing_components/components/_password_input.html.erb +18 -4
- data/app/views/govuk_publishing_components/components/_search.html.erb +1 -2
- data/app/views/govuk_publishing_components/components/_secondary_navigation.html.erb +29 -0
- data/app/views/govuk_publishing_components/components/docs/document_list.yml +23 -0
- data/app/views/govuk_publishing_components/components/docs/hint.yml +1 -0
- data/app/views/govuk_publishing_components/components/docs/password_input.yml +16 -1
- data/app/views/govuk_publishing_components/components/docs/secondary_navigation.yml +28 -0
- data/app/views/govuk_publishing_components/components/govuk_logo/_govuk_logo.html.erb +1 -5
- data/app/views/govuk_publishing_components/components/layout_for_public/_header_logo.html.erb +1 -3
- data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +0 -1
- data/config/locales/ar.yml +4 -0
- data/config/locales/az.yml +4 -0
- data/config/locales/be.yml +4 -0
- data/config/locales/bg.yml +4 -0
- data/config/locales/bn.yml +4 -0
- data/config/locales/cs.yml +4 -0
- data/config/locales/cy.yml +4 -0
- data/config/locales/da.yml +4 -0
- data/config/locales/de.yml +4 -0
- data/config/locales/dr.yml +4 -0
- data/config/locales/el.yml +4 -0
- data/config/locales/en.yml +8 -4
- data/config/locales/es-419.yml +4 -0
- data/config/locales/es.yml +4 -0
- data/config/locales/et.yml +4 -0
- data/config/locales/fa.yml +4 -0
- data/config/locales/fi.yml +4 -0
- data/config/locales/fr.yml +4 -0
- data/config/locales/gd.yml +4 -0
- data/config/locales/gu.yml +4 -0
- data/config/locales/he.yml +4 -0
- data/config/locales/hi.yml +4 -0
- data/config/locales/hr.yml +4 -0
- data/config/locales/hu.yml +4 -0
- data/config/locales/hy.yml +4 -0
- data/config/locales/id.yml +4 -0
- data/config/locales/is.yml +4 -0
- data/config/locales/it.yml +4 -0
- data/config/locales/ja.yml +4 -0
- data/config/locales/ka.yml +4 -0
- data/config/locales/kk.yml +4 -0
- data/config/locales/ko.yml +4 -0
- data/config/locales/lt.yml +4 -0
- data/config/locales/lv.yml +4 -0
- data/config/locales/ms.yml +4 -0
- data/config/locales/mt.yml +4 -0
- data/config/locales/nl.yml +4 -0
- data/config/locales/no.yml +4 -0
- data/config/locales/pa-pk.yml +4 -0
- data/config/locales/pa.yml +4 -0
- data/config/locales/pl.yml +4 -0
- data/config/locales/ps.yml +4 -0
- data/config/locales/pt.yml +4 -0
- data/config/locales/ro.yml +4 -0
- data/config/locales/ru.yml +4 -0
- data/config/locales/si.yml +4 -0
- data/config/locales/sk.yml +4 -0
- data/config/locales/sl.yml +4 -0
- data/config/locales/so.yml +4 -0
- data/config/locales/sq.yml +4 -0
- data/config/locales/sr.yml +4 -0
- data/config/locales/sv.yml +4 -0
- data/config/locales/sw.yml +4 -0
- data/config/locales/ta.yml +4 -0
- data/config/locales/th.yml +4 -0
- data/config/locales/tk.yml +4 -0
- data/config/locales/tr.yml +4 -0
- data/config/locales/uk.yml +4 -0
- data/config/locales/ur.yml +4 -0
- data/config/locales/uz.yml +4 -0
- data/config/locales/vi.yml +4 -0
- data/config/locales/zh-hk.yml +4 -0
- data/config/locales/zh-tw.yml +4 -0
- data/config/locales/zh.yml +4 -0
- data/lib/govuk_publishing_components/presenters/meta_tags.rb +5 -5
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e4cae4dbe308c9a7d6c09b6af0e5a2bd8e336704c65b65b36db523740774350
|
4
|
+
data.tar.gz: 6783d9392096dc776ab89670f28348a037de4c4312648a3459e6c7d59ca93e82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06ca0b986701886935c7fa20f38e10c65719a7112b99a454a075924a013963d431f1915272140cbc97581ab08d7123de66fd2f1c9179cefe75155326e7d5a784
|
7
|
+
data.tar.gz: dba9a2166cbab782ce0dd4800716f142241ed81aa2afa0a1e5dff4f4f164273973fe62a642cce7c8ddd74ddb1b2c0e0de2e7bfd40a9e925a94b62ed0629c8354
|
@@ -295,7 +295,7 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
|
|
295
295
|
var PIIRemover = new window.GOVUK.analyticsGa4.PIIRemover()
|
296
296
|
searchTerm = searchTerm.replace(/\++|(%2B)+/gm, ' ') // Turn + characters or unicode + characters (%2B) into a space.
|
297
297
|
searchTerm = window.GOVUK.analyticsGa4.core.trackFunctions.removeLinesAndExtraSpaces(searchTerm)
|
298
|
-
searchTerm = PIIRemover.stripPIIWithOverride(searchTerm,
|
298
|
+
searchTerm = PIIRemover.stripPIIWithOverride(searchTerm, false, true)
|
299
299
|
searchTerm = searchTerm.toLowerCase()
|
300
300
|
return searchTerm
|
301
301
|
}
|
@@ -339,8 +339,7 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
|
|
339
339
|
var DEFAULT_LIST_TITLE = 'Smart answer results'
|
340
340
|
|
341
341
|
if (isSearchResult) {
|
342
|
-
|
343
|
-
var searchQuery = window.GOVUK.analyticsGa4.core.trackFunctions.standardiseSearchTerm(element.getAttribute('data-ga4-search-query')).substring(0, 100)
|
342
|
+
var searchQuery = window.GOVUK.analyticsGa4.core.trackFunctions.standardiseSearchTerm(element.getAttribute('data-ga4-search-query'))
|
344
343
|
var variant = element.getAttribute('data-ga4-ecommerce-variant')
|
345
344
|
DEFAULT_LIST_TITLE = 'Site search results'
|
346
345
|
}
|
@@ -11,6 +11,7 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics
|
|
11
11
|
|
12
12
|
init: function (referrer) {
|
13
13
|
if (window.dataLayer) {
|
14
|
+
this.stripDates = !this.getSearchTerm()
|
14
15
|
var data = {
|
15
16
|
event: 'page_view',
|
16
17
|
page_view: {
|
@@ -33,7 +34,7 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics
|
|
33
34
|
navigation_page_type: this.getMetaContent('navigation-page-type'),
|
34
35
|
navigation_list_type: this.getMetaContent('navigation-list-type'),
|
35
36
|
step_navs: this.getMetaContent('stepnavs'),
|
36
|
-
taxonomy_level1: this.getMetaContent('themes'),
|
37
|
+
taxonomy_level1: this.getMetaContent('taxonomy_level1') || this.getMetaContent('themes'),
|
37
38
|
taxonomy_main: this.getMetaContent('taxon-slug'),
|
38
39
|
taxonomy_main_id: this.getMetaContent('taxon-id'),
|
39
40
|
taxonomy_all: this.getMetaContent('taxon-slugs'),
|
@@ -48,8 +49,8 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics
|
|
48
49
|
publishing_government: this.removeHyphensAndDowncase(this.getMetaContent('publishing-government') || this.getMetaContent('ga4-publishing-government')),
|
49
50
|
political_status: this.getMetaContent('political-status') || this.getMetaContent('ga4-political-status'),
|
50
51
|
primary_publishing_organisation: this.getMetaContent('primary-publishing-organisation'),
|
51
|
-
organisations: this.getMetaContent('analytics:organisations'),
|
52
|
-
world_locations: this.getMetaContent('analytics:world-locations'),
|
52
|
+
organisations: this.getMetaContent('organisations') || this.getMetaContent('analytics:organisations'),
|
53
|
+
world_locations: this.getMetaContent('world-locations') || this.getMetaContent('analytics:world-locations'),
|
53
54
|
|
54
55
|
/* The existence of a referrer parameter indicates that the page has been dynamically updated via an AJAX request
|
55
56
|
and therefore we can use it to set the dynamic property appropriately. This value is used by PA's to differentiate
|
@@ -78,7 +79,8 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics
|
|
78
79
|
},
|
79
80
|
|
80
81
|
getLocation: function () {
|
81
|
-
|
82
|
+
// We don't want to remove dates on search pages.
|
83
|
+
return this.PIIRemover.stripPIIWithOverride(this.stripGaParam(document.location.href), this.stripDates, true)
|
82
84
|
},
|
83
85
|
|
84
86
|
getSearchTerm: function () {
|
@@ -110,8 +112,9 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics
|
|
110
112
|
getQueryString: function () {
|
111
113
|
var queryString = window.GOVUK.analyticsGa4.core.trackFunctions.getSearch()
|
112
114
|
if (queryString) {
|
115
|
+
// We don't want to remove dates on search pages.
|
113
116
|
queryString = this.stripGaParam(queryString)
|
114
|
-
queryString = this.PIIRemover.stripPIIWithOverride(queryString,
|
117
|
+
queryString = this.PIIRemover.stripPIIWithOverride(queryString, this.stripDates, true)
|
115
118
|
queryString = queryString.substring(1) // removes the '?' character from the start.
|
116
119
|
return queryString
|
117
120
|
}
|
@@ -27,18 +27,23 @@
|
|
27
27
|
var UNLOCK_TOKEN_PATTERN = /unlock_token=[a-zA-Z0-9-]+/g
|
28
28
|
var STATE_PATTERN = /state=.[^&]+/g
|
29
29
|
|
30
|
+
// some users mistakenly use GOV.UK to search for the status of their applications.
|
31
|
+
// e.g. GWF123456789 and GB123456789000
|
32
|
+
var VISA_PATTERN_GWF = /GWF\d{9}/g
|
33
|
+
var VISA_PATTERN_GB = /GB\d{12}/g
|
34
|
+
|
30
35
|
function shouldStripDates () {
|
31
|
-
var metas = document.querySelectorAll('meta[name="govuk:
|
36
|
+
var metas = document.querySelectorAll('meta[name="govuk:ga4-strip-dates"]')
|
32
37
|
return metas.length > 0
|
33
38
|
}
|
34
39
|
|
35
40
|
function shouldStripPostcodes () {
|
36
|
-
var metas = document.querySelectorAll('meta[name="govuk:
|
41
|
+
var metas = document.querySelectorAll('meta[name="govuk:ga4-strip-postcodes"]')
|
37
42
|
return metas.length > 0
|
38
43
|
}
|
39
44
|
|
40
45
|
function queryStringParametersToStrip () {
|
41
|
-
var meta = document.querySelector('meta[name="govuk:
|
46
|
+
var meta = document.querySelector('meta[name="govuk:ga4-strip-query-string-parameters"]')
|
42
47
|
var value = false
|
43
48
|
if (meta) {
|
44
49
|
value = meta.getAttribute('content')
|
@@ -97,6 +102,8 @@
|
|
97
102
|
stripped = stripped.replace(RESET_PASSWORD_TOKEN_PATTERN, 'reset_password_token=[reset_password_token]')
|
98
103
|
stripped = stripped.replace(UNLOCK_TOKEN_PATTERN, 'unlock_token=[unlock_token]')
|
99
104
|
stripped = stripped.replace(STATE_PATTERN, 'state=[state]')
|
105
|
+
stripped = stripped.replace(VISA_PATTERN_GWF, '[gwf number]')
|
106
|
+
stripped = stripped.replace(VISA_PATTERN_GB, '[gb eori number]')
|
100
107
|
stripped = this.stripQueryStringParameters(stripped)
|
101
108
|
|
102
109
|
if (this.stripDatePII === true) {
|
@@ -202,12 +202,14 @@
|
|
202
202
|
|
203
203
|
window.GOVUK.deleteCookie = function (cookie) {
|
204
204
|
window.GOVUK.cookie(cookie, null)
|
205
|
+
window.GOVUK.expireCookie(cookie)
|
206
|
+
}
|
205
207
|
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
208
|
+
window.GOVUK.expireCookie = function (cookie, value = '') {
|
209
|
+
// We need to handle deleting cookies on the domain and the .domain
|
210
|
+
var thePast = new Date(0) // 0 = 0 seconds since UTC started (1970/01/01)
|
211
|
+
document.cookie = cookie + '=' + value + ';expires=' + thePast + ';'
|
212
|
+
document.cookie = cookie + '=' + value + ';expires=' + thePast + ';domain=' + window.location.hostname + ';path=/'
|
211
213
|
}
|
212
214
|
|
213
215
|
window.GOVUK.deleteUnconsentedCookies = function () {
|
@@ -107,7 +107,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
107
107
|
try {
|
108
108
|
documentReferrer = document.referrer || new URL(document.referrer).pathname
|
109
109
|
} catch (e) {
|
110
|
-
console.
|
110
|
+
console.warn('Error grabbing referrer for cookie settings', window.location, e)
|
111
111
|
}
|
112
112
|
return documentReferrer
|
113
113
|
}
|
@@ -67,6 +67,7 @@
|
|
67
67
|
@import "components/related-navigation";
|
68
68
|
@import "components/reorderable-list";
|
69
69
|
@import "components/search";
|
70
|
+
@import "components/secondary-navigation";
|
70
71
|
@import "components/select";
|
71
72
|
@import "components/share-links";
|
72
73
|
@import "components/signup-link";
|
@@ -178,3 +178,22 @@
|
|
178
178
|
}
|
179
179
|
}
|
180
180
|
}
|
181
|
+
|
182
|
+
@include govuk-media-query($media-type: print) {
|
183
|
+
.gem-c-action-link {
|
184
|
+
* {
|
185
|
+
color: $govuk-print-text-colour !important; // stylelint-disable-line declaration-no-important
|
186
|
+
}
|
187
|
+
|
188
|
+
&::before {
|
189
|
+
display: none;
|
190
|
+
}
|
191
|
+
|
192
|
+
.gem-c-action-link__link {
|
193
|
+
&::after {
|
194
|
+
display: block;
|
195
|
+
font-size: 12pt;
|
196
|
+
}
|
197
|
+
}
|
198
|
+
}
|
199
|
+
}
|
@@ -23,14 +23,6 @@
|
|
23
23
|
@include govuk-font($size: 19, $weight: bold);
|
24
24
|
}
|
25
25
|
|
26
|
-
.gem-c-document-list--no-underline {
|
27
|
-
.gem-c-document-list__item-title {
|
28
|
-
.govuk-link {
|
29
|
-
text-decoration: none;
|
30
|
-
}
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
26
|
.gem-c-document-list--no-top-border {
|
35
27
|
.gem-c-document-list__item {
|
36
28
|
border-top: none;
|
@@ -160,20 +152,6 @@
|
|
160
152
|
}
|
161
153
|
}
|
162
154
|
|
163
|
-
.gem-c-document-list-child__link {
|
164
|
-
text-decoration: none;
|
165
|
-
|
166
|
-
&:hover {
|
167
|
-
text-decoration: underline;
|
168
|
-
text-underline-offset: .1em;
|
169
|
-
@include govuk-link-hover-decoration;
|
170
|
-
}
|
171
|
-
|
172
|
-
&:focus {
|
173
|
-
text-decoration: none;
|
174
|
-
}
|
175
|
-
}
|
176
|
-
|
177
155
|
.gem-c-document-list-child__description {
|
178
156
|
margin-top: govuk-spacing(1);
|
179
157
|
margin-bottom: govuk-spacing(1);
|
@@ -290,6 +290,8 @@ $after-button-padding-left: govuk-spacing(4);
|
|
290
290
|
// after it has been toggled closed if the blue background has
|
291
291
|
// been enabled
|
292
292
|
.gem-c-layout-super-navigation-header__navigation-top-toggle-button.gem-c-layout-super-navigation-header__navigation-top-toggle-button--blue-background {
|
293
|
+
background-color: $govuk-brand-colour;
|
294
|
+
|
293
295
|
&:focus:not(:focus-visible) {
|
294
296
|
&::after {
|
295
297
|
background: none;
|
@@ -606,6 +608,10 @@ $after-button-padding-left: govuk-spacing(4);
|
|
606
608
|
// Styles for search toggle button.
|
607
609
|
.gem-c-layout-super-navigation-header__search-toggle-button {
|
608
610
|
background: none;
|
611
|
+
|
612
|
+
&.gem-c-layout-super-navigation-header__search-toggle-button--blue-background {
|
613
|
+
background: $govuk-brand-colour;
|
614
|
+
}
|
609
615
|
border: 0;
|
610
616
|
color: govuk-colour("white");
|
611
617
|
cursor: pointer;
|
@@ -31,7 +31,6 @@ $large-input-size: 50px;
|
|
31
31
|
display: block;
|
32
32
|
color: $govuk-text-colour;
|
33
33
|
cursor: text;
|
34
|
-
max-width: 68%;
|
35
34
|
text-overflow: ellipsis;
|
36
35
|
height: 90%;
|
37
36
|
overflow: hidden;
|
@@ -48,6 +47,7 @@ $large-input-size: 50px;
|
|
48
47
|
left: 2px;
|
49
48
|
top: 2px;
|
50
49
|
bottom: 2px;
|
50
|
+
max-width: 68%;
|
51
51
|
padding-left: govuk-spacing(3);
|
52
52
|
z-index: 1;
|
53
53
|
color: $govuk-secondary-text-colour;
|
@@ -229,7 +229,7 @@ $large-input-size: 50px;
|
|
229
229
|
}
|
230
230
|
}
|
231
231
|
|
232
|
-
.gem-c-search__label--white {
|
232
|
+
.govuk-label.gem-c-search__label--white {
|
233
233
|
color: govuk-colour("white");
|
234
234
|
}
|
235
235
|
|
@@ -0,0 +1,94 @@
|
|
1
|
+
@import "govuk_publishing_components/individual_component_support";
|
2
|
+
|
3
|
+
.gem-c-secondary-navigation {
|
4
|
+
@include govuk-font(19);
|
5
|
+
@include govuk-responsive-margin(6, "bottom");
|
6
|
+
|
7
|
+
@include govuk-media-query($from: tablet) {
|
8
|
+
box-shadow: inset 0 -1px 0 $govuk-border-colour;
|
9
|
+
display: flex;
|
10
|
+
}
|
11
|
+
}
|
12
|
+
|
13
|
+
.gem-c-secondary-navigation__list {
|
14
|
+
list-style: none;
|
15
|
+
margin-bottom: govuk-spacing(4);
|
16
|
+
padding: 0;
|
17
|
+
|
18
|
+
@include govuk-media-query($from: tablet) {
|
19
|
+
box-shadow: none;
|
20
|
+
display: flex;
|
21
|
+
margin: 0;
|
22
|
+
white-space: nowrap;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
.gem-c-secondary-navigation__list-item {
|
27
|
+
box-shadow: inset 0 -1px 0 $govuk-border-colour;
|
28
|
+
|
29
|
+
@include govuk-media-query($from: tablet) {
|
30
|
+
display: flex;
|
31
|
+
margin-right: 20px;
|
32
|
+
|
33
|
+
&:last-child {
|
34
|
+
margin-right: 0;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
&:last-child {
|
39
|
+
box-shadow: none;
|
40
|
+
}
|
41
|
+
|
42
|
+
.gem-c-secondary-navigation__list-item-link,
|
43
|
+
.gem-c-secondary-navigation__list-item-link:link,
|
44
|
+
.gem-c-secondary-navigation__list-item-link:visited {
|
45
|
+
background-color: inherit;
|
46
|
+
border-left: 4px solid transparent;
|
47
|
+
color: govuk-colour("blue");
|
48
|
+
display: block;
|
49
|
+
padding: govuk-spacing(2);
|
50
|
+
text-decoration: none;
|
51
|
+
|
52
|
+
@include govuk-media-query($from: tablet) {
|
53
|
+
border-bottom: 4px solid transparent;
|
54
|
+
border-left: 0;
|
55
|
+
padding: govuk-spacing(2) 0;
|
56
|
+
padding-bottom: govuk-spacing(2) - 4px; // Compensate for 4px border
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
.gem-c-secondary-navigation__list-item-link:hover {
|
61
|
+
color: $govuk-link-hover-colour;
|
62
|
+
}
|
63
|
+
|
64
|
+
.gem-c-secondary-navigation__list-item-link:focus {
|
65
|
+
@include govuk-focused-text;
|
66
|
+
|
67
|
+
border-color: $govuk-focus-text-colour;
|
68
|
+
border-left-color: transparent;
|
69
|
+
position: relative;
|
70
|
+
|
71
|
+
@include govuk-media-query($from: tablet) {
|
72
|
+
box-shadow: none;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
.gem-c-secondary-navigation__list-item--current {
|
78
|
+
.gem-c-secondary-navigation__list-item-link:link,
|
79
|
+
.gem-c-secondary-navigation__list-item-link:visited {
|
80
|
+
border-color: govuk-colour("blue");
|
81
|
+
color: $govuk-text-colour;
|
82
|
+
}
|
83
|
+
|
84
|
+
.gem-c-secondary-navigation__list-item-link:focus {
|
85
|
+
@include govuk-focused-text;
|
86
|
+
|
87
|
+
border-color: $govuk-focus-text-colour;
|
88
|
+
border-left-color: transparent;
|
89
|
+
|
90
|
+
@include govuk-media-query($from: tablet) {
|
91
|
+
box-shadow: none;
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}
|
@@ -128,6 +128,13 @@ $table-row-even-background-colour: govuk-colour("light-grey");
|
|
128
128
|
|
129
129
|
// stylelint-disable declaration-no-important
|
130
130
|
@include govuk-media-query($media-type: print) {
|
131
|
+
.govuk-table,
|
132
|
+
.gem-c-table {
|
133
|
+
a::after {
|
134
|
+
display: none !important;
|
135
|
+
}
|
136
|
+
}
|
137
|
+
|
131
138
|
.govuk-table--sortable {
|
132
139
|
outline: none;
|
133
140
|
|
@@ -10,7 +10,7 @@ $high-alert-border: #cc0000;
|
|
10
10
|
background-position: 98% center;
|
11
11
|
background-color: $info-background;
|
12
12
|
line-height: 1.3em;
|
13
|
-
margin: 0
|
13
|
+
margin: 0 0 1em;
|
14
14
|
padding: govuk-spacing(3) govuk-spacing(8) govuk-spacing(3) govuk-spacing(3);
|
15
15
|
text-align: left;
|
16
16
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
// A helper class for removing column layouts when printing.
|
2
|
+
// This should be applied to row/column layouts, by adding the
|
3
|
+
// class to elements with a `govuk-grid-row` class. The columns
|
4
|
+
// will then print at the full width of the page.
|
5
|
+
// Note that only the immediate child columns will be affected.
|
6
|
+
// If a child column also contains a row/column layout of
|
7
|
+
// further elements, these will be unaffected and will retain
|
8
|
+
// their existing column layout. Use the class again on these
|
9
|
+
// nested grids to apply fullwidth column printing if required.
|
10
|
+
|
11
|
+
@include govuk-media-query($media-type: print) {
|
12
|
+
.gem-print-columns-none {
|
13
|
+
width: 100%;
|
14
|
+
|
15
|
+
> .govuk-width-container {
|
16
|
+
margin: 0;
|
17
|
+
max-width: none;
|
18
|
+
}
|
19
|
+
|
20
|
+
> [class*="govuk-grid-column"] {
|
21
|
+
position: static !important; // stylelint-disable-line declaration-no-important
|
22
|
+
float: none;
|
23
|
+
clear: both;
|
24
|
+
width: 100%;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -17,7 +17,7 @@
|
|
17
17
|
dark_large_icon ||= false
|
18
18
|
light_icon ||= false
|
19
19
|
|
20
|
-
css_classes = %w(gem-c-action-link
|
20
|
+
css_classes = %w(gem-c-action-link)
|
21
21
|
css_classes << "gem-c-action-link--light-text" if light_text
|
22
22
|
css_classes << "gem-c-action-link--dark-icon" if dark_icon
|
23
23
|
css_classes << "gem-c-action-link--dark-large-icon" if dark_large_icon
|
@@ -7,12 +7,11 @@
|
|
7
7
|
|
8
8
|
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
9
9
|
component_helper.add_class("gem-c-document-list")
|
10
|
-
component_helper.add_class("gem-c-document-list--no-underline") if local_assigns[:remove_underline]
|
11
10
|
component_helper.add_class("gem-c-document-list--no-top-border") if local_assigns[:remove_top_border]
|
12
11
|
component_helper.add_class("gem-c-document-list--no-top-border-first-child") if local_assigns[:remove_top_border_from_first_child]
|
13
12
|
component_helper.add_class(shared_helper.get_margin_bottom)
|
14
13
|
|
15
|
-
|
14
|
+
extra_link_classes = "govuk-link--no-underline" if local_assigns[:remove_underline]
|
16
15
|
title_with_context_class = " gem-c-document-list__item-title--context"
|
17
16
|
|
18
17
|
brand ||= false
|
@@ -57,7 +56,7 @@
|
|
57
56
|
item[:link][:text],
|
58
57
|
item[:link][:path],
|
59
58
|
data: item[:link][:data_attributes],
|
60
|
-
class: "#{item_classes} govuk-link",
|
59
|
+
class: "#{item_classes} govuk-link #{extra_link_classes}",
|
61
60
|
lang: item[:link][:locale].presence,
|
62
61
|
rel: rel,
|
63
62
|
)
|
@@ -118,7 +117,7 @@
|
|
118
117
|
part[:link][:text],
|
119
118
|
part[:link][:path],
|
120
119
|
data: part[:link][:data_attributes],
|
121
|
-
class: "gem-c-document-list-child__heading #{brand_helper.color_class} govuk-link
|
120
|
+
class: "gem-c-document-list-child__heading gem-c-document-list-child__link #{brand_helper.color_class} govuk-link #{extra_link_classes}",
|
122
121
|
)
|
123
122
|
else
|
124
123
|
content_tag(
|
@@ -1,18 +1,17 @@
|
|
1
1
|
<%
|
2
2
|
add_gem_component_stylesheet("hint")
|
3
3
|
|
4
|
-
id ||= "hint-#{SecureRandom.hex(4)}"
|
4
|
+
local_assigns[:id] ||= "hint-#{SecureRandom.hex(4)}"
|
5
5
|
is_radio_label_hint ||= false
|
6
6
|
right_to_left ||= false
|
7
7
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
css_classes << custom_margin_bottom_class if local_assigns[:margin_bottom]
|
9
|
+
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
10
|
+
component_helper.add_class("gem-c-hint govuk-hint")
|
11
|
+
component_helper.add_class("govuk-radios__hint") if is_radio_label_hint
|
12
|
+
component_helper.add_class(shared_helper.get_margin_bottom) if [*0..9].include?(local_assigns[:margin_bottom])
|
14
13
|
%>
|
15
14
|
|
16
|
-
<%= tag.div
|
15
|
+
<%= tag.div(**component_helper.all_attributes, dir: right_to_left ? "rtl" : nil) do %>
|
17
16
|
<%= text %>
|
18
17
|
<% end %>
|
@@ -6,9 +6,24 @@
|
|
6
6
|
error_text ||= nil
|
7
7
|
error_text_prefix ||= t("components.password_input.error_text_prefix")
|
8
8
|
|
9
|
+
button_show_password_aria_label ||= t("components.password_input.button_aria_label")
|
10
|
+
button_hide_password_aria_label ||= t("components.password_input.button_aria_hide_label")
|
11
|
+
button_show_password_text ||= t("components.password_input.button")
|
12
|
+
button_hide_password_text ||= t("components.password_input.button_hide")
|
13
|
+
password_shown_announcement ||= t("components.password_input.password_shown_announcement")
|
14
|
+
password_hidden_announcement ||= t("components.password_input.password_hidden_announcement")
|
15
|
+
|
9
16
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
10
17
|
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
11
|
-
component_helper.add_data_attribute({
|
18
|
+
component_helper.add_data_attribute({
|
19
|
+
module: "govuk-password-input",
|
20
|
+
"i18n.show-password": button_show_password_text,
|
21
|
+
"i18n.hide-password": button_hide_password_text,
|
22
|
+
"i18n.show-password-aria-label": button_show_password_aria_label,
|
23
|
+
"i18n.hide-password-aria-label": button_hide_password_aria_label,
|
24
|
+
"i18n.password-shown-announcement": password_shown_announcement,
|
25
|
+
"i18n.password-hidden-announcement": password_hidden_announcement,
|
26
|
+
})
|
12
27
|
component_helper.add_class('govuk-form-group')
|
13
28
|
component_helper.add_class('govuk-form-group--error') if error_text
|
14
29
|
component_helper.add_class('govuk-password-input')
|
@@ -34,7 +49,6 @@
|
|
34
49
|
aria_controls << '-with-error-message'
|
35
50
|
paragraph_id = uid + '-password-input-with-error-message-error'
|
36
51
|
end
|
37
|
-
|
38
52
|
%>
|
39
53
|
|
40
54
|
<%= tag.div(**component_helper.all_attributes) do %>
|
@@ -70,9 +84,9 @@
|
|
70
84
|
hidden: true,
|
71
85
|
aria: {
|
72
86
|
controls: aria_controls,
|
73
|
-
label:
|
87
|
+
label: button_show_password_aria_label
|
74
88
|
}) do %>
|
75
|
-
<%=
|
89
|
+
<%= button_show_password_text %>
|
76
90
|
<% end %>
|
77
91
|
</div>
|
78
92
|
<% end %>
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<%
|
2
2
|
add_gem_component_stylesheet("search")
|
3
|
+
add_gem_component_stylesheet("label")
|
3
4
|
|
4
5
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
5
6
|
heading_helper = GovukPublishingComponents::Presenters::HeadingHelper.new(local_assigns)
|
@@ -51,10 +52,8 @@
|
|
51
52
|
end
|
52
53
|
end
|
53
54
|
%>
|
54
|
-
|
55
55
|
<div class="<%= classes.join(" ") %>" data-module="gem-toggle-input-class-on-focus">
|
56
56
|
<% if wrap_label_in_a_heading %>
|
57
|
-
<% add_gem_component_stylesheet("label") %>
|
58
57
|
<%= content_tag(shared_helper.get_heading_level, class: "govuk-!-margin-0") do %>
|
59
58
|
<%= tag_label %>
|
60
59
|
<% end %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<%
|
2
|
+
add_gem_component_stylesheet("secondary-navigation")
|
3
|
+
|
4
|
+
id ||= nil
|
5
|
+
items ||= []
|
6
|
+
|
7
|
+
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
8
|
+
component_helper.add_aria_attribute({label: aria_label})
|
9
|
+
component_helper.add_class('gem-c-secondary-navigation')
|
10
|
+
component_helper.set_id(id)
|
11
|
+
component_helper.add_role("navigation")
|
12
|
+
%>
|
13
|
+
|
14
|
+
<% if items.any? %>
|
15
|
+
<%= tag.nav(**component_helper.all_attributes) do %>
|
16
|
+
<%= tag.ul class: "gem-c-secondary-navigation__list" do %>
|
17
|
+
<% items.each do |item| %>
|
18
|
+
<%
|
19
|
+
item_classes = %w( gem-c-secondary-navigation__list-item )
|
20
|
+
item_classes << "gem-c-secondary-navigation__list-item--current" if item[:current]
|
21
|
+
item_aria_attributes = { current: "page" } if item[:current]
|
22
|
+
%>
|
23
|
+
<%= tag.li class: item_classes do %>
|
24
|
+
<%= link_to item[:label], item[:href], class: "govuk-link govuk-link--no-visited-state gem-c-secondary-navigation__list-item-link", data: item[:data_attributes], aria: item_aria_attributes %>
|
25
|
+
<% end %>
|
26
|
+
<% end %>
|
27
|
+
<% end %>
|
28
|
+
<% end %>
|
29
|
+
<% end %>
|
@@ -307,6 +307,29 @@ examples:
|
|
307
307
|
- link:
|
308
308
|
text: 'Criteria'
|
309
309
|
description: 'no url provided, just text'
|
310
|
+
with_parts_and_no_underline:
|
311
|
+
description: The legacy finders design does not include underlines on links, neither on the main item nor the children.
|
312
|
+
data:
|
313
|
+
remove_underline: true
|
314
|
+
items:
|
315
|
+
- link:
|
316
|
+
text: 'Universal credit'
|
317
|
+
path: '/universal-credit'
|
318
|
+
description: 'Universal Credit is replacing 6 other benefits with a single monthly payment if you are out of work or on a low income - eligibility, how to prepare'
|
319
|
+
parts:
|
320
|
+
- link:
|
321
|
+
text: 'What universal credit is'
|
322
|
+
path: '/universal-credit/what-it-is'
|
323
|
+
description: 'Universal Credit is a payment to help with your living costs. It’s paid monthly - or twice a month for some people in Scotland.'
|
324
|
+
- link:
|
325
|
+
text: 'Elegibility'
|
326
|
+
path: '/universal-credit/eligibility'
|
327
|
+
description: 'You may be able to get Universal Credit if: you’re on a low income or out...'
|
328
|
+
data_attributes:
|
329
|
+
an_attribute: some_value
|
330
|
+
- link:
|
331
|
+
text: 'Criteria'
|
332
|
+
description: 'no url provided, just text'
|
310
333
|
with_locale_specified:
|
311
334
|
description: |
|
312
335
|
The component is used on translated pages that don’t have a translation for the document link text or the metadata. This means that it could display the fallback English string if the translate method can’t find an appropriate translation. This makes sure that the lang can be set to ensure that browsers understand which parts of the page are in each language.
|
@@ -2,6 +2,7 @@ name: Form hint text
|
|
2
2
|
description: Use hints for any form fields.
|
3
3
|
govuk_frontend_components:
|
4
4
|
- hint
|
5
|
+
uses_component_wrapper_helper: true
|
5
6
|
accessibility_criteria: |
|
6
7
|
All text must have a contrast ratio higher than 4.5:1 against the background colour to meet [WCAG AA](https://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast)
|
7
8
|
|