govuk_publishing_components 61.3.1 → 61.4.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/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-change-tracker.js +147 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-tracker.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4-publishing.js +1 -0
- data/app/assets/stylesheets/component_guide/application.scss +1 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +0 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +0 -21
- data/app/assets/stylesheets/govuk_publishing_components/components/_emergency-banner.scss +0 -13
- data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +0 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_signup-link.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +0 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_tabs.scss +0 -23
- data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +2 -11
- data/app/controllers/govuk_publishing_components/component_guide_controller.rb +0 -44
- data/app/views/govuk_publishing_components/component_guide/preview.html.erb +1 -17
- data/app/views/govuk_publishing_components/components/_attachment.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_emergency_banner.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_published_dates.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_signup_link.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_success_alert.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +1 -1
- data/app/views/layouts/govuk_publishing_components/application.html.erb +9 -2
- data/lib/govuk_publishing_components/config.rb +5 -1
- data/lib/govuk_publishing_components/presenters/component_wrapper_helper.rb +1 -1
- data/lib/govuk_publishing_components/presenters/translation_nav_helper.rb +4 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/axe-core/README.md +4 -4
- data/node_modules/axe-core/axe.d.ts +74 -10
- data/node_modules/axe-core/axe.js +17306 -17047
- data/node_modules/axe-core/axe.min.js +2 -2
- data/node_modules/axe-core/locales/_template.json +18 -10
- data/node_modules/axe-core/locales/de.json +5 -1
- data/node_modules/axe-core/locales/ja.json +127 -118
- data/node_modules/axe-core/locales/pt_PT.json +1123 -0
- data/node_modules/axe-core/locales/ru.json +1127 -0
- data/node_modules/axe-core/package.json +9 -9
- data/node_modules/axe-core/sri-history.json +4 -0
- metadata +5 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b89ee24c83866c75be91bf960a176f2dfe9cb81dab80c5f847a92fc87b54aabb
|
|
4
|
+
data.tar.gz: 91d606a1f9be7bb0709983c262eadd92ee6abbe91a9700e5e212ae89383a7770
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 520d29353a0f37119e5f8f478851bdab86e6135f15a14eeb6e31d64f1ea5ee14913a69c549e40cf8d227b714ffd376937b6339372645d27317d1ebd562627fa2
|
|
7
|
+
data.tar.gz: 3e820542621081f90b8d6cedeb896b3e1128f023c2cd9eee8f4b92f4014114ebd53865376ac672c42cfc7ea1cf9e84475fad1318938167d447fd1ad9a505b300
|
data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-change-tracker.js
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
window.GOVUK = window.GOVUK || {}
|
|
2
|
+
window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
3
|
+
|
|
4
|
+
// This does not meet Grade C browser support for Edge
|
|
5
|
+
// as `CSS.escape` is not supported in Edge 12-18.
|
|
6
|
+
//
|
|
7
|
+
// Running this will cause an error in Edge 12-18
|
|
8
|
+
// but will not impact other JS being run.
|
|
9
|
+
|
|
10
|
+
(function (Modules) {
|
|
11
|
+
'use strict'
|
|
12
|
+
|
|
13
|
+
function Ga4FormChangeTracker (module) {
|
|
14
|
+
this.module = module
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
Ga4FormChangeTracker.prototype.init = function () {
|
|
18
|
+
var consentCookie = window.GOVUK.getConsentCookie()
|
|
19
|
+
|
|
20
|
+
if (consentCookie && consentCookie.usage) {
|
|
21
|
+
this.startModule()
|
|
22
|
+
} else {
|
|
23
|
+
this.start = this.startModule.bind(this)
|
|
24
|
+
window.addEventListener('cookie-consent', this.start)
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// triggered by cookie-consent event, which happens when users consent to cookies
|
|
29
|
+
Ga4FormChangeTracker.prototype.startModule = function () {
|
|
30
|
+
if (window.dataLayer) {
|
|
31
|
+
window.removeEventListener('cookie-consent', this.start)
|
|
32
|
+
this.module.addEventListener('change', this.trackFormChange.bind(this))
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
Ga4FormChangeTracker.prototype.getSection = function (target, checkableValue) {
|
|
37
|
+
const { id } = target
|
|
38
|
+
|
|
39
|
+
const fieldset = target.closest('fieldset')
|
|
40
|
+
const legend = fieldset && fieldset.querySelector('legend')
|
|
41
|
+
const sectionContainer = this.module.closest('[data-ga4-section]')
|
|
42
|
+
const label = this.module.querySelector(`label[for='${window.CSS.escape(id)}']`)
|
|
43
|
+
|
|
44
|
+
const ga4FormSectionContainer = target.closest('[data-ga4-form-section]')
|
|
45
|
+
|
|
46
|
+
// by default use the nearest `data-ga4-section` (if present)
|
|
47
|
+
let section = sectionContainer && sectionContainer.dataset.ga4Section
|
|
48
|
+
|
|
49
|
+
// unless there is a nearest `data-ga4-form-section`
|
|
50
|
+
if (ga4FormSectionContainer) {
|
|
51
|
+
section = ga4FormSectionContainer.dataset.ga4FormSection
|
|
52
|
+
} else {
|
|
53
|
+
// otherwise use the label of input (if it is a text field)
|
|
54
|
+
section = label ? label.innerText : section
|
|
55
|
+
// or use the legend of the input (if it is checkable field)
|
|
56
|
+
section = legend && checkableValue ? legend.innerText : section
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return section
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
Ga4FormChangeTracker.prototype.handleDateComponent = function (target) {
|
|
63
|
+
const isDateComponent = target.closest('.govuk-date-input')
|
|
64
|
+
const value = target.value
|
|
65
|
+
|
|
66
|
+
if (!isDateComponent) { return value.length }
|
|
67
|
+
|
|
68
|
+
// only track if completely filled in
|
|
69
|
+
const inputs = [
|
|
70
|
+
...target.closest('.govuk-date-input').querySelectorAll('input')
|
|
71
|
+
]
|
|
72
|
+
const allInputsSet = inputs.every((input) => input.value)
|
|
73
|
+
|
|
74
|
+
if (allInputsSet) {
|
|
75
|
+
return inputs.map((input) => input.value).join('/')
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
Ga4FormChangeTracker.prototype.trackFormChange = function (event) {
|
|
80
|
+
const target = event.target
|
|
81
|
+
const { type, id } = target
|
|
82
|
+
|
|
83
|
+
if (type === 'search') return
|
|
84
|
+
|
|
85
|
+
const indexContainer =
|
|
86
|
+
window.GOVUK.analyticsGa4.core.trackFunctions.findTrackingAttributes(
|
|
87
|
+
target,
|
|
88
|
+
'data-ga4-index'
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
let index = {}
|
|
92
|
+
|
|
93
|
+
if (indexContainer) {
|
|
94
|
+
try {
|
|
95
|
+
index = JSON.parse(indexContainer.getAttribute('data-ga4-index'))
|
|
96
|
+
} catch (e) {
|
|
97
|
+
console.warn('GA4 configuration error: ' + e.message, window.location)
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const value = (event.detail && event.detail.value) || target.value
|
|
102
|
+
|
|
103
|
+
// a radio or check input with a `name` and `value`
|
|
104
|
+
// or an option of `value` within a `select` with `name`
|
|
105
|
+
const checkableValue = this.module.querySelector(
|
|
106
|
+
`#${window.CSS.escape(id)}[value="${window.CSS.escape(value)}"], #${window.CSS.escape(id)} [value="${window.CSS.escape(value)}"]`
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
let action = 'select'
|
|
110
|
+
let text
|
|
111
|
+
|
|
112
|
+
if (checkableValue) {
|
|
113
|
+
// radio, check, option can have `:checked` pseudo-class
|
|
114
|
+
if (!checkableValue.matches(':checked')) {
|
|
115
|
+
action = 'remove'
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
text = checkableValue.innerText ||
|
|
119
|
+
this.module.querySelector(`label[for='${window.CSS.escape(id)}']`).innerText
|
|
120
|
+
|
|
121
|
+
if (text) {
|
|
122
|
+
text = text.replace(/\r?\n|\r/g, ' ')
|
|
123
|
+
}
|
|
124
|
+
} else if (!text) {
|
|
125
|
+
// it's a free form text field
|
|
126
|
+
text = this.handleDateComponent(target)
|
|
127
|
+
|
|
128
|
+
if (!text) return
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
window.GOVUK.analyticsGa4.core.applySchemaAndSendData(
|
|
132
|
+
{
|
|
133
|
+
...index,
|
|
134
|
+
section: this.getSection(
|
|
135
|
+
target,
|
|
136
|
+
checkableValue && checkableValue.matches(':not(option)')
|
|
137
|
+
),
|
|
138
|
+
event_name: 'select_content',
|
|
139
|
+
action,
|
|
140
|
+
text
|
|
141
|
+
},
|
|
142
|
+
'event_data'
|
|
143
|
+
)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
Modules.Ga4FormChangeTracker = Ga4FormChangeTracker
|
|
147
|
+
})(window.GOVUK.Modules)
|
|
@@ -85,7 +85,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
85
85
|
var labelFor = label.getAttribute('for')
|
|
86
86
|
var input = false
|
|
87
87
|
if (labelFor) {
|
|
88
|
-
input = this.module.querySelector('[id=' + labelFor + ']')
|
|
88
|
+
input = this.module.querySelector('[id="' + labelFor + '"]')
|
|
89
89
|
} else {
|
|
90
90
|
input = label.querySelector('input')
|
|
91
91
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//= require ./analytics-ga4/ga4-form-change-tracker
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// This file contains the styles for the Component Guide.
|
|
2
2
|
@use "sass:color";
|
|
3
|
-
@import "govuk_publishing_components/
|
|
4
|
-
@import "govuk_publishing_components/component_support";
|
|
3
|
+
@import "govuk_publishing_components/all_components";
|
|
5
4
|
|
|
6
5
|
// Include required helpers
|
|
7
6
|
@import "../../stylesheets/govuk_publishing_components/components/helpers/markdown-typography";
|
|
@@ -59,10 +59,6 @@ $thumbnail-icon-border-colour: govuk-colour("mid-grey");
|
|
|
59
59
|
@include govuk-font($size: 27);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
.gem-c-attachment__link {
|
|
63
|
-
line-height: 1.29;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
62
|
.gem-c-attachment__metadata {
|
|
67
63
|
margin: 0 0 govuk-spacing(3);
|
|
68
64
|
color: $govuk-secondary-text-colour;
|
|
@@ -1,27 +1,6 @@
|
|
|
1
1
|
@import "govuk_publishing_components/individual_component_support";
|
|
2
2
|
@import "govuk/components/breadcrumbs/breadcrumbs";
|
|
3
3
|
|
|
4
|
-
.gem-c-breadcrumbs--inverse .govuk-breadcrumbs__list-item .govuk-breadcrumbs__link {
|
|
5
|
-
&:link,
|
|
6
|
-
&:visited,
|
|
7
|
-
&:hover,
|
|
8
|
-
&:active {
|
|
9
|
-
color: govuk-colour("white");
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
&:focus {
|
|
13
|
-
color: $govuk-focus-text-colour;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.gem-c-breadcrumbs--inverse .govuk-breadcrumbs__list-item {
|
|
18
|
-
color: govuk-colour("white");
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.gem-c-breadcrumbs--inverse .govuk-breadcrumbs__list-item::before {
|
|
22
|
-
border-color: govuk-colour("white");
|
|
23
|
-
}
|
|
24
|
-
|
|
25
4
|
.gem-c-breadcrumbs--border-bottom {
|
|
26
5
|
border-bottom: 1px solid $govuk-border-colour;
|
|
27
6
|
padding-bottom: govuk-spacing(1);
|
|
@@ -49,19 +49,6 @@
|
|
|
49
49
|
margin: govuk-spacing(4) 0;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
.gem-c-emergency-banner__link {
|
|
53
|
-
@include govuk-font(19);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.gem-c-emergency-banner__link:link,
|
|
57
|
-
.gem-c-emergency-banner__link:visited {
|
|
58
|
-
color: govuk-colour("white");
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.gem-c-emergency-banner__link:focus {
|
|
62
|
-
@include govuk-focused-text;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
52
|
.gem-c-emergency-banner--notable-death {
|
|
66
53
|
background-color: govuk-colour("black");
|
|
67
54
|
}
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.gem-c-signup-link__title {
|
|
20
|
-
margin
|
|
21
|
-
|
|
20
|
+
margin: 0 0 govuk-spacing(2) govuk-spacing(5);
|
|
21
|
+
@include govuk-font(19, $weight: "bold");
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.gem-c-signup-link--with-background-and-border {
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
@import "govuk_publishing_components/individual_component_support";
|
|
2
2
|
@import "govuk/components/notification-banner/notification-banner";
|
|
3
3
|
|
|
4
|
-
.gem-c-success-alert__message {
|
|
5
|
-
@include govuk-font(19, $weight: bold);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
4
|
// stylelint-disable declaration-no-important
|
|
9
5
|
@include govuk-media-query($media-type: print) {
|
|
10
6
|
.gem-c-success-alert {
|
|
@@ -9,29 +9,6 @@
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
// We have some styles within GOVUK (.content-block) which can leak into the list styles for this component.
|
|
13
|
-
// These styles are defined in Static:
|
|
14
|
-
// https://github.com/alphagov/static/blob/a815620cada7ea1c65428c1c3b3ac4dbe28977bf/app/assets/stylesheets/helpers/_text.scss
|
|
15
|
-
// This sets more specific selectors so those unwanted styles are overidden
|
|
16
|
-
ul.govuk-tabs__list { // stylelint-disable-line selector-no-qualifying-type
|
|
17
|
-
margin: 0;
|
|
18
|
-
padding: 0;
|
|
19
|
-
list-style: none;
|
|
20
|
-
@include govuk-responsive-margin(6, "bottom");
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
li.govuk-tabs__list-item { // stylelint-disable-line selector-no-qualifying-type
|
|
24
|
-
margin-left: govuk-spacing(5);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.govuk-frontend-supported { // stylelint-disable-line no-duplicate-selectors
|
|
28
|
-
@include govuk-media-query($from: tablet) {
|
|
29
|
-
ul.govuk-tabs__list { // stylelint-disable-line selector-no-qualifying-type
|
|
30
|
-
margin-bottom: 0;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
12
|
@include govuk-media-query($media-type: print) {
|
|
36
13
|
.govuk-tabs__title {
|
|
37
14
|
display: block !important; // stylelint-disable-line declaration-no-important
|
|
@@ -33,18 +33,9 @@
|
|
|
33
33
|
|
|
34
34
|
.gem-c-translation-nav--inverse {
|
|
35
35
|
border-color: govuk-colour("white");
|
|
36
|
-
|
|
37
|
-
.gem-c-translation-nav__list-item,
|
|
38
|
-
.gem-c-translation-nav__link {
|
|
39
|
-
color: govuk-colour("white");
|
|
40
|
-
|
|
41
|
-
&:focus {
|
|
42
|
-
color: govuk-colour("black");
|
|
43
|
-
}
|
|
44
|
-
}
|
|
36
|
+
color: govuk-colour("white");
|
|
45
37
|
}
|
|
46
38
|
|
|
47
39
|
.gem-c-translation-nav__list-item:last-child {
|
|
48
|
-
border
|
|
49
|
-
border-left: 0;
|
|
40
|
+
border: 0;
|
|
50
41
|
}
|
|
@@ -35,21 +35,6 @@ module GovukPublishingComponents
|
|
|
35
35
|
def preview
|
|
36
36
|
@component_examples = []
|
|
37
37
|
@component_doc = component_docs.get(params[:component])
|
|
38
|
-
|
|
39
|
-
@all_components = true if params[:all_components] == "true"
|
|
40
|
-
@all_gem_component_docs = []
|
|
41
|
-
@all_app_component_docs = []
|
|
42
|
-
if @all_components
|
|
43
|
-
@component_gem_path = Gem.loaded_specs["govuk_publishing_components"].full_gem_path
|
|
44
|
-
|
|
45
|
-
# Remove components without CSS, and the current component. The current component is excluded as the view will handle rendering its CSS.
|
|
46
|
-
@all_gem_component_docs = gem_component_docs.all.reject { |component| !component_has_sass_file(component.id.gsub("_", "-")) || component.id == @component_doc.id }
|
|
47
|
-
@all_app_component_docs = component_docs.all.reject { |component| !app_component_has_sass_file(component.id.gsub("_", "-")) || component.id == @component_doc.id }
|
|
48
|
-
|
|
49
|
-
@current_component_id = @component_doc.id.gsub("_", "-")
|
|
50
|
-
@render_component_first = params[:render_component_first] == "true" unless !component_has_sass_file(@current_component_id) && !app_component_has_sass_file(@current_component_id)
|
|
51
|
-
end
|
|
52
|
-
|
|
53
38
|
@preview = true
|
|
54
39
|
|
|
55
40
|
if params[:example].present?
|
|
@@ -57,9 +42,6 @@ module GovukPublishingComponents
|
|
|
57
42
|
else
|
|
58
43
|
@component_examples = @component_doc.examples
|
|
59
44
|
end
|
|
60
|
-
|
|
61
|
-
@percy = true if params[:percy] == "true"
|
|
62
|
-
@preview_title = preview_title(@component_doc, @component_examples, @all_components, @render_component_first, @percy)
|
|
63
45
|
end
|
|
64
46
|
|
|
65
47
|
def components_in_use_sass
|
|
@@ -154,10 +136,6 @@ module GovukPublishingComponents
|
|
|
154
136
|
extra_components.flatten.uniq.sort
|
|
155
137
|
end
|
|
156
138
|
|
|
157
|
-
def app_component_has_sass_file(component)
|
|
158
|
-
Pathname.new(Rails.root + "app/assets/stylesheets/components/_#{component}.scss").exist?
|
|
159
|
-
end
|
|
160
|
-
|
|
161
139
|
def component_has_sass_file(component)
|
|
162
140
|
Pathname.new(@component_gem_path + "/app/assets/stylesheets/govuk_publishing_components/components/_#{component}.scss").exist?
|
|
163
141
|
end
|
|
@@ -190,27 +168,5 @@ module GovukPublishingComponents
|
|
|
190
168
|
h[:url] = component_doc_path(component_doc.id) if component_example
|
|
191
169
|
end
|
|
192
170
|
end
|
|
193
|
-
|
|
194
|
-
def preview_title(component, component_examples, all_components, render_component_first, percy)
|
|
195
|
-
title = [component.name]
|
|
196
|
-
|
|
197
|
-
if component_examples.length == 1 && !percy
|
|
198
|
-
title[0] << ": #{component_examples.first.name} preview"
|
|
199
|
-
end
|
|
200
|
-
|
|
201
|
-
if all_components
|
|
202
|
-
title << "+ every component's CSS file"
|
|
203
|
-
|
|
204
|
-
title << if render_component_first
|
|
205
|
-
"- component rendering first"
|
|
206
|
-
else
|
|
207
|
-
"- component rendering last"
|
|
208
|
-
end
|
|
209
|
-
end
|
|
210
|
-
|
|
211
|
-
title << "- #{GovukPublishingComponents::Config.component_guide_title}" unless percy
|
|
212
|
-
|
|
213
|
-
title.join(" ")
|
|
214
|
-
end
|
|
215
171
|
end
|
|
216
172
|
end
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
<% content_for :application_stylesheet do
|
|
2
|
-
if @all_components
|
|
3
|
-
# If rendering the component CSS first, do it explicitly here. If not, the component partial render will handle the CSS import.
|
|
4
|
-
if @render_component_first
|
|
5
|
-
if @component_doc.source == "application"
|
|
6
|
-
add_app_component_stylesheet(@current_component_id)
|
|
7
|
-
else
|
|
8
|
-
add_gem_component_stylesheet(@current_component_id)
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
@all_gem_component_docs.each do |component|
|
|
12
|
-
add_gem_component_stylesheet(component.id.gsub("_", "-"))
|
|
13
|
-
end
|
|
14
|
-
@all_app_component_docs.each do |component|
|
|
15
|
-
add_app_component_stylesheet(component.id.gsub("_", "-"))
|
|
16
|
-
end
|
|
17
|
-
end %>
|
|
1
|
+
<% content_for :application_stylesheet do %>
|
|
18
2
|
<% if @component_doc.source == "application" && application_stylesheet_in_use? %>
|
|
19
3
|
<%= render "application_stylesheet" %>
|
|
20
4
|
<% end %>
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
<%= tag.div class: "gem-c-attachment__details" do %>
|
|
89
89
|
<%= content_tag(shared_helper.get_heading_level, class: "gem-c-attachment__title") do %>
|
|
90
90
|
<%= link_to attachment.title, attachment.url,
|
|
91
|
-
class: "govuk-link
|
|
91
|
+
class: "govuk-link",
|
|
92
92
|
target: target,
|
|
93
93
|
data: url_data_attributes %>
|
|
94
94
|
<% end %>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
classes = %w[gem-c-breadcrumbs govuk-breadcrumbs]
|
|
12
12
|
classes << "govuk-breadcrumbs--collapse-on-mobile" if collapse_on_mobile
|
|
13
|
-
classes << "
|
|
13
|
+
classes << "govuk-breadcrumbs--inverse" if inverse
|
|
14
14
|
classes << "gem-c-breadcrumbs--border-bottom" if border == "bottom"
|
|
15
15
|
|
|
16
16
|
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<% if last_updated %>
|
|
24
24
|
<%= t("components.published_dates.last_updated", date: last_updated) %>
|
|
25
25
|
<% if link_to_history && history.empty? %>
|
|
26
|
-
<span aria-hidden="true">— </span><a href="#history" class="
|
|
26
|
+
<span aria-hidden="true">— </span><a href="#history" class="govuk-link"><%= t("components.published_dates.see_all_updates", locale: :en) %></a>
|
|
27
27
|
<% elsif history.any? %>
|
|
28
28
|
<a href="#full-history"
|
|
29
29
|
class="gem-c-published-dates__toggle govuk-link"
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
%>
|
|
18
18
|
<% if link_text && link_href %>
|
|
19
19
|
<%= tag.div(**component_helper.all_attributes) do %>
|
|
20
|
-
<div class="gem-c-signup-link__inner
|
|
20
|
+
<div class="gem-c-signup-link__inner">
|
|
21
21
|
<svg class="gem-c-signup-link__icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 459.334 459.334">
|
|
22
22
|
<path fill="black" d="M177.216 404.514c-.001.12-.009.239-.009.359 0 30.078 24.383 54.461 54.461 54.461s54.461-24.383 54.461-54.461c0-.12-.008-.239-.009-.359H175.216zM403.549 336.438l-49.015-72.002v-89.83c0-60.581-43.144-111.079-100.381-122.459V24.485C254.152 10.963 243.19 0 229.667 0s-24.485 10.963-24.485 24.485v27.663c-57.237 11.381-100.381 61.879-100.381 122.459v89.83l-49.015 72.002a24.76 24.76 0 0 0 20.468 38.693H383.08a24.761 24.761 0 0 0 20.469-38.694z" />
|
|
23
23
|
</svg>
|
|
24
|
-
<%= content_tag(shared_helper.get_heading_level, heading, class: "
|
|
24
|
+
<%= content_tag(shared_helper.get_heading_level, heading, class: "gem-c-signup-link__title") if heading %>
|
|
25
25
|
<%= link_to( link_text, link_href, {
|
|
26
26
|
class: "govuk-link gem-c-signup-link__link",
|
|
27
27
|
data: data,
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<%= tag.h3 message, class: "govuk-notification-banner__heading" %>
|
|
22
22
|
<%= description %>
|
|
23
23
|
<% else %>
|
|
24
|
-
<%= tag.p message, class: "govuk-
|
|
24
|
+
<%= tag.p message, class: "govuk-notification-banner__heading" %>
|
|
25
25
|
<% end %>
|
|
26
26
|
</div>
|
|
27
27
|
<% end %>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
hreflang: translation[:locale],
|
|
22
22
|
lang: translation[:locale],
|
|
23
23
|
rel: "alternate",
|
|
24
|
-
class: "govuk-link
|
|
24
|
+
class: "govuk-link #{translation_helper.link_class} #{brand_helper.color_class}",
|
|
25
25
|
data: translation[:data_attributes] %>
|
|
26
26
|
<% end %>
|
|
27
27
|
</li>
|
|
@@ -26,7 +26,15 @@
|
|
|
26
26
|
<html lang="en" class="<%= "govuk-template" unless @preview %> govuk-template--rebranded">
|
|
27
27
|
<head>
|
|
28
28
|
<meta charset="utf-8">
|
|
29
|
-
<title
|
|
29
|
+
<title>
|
|
30
|
+
<% if @preview %>
|
|
31
|
+
<%= @component_doc.name %><% if @component_examples.length == 1 %>:
|
|
32
|
+
<%= @component_examples.first.name %>
|
|
33
|
+
<% end %>
|
|
34
|
+
preview -
|
|
35
|
+
<% end %>
|
|
36
|
+
<%= yield :title %><% if content_for(:title) %> - <% end %><%= GovukPublishingComponents::Config.component_guide_title %>
|
|
37
|
+
</title>
|
|
30
38
|
<meta name="robots" content="noindex,nofollow,noimageindex">
|
|
31
39
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
32
40
|
<%= csrf_meta_tags %>
|
|
@@ -34,7 +42,6 @@
|
|
|
34
42
|
|
|
35
43
|
<%= stylesheet_link_tag "component_guide/application", media: "all" %>
|
|
36
44
|
<%= yield :application_stylesheet %>
|
|
37
|
-
<%= render_component_stylesheets %>
|
|
38
45
|
<%= yield :extra_headers %>
|
|
39
46
|
</head>
|
|
40
47
|
<body class="gem-c-layout-for-admin govuk-template__body">
|
|
@@ -35,10 +35,14 @@ module GovukPublishingComponents
|
|
|
35
35
|
Gem::Specification.find_by_name("govuk_publishing_components").gem_dir
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
+
def self.component_guide_stylesheet
|
|
39
|
+
{ "#{gem_directory}/app/assets/stylesheets/component_guide/application.scss" => "component_guide/application.css" }
|
|
40
|
+
end
|
|
41
|
+
|
|
38
42
|
def self.all_stylesheets
|
|
39
43
|
stylesheets = Dir.glob("#{gem_directory}/app/assets/stylesheets/govuk_publishing_components/components/*.scss")
|
|
40
44
|
|
|
41
|
-
application_stylesheet_hash =
|
|
45
|
+
application_stylesheet_hash = component_guide_stylesheet
|
|
42
46
|
|
|
43
47
|
stylesheets.each_with_object(application_stylesheet_hash) do |path, hsh|
|
|
44
48
|
hsh[path] = "govuk_publishing_components/components/#{File.basename(path, '.*')}.css"
|
|
@@ -183,7 +183,7 @@ module GovukPublishingComponents
|
|
|
183
183
|
def check_lang_is_valid(lang)
|
|
184
184
|
return if lang.blank?
|
|
185
185
|
|
|
186
|
-
langs = %w[ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh zh-Hans zh-Hant zh-tw cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl gd gv ka de el kl gn gu ht ha he hz hi ho hu is io ig id in ia ie iu ik ga it ja jv kl kn kr ks kk km ki rw rn ky kv kg ko ku kj lo la lv li ln lt lu lg lb gv mk mg ms ml mt mi mr mh mo mn na nv ng nd ne no nb nn ii oc oj cu or om os pi ps fa pl pt pa pa-pk qu rm ro ru se sm sg sa sr sh st tn sn ii sd si ss sk sl so nr es su sw ss sv tl ty tg ta tt te th bo ti to ts tr tk tw ug uk ur uz ve vi vo wa cy wo fy xh yi ji yo za zu]
|
|
186
|
+
langs = %w[ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh zh-Hans zh-Hant zh-hk zh-tw cv kw co cr hr cs da dv nl dz dr en eo et ee fo fj fi fr ff gl gd gv ka de el kl gn gu ht ha he hz hi ho hu is io ig id in ia ie iu ik ga it ja jv kl kn kr ks kk km ki rw rn ky kv kg ko ku kj lo la lv li ln lt lu lg lb gv mk mg ms ml mt mi mr mh mo mn na nv ng nd ne no nb nn ii oc oj cu or om os pi ps fa pl pt pa pa-pk qu rm ro ru se sm sg sa sr sh st tn sn ii sd si ss sk sl so nr es es-419 su sw ss sv tl ty tg ta tt te th bo ti to ts tr tk tw ug uk ur uz ve vi vo wa cy wo fy xh yi ji yo za zu]
|
|
187
187
|
unless langs.include? lang
|
|
188
188
|
raise(ArgumentError, "lang attribute (#{lang}) is not recognised")
|
|
189
189
|
end
|
|
@@ -138,21 +138,21 @@ axe.configure({
|
|
|
138
138
|
Axe-core supports the following locales. Do note that since locales are contributed by our community, they are not guaranteed to include all translations needed in a release.
|
|
139
139
|
|
|
140
140
|
- Basque
|
|
141
|
+
- Chinese (Simplified)
|
|
142
|
+
- Chinese (Traditional)
|
|
141
143
|
- Danish
|
|
142
144
|
- Dutch
|
|
143
145
|
- French
|
|
144
146
|
- German
|
|
147
|
+
- Greek
|
|
145
148
|
- Hebrew
|
|
149
|
+
- Italian
|
|
146
150
|
- Japanese
|
|
147
151
|
- Korean
|
|
148
152
|
- Norwegian (Bokmål)
|
|
149
153
|
- Polish
|
|
150
154
|
- Portuguese (Brazilian)
|
|
151
155
|
- Spanish
|
|
152
|
-
- Greek
|
|
153
|
-
- Italian
|
|
154
|
-
- Simplified Chinese
|
|
155
|
-
- Traditional Chinese
|
|
156
156
|
|
|
157
157
|
## Updates & Security
|
|
158
158
|
|