govuk_publishing_components 21.34.0 → 21.34.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06d7757dbcd28fd92634c297a0aa7dab4552cc8c37566ace976ae6b875ebdcd5
4
- data.tar.gz: d509b6519a31c7440d9348fbaad487178ffe1031743467e8ca2bb360824c6bdd
3
+ metadata.gz: 4e520e8f4d8396e3e7b6abd02a2b4e5c35af1a491909c010c003654cbffd7815
4
+ data.tar.gz: f36c4843d284f739f868ef8286089872464568a79500efebc8a9f4cd161b15f6
5
5
  SHA512:
6
- metadata.gz: dda8b26697d586bc62b2ee47349fa52839ecc608e5e2c21b9cca5347903b4677f6dddaec48d72c3075a1f0bf890642d010bd395fc5555eb082026026947a956d
7
- data.tar.gz: 1c09c5b51fcb0a25498a6715f81073e13ade337f56f04bf9df35de79061ace7fb48f912d6cb69667a02fb4bd6f9f721cb923e21fc2ee76eb98a723ea3572d3fc
6
+ metadata.gz: 8ee4f82df1fecd0979a2f7b557340443af3acd12a917174a36ad369378e469541e39616639d341b654a706bdecc3a332e785b8554abe085343d2d553707532c3
7
+ data.tar.gz: 76e2ed627dd262c031ec78b0990d2deab975cca1ec8441a8c125609a0d9a3d08b3f41feed463a8fe258ee57647c8e029d18c2f18bd390e9a536892a3f9b89a41
@@ -285,9 +285,26 @@ examples:
285
285
  - label: "Phone"
286
286
  value: "phone"
287
287
  conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-phone">Phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-phone" name="contactingme" type="tel"></div>
288
- - label: "Other"
289
- value: "other"
290
- conditional: "See no styling."
288
+ - label: "Text message"
289
+ value: "text"
290
+ conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-text">Mobile phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-text" name="contactingme" type="tel"></div>
291
+ checkbox_items_with_conditional_reveal_checked:
292
+ data:
293
+ name: "contacting-checked"
294
+ id: "contacting-checked"
295
+ heading: "How would you like to be contacted?"
296
+ hint_text: "Please select all options that are relevant to you."
297
+ items:
298
+ - label: "Email"
299
+ value: "email"
300
+ conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-email">Email address</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-email" name="contactingme" type="email"></div>
301
+ checked: true
302
+ - label: "Phone"
303
+ value: "phone"
304
+ conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-phone">Phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-phone" name="contactingme" type="tel"></div>
305
+ - label: "Text message"
306
+ value: "text"
307
+ conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-text">Mobile phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-text" name="contactingme" type="tel"></div>
291
308
  checkbox_items_with_checked_items:
292
309
  data:
293
310
  name: "nationality"
@@ -313,6 +313,18 @@ examples:
313
313
  - value: "govuk-verify"
314
314
  text: "Use GOV.UK Verify"
315
315
  conditional: "You’ll need to prove your identity using GOV.UK Verify"
316
+ conditional_checked:
317
+ data:
318
+ name: "radio-group-conditional"
319
+ id_prefix: "conditional-checked"
320
+ items:
321
+ - value: "government-gateway"
322
+ text: "Use Government Gateway"
323
+ conditional: "You’ll need to prove your identity using Government Gateway"
324
+ checked: true
325
+ - value: "govuk-verify"
326
+ text: "Use GOV.UK Verify"
327
+ conditional: "You’ll need to prove your identity using GOV.UK Verify"
316
328
  tracking-url:
317
329
  data:
318
330
  name: "radio-group-tracking-url"
@@ -70,11 +70,13 @@ module GovukPublishingComponents
70
70
 
71
71
  def checkbox_markup(checkbox, index)
72
72
  checkbox_id = checkbox[:id] || "#{@id}-#{index}"
73
- controls = checkbox[:conditional].present? ? "#{checkbox_id}-conditional-#{index || rand(1..100)}" : checkbox[:controls]
73
+ controls = checkbox[:controls]
74
+ aria_controls = "#{checkbox_id}-conditional-#{index || rand(1..100)}" if checkbox[:conditional].present?
74
75
  checkbox_name = checkbox[:name].present? ? checkbox[:name] : @name
75
76
  checked = true if checkbox[:checked].present?
76
77
  data = checkbox[:data_attributes] || {}
77
78
  data[:controls] = controls
79
+ data["aria-controls"] = aria_controls
78
80
 
79
81
  capture do
80
82
  concat check_box_tag checkbox_name, checkbox[:value], checked, class: "govuk-checkboxes__input", id: checkbox_id, data: data
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "21.34.0".freeze
2
+ VERSION = "21.34.1".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: 21.34.0
4
+ version: 21.34.1
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: 2020-03-23 00:00:00.000000000 Z
11
+ date: 2020-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gds-api-adapters