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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82107111f850c84527a2eac1c33b99019069fd5fc4a1683f7b88f0cdae8dd30f
4
- data.tar.gz: f0d5265c99e46d8edec4adb3e9023cd26d08f690c2717454f497c33b7593638a
3
+ metadata.gz: fa48ba590fd58d68a1a54ffec60c38a87c705415c7cd6e2d60bd6847bea674b9
4
+ data.tar.gz: '069479f197d9edd22c46232606fb13e7c404fe8f9dabac8ca53e15bcaa24fe3b'
5
5
  SHA512:
6
- metadata.gz: 12665b69dcfd60f4ed3e336aecf494cb5c0cfb425fd61e9efc512d405790e6fdddc9b66f4723418beb12cd97bf0e2b5edad6b47b6490d6697230268f44c75b60
7
- data.tar.gz: 0e73ce2217730591b427993c0274cb80896eae3da8bac9f63d257421f5556a686975e970078c361c3a0b49c740f311607831a85ffc03d389bf4cf108574ebaf8
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();
@@ -39,8 +39,8 @@
39
39
 
40
40
  .gem-c-feedback__prompt-question,
41
41
  .gem-c-feedback__prompt-success {
42
- @include bold-16;
43
42
  display: inline;
43
+ font-weight: bold;
44
44
 
45
45
  &:focus {
46
46
  outline: 0;
@@ -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 single-line text field.
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
- Markdown listing what this component must do to be accessible. For example:
6
+ Inputs in the component must:
7
7
 
8
- The link must:
9
-
10
- * be keyboard focusable
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
- email_type:
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:
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '5.1.2'.freeze
2
+ VERSION = '5.1.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.2
4
+ version: 5.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev