govuk_publishing_components 5.1.2 → 5.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +1 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +1 -1
- data/app/views/govuk_publishing_components/components/_feedback.html.erb +4 -2
- data/app/views/govuk_publishing_components/components/_input.html.erb +3 -0
- data/app/views/govuk_publishing_components/components/docs/feedback.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/input.yml +22 -6
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa48ba590fd58d68a1a54ffec60c38a87c705415c7cd6e2d60bd6847bea674b9
|
4
|
+
data.tar.gz: '069479f197d9edd22c46232606fb13e7c404fe8f9dabac8ca53e15bcaa24fe3b'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbda965032a7665f5e69c2a6c4df2a0fafe8021759a33971b6080f1151a577b3d33b36fd4cc6e0f45d6035bb75a925c18f250794ddd9357932f6ee1bc103bc15
|
7
|
+
data.tar.gz: 6bdca0f6c816436e9e279b2ac97aa4736476f64f131fac5810b67ace5823a5dad3da644b20f4d7023604e173386f7c48ee3cb62c3d63399ece43bf7399745d88
|
@@ -36,6 +36,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
36
36
|
e.preventDefault();
|
37
37
|
toggleForm($(e.target).attr('aria-controls'));
|
38
38
|
setInitialAriaAttributes();
|
39
|
+
revealInitialPrompt();
|
39
40
|
});
|
40
41
|
|
41
42
|
this.$pageIsUsefulButton.on('click', function(e) {
|
@@ -113,10 +114,6 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
113
114
|
}
|
114
115
|
}
|
115
116
|
|
116
|
-
function clearMessages () {
|
117
|
-
$element.find('.js-errors').html('').addClass(jshiddenClass);
|
118
|
-
}
|
119
|
-
|
120
117
|
function showError (error) {
|
121
118
|
var error = [
|
122
119
|
'<h2 class="gem-c-feedback__heading">',
|
@@ -133,10 +130,6 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
133
130
|
$errors.html(error).removeClass(jshiddenClass).focus();
|
134
131
|
}
|
135
132
|
|
136
|
-
function clearAllInputs () {
|
137
|
-
that.$fields.val('');
|
138
|
-
}
|
139
|
-
|
140
133
|
function showFormSuccess () {
|
141
134
|
that.$promptQuestions.addClass(jshiddenClass);
|
142
135
|
that.$promptSuccessMessage.removeClass(jshiddenClass).focus();
|
@@ -64,7 +64,8 @@
|
|
64
64
|
label: {
|
65
65
|
text: "What were you doing?"
|
66
66
|
},
|
67
|
-
name: "what_doing"
|
67
|
+
name: "what_doing",
|
68
|
+
describedby: "feedback_explanation"
|
68
69
|
} %>
|
69
70
|
|
70
71
|
<%= render "govuk_publishing_components/components/input", {
|
@@ -102,7 +103,8 @@
|
|
102
103
|
text: "Email address"
|
103
104
|
},
|
104
105
|
name: "email_survey_signup[email_address]",
|
105
|
-
type: "email"
|
106
|
+
type: "email",
|
107
|
+
describedby: "survey_explanation"
|
106
108
|
} %>
|
107
109
|
|
108
110
|
<%# TODO: use button component once available in gem %>
|
@@ -5,6 +5,7 @@
|
|
5
5
|
error_message ||= false
|
6
6
|
label ||= {}
|
7
7
|
type ||= "text"
|
8
|
+
describedby ||= false
|
8
9
|
%>
|
9
10
|
|
10
11
|
<%= render "govuk_publishing_components/components/label", {
|
@@ -24,6 +25,8 @@
|
|
24
25
|
|
25
26
|
<% if error_message %>
|
26
27
|
aria-describedby="<%= hint_id %>"
|
28
|
+
<% elsif describedby %>
|
29
|
+
aria-describedby="<%= describedby %>"
|
27
30
|
<% end %>
|
28
31
|
|
29
32
|
<% if value %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
name: Feedback
|
2
|
-
description: Invites user feedback on the current page
|
2
|
+
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. It is based on the 'improve this page' component from the Service manual, but changes have been made.
|
5
5
|
|
@@ -1,25 +1,41 @@
|
|
1
1
|
name: Form input
|
2
|
-
description: A
|
2
|
+
description: A form input field and an associated label.
|
3
3
|
body: |
|
4
4
|
[Forked from GOV.UK Frontend](https://govuk-frontend-review.herokuapp.com/components/input)
|
5
5
|
accessibility_criteria: |
|
6
|
-
|
6
|
+
Inputs in the component must:
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
* be keyboard
|
8
|
+
* accept focus
|
9
|
+
* be focusable with a keyboard
|
10
|
+
* be usable with a keyboard
|
11
|
+
* be usable with touch
|
12
|
+
* indicate when they have focus
|
13
|
+
* be recognisable as form input elements
|
14
|
+
* have correctly associated labels
|
15
|
+
* be of the appropriate type for their use, e.g. password inputs should be of type 'password'
|
11
16
|
examples:
|
12
17
|
default:
|
13
18
|
data:
|
14
19
|
label:
|
15
20
|
text: "What is your name?"
|
16
21
|
name: "name"
|
17
|
-
|
22
|
+
specific_input_type:
|
23
|
+
description: By default the input will be type="text". This parameter accepts an alternative, e.g. "search" or "email". No validation is done on this input.
|
18
24
|
data:
|
19
25
|
label:
|
20
26
|
text: "What is your email address?"
|
21
27
|
name: "address"
|
22
28
|
type: "email"
|
29
|
+
aria_described_by:
|
30
|
+
description: |
|
31
|
+
Allows the addition of an aria-describedby attribute. Note that this will be overridden in the event of an error, where the error will be used for the describedby attribute value.
|
32
|
+
|
33
|
+
The example below uses the ID of the skiplink container for demonstration purposes, in real use this would be passed the ID of an element that correctly described the input.
|
34
|
+
data:
|
35
|
+
label:
|
36
|
+
text: "This might not work"
|
37
|
+
name: "labelledby"
|
38
|
+
labelledby: "skiplink-container"
|
23
39
|
with_error:
|
24
40
|
data:
|
25
41
|
label:
|