govuk_publishing_components 21.31.0 → 21.32.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: 37a2fbff2e842370df622de39881e50806af9a8c6e00ed4f4b4d867759c4a601
4
- data.tar.gz: f01dd64ef6ab17e0dd623c8ecd3cc2dda2ad48afcfacea381896704fd22fc9dd
3
+ metadata.gz: 7b1a9090c4f5fad57615d4902fb08f085f1f132296abe03e6fbb8ebef8483a5e
4
+ data.tar.gz: 0f0089007c1b01dbc942b3a01cf115fe0ea6b9f2cd8833a9086cfb2fa141251e
5
5
  SHA512:
6
- metadata.gz: 61d6a04b5acbfdc25ba6c2c586c8ec0025debcd8638a7beaee596dd3af3ced4f8ef005e1cf90dabd3f18ee21a8c99fc2a99bd25ab6ed69e3f18a4e8fc0f977e6
7
- data.tar.gz: ca465df1771af9b6b8dfd7005c467814ee88260b73994bf3fe44790f9013ab9a375f98f2919eb115a7766d9b43a58e8f2becb6cc47245ed240ac8fd377bd4a80
6
+ metadata.gz: 7d0660fe442364870e56e1673bd266488561f72a34c9d8b6425039ba00fe33f25bfcdfb4662c2c23b033ab360e708b3d1ddf40d8d97094bbc3122c8b7a61f9af
7
+ data.tar.gz: c960079c0937fe0a7b119cdca6e56e321302d36bd224e7ca458116e0eac372d5ccf3ec495637926ca221dfc568650251a8619c1cb8c564b281c08cd5be5c103b
@@ -3,6 +3,7 @@
3
3
  is_radio_label ||= false
4
4
  bold ||= false
5
5
  heading_size = false unless ['s', 'm', 'l', 'xl'].include?(heading_size)
6
+ is_page_heading ||= false
6
7
 
7
8
  css_classes = %w( gem-c-label govuk-label )
8
9
  css_classes << "govuk-label--s" if bold
@@ -13,8 +14,12 @@
13
14
  hint_text_css_classes << "govuk-radios__hint" if is_radio_label
14
15
  %>
15
16
 
16
- <%= tag.label for: html_for, class: css_classes do %>
17
- <%= text %>
17
+ <% if is_page_heading %>
18
+ <%= tag.h1 text, class: "govuk-label-wrapper" do %>
19
+ <%= tag.label text, for: html_for, class: css_classes %>
20
+ <% end %>
21
+ <% else %>
22
+ <%= tag.label text, for: html_for, class: css_classes %>
18
23
  <% end %>
19
24
 
20
25
  <% if hint_text.present? %>
@@ -24,22 +24,29 @@ examples:
24
24
  with_hint:
25
25
  data:
26
26
  text: "National Insurance number"
27
- html_for: "id-that-matches-input"
27
+ html_for: "id-that-matches-input-1"
28
28
  hint_id: "should-match-aria-describedby-input"
29
29
  hint_text: "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’."
30
30
  with_custom_label_size:
31
31
  description: Make the label different sizes. Valid options are 's', 'm', 'l' and 'xl'.
32
32
  data:
33
33
  text: "Surname"
34
- html_for: "id-that-matches-input"
34
+ html_for: "id-that-matches-input-2"
35
35
  heading_size: "xl"
36
36
  bold_with_hint:
37
37
  data:
38
38
  bold: true
39
39
  text: "National Insurance number"
40
- html_for: "id-that-matches-input"
40
+ html_for: "id-that-matches-input-3"
41
41
  hint_id: "should-match-aria-describedby-input-bold"
42
42
  hint_text: "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’."
43
+ as_page_heading:
44
+ data:
45
+ is_page_heading: true
46
+ heading_size: "xl"
47
+ text: "National Insurance number"
48
+ html_for: "id-that-matches-input-4"
49
+ hint_id: "should-match-aria-describedby-input-bold"
43
50
  inside_a_radio_component:
44
51
  description: |
45
52
  When the label is used inside the [radio component](/component-guide/radio) additional classes are required on the radio, which are added by this option. This is already handled by the radio component and is a specific use case, but is worth documenting.
@@ -47,7 +54,7 @@ examples:
47
54
  Note that this example will not render correctly - do not be alarmed. It only works properly when inside the radio component.
48
55
  data:
49
56
  text: "National Insurance number"
50
- html_for: "id-that-matches-input"
57
+ html_for: "id-that-matches-input-5"
51
58
  is_radio_label: true
52
59
  html_for: "id-radio"
53
60
  hint_id: "id-radio"
@@ -56,6 +56,14 @@ examples:
56
56
  href: '#example-error-1'
57
57
  - text: Descriptive link to the question with an error 2
58
58
  href: '#example-error-2'
59
+ with_label_as_page_heading:
60
+ data:
61
+ label:
62
+ is_page_heading: true
63
+ heading_size: "xl"
64
+ text: "Can you provide more detail?"
65
+ hint: "Please include as much information as possible."
66
+ name: "more-detail-error"
59
67
  with_value:
60
68
  data:
61
69
  label:
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "21.31.0".freeze
2
+ VERSION = "21.32.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: 21.31.0
4
+ version: 21.32.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: 2020-03-20 00:00:00.000000000 Z
11
+ date: 2020-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gds-api-adapters