govuk_publishing_components 64.1.1 → 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/components/modal-dialogue.js +0 -2
- data/app/assets/javascripts/govuk_publishing_components/components/select-with-search.js +33 -0
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +3 -3
- data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +16 -13
- data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +4 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +5 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_modal-dialogue.scss +1 -13
- 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/_checkboxes.html.erb +8 -8
- 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/heading.yml +1 -1
- 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 +5 -2
|
@@ -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
|