govuk_publishing_components 45.7.0 → 45.8.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 +4 -4
- data/app/assets/javascripts/govuk_publishing_components/components/search-with-autocomplete.js +4 -4
- data/app/views/govuk_publishing_components/components/_label.html.erb +8 -7
- data/app/views/govuk_publishing_components/components/_lead_paragraph.html.erb +7 -6
- data/app/views/govuk_publishing_components/components/docs/label.yml +1 -0
- data/app/views/govuk_publishing_components/components/docs/lead_paragraph.yml +2 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7048798873f02e7ccdd7098ca9ce280a403df59e5b24d1ae54f93b6405971c48
|
4
|
+
data.tar.gz: 7145d41beda3ab925378248e55ee8dc9afb34585cc5a81df804a74fd664d1f05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d39c1a66ce5dbe6bca7dd41e7864170d4b413c250be1806fbe6873677bbc89126cab120ebb92741735ebd90665d3deb7c1cee17145770f9b2636f236ae67a1ae
|
7
|
+
data.tar.gz: 0a7f8ff45a1b76035cbf7842f3344d61bf1c2174727b643868a4814aacde5dfccfe87d7fd8b0dd57406ff52b70f6a0926041fd75413433178bc571ab17b1d942
|
data/app/assets/javascripts/govuk_publishing_components/components/search-with-autocomplete.js
CHANGED
@@ -116,15 +116,15 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
116
116
|
// Set tracking attributes on the input field. These can be used by the containing form's
|
117
117
|
// analytics module to track the user's interaction with the autocomplete component.
|
118
118
|
setTrackingAttributes (query, results) {
|
119
|
-
// Only set the suggestions
|
120
|
-
//
|
121
|
-
// that doesn't generate any)
|
119
|
+
// Only set the suggestions and trigger input attributes when results actually come back (so
|
120
|
+
// these attributes track the last seen non-empty suggestions and input used to trigger them,
|
121
|
+
// even if the user then amends their query to one that doesn't generate any)
|
122
122
|
if (results.length > 0) {
|
123
123
|
const formattedResults = results.slice(0, 5).join('|')
|
124
124
|
this.$autocompleteInput.dataset.autocompleteSuggestions = formattedResults
|
125
|
+
this.$autocompleteInput.dataset.autocompleteTriggerInput = query
|
125
126
|
}
|
126
127
|
|
127
|
-
this.$autocompleteInput.dataset.autocompleteTriggerInput = query
|
128
128
|
this.$autocompleteInput.dataset.autocompleteSuggestionsCount = results.length
|
129
129
|
this.$autocompleteInput.dataset.autocompleteAccepted = false
|
130
130
|
}
|
@@ -4,25 +4,26 @@
|
|
4
4
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
5
5
|
|
6
6
|
hint_text ||= ""
|
7
|
-
id ||= nil
|
8
7
|
is_radio_label ||= false
|
9
8
|
bold ||= false
|
10
9
|
heading_size = false unless shared_helper.valid_heading_size?(heading_size)
|
11
10
|
is_page_heading ||= false
|
12
11
|
right_to_left ||= false
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
14
|
+
component_helper.add_class("gem-c-label govuk-label")
|
15
|
+
component_helper.add_class("govuk-label--s") if bold
|
16
|
+
component_helper.add_class("govuk-radios__label") if is_radio_label
|
17
|
+
component_helper.add_class("govuk-label--#{heading_size}") if heading_size
|
18
|
+
component_helper.set_dir("rtl") if right_to_left
|
18
19
|
%>
|
19
20
|
|
20
21
|
<% if is_page_heading %>
|
21
22
|
<%= tag.h1 text, class: "govuk-label-wrapper" do %>
|
22
|
-
<%= tag.label text,
|
23
|
+
<%= tag.label text, for: html_for, **component_helper.all_attributes %>
|
23
24
|
<% end %>
|
24
25
|
<% else %>
|
25
|
-
<%= tag.label text,
|
26
|
+
<%= tag.label text, for: html_for, **component_helper.all_attributes %>
|
26
27
|
<% end %>
|
27
28
|
|
28
29
|
<% if hint_text.present? %>
|
@@ -5,12 +5,13 @@
|
|
5
5
|
inverse ||= false
|
6
6
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
classes << custom_margin_bottom_class if local_assigns[:margin_bottom]
|
8
|
+
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
9
|
+
component_helper.add_class("gem-c-lead-paragraph")
|
10
|
+
component_helper.add_class("gem-c-lead-paragraph--inverse") if inverse
|
11
|
+
component_helper.add_class(shared_helper.get_margin_bottom) if [*0..9].include?(local_assigns[:margin_bottom])
|
13
12
|
%>
|
14
13
|
<% if text.present? %>
|
15
|
-
<%=
|
14
|
+
<%= tag.p(**component_helper.all_attributes) do %>
|
15
|
+
<%= text %>
|
16
|
+
<% end %>
|
16
17
|
<% end %>
|
@@ -2,6 +2,7 @@ name: Form label
|
|
2
2
|
description: Use labels for all form fields.
|
3
3
|
body: |
|
4
4
|
For use with other form inputs e.g. [Radio buttons](/component-guide/radio)
|
5
|
+
uses_component_wrapper_helper: true
|
5
6
|
accessibility_criteria: |
|
6
7
|
All text must have a contrast ratio higher than 4.5:1 against the background colour to meet [WCAG AA](https://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast)
|
7
8
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
name: Lead paragraph
|
2
2
|
description: The opening paragraph of content. Typically a content item’s description field.
|
3
|
+
uses_component_wrapper_helper: true
|
3
4
|
accessibility_criteria: |
|
4
5
|
The lead paragraph must be visually distinct from other paragraphs.
|
5
6
|
|
@@ -10,6 +11,7 @@ examples:
|
|
10
11
|
text: 'UK Visas and Immigration is making changes to the Immigration Rules affecting various categories.'
|
11
12
|
right_to_left:
|
12
13
|
data:
|
14
|
+
dir: 'rtl'
|
13
15
|
text: 'قرارات تحقيقات وزارة الدفاع في الانتهاكات المزعومة للمادة ٢ والمادة ٣ من المعاهدة الاوروبية لحقوق الانسان خلال العمليات العسكرية في العراق.'
|
14
16
|
context:
|
15
17
|
right_to_left: true
|
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: 45.
|
4
|
+
version: 45.8.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: 2024-11-
|
11
|
+
date: 2024-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chartkick
|