govuk_publishing_components 34.5.1 → 34.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +29 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js +2 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/init-ga4.js +30 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4.js +1 -0
- data/app/assets/javascripts/govuk_publishing_components/dependencies.js +10 -0
- data/app/assets/javascripts/govuk_publishing_components/load-analytics.js +36 -129
- data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +6 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +12 -0
- data/app/views/govuk_publishing_components/components/_document_list.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/docs/document_list.yml +18 -1
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +22 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba0772875b264020843365a19ead36547d07face7b083d93fee75253637ad2f4
|
4
|
+
data.tar.gz: 0c43bc5ff4999895e9f7c7f7daf0061636b06b7d29f4c089c0c2354b42ff3d04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c30252644aed7426ecf32d1af456654914bdf367217775208343a2d7e7f6477aa4d9cf7b1370608d75dc4b24e469e713a6478e71d39cb15178c0990ffcc12d5
|
7
|
+
data.tar.gz: 4c29ed5588601742877861156543a535313c7f4202c9420faa71f3bea86ec1e065dca8c93c5d4ca2a219765768da40aba51f65767c907d0b1d5b3a9bf9966888
|
@@ -6,11 +6,39 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
|
|
6
6
|
'use strict'
|
7
7
|
|
8
8
|
var core = {
|
9
|
+
load: function () {
|
10
|
+
var firstScript = document.getElementsByTagName('script')[0]
|
11
|
+
var newScript = document.createElement('script')
|
12
|
+
newScript.async = true
|
13
|
+
|
14
|
+
// initialise GTM
|
15
|
+
window.dataLayer = window.dataLayer || []
|
16
|
+
window.dataLayer.push({ 'gtm.blocklist': ['customPixels', 'customScripts', 'html', 'nonGoogleScripts'] })
|
17
|
+
window.dataLayer.push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' })
|
18
|
+
|
19
|
+
var auth = window.GOVUK.analyticsGa4.vars.auth || ''
|
20
|
+
var preview = window.GOVUK.analyticsGa4.vars.preview || ''
|
21
|
+
if (auth) {
|
22
|
+
auth = '>m_auth=' + auth
|
23
|
+
}
|
24
|
+
if (preview) {
|
25
|
+
preview = '>m_preview=' + preview + '>m_cookies_win=x'
|
26
|
+
}
|
27
|
+
|
28
|
+
this.googleSrc = 'https://www.googletagmanager.com/gtm.js?id=' + window.GOVUK.analyticsGa4.vars.id + auth + preview
|
29
|
+
newScript.src = this.googleSrc
|
30
|
+
firstScript.parentNode.insertBefore(newScript, firstScript)
|
31
|
+
},
|
32
|
+
|
9
33
|
sendData: function (data) {
|
10
|
-
data.govuk_gem_version =
|
34
|
+
data.govuk_gem_version = this.getGemVersion()
|
11
35
|
window.dataLayer.push(data)
|
12
36
|
},
|
13
37
|
|
38
|
+
getGemVersion: function () {
|
39
|
+
return window.GOVUK.analyticsGa4.vars.gem_version || 'not found'
|
40
|
+
},
|
41
|
+
|
14
42
|
trackFunctions: {
|
15
43
|
findTrackingAttributes: function (clicked, trackingTrigger) {
|
16
44
|
if (clicked.hasAttribute('[' + trackingTrigger + ']')) {
|
@@ -72,7 +72,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
72
72
|
schema.event = 'event_data'
|
73
73
|
var text = data.text || event.target.textContent
|
74
74
|
data.text = window.GOVUK.analyticsGa4.core.trackFunctions.removeLinesAndExtraSpaces(text)
|
75
|
-
data.url
|
75
|
+
var url = data.url || this.findLink(event.target).getAttribute('href')
|
76
|
+
data.url = window.GOVUK.analyticsGa4.core.trackFunctions.removeCrossDomainParams(url)
|
76
77
|
data.link_domain = window.GOVUK.analyticsGa4.core.trackFunctions.populateLinkDomain(data.url)
|
77
78
|
data.link_path_parts = window.GOVUK.analyticsGa4.core.trackFunctions.populateLinkPathParts(data.url)
|
78
79
|
data.method = window.GOVUK.analyticsGa4.core.trackFunctions.getClickType(event)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
window.GOVUK = window.GOVUK || {}
|
2
|
+
window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {}
|
3
|
+
|
4
|
+
var initFunction = function () {
|
5
|
+
var consentCookie = window.GOVUK.getConsentCookie()
|
6
|
+
|
7
|
+
if (consentCookie && consentCookie.usage) {
|
8
|
+
window.GOVUK.analyticsGa4.vars.internalDomains = []
|
9
|
+
window.GOVUK.analyticsGa4.vars.internalDomains.push(window.GOVUK.analyticsGa4.core.trackFunctions.getHostname())
|
10
|
+
window.GOVUK.analyticsGa4.core.trackFunctions.appendDomainsWithoutWWW(window.GOVUK.analyticsGa4.vars.internalDomains)
|
11
|
+
window.GOVUK.analyticsGa4.core.load()
|
12
|
+
|
13
|
+
var analyticsModules = window.GOVUK.analyticsGa4.analyticsModules
|
14
|
+
for (var property in analyticsModules) {
|
15
|
+
var module = analyticsModules[property]
|
16
|
+
if (typeof module.init === 'function') {
|
17
|
+
try {
|
18
|
+
module.init()
|
19
|
+
} catch (e) {
|
20
|
+
// if there's a problem with the module, catch the error to allow other modules to start
|
21
|
+
console.warn('Error starting analytics module ' + property + ': ' + e.message, window.location)
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
} else {
|
26
|
+
window.addEventListener('cookie-consent', window.GOVUK.analyticsGa4.init)
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
window.GOVUK.analyticsGa4.init = initFunction
|
@@ -8,5 +8,15 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
8
8
|
window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {}
|
9
9
|
window.GOVUK.analyticsVars = window.GOVUK.analyticsVars || {}
|
10
10
|
|
11
|
+
// if statements ensure these functions don't execute during testing
|
12
|
+
if (typeof window.GOVUK.loadAnalytics !== 'undefined') {
|
13
|
+
if (typeof window.GOVUK.analyticsGa4.vars === 'undefined') {
|
14
|
+
window.GOVUK.loadAnalytics.loadGa4()
|
15
|
+
}
|
16
|
+
if (typeof window.GOVUK.analyticsVars.gaProperty === 'undefined') {
|
17
|
+
window.GOVUK.loadAnalytics.loadUa()
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
11
21
|
window.GOVUK.modules.start()
|
12
22
|
})
|
@@ -2,20 +2,21 @@
|
|
2
2
|
//= require govuk_publishing_components/analytics-ga4
|
3
3
|
//= require govuk_publishing_components/analytics/linked-domains
|
4
4
|
|
5
|
-
window.GOVUK = window.GOVUK || {}
|
6
|
-
|
7
5
|
window.GOVUK.loadAnalytics = {
|
8
6
|
productionDomains: [
|
9
7
|
'www.gov.uk',
|
10
|
-
'www-origin.publishing.service.gov.uk'
|
8
|
+
'www-origin.publishing.service.gov.uk',
|
9
|
+
'assets.publishing.service.gov.uk'
|
11
10
|
],
|
12
11
|
stagingDomains: [
|
13
12
|
'www.staging.publishing.service.gov.uk',
|
14
|
-
'www-origin.staging.publishing.service.gov.uk'
|
13
|
+
'www-origin.staging.publishing.service.gov.uk',
|
14
|
+
'assets.staging.publishing.service.gov.uk'
|
15
15
|
],
|
16
16
|
integrationDomains: [
|
17
17
|
'www.integration.publishing.service.gov.uk',
|
18
|
-
'www-origin.integration.publishing.service.gov.uk'
|
18
|
+
'www-origin.integration.publishing.service.gov.uk',
|
19
|
+
'assets.integration.publishing.service.gov.uk'
|
19
20
|
],
|
20
21
|
developmentDomains: [
|
21
22
|
'localhost', '127.0.0.1', '0.0.0.0'
|
@@ -47,7 +48,6 @@ window.GOVUK.loadAnalytics = {
|
|
47
48
|
},
|
48
49
|
|
49
50
|
loadUa: function (currentDomain) {
|
50
|
-
// The domain can be overridden. This is needed for testing as we need to fake the domain that we are on to test each environment.
|
51
51
|
currentDomain = currentDomain || window.location.hostname
|
52
52
|
|
53
53
|
// Universal Analytics variables
|
@@ -57,13 +57,13 @@ window.GOVUK.loadAnalytics = {
|
|
57
57
|
window.GOVUK.analyticsVars.gaProperty = 'UA-UNSET'
|
58
58
|
window.GOVUK.analyticsVars.gaPropertyCrossDomain = 'UA-UNSET'
|
59
59
|
|
60
|
-
if (this.arrayContains(
|
60
|
+
if (this.arrayContains(currentDomain, this.productionDomains)) {
|
61
61
|
window.GOVUK.analyticsVars.gaProperty = 'UA-26179049-1'
|
62
62
|
window.GOVUK.analyticsVars.gaPropertyCrossDomain = 'UA-145652997-1'
|
63
|
-
} else if (this.arrayContains(
|
63
|
+
} else if (this.arrayContains(currentDomain, this.stagingDomains)) {
|
64
64
|
window.GOVUK.analyticsVars.gaProperty = 'UA-26179049-20'
|
65
65
|
window.GOVUK.analyticsVars.gaPropertyCrossDomain = 'UA-145652997-1'
|
66
|
-
} else if (this.arrayContains(
|
66
|
+
} else if (this.arrayContains(currentDomain, this.integrationDomains)) {
|
67
67
|
window.GOVUK.analyticsVars.gaProperty = 'UA-26179049-22'
|
68
68
|
window.GOVUK.analyticsVars.gaPropertyCrossDomain = 'UA-145652997-1'
|
69
69
|
}
|
@@ -74,136 +74,43 @@ window.GOVUK.loadAnalytics = {
|
|
74
74
|
}
|
75
75
|
},
|
76
76
|
|
77
|
-
loadGa4Vars: function () {
|
78
|
-
// If we recognise the environment, load the GA4 vars
|
79
|
-
if (this.ga4EnvironmentVariables[this.environment]) {
|
80
|
-
window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {}
|
81
|
-
window.GOVUK.analyticsGa4.vars = window.GOVUK.analyticsGa4.vars || {}
|
82
|
-
window.GOVUK.analyticsGa4.vars.id = 'GTM-MG7HG5W'
|
83
|
-
window.GOVUK.analyticsGa4.vars.auth = this.ga4EnvironmentVariables[this.environment].auth
|
84
|
-
window.GOVUK.analyticsGa4.vars.preview = this.ga4EnvironmentVariables[this.environment].preview
|
85
|
-
window.GOVUK.analyticsGa4.vars.environment = this.environment // Used for testing and debugging
|
86
|
-
|
87
|
-
window.GOVUK.analyticsGa4.vars.gem_version = 'not found'
|
88
|
-
var gemMeta = document.querySelector('meta[name="govuk:components_gem_version"]')
|
89
|
-
if (gemMeta) {
|
90
|
-
window.GOVUK.analyticsGa4.vars.gem_version = gemMeta.getAttribute('content')
|
91
|
-
}
|
92
|
-
|
93
|
-
window.GOVUK.analyticsGa4.vars.internalDomains = []
|
94
|
-
window.GOVUK.analyticsGa4.vars.internalDomains.push(window.GOVUK.analyticsGa4.core.trackFunctions.getHostname())
|
95
|
-
window.GOVUK.analyticsGa4.core.trackFunctions.appendDomainsWithoutWWW(window.GOVUK.analyticsGa4.vars.internalDomains)
|
96
|
-
}
|
97
|
-
},
|
98
|
-
|
99
|
-
addGtmScriptToDom: function () {
|
100
|
-
var firstScript = document.getElementsByTagName('script')[0]
|
101
|
-
var newScript = document.createElement('script')
|
102
|
-
newScript.async = true
|
103
|
-
|
104
|
-
// initialise GTM
|
105
|
-
window.dataLayer = window.dataLayer || []
|
106
|
-
window.dataLayer.push({ 'gtm.blocklist': ['customPixels', 'customScripts', 'html', 'nonGoogleScripts'] })
|
107
|
-
window.dataLayer.push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' })
|
108
|
-
|
109
|
-
var auth = window.GOVUK.analyticsGa4.vars.auth || ''
|
110
|
-
var preview = window.GOVUK.analyticsGa4.vars.preview || ''
|
111
|
-
if (auth) {
|
112
|
-
auth = '>m_auth=' + auth
|
113
|
-
}
|
114
|
-
if (preview) {
|
115
|
-
preview = '>m_preview=' + preview + '>m_cookies_win=x'
|
116
|
-
}
|
117
|
-
|
118
|
-
this.googleSrc = 'https://www.googletagmanager.com/gtm.js?id=' + window.GOVUK.analyticsGa4.vars.id + auth + preview
|
119
|
-
newScript.src = this.googleSrc
|
120
|
-
firstScript.parentNode.insertBefore(newScript, firstScript)
|
121
|
-
},
|
122
|
-
|
123
77
|
loadGa4: function (currentDomain) {
|
124
|
-
// The domain can be overridden. This is needed for testing as we need to fake the domain that we are on to test each environment.
|
125
78
|
currentDomain = currentDomain || window.location.hostname
|
79
|
+
var environment = ''
|
126
80
|
|
127
|
-
window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {}
|
128
|
-
|
129
|
-
if (typeof window.GOVUK.analyticsGa4.core === 'undefined') {
|
130
|
-
console.warn('load-analytics.js: window.GOVUK.analyticsGa4.core was not found - has ./analytics-ga4.js been imported?')
|
131
|
-
return
|
132
|
-
}
|
133
|
-
|
134
|
-
this.environment = ''
|
135
81
|
// Categorise current environment
|
136
|
-
if (this.arrayContains(
|
137
|
-
|
138
|
-
} else if (this.arrayContains(
|
139
|
-
|
140
|
-
} else if (this.arrayContains(
|
141
|
-
|
142
|
-
} else if (this.arrayContains(
|
143
|
-
|
144
|
-
}
|
145
|
-
|
146
|
-
if (!this.environment) {
|
147
|
-
console.warn('load-analytics.js: environment for GA4 not recognised - ' + this.environment + ' on ' + currentDomain)
|
148
|
-
return
|
149
|
-
}
|
150
|
-
|
151
|
-
// Don't load GA4 if initialiseGA4 is set to false. This allows us to disable analytics if required.
|
152
|
-
if (!this.ga4EnvironmentVariables[this.environment].initialiseGA4) {
|
153
|
-
return
|
82
|
+
if (this.arrayContains(currentDomain, this.productionDomains)) {
|
83
|
+
environment = 'production'
|
84
|
+
} else if (this.arrayContains(currentDomain, this.stagingDomains)) {
|
85
|
+
environment = 'staging'
|
86
|
+
} else if (this.arrayContains(currentDomain, this.integrationDomains)) {
|
87
|
+
environment = 'integration'
|
88
|
+
} else if (this.arrayContains(currentDomain, this.developmentDomains) || currentDomain.indexOf('.dev.gov.uk') !== -1) {
|
89
|
+
environment = 'development'
|
154
90
|
}
|
155
91
|
|
156
|
-
//
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
window.GOVUK.loadAnalytics.startGa4Modules()
|
172
|
-
})
|
173
|
-
}
|
174
|
-
|
175
|
-
// to be added: cross domain tracking code
|
176
|
-
} else {
|
177
|
-
window.addEventListener('cookie-consent', function (e) {
|
178
|
-
window.GOVUK.loadAnalytics.loadGa4()
|
179
|
-
})
|
180
|
-
}
|
181
|
-
},
|
182
|
-
|
183
|
-
startGa4Modules: function () {
|
184
|
-
// Some tests initialise GA4, but we do not want our modules initialising, so this check is in place.
|
185
|
-
if (!window.GOVUK.analyticsGa4.vars.disableModules) {
|
186
|
-
var analyticsModules = window.GOVUK.analyticsGa4.analyticsModules
|
187
|
-
for (var property in analyticsModules) {
|
188
|
-
var module = analyticsModules[property]
|
189
|
-
if (typeof module.init === 'function') {
|
190
|
-
module.init()
|
92
|
+
// If we recognise the environment (i.e. the string isn't empty), load in GA4
|
93
|
+
if (environment) {
|
94
|
+
// If analytics-ga4.js exists and our detected environment has 'initialiseGA4' set to true, load GA4.
|
95
|
+
if (typeof window.GOVUK.analyticsGa4.init !== 'undefined' && this.ga4EnvironmentVariables[environment].initialiseGA4) {
|
96
|
+
window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {}
|
97
|
+
window.GOVUK.analyticsGa4.vars = window.GOVUK.analyticsGa4.vars || {}
|
98
|
+
window.GOVUK.analyticsGa4.vars.id = 'GTM-MG7HG5W'
|
99
|
+
window.GOVUK.analyticsGa4.vars.auth = this.ga4EnvironmentVariables[environment].auth
|
100
|
+
window.GOVUK.analyticsGa4.vars.preview = this.ga4EnvironmentVariables[environment].preview
|
101
|
+
window.GOVUK.analyticsGa4.vars.environment = environment // Used for testing and debugging
|
102
|
+
|
103
|
+
window.GOVUK.analyticsGa4.vars.gem_version = 'not found'
|
104
|
+
var gemMeta = document.querySelector('meta[name="govuk:components_gem_version"]')
|
105
|
+
if (gemMeta) {
|
106
|
+
window.GOVUK.analyticsGa4.vars.gem_version = gemMeta.getAttribute('content')
|
191
107
|
}
|
108
|
+
window.GOVUK.analyticsGa4.init()
|
192
109
|
}
|
193
110
|
}
|
194
111
|
},
|
195
112
|
|
196
|
-
arrayContains: function (
|
197
|
-
|
198
|
-
return false
|
199
|
-
}
|
200
|
-
|
201
|
-
return params.array.indexOf(params.valueToFind) !== -1
|
113
|
+
arrayContains: function (valueToFind, array) {
|
114
|
+
return array.indexOf(valueToFind) !== -1
|
202
115
|
}
|
203
116
|
}
|
204
|
-
|
205
|
-
// This if statement stops this function running during testing
|
206
|
-
if (!window.jasmine) {
|
207
|
-
window.GOVUK.loadAnalytics.loadUa()
|
208
|
-
window.GOVUK.loadAnalytics.loadGa4()
|
209
|
-
}
|
@@ -741,9 +741,9 @@ $after-button-padding-left: govuk-spacing(4);
|
|
741
741
|
.gem-c-layout-super-navigation-header__navigation-second-item-link {
|
742
742
|
font-size: 16px;
|
743
743
|
font-size: govuk-px-to-rem(16px);
|
744
|
+
font-weight: bold;
|
744
745
|
|
745
746
|
@include govuk-media-query($from: "desktop") {
|
746
|
-
font-weight: bold;
|
747
747
|
padding: 0;
|
748
748
|
|
749
749
|
&:after {
|
@@ -6,6 +6,7 @@
|
|
6
6
|
classes << " gem-c-document-list--bottom-margin" if local_assigns[:margin_bottom]
|
7
7
|
classes << " gem-c-document-list--no-underline" if local_assigns[:remove_underline]
|
8
8
|
classes << " gem-c-document-list--no-top-border" if local_assigns[:remove_top_border]
|
9
|
+
classes << " gem-c-document-list--no-top-border-first-child" if local_assigns[:remove_top_border_from_first_child]
|
9
10
|
|
10
11
|
within_multitype_list ||= false
|
11
12
|
within_multitype_list_class = " gem-c-document-list__multi-list" if within_multitype_list
|
@@ -195,7 +195,7 @@ examples:
|
|
195
195
|
document_type: 'Statistical data set'
|
196
196
|
subtext: 'First published during the 1996 Conservative Government'
|
197
197
|
without_top_border_on_list_element:
|
198
|
-
description: Several interfaces across GOV.UK benefit from the semantics of the document list but have their own bespoke designs, sometimes meaning that the visual border element doesn't gel with said interface. Removing it using the below attribute allows for cleaner visual fidelity in
|
198
|
+
description: Several interfaces across GOV.UK benefit from the semantics of the document list but have their own bespoke designs, sometimes meaning that the visual border element doesn't gel with said interface. Removing it using the below attribute allows for cleaner visual fidelity in these instances.
|
199
199
|
data:
|
200
200
|
remove_top_border: true
|
201
201
|
items:
|
@@ -211,6 +211,23 @@ examples:
|
|
211
211
|
metadata:
|
212
212
|
public_updated_at: 2017-07-19 15:01:48
|
213
213
|
document_type: 'Statistical data set'
|
214
|
+
without_top_border_on_first_list_element:
|
215
|
+
description: Several interfaces across GOV.UK benefit from the semantics of the document list but have their own bespoke designs, sometimes meaning that the visual border element doesn't gel with said interface. Removing it using the below attribute allows for cleaner visual fidelity in these instances.
|
216
|
+
data:
|
217
|
+
remove_top_border_from_first_child: true
|
218
|
+
items:
|
219
|
+
- link:
|
220
|
+
text: 'Department for Education – Statistics at DfE'
|
221
|
+
path: '/government/organisations/department-for-education/about/statistics'
|
222
|
+
metadata:
|
223
|
+
public_updated_at: 2017-07-19 15:01:48
|
224
|
+
document_type: 'Corporate information'
|
225
|
+
- link:
|
226
|
+
text: 'State-funded school inspections and outcomes: management information'
|
227
|
+
path: '/government/organisations/department-for-education/about/statistics'
|
228
|
+
metadata:
|
229
|
+
public_updated_at: 2017-07-19 15:01:48
|
230
|
+
document_type: 'Statistical data set'
|
214
231
|
highlighted_result:
|
215
232
|
description: Highlight one or more of the items in the list. This is used on finders to provide a 'top result' for a search. The `highlight_text` parameter is optional.
|
216
233
|
data:
|
@@ -180,11 +180,32 @@ examples:
|
|
180
180
|
</tr>
|
181
181
|
</tbody>
|
182
182
|
</table>
|
183
|
+
tables_with_alignments:
|
184
|
+
data:
|
185
|
+
block: |
|
186
|
+
<table>
|
187
|
+
<thead>
|
188
|
+
<tr>
|
189
|
+
<th scope="col">Default aligned</th>
|
190
|
+
<th class="cell-text-left" scope="col">Left aligned</th>
|
191
|
+
<th class="cell-text-center" scope="col">Center aligned</th>
|
192
|
+
<th class="cell-text-right" scope="col">Right aligned</th>
|
193
|
+
</tr>
|
194
|
+
</thead>
|
195
|
+
<tbody>
|
196
|
+
<tr>
|
197
|
+
<td>First body part</td>
|
198
|
+
<td class="cell-text-left">Second cell</td>
|
199
|
+
<td class="cell-text-center">Third cell</td>
|
200
|
+
<td class="cell-text-right">fourth cell</td>
|
201
|
+
</tr>
|
202
|
+
</tbody>
|
203
|
+
</table>
|
183
204
|
charts:
|
184
205
|
description: |
|
185
206
|
The Government Statistical Service (GSS) guidance recommends [a limit of four categories as best practice for basic data visualisations](https://gss.civilservice.gov.uk/policy-store/data-visualisation-colours-in-charts/#section-5).
|
186
207
|
|
187
|
-
Note that charts which have up to 7 categories, [chart with colours](http://govuk-publishing-components.dev.gov.uk/component-guide/govspeak/chart_with_colours/preview), for example, will display subsequent bars in `#3d3d3d`, `#a285d1` and the 7th bar in the default colour of `#0b0c0c` and will still meet the colour contrast requirements for adjacent colours.
|
208
|
+
Note that charts which have up to 7 categories, [chart with colours](http://govuk-publishing-components.dev.gov.uk/component-guide/govspeak/chart_with_colours/preview), for example, will display subsequent bars in `#3d3d3d`, `#a285d1` and the 7th bar in the default colour of `#0b0c0c` and will still meet the colour contrast requirements for adjacent colours.
|
188
209
|
Charts that have 8 or more categories will display additional bars in the default colour and will not meet colour contrast requirements for adjacent colours.
|
189
210
|
data:
|
190
211
|
block: |
|
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: 34.
|
4
|
+
version: 34.7.0
|
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-
|
11
|
+
date: 2023-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|
@@ -446,6 +446,7 @@ files:
|
|
446
446
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js
|
447
447
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-schemas.js
|
448
448
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-specialist-link-tracker.js
|
449
|
+
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/init-ga4.js
|
449
450
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/pii-remover.js
|
450
451
|
- app/assets/javascripts/govuk_publishing_components/analytics.js
|
451
452
|
- app/assets/javascripts/govuk_publishing_components/analytics/analytics.js
|
@@ -1373,7 +1374,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1373
1374
|
- !ruby/object:Gem::Version
|
1374
1375
|
version: '0'
|
1375
1376
|
requirements: []
|
1376
|
-
rubygems_version: 3.4.
|
1377
|
+
rubygems_version: 3.4.6
|
1377
1378
|
signing_key:
|
1378
1379
|
specification_version: 4
|
1379
1380
|
summary: A gem to document components in GOV.UK frontend applications
|