govuk_publishing_components 35.19.0 → 35.20.1
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/images/govuk_publishing_components/icon-close.svg +1 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +2 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js +8 -2
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-print-intent-tracker.js +24 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-scroll-tracker.js +4 -5
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4.js +1 -0
- data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +3 -5
- data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +21 -31
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +31 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +94 -23
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +13 -0
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +9 -13
- data/app/views/govuk_publishing_components/components/_contents_list.html.erb +2 -6
- data/app/views/govuk_publishing_components/components/_intervention.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +6 -10
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +43 -32
- data/app/views/govuk_publishing_components/components/_search.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_share_links.html.erb +2 -6
- data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +2 -4
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +10 -1
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +4 -8
- data/app/views/govuk_publishing_components/components/_tabs.html.erb +2 -4
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_ukraine_cta.html.erb +4 -6
- data/app/views/govuk_publishing_components/components/docs/image_card.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/search.yml +5 -0
- data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +6 -8
- data/lib/govuk_publishing_components/presenters/breadcrumbs_helper.rb +1 -3
- data/lib/govuk_publishing_components/presenters/layout_footer_helper.rb +3 -5
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '096ada32d1ecced73348563a12eaa51f1f722c75f11791baba32d24de329b4ad'
|
|
4
|
+
data.tar.gz: 7c905c2babbe3a999a4a44d2441506b5b38b48edbb78593a9b9212b55549d8da
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7bca767187c1d88419a6c36c90a6cfb763773ef81cd1106bf24f2298142bf7f247ca293c05a4bc9c76fe567f326ff36a7cbb7986bc671995512c22b4f2f67461
|
|
7
|
+
data.tar.gz: 715869ba54a39828637ded7125d39462716247acec55b3c71507975fbcbb567a01dfd2ab152a2fe19fac3044ca4c7c0e0b1ea56c9dca6b074ac440abdf4c3e28
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none"><path fill="#0B0C0C" d="M2 15.435 15.435 2l2.121 2.121L4.121 17.556z"/><path fill="#0B0C0C" d="M15.436 17.557 2 4.122l2.12-2.121 13.436 13.435z"/></svg>
|
|
@@ -325,6 +325,7 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
|
|
|
325
325
|
var target = data.event.target
|
|
326
326
|
ecommerceSchema.search_results.ecommerce.items.push({
|
|
327
327
|
item_id: target.getAttribute('data-ga4-ecommerce-path'),
|
|
328
|
+
item_content_id: target.getAttribute('data-ga4-ecommerce-content-id') || undefined,
|
|
328
329
|
item_name: target.textContent,
|
|
329
330
|
item_list_name: listTitle,
|
|
330
331
|
index: window.GOVUK.analyticsGa4.core.ecommerceHelperFunctions.getIndex(target, startPosition)
|
|
@@ -351,6 +352,7 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
|
|
|
351
352
|
|
|
352
353
|
ecommerceSchema.search_results.ecommerce.items.push({
|
|
353
354
|
item_id: path,
|
|
355
|
+
item_content_id: item.getAttribute('data-ga4-ecommerce-content-id') || undefined,
|
|
354
356
|
item_list_name: listTitle,
|
|
355
357
|
index: window.GOVUK.analyticsGa4.core.ecommerceHelperFunctions.getIndex(item, startPosition)
|
|
356
358
|
})
|
|
@@ -95,6 +95,14 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
95
95
|
data.external = trackFunctions.isExternalLink(data.url) ? 'true' : 'false'
|
|
96
96
|
data.index = this.setIndex(data.index, event.target)
|
|
97
97
|
|
|
98
|
+
// flatten the attributes in index into the main data
|
|
99
|
+
if (data.index) {
|
|
100
|
+
for (var prop in data.index) {
|
|
101
|
+
data[prop] = data.index[prop]
|
|
102
|
+
}
|
|
103
|
+
delete data.index
|
|
104
|
+
}
|
|
105
|
+
|
|
98
106
|
if (data.type === 'smart answer' && data.action === 'change response') {
|
|
99
107
|
data.section = this.PIIRemover.stripPIIWithOverride(data.section, true, true)
|
|
100
108
|
}
|
|
@@ -117,7 +125,6 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
117
125
|
if (target.getAttribute('data-ga4-index')) {
|
|
118
126
|
try {
|
|
119
127
|
var indexLink = JSON.parse(target.getAttribute('data-ga4-index'))
|
|
120
|
-
|
|
121
128
|
// Check whether the index object already exists on a parent element, as is the case with tracking accordion links.
|
|
122
129
|
// If true, combine data-ga4-index with the index object. Otherwise, just return indexLink
|
|
123
130
|
index = index ? window.GOVUK.extendObject(index, indexLink) : indexLink
|
|
@@ -126,7 +133,6 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
126
133
|
return
|
|
127
134
|
}
|
|
128
135
|
}
|
|
129
|
-
|
|
130
136
|
return index
|
|
131
137
|
}
|
|
132
138
|
|
data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-print-intent-tracker.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
window.GOVUK = window.GOVUK || {}
|
|
2
|
+
window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {}
|
|
3
|
+
window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analyticsModules || {};
|
|
4
|
+
|
|
5
|
+
(function (analyticsModules) {
|
|
6
|
+
'use strict'
|
|
7
|
+
|
|
8
|
+
var Ga4PrintIntentTracker = {
|
|
9
|
+
init: function () {
|
|
10
|
+
window.addEventListener('beforeprint', function () {
|
|
11
|
+
var data = {
|
|
12
|
+
event_name: 'print_page',
|
|
13
|
+
type: 'print page',
|
|
14
|
+
method: 'browser print'
|
|
15
|
+
}
|
|
16
|
+
var schema = new window.GOVUK.analyticsGa4.Schemas()
|
|
17
|
+
schema = schema.mergeProperties(data, 'event_data')
|
|
18
|
+
window.GOVUK.analyticsGa4.core.sendData(schema)
|
|
19
|
+
})
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
analyticsModules.Ga4PrintIntentTracker = Ga4PrintIntentTracker
|
|
24
|
+
})(window.GOVUK.analyticsGa4.analyticsModules)
|
|
@@ -118,7 +118,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
118
118
|
// following will be undefined if tracking percentages
|
|
119
119
|
data.text = node.eventData.text
|
|
120
120
|
data.section = node.eventData.text
|
|
121
|
-
data.
|
|
121
|
+
data.index_section = node.eventData.index_section
|
|
122
|
+
data.index_section_count = node.eventData.index_section_count
|
|
122
123
|
// following will be undefined if tracking headings
|
|
123
124
|
data.percent_scrolled = node.eventData.percent_scrolled
|
|
124
125
|
|
|
@@ -165,10 +166,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
165
166
|
eventData: {
|
|
166
167
|
type: type,
|
|
167
168
|
text: heading.textContent.replace(/\s+/g, ' ').trim(),
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
index_section_count: totalHeadings
|
|
171
|
-
}
|
|
169
|
+
index_section: i + 1,
|
|
170
|
+
index_section_count: totalHeadings
|
|
172
171
|
}
|
|
173
172
|
})
|
|
174
173
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
//= require ./analytics-ga4/ga4-schemas
|
|
4
4
|
//= require ./analytics-ga4/pii-remover
|
|
5
5
|
//= require ./analytics-ga4/ga4-page-views
|
|
6
|
+
//= require ./analytics-ga4/ga4-print-intent-tracker
|
|
6
7
|
//= require ./analytics-ga4/ga4-specialist-link-tracker
|
|
7
8
|
//= require ./analytics-ga4/ga4-link-tracker
|
|
8
9
|
//= require ./analytics-ga4/ga4-event-tracker
|
|
@@ -62,7 +62,7 @@ window.GOVUK.Modules.GovukAccordion = window.GOVUKFrontend.Accordion;
|
|
|
62
62
|
var isGa4Enabled = dataModule ? dataModule.indexOf('ga4-event-tracker') !== -1 : false
|
|
63
63
|
if (isGa4Enabled) {
|
|
64
64
|
var indexTotal = this.$module.querySelectorAll('.govuk-accordion__section').length
|
|
65
|
-
var showAllAttributesGa4 = { event_name: 'select_content', type: 'accordion',
|
|
65
|
+
var showAllAttributesGa4 = { event_name: 'select_content', type: 'accordion', index_section: 0, index_section_count: indexTotal }
|
|
66
66
|
showAll = this.$module.querySelector(this.showAllControls)
|
|
67
67
|
showAll.setAttribute('data-ga4-event', JSON.stringify(showAllAttributesGa4))
|
|
68
68
|
}
|
|
@@ -84,7 +84,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
84
84
|
|
|
85
85
|
// if GA4 is enabled, set attributes on 'show all sections' for tracking using ga4-event-tracker
|
|
86
86
|
if (this.$module.isGa4Enabled) {
|
|
87
|
-
var showAllAttributesGa4 = { event_name: 'select_content', type: 'step by step',
|
|
87
|
+
var showAllAttributesGa4 = { event_name: 'select_content', type: 'step by step', index_section: 0, index_section_count: this.$module.totalSteps }
|
|
88
88
|
this.$module.showOrHideAllButton.setAttribute('data-ga4-event', JSON.stringify(showAllAttributesGa4))
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -196,10 +196,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
196
196
|
event_name: 'select_content',
|
|
197
197
|
type: 'step by step',
|
|
198
198
|
text: titleText.trim(),
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
index_section_count: this.$module.totalSteps
|
|
202
|
-
},
|
|
199
|
+
index_section: i + 1,
|
|
200
|
+
index_section_count: this.$module.totalSteps,
|
|
203
201
|
index_total: thisel.querySelectorAll('a').length
|
|
204
202
|
}
|
|
205
203
|
|
|
@@ -366,11 +366,9 @@
|
|
|
366
366
|
if (!entry.hadRecentInput) {
|
|
367
367
|
var firstEntry = sessionEntries[0];
|
|
368
368
|
var latestEntry = sessionEntries[sessionEntries.length - 1];
|
|
369
|
-
if (sessionEntries.length &&
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
sessionValue = entry.value;
|
|
373
|
-
sessionEntries = [entry];
|
|
369
|
+
if (sessionEntries.length && (entry.startTime - latestEntry.startTime >= 1000 || entry.startTime - firstEntry.startTime >= 5000)) {
|
|
370
|
+
sessionValue = entry.value;
|
|
371
|
+
sessionEntries = [entry];
|
|
374
372
|
}
|
|
375
373
|
else {
|
|
376
374
|
sessionValue += entry.value;
|
|
@@ -445,7 +443,8 @@
|
|
|
445
443
|
|
|
446
444
|
var ALL_ENTRIES = [];
|
|
447
445
|
function observe(type, callback, options) {
|
|
448
|
-
if (typeof PerformanceObserver === "function" &&
|
|
446
|
+
if (typeof PerformanceObserver === "function" &&
|
|
447
|
+
PerformanceObserver.supportedEntryTypes.includes(type)) {
|
|
449
448
|
var po = new PerformanceObserver(function (list) {
|
|
450
449
|
list.getEntries().forEach(function (entry) { return callback(entry); });
|
|
451
450
|
});
|
|
@@ -547,7 +546,7 @@
|
|
|
547
546
|
// -------------------------------------------------------------------------
|
|
548
547
|
/// End
|
|
549
548
|
// -------------------------------------------------------------------------
|
|
550
|
-
var SCRIPT_VERSION = "
|
|
549
|
+
var SCRIPT_VERSION = "312";
|
|
551
550
|
var logger = new Logger();
|
|
552
551
|
var globalConfig = fromObject(LUX);
|
|
553
552
|
logger.logEvent(LogEvent.EvaluationStart, [SCRIPT_VERSION]);
|
|
@@ -695,7 +694,7 @@
|
|
|
695
694
|
// Record the FIRST input delay.
|
|
696
695
|
function recordDelay(delay) {
|
|
697
696
|
if (!gFirstInputDelay) {
|
|
698
|
-
gFirstInputDelay = delay;
|
|
697
|
+
gFirstInputDelay = floor(delay);
|
|
699
698
|
// remove event listeners
|
|
700
699
|
gaEventTypes.forEach(function (eventType) {
|
|
701
700
|
removeEventListener(eventType, onInput, ghListenerOptions);
|
|
@@ -1265,10 +1264,7 @@
|
|
|
1265
1264
|
var num = 0;
|
|
1266
1265
|
for (var i = 0, len = aElems.length; i < len; i++) {
|
|
1267
1266
|
var e = aElems[i];
|
|
1268
|
-
if (e.src &&
|
|
1269
|
-
!e.async &&
|
|
1270
|
-
!e.defer &&
|
|
1271
|
-
0 !== (e.compareDocumentPosition(lastViewportElem) & 4)) {
|
|
1267
|
+
if (e.src && !e.async && !e.defer && 0 !== (e.compareDocumentPosition(lastViewportElem) & 4)) {
|
|
1272
1268
|
// If the script has a SRC and async is false and it occurs BEFORE the last viewport element,
|
|
1273
1269
|
// then increment the counter.
|
|
1274
1270
|
num++;
|
|
@@ -1498,8 +1494,6 @@
|
|
|
1498
1494
|
}
|
|
1499
1495
|
return getHighPercentileINP();
|
|
1500
1496
|
}
|
|
1501
|
-
// function simplified for our use, original would get the customerid from the script src URL
|
|
1502
|
-
// but we set it inside the code in this file, so this function just returns that
|
|
1503
1497
|
function getCustomerId() {
|
|
1504
1498
|
return LUX.customerid || "";
|
|
1505
1499
|
}
|
|
@@ -1609,12 +1603,7 @@
|
|
|
1609
1603
|
var vw = document.documentElement.clientWidth;
|
|
1610
1604
|
// Return true if the top-left corner is in the viewport and it has width & height.
|
|
1611
1605
|
var lt = findPos(e);
|
|
1612
|
-
return (lt[0] >= 0 &&
|
|
1613
|
-
lt[1] >= 0 &&
|
|
1614
|
-
lt[0] < vw &&
|
|
1615
|
-
lt[1] < vh &&
|
|
1616
|
-
e.offsetWidth > 0 &&
|
|
1617
|
-
e.offsetHeight > 0);
|
|
1606
|
+
return (lt[0] >= 0 && lt[1] >= 0 && lt[0] < vw && lt[1] < vh && e.offsetWidth > 0 && e.offsetHeight > 0);
|
|
1618
1607
|
}
|
|
1619
1608
|
// Return an array containing the top & left coordinates of the element.
|
|
1620
1609
|
// from http://www.quirksmode.org/js/findpos.html
|
|
@@ -1838,7 +1827,7 @@
|
|
|
1838
1827
|
!gSyncId ||
|
|
1839
1828
|
!_sample() || // OUTSIDE the sampled range
|
|
1840
1829
|
!gbLuxSent // LUX has NOT been sent yet, so wait to include it there
|
|
1841
|
-
|
|
1830
|
+
) {
|
|
1842
1831
|
return;
|
|
1843
1832
|
}
|
|
1844
1833
|
var sCustomerData = valuesToString(getUpdatedCustomData());
|
|
@@ -2083,6 +2072,14 @@
|
|
|
2083
2072
|
// Set "LUX.auto=false" to disable send results automatically and
|
|
2084
2073
|
// instead you must call LUX.send() explicitly.
|
|
2085
2074
|
if (globalConfig.auto) {
|
|
2075
|
+
var sendBeaconWhenVisible_1 = function () {
|
|
2076
|
+
if (globalConfig.trackHiddenPages) {
|
|
2077
|
+
_sendLux();
|
|
2078
|
+
}
|
|
2079
|
+
else {
|
|
2080
|
+
onVisible(_sendLux);
|
|
2081
|
+
}
|
|
2082
|
+
};
|
|
2086
2083
|
var sendBeaconAfterMinimumMeasureTime_1 = function () {
|
|
2087
2084
|
var elapsedTime = _now();
|
|
2088
2085
|
var timeRemaining = globalConfig.minMeasureTime - elapsedTime;
|
|
@@ -2093,12 +2090,12 @@
|
|
|
2093
2090
|
]);
|
|
2094
2091
|
if (document.readyState === "complete") {
|
|
2095
2092
|
// If onload has already passed, send the beacon now.
|
|
2096
|
-
|
|
2093
|
+
sendBeaconWhenVisible_1();
|
|
2097
2094
|
}
|
|
2098
2095
|
else {
|
|
2099
2096
|
// Ow, send the beacon slightly after window.onload.
|
|
2100
2097
|
addListener("load", function () {
|
|
2101
|
-
setTimeout(
|
|
2098
|
+
setTimeout(sendBeaconWhenVisible_1, 200);
|
|
2102
2099
|
});
|
|
2103
2100
|
}
|
|
2104
2101
|
}
|
|
@@ -2107,14 +2104,7 @@
|
|
|
2107
2104
|
setTimeout(sendBeaconAfterMinimumMeasureTime_1, timeRemaining);
|
|
2108
2105
|
}
|
|
2109
2106
|
};
|
|
2110
|
-
|
|
2111
|
-
// The trackHiddenPages config forces the beacon to be sent even when the page is not visible.
|
|
2112
|
-
sendBeaconAfterMinimumMeasureTime_1();
|
|
2113
|
-
}
|
|
2114
|
-
else {
|
|
2115
|
-
// Otherwise we only send the beacon when the page is visible.
|
|
2116
|
-
onVisible(sendBeaconAfterMinimumMeasureTime_1);
|
|
2117
|
-
}
|
|
2107
|
+
sendBeaconAfterMinimumMeasureTime_1();
|
|
2118
2108
|
}
|
|
2119
2109
|
// When newBeaconOnPageShow = true, we initiate a new page view whenever a page is restored from
|
|
2120
2110
|
// bfcache. Since we have no "onload" event to hook into after a bfcache restore, we rely on the
|
|
@@ -41,13 +41,6 @@
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
@include govuk-media-query($from: tablet) {
|
|
45
|
-
.gem-c-image-card.gem-c-image-card--two-thirds {
|
|
46
|
-
margin: 0 (- govuk-spacing(3)) govuk-spacing(6) (- govuk-spacing(3));
|
|
47
|
-
display: block;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
44
|
@include govuk-media-query($from: mobile, $until: tablet) {
|
|
52
45
|
.gem-c-image-card {
|
|
53
46
|
margin: 0 (- govuk-spacing(3)) govuk-spacing(6) (- govuk-spacing(3));
|
|
@@ -77,7 +70,6 @@
|
|
|
77
70
|
|
|
78
71
|
.gem-c-image-card__text-wrapper.gem-c-image-card__text-wrapper--two-thirds {
|
|
79
72
|
@include govuk-grid-column($width: two-thirds, $float: right, $at: tablet);
|
|
80
|
-
padding-left: 0;
|
|
81
73
|
}
|
|
82
74
|
}
|
|
83
75
|
|
|
@@ -91,6 +83,37 @@
|
|
|
91
83
|
border-bottom: none;
|
|
92
84
|
}
|
|
93
85
|
|
|
86
|
+
.gem-c-image-card.gem-c-image-card--two-thirds {
|
|
87
|
+
// Change default flex-direction from column-reverse
|
|
88
|
+
// so that the image and text appear in the same row,
|
|
89
|
+
// with the image to the left
|
|
90
|
+
flex-direction: row-reverse;
|
|
91
|
+
-ms-flex-direction: row-reverse;
|
|
92
|
+
// Wrap flex items onto a new line and ensure
|
|
93
|
+
// that items are aligned correctly
|
|
94
|
+
flex-wrap: wrap-reverse;
|
|
95
|
+
-ms-flex-wrap: wrap-reverse;
|
|
96
|
+
justify-content: flex-end;
|
|
97
|
+
align-items: flex-end;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.gem-c-image-card__image-wrapper.gem-c-image-card__image-wrapper--one-third {
|
|
101
|
+
// The first two values set flex-grow and flex-basis to 0
|
|
102
|
+
// This ensures that the flex item does not grow or shrink
|
|
103
|
+
// The the last value, sets flex-basis to 95px
|
|
104
|
+
// padding-left is set to 15px and the image used is 80px wide
|
|
105
|
+
flex: 0 0 95px;
|
|
106
|
+
padding-right: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.gem-c-image-card__text-wrapper.gem-c-image-card__text-wrapper--two-thirds {
|
|
110
|
+
// The first two values set flex-grow and flex-basis to 1
|
|
111
|
+
// This allows the flex item contain the image card text to grow or shrink
|
|
112
|
+
// The last value, sets flex-basis to 70%
|
|
113
|
+
// If the width of the flex-item shrinks below 70%, it will wrap onto a new line
|
|
114
|
+
flex: 1 1 70%;
|
|
115
|
+
}
|
|
116
|
+
|
|
94
117
|
.gem-c-image-card__title {
|
|
95
118
|
margin: 0;
|
|
96
119
|
}
|
|
@@ -8,7 +8,7 @@ $search-width-or-height: $black-bar-height;
|
|
|
8
8
|
$pseudo-underline-height: 3px;
|
|
9
9
|
$button-pipe-colour: darken(govuk-colour("mid-grey"), 20%);
|
|
10
10
|
|
|
11
|
-
$large-navbar-height:
|
|
11
|
+
$large-navbar-height: 72px;
|
|
12
12
|
|
|
13
13
|
$pale-blue-colour: #d2e2f1;
|
|
14
14
|
|
|
@@ -630,6 +630,12 @@ $after-button-padding-left: govuk-spacing(4);
|
|
|
630
630
|
color: govuk-colour("white");
|
|
631
631
|
}
|
|
632
632
|
|
|
633
|
+
&:focus-visible {
|
|
634
|
+
&.gem-c-layout-super-navigation-header__search-toggle-button--blue-background {
|
|
635
|
+
border-bottom: $pseudo-underline-height solid govuk-colour("black");
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
|
|
633
639
|
@include govuk-media-query($from: "desktop") {
|
|
634
640
|
border: 0;
|
|
635
641
|
margin: 0;
|
|
@@ -654,15 +660,21 @@ $after-button-padding-left: govuk-spacing(4);
|
|
|
654
660
|
|
|
655
661
|
// stylelint-disable max-nesting-depth
|
|
656
662
|
@include focus-not-focus-visible {
|
|
657
|
-
border-bottom:
|
|
663
|
+
border-bottom: $pseudo-underline-height solid $govuk-brand-colour;
|
|
664
|
+
|
|
665
|
+
&:hover {
|
|
666
|
+
border-bottom: $pseudo-underline-height solid govuk-colour("white");
|
|
667
|
+
}
|
|
658
668
|
}
|
|
659
669
|
// stylelint-enable max-nesting-depth
|
|
660
670
|
}
|
|
661
671
|
|
|
662
672
|
&:focus-visible {
|
|
663
673
|
&.gem-c-layout-super-navigation-header__search-toggle-button--blue-background {
|
|
674
|
+
color: govuk-colour("black");
|
|
675
|
+
|
|
664
676
|
&:hover {
|
|
665
|
-
border-bottom: $pseudo-underline-height solid
|
|
677
|
+
border-bottom: $pseudo-underline-height solid govuk-colour("black");
|
|
666
678
|
color: govuk-colour("black");
|
|
667
679
|
}
|
|
668
680
|
}
|
|
@@ -679,9 +691,14 @@ $after-button-padding-left: govuk-spacing(4);
|
|
|
679
691
|
&.gem-c-layout-super-navigation-header__open-button {
|
|
680
692
|
&.gem-c-layout-super-navigation-header__search-toggle-button--blue-background {
|
|
681
693
|
&:hover {
|
|
682
|
-
border-bottom: $pseudo-underline-height solid govuk-colour("
|
|
694
|
+
border-bottom: $pseudo-underline-height solid govuk-colour("light-grey");
|
|
683
695
|
color: govuk-colour("white");
|
|
684
696
|
}
|
|
697
|
+
|
|
698
|
+
&:focus-visible {
|
|
699
|
+
border-bottom: $pseudo-underline-height solid govuk-colour("black");
|
|
700
|
+
color: govuk-colour("black");
|
|
701
|
+
}
|
|
685
702
|
}
|
|
686
703
|
|
|
687
704
|
@include focus-and-focus-visible {
|
|
@@ -704,6 +721,10 @@ $after-button-padding-left: govuk-spacing(4);
|
|
|
704
721
|
border-bottom-color: govuk-colour("light-grey");
|
|
705
722
|
color: govuk-colour("light-grey");
|
|
706
723
|
outline: 1px solid govuk-colour("light-grey"); // overlap the border of the nav menu so it won't appear when menu open
|
|
724
|
+
|
|
725
|
+
&:hover {
|
|
726
|
+
border-bottom: $pseudo-underline-height solid govuk-colour("light-grey");
|
|
727
|
+
}
|
|
707
728
|
}
|
|
708
729
|
}
|
|
709
730
|
}
|
|
@@ -726,7 +747,7 @@ $after-button-padding-left: govuk-spacing(4);
|
|
|
726
747
|
}
|
|
727
748
|
|
|
728
749
|
.gem-c-layout-super-navigation-header__search-container {
|
|
729
|
-
padding-bottom: govuk-spacing(
|
|
750
|
+
padding-bottom: govuk-spacing(7);
|
|
730
751
|
}
|
|
731
752
|
|
|
732
753
|
// Dropdown menu.
|
|
@@ -740,7 +761,23 @@ $after-button-padding-left: govuk-spacing(4);
|
|
|
740
761
|
padding-top: govuk-spacing(6);
|
|
741
762
|
|
|
742
763
|
@include govuk-media-query($from: "desktop") {
|
|
743
|
-
padding-top: govuk-spacing(
|
|
764
|
+
padding-top: govuk-spacing(8);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
.gem-c-layout-super-navigation-header__navigation-dropdown-menu--large-navbar {
|
|
769
|
+
@include govuk-media-query($until: "desktop") {
|
|
770
|
+
.gem-c-layout-super-navigation-header__search-items {
|
|
771
|
+
margin: 0 24px;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
@include govuk-media-query($until: "tablet") {
|
|
777
|
+
// padding to make it the same as the padding for the redesign of the homepage
|
|
778
|
+
.gem-c-layout-super-navigation-header__navigation-dropdown-menu--large-navbar .gem-c-layout-super-navigation-header__column--services-and-information,
|
|
779
|
+
.gem-c-layout-super-navigation-header__navigation-dropdown-menu--large-navbar .gem-c-layout-super-navigation-header__column--government-activity {
|
|
780
|
+
padding: 0 24px;
|
|
744
781
|
}
|
|
745
782
|
}
|
|
746
783
|
|
|
@@ -814,6 +851,11 @@ $after-button-padding-left: govuk-spacing(4);
|
|
|
814
851
|
}
|
|
815
852
|
}
|
|
816
853
|
|
|
854
|
+
.gem-c-layout-super-navigation-header__navigation-dropdown-menu--large-navbar .gem-c-layout-super-navigation-header__navigation-second-item-link {
|
|
855
|
+
font-size: 19px;
|
|
856
|
+
font-size: govuk-px-to-rem(19px);
|
|
857
|
+
}
|
|
858
|
+
|
|
817
859
|
.gem-c-layout-super-navigation-header__navigation-second-item-link--with-description {
|
|
818
860
|
font-size: 16px;
|
|
819
861
|
font-size: govuk-px-to-rem(16px);
|
|
@@ -825,16 +867,27 @@ $after-button-padding-left: govuk-spacing(4);
|
|
|
825
867
|
}
|
|
826
868
|
}
|
|
827
869
|
|
|
828
|
-
.gem-c-layout-super-navigation-header__navigation-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
870
|
+
.gem-c-layout-super-navigation-header__navigation-top-toggle-button--large-navbar {
|
|
871
|
+
.gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner {
|
|
872
|
+
padding-left: 26px;
|
|
873
|
+
padding-right: 26px;
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
.gem-c-layout-super-navigation-header__search-toggle-button--large-navbar {
|
|
878
|
+
padding-left: 24px;
|
|
879
|
+
padding-right: 24px;
|
|
880
|
+
width: 68px;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
.gem-c-layout-super-navigation-header__navigation-dropdown-menu--large-navbar .gem-c-layout-super-navigation-header__navigation-second-item-description {
|
|
884
|
+
font-size: 19px;
|
|
885
|
+
font-size: govuk-px-to-rem(19px);
|
|
886
|
+
margin-top: govuk-spacing(2);
|
|
834
887
|
}
|
|
835
888
|
|
|
836
889
|
.gem-c-layout-super-navigation-header__search-form {
|
|
837
|
-
padding:
|
|
890
|
+
padding: 0 0 govuk-spacing(8) 0;
|
|
838
891
|
}
|
|
839
892
|
|
|
840
893
|
// Popular links.
|
|
@@ -854,6 +907,11 @@ $after-button-padding-left: govuk-spacing(4);
|
|
|
854
907
|
}
|
|
855
908
|
}
|
|
856
909
|
|
|
910
|
+
.gem-c-layout-super-navigation-header__navigation-dropdown-menu--large-navbar .gem-c-layout-super-navigation-header__popular-link {
|
|
911
|
+
font-size: 19px;
|
|
912
|
+
font-size: govuk-px-to-rem(19px);
|
|
913
|
+
}
|
|
914
|
+
|
|
857
915
|
.gem-c-layout-super-navigation-header__width-container {
|
|
858
916
|
@include govuk-media-query($until: "desktop") {
|
|
859
917
|
margin: 0;
|
|
@@ -894,12 +952,12 @@ $after-button-padding-left: govuk-spacing(4);
|
|
|
894
952
|
}
|
|
895
953
|
|
|
896
954
|
.gem-c-layout-super-navigation-header__logotype-crown--large-navbar {
|
|
897
|
-
height:
|
|
898
|
-
width:
|
|
955
|
+
height: 32px;
|
|
956
|
+
width: 44px;
|
|
899
957
|
}
|
|
900
958
|
|
|
901
959
|
.gem-c-header__link--large-navbar:focus {
|
|
902
|
-
box-shadow: 0 -
|
|
960
|
+
box-shadow: 0 -6px 0 12px $govuk-focus-colour;
|
|
903
961
|
border-bottom: $govuk-focus-width solid govuk-colour("black");
|
|
904
962
|
padding-bottom: 10px;
|
|
905
963
|
}
|
|
@@ -909,17 +967,14 @@ $after-button-padding-left: govuk-spacing(4);
|
|
|
909
967
|
}
|
|
910
968
|
|
|
911
969
|
.gem-c-layout-super-navigation-header__header-logo--large-navbar {
|
|
912
|
-
height:
|
|
913
|
-
padding-bottom: govuk-spacing(
|
|
914
|
-
padding-top: govuk-spacing(
|
|
970
|
+
height: 32px;
|
|
971
|
+
padding-bottom: govuk-spacing(4);
|
|
972
|
+
padding-top: govuk-spacing(4);
|
|
915
973
|
}
|
|
916
974
|
|
|
917
975
|
.gem-c-layout-super-navigation-header__search-toggle-button--large-navbar {
|
|
918
976
|
height: $large-navbar-height;
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
// to stop the search icon moving on hover
|
|
922
|
-
.gem-c-layout-super-navigation-header__search-toggle-button--large-navbar:hover {
|
|
977
|
+
// to stop the search icon moving on hover
|
|
923
978
|
padding-bottom: 12px;
|
|
924
979
|
}
|
|
925
980
|
|
|
@@ -931,3 +986,19 @@ $after-button-padding-left: govuk-spacing(4);
|
|
|
931
986
|
height: $large-navbar-height;
|
|
932
987
|
}
|
|
933
988
|
}
|
|
989
|
+
|
|
990
|
+
@include govuk-media-query($until: tablet) {
|
|
991
|
+
.gem-c-layout-super-navigation-header__popular-links-heading--large-navbar {
|
|
992
|
+
font-size: 24px;
|
|
993
|
+
font-size: govuk-px-to-rem(24px);
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
// can't disable responsive styling because using override classes
|
|
997
|
+
// from govuk-frontend which are all responsive so have to supply
|
|
998
|
+
// custom class to the label of the search component to turn off
|
|
999
|
+
// the responsive font size
|
|
1000
|
+
.gem-c-layout-super-navigation-header__search-label--large-navbar {
|
|
1001
|
+
font-size: 24px;
|
|
1002
|
+
font-size: govuk-px-to-rem(24px);
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
@@ -91,6 +91,19 @@ $large-input-size: 50px;
|
|
|
91
91
|
&:focus {
|
|
92
92
|
@include gem-c-search-input-focus;
|
|
93
93
|
}
|
|
94
|
+
|
|
95
|
+
// Note: this is a non-standard CSS feature and will not do anything in Firefox. https://bugzilla.mozilla.org/show_bug.cgi?id=1417753
|
|
96
|
+
&::-webkit-search-cancel-button {
|
|
97
|
+
-webkit-appearance: none;
|
|
98
|
+
background-image: image-url("govuk_publishing_components/icon-close.svg");
|
|
99
|
+
background-position: center;
|
|
100
|
+
background-repeat: no-repeat;
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
height: 20px;
|
|
103
|
+
margin-left: 0;
|
|
104
|
+
margin-right: 0;
|
|
105
|
+
width: 20px;
|
|
106
|
+
}
|
|
94
107
|
}
|
|
95
108
|
|
|
96
109
|
@mixin icon-positioning($container-size) {
|
|
@@ -46,14 +46,12 @@
|
|
|
46
46
|
event_name: "select_content",
|
|
47
47
|
type: "accordion",
|
|
48
48
|
text: heading_text,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
index_section_count: items.length,
|
|
52
|
-
},
|
|
49
|
+
index_section: index,
|
|
50
|
+
index_section_count: items.length,
|
|
53
51
|
}.to_json
|
|
54
52
|
|
|
55
|
-
# These attributes have been created separately from the item[:data_attributes]
|
|
56
|
-
# object in order to keep them from colliding with GA4 event tracking and UA
|
|
53
|
+
# These attributes have been created separately from the item[:data_attributes]
|
|
54
|
+
# object in order to keep them from colliding with GA4 event tracking and UA
|
|
57
55
|
# tracking attributes
|
|
58
56
|
ga4_link_data_attributes = {}
|
|
59
57
|
ga4_link_data_attributes[:module] = "ga4-link-tracker"
|
|
@@ -63,10 +61,8 @@
|
|
|
63
61
|
event_name: "navigation",
|
|
64
62
|
type: "accordion",
|
|
65
63
|
section: heading_text,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
index_section_count: (items.length),
|
|
69
|
-
}
|
|
64
|
+
index_section: index,
|
|
65
|
+
index_section_count: (items.length),
|
|
70
66
|
}.to_json
|
|
71
67
|
end
|
|
72
68
|
|
|
@@ -94,9 +90,9 @@
|
|
|
94
90
|
<%= tag.div(item[:summary][:text], id: "#{id}-summary-#{index}", class: summary_classes) if item[:summary].present? %>
|
|
95
91
|
<% end %>
|
|
96
92
|
<%= tag.div(
|
|
97
|
-
item[:content][:html],
|
|
98
|
-
id: "#{id}-content-#{index}",
|
|
99
|
-
class: "govuk-accordion__section-content",
|
|
93
|
+
item[:content][:html],
|
|
94
|
+
id: "#{id}-content-#{index}",
|
|
95
|
+
class: "govuk-accordion__section-content",
|
|
100
96
|
'aria-labelledby': "#{id}-heading-#{index}",
|
|
101
97
|
data: ga4_link_data_attributes
|
|
102
98
|
) %>
|
|
@@ -44,9 +44,7 @@
|
|
|
44
44
|
<% link_text = format_numbers ? cl_helper.wrap_numbers_with_spans(contents_item[:text]) : contents_item[:text]
|
|
45
45
|
if ga4_tracking
|
|
46
46
|
ga4_data[:event_name] = cl_helper.get_ga4_event_name(contents_item[:href]) if contents_item[:href]
|
|
47
|
-
ga4_data[:
|
|
48
|
-
"index_link": index_link,
|
|
49
|
-
}
|
|
47
|
+
ga4_data[:index_link] = index_link
|
|
50
48
|
end
|
|
51
49
|
%>
|
|
52
50
|
<%= link_to_if !contents_item[:active], link_text, contents_item[:href],
|
|
@@ -69,9 +67,7 @@
|
|
|
69
67
|
<%
|
|
70
68
|
if ga4_tracking
|
|
71
69
|
ga4_data[:event_name] = cl_helper.get_ga4_event_name(nested_contents_item[:href]) if nested_contents_item[:href]
|
|
72
|
-
ga4_data[:
|
|
73
|
-
"index_link": index_link,
|
|
74
|
-
}
|
|
70
|
+
ga4_data[:index_link] = index_link
|
|
75
71
|
end
|
|
76
72
|
%>
|
|
77
73
|
<%= link_to_if !nested_contents_item[:active], nested_contents_item[:text], nested_contents_item[:href],
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
|
|
35
35
|
ga4_tracking ||= false
|
|
36
36
|
suggestion_data_attributes[:module] = "#{suggestion_data_attributes[:module]} ga4-link-tracker".strip if ga4_tracking
|
|
37
|
-
suggestion_data_attributes[:ga4_link] = { event_name: "navigation", type: "intervention", section: suggestion_text,
|
|
37
|
+
suggestion_data_attributes[:ga4_link] = { event_name: "navigation", type: "intervention", section: suggestion_text, index_link: 1, index_total: 1 }.to_json if ga4_tracking
|
|
38
38
|
data_attributes[:ga4_intervention_banner] = "" if ga4_tracking # Added to the parent element for the GA4 pageview object to use
|
|
39
39
|
|
|
40
40
|
suggestion_tag_options = {
|
|
@@ -107,11 +107,9 @@
|
|
|
107
107
|
data-ga4-link="<%= {
|
|
108
108
|
"event_name": "navigation",
|
|
109
109
|
"section": "Licence",
|
|
110
|
-
"
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"index_section_count": layout_footer_helper.ga4_index_section_count.to_s,
|
|
114
|
-
},
|
|
110
|
+
"index_section": layout_footer_helper.ga4_ogl_link_index_section.to_s,
|
|
111
|
+
"index_link": "1",
|
|
112
|
+
"index_section_count": layout_footer_helper.ga4_index_section_count.to_s,
|
|
115
113
|
"text": "Open Government Licence v3.0",
|
|
116
114
|
"index_total": "1",
|
|
117
115
|
"type": "footer",
|
|
@@ -132,11 +130,9 @@
|
|
|
132
130
|
data-ga4-link="<%= {
|
|
133
131
|
"event_name": "navigation",
|
|
134
132
|
"section": "Copyright",
|
|
135
|
-
"
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
"index_section_count": layout_footer_helper.ga4_index_section_count.to_s,
|
|
139
|
-
},
|
|
133
|
+
"index_section": layout_footer_helper.ga4_copyright_link_index_section.to_s,
|
|
134
|
+
"index_link": "1",
|
|
135
|
+
"index_section_count": layout_footer_helper.ga4_index_section_count.to_s,
|
|
140
136
|
"text": "© Crown copyright",
|
|
141
137
|
"index_total": "1",
|
|
142
138
|
"type": "footer",
|
data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb
CHANGED
|
@@ -65,7 +65,11 @@
|
|
|
65
65
|
button_container_classes = %w(gem-c-layout-super-navigation-header__button-container)
|
|
66
66
|
button_container_classes << "gem-c-layout-super-navigation-header__button-container--large-navbar" if large_navbar
|
|
67
67
|
|
|
68
|
+
dropdown_menu_classes = %w(gem-c-layout-super-navigation-header__navigation-dropdown-menu)
|
|
69
|
+
dropdown_menu_classes << "gem-c-layout-super-navigation-header__navigation-dropdown-menu--large-navbar" if large_navbar
|
|
68
70
|
|
|
71
|
+
popular_links_heading_classes = %w(govuk-heading-m)
|
|
72
|
+
popular_links_heading_classes << "gem-c-layout-super-navigation-header__popular-links-heading--large-navbar" if large_navbar
|
|
69
73
|
%>
|
|
70
74
|
<%= content_tag("header",
|
|
71
75
|
{
|
|
@@ -96,11 +100,9 @@
|
|
|
96
100
|
"external": "false",
|
|
97
101
|
"text": "GOV.UK",
|
|
98
102
|
"section": "Logo",
|
|
99
|
-
"
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
"index_section_count": 2,
|
|
103
|
-
},
|
|
103
|
+
"index_link": 1,
|
|
104
|
+
"index_section": 0,
|
|
105
|
+
"index_section_count": 2,
|
|
104
106
|
"index_total": 1
|
|
105
107
|
}.to_json
|
|
106
108
|
},
|
|
@@ -109,6 +111,11 @@
|
|
|
109
111
|
label: logo_link_title,
|
|
110
112
|
}
|
|
111
113
|
} do %>
|
|
114
|
+
<% if hide_logo_text %>
|
|
115
|
+
<span class="govuk-visually-hidden">
|
|
116
|
+
<%= logo_text %>
|
|
117
|
+
</span>
|
|
118
|
+
<% end %>
|
|
112
119
|
<span class="govuk-header__logotype">
|
|
113
120
|
<!--[if gt IE 8]><!-->
|
|
114
121
|
<%= content_tag(:svg, {
|
|
@@ -117,7 +124,7 @@
|
|
|
117
124
|
},
|
|
118
125
|
class: logotype_classes,
|
|
119
126
|
height: "30",
|
|
120
|
-
width: "36",
|
|
127
|
+
width: "36",
|
|
121
128
|
focusable: "false",
|
|
122
129
|
viewBox: "0 0 132 97",
|
|
123
130
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -198,10 +205,8 @@
|
|
|
198
205
|
event_name: "select_content",
|
|
199
206
|
type: "header menu bar",
|
|
200
207
|
text: link[:label],
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
index_section_count: 2,
|
|
204
|
-
},
|
|
208
|
+
index_section: 1,
|
|
209
|
+
index_section_count: 2,
|
|
205
210
|
section: link[:label]
|
|
206
211
|
}
|
|
207
212
|
},
|
|
@@ -232,10 +237,8 @@
|
|
|
232
237
|
"event_name": "select_content",
|
|
233
238
|
"type": "header menu bar",
|
|
234
239
|
"text": "Search",
|
|
235
|
-
"
|
|
236
|
-
|
|
237
|
-
"index_section_count": 2,
|
|
238
|
-
},
|
|
240
|
+
"index_section": 2,
|
|
241
|
+
"index_section_count": 2,
|
|
239
242
|
"section": "Search"
|
|
240
243
|
}.to_json
|
|
241
244
|
}"
|
|
@@ -276,10 +279,11 @@
|
|
|
276
279
|
<% end %>
|
|
277
280
|
</div>
|
|
278
281
|
|
|
279
|
-
|
|
280
|
-
id
|
|
281
|
-
|
|
282
|
-
|
|
282
|
+
<%= content_tag(:div, {
|
|
283
|
+
id: "super-navigation-menu-#{unique_id}",
|
|
284
|
+
hidden: "",
|
|
285
|
+
class: dropdown_menu_classes,
|
|
286
|
+
}) do %>
|
|
283
287
|
<div class="govuk-width-container">
|
|
284
288
|
<div class="govuk-grid-row gem-c-layout-super-navigation-header__navigation-items">
|
|
285
289
|
|
|
@@ -320,11 +324,9 @@
|
|
|
320
324
|
ga4_link: {
|
|
321
325
|
"event_name": "navigation",
|
|
322
326
|
"type": "header menu bar",
|
|
323
|
-
"
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
"index_section_count": 4,
|
|
327
|
-
},
|
|
327
|
+
"index_section": column_index + 1,
|
|
328
|
+
"index_link": index + 1,
|
|
329
|
+
"index_section_count": 4,
|
|
328
330
|
"index_total": index_total,
|
|
329
331
|
"section": column[:label],
|
|
330
332
|
}
|
|
@@ -338,9 +340,13 @@
|
|
|
338
340
|
<% end %>
|
|
339
341
|
</div>
|
|
340
342
|
</div>
|
|
341
|
-
|
|
343
|
+
<% end %>
|
|
342
344
|
|
|
343
|
-
|
|
345
|
+
<%= content_tag(:div, {
|
|
346
|
+
id: "super-search-menu",
|
|
347
|
+
hidden: "",
|
|
348
|
+
class: dropdown_menu_classes,
|
|
349
|
+
}) do %>
|
|
344
350
|
<div class="govuk-width-container gem-c-layout-super-navigation-header__search-container gem-c-layout-super-navigation-header__search-items">
|
|
345
351
|
<h3 class="govuk-visually-hidden">
|
|
346
352
|
<%= navigation_search_subheading %>
|
|
@@ -353,6 +359,7 @@
|
|
|
353
359
|
data-module="ga4-form-tracker"
|
|
354
360
|
data-ga4-form='{ "event_name": "search", "type": "header menu bar", "section": "Search GOV.UK", "action": "search", "url": "/search/all" }'
|
|
355
361
|
data-ga4-form-include-text
|
|
362
|
+
data-ga4-form-no-answer-undefined
|
|
356
363
|
action="/search"
|
|
357
364
|
method="get"
|
|
358
365
|
role="search"
|
|
@@ -362,7 +369,9 @@
|
|
|
362
369
|
inline_label: false,
|
|
363
370
|
label_size: "m",
|
|
364
371
|
label_text: search_text,
|
|
372
|
+
label_custom_class: "gem-c-layout-super-navigation-header__search-label--large-navbar",
|
|
365
373
|
size: "large",
|
|
374
|
+
margin_bottom: 0,
|
|
366
375
|
data_attributes: {
|
|
367
376
|
track_category: "headerClicked",
|
|
368
377
|
track_action: "searchSubmitted",
|
|
@@ -376,7 +385,11 @@
|
|
|
376
385
|
</div>
|
|
377
386
|
<div class="govuk-grid-row">
|
|
378
387
|
<div class="govuk-grid-column-full">
|
|
379
|
-
|
|
388
|
+
<%= content_tag(:h3, {
|
|
389
|
+
class: popular_links_heading_classes
|
|
390
|
+
}) do %>
|
|
391
|
+
<%= popular_links_heading %>
|
|
392
|
+
<% end %>
|
|
380
393
|
<ul class="govuk-list">
|
|
381
394
|
<% index_total = popular_links.length %>
|
|
382
395
|
<% popular_links.each_with_index do | popular_link, index | %>
|
|
@@ -395,11 +408,9 @@
|
|
|
395
408
|
ga4_link: {
|
|
396
409
|
"event_name": "navigation",
|
|
397
410
|
"type": "header menu bar",
|
|
398
|
-
"
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
"index_section_count": 4,
|
|
402
|
-
},
|
|
411
|
+
"index_section": 4,
|
|
412
|
+
"index_link": index + 1,
|
|
413
|
+
"index_section_count": 4,
|
|
403
414
|
"index_total": index_total,
|
|
404
415
|
"section": popular_links_heading,
|
|
405
416
|
}
|
|
@@ -411,7 +422,7 @@
|
|
|
411
422
|
</div>
|
|
412
423
|
</div>
|
|
413
424
|
</div>
|
|
414
|
-
|
|
425
|
+
<% end %>
|
|
415
426
|
</nav>
|
|
416
427
|
</div>
|
|
417
428
|
<% end %>
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
label_margin_bottom ||= nil
|
|
12
12
|
label_size ||= nil
|
|
13
13
|
label_text ||= t("components.search_box.label")
|
|
14
|
+
label_custom_class ||= nil
|
|
14
15
|
name ||= "q"
|
|
15
16
|
homepage ||= false
|
|
16
17
|
no_border ||= false
|
|
@@ -42,6 +43,7 @@
|
|
|
42
43
|
label_classes << "gem-c-search__label"
|
|
43
44
|
end
|
|
44
45
|
label_classes << "govuk-!-margin-bottom-#{label_margin_bottom}" if [*1..9].include?(label_margin_bottom) and local_assigns.include?(:inline_label)
|
|
46
|
+
label_classes << label_custom_class if label_custom_class
|
|
45
47
|
|
|
46
48
|
tag_label = capture do
|
|
47
49
|
tag.label(for: id, class: label_classes) do
|
|
@@ -54,9 +54,7 @@
|
|
|
54
54
|
ga4_link_data = {
|
|
55
55
|
'event_name': 'navigation',
|
|
56
56
|
'type': 'share page',
|
|
57
|
-
'
|
|
58
|
-
'index_link': index + 1,
|
|
59
|
-
},
|
|
57
|
+
'index_link': index + 1,
|
|
60
58
|
'index_total': links.length,
|
|
61
59
|
'text': link[:icon],
|
|
62
60
|
}
|
|
@@ -65,9 +63,7 @@
|
|
|
65
63
|
ga4_link_data = {
|
|
66
64
|
'event_name': 'navigation',
|
|
67
65
|
'type': 'follow us',
|
|
68
|
-
'
|
|
69
|
-
'index_link': index + 1,
|
|
70
|
-
},
|
|
66
|
+
'index_link': index + 1,
|
|
71
67
|
'index_total': links.length
|
|
72
68
|
}
|
|
73
69
|
end
|
|
@@ -84,10 +84,8 @@
|
|
|
84
84
|
"ga4-link": {
|
|
85
85
|
"event_name": "navigation",
|
|
86
86
|
"type": "step by step",
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
"index_section_count": steps.length
|
|
90
|
-
},
|
|
87
|
+
"index_section": step_index + 1,
|
|
88
|
+
"index_section_count": steps.length,
|
|
91
89
|
"section": step[:title]
|
|
92
90
|
}.to_json
|
|
93
91
|
}
|
|
@@ -26,6 +26,15 @@
|
|
|
26
26
|
tracking_options ||= ({ dimension96: tracking_id }).to_json
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
+
if ga4_tracking
|
|
30
|
+
ga4_data = {
|
|
31
|
+
event_name: "navigation",
|
|
32
|
+
type: "super breadcrumb",
|
|
33
|
+
index_link: "1",
|
|
34
|
+
index_total: "1",
|
|
35
|
+
}.to_json
|
|
36
|
+
end
|
|
37
|
+
|
|
29
38
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
|
30
39
|
classes = %w[gem-c-step-nav-header]
|
|
31
40
|
classes << shared_helper.get_margin_bottom if local_assigns[:margin_bottom]
|
|
@@ -44,7 +53,7 @@
|
|
|
44
53
|
data-track-action="<%= tracking_action %>"
|
|
45
54
|
data-track-label="<%= tracking_label %>"
|
|
46
55
|
<% if ga4_tracking %>
|
|
47
|
-
data-ga4-link='
|
|
56
|
+
data-ga4-link='<%= ga4_data %>'
|
|
48
57
|
<% end %>
|
|
49
58
|
<% if tracking_dimension_enabled %>
|
|
50
59
|
data-track-dimension="<%= tracking_dimension %>"
|
|
@@ -23,13 +23,11 @@
|
|
|
23
23
|
data-track-dimension="<%= links[0][:text] %>"
|
|
24
24
|
data-track-dimension-index="29"
|
|
25
25
|
data-track-options='{"dimension96" : "<%= links[0][:tracking_id] %>" }'
|
|
26
|
-
<% if ga4_tracking
|
|
26
|
+
<% if ga4_tracking
|
|
27
27
|
ga4_attributes = {
|
|
28
28
|
event_name: "navigation",
|
|
29
29
|
type: "part of",
|
|
30
|
-
|
|
31
|
-
"index_link": "1"
|
|
32
|
-
},
|
|
30
|
+
"index_link": "1",
|
|
33
31
|
index_total: "1",
|
|
34
32
|
section: pretitle,
|
|
35
33
|
}.to_json
|
|
@@ -53,13 +51,11 @@
|
|
|
53
51
|
data-track-dimension="<%= link[:text] %>"
|
|
54
52
|
data-track-dimension-index="29"
|
|
55
53
|
data-track-options='{"dimension96" : "<%= link[:tracking_id] %>" }'
|
|
56
|
-
<% if ga4_tracking
|
|
54
|
+
<% if ga4_tracking
|
|
57
55
|
ga4_attributes = {
|
|
58
56
|
event_name: "navigation",
|
|
59
57
|
type: "part of",
|
|
60
|
-
index
|
|
61
|
-
"index_link": (index + 1).to_s
|
|
62
|
-
},
|
|
58
|
+
index_link: (index + 1).to_s,
|
|
63
59
|
index_total: (links.length).to_s,
|
|
64
60
|
section: pretitle,
|
|
65
61
|
}.to_json
|
|
@@ -34,10 +34,8 @@
|
|
|
34
34
|
event_name: "select_content",
|
|
35
35
|
type: "tabs",
|
|
36
36
|
text: tab[:label],
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
index_section_count: tabs.length,
|
|
40
|
-
},
|
|
37
|
+
index_section: index + 1,
|
|
38
|
+
index_section_count: tabs.length,
|
|
41
39
|
}
|
|
42
40
|
ga4_attributes[:event_name] = "navigation" if as_links
|
|
43
41
|
tab[:tab_data_attributes][:ga4_link] = ga4_attributes if as_links
|
data/app/views/govuk_publishing_components/components/contextual_sidebar/_ukraine_cta.html.erb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<%
|
|
1
|
+
<%
|
|
2
2
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
|
3
3
|
title = t("components.related_navigation.ukraine.title")
|
|
4
4
|
lang = shared_helper.t_locale("components.related_navigation.ukraine.title")
|
|
@@ -15,11 +15,9 @@
|
|
|
15
15
|
ga4_attributes = {
|
|
16
16
|
event_name: "navigation",
|
|
17
17
|
type: "related content",
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
index_section_count: "#{ga4_tracking_counts.index_section_count}",
|
|
22
|
-
},
|
|
18
|
+
index_section: "#{ga4_tracking_counts.index_section_count}",
|
|
19
|
+
index_link: "#{index + 1}",
|
|
20
|
+
index_section_count: "#{ga4_tracking_counts.index_section_count}",
|
|
23
21
|
index_total: "#{index_total}",
|
|
24
22
|
section: title,
|
|
25
23
|
} if ga4_tracking
|
|
@@ -205,8 +205,8 @@ examples:
|
|
|
205
205
|
<div class="govuk-!-width-full">
|
|
206
206
|
<%= component %>
|
|
207
207
|
</div>
|
|
208
|
-
|
|
209
|
-
description: This variant is used for the featured section on the homepage
|
|
208
|
+
two_thirds:
|
|
209
|
+
description: This variant is used for the featured section on the homepage. The aspect ratio used is 1:1 and the width of the image is constrained to 80px wide.
|
|
210
210
|
data:
|
|
211
211
|
two_thirds: true
|
|
212
212
|
href: "/still-not-a-page"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<% end %>
|
|
25
25
|
|
|
26
26
|
<ul class="gem-c-related-navigation__link-list">
|
|
27
|
-
<%
|
|
27
|
+
<%
|
|
28
28
|
constructed_link_array = []
|
|
29
29
|
section_link_limit = related_nav_helper.calculate_section_link_limit(links)
|
|
30
30
|
index_total = links.length
|
|
@@ -35,11 +35,9 @@
|
|
|
35
35
|
ga4_attributes = {
|
|
36
36
|
event_name: "navigation",
|
|
37
37
|
type: ga4_type,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
index_section_count: "#{section_count}",
|
|
42
|
-
},
|
|
38
|
+
index_section: "#{section_index}",
|
|
39
|
+
index_link: "#{index}",
|
|
40
|
+
index_section_count: "#{section_count}",
|
|
43
41
|
index_total: "#{index_total}",
|
|
44
42
|
section: ga4_heading_text,
|
|
45
43
|
} if ga4_tracking
|
|
@@ -70,7 +68,7 @@
|
|
|
70
68
|
|
|
71
69
|
<% if links.length > section_link_limit %>
|
|
72
70
|
<%
|
|
73
|
-
classes = "gem-c-related-navigation__link toggle-wrap"
|
|
71
|
+
classes = "gem-c-related-navigation__link toggle-wrap"
|
|
74
72
|
data_attributes_li = { module: "ga4-event-tracker" } if ga4_tracking
|
|
75
73
|
data_attributes_link = {
|
|
76
74
|
controls: "toggle_#{section_title}",
|
|
@@ -83,7 +81,7 @@
|
|
|
83
81
|
<%= link_to("#", class: "gem-c-related-navigation__toggle", data: data_attributes_link) do %>
|
|
84
82
|
<%= t("common.toggle_more",
|
|
85
83
|
show: t('common.show'),
|
|
86
|
-
number: related_nav_helper.remaining_link_count(links)) %>
|
|
84
|
+
number: related_nav_helper.remaining_link_count(links)) %>
|
|
87
85
|
<% end %>
|
|
88
86
|
<% end %>
|
|
89
87
|
|
|
@@ -23,11 +23,9 @@ module GovukPublishingComponents
|
|
|
23
23
|
{
|
|
24
24
|
"event_name": "navigation",
|
|
25
25
|
"type": "footer",
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"index_section_count": @ga4_index_section_count.to_s,
|
|
30
|
-
},
|
|
26
|
+
"index_link": (index_link + 1).to_s,
|
|
27
|
+
"index_section": (index_section + 1).to_s,
|
|
28
|
+
"index_section_count": @ga4_index_section_count.to_s,
|
|
31
29
|
"index_total": index_total.to_s,
|
|
32
30
|
"section": section,
|
|
33
31
|
}
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: govuk_publishing_components
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 35.
|
|
4
|
+
version: 35.20.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GOV.UK Dev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-10-
|
|
11
|
+
date: 2023-10-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: govuk_app_config
|
|
@@ -418,6 +418,7 @@ files:
|
|
|
418
418
|
- app/assets/images/govuk_publishing_components/govuk-schema-placeholder-16x9.png
|
|
419
419
|
- app/assets/images/govuk_publishing_components/govuk-schema-placeholder-1x1.png
|
|
420
420
|
- app/assets/images/govuk_publishing_components/govuk-schema-placeholder-4x3.png
|
|
421
|
+
- app/assets/images/govuk_publishing_components/icon-close.svg
|
|
421
422
|
- app/assets/images/govuk_publishing_components/icon-file-download.svg
|
|
422
423
|
- app/assets/images/govuk_publishing_components/icon-important.svg
|
|
423
424
|
- app/assets/images/govuk_publishing_components/icon-print-2x.png
|
|
@@ -450,6 +451,7 @@ files:
|
|
|
450
451
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-tracker.js
|
|
451
452
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js
|
|
452
453
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js
|
|
454
|
+
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-print-intent-tracker.js
|
|
453
455
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-schemas.js
|
|
454
456
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-scroll-tracker.js
|
|
455
457
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-smart-answer-results-tracker.js
|