govuk_publishing_components 23.15.0 → 24.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +0 -4
  3. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +23 -14
  4. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +0 -1
  5. data/app/assets/stylesheets/govuk_publishing_components/component_support.scss +0 -2
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +4 -4
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +101 -48
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +8 -8
  9. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +0 -5
  10. data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss +2 -2
  11. data/app/views/govuk_publishing_components/components/_document_list.html.erb +10 -1
  12. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +5 -0
  13. data/app/views/govuk_publishing_components/components/docs/document_list.yml +18 -0
  14. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +3 -3
  15. data/config/initializers/assets.rb +0 -1
  16. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +61 -2
  17. data/lib/govuk_publishing_components/version.rb +1 -1
  18. data/node_modules/govuk-frontend/govuk/all.js +1 -1
  19. data/node_modules/govuk-frontend/govuk/components/_all.scss +1 -0
  20. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +10 -10
  21. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/template.njk +2 -2
  22. data/node_modules/govuk-frontend/govuk/components/button/_index.scss +2 -0
  23. data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +1 -0
  24. data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +1 -1
  25. data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +13 -0
  26. data/node_modules/govuk-frontend/govuk/components/cookie-banner/_cookie-banner.scss +2 -0
  27. data/node_modules/govuk-frontend/govuk/components/cookie-banner/_index.scss +51 -0
  28. data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +425 -0
  29. data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro-options.json +132 -0
  30. data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro.njk +3 -0
  31. data/node_modules/govuk-frontend/govuk/components/cookie-banner/template.njk +63 -0
  32. data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +2 -2
  33. data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +18 -18
  34. data/node_modules/govuk-frontend/govuk/components/header/template.njk +4 -4
  35. data/node_modules/govuk-frontend/govuk/components/table/_index.scss +21 -0
  36. data/node_modules/govuk-frontend/govuk/components/table/macro-options.json +2 -2
  37. data/node_modules/govuk-frontend/govuk/objects/_all.scss +1 -0
  38. data/node_modules/govuk-frontend/govuk/objects/_button-group.scss +94 -0
  39. data/node_modules/govuk-frontend/package.json +1 -1
  40. metadata +9 -17
  41. data/app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small-focus.svg +0 -4
  42. data/app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small.svg +0 -4
  43. data/app/assets/javascripts/govuk_publishing_components/components/header.js +0 -8
  44. data/app/assets/javascripts/govuk_publishing_components/lib/auto-track-event.js +0 -31
  45. data/app/assets/stylesheets/govuk_publishing_components/components/_chevron-banner.scss +0 -138
  46. data/app/assets/stylesheets/govuk_publishing_components/components/_list.scss +0 -1
  47. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_variables.scss +0 -27
  48. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_back-arrow.scss +0 -13
  49. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_clearfix.scss +0 -8
  50. data/app/views/govuk_publishing_components/components/_chevron_banner.html.erb +0 -19
  51. data/app/views/govuk_publishing_components/components/_subscription-links.html.erb +0 -85
  52. data/app/views/govuk_publishing_components/components/_translation-nav.html.erb +0 -33
  53. data/app/views/govuk_publishing_components/components/docs/chevron_banner.yml +0 -33
  54. data/app/views/govuk_publishing_components/components/docs/subscription-links.yml +0 -103
  55. data/app/views/govuk_publishing_components/components/docs/translation-nav.yml +0 -139
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg viewBox="0 0 104 122" xmlns="http://www.w3.org/2000/svg">
3
- <path d="m0.81268 5.0662l51.363 54.069c1.0996 1.1575 1.1 2.9735 8.258e-4 4.1315l-50.942 53.668c-1.1407 1.2017-1.0912 3.1006 0.11054 4.2412 0.55745 0.52914 1.2967 0.82413 2.0653 0.82413h41.812c0.8157 0 1.5962-0.33215 2.1618-0.91994l55.613-57.799c1.1179-1.1618 1.1176-2.9994-7.29e-4 -4.1609l-56.04-58.201c-0.56552-0.58733-1.3457-0.91919-2.1611-0.91919h-41.809c-1.6569 0-3 1.3431-3 3 0 0.76901 0.29531 1.5087 0.82496 2.0662z" fill-rule="evenodd"/>
4
- </svg>
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg viewBox="0 0 104 122" xmlns="http://www.w3.org/2000/svg">
3
- <path d="m0.81268 5.0662l51.363 54.069c1.0996 1.1575 1.1 2.9735 8.258e-4 4.1315l-50.942 53.668c-1.1407 1.2017-1.0912 3.1006 0.11054 4.2412 0.55745 0.52914 1.2967 0.82413 2.0653 0.82413h41.812c0.8157 0 1.5962-0.33215 2.1618-0.91994l55.613-57.799c1.1179-1.1618 1.1176-2.9994-7.29e-4 -4.1609l-56.04-58.201c-0.56552-0.58733-1.3457-0.91919-2.1611-0.91919h-41.809c-1.6569 0-3 1.3431-3 3 0 0.76901 0.29531 1.5087 0.82496 2.0662z" fill="#FFF" fill-rule="evenodd"/>
4
- </svg>
@@ -1,8 +0,0 @@
1
- // DO NOT MAKE CHANGES TO THIS FILE
2
- // It is a temporary copy of layout-header.js and will be deleted shortly
3
-
4
- // This component relies on JavaScript from GOV.UK Frontend
5
- // = require govuk/components/header/header.js
6
- window.GOVUK = window.GOVUK || {}
7
- window.GOVUK.Modules = window.GOVUK.Modules || {}
8
- window.GOVUK.Modules.Header = window.GOVUKFrontend
@@ -1,31 +0,0 @@
1
- // migrated from govuk_frontend_toolkit
2
- ;(function (global) {
3
- 'use strict'
4
-
5
- var GOVUK = global.GOVUK || {}
6
- GOVUK.Modules = GOVUK.Modules || {}
7
-
8
- GOVUK.Modules.AutoTrackEvent = function () {
9
- this.start = function (element) {
10
- var options = { nonInteraction: 1 } // automatic events shouldn't affect bounce rate
11
- var category = element.data('track-category')
12
- var action = element.data('track-action')
13
- var label = element.data('track-label')
14
- var value = element.data('track-value')
15
-
16
- if (typeof label === 'string') {
17
- options.label = label
18
- }
19
-
20
- if (value || value === 0) {
21
- options.value = value
22
- }
23
-
24
- if (GOVUK.analytics && GOVUK.analytics.trackEvent) {
25
- GOVUK.analytics.trackEvent(category, action, options)
26
- }
27
- }
28
- }
29
-
30
- global.GOVUK = GOVUK
31
- })(window)
@@ -1,138 +0,0 @@
1
- $red: #e61e32;
2
- $dark-red: #b31424;
3
- $yellow: #ffdd00;
4
-
5
- .gem-c-chevron-banner {
6
- position: relative;
7
- }
8
-
9
- .gem-c-chevron-banner__chevron-point,
10
- .gem-c-chevron-banner__chevron-base {
11
- stroke: $red;
12
- stroke-width: 2.4;
13
- }
14
-
15
- .gem-c-chevron-banner:hover,
16
- .gem-c-chevron-banner--hover-border:hover {
17
- .gem-c-chevron-banner__text {
18
- background-color: $dark-red;
19
- border-color: $dark-red;
20
- }
21
-
22
- .gem-c-chevron-banner__chevron-point,
23
- .gem-c-chevron-banner__chevron-base {
24
- fill: $dark-red;
25
- stroke: $dark-red;
26
- }
27
- }
28
-
29
- .gem-c-chevron-banner--hover-border:hover {
30
- .gem-c-chevron-banner__text {
31
- border-color: govuk-colour("white");
32
- }
33
-
34
- .gem-c-chevron-banner__chevron-point,
35
- .gem-c-chevron-banner__chevron-base {
36
- stroke: govuk-colour("white");
37
- }
38
- }
39
-
40
- .gem-c-chevron-banner__link:focus {
41
- background-color: transparent; // This is to override some generic link styling which sets a background colour on focus
42
- text-decoration: none;
43
- outline: 0;
44
-
45
- .gem-c-chevron-banner__text {
46
- color: govuk-colour("black");
47
- background-color: $yellow;
48
- border-color: govuk-colour("black");
49
- }
50
-
51
- .gem-c-chevron-banner__text:after {
52
- background-image: image-url("govuk_publishing_components/chevron-banner/chevron-banner-small-focus.svg");
53
- }
54
-
55
- .gem-c-chevron-banner__chevron-point,
56
- .gem-c-chevron-banner__chevron-base {
57
- fill: $yellow;
58
- stroke: govuk-colour("black");
59
- }
60
- }
61
-
62
- .gem-c-chevron-banner__chevron {
63
- display: none;
64
-
65
- @include govuk-media-query(450px) {
66
- display: inline-block;
67
- height: 100%;
68
- position: absolute;
69
- left: 70%;
70
- margin-left: (45px + govuk-spacing(4));
71
- top: 0;
72
- }
73
-
74
- @include govuk-media-query($from: 450px, $until: desktop) {
75
- margin-left: (25px + govuk-spacing(2));
76
- }
77
- }
78
-
79
- .gem-c-chevron-banner__text:after {
80
- content: "";
81
- position: absolute;
82
- right: 15px;
83
- top: 0;
84
- width: 25px;
85
- height: 100%;
86
- background-image: image-url("govuk_publishing_components/chevron-banner/chevron-banner-small.svg");
87
- background-size: 25px 25px;
88
- background-repeat: no-repeat;
89
- background-position: center right;
90
-
91
- @include govuk-media-query(450px) {
92
- display: none;
93
- }
94
- }
95
-
96
- .gem-c-chevron-banner__text {
97
- display: block;
98
- position: relative;
99
- padding: govuk-spacing(4) 45px govuk-spacing(4) govuk-spacing(4);
100
- background-color: $red;
101
- border-radius: 5px;
102
- box-sizing: border-box;
103
- width: 100%;
104
- border: 2px solid $red;
105
- z-index: 1;
106
-
107
- @include govuk-media-query($from: 450px, $until: desktop) {
108
- padding: govuk-spacing(2) 25px govuk-spacing(2) govuk-spacing(2);
109
- }
110
-
111
- @include govuk-media-query($from: 450px) {
112
- border-radius: 5px 0 0 5px;
113
- border-right: 0;
114
- width: 70%;
115
- box-sizing: content-box;
116
- }
117
- }
118
-
119
- .gem-c-chevron-banner__link:link,
120
- .gem-c-chevron-banner__link:visited,
121
- .gem-c-chevron-banner__link:hover {
122
- @include govuk-font(24, $weight: bold);
123
- color: govuk-colour("white");
124
- text-decoration: none;
125
- }
126
-
127
- // IE "hack" to stop the chevron SVG being stretched
128
- @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
129
- .gem-c-chevron-banner__chevron {
130
- max-width: 160px;
131
- }
132
- }
133
-
134
- @media screen and (min-width: 0\0) {
135
- .gem-c-chevron-banner__chevron {
136
- max-width: 160px;
137
- }
138
- }
@@ -1 +0,0 @@
1
- @import "govuk/components/list/list";
@@ -1,27 +0,0 @@
1
- // Forked from GOV.UK Frontend, namespace changed to ensure no conflicts.
2
-
3
- $gem-spacing-scale-0: 0;
4
- $gem-spacing-scale-1: 5px;
5
- $gem-spacing-scale-2: 10px;
6
- $gem-spacing-scale-3: 15px;
7
- $gem-spacing-scale-4: 20px;
8
- $gem-spacing-scale-5: 30px;
9
- $gem-spacing-scale-6: 40px;
10
- $gem-spacing-scale-7: 50px;
11
- $gem-spacing-scale-8: 60px;
12
-
13
- $gem-text-colour: $govuk-text-colour;
14
- $gem-secondary-text-colour: $govuk-secondary-text-colour;
15
-
16
- // Border widths
17
- $gem-border-width-mobile: 4px;
18
- $gem-border-width-tablet: 5px;
19
- $gem-border-width-form-element: 2px;
20
- $gem-border-width-error: 4px;
21
-
22
- // Focus
23
- $gem-focus-width: 3px;
24
- $gem-focus-colour: $govuk-focus-colour;
25
-
26
- $gem-error-colour: govuk-colour("red");
27
- $gem-success-colour: govuk-colour("green");
@@ -1,13 +0,0 @@
1
- // An arrow to represent a "back" link
2
-
3
- @mixin back-arrow {
4
- border-bottom: 5px solid transparent;
5
- border-right: 6px solid;
6
- border-top: 5px solid transparent;
7
- content: "";
8
- display: block;
9
- left: 0;
10
- margin-top: -6px;
11
- position: absolute;
12
- top: 50%;
13
- }
@@ -1,8 +0,0 @@
1
- // Mixin to clear floats
2
- @mixin gem-h-clearfix {
3
- &:after {
4
- content: "";
5
- display: block;
6
- clear: both;
7
- }
8
- }
@@ -1,19 +0,0 @@
1
- <%
2
- href ||= false
3
- text ||= false
4
- hover_border ||= false
5
-
6
- data_attributes ||= {}
7
- data_attributes[:module] = 'track-click' if data_attributes.any?
8
- %>
9
- <% if href && text %>
10
- <div class="gem-c-chevron-banner <%= "gem-c-chevron-banner--hover-border" if hover_border %>">
11
- <%= link_to href, class: "gem-c-chevron-banner__link", data: data_attributes, role: "link" do %>
12
- <span class="gem-c-chevron-banner__text"><%= text %></span>
13
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 175 109" class="gem-c-chevron-banner__chevron" preserveAspectRatio="xMidYMid meet">
14
- <path class="gem-c-chevron-banner__chevron-point" fill="#E61E32" fill-rule="nonzero" d="M91.611 51.664c1.0371 1.1432 1.0375 2.8869.000802 4.0305l-44.991 49.634c-.37092.40919-.33989 1.0416.069307 1.4125.18394.16674.42334.25909.6716.25909h36.892c.55978 0 1.0939-.2346 1.4727-.6468l46.534-50.643c1.0549-1.148 1.0546-2.9127-.000709-4.0604L85.3617.64689c-.37873-.41188-.91268-.64628-1.4722-.64628h-36.891c-.55228 0-1 .44772-1 1 0 .24841.092454.48792.25936.6719l45.352 49.992z" transform="translate(0 1)"></path>
15
- <path class="gem-c-chevron-banner__chevron-base" fill="#E61E32" fill-rule="nonzero" d="M-37.997 1l.35768 107h40.408c.55978 0 1.0939-.2346 1.4727-.6468l46.534-50.643c1.0549-1.148 1.0546-2.9127-.0007095-4.0604l-46.898-51.003c-.37873-.41188-.91268-.64628-1.4722-.64628h-40.402z" vector-effect="non-scaling-stroke"></path>
16
- </svg>
17
- <% end %>
18
- </div>
19
- <% end %>
@@ -1,85 +0,0 @@
1
- <%
2
- # DO NOT MAKE CHANGES TO THIS FILE
3
- # It is a temporary copy of _subscription_links.html.erb and will be deleted shortly
4
-
5
- brand ||= false
6
- brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
7
-
8
- sl_helper = GovukPublishingComponents::Presenters::SubscriptionLinksHelper.new(local_assigns)
9
- shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
10
-
11
- local_assigns[:margin_bottom] ||= 0
12
- local_assigns[:margin_bottom] = 0 if local_assigns[:margin_bottom] > 9
13
-
14
- css_classes = %w( gem-c-subscription-links )
15
- css_classes << (shared_helper.get_margin_bottom) unless local_assigns[:margin_bottom] == 0
16
- css_classes << brand_helper.brand_class
17
- css_classes << "gem-c-subscription-links--with-feed-box" if sl_helper.feed_link_box_value
18
-
19
- data = {"module": "gem-toggle"} if sl_helper.feed_link_box_value
20
-
21
- hide_heading ||= false
22
-
23
- email_signup_link_text_locale = local_assigns[:email_signup_link_text_locale].presence
24
- feed_link_text_locale = local_assigns[:feed_link_text_locale].presence
25
- %>
26
- <% if sl_helper.component_data_is_valid? %>
27
- <%= tag.section class: css_classes, data: data do %>
28
- <% unless hide_heading %>
29
- <h2 class="gem-c-subscription-links__hidden-header visuallyhidden"><%= t("govuk_component.subscription_links.subscriptions", default: "Subscriptions") %></h2>
30
- <% end %>
31
- <ul
32
- class="gem-c-subscription-links__list<%= ' gem-c-subscription-links__list--small' if local_assigns[:small_form] == true %>"
33
- <%= "data-module=track-click" if sl_helper.tracking_is_present? %>
34
- >
35
- <% if sl_helper.email_signup_link.present? %>
36
- <li class="gem-c-subscription-links__list-item<%= ' gem-c-subscription-links__list-item--small' if local_assigns[:small_form] == true %>" >
37
- <% email_link_text = capture do %>
38
- <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>
39
- <%= sl_helper.email_signup_link_text %>
40
- <% end %>
41
- <%= link_to email_link_text, sl_helper.email_signup_link, {
42
- class: "gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--link",
43
- data: sl_helper.email_signup_link_data_attributes,
44
- lang: email_signup_link_text_locale
45
- } %>
46
- </li>
47
- <% end %>
48
-
49
- <% if sl_helper.feed_link_box_value || sl_helper.feed_link %>
50
- <li class="gem-c-subscription-links__list-item<%= ' gem-c-subscription-links__list-item--small' if local_assigns[:small_form] == true %>">
51
- <% feed_link_text = capture do %>
52
- <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>
53
- <%= sl_helper.feed_link_text %>
54
- <% end %>
55
- <%= tag.button feed_link_text, {
56
- class: "gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--button",
57
- data: sl_helper.feed_link_data_attributes,
58
- lang: feed_link_text_locale
59
- } if sl_helper.feed_link_box_value %>
60
- <%= link_to feed_link_text, sl_helper.feed_link,
61
- {
62
- class: "gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--link",
63
- data: sl_helper.feed_link_data_attributes,
64
- lang: feed_link_text_locale
65
- } unless sl_helper.feed_link_box_value %>
66
- </li>
67
- <% end %>
68
- </ul>
69
-
70
- <% if sl_helper.feed_link_box_value %>
71
- <div class="gem-c-subscription-links__feed-box js-hidden" id="<%= sl_helper.feed_box_id %>">
72
- <h3 class="gem-c-subscription-links__feed-hidden-description visuallyhidden govuk-!-margin-top-0"><%= sl_helper.feed_link_text %></h3>
73
- <div lang="en">
74
- <%= render "govuk_publishing_components/components/input", {
75
- label: {
76
- text: "Copy and paste this URL into your feed reader"
77
- },
78
- name: "feed-reader-box",
79
- value: feed_link_box_value
80
- } %>
81
- </div>
82
- </div>
83
- <% end %>
84
- <% end %>
85
- <% end %>
@@ -1,33 +0,0 @@
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
-
5
- brand ||= false
6
- brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
7
- translation_helper = GovukPublishingComponents::Presenters::TranslationNavHelper.new(local_assigns)
8
- %>
9
- <% if translation_helper.has_translations? %>
10
- <nav role="navigation"
11
- class="gem-c-translation-nav <%= translation_helper.classes %> <%= brand_helper.brand_class %>"
12
- aria-label="<%= t("common.translations") %>"
13
- <%= "data-module=\"track-click\"" if translation_helper.tracking_is_present? %>
14
- >
15
- <ul class="gem-c-translation-nav__list">
16
- <% translation_helper.translations.each.with_index do |translation, i| %>
17
- <li class="gem-c-translation-nav__list-item">
18
- <% if translation[:active] %>
19
- <span lang="<%= translation[:locale] %>"><%= translation[:text] %></span>
20
- <% else %>
21
- <%= link_to translation[:text], translation[:base_path],
22
- hreflang: translation[:locale],
23
- lang: translation[:locale],
24
- rel: "alternate",
25
- class: "gem-c-translation-nav__link #{brand_helper.color_class}",
26
- data: translation[:data_attributes]
27
- %>
28
- <% end %>
29
- </li>
30
- <% end %>
31
- </ul>
32
- </nav>
33
- <% end %>
@@ -1,33 +0,0 @@
1
- name: Chevron Banner
2
- description: A branded banner for use on EU Exit campaign pages. This should not be used on non-campaign pages.
3
- accessibility_criteria: |
4
- The component must:
5
-
6
- - accept focus
7
- - be focusable with a keyboard
8
- - be usable with a keyboard
9
- - be usable with touch
10
- - indicate when they have focus
11
-
12
- shared_accessibility_criteria:
13
- - link
14
- examples:
15
- default:
16
- data:
17
- href: '/test-link'
18
- text: 'Gwiriwch beth sydd angen i chi wneud os nad oes cytundeb'
19
- with_hover_border:
20
- data:
21
- href: '/test-link'
22
- text: 'This is some text'
23
- hover_border: true
24
- context:
25
- dark_background: true
26
- with_data_attributes:
27
- data:
28
- href: '/test-link'
29
- text: 'This is some text'
30
- data_attributes:
31
- track-category: "startButtonClicked"
32
- track-action: "/test-link"
33
- track-label: "This is some text"
@@ -1,103 +0,0 @@
1
- # DO NOT MAKE CHANGES TO THIS FILE
2
- # It is a temporary copy of subscription_links.yml and will be deleted shortly
3
-
4
- name: Subscription links
5
- description: Links to ‘Get emails’ and ‘Subscribe to feed’
6
- body: |
7
- <strong>NOTE: This component includes a h2 heading by default but can be suppressed by using `hide_heading` option (see below)<strong>
8
- accessibility_criteria: |
9
- Icons in subscription links must be presentational and ignored by screen readers.
10
-
11
- Toggle elements in the component must:
12
-
13
- - be usable with a keyboard
14
- - be usable with touch
15
- - be recognised by screen readers as a button
16
- - announce to screen readers whether they are expanded or collapsed
17
- - show hidden elements by default when Javascript is disabled
18
- shared_accessibility_criteria:
19
- - link
20
- examples:
21
- default:
22
- data:
23
- email_signup_link: '/foreign-travel-advice/singapore/email-signup'
24
- feed_link: '/foreign-travel-advice/singapore.atom'
25
- with_margin:
26
- 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).
27
- data:
28
- email_signup_link: '/foreign-travel-advice/singapore/email-signup'
29
- feed_link: '/foreign-travel-advice/singapore.atom'
30
- margin_bottom: 9
31
- with_only_email_signup_link:
32
- data:
33
- email_signup_link: '/foreign-travel-advice/singapore/email-signup'
34
- with_only_feed_link:
35
- data:
36
- feed_link: '/foreign-travel-advice/singapore.atom'
37
- with_custom_text:
38
- data:
39
- email_signup_link: '/foreign-travel-advice/singapore/email-signup'
40
- email_signup_link_text: 'Get notifications'
41
- feed_link: '/foreign-travel-advice/singapore.atom'
42
- feed_link_text: 'View feed'
43
- with_copyable_feed_link:
44
- description: |
45
- 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.
46
-
47
- 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.
48
- data:
49
- email_signup_link: '/foreign-travel-advice/singapore/email-signup'
50
- feed_link_box_value: 'https://www.gov.uk/government/organisations/attorney-generals-office.atom'
51
- with_branding:
52
- 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.
53
- data:
54
- brand: 'attorney-generals-office'
55
- email_signup_link: '/foreign-travel-advice/singapore/email-signup'
56
- feed_link: '/foreign-travel-advice/singapore.atom'
57
- with_tracking:
58
- description: Data attributes can be passed for each link as shown.
59
- data:
60
- email_signup_link: '/foreign-travel-advice/singapore/email-signup'
61
- email_signup_link_data_attributes: {
62
- track_category: 'email_link_category',
63
- track_action: 1.1,
64
- track_label: 'email_link_label',
65
- track_options: {
66
- dimension28: 1,
67
- dimension29: 'dimension29EmailLink'
68
- }
69
- }
70
- feed_link_box_value: 'https://www.gov.uk/government/organisations/attorney-generals-office.atom'
71
- feed_link_data_attributes: {
72
- track_category: 'feed_link_category',
73
- track_action: 1.2,
74
- track_label: 'feed_link_label',
75
- track_options: {
76
- dimension28: 7,
77
- dimension29: 'dimension29feedLink'
78
- }
79
- }
80
- as_small_form:
81
- data:
82
- email_signup_link: '/foreign-travel-advice/singapore/email-signup'
83
- feed_link: '/foreign-travel-advice/singapore.atom'
84
- small_form: true
85
- without_heading:
86
- description: |
87
- 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.
88
- data:
89
- email_signup_link: '/foreign-travel-advice/singapore/email-signup'
90
- feed_link: '/foreign-travel-advice/singapore.atom'
91
- hide_heading: true
92
- with_a_different_language:
93
- data:
94
- email_signup_link: '/foreign-travel-advice/singapore/email-signup'
95
- email_signup_link_text: 'Recevez des notifications'
96
- email_signup_link_text_locale: 'fr'
97
- feed_link: '/foreign-travel-advice/singapore.atom'
98
- feed_link_text: 'Flux RSS'
99
- feed_link_text_locale: 'fr'
100
- description: |
101
- 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.
102
-
103
- 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.