govuk_publishing_components 23.13.0 → 24.1.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/images/govuk_publishing_components/take-action-amber.svg +4 -0
- data/app/assets/images/govuk_publishing_components/take-action-green.svg +4 -0
- data/app/assets/images/govuk_publishing_components/take-action-red.svg +4 -0
- data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +286 -4
- data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +0 -4
- data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +44 -39
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills/common.js +8 -0
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/component_support.scss +0 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +302 -14
- data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +34 -17
- data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +14 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +4 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +35 -44
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +112 -47
- data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +8 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +0 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_accordion.scss +16 -9
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss +2 -2
- data/app/models/govuk_publishing_components/component_doc.rb +1 -1
- data/app/views/govuk_publishing_components/audit/show.html.erb +26 -26
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +13 -20
- data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +2 -8
- data/app/views/govuk_publishing_components/components/_document_list.html.erb +12 -2
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +9 -4
- data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +21 -0
- data/app/views/govuk_publishing_components/components/docs/accordion.yml +8 -3
- data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +65 -1
- data/app/views/govuk_publishing_components/components/docs/document_list.yml +50 -7
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +3 -3
- data/app/views/govuk_publishing_components/components/docs/layout_header.yml +11 -0
- data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +9 -4
- data/config/initializers/assets.rb +3 -1
- data/config/locales/cy.yml +6 -1
- data/config/locales/en.yml +8 -3
- data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +183 -2
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/govuk/all.js +58 -1
- data/node_modules/govuk-frontend/govuk/components/_all.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +25 -10
- data/node_modules/govuk-frontend/govuk/components/back-link/fixtures.json +12 -6
- data/node_modules/govuk-frontend/govuk/components/back-link/macro-options.json +4 -4
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +34 -13
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/macro-options.json +1 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/template.njk +2 -2
- data/node_modules/govuk-frontend/govuk/components/button/_index.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +74 -31
- data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +1 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +1 -1
- data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +85 -15
- data/node_modules/govuk-frontend/govuk/components/character-count/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +145 -52
- data/node_modules/govuk-frontend/govuk/components/checkboxes/macro-options.json +2 -2
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/_cookie-banner.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/_index.scss +51 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +425 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro-options.json +132 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/template.njk +63 -0
- data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +84 -34
- data/node_modules/govuk-frontend/govuk/components/date-input/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/date-input/template.njk +1 -1
- data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +35 -15
- data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +21 -10
- data/node_modules/govuk-frontend/govuk/components/error-message/macro-options.json +1 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/_index.scss +2 -12
- data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +86 -25
- data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +20 -10
- data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +60 -13
- data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +37 -18
- data/node_modules/govuk-frontend/govuk/components/footer/macro-options.json +8 -5
- data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +36 -18
- data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +2 -2
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +4 -4
- data/node_modules/govuk-frontend/govuk/components/hint/fixtures.json +17 -8
- data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +130 -40
- data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/inset-text/fixtures.json +17 -8
- data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +20 -11
- data/node_modules/govuk-frontend/govuk/components/label/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/notification-banner/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/_index.scss +89 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/_notification-banner.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/fixtures.json +212 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/macro-options.json +68 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +61 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/template.njk +47 -0
- data/node_modules/govuk-frontend/govuk/components/panel/fixtures.json +30 -13
- data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +20 -9
- data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +167 -50
- data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +97 -18
- data/node_modules/govuk-frontend/govuk/components/select/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +21 -9
- data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +118 -25
- data/node_modules/govuk-frontend/govuk/components/table/_index.scss +21 -0
- data/node_modules/govuk-frontend/govuk/components/table/fixtures.json +92 -22
- data/node_modules/govuk-frontend/govuk/components/table/macro-options.json +2 -2
- data/node_modules/govuk-frontend/govuk/components/tabs/fixtures.json +75 -18
- data/node_modules/govuk-frontend/govuk/components/tabs/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +28 -14
- data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +68 -17
- data/node_modules/govuk-frontend/govuk/components/warning-text/fixtures.json +19 -14
- data/node_modules/govuk-frontend/govuk/helpers/_links.scss +94 -0
- data/node_modules/govuk-frontend/govuk/objects/_all.scss +1 -0
- data/node_modules/govuk-frontend/govuk/objects/_button-group.scss +94 -0
- data/node_modules/govuk-frontend/govuk/settings/_colours-applied.scss +9 -0
- data/node_modules/govuk-frontend/govuk/settings/_typography-font.scss +3 -0
- data/node_modules/govuk-frontend/package.json +1 -1
- metadata +21 -18
- data/app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small-focus.svg +0 -4
- data/app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small.svg +0 -4
- data/app/assets/javascripts/govuk_publishing_components/components/header.js +0 -8
- data/app/assets/javascripts/govuk_publishing_components/lib/auto-track-event.js +0 -31
- data/app/assets/stylesheets/govuk_publishing_components/components/_chevron-banner.scss +0 -138
- data/app/assets/stylesheets/govuk_publishing_components/components/_list.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_variables.scss +0 -27
- data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_back-arrow.scss +0 -13
- data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_clearfix.scss +0 -8
- data/app/views/govuk_publishing_components/components/_chevron_banner.html.erb +0 -19
- data/app/views/govuk_publishing_components/components/_subscription-links.html.erb +0 -85
- data/app/views/govuk_publishing_components/components/_translation-nav.html.erb +0 -33
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_related_links.html.erb +0 -6
- data/app/views/govuk_publishing_components/components/docs/chevron_banner.yml +0 -33
- data/app/views/govuk_publishing_components/components/docs/subscription-links.yml +0 -103
- data/app/views/govuk_publishing_components/components/docs/translation-nav.yml +0 -139
|
@@ -5,27 +5,34 @@
|
|
|
5
5
|
@import "../accordion";
|
|
6
6
|
|
|
7
7
|
// Open all of the accordion sections.
|
|
8
|
-
.
|
|
8
|
+
.gem-c-accordion__section-content {
|
|
9
9
|
display: block !important; // stylelint-disable-line declaration-no-important
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
// Change the colour from the blue link colour to black.
|
|
13
|
-
.
|
|
13
|
+
.gem-c-accordion__section-button {
|
|
14
14
|
color: govuk-colour("black") !important; // stylelint-disable-line declaration-no-important
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
// Removing spacing
|
|
18
|
+
.gem-c-accordion__section-header {
|
|
19
|
+
padding-bottom: govuk-spacing(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
17
22
|
// Change the summary subheading size.
|
|
18
|
-
.
|
|
23
|
+
.gem-c-accordion__section-summary {
|
|
19
24
|
@include govuk-typography-common;
|
|
20
25
|
@include govuk-typography-responsive($size: 16, $important: true);
|
|
26
|
+
}
|
|
21
27
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
// Hide the unusable "Show all sections" button and the "Chevron" icons.
|
|
29
|
+
.gem-c-accordion__open-all,
|
|
30
|
+
.gem-c-accordion__icon,
|
|
31
|
+
.gem-c-accordion__toggle-link {
|
|
32
|
+
display: none !important; // stylelint-disable-line declaration-no-important
|
|
25
33
|
}
|
|
26
34
|
|
|
27
|
-
// Hide
|
|
28
|
-
.govuk-
|
|
29
|
-
.govuk-accordion__icon {
|
|
35
|
+
// Hide all hidden content
|
|
36
|
+
.gem-c-accordion .govuk-visually-hidden {
|
|
30
37
|
display: none !important; // stylelint-disable-line declaration-no-important
|
|
31
38
|
}
|
data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
$grey-2: #bfc1c3;
|
|
2
2
|
$white: #ffffff;
|
|
3
3
|
$number-circle-size: 35px;
|
|
4
|
-
$stroke-width:
|
|
4
|
+
$stroke-width: 1px;
|
|
5
5
|
|
|
6
6
|
.gem-c-step-nav:not(.gem-c-step-nav--large),
|
|
7
7
|
.gem-c-step-nav__controls,
|
|
@@ -63,7 +63,7 @@ $stroke-width: 3px;
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
.gem-c-step-nav__circle--number {
|
|
66
|
-
border: solid
|
|
66
|
+
border: solid 1px $grey-2;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
.gem-c-step-nav__step,
|
|
@@ -69,7 +69,7 @@ module GovukPublishingComponents
|
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
def github_search_url
|
|
72
|
-
params = { q: "org:alphagov
|
|
72
|
+
params = { q: "org:alphagov components/components/#{id}", type: "Code" }
|
|
73
73
|
"https://github.com/search?#{params.to_query}"
|
|
74
74
|
end
|
|
75
75
|
|
|
@@ -39,16 +39,16 @@
|
|
|
39
39
|
</div>
|
|
40
40
|
</details>
|
|
41
41
|
|
|
42
|
-
<div class="
|
|
42
|
+
<div class="gem-c-accordion" data-module="gem-c-accordion" id="accordion-with-summary-sections">
|
|
43
43
|
<% @applications.each_with_index do |application, index| %>
|
|
44
|
-
<div class="
|
|
45
|
-
<div class="
|
|
46
|
-
<h2 class="
|
|
47
|
-
<span class="
|
|
44
|
+
<div class="gem-c-accordion__section ">
|
|
45
|
+
<div class="gem-c-accordion__section-header">
|
|
46
|
+
<h2 class="gem-c-accordion__section-heading">
|
|
47
|
+
<span class="gem-c-accordion__section-button" id="accordion-with-summary-sections-heading-<%= index %>">
|
|
48
48
|
<%= application[:name] %>
|
|
49
49
|
</span>
|
|
50
50
|
</h2>
|
|
51
|
-
<div class="
|
|
51
|
+
<div class="gem-c-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-<%= index %>">
|
|
52
52
|
<% if application[:application_found] %>
|
|
53
53
|
Warnings:
|
|
54
54
|
<% if application[:warning_count] > 0 %>
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
<% end %>
|
|
62
62
|
</div>
|
|
63
63
|
</div>
|
|
64
|
-
<div id="accordion-with-summary-sections-content-<%= index %>" class="
|
|
64
|
+
<div id="accordion-with-summary-sections-content-<%= index %>" class="gem-c-accordion__section-content" aria-labelledby="accordion-with-summary-sections-heading-<%= index %>">
|
|
65
65
|
<% if application[:application_found] %>
|
|
66
66
|
<% application[:warnings].each do |warning| %>
|
|
67
67
|
<p class="govuk-body">
|
|
@@ -144,19 +144,19 @@
|
|
|
144
144
|
} %>
|
|
145
145
|
|
|
146
146
|
<% if @components.any? %>
|
|
147
|
-
<div class="
|
|
148
|
-
<div class="
|
|
149
|
-
<div class="
|
|
150
|
-
<h2 class="
|
|
151
|
-
<span class="
|
|
147
|
+
<div class="gem-c-accordion" data-module="gem-c-accordion" id="accordion-default">
|
|
148
|
+
<div class="gem-c-accordion__section ">
|
|
149
|
+
<div class="gem-c-accordion__section-header">
|
|
150
|
+
<h2 class="gem-c-accordion__section-heading">
|
|
151
|
+
<span class="gem-c-accordion__section-button" id="accordion-default-heading-1">
|
|
152
152
|
Component files
|
|
153
153
|
</span>
|
|
154
154
|
</h2>
|
|
155
|
-
<div class="
|
|
155
|
+
<div class="gem-c-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-1">
|
|
156
156
|
Lists what files each component has
|
|
157
157
|
</div>
|
|
158
158
|
</div>
|
|
159
|
-
<div id="accordion-default-content-1" class="
|
|
159
|
+
<div id="accordion-default-content-1" class="gem-c-accordion__section-content" aria-labelledby="accordion-default-heading-1">
|
|
160
160
|
<table class="govuk-table">
|
|
161
161
|
<thead class="govuk-table__head">
|
|
162
162
|
<tr class="govuk-table__row">
|
|
@@ -206,18 +206,18 @@
|
|
|
206
206
|
</div>
|
|
207
207
|
</div>
|
|
208
208
|
|
|
209
|
-
<div class="
|
|
210
|
-
<div class="
|
|
211
|
-
<h2 class="
|
|
212
|
-
<span class="
|
|
209
|
+
<div class="gem-c-accordion__section ">
|
|
210
|
+
<div class="gem-c-accordion__section-header">
|
|
211
|
+
<h2 class="gem-c-accordion__section-heading">
|
|
212
|
+
<span class="gem-c-accordion__section-button" id="accordion-default-heading-2">
|
|
213
213
|
Components containing components
|
|
214
214
|
</span>
|
|
215
215
|
</h2>
|
|
216
|
-
<div class="
|
|
216
|
+
<div class="gem-c-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-2">
|
|
217
217
|
Shows which components contain other components
|
|
218
218
|
</div>
|
|
219
219
|
</div>
|
|
220
|
-
<div id="accordion-default-content-2" class="
|
|
220
|
+
<div id="accordion-default-content-2" class="gem-c-accordion__section-content" aria-labelledby="accordion-default-heading-2">
|
|
221
221
|
<dl class="govuk-summary-list">
|
|
222
222
|
<% @components[:components_containing_components].each do |component| %>
|
|
223
223
|
<div class="govuk-summary-list__row">
|
|
@@ -232,18 +232,18 @@
|
|
|
232
232
|
</dl>
|
|
233
233
|
</div>
|
|
234
234
|
</div>
|
|
235
|
-
<div class="
|
|
236
|
-
<div class="
|
|
237
|
-
<h2 class="
|
|
238
|
-
<span class="
|
|
235
|
+
<div class="gem-c-accordion__section ">
|
|
236
|
+
<div class="gem-c-accordion__section-header">
|
|
237
|
+
<h2 class="gem-c-accordion__section-heading">
|
|
238
|
+
<span class="gem-c-accordion__section-button" id="accordion-default-heading-2">
|
|
239
239
|
Components by application
|
|
240
240
|
</span>
|
|
241
241
|
</h2>
|
|
242
|
-
<div class="
|
|
242
|
+
<div class="gem-c-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-2">
|
|
243
243
|
Shows which applications use each component
|
|
244
244
|
</div>
|
|
245
245
|
</div>
|
|
246
|
-
<div id="accordion-default-content-2" class="
|
|
246
|
+
<div id="accordion-default-content-2" class="gem-c-accordion__section-content" aria-labelledby="accordion-default-heading-2">
|
|
247
247
|
<% if @components[:components_by_application].any? %>
|
|
248
248
|
<dl class="govuk-summary-list">
|
|
249
249
|
<% @components[:components_by_application].each do |component| %>
|
|
@@ -6,42 +6,35 @@
|
|
|
6
6
|
items ||= []
|
|
7
7
|
condensed ||= false
|
|
8
8
|
|
|
9
|
-
accordion_classes = %w(gem-c-accordion
|
|
10
|
-
accordion_classes << '
|
|
9
|
+
accordion_classes = %w(gem-c-accordion)
|
|
10
|
+
accordion_classes << 'gem-c-accordion--condensed' if condensed
|
|
11
11
|
accordion_classes << (shared_helper.get_margin_bottom)
|
|
12
12
|
|
|
13
13
|
data_attributes ||= {}
|
|
14
|
-
data_attributes[:module] = '
|
|
14
|
+
data_attributes[:module] = 'gem-accordion'
|
|
15
15
|
%>
|
|
16
16
|
<% if items.any? %>
|
|
17
17
|
<%= tag.div(class: accordion_classes, id: id, data: data_attributes) do %>
|
|
18
18
|
<% items.each_with_index do |item, i| %>
|
|
19
19
|
<%
|
|
20
|
-
# Nunjucks starts a loop on 1 and the client side JavaScript also
|
|
21
|
-
# adopts this behaviour. To prevent things from breaking, the index
|
|
22
|
-
# here also need to be increase by one. (Nunjucks is used by GOV.UK
|
|
23
|
-
# Frontend, which this component is based on.)
|
|
24
20
|
index = i + 1
|
|
25
21
|
|
|
26
22
|
item[:data_attributes] ||= nil
|
|
27
23
|
|
|
28
|
-
section_classes = %w(
|
|
29
|
-
section_classes << '
|
|
24
|
+
section_classes = %w(gem-c-accordion__section)
|
|
25
|
+
section_classes << 'gem-c-accordion__section--expanded' if item[:expanded]
|
|
30
26
|
|
|
31
|
-
summary_classes = %w(
|
|
27
|
+
summary_classes = %w(gem-c-accordion__section-summary govuk-body)
|
|
32
28
|
%>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
class: 'govuk-accordion__section-heading'
|
|
40
|
-
)
|
|
41
|
-
%>
|
|
29
|
+
|
|
30
|
+
<%= tag.section(class: section_classes) do %>
|
|
31
|
+
<div class="gem-c-accordion__section-header">
|
|
32
|
+
<%= content_tag(shared_helper.get_heading_level, class: 'gem-c-accordion__section-heading') do %>
|
|
33
|
+
<%= tag.span(item[:heading][:text], id: "#{id}-heading-#{index}", data: item[:data_attributes], class: 'gem-c-accordion__section-button') %>
|
|
34
|
+
<% end %>
|
|
42
35
|
<%= tag.div(item[:summary][:text], id: "#{id}-summary-#{index}", class: summary_classes) if item[:summary].present? %>
|
|
43
36
|
</div>
|
|
44
|
-
<%= tag.div(item[:content][:html], id: "#{id}-content-#{index}", class: "
|
|
37
|
+
<%= tag.div(item[:content][:html], id: "#{id}-content-#{index}", class: "gem-c-accordion__section-content", 'aria-label': "#{item[:heading][:text]}") %>
|
|
45
38
|
<% end %>
|
|
46
39
|
<% end %>
|
|
47
40
|
<% end %>
|
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
<% shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns) %>
|
|
3
3
|
|
|
4
4
|
<div class="gem-c-contextual-sidebar">
|
|
5
|
-
<% if navigation.show_brexit_related_links? && navigation.step_by_step_count.zero? %>
|
|
6
|
-
<%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_related_links' %>
|
|
7
|
-
<% elsif navigation.step_by_step_count.zero? && !navigation.transition_countdown_exception? %>
|
|
8
|
-
<%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta' %>
|
|
9
|
-
<% end %>
|
|
10
|
-
|
|
11
5
|
<% if navigation.content_tagged_to_a_reasonable_number_of_step_by_steps? %>
|
|
12
6
|
<%# Rendering step by step related items because there are a few but not too many of them %>
|
|
13
7
|
<%= render 'govuk_publishing_components/components/step_by_step_nav_related', links: navigation.step_nav_helper.related_links %>
|
|
@@ -30,7 +24,7 @@
|
|
|
30
24
|
} %>
|
|
31
25
|
<% end %>
|
|
32
26
|
|
|
33
|
-
<% if navigation.
|
|
34
|
-
<%= render 'govuk_publishing_components/components/contextual_sidebar/
|
|
27
|
+
<% if navigation.show_brexit_cta? || navigation.show_brexit_related_links? %>
|
|
28
|
+
<%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta' %>
|
|
35
29
|
<% end %>
|
|
36
30
|
</div>
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
classes << " gem-c-document-list--top-margin" if local_assigns[:margin_top]
|
|
6
6
|
classes << " gem-c-document-list--bottom-margin" if local_assigns[:margin_bottom]
|
|
7
7
|
classes << " gem-c-document-list--no-underline" if local_assigns[:remove_underline]
|
|
8
|
+
classes << " gem-c-document-list--no-top-border" if local_assigns[:remove_top_border]
|
|
8
9
|
|
|
9
10
|
within_multitype_list ||= false
|
|
10
11
|
within_multitype_list_class = " gem-c-document-list__multi-list" if within_multitype_list
|
|
@@ -28,12 +29,21 @@
|
|
|
28
29
|
item_classes = "gem-c-document-list__item-title #{brand_helper.color_class} #{title_with_context_class if item[:link][:context]}"
|
|
29
30
|
|
|
30
31
|
if item[:link][:path]
|
|
32
|
+
rel = [
|
|
33
|
+
"external",
|
|
34
|
+
"nofollow",
|
|
35
|
+
"noopener",
|
|
36
|
+
"noreferrer",
|
|
37
|
+
"opener",
|
|
38
|
+
].include?(item[:link][:rel]) ? item[:link][:rel] : nil
|
|
39
|
+
|
|
31
40
|
link_to(
|
|
32
41
|
item[:link][:text],
|
|
33
42
|
item[:link][:path],
|
|
34
43
|
data: item[:link][:data_attributes],
|
|
35
44
|
class: "#{item_classes} gem-c-document-list__item-link",
|
|
36
|
-
lang: item[:link][:locale].presence
|
|
45
|
+
lang: item[:link][:locale].presence,
|
|
46
|
+
rel: rel,
|
|
37
47
|
)
|
|
38
48
|
else
|
|
39
49
|
content_tag(
|
|
@@ -50,7 +60,7 @@
|
|
|
50
60
|
<% end %>
|
|
51
61
|
|
|
52
62
|
<% if item[:link][:description] %>
|
|
53
|
-
<p class="gem-c-document-list__item-description" ><%= item[:link][:description] %></p>
|
|
63
|
+
<p class="gem-c-document-list__item-description <%= "gem-c-document-list__item-description--full-size" if item[:link][:full_size_description] %>"><%= item[:link][:description] %></p>
|
|
54
64
|
<% end %>
|
|
55
65
|
|
|
56
66
|
<% if item[:metadata] %>
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
meta ||= []
|
|
3
3
|
navigation ||= []
|
|
4
4
|
with_border ||= false
|
|
5
|
+
classes = %w(gem-c-layout-footer govuk-footer)
|
|
6
|
+
classes << "gem-c-layout-footer--border" if with_border
|
|
5
7
|
%>
|
|
6
|
-
|
|
7
|
-
<div class="govuk-width-container ">
|
|
8
|
+
<%= tag.footer class: classes, role: "contentinfo" do %>
|
|
9
|
+
<div class="govuk-width-container" data-module="gem-track-click">
|
|
8
10
|
<% if navigation.any? %>
|
|
9
11
|
<div class="govuk-footer__navigation">
|
|
10
12
|
<% navigation.each do |item| %>
|
|
@@ -29,7 +31,10 @@
|
|
|
29
31
|
<% if item[:href] && item[:text] %>
|
|
30
32
|
<li class="govuk-footer__list-item">
|
|
31
33
|
<%
|
|
32
|
-
attributes = {
|
|
34
|
+
attributes = {
|
|
35
|
+
class: "govuk-footer__link",
|
|
36
|
+
"data-track-category": "footerClicked"
|
|
37
|
+
}.merge(item.fetch(:attributes, {}))
|
|
33
38
|
attributes[:rel] = "noopener" if attributes[:target] == "_blank" && !attributes[:rel]
|
|
34
39
|
%>
|
|
35
40
|
<%= link_to item[:text], item[:href], attributes %>
|
|
@@ -80,4 +85,4 @@
|
|
|
80
85
|
</div>
|
|
81
86
|
</div>
|
|
82
87
|
</div>
|
|
83
|
-
|
|
88
|
+
<% end %>
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
<%= "data-id=#{tracking_id}" if tracking_id %>
|
|
25
25
|
data-show-text="<%= t("govuk_component.step_by_step_nav.show", default: "show") %>"
|
|
26
26
|
data-hide-text="<%= t("govuk_component.step_by_step_nav.hide", default: "hide") %>"
|
|
27
|
-
data-show-all-text="<%= t("govuk_component.step_by_step_nav.show_all", default: "Show all") %>"
|
|
28
|
-
data-hide-all-text="<%= t("govuk_component.step_by_step_nav.hide_all", default: "Hide all") %>"
|
|
27
|
+
data-show-all-text="<%= t("govuk_component.step_by_step_nav.show_all", default: "Show all steps") %>"
|
|
28
|
+
data-hide-all-text="<%= t("govuk_component.step_by_step_nav.hide_all", default: "Hide all steps") %>"
|
|
29
29
|
>
|
|
30
30
|
<ol class="gem-c-step-nav__steps">
|
|
31
31
|
<% steps.each_with_index do |step, step_index| %>
|
data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb
CHANGED
|
@@ -14,7 +14,28 @@
|
|
|
14
14
|
<%= link_to link_path,
|
|
15
15
|
class: "govuk-link gem-c-contextual-sidebar__brexit-cta",
|
|
16
16
|
data: data_attributes,
|
|
17
|
+
aria: { label: "#{t("components.related_navigation.take_action_list.aria_label")} #{link_text}" },
|
|
17
18
|
lang: shared_helper.t_locale("components.related_navigation.transition.title") do %>
|
|
18
19
|
<h2 class="gem-c-contextual-sidebar__brexit-heading"><%= t("components.related_navigation.transition.title") %></h2>
|
|
20
|
+
<ul class="govuk-list gem-c-contextual-sidebar__take-action-traffic-lights">
|
|
21
|
+
<li>
|
|
22
|
+
<%= image_tag 'govuk_publishing_components/take-action-red.svg', class: "gem-c-contextual-sidebar__take-action-traffic-lists-icon", alt: "" %>
|
|
23
|
+
<span class="gem-c-contextual-sidebar__take-action-traffic-lists-text">
|
|
24
|
+
<%= t("components.related_navigation.take_action_list.red") %>
|
|
25
|
+
</span>
|
|
26
|
+
</li>
|
|
27
|
+
<li>
|
|
28
|
+
<%= image_tag 'govuk_publishing_components/take-action-amber.svg', class: "gem-c-contextual-sidebar__take-action-traffic-lists-icon", alt: "" %>
|
|
29
|
+
<span class="gem-c-contextual-sidebar__take-action-traffic-lists-text">
|
|
30
|
+
<%= t("components.related_navigation.take_action_list.amber") %>
|
|
31
|
+
</span>
|
|
32
|
+
</li>
|
|
33
|
+
<li>
|
|
34
|
+
<%= image_tag 'govuk_publishing_components/take-action-green.svg', class: "gem-c-contextual-sidebar__take-action-traffic-lists-icon", alt: "" %>
|
|
35
|
+
<span class="gem-c-contextual-sidebar__take-action-traffic-lists-text">
|
|
36
|
+
<%= t("components.related_navigation.take_action_list.green") %>
|
|
37
|
+
</span>
|
|
38
|
+
</li>
|
|
39
|
+
</ul>
|
|
19
40
|
<p class="gem-c-contextual-sidebar__brexit-text"><%= link_text %></p>
|
|
20
41
|
<% end %>
|
|
@@ -4,20 +4,25 @@ govuk_frontend_components:
|
|
|
4
4
|
- accordion
|
|
5
5
|
body: |
|
|
6
6
|
This component is based on the [design system accordion component](https://design-system.service.gov.uk/components/accordion/)
|
|
7
|
-
and is currently experimental.
|
|
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/components/accordion/#next-steps).
|
|
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
|
-
*
|
|
14
|
+
* the controls must change in appearance when keyboard focus moves to it
|
|
15
|
+
* the controls must indicate when the mouse is hovered over it
|
|
15
16
|
* be usable with touch
|
|
16
17
|
* be usable with voice commands
|
|
17
18
|
* have visible text
|
|
18
19
|
* indicate to users that each section can be expanded and collapsed
|
|
19
20
|
* inform the user when a step has been expanded or collapsed
|
|
20
|
-
* be readable when only the text of the page is zoomed in
|
|
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
|
+
* the accordion header button element has aria-controls set to the ID of the element containing the accordion panel content.
|
|
25
|
+
* section content must have aria-label / aria-labelledby with a value that refers to the button that controls display of the content.
|
|
21
26
|
|
|
22
27
|
Section headings must use a button element:
|
|
23
28
|
|
|
@@ -72,6 +72,11 @@ examples:
|
|
|
72
72
|
- text: Check what age you can drive
|
|
73
73
|
href: "/vehicles-can-drive"
|
|
74
74
|
optional: false
|
|
75
|
+
- title: Testing the and
|
|
76
|
+
logic: and
|
|
77
|
+
contents:
|
|
78
|
+
- type: paragraph
|
|
79
|
+
text: hello hello what's UP
|
|
75
80
|
- title: Driving lessons and practice
|
|
76
81
|
contents:
|
|
77
82
|
- type: paragraph
|
|
@@ -144,7 +149,33 @@ examples:
|
|
|
144
149
|
- text: Find out what you’ll get
|
|
145
150
|
href: "/settled-status-eu-citizens-families/what-settled-and-presettled-status-means"
|
|
146
151
|
optional: false
|
|
147
|
-
|
|
152
|
+
with_brexit_cta:
|
|
153
|
+
description: For documents tagged with certain taxons defined in `brexit_cta_taxon_allow_list` we show a custom Brexit call to action element.
|
|
154
|
+
data:
|
|
155
|
+
content_item:
|
|
156
|
+
title: "Transport news story"
|
|
157
|
+
content_id: "3c402d90-fe77-49b9-a8aa-1800d4fc2b3d"
|
|
158
|
+
links:
|
|
159
|
+
ordered_related_items:
|
|
160
|
+
- title: Find an apprenticeship
|
|
161
|
+
base_path: /apply-apprenticeship
|
|
162
|
+
- title: Training and study at work
|
|
163
|
+
base_path: /training-study-work-your-rights
|
|
164
|
+
- title: Careers helpline for teenagers
|
|
165
|
+
base_path: /careers-helpline-for-teenagers
|
|
166
|
+
document_collections:
|
|
167
|
+
- title: Recruit an apprentice (formerly apprenticeship vacancies)
|
|
168
|
+
base_path: /government/collections/apprenticeship-vacancies
|
|
169
|
+
document_type: document_collection
|
|
170
|
+
- title: The future of jobs and skills
|
|
171
|
+
base_path: /government/collections/the-future-of-jobs-and-skills
|
|
172
|
+
document_type: document_collection
|
|
173
|
+
taxons:
|
|
174
|
+
- content_id: "a4038b29-b332-4f13-98b1-1c9709e216bc"
|
|
175
|
+
title: "Transport"
|
|
176
|
+
phase: "live"
|
|
177
|
+
with_brexit_cta_document_exception:
|
|
178
|
+
description: Illustrates an exception to showing the custom Brexit call to action element as defined in `brexit_cta_document_type_exceptions`.
|
|
148
179
|
data:
|
|
149
180
|
content_item:
|
|
150
181
|
title: "30 creative teams awarded up to £100,000 each for Festival UK* 2022 R&D project"
|
|
@@ -164,3 +195,36 @@ examples:
|
|
|
164
195
|
- title: The future of jobs and skills
|
|
165
196
|
base_path: /government/collections/the-future-of-jobs-and-skills
|
|
166
197
|
document_type: document_collection
|
|
198
|
+
taxons:
|
|
199
|
+
- content_id: "e2ca2f1a-0ff3-43ce-b813-16645ff27904"
|
|
200
|
+
title: "Society and culture"
|
|
201
|
+
phase: "live"
|
|
202
|
+
with_brexit_cta_taxon_exception:
|
|
203
|
+
description: Illustrates an exception to showing the custom Brexit call to action element as defined in `brexit_cta_taxon_exception_list`.
|
|
204
|
+
data:
|
|
205
|
+
content_item:
|
|
206
|
+
title: "Local transport news story"
|
|
207
|
+
content_id: "5c82db20-7631-11e4-a3cb-005056011aef"
|
|
208
|
+
links:
|
|
209
|
+
ordered_related_items:
|
|
210
|
+
- title: Find an apprenticeship
|
|
211
|
+
base_path: /apply-apprenticeship
|
|
212
|
+
- title: Training and study at work
|
|
213
|
+
base_path: /training-study-work-your-rights
|
|
214
|
+
- title: Careers helpline for teenagers
|
|
215
|
+
base_path: /careers-helpline-for-teenagers
|
|
216
|
+
document_collections:
|
|
217
|
+
- title: Recruit an apprentice (formerly apprenticeship vacancies)
|
|
218
|
+
base_path: /government/collections/apprenticeship-vacancies
|
|
219
|
+
document_type: document_collection
|
|
220
|
+
- title: The future of jobs and skills
|
|
221
|
+
base_path: /government/collections/the-future-of-jobs-and-skills
|
|
222
|
+
document_type: document_collection
|
|
223
|
+
taxons:
|
|
224
|
+
- content_id: "3b4d6319-fcef-4637-b35a-e3df76321894"
|
|
225
|
+
title: "Local transport"
|
|
226
|
+
phase: "live"
|
|
227
|
+
links:
|
|
228
|
+
parent_taxons:
|
|
229
|
+
- content_id: "a4038b29-b332-4f13-98b1-1c9709e216bc"
|
|
230
|
+
title: "Transport"
|