govuk_publishing_components 23.2.1 → 23.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics/init.js +23 -15
- data/app/assets/javascripts/govuk_publishing_components/components/copy-to-clipboard.js +16 -14
- data/app/assets/javascripts/govuk_publishing_components/components/details.js +38 -34
- data/app/assets/javascripts/govuk_publishing_components/components/print-link.js +8 -7
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +10 -9
- data/app/assets/javascripts/govuk_publishing_components/lib/initial-focus.js +13 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +0 -46
- data/app/views/govuk_publishing_components/component_guide/show.html.erb +1 -2
- data/app/views/govuk_publishing_components/components/_attachment.html.erb +5 -4
- data/app/views/govuk_publishing_components/components/_input.html.erb +6 -6
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +5 -3
- data/app/views/govuk_publishing_components/components/docs/attachment.yml +10 -0
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +55 -0
- data/config/locales/cy.yml +4 -1
- data/config/locales/en.yml +4 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/govuk/all.js +31 -37
- data/node_modules/govuk-frontend/govuk/components/accordion/README.md +1 -1
- data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +235 -0
- data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/back-link/fixtures.json +56 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +172 -0
- data/node_modules/govuk-frontend/govuk/components/button/_index.scss +3 -3
- data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +275 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +170 -0
- data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +13 -13
- data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +1015 -0
- data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +499 -0
- data/node_modules/govuk-frontend/govuk/components/details/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +83 -0
- data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +66 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/_index.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +181 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/_index.scss +1 -1
- data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +93 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/macro-options.json +6 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/template.njk +5 -1
- data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +151 -0
- data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +482 -0
- data/node_modules/govuk-frontend/govuk/components/header/_index.scss +2 -5
- data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +360 -0
- data/node_modules/govuk-frontend/govuk/components/header/header.js +665 -316
- data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +13 -1
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +9 -5
- data/node_modules/govuk-frontend/govuk/components/hint/_index.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/hint/fixtures.json +50 -0
- data/node_modules/govuk-frontend/govuk/components/hint/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/input/_index.scss +91 -0
- data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +538 -0
- data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +64 -0
- data/node_modules/govuk-frontend/govuk/components/input/template.njk +17 -0
- data/node_modules/govuk-frontend/govuk/components/inset-text/fixtures.json +49 -0
- data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +75 -0
- data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +6 -2
- data/node_modules/govuk-frontend/govuk/components/panel/fixtures.json +74 -0
- data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +65 -0
- data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +13 -13
- data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +1066 -0
- data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +2 -2
- data/node_modules/govuk-frontend/govuk/components/select/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +248 -0
- data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +72 -0
- data/node_modules/govuk-frontend/govuk/components/summary-list/README.md +1 -1
- data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +2 -10
- data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +991 -0
- data/node_modules/govuk-frontend/govuk/components/table/fixtures.json +468 -0
- data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +3 -6
- data/node_modules/govuk-frontend/govuk/components/tabs/fixtures.json +229 -0
- data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +117 -0
- data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +199 -0
- data/node_modules/govuk-frontend/govuk/components/warning-text/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/warning-text/fixtures.json +68 -0
- data/node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss +3 -3
- data/node_modules/govuk-frontend/govuk/helpers/_font-faces.scss +9 -11
- data/node_modules/govuk-frontend/govuk/helpers/_links.scss +1 -3
- data/node_modules/govuk-frontend/govuk/helpers/_media-queries.scss +1 -5
- data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +2 -1
- data/node_modules/govuk-frontend/govuk/helpers/_typography.scss +7 -6
- data/node_modules/govuk-frontend/govuk/objects/_form-group.scss +0 -1
- data/node_modules/govuk-frontend/govuk/objects/_grid.scss +2 -3
- data/node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss +0 -1
- data/node_modules/govuk-frontend/govuk/overrides/_display.scss +1 -1
- data/node_modules/govuk-frontend/govuk/overrides/_width.scss +1 -0
- data/node_modules/govuk-frontend/govuk/settings/_colours-applied.scss +0 -3
- data/node_modules/govuk-frontend/govuk/settings/_colours-organisations.scss +3 -0
- data/node_modules/govuk-frontend/govuk/settings/_colours-palette.scss +9 -2
- data/node_modules/govuk-frontend/govuk/settings/_compatibility.scss +0 -1
- data/node_modules/govuk-frontend/govuk/settings/_measurements.scss +0 -4
- data/node_modules/govuk-frontend/govuk/settings/_typography-font-families.scss +2 -2
- data/node_modules/govuk-frontend/govuk/settings/_typography-font.scss +11 -5
- data/node_modules/govuk-frontend/govuk/settings/_typography-responsive.scss +6 -2
- data/node_modules/govuk-frontend/govuk/tools/_font-url.scss +0 -3
- data/node_modules/govuk-frontend/govuk/tools/_image-url.scss +0 -3
- data/node_modules/govuk-frontend/govuk/utilities/_visually-hidden.scss +0 -1
- data/node_modules/govuk-frontend/govuk/vendor/_sass-mq.scss +0 -4
- data/node_modules/govuk-frontend/package.json +1 -1
- metadata +32 -3
- data/app/assets/javascripts/govuk_publishing_components/components/initial-focus.js +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34b79bd902906ae48c22d4f01510b329d279a953d607ef7633fcd29d44dbd3ef
|
4
|
+
data.tar.gz: e4bf0609433d8308708a96da4b9a6e9f2960e3551960af806c12be5bb74be16d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 285ae326a806521d45584efced7930c995009d6577820a248fec57fb4f0974d7e2eeaaabd7ba2e245beac066fe16e1c398a2ffc6590141e272fb1c2807adbf96
|
7
|
+
data.tar.gz: c2e148283ce68ef51963f2b9a437aa754bb65f5baa9aadc712316605e3028c3d0714d1db6f36214f77be558755464d013bb63ede138764376076376cb484de76
|
@@ -1,8 +1,14 @@
|
|
1
|
-
var analyticsInit = function (
|
1
|
+
var analyticsInit = function () {
|
2
2
|
'use strict'
|
3
3
|
|
4
|
-
var
|
4
|
+
var analyticsVars = window.GOVUK.analyticsVars || false
|
5
|
+
if (analyticsVars) {
|
6
|
+
var gaProperty = window.GOVUK.analyticsVars.gaProperty || false
|
7
|
+
var gaPropertyCrossDomain = window.GOVUK.analyticsVars.gaPropertyCrossDomain || false
|
8
|
+
var linkedDomains = window.GOVUK.analyticsVars.linkedDomains || false
|
9
|
+
}
|
5
10
|
|
11
|
+
var consentCookie = window.GOVUK.getConsentCookie()
|
6
12
|
var dummyAnalytics = {
|
7
13
|
addLinkedTrackerDomain: function () {},
|
8
14
|
setDimension: function () {},
|
@@ -23,22 +29,24 @@ var analyticsInit = function (gaProperty, gaPropertyCrossDomain, linkedDomains)
|
|
23
29
|
// Load Google Analytics libraries
|
24
30
|
window.GOVUK.StaticAnalytics.load()
|
25
31
|
|
26
|
-
|
27
|
-
|
28
|
-
|
32
|
+
if (gaProperty) {
|
33
|
+
// Use document.domain in dev, preview and staging so that tracking works
|
34
|
+
// Otherwise explicitly set the domain as www.gov.uk (and not gov.uk).
|
35
|
+
var cookieDomain = (document.domain === 'www.gov.uk') ? '.www.gov.uk' : document.domain
|
29
36
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
37
|
+
// Configure profiles, setup custom vars, track initial pageview
|
38
|
+
var analytics = new window.GOVUK.StaticAnalytics({
|
39
|
+
universalId: gaProperty,
|
40
|
+
cookieDomain: cookieDomain,
|
41
|
+
allowLinker: true
|
42
|
+
})
|
36
43
|
|
37
|
-
|
38
|
-
|
44
|
+
// Make interface public for virtual pageviews and events
|
45
|
+
window.GOVUK.analytics = analytics
|
39
46
|
|
40
|
-
|
41
|
-
|
47
|
+
if (linkedDomains && linkedDomains.length > 0) {
|
48
|
+
window.GOVUK.analytics.addLinkedTrackerDomain(gaPropertyCrossDomain, 'govuk', linkedDomains)
|
49
|
+
}
|
42
50
|
}
|
43
51
|
} else {
|
44
52
|
window.GOVUK.analytics = dummyAnalytics
|
@@ -2,22 +2,24 @@ window.GOVUK = window.GOVUK || {}
|
|
2
2
|
window.GOVUK.Modules = window.GOVUK.Modules || {};
|
3
3
|
|
4
4
|
(function (Modules) {
|
5
|
-
|
5
|
+
function CopyToClipboard () { }
|
6
6
|
|
7
|
-
|
8
|
-
this
|
9
|
-
var input = element[0].querySelector('.gem-c-input')
|
10
|
-
var copyButton = element[0].querySelector('.gem-c-button')
|
7
|
+
CopyToClipboard.prototype.start = function ($module) {
|
8
|
+
this.$module = $module[0]
|
11
9
|
|
12
|
-
|
13
|
-
|
14
|
-
})
|
10
|
+
var input = this.$module.querySelector('.gem-c-input')
|
11
|
+
var copyButton = this.$module.querySelector('.gem-c-button')
|
15
12
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
13
|
+
input.addEventListener('click', function () {
|
14
|
+
input.select()
|
15
|
+
})
|
16
|
+
|
17
|
+
copyButton.addEventListener('click', function (event) {
|
18
|
+
event.preventDefault()
|
19
|
+
input.select()
|
20
|
+
document.execCommand('copy')
|
21
|
+
})
|
22
22
|
}
|
23
|
+
|
24
|
+
Modules.CopyToClipboard = CopyToClipboard
|
23
25
|
})(window.GOVUK.Modules)
|
@@ -4,47 +4,51 @@ window.GOVUK = window.GOVUK || {}
|
|
4
4
|
window.GOVUK.Modules = window.GOVUK.Modules || {};
|
5
5
|
|
6
6
|
(function (Modules) {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
this
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
})
|
27
|
-
}
|
7
|
+
function GovukDetails () { }
|
8
|
+
|
9
|
+
GovukDetails.prototype.start = function ($module) {
|
10
|
+
this.$module = $module[0]
|
11
|
+
|
12
|
+
var customTrackLabel = this.$module.getAttribute('data-track-label')
|
13
|
+
|
14
|
+
// If a custom label has been provided, we can simply call the tracking module
|
15
|
+
if (customTrackLabel) {
|
16
|
+
var trackDetails = new window.GOVUK.Modules.TrackClick()
|
17
|
+
trackDetails.start($module)
|
18
|
+
} else {
|
19
|
+
// If no custom label is set, we use the open/close status as the label
|
20
|
+
var detailsClick = this.$module.querySelector('[data-details-track-click]')
|
21
|
+
|
22
|
+
if (detailsClick) {
|
23
|
+
detailsClick.addEventListener('click', function (event) {
|
24
|
+
this.trackDefault(this.$module)
|
25
|
+
}.bind(this))
|
28
26
|
}
|
29
27
|
}
|
28
|
+
}
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
30
|
+
GovukDetails.prototype.trackDefault = function (element) {
|
31
|
+
if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
|
32
|
+
var componentStatus = (element.getAttribute('open') == null) ? 'open' : 'closed'
|
33
|
+
var trackCategory = element.getAttribute('data-track-category')
|
34
|
+
var trackAction = element.getAttribute('data-track-action')
|
35
|
+
var trackOptions = element.getAttribute('data-track-options')
|
37
36
|
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
if (trackOptions) {
|
38
|
+
trackOptions = JSON.parse(trackOptions)
|
39
|
+
}
|
40
|
+
|
41
|
+
if (typeof trackOptions !== 'object' || trackOptions === null) {
|
42
|
+
trackOptions = {}
|
43
|
+
}
|
41
44
|
|
42
|
-
|
45
|
+
trackOptions.label = componentStatus
|
43
46
|
|
44
|
-
|
45
|
-
|
46
|
-
}
|
47
|
+
if (trackAction && trackCategory) {
|
48
|
+
window.GOVUK.analytics.trackEvent(trackCategory, trackAction, trackOptions)
|
47
49
|
}
|
48
50
|
}
|
49
51
|
}
|
52
|
+
|
53
|
+
Modules.GovukDetails = GovukDetails
|
50
54
|
})(window.GOVUK.Modules)
|
@@ -2,13 +2,14 @@ window.GOVUK = window.GOVUK || {}
|
|
2
2
|
window.GOVUK.Modules = window.GOVUK.Modules || {};
|
3
3
|
|
4
4
|
(function (Modules) {
|
5
|
-
|
5
|
+
function PrintLink () { }
|
6
6
|
|
7
|
-
|
8
|
-
this
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
}
|
7
|
+
PrintLink.prototype.start = function ($module) {
|
8
|
+
this.$module = $module[0]
|
9
|
+
this.$module.addEventListener('click', function () {
|
10
|
+
window.print()
|
11
|
+
})
|
13
12
|
}
|
13
|
+
|
14
|
+
Modules.PrintLink = PrintLink
|
14
15
|
})(window.GOVUK.Modules)
|
@@ -49,8 +49,9 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
49
49
|
|
50
50
|
// true if it's a 'multiple' table
|
51
51
|
// this means multiple bars per rows, but not stacked.
|
52
|
-
var
|
53
|
-
|
52
|
+
var moreThanTwoCells = this.$table.querySelectorAll('tbody tr')[0].querySelectorAll('th, td').length > 2
|
53
|
+
|
54
|
+
this.options.multiple = !this.options.stacked && (this.$table.classList.contains('mc-multiple') || moreThanTwoCells)
|
54
55
|
|
55
56
|
// set the outdent options
|
56
57
|
// which can be set via classes or overriden by setting the value to true
|
@@ -118,11 +119,11 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
118
119
|
tr.classList.add('mc-tr')
|
119
120
|
|
120
121
|
var output = ''
|
121
|
-
var
|
122
|
+
var allTheTHsInTableHead = this.$table.querySelectorAll('thead th')
|
122
123
|
|
123
|
-
for (var i = 0; i <
|
124
|
+
for (var i = 0; i < allTheTHsInTableHead.length; i++) {
|
124
125
|
output += '<div class="mc-th">'
|
125
|
-
output +=
|
126
|
+
output += allTheTHsInTableHead[i].innerHTML
|
126
127
|
output += '</div>'
|
127
128
|
}
|
128
129
|
|
@@ -143,11 +144,11 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
143
144
|
tr.classList.add('mc-tr')
|
144
145
|
|
145
146
|
var cellsOutput = ''
|
146
|
-
var
|
147
|
+
var allTheTableBodyCells = allTheTbodyTrs[i].querySelectorAll('th, td')
|
147
148
|
|
148
|
-
for (var j = 0; j <
|
149
|
+
for (var j = 0; j < allTheTableBodyCells.length; j++) {
|
149
150
|
cellsOutput += '<div class="mc-td">'
|
150
|
-
cellsOutput +=
|
151
|
+
cellsOutput += allTheTableBodyCells[j].innerHTML
|
151
152
|
cellsOutput += '</div>'
|
152
153
|
}
|
153
154
|
tr.innerHTML = cellsOutput
|
@@ -412,7 +413,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
412
413
|
}
|
413
414
|
} else {
|
414
415
|
// if it's a stacked graph
|
415
|
-
if (spanWidth > cellWidth && cellVal > 0) {
|
416
|
+
if ((spanWidth > cellWidth && cellVal > 0) || (cellVal < 1)) {
|
416
417
|
$cell.classList.add('mc-value-overflow')
|
417
418
|
}
|
418
419
|
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
window.GOVUK = window.GOVUK || {}
|
2
|
+
window.GOVUK.Modules = window.GOVUK.Modules || {};
|
3
|
+
|
4
|
+
(function (Modules) {
|
5
|
+
function InitialFocus () { }
|
6
|
+
|
7
|
+
InitialFocus.prototype.start = function ($module) {
|
8
|
+
this.$module = $module[0]
|
9
|
+
this.$module.focus()
|
10
|
+
}
|
11
|
+
|
12
|
+
Modules.InitialFocus = InitialFocus
|
13
|
+
})(window.GOVUK.Modules)
|
@@ -18,49 +18,3 @@
|
|
18
18
|
padding-left: govuk-spacing(6);
|
19
19
|
}
|
20
20
|
}
|
21
|
-
|
22
|
-
.gem-c-input__wrapper {
|
23
|
-
display: flex;
|
24
|
-
display: -ms-flexbox;
|
25
|
-
|
26
|
-
.gem-c-input {
|
27
|
-
display: inline-block;
|
28
|
-
flex: 0 1 auto;
|
29
|
-
}
|
30
|
-
|
31
|
-
.gem-c-input:focus {
|
32
|
-
z-index: 1; // increase z-index on focus so it appears over the suffix
|
33
|
-
}
|
34
|
-
}
|
35
|
-
|
36
|
-
.gem-c-input__prefix,
|
37
|
-
.gem-c-input__suffix {
|
38
|
-
@include govuk-font($size: 19);
|
39
|
-
|
40
|
-
background-color: govuk-colour("light-grey", $legacy: "grey-3");
|
41
|
-
border: $govuk-border-width-form-element solid $govuk-input-border-colour;
|
42
|
-
box-sizing: border-box;
|
43
|
-
cursor: default; // emphasise non-editable status of prefixes and suffixes
|
44
|
-
display: inline-block;
|
45
|
-
flex: 0 0 auto;
|
46
|
-
height: 40px;
|
47
|
-
margin-top: 0;
|
48
|
-
min-width: 40px;
|
49
|
-
padding: govuk-spacing(1);
|
50
|
-
text-align: center;
|
51
|
-
white-space: nowrap;
|
52
|
-
width: auto;
|
53
|
-
|
54
|
-
@if $govuk-typography-use-rem {
|
55
|
-
height: govuk-px-to-rem(40px);
|
56
|
-
min-width: govuk-px-to-rem(40px);
|
57
|
-
}
|
58
|
-
}
|
59
|
-
|
60
|
-
.gem-c-input__prefix {
|
61
|
-
border-right: 0;
|
62
|
-
}
|
63
|
-
|
64
|
-
.gem-c-input__suffix {
|
65
|
-
border-left: 0;
|
66
|
-
}
|
@@ -22,10 +22,9 @@
|
|
22
22
|
<div class="component-markdown">
|
23
23
|
<%= raw(@component_doc.html_body) %>
|
24
24
|
</div>
|
25
|
-
|
26
|
-
<p class="govuk-body"><%= link_to "Search for usage of this component on GitHub", @component_doc.github_search_url, class: "govuk-link" %></p>
|
27
25
|
</div>
|
28
26
|
<% end %>
|
27
|
+
<p class="govuk-body"><%= link_to "Search for usage of this component on GitHub", @component_doc.github_search_url, class: "govuk-link" %></p>
|
29
28
|
</div>
|
30
29
|
</div>
|
31
30
|
|
@@ -5,6 +5,7 @@
|
|
5
5
|
hide_order_copy_link ||= false
|
6
6
|
attributes = []
|
7
7
|
data_attributes ||= {}
|
8
|
+
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
8
9
|
|
9
10
|
if attachment.content_type_name
|
10
11
|
content = if attachment.content_type_abbr
|
@@ -50,11 +51,11 @@
|
|
50
51
|
<% end %>
|
51
52
|
|
52
53
|
<%= tag.div class: "gem-c-attachment__details" do %>
|
53
|
-
<%=
|
54
|
+
<%= content_tag(shared_helper.get_heading_level, class: "gem-c-attachment__title") do %>
|
54
55
|
<%= link_to attachment.title, attachment.url,
|
55
|
-
|
56
|
-
|
57
|
-
|
56
|
+
class: "govuk-link gem-c-attachment__link",
|
57
|
+
target: target,
|
58
|
+
data: data_attributes %>
|
58
59
|
<% end %>
|
59
60
|
|
60
61
|
<% if attachment.reference.present? %>
|
@@ -107,17 +107,17 @@
|
|
107
107
|
%>
|
108
108
|
|
109
109
|
<% if prefix && suffix %>
|
110
|
-
<%= tag.div class: "
|
110
|
+
<%= tag.div class: "govuk-input__wrapper" do %>
|
111
111
|
<% # The line below relies on in-line styling for legacy browsers and it's whitespace-sensitive %>
|
112
|
-
<%= tag.span prefix, class: "
|
112
|
+
<%= tag.span prefix, class: "govuk-input__prefix", aria: { hidden: true } %><%= input_tag %><%= tag.span suffix, class: "govuk-input__suffix", aria: { hidden: true } %>
|
113
113
|
<% end %>
|
114
114
|
<% elsif prefix %>
|
115
|
-
<%= tag.div class: "
|
116
|
-
<%= tag.span prefix, class: "
|
115
|
+
<%= tag.div class: "govuk-input__wrapper" do %>
|
116
|
+
<%= tag.span prefix, class: "govuk-input__prefix", aria: { hidden: true } %><%= input_tag %>
|
117
117
|
<% end %>
|
118
118
|
<% elsif suffix %>
|
119
|
-
<%= tag.div class: "
|
120
|
-
<%= input_tag %><%= tag.span suffix, class: "
|
119
|
+
<%= tag.div class: "govuk-input__wrapper" do %>
|
120
|
+
<%= input_tag %><%= tag.span suffix, class: "govuk-input__suffix", aria: { hidden: true } %>
|
121
121
|
<% end %>
|
122
122
|
<% else %>
|
123
123
|
<%= input_tag %>
|
data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
<% link_text = t("components.related_navigation.transition.link_text") %>
|
2
|
+
<% link_path = t("components.related_navigation.transition.link_path") %>
|
3
|
+
<div class="gem-c-contextual-sidebar__brexit-cta govuk-!-margin-bottom-6" data-module="track-click" lang="en">
|
4
|
+
<h2 class="gem-c-contextual-sidebar__brexit-heading"><%= t("components.related_navigation.transition.title") %></h2>
|
5
|
+
<a href="<%= link_path %>" class="govuk-link" data-track-category="relatedLinkClicked" data-track-action="1.0 Transition" data-track-label="<%= link_path %>" data-track-options='{"dimension29":"<%= link_text %>"}'><%= link_text %></a>
|
4
6
|
</div>
|
@@ -158,3 +158,13 @@ examples:
|
|
158
158
|
unique_reference: "2942"
|
159
159
|
unnumbered_hoc_paper: true
|
160
160
|
hide_order_copy_link: true
|
161
|
+
with_custom_heading_level:
|
162
|
+
description: Default is `h2`.
|
163
|
+
data:
|
164
|
+
heading_level: 3
|
165
|
+
attachment:
|
166
|
+
title: "Department for Transport information asset register"
|
167
|
+
url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/747661/department-for-transport-information-asset-register.csv
|
168
|
+
filename: department-for-transport-information-asset-register.csv
|
169
|
+
content_type: text/csv
|
170
|
+
file_size: 20000
|
@@ -236,6 +236,61 @@ examples:
|
|
236
236
|
</tr>
|
237
237
|
</tbody>
|
238
238
|
</table>
|
239
|
+
stacked_chart:
|
240
|
+
data:
|
241
|
+
block: |
|
242
|
+
<table class="js-barchart-table mc-stacked mc-auto-outdent">
|
243
|
+
<thead>
|
244
|
+
<tr>
|
245
|
+
<th scope="col">Colours</th>
|
246
|
+
<th scope="col">Fruits</th>
|
247
|
+
<th scope="col">Vegetables</th>
|
248
|
+
<th scope="col">Beans</th>
|
249
|
+
<th scope="col">Nuts</th>
|
250
|
+
<th scope="col">Total</th>
|
251
|
+
</tr>
|
252
|
+
</thead>
|
253
|
+
<tbody>
|
254
|
+
<tr>
|
255
|
+
<td>Red</td>
|
256
|
+
<td>23</td>
|
257
|
+
<td>9</td>
|
258
|
+
<td>2</td>
|
259
|
+
<td>1</td>
|
260
|
+
<td>35</td>
|
261
|
+
</tr>
|
262
|
+
<tr>
|
263
|
+
<td>Green</td>
|
264
|
+
<td>5</td>
|
265
|
+
<td>33</td>
|
266
|
+
<td>8</td>
|
267
|
+
<td>0</td>
|
268
|
+
<td>46</td>
|
269
|
+
</tr>
|
270
|
+
<tr>
|
271
|
+
<td>Yellow</td>
|
272
|
+
<td>2</td>
|
273
|
+
<td>10</td>
|
274
|
+
<td>0</td>
|
275
|
+
<td>15</td>
|
276
|
+
<td>27</td>
|
277
|
+
</tr>
|
278
|
+
</tbody>
|
279
|
+
</table>
|
280
|
+
chart_with_multiple_headings:
|
281
|
+
data:
|
282
|
+
block: |
|
283
|
+
<table id="multiple-table-chart" class="js-barchart-table mc-multiple">
|
284
|
+
<caption>Multiple Table</caption>
|
285
|
+
<thead>
|
286
|
+
<tr><th>Some Data</th><th>YES</th><th>NO</th><th>MAYBE</th></tr>
|
287
|
+
</thead>
|
288
|
+
<tbody>
|
289
|
+
<tr><th>Testing One</th><td>5</td><td>6</td><td>11</td></tr>
|
290
|
+
<tr><th>Testing Two</th><td>6</td><td>2</td><td>8</td></tr>
|
291
|
+
<tr><th>Testing Three</th><td>3</td><td>9</td><td>12</td></tr>
|
292
|
+
</tbody>
|
293
|
+
</table>
|
239
294
|
address:
|
240
295
|
data:
|
241
296
|
block: |
|