govuk_publishing_components 23.12.0 → 23.13.1
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/components/header.js +3 -0
- data/app/assets/javascripts/govuk_publishing_components/components/layout-header.js +5 -0
- data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +32 -36
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +66 -14
- data/app/assets/javascripts/govuk_publishing_components/modules.js +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +5 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_show-password.scss +4 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +19 -7
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +17 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +5 -0
- data/app/views/govuk_publishing_components/components/_button.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_layout_header.html.erb +3 -2
- data/app/views/govuk_publishing_components/components/_machine_readable_metadata.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_subscription-links.html.erb +3 -0
- data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +82 -0
- data/app/views/govuk_publishing_components/components/_translation-nav.html.erb +3 -0
- data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +30 -0
- data/app/views/govuk_publishing_components/components/docs/layout_header.yml +21 -0
- data/app/views/govuk_publishing_components/components/docs/meta_tags.yml +99 -1
- data/app/views/govuk_publishing_components/components/docs/subscription-links.yml +3 -0
- data/app/views/govuk_publishing_components/components/docs/subscription_links.yml +100 -0
- data/app/views/govuk_publishing_components/components/docs/translation-nav.yml +3 -1
- data/app/views/govuk_publishing_components/components/docs/translation_nav.yml +137 -0
- data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +3 -3
- data/config/locales/en.yml +2 -2
- data/lib/govuk_publishing_components/presenters/meta_tags.rb +2 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/govuk/all.js +57 -0
- data/node_modules/govuk-frontend/govuk/components/_all.scss +1 -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/button/fixtures.json +74 -31
- data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +72 -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/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 +34 -14
- 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/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/fixtures.json +92 -22
- 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/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 +15 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_transition-countdown.scss +0 -125
@@ -1,4 +1,5 @@
|
|
1
1
|
<%
|
2
|
+
# button_helper.css_classes generates "gem-c-button"
|
2
3
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
3
4
|
local_assigns[:classes] = shared_helper.classes
|
4
5
|
button = GovukPublishingComponents::Presenters::ButtonHelper.new(local_assigns)
|
@@ -5,6 +5,7 @@
|
|
5
5
|
search ||= false
|
6
6
|
search_left ||= false
|
7
7
|
navigation_items ||= []
|
8
|
+
navigation_aria_label ||= "Top level"
|
8
9
|
remove_bottom_border ||= false
|
9
10
|
search_left ||= false
|
10
11
|
width_class = full_width ? "govuk-header__container--full-width" : "govuk-width-container"
|
@@ -28,7 +29,7 @@
|
|
28
29
|
<%= render "govuk_publishing_components/components/layout_header/search" %>
|
29
30
|
</div>
|
30
31
|
<div class="govuk-header__content gem-c-header__content govuk-grid-column-full">
|
31
|
-
<%= render "govuk_publishing_components/components/layout_header/navigation_items", navigation_items: navigation_items %>
|
32
|
+
<%= render "govuk_publishing_components/components/layout_header/navigation_items", navigation_items: navigation_items, navigation_aria_label: navigation_aria_label %>
|
32
33
|
</div>
|
33
34
|
</div>
|
34
35
|
<% else %>
|
@@ -37,7 +38,7 @@
|
|
37
38
|
<%= render "govuk_publishing_components/components/layout_header/header_logo", environment: environment, product_name: product_name %>
|
38
39
|
</div>
|
39
40
|
<div class="govuk-header__content gem-c-header__content">
|
40
|
-
<%= render "govuk_publishing_components/components/layout_header/navigation_items", navigation_items: navigation_items %>
|
41
|
+
<%= render "govuk_publishing_components/components/layout_header/navigation_items", navigation_items: navigation_items, navigation_aria_label: navigation_aria_label %>
|
41
42
|
</div>
|
42
43
|
<% if search %>
|
43
44
|
<div class="govuk-grid-column-one-third gem-c-layout-header__search">
|
@@ -9,7 +9,7 @@
|
|
9
9
|
<% structured_data = GovukPublishingComponents::Presenters::SchemaOrg.new(page).structured_data %>
|
10
10
|
|
11
11
|
<script type="application/ld+json">
|
12
|
-
<%= raw
|
12
|
+
<%= raw(json_escape(JSON.pretty_generate(structured_data))) %>
|
13
13
|
</script>
|
14
14
|
|
15
15
|
<link rel="canonical" href="<%= page.canonical_url %>" />
|
@@ -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| %>
|
@@ -0,0 +1,82 @@
|
|
1
|
+
<%
|
2
|
+
brand ||= false
|
3
|
+
brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
|
4
|
+
|
5
|
+
sl_helper = GovukPublishingComponents::Presenters::SubscriptionLinksHelper.new(local_assigns)
|
6
|
+
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
7
|
+
|
8
|
+
local_assigns[:margin_bottom] ||= 0
|
9
|
+
local_assigns[:margin_bottom] = 0 if local_assigns[:margin_bottom] > 9
|
10
|
+
|
11
|
+
css_classes = %w( gem-c-subscription-links )
|
12
|
+
css_classes << (shared_helper.get_margin_bottom) unless local_assigns[:margin_bottom] == 0
|
13
|
+
css_classes << brand_helper.brand_class
|
14
|
+
css_classes << "gem-c-subscription-links--with-feed-box" if sl_helper.feed_link_box_value
|
15
|
+
|
16
|
+
data = {"module": "gem-toggle"} if sl_helper.feed_link_box_value
|
17
|
+
|
18
|
+
hide_heading ||= false
|
19
|
+
|
20
|
+
email_signup_link_text_locale = local_assigns[:email_signup_link_text_locale].presence
|
21
|
+
feed_link_text_locale = local_assigns[:feed_link_text_locale].presence
|
22
|
+
%>
|
23
|
+
<% if sl_helper.component_data_is_valid? %>
|
24
|
+
<%= tag.section class: css_classes, data: data do %>
|
25
|
+
<% unless hide_heading %>
|
26
|
+
<h2 class="gem-c-subscription-links__hidden-header visuallyhidden"><%= t("govuk_component.subscription_links.subscriptions", default: "Subscriptions") %></h2>
|
27
|
+
<% end %>
|
28
|
+
<ul
|
29
|
+
class="gem-c-subscription-links__list<%= ' gem-c-subscription-links__list--small' if local_assigns[:small_form] == true %>"
|
30
|
+
<%= "data-module=track-click" if sl_helper.tracking_is_present? %>
|
31
|
+
>
|
32
|
+
<% if sl_helper.email_signup_link.present? %>
|
33
|
+
<li class="gem-c-subscription-links__list-item<%= ' gem-c-subscription-links__list-item--small' if local_assigns[:small_form] == true %>" >
|
34
|
+
<% email_link_text = capture do %>
|
35
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="21" height="15.75" class="gem-c-subscription-links__icon" focusable="false" fill="currentColor" aria-hidden="true"><path d="M19.687 0H1.312C.589 0 0 .587 0 1.313v13.124c0 .726.588 1.313 1.313 1.313h18.374c.725 0 1.313-.587 1.313-1.313V1.313C21 .587 20.412 0 19.687 0zm-2.625 2.625L10.5 7.875l-6.563-5.25h13.126zm1.313 10.5H2.625V3.937L10.5 10.5l7.875-6.563v9.188z"/></svg>
|
36
|
+
<%= sl_helper.email_signup_link_text %>
|
37
|
+
<% end %>
|
38
|
+
<%= link_to email_link_text, sl_helper.email_signup_link, {
|
39
|
+
class: "gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--link",
|
40
|
+
data: sl_helper.email_signup_link_data_attributes,
|
41
|
+
lang: email_signup_link_text_locale
|
42
|
+
} %>
|
43
|
+
</li>
|
44
|
+
<% end %>
|
45
|
+
|
46
|
+
<% if sl_helper.feed_link_box_value || sl_helper.feed_link %>
|
47
|
+
<li class="gem-c-subscription-links__list-item<%= ' gem-c-subscription-links__list-item--small' if local_assigns[:small_form] == true %>">
|
48
|
+
<% feed_link_text = capture do %>
|
49
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" class="gem-c-subscription-links__icon" focusable="false" fill="currentColor" aria-hidden="true"><path d="M1.996 11A2 2 0 0 0 0 12.993c0 1.101.895 1.99 1.996 1.99 1.106 0 2-.889 2-1.99a2 2 0 0 0-2-1.993zM.002 5.097V7.97c1.872 0 3.632.733 4.958 2.059A6.984 6.984 0 0 1 7.015 15h2.888c0-5.461-4.443-9.903-9.9-9.903zM.006 0v2.876c6.676 0 12.11 5.44 12.11 12.124H15C15 6.731 8.273 0 .006 0z"/></svg>
|
50
|
+
<%= sl_helper.feed_link_text %>
|
51
|
+
<% end %>
|
52
|
+
<%= tag.button feed_link_text, {
|
53
|
+
class: "gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--button",
|
54
|
+
data: sl_helper.feed_link_data_attributes,
|
55
|
+
lang: feed_link_text_locale
|
56
|
+
} if sl_helper.feed_link_box_value %>
|
57
|
+
<%= link_to feed_link_text, sl_helper.feed_link,
|
58
|
+
{
|
59
|
+
class: "gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--link",
|
60
|
+
data: sl_helper.feed_link_data_attributes,
|
61
|
+
lang: feed_link_text_locale
|
62
|
+
} unless sl_helper.feed_link_box_value %>
|
63
|
+
</li>
|
64
|
+
<% end %>
|
65
|
+
</ul>
|
66
|
+
|
67
|
+
<% if sl_helper.feed_link_box_value %>
|
68
|
+
<div class="gem-c-subscription-links__feed-box js-hidden" id="<%= sl_helper.feed_box_id %>">
|
69
|
+
<h3 class="gem-c-subscription-links__feed-hidden-description visuallyhidden govuk-!-margin-top-0"><%= sl_helper.feed_link_text %></h3>
|
70
|
+
<div lang="en">
|
71
|
+
<%= render "govuk_publishing_components/components/input", {
|
72
|
+
label: {
|
73
|
+
text: "Copy and paste this URL into your feed reader"
|
74
|
+
},
|
75
|
+
name: "feed-reader-box",
|
76
|
+
value: feed_link_box_value
|
77
|
+
} %>
|
78
|
+
</div>
|
79
|
+
</div>
|
80
|
+
<% end %>
|
81
|
+
<% end %>
|
82
|
+
<% end %>
|
@@ -1,4 +1,7 @@
|
|
1
1
|
<%
|
2
|
+
# DO NOT MAKE CHANGES TO THIS FILE
|
3
|
+
# It is a temporary copy of _translation_nav.html.erb and will be deleted shortly
|
4
|
+
|
2
5
|
brand ||= false
|
3
6
|
brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
|
4
7
|
translation_helper = GovukPublishingComponents::Presenters::TranslationNavHelper.new(local_assigns)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<%
|
2
|
+
brand ||= false
|
3
|
+
brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
|
4
|
+
translation_helper = GovukPublishingComponents::Presenters::TranslationNavHelper.new(local_assigns)
|
5
|
+
%>
|
6
|
+
<% if translation_helper.has_translations? %>
|
7
|
+
<nav role="navigation"
|
8
|
+
class="gem-c-translation-nav <%= translation_helper.classes %> <%= brand_helper.brand_class %>"
|
9
|
+
aria-label="<%= t("common.translations") %>"
|
10
|
+
<%= "data-module=\"track-click\"" if translation_helper.tracking_is_present? %>
|
11
|
+
>
|
12
|
+
<ul class="gem-c-translation-nav__list">
|
13
|
+
<% translation_helper.translations.each.with_index do |translation, i| %>
|
14
|
+
<li class="gem-c-translation-nav__list-item">
|
15
|
+
<% if translation[:active] %>
|
16
|
+
<span lang="<%= translation[:locale] %>"><%= translation[:text] %></span>
|
17
|
+
<% else %>
|
18
|
+
<%= link_to translation[:text], translation[:base_path],
|
19
|
+
hreflang: translation[:locale],
|
20
|
+
lang: translation[:locale],
|
21
|
+
rel: "alternate",
|
22
|
+
class: "gem-c-translation-nav__link #{brand_helper.color_class}",
|
23
|
+
data: translation[:data_attributes]
|
24
|
+
%>
|
25
|
+
<% end %>
|
26
|
+
</li>
|
27
|
+
<% end %>
|
28
|
+
</ul>
|
29
|
+
</nav>
|
30
|
+
<% end %>
|
@@ -60,6 +60,27 @@ examples:
|
|
60
60
|
- text: News and communications
|
61
61
|
href: "item-6"
|
62
62
|
active: true
|
63
|
+
with_custom_navigation_aria_label:
|
64
|
+
description: The navigation has `aria-label="Top level"` by default. This option is here for when the `aria-label` needs to be more descriptive than that.
|
65
|
+
data:
|
66
|
+
search_left: true
|
67
|
+
navigation_aria_label: "Departments and policy"
|
68
|
+
navigation_items:
|
69
|
+
- text: Departments
|
70
|
+
href: "item-1"
|
71
|
+
- text: Worldwide
|
72
|
+
href: "item-2"
|
73
|
+
- text: How government works
|
74
|
+
href: "item-3"
|
75
|
+
- text: Get involved
|
76
|
+
href: "item-4"
|
77
|
+
- text: Consultations
|
78
|
+
href: "item-4"
|
79
|
+
- text: Statistics
|
80
|
+
href: "item-5"
|
81
|
+
- text: News and communications
|
82
|
+
href: "item-6"
|
83
|
+
active: true
|
63
84
|
full_width:
|
64
85
|
description: |
|
65
86
|
This is difficult to preview because the preview windows are constrained, but the header will stretch to the size of its container.
|
@@ -4,11 +4,43 @@ body: |
|
|
4
4
|
This takes a content-store links hash like object which it can then turn into
|
5
5
|
the correct analytics identifier metadata tags.
|
6
6
|
|
7
|
-
|
7
|
+
These are additionally used by the <a href="https://github.com/alphagov/govuk-browser-extension">GOV.UK browser extension</a> to provide details about a given page.
|
8
|
+
|
9
|
+
The code which reads the meta tags can be found <a href="https://github.com/alphagov/govuk_publishing_components/blob/master/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js">in custom-dimensions.js</a>.
|
8
10
|
accessibility_criteria: |
|
9
11
|
The analytics meta tags component should not be visible to any users.
|
10
12
|
display_html: true
|
11
13
|
examples:
|
14
|
+
with_core_tags:
|
15
|
+
data:
|
16
|
+
content_item:
|
17
|
+
document_type: "html_publication"
|
18
|
+
publishing_app: "whitehall"
|
19
|
+
schema_name: "html_publication"
|
20
|
+
content_id: "00000000-0000-0000-0000-00000000000"
|
21
|
+
navigation_page_type: "Taxon Page"
|
22
|
+
section: "business tax"
|
23
|
+
withdrawn_notice: true
|
24
|
+
with_content_history_tags:
|
25
|
+
description: |
|
26
|
+
The tags in this object will generate the `content-has-history` tag, set to true. This tag is triggered when either, within `content_item`:
|
27
|
+
|
28
|
+
1. `public_updated_at` and `first_public_at` within `details` are both present and they aren't the same value
|
29
|
+
2. `change_history` within `details` is present and it has a value of more than 1
|
30
|
+
|
31
|
+
See below example for specific details.
|
32
|
+
data:
|
33
|
+
content_item:
|
34
|
+
public_updated_at: "2021-01-15T12:30:45.000+00:00"
|
35
|
+
details:
|
36
|
+
first_public_at: "2020-11-03T09:15:00.000+00:00"
|
37
|
+
change_history: "5"
|
38
|
+
with_date_and_postcode_stripping_for_static_analytics:
|
39
|
+
data:
|
40
|
+
content_item:
|
41
|
+
local_assigns:
|
42
|
+
strip_dates_pii: true
|
43
|
+
strip_postcodes_pii: true
|
12
44
|
with_organisations:
|
13
45
|
data:
|
14
46
|
content_item:
|
@@ -24,3 +56,69 @@ examples:
|
|
24
56
|
links:
|
25
57
|
world_locations:
|
26
58
|
- analytics_identifier: WL3
|
59
|
+
with_political_tags:
|
60
|
+
data:
|
61
|
+
content_item:
|
62
|
+
details:
|
63
|
+
political: true
|
64
|
+
government:
|
65
|
+
current: true
|
66
|
+
slug: "2010-to-2015-conservative-and-liberal-democrat-coalition-government"
|
67
|
+
with_historic_political_tags:
|
68
|
+
data:
|
69
|
+
content_item:
|
70
|
+
details:
|
71
|
+
political: true
|
72
|
+
government:
|
73
|
+
current: false
|
74
|
+
slug: "2010-to-2015-conservative-and-liberal-democrat-coalition-government"
|
75
|
+
with_non-political_tags:
|
76
|
+
data:
|
77
|
+
content_item:
|
78
|
+
details:
|
79
|
+
political: false
|
80
|
+
government:
|
81
|
+
slug: "2010-to-2015-conservative-and-liberal-democrat-coalition-government"
|
82
|
+
with_taxonomy_added_via_document_type:
|
83
|
+
description: |
|
84
|
+
You can trigger taxonomy tag rendering by either including a `document_type` attributes of "taxon" or including the `parent_taxons` or `taxons` attributes under the `links` attribute.
|
85
|
+
data:
|
86
|
+
content_item:
|
87
|
+
content_id: "00000000-0000-0000-0000-000000000000"
|
88
|
+
document_type: "taxon"
|
89
|
+
base_path: "/example-of-taxons"
|
90
|
+
with_taxonomy_added_via_links:
|
91
|
+
data:
|
92
|
+
content_item:
|
93
|
+
links:
|
94
|
+
taxons:
|
95
|
+
- content_id: "11111111-1111-1111-1111-111111111111"
|
96
|
+
document_type: "taxon"
|
97
|
+
base_path: "/disabilities-benefits"
|
98
|
+
- content_id: "22222222-2222-2222-2222-222222222222"
|
99
|
+
document_type: "taxon"
|
100
|
+
base_path: "/childcare-parenting/childrens-social-care-providers"
|
101
|
+
links:
|
102
|
+
parent_taxons:
|
103
|
+
- content_id: "33333333-3333-3333-3333-333333333333"
|
104
|
+
document_type: "taxon"
|
105
|
+
base_path: "/childcare-parenting"
|
106
|
+
with_multiple_step_by_step_tags:
|
107
|
+
data:
|
108
|
+
content_item:
|
109
|
+
links:
|
110
|
+
part_of_step_navs:
|
111
|
+
- content_id: "00000000-0000-0000-0000-000000000000"
|
112
|
+
- content_id: "11111111-1111-1111-1111-111111111111"
|
113
|
+
with_primary_step_by_step_tag:
|
114
|
+
data:
|
115
|
+
content_item:
|
116
|
+
links:
|
117
|
+
part_of_step_navs:
|
118
|
+
- content_id: "00000000-0000-0000-0000-000000000000"
|
119
|
+
with_secondary_step_by_step_tag:
|
120
|
+
data:
|
121
|
+
content_item:
|
122
|
+
links:
|
123
|
+
secondary_to_step_navs:
|
124
|
+
- content_id: "22222222-2222-2222-2222-222222222222"
|
@@ -0,0 +1,100 @@
|
|
1
|
+
name: Subscription links
|
2
|
+
description: Links to ‘Get emails’ and ‘Subscribe to feed’
|
3
|
+
body: |
|
4
|
+
<strong>NOTE: This component includes a h2 heading by default but can be suppressed by using `hide_heading` option (see below)<strong>
|
5
|
+
accessibility_criteria: |
|
6
|
+
Icons in subscription links must be presentational and ignored by screen readers.
|
7
|
+
|
8
|
+
Toggle elements in the component must:
|
9
|
+
|
10
|
+
- be usable with a keyboard
|
11
|
+
- be usable with touch
|
12
|
+
- be recognised by screen readers as a button
|
13
|
+
- announce to screen readers whether they are expanded or collapsed
|
14
|
+
- show hidden elements by default when Javascript is disabled
|
15
|
+
shared_accessibility_criteria:
|
16
|
+
- link
|
17
|
+
examples:
|
18
|
+
default:
|
19
|
+
data:
|
20
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
21
|
+
feed_link: '/foreign-travel-advice/singapore.atom'
|
22
|
+
with_margin:
|
23
|
+
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 no margin bottom, although some margin is supplied by the links themselves (so that when they stack on mobile there is space between them).
|
24
|
+
data:
|
25
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
26
|
+
feed_link: '/foreign-travel-advice/singapore.atom'
|
27
|
+
margin_bottom: 9
|
28
|
+
with_only_email_signup_link:
|
29
|
+
data:
|
30
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
31
|
+
with_only_feed_link:
|
32
|
+
data:
|
33
|
+
feed_link: '/foreign-travel-advice/singapore.atom'
|
34
|
+
with_custom_text:
|
35
|
+
data:
|
36
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
37
|
+
email_signup_link_text: 'Get notifications'
|
38
|
+
feed_link: '/foreign-travel-advice/singapore.atom'
|
39
|
+
feed_link_text: 'View feed'
|
40
|
+
with_copyable_feed_link:
|
41
|
+
description: |
|
42
|
+
This option changes the feed link to a toggle control, which opens a hidden element containing an input prepopulated with the value passed to the component, usually a URL to an atom feed. This uses the [form input](/component-guide/input) component.
|
43
|
+
|
44
|
+
Note that this option overrides the feed_link option, so if both are passed feed_link is ignored. Note that a value for email_signup_link can also be passed as normal.
|
45
|
+
data:
|
46
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
47
|
+
feed_link_box_value: 'https://www.gov.uk/government/organisations/attorney-generals-office.atom'
|
48
|
+
with_branding:
|
49
|
+
description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/master/docs/component_branding.md) can be added to the component as shown.
|
50
|
+
data:
|
51
|
+
brand: 'attorney-generals-office'
|
52
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
53
|
+
feed_link: '/foreign-travel-advice/singapore.atom'
|
54
|
+
with_tracking:
|
55
|
+
description: Data attributes can be passed for each link as shown.
|
56
|
+
data:
|
57
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
58
|
+
email_signup_link_data_attributes: {
|
59
|
+
track_category: 'email_link_category',
|
60
|
+
track_action: 1.1,
|
61
|
+
track_label: 'email_link_label',
|
62
|
+
track_options: {
|
63
|
+
dimension28: 1,
|
64
|
+
dimension29: 'dimension29EmailLink'
|
65
|
+
}
|
66
|
+
}
|
67
|
+
feed_link_box_value: 'https://www.gov.uk/government/organisations/attorney-generals-office.atom'
|
68
|
+
feed_link_data_attributes: {
|
69
|
+
track_category: 'feed_link_category',
|
70
|
+
track_action: 1.2,
|
71
|
+
track_label: 'feed_link_label',
|
72
|
+
track_options: {
|
73
|
+
dimension28: 7,
|
74
|
+
dimension29: 'dimension29feedLink'
|
75
|
+
}
|
76
|
+
}
|
77
|
+
as_small_form:
|
78
|
+
data:
|
79
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
80
|
+
feed_link: '/foreign-travel-advice/singapore.atom'
|
81
|
+
small_form: true
|
82
|
+
without_heading:
|
83
|
+
description: |
|
84
|
+
By default the component includes an h2 heading. The component could be used anywhere on the page and could mean that it produces invalid markup or make the site unaccessible.
|
85
|
+
data:
|
86
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
87
|
+
feed_link: '/foreign-travel-advice/singapore.atom'
|
88
|
+
hide_heading: true
|
89
|
+
with_a_different_language:
|
90
|
+
data:
|
91
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
92
|
+
email_signup_link_text: 'Recevez des notifications'
|
93
|
+
email_signup_link_text_locale: 'fr'
|
94
|
+
feed_link: '/foreign-travel-advice/singapore.atom'
|
95
|
+
feed_link_text: 'Flux RSS'
|
96
|
+
feed_link_text_locale: 'fr'
|
97
|
+
description: |
|
98
|
+
The component is used on translated pages that don't have a translation for the text strings. This means that it could display the fallback English string if the translate method can't find an appropriate translation. This makes sure that the `lang` can be set to ensure that browsers understand which parts of the page are in each language.
|
99
|
+
|
100
|
+
The `lang` attribute **must** be set to a [valid BCP47 string](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang#Language_tag_syntax). A valid code can be the two or three letter language code - for example, English is `en` or `eng`, Korean is `ko` or `kor` - but if in doubt please check.
|