govuk_publishing_components 21.13.5 → 21.14.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3b8b720833271b00598f634fa50424361c265ea3f4bf42cef01184a5b36af26
|
4
|
+
data.tar.gz: 6b4a2ae3ee350c4e4a45cbdac9ab04e9412a1c66fb361b05c706fdcca1ba6240
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7840cdd577f7307231fc74e67aa8e0e0d81e5929fecd0408297e79c82e268a916466633ea8efce01b8f8d0dd8c1f4a73965b761f9d08df9c720334733fd4fe8
|
7
|
+
data.tar.gz: 7ebb8a3c9a9442e323955a5b815e97d673e7fbb292da063dc0f14a513c6b91a49cfb418fc293c10149cd9c05002d9b46c5c3250044294b32ce75efd1b66d6d2d
|
@@ -1,7 +1,10 @@
|
|
1
1
|
<%
|
2
|
+
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
3
|
+
|
2
4
|
text = text || yield
|
3
5
|
describedby ||= nil
|
4
6
|
role ||= nil
|
7
|
+
heading_level ||= nil
|
5
8
|
heading_size = false unless ['s', 'm', 'l', 'xl'].include?(heading_size)
|
6
9
|
error_message ||= nil
|
7
10
|
error_id ||= nil
|
@@ -22,8 +25,17 @@
|
|
22
25
|
%>
|
23
26
|
<%= tag.div class: css_classes do %>
|
24
27
|
<%= tag.fieldset class: fieldset_classes, aria: { describedby: describedby }, role: role, id: id do %>
|
25
|
-
|
26
|
-
<%=
|
28
|
+
<% if heading_level %>
|
29
|
+
<%= tag.legend class: legend_classes do %>
|
30
|
+
<%= content_tag(
|
31
|
+
shared_helper.get_heading_level,
|
32
|
+
legend_text,
|
33
|
+
class: "govuk-fieldset__heading"
|
34
|
+
)
|
35
|
+
%>
|
36
|
+
<% end %>
|
37
|
+
<% else %>
|
38
|
+
<%= tag.legend legend_text, class: legend_classes %>
|
27
39
|
<% end %>
|
28
40
|
<% if error_message %>
|
29
41
|
<%= render "govuk_publishing_components/components/error_message", {
|
@@ -10,60 +10,58 @@ examples:
|
|
10
10
|
default:
|
11
11
|
data:
|
12
12
|
legend_text: 'Do you have a passport?'
|
13
|
-
|
13
|
+
block: |
|
14
14
|
<!-- Use the radio component, this is hardcoded only for this example -->
|
15
|
-
|
16
|
-
|
15
|
+
<input type="radio" id="default-yes" name="default">
|
16
|
+
<label for="default-yes">Yes</label>
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
<input type="radio" id="default-no" name="default">
|
19
|
+
<label for="default-no">No</label>
|
20
20
|
with_id_attribute:
|
21
21
|
data:
|
22
22
|
legend_text: 'Do you have a passport?'
|
23
23
|
id: passports
|
24
|
-
|
24
|
+
block: |
|
25
25
|
<!-- Use the radio component, this is hardcoded only for this example -->
|
26
|
-
|
27
|
-
|
26
|
+
<input type="radio" id="passport-yes" name="default">
|
27
|
+
<label for="passport-yes">Yes</label>
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
<input type="radio" id="passport-no" name="default">
|
30
|
+
<label for="passport-no">No</label>
|
31
|
+
with_heading:
|
32
32
|
description: Make the legend different sizes. Valid options are 's', 'm', 'l' and 'xl'.
|
33
33
|
data:
|
34
34
|
legend_text: 'Do you have a driving license?'
|
35
|
-
|
36
|
-
|
35
|
+
heading_level: 2
|
36
|
+
heading_size: 'm'
|
37
|
+
block: |
|
37
38
|
<!-- Use the radio component, this is hardcoded only for this example -->
|
38
|
-
|
39
|
-
|
39
|
+
<input type="radio" id="level-yes" name="default">
|
40
|
+
<label for="level-yes">Yes</label>
|
40
41
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
description:
|
42
|
+
<input type="radio" id="level-no" name="default">
|
43
|
+
<label for="level-no">No</label>
|
44
|
+
with_custom_legend_size:
|
45
|
+
description: Make the legend different sizes. Valid options are 's', 'm', 'l' and 'xl'.
|
45
46
|
data:
|
46
|
-
legend_text:
|
47
|
-
|
48
|
-
|
49
|
-
Do you have a passport?
|
50
|
-
</h1>
|
51
|
-
text: |
|
47
|
+
legend_text: 'Do you have a driving license?'
|
48
|
+
heading_size: 'l'
|
49
|
+
block: |
|
52
50
|
<!-- Use the radio component, this is hardcoded only for this example -->
|
53
|
-
|
54
|
-
|
51
|
+
<input type="radio" id="size-yes" name="default">
|
52
|
+
<label for="size-yes">Yes</label>
|
55
53
|
|
56
|
-
|
57
|
-
|
54
|
+
<input type="radio" id="size-no" name="default">
|
55
|
+
<label for="size-no">No</label>
|
58
56
|
with_error_message:
|
59
57
|
description: The component also accepts an error_id, or generates one automatically.
|
60
58
|
data:
|
61
59
|
legend_text: 'Do you have a passport?'
|
62
60
|
error_message: 'Please choose an option'
|
63
|
-
|
61
|
+
block: |
|
64
62
|
<!-- Use the radio component, this is hardcoded only for this example -->
|
65
|
-
|
66
|
-
|
63
|
+
<input type="radio" id="default2-yes" name="default2">
|
64
|
+
<label for="default2-yes">Yes</label>
|
67
65
|
|
68
|
-
|
69
|
-
|
66
|
+
<input type="radio" id="default2-no" name="default2">
|
67
|
+
<label for="default2-no">No</label>
|
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.
|
4
|
+
version: 21.14.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-12-
|
11
|
+
date: 2019-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gds-api-adapters
|