govuk_publishing_components 18.2.0 → 18.3.0

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: 9ac6e954b1c78501866e17af77d1a1ccbe4bdc265a8775a6e9546ab9791f00ab
4
- data.tar.gz: 6069d12624e6ad77aa88b817ea746ee21058b315057f65a184ec94621def5215
3
+ metadata.gz: 41819966f3acdcd91980fc9e8f51633caf134bc96333f053c0618e0f1306cd59
4
+ data.tar.gz: ad4486815abaab2fab8bfb56c8bcce37fb5384a8eab21997678dadf8cbd64d15
5
5
  SHA512:
6
- metadata.gz: f57d71f018e862dc34d6a3c2a25fb36901443d6463238de63632bd8bca9c02916372a18e4f45338338177de1fe181f10ce73f6fff073b1939ccbea72191863e3
7
- data.tar.gz: fed6631e756f445a51f5af976375b250c435067646bb479d6c4224874930fa03d9485422977ec54e7357311f37c16ab2f47cb00a17228c482ee92992058281c3
6
+ metadata.gz: d311fd3a434bcbcda4a498279635be91c1942aefa6bbc68c7882a74e866856b173b320e809a265e936e724219e92bd32e315e8e8ff5b2608f1bac6707bc56dd3
7
+ data.tar.gz: 479d44fb2d1c2a0ce945b29e74bf80feaeb49feb048821a1b73af391f6c9eacaf849b74bc07a95707dd414be9fd8201fdaac8fb4755204c468717d43a2410bf1
@@ -98,4 +98,13 @@ examples:
98
98
  data:
99
99
  text: "Second button"
100
100
  inline_layout: true
101
+ with_name_and_value_set:
102
+ description: |
103
+ By default, the button has no value or name set so it will not pass information when the form is submitted. This allows a name and value to be added so a button can add information to the form submission.
104
+
105
+ Please note that Internet Explorer 6 and 7 have **breaking bugs** when submitting a form with multiple buttons - this can [change what value is submitted by the button](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Notes). Make sure to check your user needs and browser usage.
106
+ data:
107
+ text: "This is the button text"
108
+ value: "this_is_the_value"
109
+ name: "this_is_the_name"
101
110
 
@@ -37,22 +37,18 @@ examples:
37
37
  text: "Has an id"
38
38
  name: "hasid"
39
39
  id: "hasid"
40
- aria_described_by:
40
+ with_aria_attributes:
41
41
  description: |
42
- 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.
42
+ The component accepts two possible aria attributes: aria-describedby and aria-controls.
43
43
 
44
- The example below uses the ID of the main container for demonstration purposes as there aren't any useful elements with IDs in the component guide. In real use this would be passed the ID of an element that correctly described the input.
44
+ [aria-describedby](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute) is used to indicate the ID of the element that describes the input. This will be overridden in the event of an error, where the error will be used for the describedby attribute value. This example uses the ID of the main container for demonstration purposes as there aren't any useful elements with IDs in the component guide. In real use this would be passed the ID of an element that correctly described the input.
45
+
46
+ aria-controls allows the addition of an aria-controls attribute, for use in places like the finders where the page is updated dynamically after value changes to the input.
45
47
  data:
46
48
  label:
47
49
  text: "This is an example only and may not work with a screen reader"
48
50
  name: "labelledby"
49
51
  describedby: "wrapper"
50
- aria_controls:
51
- description: Allows the addition of an aria-controls attribute, for use in places like the finders where the page is updated dynamically after value changes to the input.
52
- data:
53
- label:
54
- text: "This is an example only and will not work with a screen reader as intended"
55
- name: "controls"
56
52
  controls: "wrapper"
57
53
  with_hint:
58
54
  data:
@@ -5,7 +5,7 @@ module GovukPublishingComponents
5
5
  class ButtonHelper
6
6
  attr_reader :href, :text, :title, :info_text, :rel, :data_attributes,
7
7
  :margin_bottom, :inline_layout, :target, :type, :start,
8
- :secondary, :secondary_quiet, :destructive
8
+ :secondary, :secondary_quiet, :destructive, :name, :value
9
9
 
10
10
  def initialize(local_assigns)
11
11
  @href = local_assigns[:href]
@@ -22,6 +22,8 @@ module GovukPublishingComponents
22
22
  @secondary = local_assigns[:secondary]
23
23
  @secondary_quiet = local_assigns[:secondary_quiet]
24
24
  @destructive = local_assigns[:destructive]
25
+ @name = local_assigns[:name]
26
+ @value = local_assigns[:value]
25
27
  end
26
28
 
27
29
  def link?
@@ -36,6 +38,8 @@ module GovukPublishingComponents
36
38
  options[:data] = data_attributes if data_attributes
37
39
  options[:title] = title if title
38
40
  options[:target] = target if target
41
+ options[:name] = name if name.present? && value.present?
42
+ options[:value] = value if name.present? && value.present?
39
43
  options
40
44
  end
41
45
 
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '18.2.0'.freeze
2
+ VERSION = '18.3.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 18.2.0
4
+ version: 18.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-22 00:00:00.000000000 Z
11
+ date: 2019-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gds-api-adapters