govuk_publishing_components 27.18.0 → 28.1.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/images/govuk_publishing_components/image-card-srcset/cop26-170.jpg +0 -0
- data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-240.jpg +0 -0
- data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-320.jpg +0 -0
- data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-480.jpg +0 -0
- data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26.jpg +0 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js +2 -20
- data/app/assets/javascripts/govuk_publishing_components/analytics/download-link-tracker.js +21 -16
- data/app/assets/javascripts/govuk_publishing_components/analytics/external-link-tracker.js +46 -32
- data/app/assets/javascripts/govuk_publishing_components/analytics/google-analytics-universal-tracker.js +20 -7
- data/app/assets/javascripts/govuk_publishing_components/analytics/mailto-link-tracker.js +22 -17
- data/app/assets/javascripts/govuk_publishing_components/analytics/static-analytics.js +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +18 -18
- data/app/assets/javascripts/govuk_publishing_components/components/metadata.js +27 -0
- data/app/assets/javascripts/govuk_publishing_components/lib/extend-object.js +22 -0
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +19 -14
- data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +6 -35
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +17 -7
- data/app/assets/stylesheets/govuk_publishing_components/components/_signup-link.scss +34 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +7 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +6 -0
- data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +5 -1
- data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_intervention.html.erb +10 -1
- data/app/views/govuk_publishing_components/components/_metadata.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_signup_link.html.erb +30 -0
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_covid_cta.html.erb +27 -0
- data/app/views/govuk_publishing_components/components/docs/accordion.yml +31 -25
- data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +15 -87
- data/app/views/govuk_publishing_components/components/docs/feedback.yml +5 -0
- data/app/views/govuk_publishing_components/components/docs/image_card.yml +29 -0
- data/app/views/govuk_publishing_components/components/docs/input.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/intervention.yml +9 -0
- data/app/views/govuk_publishing_components/components/docs/signup_link.yml +39 -0
- data/app/views/govuk_publishing_components/components/docs/success_alert.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/tabs.yml +2 -2
- data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +9 -6
- data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +4 -3
- data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +4 -4
- data/config/locales/ar.yml +0 -8
- data/config/locales/az.yml +0 -8
- data/config/locales/be.yml +0 -8
- data/config/locales/bg.yml +0 -8
- data/config/locales/bn.yml +0 -8
- data/config/locales/cs.yml +0 -8
- data/config/locales/cy.yml +0 -8
- data/config/locales/da.yml +0 -8
- data/config/locales/de.yml +0 -8
- data/config/locales/dr.yml +0 -8
- data/config/locales/el.yml +0 -8
- data/config/locales/en.yml +4 -10
- data/config/locales/es-419.yml +0 -8
- data/config/locales/es.yml +0 -8
- data/config/locales/et.yml +0 -8
- data/config/locales/fa.yml +0 -8
- data/config/locales/fi.yml +0 -8
- data/config/locales/fr.yml +0 -8
- data/config/locales/gd.yml +0 -8
- data/config/locales/gu.yml +0 -8
- data/config/locales/he.yml +0 -8
- data/config/locales/hi.yml +0 -8
- data/config/locales/hr.yml +0 -8
- data/config/locales/hu.yml +0 -8
- data/config/locales/hy.yml +0 -8
- data/config/locales/id.yml +0 -8
- data/config/locales/is.yml +0 -8
- data/config/locales/it.yml +0 -8
- data/config/locales/ja.yml +0 -8
- data/config/locales/ka.yml +0 -8
- data/config/locales/kk.yml +0 -8
- data/config/locales/ko.yml +0 -8
- data/config/locales/lt.yml +0 -8
- data/config/locales/lv.yml +0 -8
- data/config/locales/ms.yml +0 -8
- data/config/locales/mt.yml +0 -8
- data/config/locales/nl.yml +0 -8
- data/config/locales/no.yml +0 -8
- data/config/locales/pa-pk.yml +0 -8
- data/config/locales/pa.yml +0 -8
- data/config/locales/pl.yml +0 -8
- data/config/locales/ps.yml +0 -8
- data/config/locales/pt.yml +0 -8
- data/config/locales/ro.yml +0 -8
- data/config/locales/ru.yml +0 -8
- data/config/locales/si.yml +0 -8
- data/config/locales/sk.yml +0 -8
- data/config/locales/sl.yml +0 -8
- data/config/locales/so.yml +0 -8
- data/config/locales/sq.yml +0 -8
- data/config/locales/sr.yml +0 -8
- data/config/locales/sv.yml +0 -8
- data/config/locales/sw.yml +0 -8
- data/config/locales/ta.yml +0 -8
- data/config/locales/th.yml +0 -8
- data/config/locales/tk.yml +0 -8
- data/config/locales/tr.yml +0 -8
- data/config/locales/uk.yml +0 -8
- data/config/locales/ur.yml +0 -8
- data/config/locales/uz.yml +0 -8
- data/config/locales/vi.yml +0 -8
- data/config/locales/zh-hk.yml +0 -8
- data/config/locales/zh-tw.yml +0 -8
- data/config/locales/zh.yml +0 -8
- data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +42 -170
- data/lib/govuk_publishing_components/presenters/image_card_helper.rb +11 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/lib/govuk_publishing_components.rb +0 -2
- metadata +13 -15
- data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +0 -237
- data/app/assets/stylesheets/govuk_publishing_components/components/_highlight-boxes.scss +0 -84
- data/app/assets/stylesheets/govuk_publishing_components/components/_taxonomy-list.scss +0 -21
- data/app/views/govuk_publishing_components/components/_admin_analytics.html.erb +0 -20
- data/app/views/govuk_publishing_components/components/_government_navigation.html.erb +0 -86
- data/app/views/govuk_publishing_components/components/_highlight_boxes.html.erb +0 -47
- data/app/views/govuk_publishing_components/components/_taxonomy_list.html.erb +0 -30
- data/app/views/govuk_publishing_components/components/docs/admin_analytics.yml +0 -10
- data/app/views/govuk_publishing_components/components/docs/government_navigation.yml +0 -20
- data/app/views/govuk_publishing_components/components/docs/highlight_boxes.yml +0 -171
- data/app/views/govuk_publishing_components/components/docs/taxonomy_list.yml +0 -112
- data/lib/govuk_publishing_components/presenters/highlight_boxes_helper.rb +0 -13
- data/lib/govuk_publishing_components/presenters/taxonomy_list_helper.rb +0 -23
@@ -45,17 +45,21 @@
|
|
45
45
|
}
|
46
46
|
|
47
47
|
.gem-c-image-card__image-wrapper {
|
48
|
-
@include govuk-grid-column($width: one-
|
48
|
+
@include govuk-grid-column($width: one-half, $at: mobile);
|
49
49
|
}
|
50
50
|
|
51
51
|
.gem-c-image-card__text-wrapper {
|
52
|
-
@include govuk-grid-column($width:
|
52
|
+
@include govuk-grid-column($width: one-half, $at: mobile);
|
53
53
|
}
|
54
54
|
}
|
55
55
|
|
56
56
|
.gem-c-image-card__image {
|
57
57
|
display: block;
|
58
58
|
max-width: 100%;
|
59
|
+
border-top: 1px solid $govuk-border-colour;
|
60
|
+
border-left: none;
|
61
|
+
border-right: none;
|
62
|
+
border-bottom: none;
|
59
63
|
}
|
60
64
|
|
61
65
|
.gem-c-image-card__title {
|
@@ -100,7 +104,13 @@
|
|
100
104
|
|
101
105
|
.gem-c-image-card__context,
|
102
106
|
.gem-c-image-card__metadata {
|
103
|
-
@include govuk-font(
|
107
|
+
@include govuk-font($size: false);
|
108
|
+
font-size: 16px;
|
109
|
+
|
110
|
+
@if $govuk-typography-use-rem {
|
111
|
+
font-size: govuk-px-to-rem(16px);
|
112
|
+
}
|
113
|
+
|
104
114
|
margin: 0 0 (govuk-spacing(3) / 2);
|
105
115
|
color: govuk-colour("dark-grey", $legacy: "grey-1");
|
106
116
|
|
@@ -110,13 +120,13 @@
|
|
110
120
|
}
|
111
121
|
|
112
122
|
.gem-c-image-card__description {
|
113
|
-
@include govuk-font($size:
|
123
|
+
@include govuk-font($size: 19);
|
114
124
|
padding-top: (govuk-spacing(3) / 2);
|
115
125
|
word-wrap: break-word;
|
116
126
|
}
|
117
127
|
|
118
128
|
.gem-c-image-card__list {
|
119
|
-
@include govuk-font($size:
|
129
|
+
@include govuk-font($size: 19);
|
120
130
|
position: relative;
|
121
131
|
z-index: 2;
|
122
132
|
padding: (govuk-spacing(3) / 2) 0 0 0;
|
@@ -160,7 +170,7 @@
|
|
160
170
|
|
161
171
|
.gem-c-image-card--large {
|
162
172
|
.gem-c-image-card__image-wrapper {
|
163
|
-
@include govuk-grid-column($width:
|
173
|
+
@include govuk-grid-column($width: one-half, $at: tablet);
|
164
174
|
|
165
175
|
margin-bottom: govuk-spacing(2);
|
166
176
|
float: none;
|
@@ -175,7 +185,7 @@
|
|
175
185
|
}
|
176
186
|
|
177
187
|
.gem-c-image-card__text-wrapper {
|
178
|
-
@include govuk-grid-column($width: one-
|
188
|
+
@include govuk-grid-column($width: one-half, $at: tablet);
|
179
189
|
|
180
190
|
padding: 0;
|
181
191
|
overflow: hidden;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
.gem-c-signup-link__link {
|
2
|
+
@include govuk-font($size: 19);
|
3
|
+
}
|
4
|
+
|
5
|
+
.gem-c-signup-link__inner {
|
6
|
+
position: relative;
|
7
|
+
}
|
8
|
+
|
9
|
+
.gem-c-signup-link__icon {
|
10
|
+
position: absolute;
|
11
|
+
|
12
|
+
@include govuk-media-query($from: tablet) {
|
13
|
+
top: 2px;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
.gem-c-signup-link__title {
|
18
|
+
margin-bottom: govuk-spacing(2);
|
19
|
+
margin-left: govuk-spacing(5);
|
20
|
+
}
|
21
|
+
|
22
|
+
.gem-c-signup-link--with-background-and-border {
|
23
|
+
padding: govuk-spacing(6);
|
24
|
+
background-color: govuk-colour("light-grey");
|
25
|
+
border: 1px solid $govuk-border-colour;
|
26
|
+
}
|
27
|
+
|
28
|
+
.gem-c-signup-link--link-only .gem-c-signup-link__link {
|
29
|
+
display: inline-block;
|
30
|
+
vertical-align: top;
|
31
|
+
font-weight: bold;
|
32
|
+
margin-left: govuk-spacing(5);
|
33
|
+
margin-bottom: 0;
|
34
|
+
}
|
@@ -24,7 +24,11 @@
|
|
24
24
|
} %>
|
25
25
|
<% end %>
|
26
26
|
|
27
|
-
<% if navigation.show_brexit_cta?
|
27
|
+
<% if navigation.show_brexit_cta? %>
|
28
28
|
<%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta', content_item: content_item %>
|
29
29
|
<% end %>
|
30
|
+
|
31
|
+
<% if navigation.show_covid_booster_cta? %>
|
32
|
+
<%= render 'govuk_publishing_components/components/contextual_sidebar/covid_cta', content_item: content_item %>
|
33
|
+
<% end %>
|
30
34
|
</div>
|
@@ -3,8 +3,10 @@
|
|
3
3
|
suggestion_link_text ||= false
|
4
4
|
suggestion_link_url ||= false
|
5
5
|
suggestion_text ||= nil
|
6
|
+
hide ||= false
|
6
7
|
new_tab ||= false
|
7
8
|
|
9
|
+
|
8
10
|
data_attributes ||= {}
|
9
11
|
data_attributes[:module] = 'intervention'
|
10
12
|
suggestion_data_attributes ||= {}
|
@@ -34,9 +36,16 @@
|
|
34
36
|
|
35
37
|
suggestion_link_text = intervention_helper.accessible_text
|
36
38
|
end
|
39
|
+
|
40
|
+
section_options = {
|
41
|
+
class: "gem-c-intervention",
|
42
|
+
role: "region", aria: aria_attributes,
|
43
|
+
data: data_attributes,
|
44
|
+
}
|
45
|
+
section_options.merge!({ hidden: true }) if hide
|
37
46
|
%>
|
38
47
|
<% if suggestion_text || (suggestion_link_text && suggestion_link_url) %>
|
39
|
-
<%= tag.section
|
48
|
+
<%= tag.section section_options do %>
|
40
49
|
<p class="govuk-body">
|
41
50
|
<%= tag.span suggestion_text, class: "gem-c-intervention__textwrapper" if suggestion_text %>
|
42
51
|
<% if suggestion_link_text && suggestion_link_url %>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
classes << "gem-c-metadata--inverse" if inverse
|
18
18
|
classes << shared_helper.get_margin_bottom if local_assigns[:margin_bottom]
|
19
19
|
%>
|
20
|
-
<%= content_tag :div, class: classes, data: { module: "gem-toggle" } do %>
|
20
|
+
<%= content_tag :div, class: classes, data: { module: "gem-toggle metadata" } do %>
|
21
21
|
<dl data-module="gem-track-click">
|
22
22
|
<% if from.any? %>
|
23
23
|
<dt class="gem-c-metadata__term"><%= t("components.metadata.from") %>:</dt>
|
@@ -44,7 +44,7 @@
|
|
44
44
|
<dd class="gem-c-metadata__definition">
|
45
45
|
<%= last_updated %>
|
46
46
|
<% if local_assigns.include?(:see_updates_link) %>
|
47
|
-
— <a href="#history" class="gem-c-metadata__definition-link govuk-!-display-none-print"
|
47
|
+
— <a href="#history" class="gem-c-metadata__definition-link govuk-!-display-none-print js-see-all-updates-link"
|
48
48
|
data-track-category="content-history"
|
49
49
|
data-track-action="see-all-updates-link-clicked"
|
50
50
|
data-track-label="history">
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<%
|
2
|
+
local_assigns[:heading_level] ||= 3
|
3
|
+
local_assigns[:margin_bottom] ||= 0
|
4
|
+
link_text ||= false
|
5
|
+
link_href ||= false
|
6
|
+
heading ||= false
|
7
|
+
background ||= false
|
8
|
+
data ||= false
|
9
|
+
|
10
|
+
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
11
|
+
|
12
|
+
classes = %w(gem-c-signup-link govuk-!-display-none-print)
|
13
|
+
classes << shared_helper.get_margin_bottom
|
14
|
+
classes << "gem-c-signup-link--link-only" unless heading
|
15
|
+
classes << "gem-c-signup-link--with-background-and-border" if background
|
16
|
+
%>
|
17
|
+
<% if link_text && link_href %>
|
18
|
+
<div class="<%= classes.join(' ') %>">
|
19
|
+
<div class="gem-c-signup-link__inner govuk-width-container">
|
20
|
+
<svg class="gem-c-signup-link__icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 459.334 459.334">
|
21
|
+
<path fill="black" d="M177.216 404.514c-.001.12-.009.239-.009.359 0 30.078 24.383 54.461 54.461 54.461s54.461-24.383 54.461-54.461c0-.12-.008-.239-.009-.359H175.216zM403.549 336.438l-49.015-72.002v-89.83c0-60.581-43.144-111.079-100.381-122.459V24.485C254.152 10.963 243.19 0 229.667 0s-24.485 10.963-24.485 24.485v27.663c-57.237 11.381-100.381 61.879-100.381 122.459v89.83l-49.015 72.002a24.76 24.76 0 0 0 20.468 38.693H383.08a24.761 24.761 0 0 0 20.469-38.694z"/>
|
22
|
+
</svg>
|
23
|
+
<%= content_tag(shared_helper.get_heading_level, heading, class: "govuk-heading-s gem-c-signup-link__title") if heading %>
|
24
|
+
<%= link_to( link_text, link_href, {
|
25
|
+
class: "govuk-link gem-c-signup-link__link",
|
26
|
+
data: data
|
27
|
+
}) %>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
<% end %>
|
data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb
CHANGED
@@ -15,9 +15,9 @@
|
|
15
15
|
"track-dimension-index": "29",
|
16
16
|
} %>
|
17
17
|
|
18
|
-
<%= tag.div class: "gem-c-contextual-
|
19
|
-
<%= tag.h2 title, class: "gem-c-contextual-
|
20
|
-
<%= tag.p class: "gem-c-contextual-
|
18
|
+
<%= tag.div class: "gem-c-contextual-sidebar__cta gem-c-contextual-sidebar__cta--brexit" do %>
|
19
|
+
<%= tag.h2 title, class: "gem-c-contextual-sidebar__heading govuk-heading-s" %>
|
20
|
+
<%= tag.p class: "gem-c-contextual-sidebar__text govuk-body" do %>
|
21
21
|
<%= link_to link_text,
|
22
22
|
link_path,
|
23
23
|
class: "govuk-link",
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<% shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns) %>
|
2
|
+
<%
|
3
|
+
title = t("components.related_navigation.covid_booster.title")
|
4
|
+
link_text = t("components.related_navigation.covid_booster.link_text")
|
5
|
+
link_path = t("components.related_navigation.covid_booster.link_path")
|
6
|
+
lang = shared_helper.t_locale("components.related_navigation.covid_booster.title")
|
7
|
+
%>
|
8
|
+
|
9
|
+
<% data_attributes = {
|
10
|
+
"module": "gem-track-click",
|
11
|
+
"track-category": "relatedLinkClicked",
|
12
|
+
"track-action": "1.0 Coronavirus",
|
13
|
+
"track-label": link_path,
|
14
|
+
"track-dimension": link_text,
|
15
|
+
"track-dimension-index": "29",
|
16
|
+
} %>
|
17
|
+
|
18
|
+
<%= tag.div class: "gem-c-contextual-sidebar__cta gem-c-contextual-sidebar__cta--covid" do %>
|
19
|
+
<%= tag.h2 title, class: "gem-c-contextual-sidebar__heading govuk-heading-s" %>
|
20
|
+
<%= tag.p class: "gem-c-contextual-sidebar__text govuk-body" do %>
|
21
|
+
<%= link_to link_text,
|
22
|
+
link_path,
|
23
|
+
class: "govuk-link",
|
24
|
+
data: data_attributes,
|
25
|
+
lang: lang %>
|
26
|
+
<% end %>
|
27
|
+
<% end %>
|
@@ -3,33 +3,34 @@ description: The accordion component lets users show and hide sections of relate
|
|
3
3
|
govuk_frontend_components:
|
4
4
|
- accordion
|
5
5
|
body: |
|
6
|
-
This component is based on the [
|
7
|
-
and is currently experimental because more research is needed to validate it. If using this component, [please feed back any research findings to the Design System team](https://design-system.service.gov.uk/
|
6
|
+
This component is based on the [GOV.UK Design System accordion component](https://design-system.service.gov.uk/components/accordion/)
|
7
|
+
and is currently experimental because more research is needed to validate it. If using this component, [please feed back any research findings to the Design System team](https://design-system.service.gov.uk/get-in-touch/).
|
8
8
|
|
9
9
|
accessibility_criteria: |
|
10
10
|
The accordion must:
|
11
11
|
|
12
12
|
* accept focus
|
13
13
|
* be usable with a keyboard
|
14
|
-
* the controls
|
15
|
-
* the controls
|
14
|
+
* allow the controls to change in appearance when keyboard focus moves to it
|
15
|
+
* allow the controls to indicate when users hover their cursor over it
|
16
16
|
* be usable with touch
|
17
17
|
* be usable with voice commands
|
18
18
|
* have visible text
|
19
19
|
* indicate to users that each section can be expanded and collapsed
|
20
|
-
*
|
20
|
+
* tell the user when a step has been expanded or collapsed
|
21
21
|
* be readable when only the [text of the page is zoomed in](https://support.mozilla.org/en-US/kb/font-size-and-zoom-increase-size-of-web-pages#w_how-to-only-change-the-size-of-the-text)
|
22
|
-
* zoom in up to 300% without the text spilling off the screen
|
23
|
-
* pass colour contrast
|
24
|
-
*
|
25
|
-
*
|
22
|
+
* zoom in up to 300% [without the text spilling off the screen](https://www.w3.org/WAI/WCAG21/Understanding/reflow.html)
|
23
|
+
* pass [colour contrast](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html)
|
24
|
+
* be readable should a [user change colours](https://support.mozilla.org/en-US/kb/change-fonts-and-colors-websites-use)
|
25
|
+
* associate panel content with the control that opens it using the `aria-controls` attribute
|
26
|
+
* have `aria-label` / `aria-labelledby` on section content with a value that refers to the button that controls display of the content
|
26
27
|
|
27
|
-
Section headings must use a button element:
|
28
|
+
Section headings must use a button element so that users:
|
28
29
|
|
29
|
-
*
|
30
|
-
*
|
30
|
+
* can toggle sections with the space and enter keys
|
31
|
+
* cannot open sections in a new tab or window
|
31
32
|
|
32
|
-
When JavaScript is unavailable the component must:
|
33
|
+
When CSS and / or JavaScript is unavailable, the component must:
|
33
34
|
|
34
35
|
* be fully expanded
|
35
36
|
* not be marked as expandable
|
@@ -57,9 +58,9 @@ examples:
|
|
57
58
|
html: <p class="govuk-body">This is the content for How people read.</p>
|
58
59
|
with_supplied_identification:
|
59
60
|
description: |
|
60
|
-
An `id` is optional as it's automatically generated, but it can be supplied if a specific `id` is required.
|
61
|
+
An `id` for an individual accordion is optional as it's automatically generated, but it can be supplied if a specific `id` is required.
|
61
62
|
|
62
|
-
The `id` must be
|
63
|
+
The `id` must be unique across the domain of your service. This is because the open or closed state of individual instances of the accordion uses `localStorage` to persist across page loads.
|
63
64
|
|
64
65
|
Used as an `id` in the HTML for the accordion as a whole, and also as a prefix for the `id`s of the section contents and the buttons that open them, so that those `id`s can be the target of `aria-labelledby` and `aria-control` attributes.
|
65
66
|
data:
|
@@ -182,11 +183,11 @@ examples:
|
|
182
183
|
</ul>'
|
183
184
|
with_data_attributes:
|
184
185
|
description: |
|
185
|
-
Adds custom data attributes to
|
186
|
+
Adds custom data attributes to each section of the accordion. Accepts a hash, so multiple attributes can be added.
|
186
187
|
|
187
188
|
The `data_attributes` hash is for the outermost element in the accordion.
|
188
189
|
|
189
|
-
Each item can also have a `data_attributes` hash.
|
190
|
+
Each item can also have a `data_attributes` hash. These `data_attributes` are placed on the `button` that triggers the opening and closing - useful for differentiating between each section of the accordion.
|
190
191
|
|
191
192
|
data:
|
192
193
|
data_attributes:
|
@@ -240,7 +241,7 @@ examples:
|
|
240
241
|
html: <p class="govuk-body">This is the content for How people read.</p>
|
241
242
|
with_margin_bottom:
|
242
243
|
description: |
|
243
|
-
The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having a margin bottom of 30px
|
244
|
+
The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having a margin bottom of `30px`.
|
244
245
|
data:
|
245
246
|
margin_bottom: 0
|
246
247
|
items:
|
@@ -254,7 +255,7 @@ examples:
|
|
254
255
|
html: <p class="govuk-body">This is the content for Writing well for specialists.</p>
|
255
256
|
with_section_open:
|
256
257
|
description: |
|
257
|
-
Adding `expanded: true` to the item will mean the section
|
258
|
+
Adding `expanded: true` to the item will mean the section defaults to being open, rather than closed. Once a user opens or closes a section, the state of each section is remembered.
|
258
259
|
data:
|
259
260
|
items:
|
260
261
|
- heading:
|
@@ -276,13 +277,18 @@ examples:
|
|
276
277
|
html: <p class="govuk-body">This is the content for How people read.</p>
|
277
278
|
with_the_anchor_link_navigation:
|
278
279
|
description: |
|
279
|
-
Some apps require custom
|
280
|
+
Some apps require custom `id`s per accordion section heading. Custom `id`s allow you to link section headings, sometimes across multiple pages.
|
281
|
+
|
282
|
+
For example on [guidance pages for Content Designers, referred to as "manuals",](https://www.gov.uk/guidance/how-to-publish-on-gov-uk/creating-and-updating-pages#associations) each manual includes multiple sets of accordions and will reference between specific sections to easily access content.
|
280
283
|
|
281
|
-
|
284
|
+
Using the same rules, custom `id`s automatically open accordions when users click within another accordion that links to either
|
282
285
|
|
283
|
-
|
286
|
+
* the `id` of an accordion section heading
|
287
|
+
* an `id` within the content of an accordion (this will also automatically navigate to and open accordions on page load)
|
284
288
|
|
285
|
-
|
289
|
+
This feature will only be used if the `anchor_navigation` flag is passed as `true`. This mitigates performance risk from event listeners on a large number of links.
|
290
|
+
|
291
|
+
Unlike with the accordion-wide custom `id` attribute, any `id`s passed to accordion headings as part of this are not stored in `localStorage`. `id`s do not need to be unique across your domain, but should still be unique in the context of the page.
|
286
292
|
data:
|
287
293
|
anchor_navigation: true
|
288
294
|
items:
|
@@ -305,7 +311,7 @@ examples:
|
|
305
311
|
html: <p class="govuk-body">This is the content for How people read.</p>
|
306
312
|
condensed_layout:
|
307
313
|
description: |
|
308
|
-
This is for when a smaller accordion is required. Since smaller screens trigger a single column layout, this modifier only makes the accordion smaller when viewed on large screens.
|
314
|
+
This layout is for when a smaller accordion is required. Since smaller screens trigger a single column layout, this modifier only makes the accordion smaller when viewed on large screens.
|
309
315
|
data:
|
310
316
|
condensed: true
|
311
317
|
items:
|
@@ -397,4 +403,4 @@ examples:
|
|
397
403
|
<li>
|
398
404
|
<a class="govuk-link govuk-body-s" href="#">Retiring your service</a>
|
399
405
|
</li>
|
400
|
-
</ul>'
|
406
|
+
</ul>'
|
@@ -11,6 +11,8 @@ body: |
|
|
11
11
|
|
12
12
|
It must always be used [with the contextual breadcrumbs component][contextual_breadcrumbs].
|
13
13
|
|
14
|
+
The COVID CTA will displayed on all pages except for a few exemptions documented below.
|
15
|
+
|
14
16
|
[preview]: /contextual-navigation
|
15
17
|
[step-by-step]: /component-guide/step_by_step_nav
|
16
18
|
[related_navigation]: /component-guide/related_navigation
|
@@ -86,69 +88,6 @@ examples:
|
|
86
88
|
- text: The Highway Code
|
87
89
|
href: "/guidance/the-highway-code"
|
88
90
|
optional: false
|
89
|
-
with_brexit_and_other_related_links:
|
90
|
-
data:
|
91
|
-
content_item:
|
92
|
-
title: "A content item"
|
93
|
-
links:
|
94
|
-
taxons:
|
95
|
-
- content_id: "test"
|
96
|
-
title: "Not Brexit"
|
97
|
-
phase: "live"
|
98
|
-
links:
|
99
|
-
parent_taxons:
|
100
|
-
- content_id: "d6c2de5d-ef90-45d1-82d4-5f2438369eea"
|
101
|
-
title: "Brexit"
|
102
|
-
ordered_related_items:
|
103
|
-
- title: Find an apprenticeship
|
104
|
-
base_path: /apply-apprenticeship
|
105
|
-
- title: Training and study at work
|
106
|
-
base_path: /training-study-work-your-rights
|
107
|
-
- title: Careers helpline for teenagers
|
108
|
-
base_path: /careers-helpline-for-teenagers
|
109
|
-
document_collections:
|
110
|
-
- title: Recruit an apprentice (formerly apprenticeship vacancies)
|
111
|
-
base_path: /government/collections/apprenticeship-vacancies
|
112
|
-
document_type: document_collection
|
113
|
-
- title: The future of jobs and skills
|
114
|
-
base_path: /government/collections/the-future-of-jobs-and-skills
|
115
|
-
document_type: document_collection
|
116
|
-
with_brexit_related_links_and_step_by_steps:
|
117
|
-
data:
|
118
|
-
content_item:
|
119
|
-
title: "A content item"
|
120
|
-
links:
|
121
|
-
taxons:
|
122
|
-
- content_id: "d6c2de5d-ef90-45d1-82d4-5f2438369eea"
|
123
|
-
title: "Brexit"
|
124
|
-
phase: "live"
|
125
|
-
part_of_step_navs:
|
126
|
-
- title: "Choosing a micropig or micropug: step by step"
|
127
|
-
base_path: "/micropigs-vs-micropugs"
|
128
|
-
details:
|
129
|
-
step_by_step_nav:
|
130
|
-
title: 'Stay in the UK after it leaves the EU (''settled status''): step by step'
|
131
|
-
steps:
|
132
|
-
- title: Check if you need to apply to the EU Settlement Scheme
|
133
|
-
contents:
|
134
|
-
- type: paragraph
|
135
|
-
text: 'You may need to apply to the EU Settlement Scheme to continue living
|
136
|
-
in the UK. '
|
137
|
-
- type: list
|
138
|
-
contents:
|
139
|
-
- text: Check if you need to apply
|
140
|
-
href: "/settled-status-eu-citizens-families/eligibility"
|
141
|
-
optional: false
|
142
|
-
- title: Find out what status you’ll get
|
143
|
-
contents:
|
144
|
-
- type: paragraph
|
145
|
-
text: You’ll get settled or pre-settled status depending on how long you’ve
|
146
|
-
been living in the UK. This might affect when you choose to apply.
|
147
|
-
- type: list
|
148
|
-
contents:
|
149
|
-
- text: Find out what you’ll get
|
150
|
-
href: "/settled-status-eu-citizens-families/what-settled-and-presettled-status-means"
|
151
|
-
optional: false
|
152
91
|
with_brexit_cta:
|
153
92
|
description: For documents tagged with certain taxons defined in `brexit_cta_taxon_allow_list` we show a custom Brexit call to action element.
|
154
93
|
data:
|
@@ -172,17 +111,19 @@ examples:
|
|
172
111
|
base_path: /government/collections/the-future-of-jobs-and-skills
|
173
112
|
document_type: document_collection
|
174
113
|
taxons:
|
175
|
-
- content_id: "
|
176
|
-
title: "
|
114
|
+
- content_id: "2f8b848d-23c8-4f42-a41a-df1f81c64d0f"
|
115
|
+
title: "Exporting"
|
177
116
|
phase: "live"
|
178
|
-
|
179
|
-
description:
|
117
|
+
with_covid_cta_taxon_exception:
|
118
|
+
description: The COVID Booster call to action element is not displayed on content tagged to taxons in `covid_booster_cta_taxon_exception_list`.
|
180
119
|
data:
|
181
120
|
content_item:
|
182
|
-
title: "
|
183
|
-
content_id: "c3752802-f091-43a9-ba90-33568fccf391"
|
184
|
-
locale: "en"
|
121
|
+
title: "A content item"
|
185
122
|
links:
|
123
|
+
taxons:
|
124
|
+
- content_id: ac7b8472-5d09-4679-9551-87847b0ac827
|
125
|
+
title: "Not Covid"
|
126
|
+
phase: "live"
|
186
127
|
ordered_related_items:
|
187
128
|
- title: Find an apprenticeship
|
188
129
|
base_path: /apply-apprenticeship
|
@@ -197,17 +138,12 @@ examples:
|
|
197
138
|
- title: The future of jobs and skills
|
198
139
|
base_path: /government/collections/the-future-of-jobs-and-skills
|
199
140
|
document_type: document_collection
|
200
|
-
|
201
|
-
|
202
|
-
title: "Society and culture"
|
203
|
-
phase: "live"
|
204
|
-
with_brexit_cta_taxon_exception:
|
205
|
-
description: Illustrates an exception to showing the custom Brexit call to action element as defined in `brexit_cta_taxon_exception_list`.
|
141
|
+
with_covid_cta_document_type_exception:
|
142
|
+
description: Illustrates an exception to showing the custom COVID Booster call to action element as defined in `covid_booster_cta_document_type_exceptions`.
|
206
143
|
data:
|
207
144
|
content_item:
|
208
|
-
title: "
|
209
|
-
|
210
|
-
locale: "en"
|
145
|
+
title: "A content item"
|
146
|
+
document_type: smart_answer
|
211
147
|
links:
|
212
148
|
ordered_related_items:
|
213
149
|
- title: Find an apprenticeship
|
@@ -223,11 +159,3 @@ examples:
|
|
223
159
|
- title: The future of jobs and skills
|
224
160
|
base_path: /government/collections/the-future-of-jobs-and-skills
|
225
161
|
document_type: document_collection
|
226
|
-
taxons:
|
227
|
-
- content_id: "3b4d6319-fcef-4637-b35a-e3df76321894"
|
228
|
-
title: "Local transport"
|
229
|
-
phase: "live"
|
230
|
-
links:
|
231
|
-
parent_taxons:
|
232
|
-
- content_id: "a4038b29-b332-4f13-98b1-1c9709e216bc"
|
233
|
-
title: "Transport"
|
@@ -5,6 +5,11 @@ body: |
|
|
5
5
|
|
6
6
|
This component uses JavaScript for expanding and collapsing and also for submitting form responses. This code is not compatible with Internet Explorer, so IE11 and down do not use JavaScript to submit the forms, instead falling back to a normal form submission.
|
7
7
|
accessibility_criteria: |
|
8
|
+
The form must:
|
9
|
+
|
10
|
+
* be functional and accessible with JavaScript disabled
|
11
|
+
* be usable and accessible with stylesheets disabled
|
12
|
+
|
8
13
|
Form elements in the component must:
|
9
14
|
|
10
15
|
* accept focus
|
@@ -253,3 +253,32 @@ examples:
|
|
253
253
|
image_alt: "some meaningful alt text please"
|
254
254
|
heading_text: Yr hyn rydym ni'n ei wneud
|
255
255
|
lang: cy
|
256
|
+
with_sizes_attribute:
|
257
|
+
description: |
|
258
|
+
`sizes` is an attribute that makes use of html's native responsive images functionality.
|
259
|
+
|
260
|
+
[Read more about responsive images](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images)
|
261
|
+
data:
|
262
|
+
href: "/not-a-page"
|
263
|
+
image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
|
264
|
+
image_alt: "some meaningful alt text please"
|
265
|
+
heading_text: "News headline"
|
266
|
+
sizes: "(max-width: 640px) 100vw, (max-width: 1020px) 33vw, 300px"
|
267
|
+
with_srcset:
|
268
|
+
description: |
|
269
|
+
`srcset` is another responsive images attribute (see `sizes` section above for info on how responsive images work).
|
270
|
+
|
271
|
+
`srcset` strings typically pull from the `asset/images` directory of a repo so use this as a starting point when writing paths for your `srcset` image keys.
|
272
|
+
|
273
|
+
Note that the below example will appear to render incorrectly as we don't want to include `srcset` example images in our component guide as this will get served to frontend apps, adding weight to the user to download.
|
274
|
+
data:
|
275
|
+
href: "/not-a-page"
|
276
|
+
image_src: "/assets/govuk_publishing_components/image-card-srcset/afghan-image-promo.jpg"
|
277
|
+
image_alt: "some meaningful alt text please"
|
278
|
+
heading_text: "News headline"
|
279
|
+
srcset:
|
280
|
+
/assets/govuk_publishing_components/image-card-srcset/cop26.jpg: 610w
|
281
|
+
/assets/govuk_publishing_components/image-card-srcset/cop26-480.jpg: 480w
|
282
|
+
/assets/govuk_publishing_components/image-card-srcset/cop26-320.jpg: 320w
|
283
|
+
/assets/govuk_publishing_components/image-card-srcset/cop26-240.jpg: 240w
|
284
|
+
/assets/govuk_publishing_components/image-card-srcset/cop26-170.jpg: 170w
|
@@ -31,7 +31,7 @@ examples:
|
|
31
31
|
name: "address"
|
32
32
|
type: "email"
|
33
33
|
numeric_input:
|
34
|
-
description: If input is set to `type="number"` we set the component up as described in the [Design System guidance](https://design-system.service.gov.uk/components/text-input/#numbers) adding `inputmode` and `pattern`. These values can be overridden if necessary.
|
34
|
+
description: If input is set to `type="number"` we set the component up as described in the [GOV.UK Design System guidance](https://design-system.service.gov.uk/components/text-input/#numbers) adding `inputmode` and `pattern`. These values can be overridden if necessary.
|
35
35
|
data:
|
36
36
|
label:
|
37
37
|
text: "Account number"
|
@@ -38,6 +38,15 @@ examples:
|
|
38
38
|
suggestion_link_text: "You can now apply for a permit online."
|
39
39
|
suggestion_link_url: "/permit"
|
40
40
|
|
41
|
+
with_hide:
|
42
|
+
description: |
|
43
|
+
This example is for when we want to hide by default and display to the user based on some logic,
|
44
|
+
either in the backend or with Javascript.
|
45
|
+
data:
|
46
|
+
suggestion_link_text: "You may be invited to fill in a questionnaire"
|
47
|
+
suggestion_link_url: "/questionnaire"
|
48
|
+
hide: true
|
49
|
+
|
41
50
|
open_suggestion_link_in_new_tab:
|
42
51
|
description: |
|
43
52
|
When sending users to another online task, you don't want to completely hijack
|