govuk_publishing_components 43.4.1 → 44.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/config/govuk_publishing_components_manifest.js +0 -1
- data/app/assets/javascripts/govuk_publishing_components/components/option-select.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +20 -19
- data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +1 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_cards.scss +0 -12
- data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +0 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/_devolved-nations.scss +1 -9
- data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +12 -10
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +0 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_inset-text.scss +0 -17
- data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +0 -17
- data/app/assets/stylesheets/govuk_publishing_components/components/_option-select.scss +12 -7
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +0 -12
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +0 -17
- data/app/assets/stylesheets/govuk_publishing_components/lib/_print_support.scss +45 -0
- data/app/models/govuk_publishing_components/component_wrapper_helper_options.rb +1 -0
- data/app/views/govuk_publishing_components/components/_action_link.html.erb +4 -4
- data/app/views/govuk_publishing_components/components/_cards.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_contents_list.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_contextual_guidance.html.erb +7 -3
- data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +12 -4
- data/app/views/govuk_publishing_components/components/_devolved_nations.html.erb +16 -12
- data/app/views/govuk_publishing_components/components/_document_list.html.erb +3 -2
- data/app/views/govuk_publishing_components/components/_image_card.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_inset_text.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_intervention.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +0 -1
- data/app/views/govuk_publishing_components/components/_option_select.html.erb +5 -3
- data/app/views/govuk_publishing_components/components/_radio.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/docs/action_link.yml +5 -5
- data/app/views/govuk_publishing_components/components/docs/attachment_link.yml +6 -0
- data/app/views/govuk_publishing_components/components/docs/big_number.yml +17 -2
- data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +3 -1
- data/app/views/govuk_publishing_components/components/docs/contextual_guidance.yml +1 -0
- data/app/views/govuk_publishing_components/components/docs/devolved_nations.yml +2 -1
- data/app/views/govuk_publishing_components/components/docs/document_list.yml +22 -0
- data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +2 -30
- data/app/views/govuk_publishing_components/components/docs/radio.yml +15 -0
- data/app/views/govuk_publishing_components/components/docs/search.yml +1 -3
- data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml +2 -0
- data/app/views/govuk_publishing_components/components/docs/tabs.yml +1 -1
- data/app/views/govuk_publishing_components/components/layout_for_public/_account-layout.html.erb +0 -1
- data/app/views/layouts/govuk_publishing_components/application.html.erb +0 -2
- data/lib/govuk_publishing_components/presenters/component_wrapper_helper.rb +16 -0
- data/lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb +3 -3
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/accessible-autocomplete/CHANGELOG.md +8 -0
- data/node_modules/accessible-autocomplete/accessibility-criteria.md +2 -1
- data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js +1 -1
- data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js.map +1 -1
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js +1 -1
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js.map +1 -1
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js +1 -1
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js.map +1 -1
- data/node_modules/accessible-autocomplete/examples/ajax-source.html +300 -0
- data/node_modules/accessible-autocomplete/examples/form-single.html +4 -2
- data/node_modules/accessible-autocomplete/examples/index.html +7 -52
- data/node_modules/accessible-autocomplete/examples/suggestions.json +258 -0
- data/node_modules/accessible-autocomplete/package.json +15 -15
- data/node_modules/accessible-autocomplete/src/autocomplete.js +4 -2
- data/node_modules/accessible-autocomplete/test/functional/index.js +21 -5
- metadata +19 -4
- data/app/assets/javascripts/govuk_publishing_components/vendor/modernizr.js +0 -3
@@ -38,7 +38,7 @@
|
|
38
38
|
data_attributes[:ga4_intervention_banner] = "" unless disable_ga4 # Added to the parent element for the GA4 pageview object to use
|
39
39
|
|
40
40
|
suggestion_tag_options = {
|
41
|
-
class: "govuk-link",
|
41
|
+
class: "govuk-link gem-print-link",
|
42
42
|
href: suggestion_link_url,
|
43
43
|
data: suggestion_data_attributes,
|
44
44
|
}
|
@@ -18,7 +18,6 @@
|
|
18
18
|
<%= csrf_meta_tags %>
|
19
19
|
<%= favicon_link_tag "govuk_publishing_components/favicon-#{environment}.png" %>
|
20
20
|
<%= stylesheet_link_tag css_filename, media: "all" %>
|
21
|
-
<%= javascript_include_tag "govuk_publishing_components/vendor/modernizr" %>
|
22
21
|
<% if GovukPublishingComponents::Config.use_es6_components %>
|
23
22
|
<%= javascript_include_tag js_module_filename, type: "module" %>
|
24
23
|
<% end %>
|
@@ -45,9 +45,11 @@
|
|
45
45
|
|
46
46
|
<%= tag.div(**helper.all_attributes) do %>
|
47
47
|
<h3 class="gem-c-option-select__heading js-container-heading">
|
48
|
-
<
|
49
|
-
|
50
|
-
|
48
|
+
<div class="gem-c-option-select__toggle js-container-toggle">
|
49
|
+
<span class="gem-c-option-select__title js-container-button" id="<%= title_id %>"><%= title %></span>
|
50
|
+
<svg version="1.1" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="0" height="0" class="gem-c-option-select__icon gem-c-option-select__icon--up" aria-hidden="true" focusable="false"><path d="m798.16 609.84l-256-256c-16.683-16.683-43.691-16.683-60.331 0l-256 256c-16.683 16.683-16.683 43.691 0 60.331s43.691 16.683 60.331 0l225.84-225.84 225.84 225.84c16.683 16.683 43.691 16.683 60.331 0s16.683-43.691 0-60.331z"/></svg>
|
51
|
+
<svg version="1.1" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="0" height="0" class="gem-c-option-select__icon gem-c-option-select__icon--down" aria-hidden="true" focusable="false"><path d="m225.84 414.16l256 256c16.683 16.683 43.691 16.683 60.331 0l256-256c16.683-16.683 16.683-43.691 0-60.331s-43.691-16.683-60.331 0l-225.84 225.84-225.84-225.84c-16.683-16.683-43.691-16.683-60.331 0s-16.683 43.691 0 60.331z"/></svg>
|
52
|
+
</div>
|
51
53
|
</h3>
|
52
54
|
|
53
55
|
<%= content_tag(:div, class: options_container_classes, id: options_container_id, tabindex: "-1") do %>
|
@@ -12,6 +12,7 @@
|
|
12
12
|
heading ||= nil
|
13
13
|
heading_caption ||= nil
|
14
14
|
heading_size ||= nil
|
15
|
+
visually_hidden_heading ||= false
|
15
16
|
small ||= false
|
16
17
|
inline ||= false
|
17
18
|
heading_level = shared_helper.get_heading_level
|
@@ -46,6 +47,7 @@
|
|
46
47
|
|
47
48
|
legend_classes = %w(govuk-fieldset__legend)
|
48
49
|
legend_classes << "govuk-fieldset__legend--#{size}"
|
50
|
+
legend_classes << "govuk-visually-hidden" if visually_hidden_heading
|
49
51
|
|
50
52
|
aria = "#{hint_id} #{"#{error_id}" if has_error}".strip if hint or has_error
|
51
53
|
|
@@ -35,7 +35,7 @@
|
|
35
35
|
<strong class="gem-c-step-nav-header__part-of">Part of</strong>
|
36
36
|
<% if path %>
|
37
37
|
<a href="<%= path %>"
|
38
|
-
class="gem-c-step-nav-header__title govuk-link"
|
38
|
+
class="gem-c-step-nav-header__title govuk-link gem-print-link"
|
39
39
|
<% unless disable_ga4 %>
|
40
40
|
data-ga4-link='<%= ga4_data %>'
|
41
41
|
<% end %>
|
@@ -15,7 +15,7 @@
|
|
15
15
|
<span class="gem-c-step-nav-related__pretitle"><%= pretitle %></span>
|
16
16
|
<% if links.length == 1 && !always_display_as_list %>
|
17
17
|
<a href="<%= links[0][:href] %>"
|
18
|
-
class="govuk-link"
|
18
|
+
class="govuk-link gem-print-link"
|
19
19
|
<% unless disable_ga4
|
20
20
|
ga4_attributes = {
|
21
21
|
event_name: "navigation",
|
@@ -37,7 +37,7 @@
|
|
37
37
|
<% links.each_with_index do |link, index| %>
|
38
38
|
<li class="gem-c-step-nav-related__link-item">
|
39
39
|
<a href="<%= link[:href] %>"
|
40
|
-
class="govuk-link"
|
40
|
+
class="govuk-link gem-print-link"
|
41
41
|
<% unless disable_ga4
|
42
42
|
ga4_attributes = {
|
43
43
|
event_name: "navigation",
|
@@ -18,11 +18,11 @@ examples:
|
|
18
18
|
text: "Coronavirus (COVID-19):"
|
19
19
|
nowrap_text: what you need to do
|
20
20
|
href: "/page"
|
21
|
-
|
21
|
+
inverse:
|
22
22
|
data:
|
23
23
|
text: "Coronavirus (COVID-19)"
|
24
24
|
href: "/page"
|
25
|
-
|
25
|
+
inverse: true
|
26
26
|
context:
|
27
27
|
dark_background: true
|
28
28
|
with_subtext:
|
@@ -35,7 +35,7 @@ examples:
|
|
35
35
|
text: Emergency something
|
36
36
|
href: "/page"
|
37
37
|
subtext: This is about the emergency that is happening right now unfortunately so pay attention
|
38
|
-
|
38
|
+
inverse: true
|
39
39
|
context:
|
40
40
|
dark_background: true
|
41
41
|
mobile_subtext:
|
@@ -56,7 +56,7 @@ examples:
|
|
56
56
|
text: Remain calm
|
57
57
|
subtext: Better things are ahead
|
58
58
|
subtext_href: "/page"
|
59
|
-
|
59
|
+
inverse: true
|
60
60
|
context:
|
61
61
|
dark_background: true
|
62
62
|
simple_arrow:
|
@@ -68,7 +68,7 @@ examples:
|
|
68
68
|
data:
|
69
69
|
text: Getting financial help and keeping your business safe
|
70
70
|
href: "/financial-help"
|
71
|
-
|
71
|
+
inverse: true
|
72
72
|
simple_light: true
|
73
73
|
context:
|
74
74
|
dark_background: true
|
@@ -6,6 +6,12 @@ body: |
|
|
6
6
|
|
7
7
|
It is expected to be embedded inside an element that provides text styles
|
8
8
|
(such as `.govuk-body`) so does not provide its own text styling.
|
9
|
+
accessibility_criteria: |
|
10
|
+
All touch targets (e.g the attachment link) must be 24px large, or leave sufficient space (target-size). See [Understanding Success Criterion 2.5.8: Target Size (Minimum))](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html).
|
11
|
+
|
12
|
+
To achieve this, you can embed the attachment link within another element that maintains sufficient space above and below the target. For instance, you can place individual links inside a paragraph element styled with a `.govuk-body` class, or as list items in the [list component](https://components.publishing.service.gov.uk/component-guide/list).
|
13
|
+
|
14
|
+
Attachment links within paragraphs of text do not need to meet the 24 by 24 CSS pixels requirements.
|
9
15
|
shared_accessibility_criteria:
|
10
16
|
- link
|
11
17
|
examples:
|
@@ -18,11 +18,26 @@ examples:
|
|
18
18
|
data:
|
19
19
|
number: 119
|
20
20
|
label: Open consultations
|
21
|
-
|
22
|
-
description: "In some cases, we want to communicate more than just the flat numeric value eg: `400
|
21
|
+
with_plus_symbol:
|
22
|
+
description: "In some cases, we want to communicate more than just the flat numeric value eg: `400+`. This is why we allow values to be passed as flat strings."
|
23
23
|
data:
|
24
24
|
number: "400+"
|
25
25
|
label: Other agencies and public bodies
|
26
|
+
with_percentage_symbol:
|
27
|
+
description: "In some cases, we want to communicate more than just the flat numeric value eg: `90%`. This is why we allow values to be passed as flat strings."
|
28
|
+
data:
|
29
|
+
number: "90%"
|
30
|
+
label: is a large percentage of something
|
31
|
+
with_negative_symbol:
|
32
|
+
description: "In some cases, we want to communicate more than just the flat numeric value eg: `-20`. This is why we allow values to be passed as flat strings."
|
33
|
+
data:
|
34
|
+
number: "-20"
|
35
|
+
label: is a negative number
|
36
|
+
with_unit_symbol:
|
37
|
+
description: "In some cases, we want to communicate more than just the flat numeric value eg: `1M`. This is why we allow values to be passed as flat strings."
|
38
|
+
data:
|
39
|
+
number: "1M"
|
40
|
+
label: is a shorter way of saying one million
|
26
41
|
with_link:
|
27
42
|
data:
|
28
43
|
number: 23
|
@@ -6,9 +6,11 @@ body: |
|
|
6
6
|
We recommend that if using the breadcrumbs for navigation purposes, you set `collapse_on_mobile` to `true` to make things more readable for mobile users. However, you can specify `collapse_on_mobile:``false` or remove the flag completely to stop this behaviour.
|
7
7
|
shared_accessibility_criteria:
|
8
8
|
- link
|
9
|
-
accessibility_criteria:
|
9
|
+
accessibility_criteria: |
|
10
10
|
The breadcrumb links must have a text contrast ratio higher than 4.5:1 against the background colour to meet WCAG AA
|
11
11
|
(this especially applies when [using the inverse flag](/component-guide/breadcrumbs/inverse)).
|
12
|
+
|
13
|
+
Always place breadcrumbs at the top of a page, before the `<main>` element. Placing them here means that the "Skip to main content" link allows the user to skip all navigation links, including breadcrumbs.
|
12
14
|
accessibility_excluded_rules:
|
13
15
|
- skip-link # This component is creating a reference to #content which is part of the layout
|
14
16
|
display_html: true
|
@@ -11,6 +11,7 @@ accessibility_criteria: |
|
|
11
11
|
* be hidden by default
|
12
12
|
* be visible when the associated input field if focused
|
13
13
|
* stay visible until another input field with guidance is being focused
|
14
|
+
uses_component_wrapper_helper: true
|
14
15
|
shared_accessibility_criteria:
|
15
16
|
- link
|
16
17
|
examples:
|
@@ -7,6 +7,7 @@ body: |
|
|
7
7
|
|
8
8
|
* nations that the alternative content relates to
|
9
9
|
* a list of alternative URLs where applicable
|
10
|
+
uses_component_wrapper: true
|
10
11
|
shared_accessibility_criteria:
|
11
12
|
- link
|
12
13
|
accessibility_criteria: |
|
@@ -104,4 +105,4 @@ examples:
|
|
104
105
|
applicable: false
|
105
106
|
alternative_url: /
|
106
107
|
type: detailed_guide
|
107
|
-
|
108
|
+
disable_ga4: true
|
@@ -244,6 +244,28 @@ examples:
|
|
244
244
|
metadata:
|
245
245
|
public_updated_at: 2017-07-19 15:01:48
|
246
246
|
document_type: 'Statistical data set'
|
247
|
+
with_equal_item_spacing:
|
248
|
+
description: |
|
249
|
+
The new search UI has consistently equal spacing between items in the document list, instead
|
250
|
+
of the original larger bottom padding.
|
251
|
+
data:
|
252
|
+
equal_item_spacing: true
|
253
|
+
items:
|
254
|
+
- link:
|
255
|
+
text: 'Become an apprentice'
|
256
|
+
path: '/become-an-apprentice'
|
257
|
+
description: 'Becoming an apprentice - what to expect, apprenticeship levels, pay and training, making an application, complaining about an apprenticeship.'
|
258
|
+
full_size_description: true
|
259
|
+
- link:
|
260
|
+
text: 'Become a journeyman'
|
261
|
+
path: '/become-a-journeyman'
|
262
|
+
description: 'Becoming a journeyman - what to expect, what to take, pay and training, making an application, complaining about being a journeyman.'
|
263
|
+
full_size_description: true
|
264
|
+
- link:
|
265
|
+
text: 'Become enlightened'
|
266
|
+
path: '/become-enlightened'
|
267
|
+
description: 'Becoming enlightened - what to expect, what to take, pay and training, making an application, complaining about being enlightened.'
|
268
|
+
full_size_description: true
|
247
269
|
highlighted_result:
|
248
270
|
description: Highlight one or more of the items in the list. This is used on finders to provide a 'top result' for a search. The `highlight_text` parameter is optional.
|
249
271
|
data:
|
@@ -1,17 +1,13 @@
|
|
1
1
|
name: Inverse header
|
2
2
|
description: A wrapper to contain header content in white text
|
3
3
|
body: |
|
4
|
-
This component can be passed a block of template code and will wrap it in a blue header. This is as light-touch as possible and doesn't attempt to deal with the margins and paddings of its content. White text is enforced on content and would need to be overridden where unwanted. Implemented to accommodate topic and list page headings
|
4
|
+
This component can be passed a block of template code and will wrap it in a blue header. This is as light-touch as possible and doesn't attempt to deal with the margins and paddings of its content. White text is enforced on content and would need to be overridden where unwanted. Implemented to accommodate topic and list page headings but unopinionated about its contents.
|
5
5
|
|
6
6
|
If passing links to the block make sure to add [the inverse modifier](https://design-system.service.gov.uk/styles/typography/#links-on-dark-backgrounds).
|
7
|
-
|
8
7
|
accessibility_criteria: |
|
9
8
|
The component must:
|
10
9
|
|
11
10
|
* be used in conjunction with content that renders a text contrast ratio higher than 4.5:1 against the header colour to meet WCAG AA.
|
12
|
-
|
13
|
-
accessibility_excluded_rules:
|
14
|
-
- skip-link # Examples of this component contain breadcrumbs, creating a reference to #content which is part of the layout
|
15
11
|
examples:
|
16
12
|
default:
|
17
13
|
data:
|
@@ -45,31 +41,7 @@ examples:
|
|
45
41
|
} %>
|
46
42
|
<p class="publication-header__last-changed">Published 22 April 2016</p>
|
47
43
|
<!-- end of example content -->
|
48
|
-
|
49
|
-
data:
|
50
|
-
padding_top: false
|
51
|
-
block: |
|
52
|
-
<!-- example content -->
|
53
|
-
<%= render "govuk_publishing_components/components/breadcrumbs", {
|
54
|
-
collapse_on_mobile: true,
|
55
|
-
breadcrumbs: [
|
56
|
-
{
|
57
|
-
title: "Section",
|
58
|
-
url: "/section"
|
59
|
-
},
|
60
|
-
{
|
61
|
-
title: "Education of disadvantaged children",
|
62
|
-
url: "/section/sub-section"
|
63
|
-
}
|
64
|
-
],
|
65
|
-
inverse: true
|
66
|
-
} %>
|
67
|
-
<%= render "govuk_publishing_components/components/lead_paragraph", {
|
68
|
-
text: "Schools and academies, further and higher education, apprenticeships and other skills training, student funding, early years.",
|
69
|
-
inverse: true
|
70
|
-
} %>
|
71
|
-
<!-- end of example content -->
|
72
|
-
with_link:
|
44
|
+
with_paragraph_and_link:
|
73
45
|
data:
|
74
46
|
block: |
|
75
47
|
<p class="gem-c-lead-paragraph gem-c-lead-paragraph--inverse">
|
@@ -160,6 +160,21 @@ examples:
|
|
160
160
|
text: "Yes"
|
161
161
|
- value: "no"
|
162
162
|
text: "No"
|
163
|
+
with_visually_hidden_heading:
|
164
|
+
description: |
|
165
|
+
If the heading/legend on the radios is not required, it can be visually hidden using this
|
166
|
+
option. It will still be visible to screen readers.
|
167
|
+
data:
|
168
|
+
name: "radio-group-visually-hidden-heading"
|
169
|
+
heading: "What is your favourite colour?"
|
170
|
+
visually_hidden_heading: true
|
171
|
+
items:
|
172
|
+
- value: "red"
|
173
|
+
text: "Red"
|
174
|
+
- value: "green"
|
175
|
+
text: "Green"
|
176
|
+
- value: "blue"
|
177
|
+
text: "Blue"
|
163
178
|
with_description:
|
164
179
|
data:
|
165
180
|
name: "radio-group-description"
|
@@ -16,10 +16,8 @@ accessibility_criteria: |
|
|
16
16
|
examples:
|
17
17
|
default:
|
18
18
|
data: {}
|
19
|
-
|
19
|
+
set_search_value:
|
20
20
|
data:
|
21
|
-
inline_label: false
|
22
|
-
label_text: "<h1>Search GOV.UK</h1>"
|
23
21
|
value: "driving licence"
|
24
22
|
stop_the_label_appearing_inline:
|
25
23
|
data:
|
@@ -8,6 +8,8 @@ accessibility_criteria: |
|
|
8
8
|
An earlier version of the component did not use a heading element – this failed WCAG 2.1 Success Criterion 1.3.1 ("Information, structure, and relationships conveyed through presentation can be programmatically determined or are available in text.")
|
9
9
|
|
10
10
|
An early version of the component contained a hidden skip link for keyboard and screen reader users, that jumped to the step by step navigation component in the sidebar (similar to the 'skip to content' link at the top of all GOV.UK pages). User testing suggested that rather than helping users it confused them, so this has been removed.
|
11
|
+
|
12
|
+
Always place the step by step navigation header at the top of a page, before the `<main>` element. Placing the component here means that the "Skip to main content" link allows the user to skip all navigation links, including the step by step navigation header.
|
11
13
|
shared_accessibility_criteria:
|
12
14
|
- link
|
13
15
|
examples:
|
data/app/views/govuk_publishing_components/components/layout_for_public/_account-layout.html.erb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
<div class="govuk-width-container">
|
2
2
|
<%= render "govuk_publishing_components/components/phase_banner", {
|
3
3
|
phase: "beta",
|
4
|
-
ga4_tracking: true,
|
5
4
|
message: sanitize(t("components.layout_for_public.account_layout.feedback.banners.phase_banner_html"))
|
6
5
|
} unless omit_account_phase_banner %>
|
7
6
|
|
@@ -41,8 +41,6 @@
|
|
41
41
|
<%= stylesheet_link_tag "component_guide/application", media: "all" %>
|
42
42
|
<%= yield :application_stylesheet %>
|
43
43
|
<%= render_component_stylesheets %>
|
44
|
-
|
45
|
-
<%= javascript_include_tag "govuk_publishing_components/vendor/modernizr" %>
|
46
44
|
<%= yield :extra_headers %>
|
47
45
|
</head>
|
48
46
|
<body class="gem-c-layout-for-admin govuk-template__body <%= 'hide-header-and-footer' if @preview %>">
|
@@ -11,6 +11,7 @@ module GovukPublishingComponents
|
|
11
11
|
check_role_is_valid(@options[:role]) if @options.include?(:role)
|
12
12
|
check_lang_is_valid(@options[:lang]) if @options.include?(:lang)
|
13
13
|
check_open_is_valid(@options[:open]) if @options.include?(:open)
|
14
|
+
check_hidden_is_valid(@options[:hidden]) if @options.include?(:hidden)
|
14
15
|
end
|
15
16
|
|
16
17
|
def all_attributes
|
@@ -23,6 +24,7 @@ module GovukPublishingComponents
|
|
23
24
|
attributes[:role] = @options[:role] unless @options[:role].blank?
|
24
25
|
attributes[:lang] = @options[:lang] unless @options[:lang].blank?
|
25
26
|
attributes[:open] = @options[:open] unless @options[:open].blank?
|
27
|
+
attributes[:hidden] = @options[:hidden] unless @options[:hidden].nil?
|
26
28
|
|
27
29
|
attributes
|
28
30
|
end
|
@@ -62,6 +64,11 @@ module GovukPublishingComponents
|
|
62
64
|
@options[:open] = open_attribute
|
63
65
|
end
|
64
66
|
|
67
|
+
def set_hidden(hidden_attribute)
|
68
|
+
check_hidden_is_valid(hidden_attribute)
|
69
|
+
@options[:hidden] = hidden_attribute
|
70
|
+
end
|
71
|
+
|
65
72
|
private
|
66
73
|
|
67
74
|
def check_id_is_valid(id)
|
@@ -130,6 +137,15 @@ module GovukPublishingComponents
|
|
130
137
|
end
|
131
138
|
end
|
132
139
|
|
140
|
+
def check_hidden_is_valid(hidden_attribute)
|
141
|
+
return if hidden_attribute.nil?
|
142
|
+
|
143
|
+
options = ["", "hidden", "until-found"]
|
144
|
+
unless options.include? hidden_attribute
|
145
|
+
raise(ArgumentError, "hidden attribute (#{hidden_attribute}) is not recognised")
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
133
149
|
def extend_string(option, string)
|
134
150
|
((@options[option] ||= "") << " #{string}").strip!
|
135
151
|
end
|
@@ -77,18 +77,18 @@ module GovukPublishingComponents
|
|
77
77
|
if show_sidebar?
|
78
78
|
@sidebar ||= current_step_nav.content.tap do |sb|
|
79
79
|
configure_for_sidebar(sb)
|
80
|
-
sb.merge!(small: true, heading_level: 3, tracking_id: current_step_nav.content_id,
|
80
|
+
sb.merge!(small: true, heading_level: 3, tracking_id: current_step_nav.content_id, disable_ga4: @query_parameters[:disable_ga4])
|
81
81
|
end
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
85
|
-
def header(
|
85
|
+
def header(disable_ga4)
|
86
86
|
if show_header?
|
87
87
|
{
|
88
88
|
title: current_step_nav.title,
|
89
89
|
path: current_step_nav.base_path,
|
90
90
|
tracking_id: current_step_nav.content_id,
|
91
|
-
|
91
|
+
disable_ga4:,
|
92
92
|
}
|
93
93
|
else
|
94
94
|
{}
|
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 3.0.1 - 2024-09-12
|
6
|
+
|
7
|
+
### Fixes
|
8
|
+
|
9
|
+
- [Pull request #727: Add `aria-controls` to aria props](https://github.com/alphagov/accessible-autocomplete/pull/727)
|
10
|
+
- [Pull request #724: Add accessibility controls to 'No results' list item](https://github.com/alphagov/accessible-autocomplete/pull/724)
|
11
|
+
- [Pull request #729: Move `aria-labelledby` into computed menu props](https://github.com/alphagov/accessible-autocomplete/pull/729)
|
12
|
+
|
5
13
|
## 3.0.0 - 2024-04-19
|
6
14
|
|
7
15
|
### Breaking changes
|
@@ -26,7 +26,8 @@ The field with autocomplete must:
|
|
26
26
|
1. Inform the user when there are matches, or if there are no matches
|
27
27
|
1. (Optional) Inform the user how many matches are currently available
|
28
28
|
1. Inform the user as the number of matches changes
|
29
|
-
1. Enable the user to navigate the available matches using touch or keyboard
|
29
|
+
1. Enable the user to navigate the available matches, using just one input method (pointer, mouse, touch or keyboard)
|
30
|
+
1. Enable the user to navigate the available matches, with a single action at a time (no dragging movements or multi-key presses needed)
|
30
31
|
1. Inform the user when a match is selected
|
31
32
|
1. (Optional) Inform the user which number the currently selected match is (1 of 3 for example)
|
32
33
|
1. Inform the user if a match is pre-selected
|