govuk_publishing_components 23.13.1 → 24.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/take-action-amber.svg +4 -0
  3. data/app/assets/images/govuk_publishing_components/take-action-green.svg +4 -0
  4. data/app/assets/images/govuk_publishing_components/take-action-red.svg +4 -0
  5. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +286 -4
  6. data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +0 -4
  7. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +23 -14
  8. data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills/common.js +8 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +0 -1
  10. data/app/assets/stylesheets/govuk_publishing_components/component_support.scss +0 -2
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +298 -14
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +34 -17
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +14 -8
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +4 -4
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +35 -44
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +21 -5
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +105 -48
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +8 -8
  19. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +0 -5
  20. data/app/assets/stylesheets/govuk_publishing_components/components/print/_accordion.scss +17 -9
  21. data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss +2 -2
  22. data/app/assets/stylesheets/govuk_publishing_components/govuk_frontend_support.scss +1 -11
  23. data/app/models/govuk_publishing_components/audit_applications.rb +1 -1
  24. data/app/models/govuk_publishing_components/component_doc.rb +1 -1
  25. data/app/views/govuk_publishing_components/audit/show.html.erb +26 -26
  26. data/app/views/govuk_publishing_components/components/_accordion.html.erb +13 -20
  27. data/app/views/govuk_publishing_components/components/_attachment.html.erb +3 -3
  28. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +2 -8
  29. data/app/views/govuk_publishing_components/components/_document_list.html.erb +12 -2
  30. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +9 -4
  31. data/app/views/govuk_publishing_components/components/attachment/{_thumbnail_document.svg → _thumbnail_document.html.erb} +0 -0
  32. data/app/views/govuk_publishing_components/components/attachment/{_thumbnail_generic.svg → _thumbnail_generic.html.erb} +0 -0
  33. data/app/views/govuk_publishing_components/components/attachment/{_thumbnail_spreadsheet.svg → _thumbnail_spreadsheet.html.erb} +0 -0
  34. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +21 -0
  35. data/app/views/govuk_publishing_components/components/docs/accordion.yml +8 -3
  36. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +65 -1
  37. data/app/views/govuk_publishing_components/components/docs/document_list.yml +50 -7
  38. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +3 -3
  39. data/app/views/govuk_publishing_components/components/docs/layout_header.yml +11 -0
  40. data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +1 -1
  41. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +9 -4
  42. data/config/initializers/assets.rb +3 -1
  43. data/config/locales/cy.yml +6 -1
  44. data/config/locales/en.yml +6 -1
  45. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +183 -2
  46. data/lib/govuk_publishing_components/version.rb +1 -1
  47. data/node_modules/govuk-frontend/govuk/all.js +1 -1
  48. data/node_modules/govuk-frontend/govuk/components/_all.scss +1 -0
  49. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +10 -10
  50. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/template.njk +2 -2
  51. data/node_modules/govuk-frontend/govuk/components/button/_index.scss +2 -0
  52. data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +1 -0
  53. data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +1 -1
  54. data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +13 -0
  55. data/node_modules/govuk-frontend/govuk/components/cookie-banner/_cookie-banner.scss +2 -0
  56. data/node_modules/govuk-frontend/govuk/components/cookie-banner/_index.scss +51 -0
  57. data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +425 -0
  58. data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro-options.json +132 -0
  59. data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro.njk +3 -0
  60. data/node_modules/govuk-frontend/govuk/components/cookie-banner/template.njk +63 -0
  61. data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +2 -2
  62. data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +18 -18
  63. data/node_modules/govuk-frontend/govuk/components/header/template.njk +4 -4
  64. data/node_modules/govuk-frontend/govuk/components/table/_index.scss +21 -0
  65. data/node_modules/govuk-frontend/govuk/components/table/macro-options.json +2 -2
  66. data/node_modules/govuk-frontend/govuk/objects/_all.scss +1 -0
  67. data/node_modules/govuk-frontend/govuk/objects/_button-group.scss +94 -0
  68. data/node_modules/govuk-frontend/package.json +1 -1
  69. metadata +16 -21
  70. data/app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small-focus.svg +0 -4
  71. data/app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small.svg +0 -4
  72. data/app/assets/javascripts/govuk_publishing_components/components/header.js +0 -8
  73. data/app/assets/javascripts/govuk_publishing_components/lib/auto-track-event.js +0 -31
  74. data/app/assets/stylesheets/govuk_publishing_components/components/_chevron-banner.scss +0 -138
  75. data/app/assets/stylesheets/govuk_publishing_components/components/_list.scss +0 -1
  76. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_variables.scss +0 -27
  77. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_back-arrow.scss +0 -13
  78. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_clearfix.scss +0 -8
  79. data/app/views/govuk_publishing_components/components/_chevron_banner.html.erb +0 -19
  80. data/app/views/govuk_publishing_components/components/_subscription-links.html.erb +0 -85
  81. data/app/views/govuk_publishing_components/components/_translation-nav.html.erb +0 -33
  82. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_related_links.html.erb +0 -6
  83. data/app/views/govuk_publishing_components/components/docs/chevron_banner.yml +0 -33
  84. data/app/views/govuk_publishing_components/components/docs/subscription-links.yml +0 -103
  85. data/app/views/govuk_publishing_components/components/docs/translation-nav.yml +0 -139
