govuk_publishing_components 43.0.1 → 43.1.0
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/component_guide/application.js +1 -0
- data/app/assets/javascripts/govuk_publishing_components/components/password-input.js +5 -0
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +10 -17
- data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +39 -17
- data/app/assets/stylesheets/component_guide/application.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_cross-service-header.scss +3 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +3 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +32 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +1 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_password-input.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_phase-banner.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_summary-card.scss +16 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_warning-text.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +2 -4
- data/app/assets/stylesheets/govuk_publishing_components/govuk_frontend_support.scss +4 -0
- data/app/views/govuk_publishing_components/components/_chat_entry.html.erb +13 -1
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_password_input.html.erb +78 -0
- data/app/views/govuk_publishing_components/components/_summary_card.html.erb +62 -0
- data/app/views/govuk_publishing_components/components/docs/chat_entry.yml +5 -0
- data/app/views/govuk_publishing_components/components/docs/password_input.yml +45 -0
- data/app/views/govuk_publishing_components/components/docs/summary_card.yml +93 -0
- data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +6 -3
- data/app/views/govuk_publishing_components/components/layout_header/_search.html.erb +7 -2
- data/config/locales/ar.yml +5 -0
- data/config/locales/az.yml +5 -0
- data/config/locales/be.yml +5 -0
- data/config/locales/bg.yml +5 -0
- data/config/locales/bn.yml +5 -0
- data/config/locales/cs.yml +5 -0
- data/config/locales/cy.yml +5 -0
- data/config/locales/da.yml +5 -0
- data/config/locales/de.yml +5 -0
- data/config/locales/dr.yml +5 -0
- data/config/locales/el.yml +5 -0
- data/config/locales/en.yml +5 -0
- data/config/locales/es-419.yml +5 -0
- data/config/locales/es.yml +5 -0
- data/config/locales/et.yml +5 -0
- data/config/locales/fa.yml +5 -0
- data/config/locales/fi.yml +5 -0
- data/config/locales/fr.yml +5 -0
- data/config/locales/gd.yml +5 -0
- data/config/locales/gu.yml +5 -0
- data/config/locales/he.yml +5 -0
- data/config/locales/hi.yml +5 -0
- data/config/locales/hr.yml +5 -0
- data/config/locales/hu.yml +5 -0
- data/config/locales/hy.yml +5 -0
- data/config/locales/id.yml +5 -0
- data/config/locales/is.yml +5 -0
- data/config/locales/it.yml +5 -0
- data/config/locales/ja.yml +5 -0
- data/config/locales/ka.yml +5 -0
- data/config/locales/kk.yml +5 -0
- data/config/locales/ko.yml +5 -0
- data/config/locales/lt.yml +5 -0
- data/config/locales/lv.yml +5 -0
- data/config/locales/ms.yml +5 -0
- data/config/locales/mt.yml +5 -0
- data/config/locales/nl.yml +5 -0
- data/config/locales/no.yml +5 -0
- data/config/locales/pa-pk.yml +5 -0
- data/config/locales/pa.yml +5 -0
- data/config/locales/pl.yml +5 -0
- data/config/locales/ps.yml +5 -0
- data/config/locales/pt.yml +5 -0
- data/config/locales/ro.yml +5 -0
- data/config/locales/ru.yml +5 -0
- data/config/locales/si.yml +5 -0
- data/config/locales/sk.yml +5 -0
- data/config/locales/sl.yml +5 -0
- data/config/locales/so.yml +5 -0
- data/config/locales/sq.yml +5 -0
- data/config/locales/sr.yml +5 -0
- data/config/locales/sv.yml +5 -0
- data/config/locales/sw.yml +5 -0
- data/config/locales/ta.yml +5 -0
- data/config/locales/th.yml +5 -0
- data/config/locales/tk.yml +5 -0
- data/config/locales/tr.yml +5 -0
- data/config/locales/uk.yml +5 -0
- data/config/locales/ur.yml +5 -0
- data/config/locales/uz.yml +5 -0
- data/config/locales/vi.yml +5 -0
- data/config/locales/zh-hk.yml +5 -0
- data/config/locales/zh-tw.yml +5 -0
- data/config/locales/zh.yml +5 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/sortablejs/README.md +3 -2
- data/node_modules/sortablejs/Sortable.js +5 -4
- data/node_modules/sortablejs/Sortable.min.js +2 -2
- data/node_modules/sortablejs/modular/sortable.complete.esm.js +5 -4
- data/node_modules/sortablejs/modular/sortable.core.esm.js +5 -4
- data/node_modules/sortablejs/modular/sortable.esm.js +5 -4
- data/node_modules/sortablejs/package.json +3 -2
- data/node_modules/sortablejs/src/Animation.js +175 -0
- data/node_modules/sortablejs/src/BrowserInfo.js +12 -0
- data/node_modules/sortablejs/src/EventDispatcher.js +57 -0
- data/node_modules/sortablejs/src/PluginManager.js +94 -0
- data/node_modules/sortablejs/src/Sortable.js +2011 -0
- data/node_modules/sortablejs/src/utils.js +595 -0
- metadata +15 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0cd528b4f8f215e98dc668b8aebbc8a70830275d42df7aadae6d26d8763ea932
|
|
4
|
+
data.tar.gz: 9406315ea8c87a29bbfe16c9243f8e05e6fb6f418ec10b41d16493891c92d9b4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5bd32ba843de584bfb07f87df4c3dc7624b3fb65d7cd6f46e6f21cc711950c102edc302cc2004570908e7f18a425315983c516f97d0a370654281803a9b7b394
|
|
7
|
+
data.tar.gz: d4deba88fd859ddce5ecec74087f169b45a305f84af32a3be12b3666a70c179d6d75901f22c1f7e7dde7b788f98db806fdcf929f3f9809ec649dfd100f06198e
|
|
@@ -3,4 +3,5 @@
|
|
|
3
3
|
//= require ../govuk_publishing_components/dependencies
|
|
4
4
|
//= require ../govuk_publishing_components/components/accordion
|
|
5
5
|
//= require ../govuk_publishing_components/components/intervention
|
|
6
|
+
//= require ../govuk_publishing_components/components/password-input
|
|
6
7
|
//= require ../govuk_publishing_components/components/tabs
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// This component relies on JavaScript from GOV.UK Frontend
|
|
2
|
+
// = require govuk/components/password-input/password-input.bundle.js
|
|
3
|
+
window.GOVUK = window.GOVUK || {}
|
|
4
|
+
window.GOVUK.Modules = window.GOVUK.Modules || {}
|
|
5
|
+
window.GOVUK.Modules.GovukPasswordInput = window.GOVUKFrontend.PasswordInput
|
data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
link: $link
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
if (href.
|
|
35
|
+
if (href.includes('/live_stream')) {
|
|
36
36
|
var channelId = YoutubeLinkEnhancement.parseLivestream(href)
|
|
37
37
|
|
|
38
38
|
if (!this.hasDisabledEmbed($link) && channelId) {
|
|
@@ -175,23 +175,16 @@
|
|
|
175
175
|
// This is a public class method so it can be used outside of this embed to
|
|
176
176
|
// check that user input for videos will be supported in govspeak
|
|
177
177
|
YoutubeLinkEnhancement.parseVideoId = function (url) {
|
|
178
|
-
var
|
|
178
|
+
var u
|
|
179
179
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
var part = parts[i].split('=')
|
|
189
|
-
params[part[0]] = part[1]
|
|
190
|
-
}
|
|
191
|
-
return params.v
|
|
192
|
-
} else if (url.indexOf('youtu.be') > -1) {
|
|
193
|
-
parts = url.split('/')
|
|
194
|
-
return parts.pop()
|
|
180
|
+
try {
|
|
181
|
+
u = new URL(url)
|
|
182
|
+
} catch (e) { return undefined }
|
|
183
|
+
|
|
184
|
+
if (u.host === 'www.youtube.com' || u.host === 'youtube.com') {
|
|
185
|
+
return u.searchParams.get('v') || undefined
|
|
186
|
+
} else if (u.host === 'youtu.be') {
|
|
187
|
+
return u.pathname.slice(1) // Trim the leading /
|
|
195
188
|
}
|
|
196
189
|
}
|
|
197
190
|
|
|
@@ -60,6 +60,21 @@
|
|
|
60
60
|
}
|
|
61
61
|
return "";
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Returns the delivery type for the current document. To differentiate between the valid empty
|
|
65
|
+
* string value and browsers that don't support PerformanceResourceTiming.deliveryType, we convert
|
|
66
|
+
* the empty string value to "(empty string)". Browsers that don't support deliveryType will return
|
|
67
|
+
* null. Despite straying from the spec, this allows us to differentiate between the two cases.
|
|
68
|
+
*
|
|
69
|
+
* @see https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-deliverytype
|
|
70
|
+
*/
|
|
71
|
+
function deliveryType() {
|
|
72
|
+
var navEntry = getNavigationEntry();
|
|
73
|
+
if ("deliveryType" in navEntry) {
|
|
74
|
+
return navEntry.deliveryType || "(empty string)";
|
|
75
|
+
}
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
63
78
|
function getNavigationEntry() {
|
|
64
79
|
var navEntries = getEntriesByType("navigation");
|
|
65
80
|
if (navEntries.length) {
|
|
@@ -321,7 +336,7 @@
|
|
|
321
336
|
return str;
|
|
322
337
|
}
|
|
323
338
|
|
|
324
|
-
var VERSION = "4.0.
|
|
339
|
+
var VERSION = "4.0.26";
|
|
325
340
|
/**
|
|
326
341
|
* Returns the version of the script as a float to be stored in legacy systems that do not support
|
|
327
342
|
* string versions.
|
|
@@ -666,25 +681,25 @@
|
|
|
666
681
|
startTime: processTimeMetric(entry.startTime),
|
|
667
682
|
elementSelector: getNodeSelector(source.node),
|
|
668
683
|
elementType: source.node.nodeName,
|
|
669
|
-
|
|
684
|
+
}); })
|
|
670
685
|
: [];
|
|
671
686
|
if (sessionEntries.length &&
|
|
672
687
|
(entry.startTime - latestEntry.startTime >= 1000 ||
|
|
673
688
|
entry.startTime - firstEntry.startTime >= 5000)) {
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
689
|
+
sessionValue = entry.value;
|
|
690
|
+
sessionEntries = [entry];
|
|
691
|
+
sessionAttributions = sources;
|
|
692
|
+
largestEntry = entry;
|
|
693
|
+
}
|
|
694
|
+
else {
|
|
695
|
+
sessionValue += entry.value;
|
|
696
|
+
sessionEntries.push(entry);
|
|
697
|
+
sessionAttributions = sessionAttributions.concat(sources);
|
|
698
|
+
if (!largestEntry || entry.value > largestEntry.value) {
|
|
677
699
|
largestEntry = entry;
|
|
678
700
|
}
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
sessionEntries.push(entry);
|
|
682
|
-
sessionAttributions = sessionAttributions.concat(sources);
|
|
683
|
-
if (!largestEntry || entry.value > largestEntry.value) {
|
|
684
|
-
largestEntry = entry;
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
maximumSessionValue = max(maximumSessionValue, sessionValue);
|
|
701
|
+
}
|
|
702
|
+
maximumSessionValue = max(maximumSessionValue, sessionValue);
|
|
688
703
|
}
|
|
689
704
|
}
|
|
690
705
|
function reset$2() {
|
|
@@ -1946,7 +1961,7 @@
|
|
|
1946
1961
|
].join("");
|
|
1947
1962
|
}
|
|
1948
1963
|
function getCustomerId() {
|
|
1949
|
-
return
|
|
1964
|
+
return String(_thisCustomerId) || "";
|
|
1950
1965
|
}
|
|
1951
1966
|
function avgDomDepth() {
|
|
1952
1967
|
var aElems = document.getElementsByTagName("*");
|
|
@@ -2184,6 +2199,12 @@
|
|
|
2184
2199
|
var baseUrl = _getBeaconUrl(getAllCustomData());
|
|
2185
2200
|
var is = inlineTagSize("script");
|
|
2186
2201
|
var ic = inlineTagSize("style");
|
|
2202
|
+
var ds = docSize();
|
|
2203
|
+
var ct = connectionType();
|
|
2204
|
+
var dt = deliveryType();
|
|
2205
|
+
// Note some page stat values (the `PS` query string) are non-numeric. To make extracting these
|
|
2206
|
+
// values easier, we append an underscore "_" to the value. Values this is used for include
|
|
2207
|
+
// connection type (ct) and delivery type (dt).
|
|
2187
2208
|
var metricsQueryString =
|
|
2188
2209
|
// only send Nav Timing and lux.js metrics on initial pageload (not for SPA page views)
|
|
2189
2210
|
(gbNavSent ? "" : "&NT=" + getNavTiming()) +
|
|
@@ -2216,8 +2237,9 @@
|
|
|
2216
2237
|
docHeight(document) +
|
|
2217
2238
|
"dw" +
|
|
2218
2239
|
docWidth(document) +
|
|
2219
|
-
(
|
|
2220
|
-
(
|
|
2240
|
+
(ds ? "ds" + ds : "") + // document HTTP transfer size (bytes)
|
|
2241
|
+
(ct ? "ct" + ct + "_" : "") + // connection type
|
|
2242
|
+
(typeof dt !== "undefined" ? "dt" + dt + "_" : "") + // delivery type
|
|
2221
2243
|
"er" +
|
|
2222
2244
|
nErrors +
|
|
2223
2245
|
"nt" +
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
@import "components/option-select";
|
|
60
60
|
@import "components/organisation-logo";
|
|
61
61
|
@import "components/panel";
|
|
62
|
+
@import "components/password-input";
|
|
62
63
|
@import "components/phase-banner";
|
|
63
64
|
@import "components/previous-and-next-navigation";
|
|
64
65
|
@import "components/print-link";
|
|
@@ -76,6 +77,7 @@
|
|
|
76
77
|
@import "components/step-by-step-nav";
|
|
77
78
|
@import "components/subscription-links";
|
|
78
79
|
@import "components/success-alert";
|
|
80
|
+
@import "components/summary-card";
|
|
79
81
|
@import "components/summary-list";
|
|
80
82
|
@import "components/tabs";
|
|
81
83
|
@import "components/table";
|
data/app/assets/stylesheets/govuk_publishing_components/components/_cross-service-header.scss
CHANGED
|
@@ -443,7 +443,7 @@ $govuk-header-link-underline-thickness: 3px;
|
|
|
443
443
|
}
|
|
444
444
|
|
|
445
445
|
.gem-c-one-login-header {
|
|
446
|
-
background
|
|
446
|
+
background: none;
|
|
447
447
|
border-bottom: 2pt solid $govuk-print-text-colour;
|
|
448
448
|
|
|
449
449
|
* {
|
|
@@ -456,6 +456,8 @@ $govuk-header-link-underline-thickness: 3px;
|
|
|
456
456
|
}
|
|
457
457
|
|
|
458
458
|
.gem-c-service-header {
|
|
459
|
+
background: none;
|
|
460
|
+
|
|
459
461
|
.govuk-width-container {
|
|
460
462
|
margin: 0;
|
|
461
463
|
}
|
|
@@ -21,10 +21,39 @@
|
|
|
21
21
|
margin-bottom: 20px;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
// stylelint-disable declaration-no-important
|
|
25
24
|
@include govuk-media-query($media-type: print) {
|
|
25
|
+
.govuk-footer {
|
|
26
|
+
background: none;
|
|
27
|
+
margin: 25mm 0 0;
|
|
28
|
+
padding: 5mm 0 0;
|
|
29
|
+
border-top: 2pt solid $govuk-print-text-colour;
|
|
30
|
+
|
|
31
|
+
.govuk-width-container {
|
|
32
|
+
margin: 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.govuk-footer__meta,
|
|
37
|
+
.govuk-footer__meta-item {
|
|
38
|
+
border: 0;
|
|
39
|
+
padding: 0;
|
|
40
|
+
margin: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.govuk-footer__licence-description {
|
|
44
|
+
padding-right: 10mm;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.govuk-footer__copyright-logo {
|
|
48
|
+
min-width: auto;
|
|
49
|
+
padding-top: 13mm;
|
|
50
|
+
background-size: 15mm;
|
|
51
|
+
background-position: center top;
|
|
52
|
+
print-color-adjust: exact;
|
|
53
|
+
-webkit-print-color-adjust: exact;
|
|
54
|
+
}
|
|
55
|
+
|
|
26
56
|
.gem-c-layout-footer {
|
|
27
|
-
font-size:
|
|
57
|
+
font-size: 10pt !important; // stylelint-disable-line declaration-no-important
|
|
28
58
|
}
|
|
29
59
|
}
|
|
30
|
-
// stylelint-enable declaration-no-important
|
|
@@ -148,8 +148,6 @@
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
.gem-c-layout-header__search-form {
|
|
151
|
-
display: none;
|
|
152
|
-
|
|
153
151
|
&.js-visible {
|
|
154
152
|
display: block;
|
|
155
153
|
}
|
|
@@ -185,7 +183,7 @@
|
|
|
185
183
|
.gem-c-header__product-name,
|
|
186
184
|
.gem-c-environment-tag {
|
|
187
185
|
color: $govuk-print-text-colour;
|
|
188
|
-
background
|
|
186
|
+
background: none;
|
|
189
187
|
}
|
|
190
188
|
}
|
|
191
189
|
}
|
|
@@ -989,7 +989,7 @@ $after-button-padding-left: govuk-spacing(4);
|
|
|
989
989
|
border-top: 0;
|
|
990
990
|
border-bottom: 2pt solid $govuk-print-text-colour;
|
|
991
991
|
margin: 0 0 5mm;
|
|
992
|
-
background
|
|
992
|
+
background: none;
|
|
993
993
|
|
|
994
994
|
&:has(.gem-c-layout-super-navigation-header__header-logo .govuk-visually-hidden) {
|
|
995
995
|
border: 0;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@import "govuk_publishing_components/individual_component_support";
|
|
2
|
+
@import "govuk/components/summary-list/summary-list";
|
|
3
|
+
|
|
4
|
+
.gem-c-summary-card {
|
|
5
|
+
.govuk-summary-list__key {
|
|
6
|
+
vertical-align: top;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.govuk-summary-list__actions {
|
|
10
|
+
width: auto;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
img {
|
|
14
|
+
display: block;
|
|
15
|
+
}
|
|
16
|
+
}
|
data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss
CHANGED
|
@@ -44,15 +44,13 @@ $highlight-answer-color: govuk-colour("white");
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
// stylelint-disable declaration-no-important
|
|
48
47
|
@include govuk-media-query($media-type: print) {
|
|
49
|
-
background
|
|
48
|
+
background: none;
|
|
50
49
|
|
|
51
50
|
&,
|
|
52
51
|
& * {
|
|
53
|
-
color: $govuk-print-text-colour !important;
|
|
52
|
+
color: $govuk-print-text-colour !important; // stylelint-disable-line declaration-no-important
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
|
-
// stylelint-enable declaration-no-important
|
|
57
55
|
}
|
|
58
56
|
}
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
@import "components/mixins/govuk-template-link-focus-override";
|
|
9
9
|
@import "components/mixins/css3";
|
|
10
10
|
|
|
11
|
+
$govuk-suppressed-warnings: (
|
|
12
|
+
organisation-colours
|
|
13
|
+
);
|
|
14
|
+
|
|
11
15
|
$gem-secondary-button-colour: #00823b;
|
|
12
16
|
$gem-secondary-button-hover-colour: darken($gem-secondary-button-colour, 5%);
|
|
13
17
|
$gem-secondary-button-background-colour: govuk-colour("white");
|
|
@@ -7,12 +7,24 @@
|
|
|
7
7
|
description_text ||= t("components.chat_entry.description")
|
|
8
8
|
border_top ||= false
|
|
9
9
|
border_bottom ||= false
|
|
10
|
+
disable_ga4 ||= false
|
|
10
11
|
|
|
11
12
|
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
|
12
13
|
component_helper.add_class("gem-c-chat-entry")
|
|
13
14
|
component_helper.add_class("gem-c-chat-entry--border-top") if border_top
|
|
14
15
|
component_helper.add_class("gem-c-chat-entry--border-bottom") if border_bottom
|
|
15
16
|
component_helper.add_class(shared_helper.get_margin_bottom)
|
|
17
|
+
component_helper.add_data_attribute({ module: "ga4-link-tracker" }) unless disable_ga4
|
|
18
|
+
|
|
19
|
+
unless disable_ga4
|
|
20
|
+
ga4_link_data = {
|
|
21
|
+
ga4_link: {
|
|
22
|
+
event_name: "navigation",
|
|
23
|
+
type: "callout",
|
|
24
|
+
section: "GOV.UK Chat entry",
|
|
25
|
+
}.to_json
|
|
26
|
+
}
|
|
27
|
+
end
|
|
16
28
|
%>
|
|
17
29
|
|
|
18
30
|
<%= tag.div(**component_helper.all_attributes) do %>
|
|
@@ -36,7 +48,7 @@
|
|
|
36
48
|
|
|
37
49
|
<div class="gem-c-chat-entry__description">
|
|
38
50
|
<%= content_tag(shared_helper.get_heading_level, class: "gem-c-chat-entry__heading") do %>
|
|
39
|
-
<%= link_to heading_text, href, class: "govuk-link" %>
|
|
51
|
+
<%= link_to heading_text, href, class: "govuk-link", data: ga4_link_data %>
|
|
40
52
|
<% end %>
|
|
41
53
|
|
|
42
54
|
<% if description_text %>
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
<% end %>
|
|
64
64
|
</div>
|
|
65
65
|
|
|
66
|
-
<hr class="govuk-footer__section-break">
|
|
66
|
+
<hr class="govuk-footer__section-break govuk-!-display-none-print">
|
|
67
67
|
<% end %>
|
|
68
68
|
<div class="govuk-footer__meta">
|
|
69
69
|
<div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<%
|
|
2
|
+
add_gem_component_stylesheet("password-input")
|
|
3
|
+
|
|
4
|
+
label_text ||= t("components.password_input.label")
|
|
5
|
+
|
|
6
|
+
error_text ||= nil
|
|
7
|
+
error_text_prefix ||= t("components.password_input.error_text_prefix")
|
|
8
|
+
|
|
9
|
+
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
|
10
|
+
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
|
11
|
+
component_helper.add_data_attribute({ module: "govuk-password-input" })
|
|
12
|
+
component_helper.add_class('govuk-form-group')
|
|
13
|
+
component_helper.add_class('govuk-form-group--error') if error_text
|
|
14
|
+
component_helper.add_class('govuk-password-input')
|
|
15
|
+
component_helper.add_class('gem-c-password-input')
|
|
16
|
+
component_helper.add_class(shared_helper.get_margin_bottom)
|
|
17
|
+
|
|
18
|
+
uid = SecureRandom.hex(4)
|
|
19
|
+
|
|
20
|
+
label_for = uid + '-password-input'
|
|
21
|
+
|
|
22
|
+
input_name = 'password'
|
|
23
|
+
input_id = uid + '-password-input'
|
|
24
|
+
|
|
25
|
+
aria_controls = uid + '-password-input'
|
|
26
|
+
|
|
27
|
+
input_classes = %w(govuk-input govuk-password-input__input govuk-js-password-input-input)
|
|
28
|
+
|
|
29
|
+
if error_text
|
|
30
|
+
label_for << '-with-error-message'
|
|
31
|
+
input_id << '-with-error-message'
|
|
32
|
+
input_name << '-input-with-error-message'
|
|
33
|
+
input_classes << 'govuk-input--error'
|
|
34
|
+
aria_controls << '-with-error-message'
|
|
35
|
+
paragraph_id = uid + '-password-input-with-error-message-error'
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
%>
|
|
39
|
+
|
|
40
|
+
<%= tag.div(**component_helper.all_attributes) do %>
|
|
41
|
+
<%= render "govuk_publishing_components/components/label", {
|
|
42
|
+
text: label_text,
|
|
43
|
+
html_for: label_for
|
|
44
|
+
} %>
|
|
45
|
+
<% if error_text %>
|
|
46
|
+
<p id="<%= paragraph_id %>" class="govuk-error-message">
|
|
47
|
+
<span class="govuk-visually-hidden"><%= error_text_prefix %>:</span> <%= error_text %>
|
|
48
|
+
</p>
|
|
49
|
+
<% end %>
|
|
50
|
+
|
|
51
|
+
<div class="govuk-input__wrapper govuk-password-input__wrapper">
|
|
52
|
+
<%= tag.input(
|
|
53
|
+
name: input_name,
|
|
54
|
+
type: "password",
|
|
55
|
+
class: input_classes,
|
|
56
|
+
id: input_id,
|
|
57
|
+
spellcheck: false,
|
|
58
|
+
autocomplete: "current-password",
|
|
59
|
+
autocapitalize: "none",
|
|
60
|
+
aria: {
|
|
61
|
+
describedby: paragraph_id
|
|
62
|
+
}) %>
|
|
63
|
+
|
|
64
|
+
<%= tag.button(
|
|
65
|
+
type: "button",
|
|
66
|
+
class: "govuk-button govuk-button--secondary govuk-password-input__toggle govuk-js-password-input-toggle",
|
|
67
|
+
data: {
|
|
68
|
+
module: "govuk-button"
|
|
69
|
+
},
|
|
70
|
+
hidden: true,
|
|
71
|
+
aria: {
|
|
72
|
+
controls: aria_controls,
|
|
73
|
+
label: t("components.password_input.button_aria_label")
|
|
74
|
+
}) do %>
|
|
75
|
+
<%= t("components.password_input.button") %>
|
|
76
|
+
<% end %>
|
|
77
|
+
</div>
|
|
78
|
+
<% end %>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<%
|
|
2
|
+
add_gem_component_stylesheet("summary-card")
|
|
3
|
+
|
|
4
|
+
id ||= nil
|
|
5
|
+
title ||= nil
|
|
6
|
+
data_attributes ||= {}
|
|
7
|
+
summary_card_actions ||= []
|
|
8
|
+
rows ||=[]
|
|
9
|
+
%>
|
|
10
|
+
<% if title || rows.any? %>
|
|
11
|
+
<%= tag.div class: "gem-c-summary-card", id: id, data: data_attributes do %>
|
|
12
|
+
<%= tag.div class: "govuk-summary-card" do %>
|
|
13
|
+
<%= tag.div class: "govuk-summary-card__title-wrapper" do %>
|
|
14
|
+
<%= tag.h2 class: "govuk-summary-card__title" do %>
|
|
15
|
+
<%= title %>
|
|
16
|
+
<% end %>
|
|
17
|
+
|
|
18
|
+
<%= tag.ul class: "govuk-summary-card__actions" do %>
|
|
19
|
+
<% summary_card_actions.each do |action| %>
|
|
20
|
+
<%= tag.li class: "govuk-summary-card__action" do %>
|
|
21
|
+
<%= link_to sanitize(action[:label] + tag.span(" #{title}", class: "govuk-visually-hidden")), action[:href], class: "govuk-link govuk-link--no-visited-state #{"gem-link--destructive govuk-!-font-weight-bold" if action[:destructive]}".strip %>
|
|
22
|
+
<% end %>
|
|
23
|
+
<% end %>
|
|
24
|
+
<% end %>
|
|
25
|
+
<% end %>
|
|
26
|
+
|
|
27
|
+
<% if rows.present? %>
|
|
28
|
+
<%= tag.div class: "govuk-summary-card__content" do %>
|
|
29
|
+
<%= tag.dl class: "govuk-summary-list" do %>
|
|
30
|
+
<% rows.each do |row| %>
|
|
31
|
+
<%= tag.div class: "govuk-summary-list__row" do %>
|
|
32
|
+
<%= tag.dt class: "govuk-summary-list__key" do %>
|
|
33
|
+
<%= row[:key] %>
|
|
34
|
+
<% end %>
|
|
35
|
+
|
|
36
|
+
<%= tag.dt class: "govuk-summary-list__value" do %>
|
|
37
|
+
<%= row[:value] %>
|
|
38
|
+
<% end %>
|
|
39
|
+
|
|
40
|
+
<% if row[:actions].present? %>
|
|
41
|
+
<%= tag.dd class: "govuk-summary-list__actions" do %>
|
|
42
|
+
<%= tag.ul class: "govuk-summary-list__actions-list" do %>
|
|
43
|
+
<% row[:actions].each do |action| %>
|
|
44
|
+
<%= tag.li class: "govuk-summary-list__actions-list-item" do %>
|
|
45
|
+
<% if action[:opens_in_new_tab] %>
|
|
46
|
+
<%= link_to sanitize(action[:label] + tag.span(" #{row[:key]} (opens in new tab)", class: "govuk-visually-hidden")), action[:href], class: "govuk-link govuk-link--no-visited-state", rel: "noreferrer noopener", target: "_blank" %>
|
|
47
|
+
<% else %>
|
|
48
|
+
<%= link_to sanitize(action[:label] + tag.span(" #{row[:key]}", class: "govuk-visually-hidden")), action[:href], class: "govuk-link govuk-link--no-visited-state #{"gem-link--destructive" if action[:destructive]}".strip %>
|
|
49
|
+
<% end %>
|
|
50
|
+
<% end %>
|
|
51
|
+
<% end %>
|
|
52
|
+
<% end %>
|
|
53
|
+
<% end %>
|
|
54
|
+
<% end %>
|
|
55
|
+
<% end %>
|
|
56
|
+
<% end %>
|
|
57
|
+
<% end %>
|
|
58
|
+
<% end %>
|
|
59
|
+
<% end %>
|
|
60
|
+
<% end %>
|
|
61
|
+
<% end %>
|
|
62
|
+
<% end %>
|
|
@@ -34,3 +34,8 @@ examples:
|
|
|
34
34
|
with_margin_bottom:
|
|
35
35
|
data:
|
|
36
36
|
margin_bottom: 3
|
|
37
|
+
without_ga4_tracking:
|
|
38
|
+
description: |
|
|
39
|
+
Disables GA4 tracking on the component. Tracking is enabled by default. This adds a data module and data-attributes with JSON data. See the [ga4-link-tracker documentation](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-link-tracker.md) for more information.
|
|
40
|
+
data:
|
|
41
|
+
disable_ga4: true
|