govuk_publishing_components 64.1.2 → 64.2.0
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/lib/govspeak/magna-charta.js +3 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +5 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +0 -20
- data/app/controllers/govuk_publishing_components/applications_page_controller.rb +5 -2
- data/app/controllers/govuk_publishing_components/audit_controller.rb +3 -2
- data/app/models/govuk_publishing_components/applications_page.rb +39 -4
- data/app/views/govuk_publishing_components/applications_page/_table-content.html.erb +9 -0
- data/app/views/govuk_publishing_components/applications_page/show.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_service_navigation.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/docs/attachment.yml +1 -2
- data/app/views/govuk_publishing_components/components/docs/details.yml +1 -8
- data/app/views/govuk_publishing_components/components/docs/error_alert.yml +2 -4
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +7 -7
- data/app/views/govuk_publishing_components/components/docs/modal_dialogue.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/table.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/tabs.yml +2 -6
- data/lib/govuk_publishing_components/presenters/contents_list_helper.rb +2 -3
- data/lib/govuk_publishing_components/presenters/pagination_helper.rb +1 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +31 -3
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +31 -3
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/footer/fixtures.json +95 -23
- data/node_modules/govuk-frontend/dist/govuk/components/footer/macro-options.json +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-default.html +22 -22
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-full-gds-example.html +22 -22
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-three-equal-columns.html +22 -22
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-html-content-licence-and-copyright-notice.html +17 -17
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-meta.html +22 -22
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-text-content-licence-and-copyright-notice.html +17 -17
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-one-column.html +22 -22
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-two-columns.html +22 -22
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-meta-links-and-meta-content.html +22 -22
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-navigation.html +22 -22
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-no-content-licence.html +16 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-only-custom-meta.html +20 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-only-meta-links.html +59 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template.njk +30 -28
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/fixtures.json +31 -9
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-default.html +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-first-page.html +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-last-page.html +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-custom-link-and-item-text.html +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-many-pages.html +9 -9
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template.njk +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/fixtures.json +18 -18
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +30 -2
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs +30 -2
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs +30 -2
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-default.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-inverse.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-a-single-navigation-item-and-collapsenavigationonmobile-set-to-true.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-html-navigation-items.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-large-navigation.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-navigation-with-a-current-item.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-non-link-navigation-items.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-service-name-and-navigation.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template.njk +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/macros/attributes.njk +30 -14
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss.map +1 -1
- data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +1 -1
- data/node_modules/govuk-frontend/package.json +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ac4e471b589031c6a117d700be0a816631ed09e325fd174a05965d7d86f5ad95
|
|
4
|
+
data.tar.gz: 8a9a5455dd4b3464b4abd50a2b84fb7a21d39415e7c72f6043232f8711f20db7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b695337f57ca2b458e5df63e52338565ad1e0021be84e912a29373b0119d5ce96c49a5b78bc88b577372ef2efcfcb2b147e1bb7e1c6433cf1b069499187196f2
|
|
7
|
+
data.tar.gz: 216b8f0d3f45d9a8732983b26361632d6597bc21279c170dbbf4a123e416b9c1863abb922e898afe0af3d897fa0b6fe4b742fb9d21b16ea4a59cdaef10a1f98c
|
|
@@ -193,13 +193,13 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
193
193
|
var toggleText = document.createElement('span')
|
|
194
194
|
var toggleStatus = document.createElement('span')
|
|
195
195
|
|
|
196
|
-
toggleText.classList.add('
|
|
196
|
+
toggleText.classList.add('js-toggle-text')
|
|
197
197
|
toggleText.innerHTML = chartVisibleText
|
|
198
198
|
|
|
199
199
|
toggleStatus.classList.add('govuk-visually-hidden', 'mc-toggle-status')
|
|
200
200
|
toggleStatus.setAttribute('role', 'alert')
|
|
201
201
|
|
|
202
|
-
link.classList.add('
|
|
202
|
+
link.classList.add('gem-c-button', 'govuk-button', 'govuk-button--secondary')
|
|
203
203
|
link.appendChild(toggleText)
|
|
204
204
|
link.appendChild(toggleStatus)
|
|
205
205
|
|
|
@@ -213,7 +213,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
213
213
|
this.toggleLink.addEventListener('click', function (e) {
|
|
214
214
|
e.preventDefault()
|
|
215
215
|
|
|
216
|
-
var toggleText = that.toggleLink.querySelector('.
|
|
216
|
+
var toggleText = that.toggleLink.querySelector('.js-toggle-text')
|
|
217
217
|
var toggleStatus = that.toggleLink.querySelector('.mc-toggle-status')
|
|
218
218
|
|
|
219
219
|
that.$graphContainer.classList.toggle('mc-hidden')
|
|
@@ -684,7 +684,7 @@ $search-icon-height: 20px;
|
|
|
684
684
|
border-top: 0;
|
|
685
685
|
border-bottom: 2pt solid $govuk-print-text-colour;
|
|
686
686
|
margin: 0 0 5mm;
|
|
687
|
-
background:
|
|
687
|
+
background: transparent;
|
|
688
688
|
|
|
689
689
|
&:has(.gem-c-layout-super-navigation-header__header-logo .govuk-visually-hidden) {
|
|
690
690
|
border: 0;
|
|
@@ -698,6 +698,10 @@ $search-icon-height: 20px;
|
|
|
698
698
|
.govuk-width-container {
|
|
699
699
|
margin: 0;
|
|
700
700
|
}
|
|
701
|
+
|
|
702
|
+
.gem-c-layout-super-navigation-header__container {
|
|
703
|
+
background: transparent;
|
|
704
|
+
}
|
|
701
705
|
}
|
|
702
706
|
|
|
703
707
|
.gem-c-layout-super-navigation-header__header-logo {
|
|
@@ -283,26 +283,6 @@
|
|
|
283
283
|
text-align: left;
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
-
.mc-toggle-button {
|
|
287
|
-
border: 1px solid $govuk-border-colour;
|
|
288
|
-
color: $govuk-link-colour;
|
|
289
|
-
cursor: pointer;
|
|
290
|
-
margin: govuk-spacing(0);
|
|
291
|
-
padding: govuk-spacing(2);
|
|
292
|
-
background-color: govuk-colour("white");
|
|
293
|
-
|
|
294
|
-
&:hover {
|
|
295
|
-
background-color: govuk-colour("light-grey");
|
|
296
|
-
color: $govuk-link-hover-colour;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
&:focus {
|
|
300
|
-
background-color: $govuk-focus-colour;
|
|
301
|
-
border-color: transparent;
|
|
302
|
-
@include govuk-focused-text;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
|
|
306
286
|
// Hides the original table
|
|
307
287
|
.mc-hidden,
|
|
308
288
|
.mc-hidden caption {
|
|
@@ -8,11 +8,11 @@ module GovukPublishingComponents
|
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
type: "publishing",
|
|
11
|
-
apps: %w[content-data-admin collections-publisher travel-advice-publisher whitehall datagovuk_find local-links-manager places-manager support manuals-publisher service-manual-publisher short-url-manager specialist-publisher content-tagger publisher transition search-admin].sort,
|
|
11
|
+
apps: %w[content-data-admin collections-publisher travel-advice-publisher whitehall datagovuk_find local-links-manager places-manager support manuals-publisher service-manual-publisher short-url-manager specialist-publisher content-tagger publisher transition search-admin fact-check-manager content-block-manager].sort,
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
type: "utility",
|
|
15
|
-
apps: %w[account-api signon govspeak govspeak-preview release govuk-developer-docs govuk-chat].sort,
|
|
15
|
+
apps: %w[account-api signon govspeak govspeak-preview release govuk-developer-docs govuk-chat govuk_web_banners].sort,
|
|
16
16
|
},
|
|
17
17
|
]
|
|
18
18
|
|
|
@@ -41,6 +41,9 @@ module GovukPublishingComponents
|
|
|
41
41
|
gem_version_status: app.gem_version == GovukPublishingComponents::VERSION ? "green" : "red",
|
|
42
42
|
sass_version: app.sass_version,
|
|
43
43
|
ruby_version: app.ruby_version,
|
|
44
|
+
ruby_version_status: app.ruby_status(app.ruby_version),
|
|
45
|
+
yarn_version: app.yarn_version,
|
|
46
|
+
yarn_version_status: app.yarn_version.to_f >= 4 ? "green" : "red",
|
|
44
47
|
}
|
|
45
48
|
end
|
|
46
49
|
end
|
|
@@ -5,11 +5,12 @@ module GovukPublishingComponents
|
|
|
5
5
|
account-api
|
|
6
6
|
collections
|
|
7
7
|
collections-publisher
|
|
8
|
+
content-block-manager
|
|
8
9
|
content-data-admin
|
|
9
|
-
content-publisher
|
|
10
10
|
content-tagger
|
|
11
11
|
datagovuk_find
|
|
12
12
|
email-alert-frontend
|
|
13
|
+
fact-check-manager
|
|
13
14
|
feedback
|
|
14
15
|
finder-frontend
|
|
15
16
|
frontend
|
|
@@ -18,13 +19,13 @@ module GovukPublishingComponents
|
|
|
18
19
|
govspeak-preview
|
|
19
20
|
govuk-chat
|
|
20
21
|
govuk-developer-docs
|
|
22
|
+
govuk_web_banners
|
|
21
23
|
local-links-manager
|
|
22
24
|
manuals-publisher
|
|
23
25
|
places-manager
|
|
24
26
|
publisher
|
|
25
27
|
release
|
|
26
28
|
search-admin
|
|
27
|
-
search-v2-evaluator
|
|
28
29
|
service-manual-publisher
|
|
29
30
|
short-url-manager
|
|
30
31
|
signon
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
module GovukPublishingComponents
|
|
2
2
|
class ApplicationsPage
|
|
3
|
-
attr_reader :source
|
|
3
|
+
attr_reader :source, :ruby_version
|
|
4
4
|
|
|
5
5
|
def initialize(application)
|
|
6
6
|
@application = application
|
|
7
7
|
@dir = get_directory
|
|
8
8
|
@gemfilelock = get_file("Gemfile.lock")
|
|
9
|
-
|
|
9
|
+
rubyfile = get_file(".ruby-version")
|
|
10
|
+
@ruby_version = rubyfile.strip if rubyfile
|
|
11
|
+
@packagejson = get_file("package.json")
|
|
10
12
|
end
|
|
11
13
|
|
|
12
14
|
def readable_name
|
|
@@ -21,8 +23,41 @@ module GovukPublishingComponents
|
|
|
21
23
|
parse_file(@gemfilelock, /sass-embedded \(([^)>=~ ]+)\)/)
|
|
22
24
|
end
|
|
23
25
|
|
|
24
|
-
def
|
|
25
|
-
|
|
26
|
+
def ruby_status(version)
|
|
27
|
+
version = version.to_f # to_f ignores non-numbers on the string end, so 3.3.1 becomes 3.1
|
|
28
|
+
versions = [
|
|
29
|
+
{
|
|
30
|
+
version: 3.3,
|
|
31
|
+
eol: "2027-03-31",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
version: 3.2,
|
|
35
|
+
eol: "2026-03-31",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
version: 3.1,
|
|
39
|
+
eol: "2024-04-23",
|
|
40
|
+
},
|
|
41
|
+
]
|
|
42
|
+
today = Date.today # rubocop:disable Rails/Date
|
|
43
|
+
result = "not set"
|
|
44
|
+
|
|
45
|
+
versions.each do |v|
|
|
46
|
+
next unless version >= v[:version]
|
|
47
|
+
|
|
48
|
+
version_eol = Date.parse(v[:eol])
|
|
49
|
+
age = version_eol - today
|
|
50
|
+
result = "green"
|
|
51
|
+
result = "orange" if age < 100
|
|
52
|
+
result = "red" if age.negative?
|
|
53
|
+
break
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
result
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def yarn_version
|
|
60
|
+
parse_file(@packagejson, /"packageManager"\s*:\s*"yarn@(\d+(?:\.\d+)*)"/)
|
|
26
61
|
end
|
|
27
62
|
|
|
28
63
|
private
|
|
@@ -32,6 +32,15 @@
|
|
|
32
32
|
<% if app[:ruby_version] %>
|
|
33
33
|
<%= render "govuk_publishing_components/components/tag", {
|
|
34
34
|
text: app[:ruby_version],
|
|
35
|
+
colour: app[:ruby_version_status],
|
|
36
|
+
} %>
|
|
37
|
+
<% end %>
|
|
38
|
+
</td>
|
|
39
|
+
<td class="govuk-table__cell">
|
|
40
|
+
<% if app[:yarn_version] %>
|
|
41
|
+
<%= render "govuk_publishing_components/components/tag", {
|
|
42
|
+
text: app[:yarn_version],
|
|
43
|
+
colour: app[:yarn_version_status],
|
|
35
44
|
} %>
|
|
36
45
|
<% end %>
|
|
37
46
|
</td>
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
<th scope="col" class="govuk-table__header sticky-table-header">Gem version</th>
|
|
26
26
|
<th scope="col" class="govuk-table__header sticky-table-header">Sass version</th>
|
|
27
27
|
<th scope="col" class="govuk-table__header sticky-table-header">Ruby version</th>
|
|
28
|
+
<th scope="col" class="govuk-table__header sticky-table-header">Yarn version</th>
|
|
28
29
|
</tr>
|
|
29
30
|
</thead>
|
|
30
31
|
<tbody class="govuk-table__body">
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<% if navigation_items.present? %>
|
|
32
32
|
<nav aria-label="<%= navigation_aria_label %>" class="govuk-service-navigation__wrapper">
|
|
33
33
|
<% if collapse_navigation_on_mobile %>
|
|
34
|
-
<button type="button" class="govuk-service-navigation__toggle govuk-js-service-navigation-toggle" aria-controls="navigation" hidden>
|
|
34
|
+
<button type="button" class="govuk-service-navigation__toggle govuk-js-service-navigation-toggle" aria-controls="navigation" hidden aria-hidden="true">
|
|
35
35
|
Menu
|
|
36
36
|
</button>
|
|
37
37
|
<% end %>
|
|
@@ -4,8 +4,7 @@ body: |
|
|
|
4
4
|
This component shows a link to a document that is attached to GOV.UK content
|
|
5
5
|
along with a thumbnail and relevant file data.
|
|
6
6
|
|
|
7
|
-
It is intended to be rendered in Govspeak
|
|
8
|
-
Content Publisher.
|
|
7
|
+
It is intended to be rendered in Govspeak.
|
|
9
8
|
|
|
10
9
|
It is not as rich in features as the [attachment rendering][Whitehall]
|
|
11
10
|
provided by Whitehall, it lacks support for multiple languages, CSV previews
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
name: Details
|
|
2
2
|
description: Make a page easier to scan by letting users reveal more detailed information only if they need it
|
|
3
|
+
uses_component_wrapper_helper: true
|
|
3
4
|
shared_accessibility_criteria:
|
|
4
5
|
- link
|
|
5
6
|
accessibility_criteria: |
|
|
@@ -38,14 +39,6 @@ examples:
|
|
|
38
39
|
<p class="govuk-body">Attorney General's office</p>
|
|
39
40
|
<%= component %>
|
|
40
41
|
</div>
|
|
41
|
-
with_GTM_tracking:
|
|
42
|
-
description: Applies a tracking attribute specifically for use by Google Tag Manager in [Content Publisher](https://github.com/alphagov/content-publisher).
|
|
43
|
-
data:
|
|
44
|
-
title: Help with nationality
|
|
45
|
-
data_attributes:
|
|
46
|
-
tracking: GTM-123AB
|
|
47
|
-
block: |
|
|
48
|
-
We need to know your nationality so we can work out which elections you’re entitled to vote in. If you can’t provide your nationality, you’ll have to send copies of identity documents through the post.
|
|
49
42
|
with_ga4_tracking:
|
|
50
43
|
description: |
|
|
51
44
|
GA4 tracking is mostly handled internally by the component, apart from the required attribute `index_section_count`. This records the number of details components on the page and must be passed by the hosting application. Other GA4 attributes can also be passed if required, including to override attributes set by the component (for some reason this doesn't work in the component guide but works in applications).
|
|
@@ -24,14 +24,12 @@ examples:
|
|
|
24
24
|
Nullam sed neque quis turpis.
|
|
25
25
|
with_data_attributes:
|
|
26
26
|
description: |
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
Other data attributes can also be applied as required. Note that the component does not include built in tracking. If this is required consider using the [GA4 link tracker](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/trackers/ga4-link-tracker.md).
|
|
27
|
+
Note that the component does not include built in tracking. If this is required consider using the [GA4 link tracker](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/trackers/ga4-link-tracker.md).
|
|
30
28
|
data:
|
|
31
29
|
message: Message to alert the user to a unsuccessful action goes here
|
|
32
30
|
description: A further description
|
|
33
31
|
data_attributes:
|
|
34
|
-
|
|
32
|
+
hello: world
|
|
35
33
|
with_specified_id_attribute:
|
|
36
34
|
data:
|
|
37
35
|
id: test-id
|
|
@@ -317,7 +317,7 @@ examples:
|
|
|
317
317
|
</section>
|
|
318
318
|
<section class="attachment embedded" id="attachment_1399344">
|
|
319
319
|
<div class="attachment-thumb">
|
|
320
|
-
<a aria-hidden="true" class="thumbnail" href="https://www.gov.uk/government/world-location-news/294043.es-419"><img alt="" src="
|
|
320
|
+
<a aria-hidden="true" class="thumbnail" href="https://www.gov.uk/government/world-location-news/294043.es-419"><img alt="" src="#"></a>
|
|
321
321
|
</div>
|
|
322
322
|
<div class="attachment-details">
|
|
323
323
|
<h2 class="title"><a href="https://www.gov.uk/government/world-location-news/294043.es-419">Document attachment</a></h2>
|
|
@@ -345,7 +345,7 @@ examples:
|
|
|
345
345
|
</section>
|
|
346
346
|
<section class="attachment embedded" id="attachment_1399348">
|
|
347
347
|
<div class="attachment-thumb">
|
|
348
|
-
<img alt="" src="
|
|
348
|
+
<img alt="" src="#">
|
|
349
349
|
</div>
|
|
350
350
|
<div class="attachment-details">
|
|
351
351
|
<h2 class="title">Previewable online example</h2>
|
|
@@ -366,7 +366,7 @@ examples:
|
|
|
366
366
|
</section>
|
|
367
367
|
<section class="attachment embedded" id="attachment_1243761">
|
|
368
368
|
<div class="attachment-thumb">
|
|
369
|
-
<a aria-hidden="true" class="thumbnail" href="https://www.gov.uk/government/statistical-data-sets/env24-fly-tipping-incidents-and-actions-taken-in-england"><img alt="" src="
|
|
369
|
+
<a aria-hidden="true" class="thumbnail" href="https://www.gov.uk/government/statistical-data-sets/env24-fly-tipping-incidents-and-actions-taken-in-england"><img alt="" src="#"></a>
|
|
370
370
|
</div>
|
|
371
371
|
<div class="attachment-details">
|
|
372
372
|
<h2 class="title"><a aria-describedby="attachment-1243761-accessibility-help" href="https://www.gov.uk/government/statistical-data-sets/env24-fly-tipping-incidents-and-actions-taken-in-england">Fly-tipping incidents and actions reported by local authorities in 2014 to 2015</a></h2>
|
|
@@ -391,7 +391,7 @@ examples:
|
|
|
391
391
|
</section>
|
|
392
392
|
<section class="attachment embedded" id="attachment_1112527">
|
|
393
393
|
<div class="attachment-thumb">
|
|
394
|
-
<a aria-hidden="true" class="thumbnail" href="https://www.gov.uk/government/publications/summer-budget-2015/summer-budget-2015"><img alt="" src="
|
|
394
|
+
<a aria-hidden="true" class="thumbnail" href="https://www.gov.uk/government/publications/summer-budget-2015/summer-budget-2015"><img alt="" src="#"></a>
|
|
395
395
|
</div>
|
|
396
396
|
<div class="attachment-details">
|
|
397
397
|
<h2 class="title"><a href="https://www.gov.uk/government/publications/summer-budget-2015/summer-budget-2015">Summer Budget 2015</a></h2>
|
|
@@ -402,7 +402,7 @@ examples:
|
|
|
402
402
|
</section>
|
|
403
403
|
<section class="attachment hosted-externally" id="attachment_1425055">
|
|
404
404
|
<div class="attachment-thumb">
|
|
405
|
-
<a aria-hidden="true" class="thumbnail" href="http://example.com"><img alt="" src="
|
|
405
|
+
<a aria-hidden="true" class="thumbnail" href="http://example.com"><img alt="" src="#"></a>
|
|
406
406
|
</div>
|
|
407
407
|
<div class="attachment-details">
|
|
408
408
|
<h2 class="title"><a rel="external" href="https://www.arcgis.com/apps/opsdashboard/index.html#/f94c3c90da5b4e9f9a0b19484dd4bb14">Track coronavirus cases</a></h2>
|
|
@@ -413,7 +413,7 @@ examples:
|
|
|
413
413
|
</section>
|
|
414
414
|
<section class="attachment hosted-externally" id="attachment_1425056">
|
|
415
415
|
<div class="attachment-thumb">
|
|
416
|
-
<a aria-hidden="true" class="thumbnail" href="http://example.com"><img alt="" src="
|
|
416
|
+
<a aria-hidden="true" class="thumbnail" href="http://example.com"><img alt="" src="#"></a>
|
|
417
417
|
</div>
|
|
418
418
|
<div class="attachment-details">
|
|
419
419
|
<h2 class="title"><a rel="external" href="http://example.com">An external link (with all possible metadata)</a></h2>
|
|
@@ -431,7 +431,7 @@ examples:
|
|
|
431
431
|
</section>
|
|
432
432
|
<section class="attachment embedded" id="attachment_1398523">
|
|
433
433
|
<div class="attachment-thumb">
|
|
434
|
-
<a aria-hidden="true" class="thumbnail" href="https://www.gov.uk/government/consultations/environmental-permitting-updating-the-standards-for-petrol-vapour-recovery-at-service-stations"><img alt="" src="
|
|
434
|
+
<a aria-hidden="true" class="thumbnail" href="https://www.gov.uk/government/consultations/environmental-permitting-updating-the-standards-for-petrol-vapour-recovery-at-service-stations"><img alt="" src="#"></a>
|
|
435
435
|
</div>
|
|
436
436
|
<div class="attachment-details">
|
|
437
437
|
<h2 class="title"><a href="https://www.gov.uk/government/consultations/environmental-permitting-updating-the-standards-for-petrol-vapour-recovery-at-service-stations">Consultation outcome with published date</a></h2>
|
|
@@ -10,7 +10,7 @@ body: |
|
|
|
10
10
|
|
|
11
11
|
Modal components must be a direct descendant of the `<body>` element; we recommend placing it toward the end of the document for performance considerations.
|
|
12
12
|
|
|
13
|
-
This component is currently experimental. If you are using it, please feed back any research findings to
|
|
13
|
+
This component is currently experimental. If you are using it, please feed back any research findings to #govuk-ruby-frontenders on Slack.
|
|
14
14
|
accessibility_criteria: |
|
|
15
15
|
The modal dialogue box must:
|
|
16
16
|
|
|
@@ -90,7 +90,7 @@ examples:
|
|
|
90
90
|
description: |
|
|
91
91
|
This option allows links to be added to the table headers for sorting. Sorting must be handled server side, it is not done by the component.
|
|
92
92
|
|
|
93
|
-
The example shown applies a
|
|
93
|
+
The example shown applies a data attribute too.
|
|
94
94
|
|
|
95
95
|
Other data attributes can also be applied as required. Note that the component does not include built in tracking. If this is required consider using the [GA4 link tracker](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/trackers/ga4-link-tracker.md).
|
|
96
96
|
data:
|
|
@@ -102,7 +102,7 @@ examples:
|
|
|
102
102
|
sort_direction: descending
|
|
103
103
|
href: /?sort_direction=desc
|
|
104
104
|
data_attributes:
|
|
105
|
-
|
|
105
|
+
hello: world
|
|
106
106
|
- text: Rate for vehicles
|
|
107
107
|
format: numeric
|
|
108
108
|
href: /?sort_direction=desc
|
|
@@ -75,24 +75,20 @@ examples:
|
|
|
75
75
|
content: |
|
|
76
76
|
<p class="govuk-body-m">Here is a single piece of content, there should be no tabs.</p>
|
|
77
77
|
with_data_attributes:
|
|
78
|
-
description: |
|
|
79
|
-
The example shown applies a tracking attribute specifically for use by Google Tag Manager in [Content Publisher](https://github.com/alphagov/content-publisher).
|
|
80
|
-
|
|
81
|
-
Other data attributes can also be applied as required. Note that the component does not include built in tracking. If this is required consider using the [GA4 link tracker](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/trackers/ga4-link-tracker.md).
|
|
82
78
|
data:
|
|
83
79
|
tabs:
|
|
84
80
|
- id: "tab-with-data-attributes-1"
|
|
85
81
|
label: "First section"
|
|
86
82
|
title: "First section"
|
|
87
83
|
tab_data_attributes:
|
|
88
|
-
|
|
84
|
+
hello: world
|
|
89
85
|
content: |
|
|
90
86
|
<p class="govuk-body-m">Fusce at dictum tellus, ac accumsan est. Nulla vitae turpis in nulla gravida tincidunt. Duis lectus felis, tempus id bibendum sit amet, posuere ut elit. Donec enim odio, eleifend in urna a, sagittis egestas est. Proin id ex ultricies, porta eros id, vehicula quam. Morbi non sagittis velit.</p>
|
|
91
87
|
- id: "tab-with-data-attributes-2"
|
|
92
88
|
label: "Second section"
|
|
93
89
|
title: "Second section"
|
|
94
90
|
tab_data_attributes:
|
|
95
|
-
|
|
91
|
+
hello: world
|
|
96
92
|
content: |
|
|
97
93
|
<p class="govuk-body-m">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam congue elementum commodo. Vestibulum elit turpis, efficitur quis posuere vitae, commodo vitae augue. Donec ut pharetra ligula. Phasellus ac mauris eu felis bibendum dapibus rutrum sed quam. Pellentesque posuere ante id consequat pretium.</p>
|
|
98
94
|
without_ga4_tracking_on_tabs:
|
|
@@ -26,10 +26,9 @@ module GovukPublishingComponents
|
|
|
26
26
|
output = clean_string(link_text)
|
|
27
27
|
# Must start with a number
|
|
28
28
|
# Number must be between 1 and 999 (ie not 2014)
|
|
29
|
-
# Must
|
|
30
|
-
# May contain a period `1.`
|
|
29
|
+
# Must contain at least one period
|
|
31
30
|
# May be a decimal `1.2`
|
|
32
|
-
number = /^\d{1,3}(
|
|
31
|
+
number = /^\d{1,3}\.(\d{1,2})?(?=\s)/.match(output)
|
|
33
32
|
|
|
34
33
|
if number
|
|
35
34
|
words = output.sub(number.to_s, "").strip # remove the number from the text
|
|
@@ -43,7 +43,7 @@ module GovukPublishingComponents
|
|
|
43
43
|
def pages_link_helper
|
|
44
44
|
return unless has_pages?
|
|
45
45
|
|
|
46
|
-
page_links = @items.each_with_index.map do |item, index|
|
|
46
|
+
page_links = @items.reject(&:blank?).each_with_index.map do |item, index|
|
|
47
47
|
{ href: nil, ellipsis: nil, current: nil, number: nil, visually_hidden_text: nil, **item.symbolize_keys } => { href:, ellipsis:, current:, number:, visually_hidden_text: }
|
|
48
48
|
|
|
49
49
|
raise ArgumentError, "Number or ellipsis value required for item #{index}" if ellipsis.blank? && number.blank?
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.GOVUKFrontend = global.GOVUKFrontend || {}));
|
|
5
5
|
})(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
|
-
const version = '5.
|
|
7
|
+
const version = '5.14.0';
|
|
8
8
|
|
|
9
9
|
function getBreakpoint(name) {
|
|
10
10
|
const property = `--govuk-breakpoint-${name}`;
|
|
@@ -2255,9 +2255,9 @@
|
|
|
2255
2255
|
}
|
|
2256
2256
|
if (this.mql.matches) {
|
|
2257
2257
|
this.$menu.removeAttribute('hidden');
|
|
2258
|
-
this.$menuButton
|
|
2258
|
+
setAttributes(this.$menuButton, attributesForHidingButton);
|
|
2259
2259
|
} else {
|
|
2260
|
-
this.$menuButton.
|
|
2260
|
+
removeAttributes(this.$menuButton, Object.keys(attributesForHidingButton));
|
|
2261
2261
|
this.$menuButton.setAttribute('aria-expanded', this.menuIsOpen.toString());
|
|
2262
2262
|
if (this.menuIsOpen) {
|
|
2263
2263
|
this.$menu.removeAttribute('hidden');
|
|
@@ -2272,6 +2272,34 @@
|
|
|
2272
2272
|
}
|
|
2273
2273
|
}
|
|
2274
2274
|
ServiceNavigation.moduleName = 'govuk-service-navigation';
|
|
2275
|
+
const attributesForHidingButton = {
|
|
2276
|
+
hidden: '',
|
|
2277
|
+
'aria-hidden': 'true'
|
|
2278
|
+
};
|
|
2279
|
+
|
|
2280
|
+
/**
|
|
2281
|
+
* Sets a group of attributes on the given element
|
|
2282
|
+
*
|
|
2283
|
+
* @param {Element} $element - The element to set the attribute on
|
|
2284
|
+
* @param {{[attributeName: string]: string}} attributes - The attributes to set
|
|
2285
|
+
*/
|
|
2286
|
+
function setAttributes($element, attributes) {
|
|
2287
|
+
for (const attributeName in attributes) {
|
|
2288
|
+
$element.setAttribute(attributeName, attributes[attributeName]);
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
|
|
2292
|
+
/**
|
|
2293
|
+
* Removes a list of attributes from the given element
|
|
2294
|
+
*
|
|
2295
|
+
* @param {Element} $element - The element to remove the attributes from
|
|
2296
|
+
* @param {string[]} attributeNames - The names of the attributes to remove
|
|
2297
|
+
*/
|
|
2298
|
+
function removeAttributes($element, attributeNames) {
|
|
2299
|
+
for (const attributeName of attributeNames) {
|
|
2300
|
+
$element.removeAttribute(attributeName);
|
|
2301
|
+
}
|
|
2302
|
+
}
|
|
2275
2303
|
|
|
2276
2304
|
/**
|
|
2277
2305
|
* Skip link component
|