@@ -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,6 +0,0 @@
1
- <% link_text = t("components.related_navigation.transition.link_text") %>
2
- <% link_path = t("components.related_navigation.transition.link_path") %>
3
- <div class="gem-c-contextual-sidebar__brexit-related-links govuk-!-margin-bottom-6" data-module="track-click" lang="en">
4
- <h2 class="gem-c-contextual-sidebar__brexit-heading"><%= t("components.related_navigation.transition.title") %></h2>
5
- <a href="<%= link_path %>" class="govuk-link" data-track-category="relatedLinkClicked" data-track-action="1.0 Transition" data-track-label="<%= link_path %>" data-track-options='{"dimension29":"<%= link_text %>"}'><%= link_text %></a>
6
- </div>
@@ -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.
@@ -1,139 +0,0 @@
1
- # DO NOT MAKE CHANGES TO THIS FILE
2
- # It is a temporary copy of translation_nav.yml and will be deleted shortly
3
-
4
- name: Translation navigation
5
- description: A list of links to available translations
6
- body: The active property indicates the current language.
7
- accessibility_criteria: |
8
- The component must:
9
-
10
- - be [a landmark with a navigation role](https://accessibility.blog.gov.uk/2016/05/27/using-navigation-landmarks/)
11
- - have an accessible name in the current language, eg "Translations"
12
-
13
- The translation links must:
14
-
15
- - [identify the language of the text](https://www.w3.org/TR/UNDERSTANDING-WCAG20/meaning-other-lang-id.html#meaning-other-lang-id-examples-head)
16
-
17
- [Watch a screen reader pronounce text differently based on lang attribute](https://bit.ly/screenreaderpronunciation)
18
- shared_accessibility_criteria:
19
- - link
20
- examples:
21
- default:
22
- data:
23
- translations:
24
- - locale: 'en'
25
- base_path: '/en'
26
- text: 'English'
27
- active: true
28
- - locale: 'hi'
29
- base_path: '/hi'
30
- text: 'हिंदी'
31
- multiple_translations:
32
- data:
33
- translations:
34
- - locale: 'en'
35
- base_path: '/en'
36
- text: 'English'
37
- active: true
38
- - locale: 'fr'
39
- base_path: '/fr'
40
- text: 'Français'
41
- - locale: 'hi'
42
- base_path: '/hi'
43
- text: 'हिंदी'
44
- - locale: 'ja'
45
- base_path: '/ja'
46
- text: '日本語'
47
- - locale: 'ur'
48
- base_path: '/ur'
49
- text: 'اردو'
50
- - locale: 'zh'
51
- base_path: '/zh'
52
- text: '中文'
53
- right_to_left:
54
- data:
55
- translations:
56
- - locale: 'en'
57
- base_path: '/en'
58
- text: 'English'
59
- - locale: 'ar'
60
- base_path: '/ar'
61
- text: 'العربية'
62
- active: true
63
- context:
64
- right_to_left: true
65
- with_branding:
66
- 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.
67
- data:
68
- brand: 'wales-office'
69
- translations:
70
- - locale: 'en'
71
- base_path: '/en'
72
- text: 'English'
73
- active: true
74
- - locale: 'cy'
75
- base_path: '/cy'
76
- text: 'Cymraeg'
77
- with_no_top_margin:
78
- data:
79
- no_margin_top: true
80
- translations:
81
- - locale: 'en'
82
- base_path: '/en'
83
- text: 'English'
84
- active: true
85
- - locale: 'cy'
86
- base_path: '/cy'
87
- text: 'Cymraeg'
88
- with_tracking:
89
- description: Data attributes can be passed for each link as shown.
90
- data:
91
- translations:
92
- - locale: 'en'
93
- base_path: '/en'
94
- text: 'English'
95
- active: true
96
- data_attributes:
97
- track_category: 'categoryEnglish'
98
- track_action: 1.1
99
- track_label: 'labelEnglish'
100
- track_options:
101
- dimension28: 1
102
- dimension29: 'dimension29English'
103
- - locale: 'cy'
104
- base_path: '/cy'
105
- text: 'Cymraeg'
106
- data_attributes:
107
- track_category: 'categoryWelsh'
108
- track_action: 1.2
109
- track_label: 'labelWelsh'
110
- track_options:
111
- dimension28: 1
112
- dimension29: 'dimension29Welsh'
113
- inverse:
114
- data:
115
- inverse: true
116
- translations:
117
- - locale: 'en'
118
- base_path: '/en'
119
- text: 'English'
120
- active: true
121
- data_attributes:
122
- track_category: 'categoryEnglish'
123
- track_action: 1.1
124
- track_label: 'labelEnglish'
125
- track_options:
126
- dimension28: 1
127
- dimension29: 'dimension29English'
128
- - locale: 'cy'
129
- base_path: '/cy'
130
- text: 'Cymraeg'
131
- data_attributes:
132
- track_category: 'categoryWelsh'
133
- track_action: 1.2
134
- track_label: 'labelWelsh'
135
- track_options:
136
- dimension28: 1
137
- dimension29: 'dimension29Welsh'
138
- context:
139
- dark_background: true