govuk_publishing_components 28.5.0 → 28.6.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/javascripts/govuk_publishing_components/analytics/track-select-change.js +4 -3
- data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +21 -291
- data/app/assets/javascripts/govuk_publishing_components/components/button.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/character-count.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/details.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/error-summary.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/layout-header.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/radio.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/skip-link.js +5 -0
- data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +40 -37
- data/app/assets/javascripts/govuk_publishing_components/components/tabs.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js +2 -1
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +8 -10
- data/app/assets/javascripts/govuk_publishing_components/lib/initial-focus.js +4 -3
- data/app/assets/javascripts/govuk_publishing_components/lib/toggle-input-class-on-focus.js +4 -3
- data/app/assets/javascripts/govuk_publishing_components/lib/toggle.js +4 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +1 -329
- data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +95 -56
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_accordion.scss +6 -17
- data/app/assets/stylesheets/govuk_publishing_components/govuk_frontend_support.scss +0 -9
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +31 -16
- data/app/views/govuk_publishing_components/components/_button.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_character_count.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_checkboxes.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_error_message.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_error_summary.html.erb +0 -1
- data/app/views/govuk_publishing_components/components/_inset_text.html.erb +12 -1
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_modal_dialogue.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_radio.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_skip_link.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/docs/accordion.yml +2 -97
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/inset_text.yml +6 -0
- data/app/views/govuk_publishing_components/components/docs/share_links.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/step_by_step_nav.yml +13 -13
- data/app/views/govuk_publishing_components/components/docs/tabs.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/textarea.yml +1 -1
- data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +11 -11
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/govuk/all.js +294 -76
- data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +274 -99
- data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +169 -65
- data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +37 -5
- data/node_modules/govuk-frontend/govuk/components/accordion/macro-options.json +4 -4
- data/node_modules/govuk-frontend/govuk/components/button/button.js +2 -2
- data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +3 -3
- data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +15 -2
- data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js +8 -10
- data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +52 -15
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/_index.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +31 -0
- data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +25 -25
- data/node_modules/govuk-frontend/govuk/components/details/details.js +2 -2
- data/node_modules/govuk-frontend/govuk/components/error-message/_index.scss +1 -0
- data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +8 -8
- data/node_modules/govuk-frontend/govuk/components/error-message/template.njk +2 -2
- data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js +24 -3
- data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +25 -16
- data/node_modules/govuk-frontend/govuk/components/error-summary/macro-options.json +6 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/template.njk +2 -1
- data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +4 -4
- data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +3 -37
- data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +119 -15
- data/node_modules/govuk-frontend/govuk/components/footer/macro-options.json +6 -0
- data/node_modules/govuk-frontend/govuk/components/footer/template.njk +1 -1
- data/node_modules/govuk-frontend/govuk/components/header/_index.scss +10 -4
- data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +11 -11
- data/node_modules/govuk-frontend/govuk/components/header/header.js +4 -4
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +4 -3
- data/node_modules/govuk-frontend/govuk/components/hint/_index.scss +1 -3
- data/node_modules/govuk-frontend/govuk/components/input/_index.scss +1 -1
- data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +40 -40
- data/node_modules/govuk-frontend/govuk/components/input/template.njk +4 -3
- data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +499 -2
- data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +2 -2
- data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +0 -8
- data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +44 -45
- data/node_modules/govuk-frontend/govuk/components/radios/radios.js +4 -4
- data/node_modules/govuk-frontend/govuk/components/radios/template.njk +2 -9
- data/node_modules/govuk-frontend/govuk/components/select/_index.scss +6 -1
- data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +3 -3
- data/node_modules/govuk-frontend/govuk/components/skip-link/_index.scss +13 -0
- data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +9 -9
- data/node_modules/govuk-frontend/govuk/components/skip-link/skip-link.js +1108 -0
- data/node_modules/govuk-frontend/govuk/components/skip-link/template.njk +1 -1
- data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +20 -23
- data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +86 -1
- data/node_modules/govuk-frontend/govuk/components/summary-list/template.njk +1 -4
- data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +2 -2
- data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js +2 -2
- data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +0 -5
- data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +2 -2
- data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +1 -1
- data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +4 -4
- data/node_modules/govuk-frontend/govuk/core/_all.scss +0 -1
- data/node_modules/govuk-frontend/govuk/core/_global-styles.scss +0 -6
- data/node_modules/govuk-frontend/govuk/core/_links.scss +0 -6
- data/node_modules/govuk-frontend/govuk/core/_lists.scss +0 -6
- data/node_modules/govuk-frontend/govuk/core/_section-break.scss +0 -6
- data/node_modules/govuk-frontend/govuk/core/_typography.scss +0 -6
- data/node_modules/govuk-frontend/govuk/objects/_all.scss +1 -0
- data/node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss +15 -30
- data/node_modules/govuk-frontend/govuk/{core → objects}/_template.scss +1 -5
- data/node_modules/govuk-frontend/govuk/overrides/_display.scss +0 -6
- data/node_modules/govuk-frontend/govuk/overrides/_spacing.scss +0 -6
- data/node_modules/govuk-frontend/govuk/overrides/_text-align.scss +0 -6
- data/node_modules/govuk-frontend/govuk/overrides/_typography.scss +0 -6
- data/node_modules/govuk-frontend/govuk/overrides/_width.scss +0 -6
- data/node_modules/govuk-frontend/govuk/settings/_colours-organisations.scss +3 -0
- data/node_modules/govuk-frontend/govuk/settings/_measurements.scss +0 -10
- data/node_modules/govuk-frontend/govuk/tools/_all.scss +0 -1
- data/node_modules/govuk-frontend/package.json +1 -1
- metadata +8 -7
- data/node_modules/govuk-frontend/govuk/tools/_iff.scss +0 -17
@@ -6,34 +6,23 @@
|
|
6
6
|
@import "../accordion";
|
7
7
|
|
8
8
|
// Open all of the accordion sections.
|
9
|
-
.
|
9
|
+
.govuk-accordion__section-content {
|
10
10
|
display: block !important; // stylelint-disable-line declaration-no-important
|
11
11
|
}
|
12
12
|
|
13
13
|
// Change the colour from the blue link colour to black.
|
14
|
-
.
|
14
|
+
.govuk-accordion__section-button {
|
15
15
|
color: govuk-colour("black") !important; // stylelint-disable-line declaration-no-important
|
16
16
|
}
|
17
17
|
|
18
|
-
// Removing spacing
|
19
|
-
.gem-c-accordion__section-header {
|
20
|
-
padding-bottom: govuk-spacing(1);
|
21
|
-
}
|
22
|
-
|
23
18
|
// Change the summary subheading size.
|
24
|
-
.
|
19
|
+
.govuk-accordion__section-summary {
|
25
20
|
@include govuk-typography-common;
|
26
21
|
@include govuk-typography-responsive($size: 16, $important: true);
|
27
22
|
}
|
28
23
|
|
29
|
-
// Hide the unusable "
|
30
|
-
.
|
31
|
-
.
|
32
|
-
.gem-c-accordion__toggle-link {
|
33
|
-
display: none !important; // stylelint-disable-line declaration-no-important
|
34
|
-
}
|
35
|
-
|
36
|
-
// Hide all hidden content
|
37
|
-
.gem-c-accordion .govuk-visually-hidden {
|
24
|
+
// Hide the unusable "Open all" button and the "+" icons.
|
25
|
+
.govuk-accordion__open-all,
|
26
|
+
.govuk-accordion__icon {
|
38
27
|
display: none !important; // stylelint-disable-line declaration-no-important
|
39
28
|
}
|
@@ -17,12 +17,3 @@ $gem-quiet-button-colour: govuk-colour("dark-grey", $legacy: "grey-1");
|
|
17
17
|
$gem-quiet-button-hover-colour: darken($gem-quiet-button-colour, 5%);
|
18
18
|
|
19
19
|
$gem-hover-dark-background: #dddcdb;
|
20
|
-
|
21
|
-
$govuk-colours-organisations: map-merge(
|
22
|
-
$govuk-colours-organisations,
|
23
|
-
(
|
24
|
-
"department-for-levelling-up-housing-and-communities": (
|
25
|
-
colour: #012169,
|
26
|
-
),
|
27
|
-
)
|
28
|
-
);
|
@@ -4,12 +4,10 @@
|
|
4
4
|
|
5
5
|
id ||= "default-id-#{SecureRandom.hex(4)}"
|
6
6
|
items ||= []
|
7
|
-
condensed ||= false
|
8
7
|
anchor_navigation ||= false
|
9
8
|
|
10
|
-
accordion_classes = %w(gem-c-accordion)
|
11
|
-
accordion_classes <<
|
12
|
-
accordion_classes << shared_helper.get_margin_bottom
|
9
|
+
accordion_classes = %w(gem-c-accordion govuk-accordion)
|
10
|
+
accordion_classes << (shared_helper.get_margin_bottom)
|
13
11
|
|
14
12
|
translations = {
|
15
13
|
show_text: "components.accordion.show",
|
@@ -22,7 +20,7 @@
|
|
22
20
|
locales = {}
|
23
21
|
|
24
22
|
data_attributes ||= {}
|
25
|
-
data_attributes[:module] = 'gem-accordion'
|
23
|
+
data_attributes[:module] = 'govuk-accordion gem-accordion'
|
26
24
|
data_attributes[:anchor_navigation] = anchor_navigation
|
27
25
|
|
28
26
|
translations.each do |key, translation|
|
@@ -39,27 +37,44 @@
|
|
39
37
|
data_attributes[:locale] = unique_locales[0]
|
40
38
|
end
|
41
39
|
end
|
40
|
+
|
42
41
|
%>
|
43
42
|
<% if items.any? %>
|
44
43
|
<%= tag.div(class: accordion_classes, id: id, data: data_attributes) do %>
|
45
44
|
<% items.each_with_index do |item, i| %>
|
46
45
|
<%
|
46
|
+
# The GOVUK Frontend JavaScript for this component
|
47
|
+
# uses a loop starting at 1 for accessing heading ID values,
|
48
|
+
# hence the increment below
|
47
49
|
index = i + 1
|
48
50
|
|
49
|
-
|
50
|
-
section_classes << 'gem-c-accordion__section--expanded' if item[:expanded]
|
51
|
+
item[:data_attributes] ||= nil
|
51
52
|
|
52
|
-
|
53
|
-
|
53
|
+
section_classes = %w(govuk-accordion__section)
|
54
|
+
section_classes << 'govuk-accordion__section--expanded' if item[:expanded]
|
54
55
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
56
|
+
summary_classes = %w(govuk-accordion__section-summary govuk-body)
|
57
|
+
%>
|
58
|
+
<%= tag.div(class: section_classes) do %>
|
59
|
+
<%= tag.div(class: "govuk-accordion__section-header") do %>
|
60
|
+
<%=
|
61
|
+
content_tag(
|
62
|
+
shared_helper.get_heading_level,
|
63
|
+
content_tag(
|
64
|
+
'span',
|
65
|
+
item[:heading][:text],
|
66
|
+
class: "govuk-accordion__section-button",
|
67
|
+
id: "#{id}-heading-#{index}"
|
68
|
+
|
69
|
+
),
|
70
|
+
class: "govuk-accordion__section-heading",
|
71
|
+
id: item[:heading][:id],
|
72
|
+
data: item[:data_attributes]
|
73
|
+
)
|
74
|
+
%>
|
60
75
|
<%= tag.div(item[:summary][:text], id: "#{id}-summary-#{index}", class: summary_classes) if item[:summary].present? %>
|
61
|
-
|
62
|
-
<%= tag.div(item[:content][:html], id: "#{id}-content-#{index}", class: "
|
76
|
+
<% end %>
|
77
|
+
<%= tag.div(item[:content][:html], id: "#{id}-content-#{index}", class: "govuk-accordion__section-content", 'aria-labelledby': "#{id}-heading-#{index}") %>
|
63
78
|
<% end %>
|
64
79
|
<% end %>
|
65
80
|
<% end %>
|
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
<% start_button_text = capture do %>
|
9
9
|
<%= button.text %>
|
10
|
-
<svg class="govuk-button__start-icon govuk-!-display-none-print" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40"
|
10
|
+
<svg class="govuk-button__start-icon govuk-!-display-none-print" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40" focusable="false" aria-hidden="true">
|
11
11
|
<path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z" />
|
12
12
|
</svg>
|
13
13
|
<% end %>
|
@@ -17,8 +17,8 @@
|
|
17
17
|
|
18
18
|
<%= render "govuk_publishing_components/components/textarea", { id: id, character_count: true }.merge(textarea.symbolize_keys) %>
|
19
19
|
|
20
|
-
<
|
20
|
+
<div id="<%= id %>-info" class="govuk-hint govuk-character-count__message" aria-live="polite">
|
21
21
|
<%= t("components.character_count.body", number: maxlength || maxwords, type: maxwords ? t("components.character_count.type.words") : t("components.character_count.type.characters")) %>
|
22
|
-
</
|
22
|
+
</div>
|
23
23
|
<% end %>
|
24
24
|
<% end %>
|
@@ -15,11 +15,11 @@
|
|
15
15
|
<% end %>
|
16
16
|
|
17
17
|
<% if cb_helper.hint_text %>
|
18
|
-
<%= tag.
|
18
|
+
<%= tag.div cb_helper.hint_text, id: "#{id}-hint", class: "govuk-hint" %>
|
19
19
|
<% end %>
|
20
20
|
|
21
21
|
<% if cb_helper.error %>
|
22
|
-
<%= tag.
|
22
|
+
<%= tag.p error, id: "#{id}-error", class: "govuk-error-message" %>
|
23
23
|
<% end %>
|
24
24
|
|
25
25
|
<%= tag.ul class: cb_helper.list_classes, data: {
|
@@ -1,7 +1,18 @@
|
|
1
1
|
<%
|
2
2
|
id ||= "inset-text-#{SecureRandom.hex(4)}"
|
3
|
+
margin_top ||= 6
|
4
|
+
margin_bottom ||= 6
|
5
|
+
|
6
|
+
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new({
|
7
|
+
margin_top: margin_top,
|
8
|
+
margin_bottom: margin_bottom
|
9
|
+
})
|
10
|
+
|
11
|
+
classes = %w[gem-c-inset-text govuk-inset-text]
|
12
|
+
classes << shared_helper.get_margin_top
|
13
|
+
classes << shared_helper.get_margin_bottom
|
3
14
|
%>
|
4
|
-
<%= tag.div id: id, class:
|
15
|
+
<%= tag.div id: id, class: classes do %>
|
5
16
|
<% if defined? text %>
|
6
17
|
<%= text %>
|
7
18
|
<% elsif block_given? %>
|
@@ -72,7 +72,7 @@
|
|
72
72
|
<% end %>
|
73
73
|
</ul>
|
74
74
|
<% end %>
|
75
|
-
<svg
|
75
|
+
<svg aria-hidden="true" focusable="false" class="govuk-footer__licence-logo" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 483.2 195.7" height="17" width="41">
|
76
76
|
<path
|
77
77
|
fill="currentColor"
|
78
78
|
d="M421.5 142.8V.1l-50.7 32.3v161.1h112.4v-50.7zm-122.3-9.6A47.12 47.12 0 0 1 221 97.8c0-26 21.1-47.1 47.1-47.1 16.7 0 31.4 8.7 39.7 21.8l42.7-27.2A97.63 97.63 0 0 0 268.1 0c-36.5 0-68.3 20.1-85.1 49.7A98 98 0 0 0 97.8 0C43.9 0 0 43.9 0 97.8s43.9 97.8 97.8 97.8c36.5 0 68.3-20.1 85.1-49.7a97.76 97.76 0 0 0 149.6 25.4l19.4 22.2h3v-87.8h-80l24.3 27.5zM97.8 145c-26 0-47.1-21.1-47.1-47.1s21.1-47.1 47.1-47.1 47.2 21 47.2 47S123.8 145 97.8 145"
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<%= tag.div class: "gem-c-modal-dialogue__overlay" %>
|
12
12
|
<%= tag.dialog class: dialog_classes, data: data_attributes, aria: { modal: true, label: aria_label }, role: "dialog", tabindex: 0 do %>
|
13
13
|
<%= tag.div class: "gem-c-modal-dialogue__header" do %>
|
14
|
-
<svg
|
14
|
+
<svg aria-hidden="true" focusable="false" class="gem-c-modal-dialogue__logotype-crown" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 132 97" height="26" width="30">
|
15
15
|
<path fill="currentColor" fill-rule="evenodd"
|
16
16
|
d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM9 39.5c3.6 1.5 7.8-.2 9.2-3.7 1.5-3.6-.2-7.8-3.9-9.1-3.6-1.5-7.6.2-9.1 3.8-1.4 3.5.3 7.5 3.8 9zM4.4 57.2c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.5-1.5-7.6.3-9.1 3.8-1.4 3.5.3 7.6 3.9 9.1zm38.3-21.4c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.6-1.5-7.6.3-9.1 3.8-1.3 3.6.4 7.7 3.9 9.1zm64.4-5.6c-3.6 1.5-7.8-.2-9.1-3.7-1.5-3.6.2-7.8 3.8-9.2 3.6-1.4 7.7.3 9.2 3.9 1.3 3.5-.4 7.5-3.9 9zm15.9 9.3c-3.6 1.5-7.7-.2-9.1-3.7-1.5-3.6.2-7.8 3.7-9.1 3.6-1.5 7.7.2 9.2 3.8 1.5 3.5-.3 7.5-3.8 9zm4.7 17.7c-3.6 1.5-7.8-.2-9.2-3.8-1.5-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.3 3.5-.4 7.6-3.9 9.1zM89.3 35.8c-3.6 1.5-7.8-.2-9.2-3.8-1.4-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.4 3.6-.3 7.7-3.9 9.1zM69.7 17.7l8.9 4.7V9.3l-8.9 2.8c-.2-.3-.5-.6-.9-.9L72.4 0H59.6l3.5 11.2c-.3.3-.6.5-.9.9l-8.8-2.8v13.1l8.8-4.7c.3.3.6.7.9.9l-5 15.4v.1c-.2.8-.4 1.6-.4 2.4 0 4.1 3.1 7.5 7 8.1h.2c.3 0 .7.1 1 .1.4 0 .7 0 1-.1h.2c4-.6 7.1-4.1 7.1-8.1 0-.8-.1-1.7-.4-2.4V34l-5.1-15.4c.4-.2.7-.6 1-.9zM66 92.8c16.9 0 32.8 1.1 47.1 3.2 4-16.9 8.9-26.7 14-33.5l-9.6-3.4c1 4.9 1.1 7.2 0 10.2-1.5-1.4-3-4.3-4.2-8.7L108.6 76c2.8-2 5-3.2 7.5-3.3-4.4 9.4-10 11.9-13.6 11.2-4.3-.8-6.3-4.6-5.6-7.9 1-4.7 5.7-5.9 8-.5 4.3-8.7-3-11.4-7.6-8.8 7.1-7.2 7.9-13.5 2.1-21.1-8 6.1-8.1 12.3-4.5 20.8-4.7-5.4-12.1-2.5-9.5 6.2 3.4-5.2 7.9-2 7.2 3.1-.6 4.3-6.4 7.8-13.5 7.2-10.3-.9-10.9-8-11.2-13.8 2.5-.5 7.1 1.8 11 7.3L80.2 60c-4.1 4.4-8 5.3-12.3 5.4 1.4-4.4 8-11.6 8-11.6H55.5s6.4 7.2 7.9 11.6c-4.2-.1-8-1-12.3-5.4l1.4 16.4c3.9-5.5 8.5-7.7 10.9-7.3-.3 5.8-.9 12.8-11.1 13.8-7.2.6-12.9-2.9-13.5-7.2-.7-5 3.8-8.3 7.1-3.1 2.7-8.7-4.6-11.6-9.4-6.2 3.7-8.5 3.6-14.7-4.6-20.8-5.8 7.6-5 13.9 2.2 21.1-4.7-2.6-11.9.1-7.7 8.8 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"></path>
|
17
17
|
<image src="<%= asset_path('govuk-logotype-crown.png') %>" class="gem-c-modal-dialogue__logotype-crown-fallback-image"></image>
|
@@ -122,7 +122,7 @@
|
|
122
122
|
<% end %>
|
123
123
|
|
124
124
|
<% if item[:conditional] %>
|
125
|
-
<%= tag.div item[:conditional], class:"govuk-radios__conditional govuk-radios__conditional--hidden", id: conditional_id %>
|
125
|
+
<%= tag.div item[:conditional], class:"govuk-radios__conditional govuk-radios__conditional--hidden govuk-body", id: conditional_id %>
|
126
126
|
<% end %>
|
127
127
|
|
128
128
|
<% end %>
|
@@ -2,4 +2,4 @@
|
|
2
2
|
href ||= '#main-content'
|
3
3
|
text ||= t('components.skip_link.text')
|
4
4
|
%>
|
5
|
-
<%= link_to(text, href, class: "gem-c-skip-link govuk-skip-link govuk-!-display-none-print") %>
|
5
|
+
<%= link_to(text, href, class: "gem-c-skip-link govuk-skip-link govuk-!-display-none-print", data: { module: "govuk-skip-link" }) %>
|
@@ -296,11 +296,11 @@ examples:
|
|
296
296
|
text: Writing well for the web
|
297
297
|
id: writing-well-for-the-web
|
298
298
|
content:
|
299
|
-
html: <p class="govuk-body">This is
|
299
|
+
html: <p class="govuk-body">This is content for accordion 1 of 2</p><p class="govuk-body">This content contains a <a href="#anchor-nav-test" class="govuk-link">link</a></p>
|
300
300
|
- heading:
|
301
301
|
text: Writing well for specialists
|
302
302
|
content:
|
303
|
-
html: <p class="govuk-body">This is
|
303
|
+
html: <p class="govuk-body" id="anchor-nav-test">This is content for accordion 2 of 2</p>
|
304
304
|
- heading:
|
305
305
|
text: Know your audience
|
306
306
|
content:
|
@@ -309,98 +309,3 @@ examples:
|
|
309
309
|
text: How people read
|
310
310
|
content:
|
311
311
|
html: <p class="govuk-body">This is the content for How people read.</p>
|
312
|
-
condensed_layout:
|
313
|
-
description: |
|
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.
|
315
|
-
data:
|
316
|
-
condensed: true
|
317
|
-
items:
|
318
|
-
- heading:
|
319
|
-
text: Understanding agile project management
|
320
|
-
content:
|
321
|
-
html:
|
322
|
-
'<ul class="govuk-list">
|
323
|
-
<li>
|
324
|
-
<a class="govuk-link govuk-body-s" href="#">Agile and government services: an introduction</a>
|
325
|
-
</li>
|
326
|
-
<li>
|
327
|
-
<a class="govuk-link govuk-body-s" href="#">Agile methods: an introduction</a>
|
328
|
-
</li>
|
329
|
-
<li>
|
330
|
-
<a class="govuk-link govuk-body-s" href="#">Core principles of agile</a>
|
331
|
-
</li>
|
332
|
-
</ul>'
|
333
|
-
- heading:
|
334
|
-
text: Working with agile methods
|
335
|
-
summary:
|
336
|
-
text: Workspaces, tools and techniques, user stories, planning.
|
337
|
-
content:
|
338
|
-
html:
|
339
|
-
'<ul class="govuk-list">
|
340
|
-
<li>
|
341
|
-
<a class="govuk-link govuk-body-s" href="#">Creating an agile working environment</a>
|
342
|
-
</li>
|
343
|
-
<li>
|
344
|
-
<a class="govuk-link govuk-body-s" href="#">Agile tools and techniques</a>
|
345
|
-
</li>
|
346
|
-
<li>
|
347
|
-
<a class="govuk-link govuk-body-s" href="#">Set up a team wall</a>
|
348
|
-
</li>
|
349
|
-
<li>
|
350
|
-
<a class="govuk-link govuk-body-s" href="#">Writing user stories</a>
|
351
|
-
</li>
|
352
|
-
<li>
|
353
|
-
<a class="govuk-link govuk-body-s" href="#">Planning in agile</a>
|
354
|
-
</li>
|
355
|
-
<li>
|
356
|
-
<a class="govuk-link govuk-body-s" href="#">Deciding on priorities</a>
|
357
|
-
</li>
|
358
|
-
<li>
|
359
|
-
<a class="govuk-link govuk-body-s" href="#">Developing a roadmap</a>
|
360
|
-
</li>
|
361
|
-
</ul>'
|
362
|
-
- heading:
|
363
|
-
text: Governing agile services
|
364
|
-
content:
|
365
|
-
html:
|
366
|
-
'<ul class="govuk-list">
|
367
|
-
<li>
|
368
|
-
<a class="govuk-link govuk-body-s" href="#">Governance principles for agile service delivery</a>
|
369
|
-
</li>
|
370
|
-
<li>
|
371
|
-
<a class="govuk-link govuk-body-s" href="#">Measuring and reporting progress</a>
|
372
|
-
</li>
|
373
|
-
<li>
|
374
|
-
<a class="govuk-link govuk-body-s" href="#">Spend controls: check if you need approval to spend money on a service</a>
|
375
|
-
</li>
|
376
|
-
<li>
|
377
|
-
<a class="govuk-link govuk-body-s" href="#">Spend controls: apply for approval to spend money on a service</a>
|
378
|
-
</li>
|
379
|
-
<li>
|
380
|
-
<a class="govuk-link govuk-body-s" href="#">Spend controls: the new pipeline process</a>
|
381
|
-
</li>
|
382
|
-
<li>
|
383
|
-
<a class="govuk-link govuk-body-s" href="#">Working across organisational boundaries</a>
|
384
|
-
</li>
|
385
|
-
</ul>'
|
386
|
-
- heading:
|
387
|
-
text: Phases of an agile project
|
388
|
-
content:
|
389
|
-
html:
|
390
|
-
'<ul class="govuk-list">
|
391
|
-
<li>
|
392
|
-
<a class="govuk-link govuk-body-s" href="#">How the discovery phase works</a>
|
393
|
-
</li>
|
394
|
-
<li>
|
395
|
-
<a class="govuk-link govuk-body-s" href="#">How the alpha phase works</a>
|
396
|
-
</li>
|
397
|
-
<li>
|
398
|
-
<a class="govuk-link govuk-body-s" href="#">How the beta phase works</a>
|
399
|
-
</li>
|
400
|
-
<li>
|
401
|
-
<a class="govuk-link govuk-body-s" href="#">How the live phase works</a>
|
402
|
-
</li>
|
403
|
-
<li>
|
404
|
-
<a class="govuk-link govuk-body-s" href="#">Retiring your service</a>
|
405
|
-
</li>
|
406
|
-
</ul>'
|
@@ -816,7 +816,7 @@ examples:
|
|
816
816
|
block: |
|
817
817
|
<p>
|
818
818
|
<a role="button" class="gem-c-button govuk-button" href="https://gov.uk/random">Button</a>
|
819
|
-
<a class="gem-c-button govuk-button govuk-button--start" role="button" href="https://gov.uk/random"> Start button <svg class="govuk-button__start-icon" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40"
|
819
|
+
<a class="gem-c-button govuk-button govuk-button--start" role="button" href="https://gov.uk/random"> Start button <svg class="govuk-button__start-icon" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40" aria-hidden="true" focusable="false"><path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z"></path></svg></a>
|
820
820
|
</p>
|
821
821
|
image:
|
822
822
|
data:
|
@@ -18,3 +18,9 @@ examples:
|
|
18
18
|
<h2 class="govuk-heading-m" id='heading'>To publish this step by step you need to</h2>
|
19
19
|
<a class="govuk-link" href='/foo'>Check for broken links</a>
|
20
20
|
</div>
|
21
|
+
with_custom_margins:
|
22
|
+
description: 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 margin of 6 (30px) top and bottom.
|
23
|
+
data:
|
24
|
+
text: "When a failure occurs, you must submit logbook, landing and transhipment data manually to the UK Fisheries Call Centre each day and by no later than 23.59 UTC"
|
25
|
+
margin_top: 0
|
26
|
+
margin_bottom: 9
|
@@ -96,7 +96,7 @@ examples:
|
|
96
96
|
}
|
97
97
|
]
|
98
98
|
with_a_different_heading_level:
|
99
|
-
description: Steps have a
|
99
|
+
description: Steps have a `h2` by default, but this can be changed. The heading level does not change any styling.
|
100
100
|
data:
|
101
101
|
heading_level: 3
|
102
102
|
steps: [
|
@@ -164,7 +164,7 @@ examples:
|
|
164
164
|
]
|
165
165
|
remember_last_opened_step:
|
166
166
|
description: |
|
167
|
-
If steps are opened their IDs are added to an array in sessionStorage
|
167
|
+
If steps are opened their IDs are added to an array in `sessionStorage`, so that if the user returns to this page in the same session, those steps will be opened on page load. This option can technically be used together with the option to open a step by default, but this is not recommended as it could confuse users.
|
168
168
|
data:
|
169
169
|
remember_last_step: true
|
170
170
|
steps: [
|
@@ -192,9 +192,9 @@ examples:
|
|
192
192
|
Links can have the following attributes:
|
193
193
|
|
194
194
|
- style, an attribute on the parent list that controls its appearance. Defaults to optional but can be set to 'choice' (adds indent and bullets to the list)
|
195
|
-
- context
|
196
|
-
- active
|
197
|
-
- highlight_step
|
195
|
+
- `context`, an optional text field to show some extra information after the link, usually a monetary value
|
196
|
+
- `active`, whether to make the link highlighted (to indicate the current page)
|
197
|
+
- `highlight_step`, a general option to highlight the step. Usually the active link would be in the active step, but in some circumstances there might be an active step but no highlighted link.
|
198
198
|
data:
|
199
199
|
highlight_step: 2
|
200
200
|
show_step: 2
|
@@ -338,11 +338,11 @@ examples:
|
|
338
338
|
|
339
339
|
If a link is in a step by step navigation more than once and the user is on that page, the backend doesn't know which link to highlight, so it highlights both of them.
|
340
340
|
|
341
|
-
JavaScript is included in the component to solve this. It uses sessionStorage to capture the data-position attribute of non-external links when clicked, and then uses this value to decide which link to highlight after the new page loads. It uses the value of the tracking_id option to uniquely identify the current step nav in the session (if this is not passed to the component this may result in other step navs having the wrong link highlighted).
|
341
|
+
JavaScript is included in the component to solve this. It uses `sessionStorage` to capture the data-position attribute of non-external links when clicked, and then uses this value to decide which link to highlight after the new page loads. It uses the value of the `tracking_id` option to uniquely identify the current step nav in the session (if this is not passed to the component this may result in other step navs having the wrong link highlighted).
|
342
342
|
|
343
|
-
If a user has not clicked a link (i.e. has visited the page without first clicking on a step by step navigation) only the first duplicate link will be highlighted. If that link is not in the active step, the
|
343
|
+
If a user has not clicked a link (i.e. has visited the page without first clicking on a step by step navigation) only the first duplicate link will be highlighted. If that link is not in the active step, the JavaScript makes the highlighted link's parent the active step. If there is no active step, the first active link will be highlighted (but there should always be an active step).
|
344
344
|
|
345
|
-
The example below will show all non-external links highlighted if
|
345
|
+
The example below will show all non-external links highlighted if JavaScript is disabled. In the real world no more than two or three links are likely to be highlighted at once.
|
346
346
|
|
347
347
|
Changes to the active step and highlighted link are also applied on click, if the user clicks one of the other links that is to the same page (they are amended by the component to be jump links to the top of the page). Open this example using the 'preview' link and try clicking on the 'internal' links to see how it behaves.
|
348
348
|
data:
|
@@ -417,15 +417,15 @@ examples:
|
|
417
417
|
|
418
418
|
The solution is to track the step by step journey the user is on.
|
419
419
|
|
420
|
-
This has been achieved by adding a query string to all of the internal links in the step by step that contains the content_id of the step by step.
|
420
|
+
This has been achieved by adding a query string to all of the internal links in the step by step that contains the `content_id` of the step by step.
|
421
421
|
|
422
|
-
For example, if the step by step contains a link to [/check-uk-visa](/check-uk-visa), the component will
|
422
|
+
For example, if the step by step contains a link to [/check-uk-visa](/check-uk-visa), the component will render the link as [/check-uk-visa?step-by-step-nav=d8f3c2e0-d544-4664-9616-ab71323e4d18](/check-uk-visa?step-by-step-nav=d8f3c2e0-d544-4664-9616-ab71323e4d18)
|
423
423
|
|
424
424
|
As long as the user follows the links in the step by step (and not the inline links in the content), the component will know which step by step journey the user is on.
|
425
425
|
|
426
|
-
If the content item is part of multiple step by steps, the component fetches the content_id of the `active` step by step from the query string and expands that one. The other step by steps that the content item is part of are displayed as a list of titles under an "Also part of" heading.
|
426
|
+
If the content item is part of multiple step by steps, the component fetches the `content_id` of the `active` step by step from the query string and expands that one. The other step by steps that the content item is part of are displayed as a list of titles under an "Also part of" heading.
|
427
427
|
|
428
|
-
Additionally, if content designers have chosen to "hide" a step by step on a content page, but we can see that the user is following a step by step journey (the content_id of the step by step is in the querystring), the step by step will still be displayed and expanded in the sidebar, and the other step by steps that the content item is part of, but content designers have chosen to hide will also be displayed as a list of titles under an "Also part of heading".
|
428
|
+
Additionally, if content designers have chosen to "hide" a step by step on a content page, but we can see that the user is following a step by step journey (the `content_id` of the step by step is in the querystring), the step by step will still be displayed and expanded in the sidebar, and the other step by steps that the content item is part of, but content designers have chosen to hide will also be displayed as a list of titles under an "Also part of heading".
|
429
429
|
|
430
430
|
In both cases, we never show more than 5 step by steps in the list.
|
431
431
|
|
@@ -523,7 +523,7 @@ examples:
|
|
523
523
|
description: |
|
524
524
|
Steps can be optional. This is controlled by two parameters, 'optional' and 'logic'.
|
525
525
|
|
526
|
-
- Optional steps used to have a dotted line down the side but this was removed as it confused users. In some cases we may still need to record if a step is optional, so if this parameter is applied,
|
526
|
+
- Optional steps used to have a dotted line down the side but this was removed as it confused users. In some cases we may still need to record if a step is optional, so if this parameter is applied, Google Analytics tracking events will have 'optional' appended to the end of the eventLabel.
|
527
527
|
- Logic will change the number next to a step to the word 'and' or the word 'or'.
|
528
528
|
|
529
529
|
If a step is optional this should be conveyed by the text within that step.
|
@@ -2,7 +2,7 @@ name: "Tabs (experimental)"
|
|
2
2
|
description: "The tabs component lets users toggle between related sections of content."
|
3
3
|
body: |
|
4
4
|
This component is based on the [GOV.UK Design System tabs component](https://design-system.service.gov.uk/components/tabs/)
|
5
|
-
and is currently experimental. If using this component, please feed back any research findings to the Design System team](https://design-system.service.gov.uk/get-in-touch/).
|
5
|
+
and is currently experimental. If using this component, please feed back any research findings to the [GOV.UK Design System team](https://design-system.service.gov.uk/get-in-touch/).
|
6
6
|
|
7
7
|
The tabs component lets users navigate between related sections of content on a single page,
|
8
8
|
displaying one section at a time. Note that they are not intended to be used to navigate
|
data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
<% navigation_aria_label ||= "Top level" %>
|
2
2
|
|
3
3
|
<% if navigation_items.any? %>
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
<ul id="navigation" class="govuk-header__navigation
|
4
|
+
<%= tag.nav class: "gem-c-header__nav govuk-header__navigation govuk-header__navigation--end", aria: { label: navigation_aria_label } do %>
|
5
|
+
<button
|
6
|
+
aria-controls="navigation"
|
7
|
+
aria-label="Show or hide Top Level Navigation"
|
8
|
+
class="govuk-header__menu-button govuk-js-header-toggle gem-c-header__menu-button govuk-!-display-none-print"
|
9
|
+
type="button"
|
10
|
+
data-button-name="menu"
|
11
|
+
>
|
12
|
+
<%= t("components.layout_header.menu") %>
|
13
|
+
</button>
|
14
|
+
<ul id="navigation" class="govuk-header__navigation-list">
|
15
15
|
<% navigation_items.each_with_index do |item, index| %>
|
16
16
|
<%
|
17
17
|
li_classes = %w(govuk-header__navigation-item)
|