govuk_publishing_components 28.1.0 → 28.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics/auto-scroll-tracker.js +2 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics/auto-track-event.js +22 -22
- data/app/assets/javascripts/govuk_publishing_components/analytics/pii.js +9 -5
- data/app/assets/javascripts/govuk_publishing_components/analytics/track-click.js +4 -3
- data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +0 -1
- data/app/assets/javascripts/govuk_publishing_components/components/details.js +2 -3
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_big-number.scss +5 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +0 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +67 -21
- data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +2 -2
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_action_link.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_big_number.html.erb +19 -9
- data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +0 -4
- data/app/views/govuk_publishing_components/components/_details.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_heading.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_hint.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +22 -18
- data/app/views/govuk_publishing_components/components/_list.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_metadata.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_notice.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_print_link.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_search.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_select.html.erb +19 -1
- data/app/views/govuk_publishing_components/components/_share_links.html.erb +25 -22
- data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_textarea.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_title.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/docs/big_number.yml +6 -0
- data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +0 -47
- data/app/views/govuk_publishing_components/components/docs/select.yml +12 -0
- data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +26 -0
- data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +16 -8
- data/config/locales/ar.yml +2 -0
- data/config/locales/az.yml +2 -1
- data/config/locales/be.yml +2 -0
- data/config/locales/bg.yml +2 -0
- data/config/locales/bn.yml +2 -0
- data/config/locales/cs.yml +2 -0
- data/config/locales/cy.yml +2 -0
- data/config/locales/da.yml +2 -0
- data/config/locales/de.yml +2 -0
- data/config/locales/dr.yml +2 -0
- data/config/locales/el.yml +2 -0
- data/config/locales/en.yml +0 -4
- data/config/locales/es-419.yml +2 -0
- data/config/locales/es.yml +2 -0
- data/config/locales/et.yml +2 -0
- data/config/locales/fa.yml +2 -1
- data/config/locales/fi.yml +2 -0
- data/config/locales/fr.yml +2 -0
- data/config/locales/gd.yml +2 -0
- data/config/locales/gu.yml +2 -0
- data/config/locales/he.yml +2 -0
- data/config/locales/hi.yml +2 -0
- data/config/locales/hr.yml +2 -0
- data/config/locales/hu.yml +2 -0
- data/config/locales/hy.yml +2 -0
- data/config/locales/id.yml +2 -1
- data/config/locales/is.yml +2 -0
- data/config/locales/it.yml +2 -0
- data/config/locales/ja.yml +2 -1
- data/config/locales/ka.yml +2 -0
- data/config/locales/kk.yml +2 -0
- data/config/locales/ko.yml +2 -1
- data/config/locales/lt.yml +2 -0
- data/config/locales/lv.yml +2 -0
- data/config/locales/ms.yml +2 -1
- data/config/locales/mt.yml +2 -0
- data/config/locales/nl.yml +2 -0
- data/config/locales/no.yml +2 -0
- data/config/locales/pa-pk.yml +2 -0
- data/config/locales/pa.yml +2 -0
- data/config/locales/pl.yml +2 -0
- data/config/locales/ps.yml +2 -0
- data/config/locales/pt.yml +2 -0
- data/config/locales/ro.yml +2 -0
- data/config/locales/ru.yml +2 -0
- data/config/locales/si.yml +2 -0
- data/config/locales/sk.yml +2 -0
- data/config/locales/sl.yml +2 -0
- data/config/locales/so.yml +2 -0
- data/config/locales/sq.yml +2 -0
- data/config/locales/sr.yml +2 -1
- data/config/locales/sv.yml +2 -0
- data/config/locales/sw.yml +2 -0
- data/config/locales/ta.yml +2 -0
- data/config/locales/th.yml +2 -1
- data/config/locales/tk.yml +2 -0
- data/config/locales/tr.yml +2 -0
- data/config/locales/uk.yml +2 -0
- data/config/locales/ur.yml +2 -0
- data/config/locales/uz.yml +2 -0
- data/config/locales/vi.yml +2 -1
- data/config/locales/zh-hk.yml +2 -1
- data/config/locales/zh-tw.yml +2 -1
- data/config/locales/zh.yml +2 -1
- data/lib/govuk_publishing_components/presenters/big_number_helper.rb +30 -0
- data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +0 -38
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/lib/govuk_publishing_components.rb +1 -0
- metadata +5 -11
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_covid_cta.html.erb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 371db87e529f0df4c14d1dd53c23ebc9c5d7f7df9574359ed8d64da6c7302953
|
4
|
+
data.tar.gz: dc72630351ee918647581cfc58b7ca7c19282c50990c16bd72eec14222fbd375
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca824e190545a628771d2ef3e632aa57b5144bec484a4538b0e9a53caee73421e13f67c6d50ff114720b3b810f6435892be1491afff41825cbc989970f1e73ed
|
7
|
+
data.tar.gz: ed1b7d8547fd264afc779a55adc347ff22ccf170cb1b003da362bc8ca9bbbf59964522387cba9059b0eb8038dc9487b0c5262a5e1e54e8e5245e23d5845edd6f
|
data/README.md
CHANGED
@@ -199,7 +199,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
199
199
|
|
200
200
|
for (var i = 0; i < this.config.percentages.length; i++) {
|
201
201
|
var percent = this.config.percentages[i]
|
202
|
-
|
202
|
+
// subtract 1 pixel to solve a bug where 100% can't be reached in some cases
|
203
|
+
var pos = ((pageHeight / 100) * percent) - 1
|
203
204
|
var alreadySeen = false
|
204
205
|
if (trackedNodes.length) {
|
205
206
|
alreadySeen = trackedNodes[i].alreadySeen
|
@@ -1,30 +1,30 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
window.GOVUK = window.GOVUK || {}
|
2
|
+
window.GOVUK.Modules = window.GOVUK.Modules || {};
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
(function (Modules) {
|
5
|
+
function AutoTrackEvent ($module) {
|
6
|
+
this.$module = $module
|
7
|
+
}
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
var value = element.data('track-value')
|
9
|
+
AutoTrackEvent.prototype.init = function () {
|
10
|
+
var options = { nonInteraction: 1 } // automatic events shouldn't affect bounce rate
|
11
|
+
var category = this.$module.getAttribute('data-track-category')
|
12
|
+
var action = this.$module.getAttribute('data-track-action')
|
13
|
+
var label = this.$module.getAttribute('data-track-label')
|
14
|
+
var value = parseInt(this.$module.getAttribute('data-track-value'))
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
16
|
+
if (typeof label === 'string') {
|
17
|
+
options.label = label
|
18
|
+
}
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
20
|
+
if (value || value === 0) {
|
21
|
+
options.value = value
|
22
|
+
}
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
}
|
24
|
+
if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
|
25
|
+
window.GOVUK.analytics.trackEvent(category, action, options)
|
26
26
|
}
|
27
27
|
}
|
28
28
|
|
29
|
-
|
30
|
-
})(window)
|
29
|
+
Modules.AutoTrackEvent = AutoTrackEvent
|
30
|
+
})(window.GOVUK.Modules)
|
@@ -1,5 +1,3 @@
|
|
1
|
-
/* global $ */
|
2
|
-
|
3
1
|
;(function (global) {
|
4
2
|
'use strict'
|
5
3
|
|
@@ -15,15 +13,21 @@
|
|
15
13
|
var STATE_PATTERN = /state=.[^&]+/g
|
16
14
|
|
17
15
|
function shouldStripDates () {
|
18
|
-
|
16
|
+
var metas = document.querySelectorAll('meta[name="govuk:static-analytics:strip-dates"]')
|
17
|
+
return metas.length > 0
|
19
18
|
}
|
20
19
|
|
21
20
|
function shouldStripPostcodes () {
|
22
|
-
|
21
|
+
var metas = document.querySelectorAll('meta[name="govuk:static-analytics:strip-postcodes"]')
|
22
|
+
return metas.length > 0
|
23
23
|
}
|
24
24
|
|
25
25
|
function queryStringParametersToStrip () {
|
26
|
-
var
|
26
|
+
var meta = document.querySelector('meta[name="govuk:static-analytics:strip-query-string-parameters"]')
|
27
|
+
var value = false
|
28
|
+
if (meta) {
|
29
|
+
value = meta.getAttribute('content')
|
30
|
+
}
|
27
31
|
var parameters = []
|
28
32
|
|
29
33
|
if (value) {
|
@@ -4,10 +4,11 @@ window.GOVUK = window.GOVUK || {}
|
|
4
4
|
window.GOVUK.Modules = window.GOVUK.Modules || {};
|
5
5
|
|
6
6
|
(function (Modules) {
|
7
|
-
function GemTrackClick () {
|
7
|
+
function GemTrackClick ($module) {
|
8
|
+
this.$module = $module
|
9
|
+
}
|
8
10
|
|
9
|
-
GemTrackClick.prototype.
|
10
|
-
this.$module = $module[0]
|
11
|
+
GemTrackClick.prototype.init = function () {
|
11
12
|
this.$module.handleClick = this.handleClick.bind(this)
|
12
13
|
var trackLinksOnly = this.$module.hasAttribute('data-track-links-only')
|
13
14
|
var limitToElementClass = this.$module.getAttribute('data-limit-to-element-class')
|
@@ -1,4 +1,3 @@
|
|
1
|
-
/* eslint-env jquery */
|
2
1
|
// = require govuk/components/details/details.js
|
3
2
|
window.GOVUK = window.GOVUK || {}
|
4
3
|
window.GOVUK.Modules = window.GOVUK.Modules || {}
|
@@ -15,8 +14,8 @@ window.GOVUK.Modules.GovukDetails = window.GOVUKFrontend;
|
|
15
14
|
|
16
15
|
GemDetails.prototype.init = function () {
|
17
16
|
if (this.customTrackLabel) { // If a custom label has been provided, we can simply call the tracking module
|
18
|
-
var trackDetails = new window.GOVUK.Modules.GemTrackClick()
|
19
|
-
trackDetails.
|
17
|
+
var trackDetails = new window.GOVUK.Modules.GemTrackClick(this.$summary)
|
18
|
+
trackDetails.init()
|
20
19
|
} else if (this.detailsClick) { // If no custom label is set, we use the open/close status as the label
|
21
20
|
this.detailsClick.addEventListener('click', function (event) {
|
22
21
|
this.trackDefault(this.$summary)
|
data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
window.GOVUK = window.GOVUK || {};
|
4
4
|
|
5
|
-
(function (GOVUK
|
5
|
+
(function (GOVUK) {
|
6
6
|
'use strict'
|
7
7
|
|
8
8
|
var BarchartEnhancement = function ($element) {
|
@@ -30,4 +30,4 @@ window.GOVUK = window.GOVUK || {};
|
|
30
30
|
}
|
31
31
|
|
32
32
|
GOVUK.GovspeakBarchartEnhancement = BarchartEnhancement
|
33
|
-
}(window.GOVUK
|
33
|
+
}(window.GOVUK))
|
@@ -1,12 +1,11 @@
|
|
1
1
|
.gem-c-big-number {
|
2
2
|
margin-bottom: govuk-spacing(3);
|
3
|
-
@include govuk-typography-common;
|
4
3
|
@include govuk-text-colour;
|
5
4
|
}
|
6
5
|
|
7
6
|
.gem-c-big-number__value {
|
7
|
+
@include govuk-font($size: false, $weight: bold);
|
8
8
|
font-size: 80px;
|
9
|
-
@include govuk-typography-weight-bold;
|
10
9
|
line-height: 1;
|
11
10
|
|
12
11
|
@if $govuk-typography-use-rem {
|
@@ -55,3 +54,7 @@
|
|
55
54
|
}
|
56
55
|
}
|
57
56
|
}
|
57
|
+
|
58
|
+
.gem-c-big-number__suffix {
|
59
|
+
vertical-align: middle;
|
60
|
+
}
|
@@ -1,5 +1,4 @@
|
|
1
1
|
$transition-campaign-red: #ff003b;
|
2
|
-
$covid-colour: $govuk-link-colour;
|
3
2
|
|
4
3
|
.gem-c-contextual-sidebar__related-links {
|
5
4
|
border-top: 2px solid $govuk-brand-colour;
|
@@ -30,7 +29,3 @@ $covid-colour: $govuk-link-colour;
|
|
30
29
|
.gem-c-contextual-sidebar__cta--brexit {
|
31
30
|
border-top: 2px solid $transition-campaign-red;
|
32
31
|
}
|
33
|
-
|
34
|
-
.gem-c-contextual-sidebar__cta--covid {
|
35
|
-
border-top: 2px solid $covid-colour;
|
36
|
-
}
|
@@ -141,9 +141,9 @@
|
|
141
141
|
}
|
142
142
|
}
|
143
143
|
|
144
|
-
.gem-c-feedback__option-list-item:
|
144
|
+
.gem-c-feedback__option-list-item:last-child {
|
145
145
|
@include govuk-media-query($from: mobile) {
|
146
|
-
margin-
|
146
|
+
margin-left: govuk-spacing(4);
|
147
147
|
}
|
148
148
|
}
|
149
149
|
|
@@ -6,6 +6,7 @@ $chevron-indent-spacing: 7px;
|
|
6
6
|
$black-bar-height: 50px;
|
7
7
|
$search-width-or-height: $black-bar-height;
|
8
8
|
$pseudo-underline-height: 3px;
|
9
|
+
$button-pipe-colour: darken(govuk-colour("mid-grey"), 20%);
|
9
10
|
|
10
11
|
@mixin chevron($colour, $update: false) {
|
11
12
|
@if ($update == true) {
|
@@ -18,7 +19,7 @@ $pseudo-underline-height: 3px;
|
|
18
19
|
content: "";
|
19
20
|
display: inline-block;
|
20
21
|
height: 8px;
|
21
|
-
margin: 0
|
22
|
+
margin: 0 10px 0 2px;
|
22
23
|
vertical-align: middle;
|
23
24
|
width: 8px;
|
24
25
|
}
|
@@ -172,6 +173,15 @@ $pseudo-underline-height: 3px;
|
|
172
173
|
@include govuk-media-query($from: "desktop") {
|
173
174
|
border-bottom: 0;
|
174
175
|
padding: 0;
|
176
|
+
|
177
|
+
&:first-of-type {
|
178
|
+
margin-right: -1px;
|
179
|
+
|
180
|
+
.gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
|
181
|
+
border-left: 1px solid $button-pipe-colour;
|
182
|
+
border-right: 1px solid $button-pipe-colour;
|
183
|
+
}
|
184
|
+
}
|
175
185
|
}
|
176
186
|
}
|
177
187
|
|
@@ -313,22 +323,28 @@ $pseudo-underline-height: 3px;
|
|
313
323
|
padding: 0;
|
314
324
|
|
315
325
|
@include focus-not-focus-visible {
|
316
|
-
|
317
|
-
|
326
|
+
.gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
|
327
|
+
&:before {
|
328
|
+
@include chevron($govuk-link-colour);
|
329
|
+
}
|
318
330
|
}
|
319
331
|
}
|
320
332
|
|
321
333
|
@include focus-not-focus-visible {
|
322
334
|
&:hover {
|
323
|
-
|
324
|
-
|
335
|
+
.gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
|
336
|
+
&:before {
|
337
|
+
@include chevron($govuk-link-hover-colour, true);
|
338
|
+
}
|
325
339
|
}
|
326
340
|
}
|
327
341
|
}
|
328
342
|
|
329
343
|
&:focus {
|
330
|
-
|
331
|
-
|
344
|
+
.gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
|
345
|
+
&:before {
|
346
|
+
@include chevron($govuk-focus-text-colour, true);
|
347
|
+
}
|
332
348
|
}
|
333
349
|
}
|
334
350
|
|
@@ -345,12 +361,15 @@ $pseudo-underline-height: 3px;
|
|
345
361
|
font-size: govuk-px-to-rem(16px);
|
346
362
|
}
|
347
363
|
height: $black-bar-height;
|
348
|
-
padding: govuk-spacing(3) govuk-spacing(6) govuk-spacing(3) govuk-spacing(5);
|
349
364
|
position: relative;
|
350
365
|
text-decoration: none;
|
351
366
|
|
352
|
-
|
353
|
-
|
367
|
+
.gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
|
368
|
+
border-color: $button-pipe-colour;
|
369
|
+
|
370
|
+
&:before {
|
371
|
+
@include chevron(govuk-colour("white"), true);
|
372
|
+
}
|
354
373
|
}
|
355
374
|
}
|
356
375
|
@include focus-not-focus-visible {
|
@@ -362,8 +381,12 @@ $pseudo-underline-height: 3px;
|
|
362
381
|
background: govuk-colour("mid-grey");
|
363
382
|
}
|
364
383
|
|
365
|
-
|
366
|
-
|
384
|
+
.gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
|
385
|
+
border-color: $button-pipe-colour;
|
386
|
+
|
387
|
+
&:before {
|
388
|
+
@include chevron($button-pipe-colour, true);
|
389
|
+
}
|
367
390
|
}
|
368
391
|
}
|
369
392
|
}
|
@@ -375,16 +398,22 @@ $pseudo-underline-height: 3px;
|
|
375
398
|
background: $govuk-focus-text-colour;
|
376
399
|
}
|
377
400
|
|
378
|
-
|
379
|
-
|
401
|
+
.gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
|
402
|
+
border-color: $govuk-focus-colour;
|
403
|
+
|
404
|
+
&:before {
|
405
|
+
@include chevron($govuk-focus-text-colour, true);
|
406
|
+
}
|
380
407
|
}
|
381
408
|
}
|
382
409
|
}
|
383
410
|
|
384
411
|
&.gem-c-layout-super-navigation-header__open-button {
|
385
412
|
@include focus-not-focus-visible {
|
386
|
-
|
387
|
-
|
413
|
+
.gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
|
414
|
+
&:before {
|
415
|
+
@include prefixed-transform($rotate: 225deg, $translateY: 1px);
|
416
|
+
}
|
388
417
|
}
|
389
418
|
}
|
390
419
|
|
@@ -393,8 +422,13 @@ $pseudo-underline-height: 3px;
|
|
393
422
|
background: govuk-colour("light-grey");
|
394
423
|
color: $govuk-link-colour;
|
395
424
|
|
396
|
-
|
397
|
-
|
425
|
+
// stylelint-disable max-nesting-depth
|
426
|
+
.gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
|
427
|
+
border-color: govuk-colour("light-grey");
|
428
|
+
|
429
|
+
&:before {
|
430
|
+
@include chevron($govuk-link-colour, true);
|
431
|
+
}
|
398
432
|
}
|
399
433
|
|
400
434
|
&:after {
|
@@ -406,8 +440,12 @@ $pseudo-underline-height: 3px;
|
|
406
440
|
background-color: $govuk-focus-colour;
|
407
441
|
color: $govuk-focus-text-colour;
|
408
442
|
|
409
|
-
|
410
|
-
|
443
|
+
.gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
|
444
|
+
border-color: $govuk-focus-colour;
|
445
|
+
|
446
|
+
&:before {
|
447
|
+
@include chevron($govuk-focus-text-colour, true);
|
448
|
+
}
|
411
449
|
}
|
412
450
|
|
413
451
|
&:after {
|
@@ -416,12 +454,20 @@ $pseudo-underline-height: 3px;
|
|
416
454
|
}
|
417
455
|
}
|
418
456
|
}
|
457
|
+
// stylelint-enable max-nesting-depth
|
419
458
|
|
420
459
|
.js-module-initialised & {
|
421
460
|
@include govuk-link-style-no-underline;
|
422
461
|
}
|
423
462
|
}
|
424
463
|
|
464
|
+
.gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
|
465
|
+
@include govuk-media-query($from: "desktop") {
|
466
|
+
display: inline-block;
|
467
|
+
padding: govuk-spacing(2) govuk-spacing(6) govuk-spacing(2) govuk-spacing(5);
|
468
|
+
}
|
469
|
+
}
|
470
|
+
|
425
471
|
// Search link and dropdown.
|
426
472
|
.gem-c-layout-super-navigation-header__search-item-link {
|
427
473
|
&:link,
|
@@ -550,7 +596,7 @@ $pseudo-underline-height: 3px;
|
|
550
596
|
box-shadow: none;
|
551
597
|
|
552
598
|
.gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner {
|
553
|
-
border-color:
|
599
|
+
border-color: $button-pipe-colour;
|
554
600
|
color: govuk-colour("white");
|
555
601
|
|
556
602
|
@include govuk-media-query($from: 360px) {
|
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
accordion_classes = %w(gem-c-accordion)
|
11
11
|
accordion_classes << 'gem-c-accordion--condensed' if condensed
|
12
|
-
accordion_classes <<
|
12
|
+
accordion_classes << shared_helper.get_margin_bottom
|
13
13
|
|
14
14
|
translations = {
|
15
15
|
show_text: "components.accordion.show",
|
@@ -33,7 +33,7 @@
|
|
33
33
|
css_classes << "gem-c-action-link--simple-light" if simple_light
|
34
34
|
css_classes << "gem-c-action-link--with-subtext" if subtext
|
35
35
|
css_classes << "gem-c-action-link--mobile-subtext" if mobile_subtext
|
36
|
-
css_classes <<
|
36
|
+
css_classes << shared_helper.get_margin_bottom
|
37
37
|
|
38
38
|
link_classes = %w(govuk-link gem-c-action-link__link)
|
39
39
|
link_classes << shared_helper.classes if classes
|
@@ -1,19 +1,29 @@
|
|
1
1
|
<%
|
2
|
-
|
2
|
+
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
3
|
+
big_number_helper = GovukPublishingComponents::Presenters::BigNumberHelper.new(local_assigns)
|
4
|
+
|
5
|
+
number ||= false
|
3
6
|
label ||= nil
|
4
7
|
href ||= nil
|
5
8
|
data_attributes ||= nil
|
6
9
|
aria ||= nil
|
7
|
-
classes = ["gem-c-big-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
end
|
10
|
+
classes = ["gem-c-big-number"]
|
11
|
+
classes << shared_helper.get_margin_bottom
|
12
|
+
|
13
|
+
value_classes = big_number_helper.value_classes
|
12
14
|
%>
|
13
15
|
<% if number %>
|
14
16
|
<% big_number_value = capture do %>
|
15
|
-
<%= tag.span class:
|
16
|
-
|
17
|
+
<%= tag.span class: value_classes, data: href ? nil : data_attributes do %>
|
18
|
+
<%
|
19
|
+
# The below check is to account for small symbols awkwardly sitting above the baseline in our typeface and adjust them to sit at the baseline for the purpose of visual harmony
|
20
|
+
# Currently the only small symbol used with big numbers are pluses so they are specifically applied in the below code
|
21
|
+
%>
|
22
|
+
<% if big_number_helper.number_has_plus_suffix? %>
|
23
|
+
<%= number[0...-1] %><%= tag.span "+", class: "gem-c-big-number__suffix" %>
|
24
|
+
<% else %>
|
25
|
+
<%= number %>
|
26
|
+
<% end %>
|
17
27
|
<% end %>
|
18
28
|
|
19
29
|
<% unless label.nil? %>
|
@@ -25,7 +35,7 @@
|
|
25
35
|
<% end %>
|
26
36
|
<% end %>
|
27
37
|
|
28
|
-
<%= tag.div class:
|
38
|
+
<%= tag.div class: classes, aria: aria do %>
|
29
39
|
<% unless href.nil? %>
|
30
40
|
<%= link_to big_number_value, href, class: "govuk-link gem-c-big-number__link", data: data_attributes %>
|
31
41
|
<% else %>
|
@@ -27,8 +27,4 @@
|
|
27
27
|
<% if navigation.show_brexit_cta? %>
|
28
28
|
<%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta', content_item: content_item %>
|
29
29
|
<% end %>
|
30
|
-
|
31
|
-
<% if navigation.show_covid_booster_cta? %>
|
32
|
-
<%= render 'govuk_publishing_components/components/contextual_sidebar/covid_cta', content_item: content_item %>
|
33
|
-
<% end %>
|
34
30
|
</div>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
open ||= nil
|
5
5
|
margin_bottom ||= 3
|
6
6
|
css_classes = %w(gem-c-details govuk-details)
|
7
|
-
css_classes <<
|
7
|
+
css_classes << shared_helper.get_margin_bottom
|
8
8
|
|
9
9
|
details_data_attributes = {}
|
10
10
|
details_data_attributes[:module] = 'govuk-details gem-details'
|
@@ -10,7 +10,7 @@
|
|
10
10
|
classes << heading_helper.classes
|
11
11
|
classes << brand_helper.brand_class
|
12
12
|
classes << brand_helper.border_color_class
|
13
|
-
classes <<
|
13
|
+
classes << shared_helper.get_margin_bottom if [*0..9].include?(local_assigns[:margin_bottom])
|
14
14
|
%>
|
15
15
|
<%= content_tag(shared_helper.get_heading_level, text,
|
16
16
|
class: classes,
|
@@ -3,7 +3,7 @@
|
|
3
3
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
4
4
|
|
5
5
|
css_classes = %w( gem-c-hint govuk-hint )
|
6
|
-
css_classes <<
|
6
|
+
css_classes << shared_helper.get_margin_bottom
|
7
7
|
%>
|
8
8
|
|
9
9
|
<%= tag.div id: id, class: css_classes do %>
|
data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb
CHANGED
@@ -108,24 +108,28 @@
|
|
108
108
|
track_dimension_index: "29",
|
109
109
|
}
|
110
110
|
} %>
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
111
|
+
<% if has_children %>
|
112
|
+
<%= content_tag(:button, {
|
113
|
+
aria: {
|
114
|
+
controls: "super-navigation-menu__section-#{unique_id}",
|
115
|
+
expanded: false,
|
116
|
+
label: show_menu_text,
|
117
|
+
},
|
118
|
+
class: "gem-c-layout-super-navigation-header__navigation-second-toggle-button",
|
119
|
+
data: {
|
120
|
+
text_for_hide: hide_menu_text,
|
121
|
+
text_for_show: show_menu_text,
|
122
|
+
toggle_desktop_group: "top",
|
123
|
+
toggle_mobile_group: "second",
|
124
|
+
tracking_key: tracking_label,
|
125
|
+
},
|
126
|
+
hidden: true,
|
127
|
+
id: "super-navigation-menu__section-#{unique_id}-toggle",
|
128
|
+
type: "button",
|
129
|
+
}) do %>
|
130
|
+
<%= tag.span link[:label], class: "gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner" %>
|
131
|
+
<% end %>
|
132
|
+
<% end %>
|
129
133
|
</div>
|
130
134
|
<% if has_children %>
|
131
135
|
<div
|
@@ -14,7 +14,7 @@
|
|
14
14
|
classes << "govuk-list--spaced" if extra_spacing
|
15
15
|
# Setting the `margin_bottom` to 4 is the same as the default margin - so we
|
16
16
|
# can omit the override class. To do this we leave out `4` from the array:
|
17
|
-
classes <<
|
17
|
+
classes << shared_helper.get_margin_bottom if [0,1,2,3,5,6,7,8,9].include?(local_assigns[:margin_bottom])
|
18
18
|
|
19
19
|
# Default list type is unordered list.
|
20
20
|
list_tag = "ul"
|
@@ -44,7 +44,7 @@
|
|
44
44
|
<dd class="gem-c-metadata__definition">
|
45
45
|
<%= last_updated %>
|
46
46
|
<% if local_assigns.include?(:see_updates_link) %>
|
47
|
-
— <a href="#history" class="gem-c-metadata__definition-link govuk-!-display-none-print js-see-all-updates-link"
|
47
|
+
— <a href="#full-publication-update-history" class="gem-c-metadata__definition-link govuk-!-display-none-print js-see-all-updates-link"
|
48
48
|
data-track-category="content-history"
|
49
49
|
data-track-action="see-all-updates-link-clicked"
|
50
50
|
data-track-label="history">
|
@@ -16,7 +16,7 @@
|
|
16
16
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
17
17
|
|
18
18
|
css_classes = %w[govuk-notification-banner gem-c-notice]
|
19
|
-
css_classes <<
|
19
|
+
css_classes << shared_helper.get_margin_bottom
|
20
20
|
|
21
21
|
aria_attributes = {label: 'Notice'}
|
22
22
|
aria_attributes[:live] = 'polite' if aria_live
|
@@ -15,8 +15,8 @@
|
|
15
15
|
|
16
16
|
wrapper_classes = %w(gem-c-print-link govuk-!-display-none-print)
|
17
17
|
wrapper_classes << "gem-c-print-link--show-without-js" unless require_js
|
18
|
-
wrapper_classes <<
|
19
|
-
wrapper_classes <<
|
18
|
+
wrapper_classes << shared_helper.get_margin_top
|
19
|
+
wrapper_classes << shared_helper.get_margin_bottom
|
20
20
|
|
21
21
|
classes = %w[govuk-link]
|
22
22
|
classes << "govuk-body-s gem-c-print-link__button" if href.nil?
|
@@ -18,8 +18,8 @@
|
|
18
18
|
data_attributes[:module] = 'gem-track-click'
|
19
19
|
|
20
20
|
classes = %w[gem-c-search govuk-!-display-none-print]
|
21
|
-
classes <<
|
22
|
-
classes <<
|
21
|
+
classes << shared_helper.get_margin_top
|
22
|
+
classes << shared_helper.get_margin_bottom if local_assigns[:margin_bottom]
|
23
23
|
classes << "gem-c-search--large" if size == "large"
|
24
24
|
classes << "gem-c-search--large-on-mobile" if size == "large-mobile"
|
25
25
|
classes << "gem-c-search--no-border" if no_border
|