govuk_publishing_components 51.1.1 → 51.2.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/components/feedback.js +29 -34
- data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +7 -2
- data/app/assets/stylesheets/component_guide/application.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +2 -2
- data/app/models/govuk_publishing_components/audit_comparer.rb +3 -3
- data/app/views/govuk_publishing_components/components/_title.html.erb +2 -3
- data/app/views/govuk_publishing_components/components/docs/add_another.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/feedback.yml +1 -1
- data/lib/govuk_publishing_components/presenters/checkboxes_helper.rb +1 -1
- data/lib/govuk_publishing_components/presenters/shared_helper.rb +0 -11
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +217 -184
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +216 -184
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.mjs +1 -0
- data/node_modules/govuk-frontend/dist/govuk/all.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/all.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs +164 -0
- data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/index.mjs +1 -87
- data/node_modules/govuk-frontend/dist/govuk/common/index.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +149 -112
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +148 -111
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs +5 -8
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js +149 -112
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs +148 -111
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs +5 -8
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +174 -140
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +173 -139
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +17 -16
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/macro-options.json +4 -4
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js +1 -24
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs +0 -23
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/macro-options.json +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js +149 -112
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs +148 -111
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs +6 -8
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +149 -112
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +148 -111
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs +5 -8
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +1 -24
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +0 -23
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/input/macro-options.json +4 -4
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js +149 -112
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs +148 -111
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs +6 -8
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/macro-options.json +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +149 -112
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +148 -111
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs +5 -8
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js +1 -24
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs +0 -23
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +1 -24
- 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 +0 -23
- 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/skip-link/skip-link.bundle.js +1 -24
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs +0 -23
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js +1 -24
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs +0 -23
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/macro-options.json +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 +1 -1
- 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/init.mjs +17 -13
- data/node_modules/govuk-frontend/dist/govuk/init.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss +5 -10
- data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss.map +1 -1
- data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +1 -1
- data/node_modules/govuk-frontend/package.json +9 -9
- metadata +4 -6
- data/node_modules/govuk-frontend/dist/govuk/common/normalise-dataset.mjs +0 -18
- data/node_modules/govuk-frontend/dist/govuk/common/normalise-dataset.mjs.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/common/normalise-string.mjs +0 -31
- data/node_modules/govuk-frontend/dist/govuk/common/normalise-string.mjs.map +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c50d14be7610561ed91341a0824caa29b9c767d839acb2c6f7c65b5f58514ac4
|
4
|
+
data.tar.gz: d8bd8854736387adecda29ca77c0f31af6b7e5f0d8123c30c4b9fa5223e2530e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a3fd0fbac03888e39e3aecd3adcc1c69dd9c1f3b179f8eeb853c14cb3edbea20df8593a00126fc3d23fa3b550af45746f6b42679a145287abf31b92e20886a1
|
7
|
+
data.tar.gz: e26f92b617d944bee8ffaee93c200eef6bf1b8596c946092e5646f4862d9043a7c4ba26e9d784ce4f0445cda143ef57f27003c94275b2c2423e8117a743553de
|
@@ -69,40 +69,35 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
69
69
|
}.bind(this), 1000)
|
70
70
|
}.bind(this))
|
71
71
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
this.disableSubmitFormButton($form)
|
103
|
-
xhr.send(params)
|
104
|
-
}.bind(this))
|
105
|
-
}
|
72
|
+
for (var f = 0; f < this.forms.length; f++) {
|
73
|
+
this.forms[f].addEventListener('submit', function (e) {
|
74
|
+
e.preventDefault()
|
75
|
+
var $form = e.target
|
76
|
+
var xhr = new XMLHttpRequest()
|
77
|
+
var url = $form.getAttribute('action')
|
78
|
+
var params = new FormData($form)
|
79
|
+
params = new URLSearchParams(params).toString()
|
80
|
+
|
81
|
+
this.done = function () {
|
82
|
+
if (xhr.status === 200) {
|
83
|
+
this.showFormSuccess(xhr.message)
|
84
|
+
this.revealInitialPrompt()
|
85
|
+
this.setInitialAriaAttributes()
|
86
|
+
this.activeForm.hidden = true
|
87
|
+
clearInterval(this.timerInterval)
|
88
|
+
} else {
|
89
|
+
this.showError(xhr)
|
90
|
+
this.enableSubmitFormButton($form)
|
91
|
+
}
|
92
|
+
}.bind(this)
|
93
|
+
|
94
|
+
xhr.addEventListener('loadend', this.done)
|
95
|
+
xhr.open('POST', url, true)
|
96
|
+
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded')
|
97
|
+
|
98
|
+
this.disableSubmitFormButton($form)
|
99
|
+
xhr.send(params)
|
100
|
+
}.bind(this))
|
106
101
|
}
|
107
102
|
}
|
108
103
|
|
@@ -336,7 +336,7 @@
|
|
336
336
|
return str;
|
337
337
|
}
|
338
338
|
|
339
|
-
var VERSION = "4.0.
|
339
|
+
var VERSION = "4.0.30";
|
340
340
|
/**
|
341
341
|
* Returns the version of the script as a float to be stored in legacy systems that do not support
|
342
342
|
* string versions.
|
@@ -622,6 +622,10 @@
|
|
622
622
|
}
|
623
623
|
var MAX_SELECTOR_LENGTH = 100;
|
624
624
|
function getNodeSelector(node, selector) {
|
625
|
+
if (selector === void 0) { selector = ""; }
|
626
|
+
return _getNodeSelector(node, selector).slice(0, MAX_SELECTOR_LENGTH);
|
627
|
+
}
|
628
|
+
function _getNodeSelector(node, selector) {
|
625
629
|
if (selector === void 0) { selector = ""; }
|
626
630
|
try {
|
627
631
|
if (selector &&
|
@@ -668,6 +672,7 @@
|
|
668
672
|
var sessionAttributions = [];
|
669
673
|
var largestEntry;
|
670
674
|
var maximumSessionValue = 0;
|
675
|
+
var MAX_CLS_SOURCES = 50;
|
671
676
|
function processEntry$2(entry) {
|
672
677
|
if (!entry.hadRecentInput) {
|
673
678
|
var firstEntry = sessionEntries[0];
|
@@ -717,7 +722,7 @@
|
|
717
722
|
startTime: processTimeMetric(largestEntry.startTime),
|
718
723
|
}
|
719
724
|
: null,
|
720
|
-
sources: sessionAttributions.length ? sessionAttributions : null,
|
725
|
+
sources: sessionAttributions.length ? sessionAttributions.slice(0, MAX_CLS_SOURCES) : null,
|
721
726
|
};
|
722
727
|
}
|
723
728
|
|
@@ -116,7 +116,7 @@ $gem-guide-border-width: 1px;
|
|
116
116
|
}
|
117
117
|
|
118
118
|
.component-guide-preview {
|
119
|
-
padding:
|
119
|
+
padding: $govuk-gutter;
|
120
120
|
border: $gem-guide-border-width solid $govuk-border-colour;
|
121
121
|
position: relative;
|
122
122
|
|
@@ -38,6 +38,7 @@
|
|
38
38
|
@import "components/fieldset";
|
39
39
|
@import "components/file-upload";
|
40
40
|
@import "components/glance-metric";
|
41
|
+
@import "components/global-banner";
|
41
42
|
@import "components/govspeak-html-publication";
|
42
43
|
@import "components/govspeak";
|
43
44
|
@import "components/heading";
|
data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss
CHANGED
@@ -31,12 +31,11 @@
|
|
31
31
|
|
32
32
|
h2 {
|
33
33
|
margin-top: $govuk-gutter;
|
34
|
-
margin-bottom:
|
34
|
+
margin-bottom: govuk-spacing(4);
|
35
35
|
@include govuk-font($size: 27, $weight: bold);
|
36
36
|
|
37
37
|
@include govuk-media-query($from: desktop) {
|
38
38
|
margin-top: $govuk-gutter * 1.5;
|
39
|
-
margin-bottom: 0;
|
40
39
|
}
|
41
40
|
}
|
42
41
|
|
@@ -77,6 +76,7 @@
|
|
77
76
|
a {
|
78
77
|
@include govuk-link-common;
|
79
78
|
@include govuk-link-style-default;
|
79
|
+
@include govuk-text-break-word;
|
80
80
|
|
81
81
|
&:focus {
|
82
82
|
@include govuk-focused-text;
|
@@ -182,7 +182,7 @@ module GovukPublishingComponents
|
|
182
182
|
warnings = []
|
183
183
|
|
184
184
|
locations.each do |location|
|
185
|
-
next if
|
185
|
+
next if %w[template ruby].include?(location[:location])
|
186
186
|
|
187
187
|
location[:components].each do |component|
|
188
188
|
raise_warning = asset_already_in_static(location[:location], component)
|
@@ -196,14 +196,14 @@ module GovukPublishingComponents
|
|
196
196
|
def warn_about_missing_assets(components)
|
197
197
|
warnings = []
|
198
198
|
|
199
|
-
code = components.select { |c|
|
199
|
+
code = components.select { |c| %w[template ruby].include?(c[:location]) }
|
200
200
|
code = [
|
201
201
|
{
|
202
202
|
location: "code",
|
203
203
|
components: code.map { |c| c[:components] }.flatten.uniq.sort,
|
204
204
|
},
|
205
205
|
]
|
206
|
-
assets = components.select { |c|
|
206
|
+
assets = components.select { |c| %w[stylesheet javascript].include?(c[:location]) }
|
207
207
|
|
208
208
|
warnings << find_missing_items(code, assets)
|
209
209
|
warnings << find_missing_items(assets, code)
|
@@ -9,12 +9,11 @@
|
|
9
9
|
|
10
10
|
inverse ||= false
|
11
11
|
local_assigns[:margin_bottom] ||= 8
|
12
|
-
|
13
|
-
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
12
|
+
margin_bottom = [*0..9].include?(local_assigns[:margin_bottom]) ? "govuk-!-margin-bottom-#{local_assigns[:margin_bottom]}" : "govuk-!-margin-bottom-3"
|
14
13
|
|
15
14
|
classes = %w[gem-c-title]
|
16
15
|
classes << "gem-c-title--inverse" if inverse
|
17
|
-
classes <<
|
16
|
+
classes << margin_bottom
|
18
17
|
|
19
18
|
heading_classes = %w[gem-c-title__text]
|
20
19
|
heading_classes << (average_title_length.present? ? 'govuk-heading-l' : 'govuk-heading-xl')
|
@@ -35,7 +35,7 @@ examples:
|
|
35
35
|
<input class="gem-c-input govuk-input" id="person_0_name" name="person[0]name">
|
36
36
|
</div>
|
37
37
|
destroy_checkbox: >
|
38
|
-
<div class="govuk-checkboxes" data-module="govuk-checkboxes"
|
38
|
+
<div class="govuk-checkboxes" data-module="govuk-checkboxes">
|
39
39
|
<div class="govuk-checkboxes__item">
|
40
40
|
<input type="checkbox" name="person[0][_destroy]" id="person_0__destroy" class="govuk-checkboxes__input">
|
41
41
|
<label for="person_0__destroy" class="govuk-label govuk-checkboxes__label">Delete</label>
|
@@ -3,7 +3,7 @@ description: Invites user feedback on the current page.
|
|
3
3
|
body: |
|
4
4
|
This component is designed to sit at the bottom of pages on GOV.UK to allow users to submit feedback on that page.
|
5
5
|
|
6
|
-
This component uses JavaScript for expanding and collapsing and also for submitting form responses.
|
6
|
+
This component uses JavaScript for expanding and collapsing and also for submitting form responses. Users without JavaScript will fall back to a normal form submission.
|
7
7
|
uses_component_wrapper_helper: true
|
8
8
|
accessibility_criteria: |
|
9
9
|
The form must:
|
@@ -34,7 +34,7 @@ module GovukPublishingComponents
|
|
34
34
|
@is_page_heading = options[:is_page_heading]
|
35
35
|
@description = options[:description] || nil
|
36
36
|
@no_hint_text = options[:no_hint_text]
|
37
|
-
@hint_text = options[:hint_text] || "Select all that apply
|
37
|
+
@hint_text = options[:hint_text] || "Select all that apply" unless @no_hint_text
|
38
38
|
@visually_hide_heading = options[:visually_hide_heading]
|
39
39
|
end
|
40
40
|
|
@@ -7,17 +7,6 @@ module GovukPublishingComponents
|
|
7
7
|
@options = local_assigns
|
8
8
|
@margin_bottom = @options[:margin_bottom] || 3
|
9
9
|
@heading_level = @options[:heading_level] || 2
|
10
|
-
|
11
|
-
if local_assigns.include?(:classes)
|
12
|
-
@classes = local_assigns[:classes].split(" ")
|
13
|
-
unless @classes.all? { |c| c.start_with?("js-") }
|
14
|
-
raise(ArgumentError, "Passed classes must be prefixed with `js-`")
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def get_margin_bottom
|
20
|
-
[*0..9].include?(@margin_bottom) ? "govuk-!-margin-bottom-#{margin_bottom}" : "govuk-!-margin-bottom-3"
|
21
10
|
end
|
22
11
|
|
23
12
|
def get_heading_level
|