govuk_publishing_components 56.1.0 → 56.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/components/service-navigation.js +5 -0
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_service-navigation.scss +2 -0
- data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_service_navigation.html.erb +61 -0
- data/app/views/govuk_publishing_components/components/_summary_banner.html.erb +3 -2
- data/app/views/govuk_publishing_components/components/docs/service_navigation.yml +42 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d04da5aec01a8aa95f8821ceb98468cb2abdec1bd8940f150a2a731d19bcc3cc
|
4
|
+
data.tar.gz: 7e0224213c7843ab1913ad42cb90b75571bea7f87e27e8a7a07d3c5b3c5450f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 835fba7ec8ce2e2e49f964c4d65ec6d94adc9e491cfeae86f30fe6afdeefa889f8cf62b42a7142a509f2b20060121f8df80582384efe71519f0487592d5a415e
|
7
|
+
data.tar.gz: 05b5620cb839db46c647907bd930d863c6f84daf046d8c710d4aa87129e83e6d14880acc70834e410fa17abee9da58cdeb57a85ab88f1e3bafdd7d84e5d5fcb7
|
@@ -0,0 +1,5 @@
|
|
1
|
+
// This component relies on JavaScript from GOV.UK Frontend
|
2
|
+
// = require govuk/components/service-navigation/service-navigation.bundle.js
|
3
|
+
window.GOVUK = window.GOVUK || {}
|
4
|
+
window.GOVUK.Modules = window.GOVUK.Modules || {}
|
5
|
+
window.GOVUK.Modules.GovukServiceNavigation = window.GOVUKFrontend.ServiceNavigation
|
@@ -75,6 +75,7 @@
|
|
75
75
|
@import "components/search";
|
76
76
|
@import "components/secondary-navigation";
|
77
77
|
@import "components/select";
|
78
|
+
@import "components/service-navigation";
|
78
79
|
@import "components/share-links";
|
79
80
|
@import "components/signup-link";
|
80
81
|
@import "components/single-page-notification-button";
|
@@ -44,7 +44,7 @@
|
|
44
44
|
<div class="govuk-grid-column-two-thirds">
|
45
45
|
<h2 class="govuk-cookie-banner__heading govuk-heading-m"><%= title %></h2>
|
46
46
|
<div tabindex="-1" class="govuk-cookie-banner__content gem-c-cookie-banner__confirmation">
|
47
|
-
<
|
47
|
+
<div class="gem-c-cookie-banner__content"><%= text %></div>
|
48
48
|
<p class="gem-c-cookie-banner__confirmation-message--accepted govuk-body" hidden
|
49
49
|
<% unless disable_ga4 %>
|
50
50
|
data-ga4-cookie-banner <%# GA4 pageview JS looks for data-ga4-cookie-banner %>
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<%
|
2
|
+
add_gem_component_stylesheet("service-navigation")
|
3
|
+
|
4
|
+
service_name ||= nil
|
5
|
+
service_name_url ||= nil
|
6
|
+
navigation_items ||= []
|
7
|
+
|
8
|
+
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
9
|
+
component_helper.add_class("gem-c-service-navigation govuk-service-navigation")
|
10
|
+
component_helper.add_aria_attribute({ label: "Service information" }) if service_name.present?
|
11
|
+
component_helper.add_data_attribute({ module: "govuk-service-navigation" })
|
12
|
+
%>
|
13
|
+
<% if service_name.present? || navigation_items.present? %>
|
14
|
+
<% service_navigation_content = capture do %>
|
15
|
+
<div class="govuk-width-container">
|
16
|
+
<div class="govuk-service-navigation__container">
|
17
|
+
<% if service_name %>
|
18
|
+
<% if service_name_url %>
|
19
|
+
<%= tag.span(class: "govuk-service-navigation__service-name") do %>
|
20
|
+
<%= link_to(service_name, service_name_url, class: "govuk-service-navigation__link") %>
|
21
|
+
<% end %>
|
22
|
+
<% else %>
|
23
|
+
<%= tag.span(service_name, class: "govuk-service-navigation__service-name") %>
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
26
|
+
|
27
|
+
<% if navigation_items.present? %>
|
28
|
+
<nav aria-label="<%= t("components.layout_header.menu") %>" class="govuk-service-navigation__wrapper">
|
29
|
+
<button type="button" class="govuk-service-navigation__toggle govuk-js-service-navigation-toggle" aria-controls="navigation" hidden>
|
30
|
+
Menu
|
31
|
+
</button>
|
32
|
+
<ul class="govuk-service-navigation__list" id="navigation">
|
33
|
+
<% navigation_items.each do |nav| %>
|
34
|
+
<%
|
35
|
+
nav_classes = %w(govuk-service-navigation__item)
|
36
|
+
nav_classes << "govuk-service-navigation__item--active" if nav[:active]
|
37
|
+
aria_current = nav[:active]
|
38
|
+
%>
|
39
|
+
<%= tag.li nav[:text], class: nav_classes do %>
|
40
|
+
<% if nav[:active] %>
|
41
|
+
<%= link_to(nav[:href], class: "govuk-service-navigation__link", aria: { current: aria_current }) do %>
|
42
|
+
<%= tag.strong(nav[:text], class: "govuk-service-navigation__active-fallback") %>
|
43
|
+
<% end %>
|
44
|
+
<% else %>
|
45
|
+
<%= link_to nav[:text], nav[:href], class: "govuk-service-navigation__link" %>
|
46
|
+
<% end %>
|
47
|
+
<% end %>
|
48
|
+
<% end %>
|
49
|
+
</ul>
|
50
|
+
</nav>
|
51
|
+
<% end %>
|
52
|
+
</div>
|
53
|
+
</div>
|
54
|
+
<% end %>
|
55
|
+
|
56
|
+
<% if service_name.present? %>
|
57
|
+
<%= tag.section(service_navigation_content, **component_helper.all_attributes) %>
|
58
|
+
<% else %>
|
59
|
+
<%= tag.div(service_navigation_content, **component_helper.all_attributes) %>
|
60
|
+
<% end %>
|
61
|
+
<% end %>
|
@@ -2,13 +2,14 @@
|
|
2
2
|
add_gem_component_stylesheet("summary-banner")
|
3
3
|
|
4
4
|
title ||= false
|
5
|
+
title_id = "summary-banner-title-#{SecureRandom.hex(4)}"
|
5
6
|
text ||= false
|
6
7
|
secondary_text ||= false
|
7
8
|
local_assigns[:margin_bottom] ||= 7
|
8
9
|
|
9
10
|
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
10
11
|
component_helper.add_class("gem-c-summary-banner")
|
11
|
-
component_helper.add_aria_attribute({
|
12
|
+
component_helper.add_aria_attribute({ labelledby: title_id })
|
12
13
|
component_helper.set_lang("en")
|
13
14
|
component_helper.add_data_attribute({ module: "ga4-link-tracker" })
|
14
15
|
component_helper.add_data_attribute({ ga4_track_links_only: "" })
|
@@ -16,7 +17,7 @@
|
|
16
17
|
%>
|
17
18
|
<% if title.present? && text.present? %>
|
18
19
|
<%= tag.section(**component_helper.all_attributes) do %>
|
19
|
-
<h2 class="gem-c-summary-banner__title govuk-heading-m"><%= title %></h2>
|
20
|
+
<h2 class="gem-c-summary-banner__title govuk-heading-m" id="<%= title_id %>"><%= title %></h2>
|
20
21
|
<p class="gem-c-summary-banner__text">
|
21
22
|
<%= text %>
|
22
23
|
</p>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
name: Service Navigation
|
2
|
+
description: Renders a box with a link to sign up for email notifications
|
3
|
+
accessibility_criteria: |
|
4
|
+
- the component must use the correct heading level for the page
|
5
|
+
- text should have a text contrast ratio higher than 4.5:1 against the background colour to meet WCAG AA
|
6
|
+
- the icon must not be focusable or shown to screenreaders
|
7
|
+
accessibility_excluded_rules:
|
8
|
+
- duplicate-id-aria
|
9
|
+
- landmark-unique
|
10
|
+
uses_component_wrapper_helper: true
|
11
|
+
govuk_frontend_components:
|
12
|
+
- service-navigation
|
13
|
+
shared_accessibility_criteria:
|
14
|
+
- link
|
15
|
+
examples:
|
16
|
+
default:
|
17
|
+
data:
|
18
|
+
navigation_items:
|
19
|
+
- text: Navigation item 1
|
20
|
+
href: "#"
|
21
|
+
active: true
|
22
|
+
- text: Navigation item 2
|
23
|
+
href: "#"
|
24
|
+
- text: Navigation item 3
|
25
|
+
href: "#"
|
26
|
+
with_service_name:
|
27
|
+
data:
|
28
|
+
service_name: My service name
|
29
|
+
with_service_name_and_service_name_url:
|
30
|
+
data:
|
31
|
+
service_name: My service name
|
32
|
+
service_name_url: "#"
|
33
|
+
with_service_name_and_navigation_links:
|
34
|
+
data:
|
35
|
+
service_name: My service name
|
36
|
+
navigation_items:
|
37
|
+
- text: Navigation item 1
|
38
|
+
href: "#"
|
39
|
+
- text: Navigation item 2
|
40
|
+
href: "#"
|
41
|
+
- text: Navigation item 3
|
42
|
+
href: "#"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_publishing_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 56.
|
4
|
+
version: 56.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: govuk_app_config
|
@@ -496,6 +496,7 @@ files:
|
|
496
496
|
- app/assets/javascripts/govuk_publishing_components/components/radio.js
|
497
497
|
- app/assets/javascripts/govuk_publishing_components/components/reorderable-list.js
|
498
498
|
- app/assets/javascripts/govuk_publishing_components/components/search-with-autocomplete.js
|
499
|
+
- app/assets/javascripts/govuk_publishing_components/components/service-navigation.js
|
499
500
|
- app/assets/javascripts/govuk_publishing_components/components/single-page-notification-button.js
|
500
501
|
- app/assets/javascripts/govuk_publishing_components/components/skip-link.js
|
501
502
|
- app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js
|
@@ -594,6 +595,7 @@ files:
|
|
594
595
|
- app/assets/stylesheets/govuk_publishing_components/components/_search.scss
|
595
596
|
- app/assets/stylesheets/govuk_publishing_components/components/_secondary-navigation.scss
|
596
597
|
- app/assets/stylesheets/govuk_publishing_components/components/_select.scss
|
598
|
+
- app/assets/stylesheets/govuk_publishing_components/components/_service-navigation.scss
|
597
599
|
- app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss
|
598
600
|
- app/assets/stylesheets/govuk_publishing_components/components/_signup-link.scss
|
599
601
|
- app/assets/stylesheets/govuk_publishing_components/components/_single-page-notification-button.scss
|
@@ -744,6 +746,7 @@ files:
|
|
744
746
|
- app/views/govuk_publishing_components/components/_search_with_autocomplete.html.erb
|
745
747
|
- app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
|
746
748
|
- app/views/govuk_publishing_components/components/_select.html.erb
|
749
|
+
- app/views/govuk_publishing_components/components/_service_navigation.html.erb
|
747
750
|
- app/views/govuk_publishing_components/components/_share_links.html.erb
|
748
751
|
- app/views/govuk_publishing_components/components/_signup_link.html.erb
|
749
752
|
- app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb
|
@@ -844,6 +847,7 @@ files:
|
|
844
847
|
- app/views/govuk_publishing_components/components/docs/search_with_autocomplete.yml
|
845
848
|
- app/views/govuk_publishing_components/components/docs/secondary_navigation.yml
|
846
849
|
- app/views/govuk_publishing_components/components/docs/select.yml
|
850
|
+
- app/views/govuk_publishing_components/components/docs/service_navigation.yml
|
847
851
|
- app/views/govuk_publishing_components/components/docs/share_links.yml
|
848
852
|
- app/views/govuk_publishing_components/components/docs/signup_link.yml
|
849
853
|
- app/views/govuk_publishing_components/components/docs/single_page_notification_button.yml
|
@@ -2034,7 +2038,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
2034
2038
|
- !ruby/object:Gem::Version
|
2035
2039
|
version: '0'
|
2036
2040
|
requirements: []
|
2037
|
-
rubygems_version: 3.6.
|
2041
|
+
rubygems_version: 3.6.7
|
2038
2042
|
specification_version: 4
|
2039
2043
|
summary: A gem to document components in GOV.UK frontend applications
|
2040
2044
|
test_files: []
|