govuk_publishing_components 21.35.0 → 21.36.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/stylesheets/component_guide/application.scss +0 -2
- data/app/controllers/govuk_publishing_components/component_guide_controller.rb +15 -7
- data/app/models/govuk_publishing_components/shared_accessibility_criteria.rb +1 -0
- data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +2 -6
- data/app/views/govuk_publishing_components/components/docs/layout_footer.yml +2 -10
- data/app/views/govuk_publishing_components/components/docs/layout_header.yml +2 -10
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72ef6e6f7e0ef3a11b274d2fb91b93c0c3d793869db14f62c40bdd3442b1d75a
|
4
|
+
data.tar.gz: 7e26ac63476c3d175219f7cb841008ededf58bb9671a6fc34b4e5e870406cafb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16f44b2add40459adff96288055e71100ab28ac8ac1fcbba4ed59b50b9c80394c691db73e6eb88ff9e308c970e4d9557648f7a334b91a1f0f8fa0f9ea08c0779
|
7
|
+
data.tar.gz: 6b9424c82c0f4c040f8b23064e02d1c9293f1aec8c28e74a97f7f26ebb9268e5ea73f605063755aa4f9fcfd3c6f470e3b8f3b8826e3e25f2df894f8cc04b034b
|
@@ -3,6 +3,8 @@ module GovukPublishingComponents
|
|
3
3
|
append_view_path File.join(Rails.root, "app", "views", GovukPublishingComponents::Config.component_directory_name)
|
4
4
|
|
5
5
|
def index
|
6
|
+
@application_path = Rails.root
|
7
|
+
@component_gem_path = Gem.loaded_specs["govuk_publishing_components"].full_gem_path
|
6
8
|
@component_docs = component_docs.all
|
7
9
|
@gem_component_docs = gem_component_docs.all
|
8
10
|
@components_in_use_docs = components_in_use_docs.used_in_this_app
|
@@ -44,7 +46,7 @@ module GovukPublishingComponents
|
|
44
46
|
additional_files = "@import 'govuk_publishing_components/govuk_frontend_support';\n"
|
45
47
|
additional_files << "@import 'govuk_publishing_components/component_support';\n" unless print_styles
|
46
48
|
|
47
|
-
components = components_in_use
|
49
|
+
components = components_in_use("#{@application_path}/app/views/")
|
48
50
|
extra_components = []
|
49
51
|
|
50
52
|
components.each do |component|
|
@@ -53,11 +55,12 @@ module GovukPublishingComponents
|
|
53
55
|
end
|
54
56
|
|
55
57
|
components << extra_components.compact
|
58
|
+
components << components_used_by_component_guide.compact
|
56
59
|
components = components.flatten.uniq.sort
|
57
60
|
|
58
61
|
components.map { |component|
|
59
62
|
"@import 'govuk_publishing_components/components/#{print_path}_#{component.gsub('_', '-')}';" if component_has_sass_file(component.gsub("_", "-"), print_styles)
|
60
|
-
}.join("\n").squeeze("\n").prepend(additional_files)
|
63
|
+
}.compact.uniq.sort.join("\n").squeeze("\n").prepend(additional_files)
|
61
64
|
end
|
62
65
|
|
63
66
|
private
|
@@ -71,13 +74,13 @@ module GovukPublishingComponents
|
|
71
74
|
end
|
72
75
|
|
73
76
|
def components_in_use_docs
|
74
|
-
@components_in_use_docs ||= ComponentDocs.new(gem_components: true, limit_to: components_in_use)
|
77
|
+
@components_in_use_docs ||= ComponentDocs.new(gem_components: true, limit_to: components_in_use("#{@application_path}/app/views/"))
|
75
78
|
end
|
76
79
|
|
77
|
-
def components_in_use
|
80
|
+
def components_in_use(path)
|
78
81
|
matches = []
|
79
82
|
|
80
|
-
files = Dir["
|
83
|
+
files = Dir[path + "**/*.html.erb"]
|
81
84
|
files.each do |file|
|
82
85
|
data = File.read(file)
|
83
86
|
matches << data.scan(/(govuk_publishing_components\/components\/[a-z_-]+)/)
|
@@ -88,11 +91,11 @@ module GovukPublishingComponents
|
|
88
91
|
|
89
92
|
def component_has_sass_file(component, print_styles)
|
90
93
|
print_path = "print/" if print_styles
|
91
|
-
Pathname.new(
|
94
|
+
Pathname.new(@component_gem_path + "/app/assets/stylesheets/govuk_publishing_components/components/#{print_path}_#{component}.scss").exist?
|
92
95
|
end
|
93
96
|
|
94
97
|
def components_within_component(component)
|
95
|
-
data = File.read(
|
98
|
+
data = File.read(@component_gem_path + "/app/views/govuk_publishing_components/components/_#{component}.html.erb")
|
96
99
|
match = data.scan(/(govuk_publishing_components\/components\/[a-z_-]+)/)
|
97
100
|
match.flatten.uniq.map(&:to_s).sort.map { |m| m.gsub("govuk_publishing_components/components/", "") }
|
98
101
|
end
|
@@ -110,5 +113,10 @@ module GovukPublishingComponents
|
|
110
113
|
h[:url] = component_doc_path(component_doc.id) if component_example
|
111
114
|
end
|
112
115
|
end
|
116
|
+
|
117
|
+
def components_used_by_component_guide
|
118
|
+
components = components_in_use("#{@component_gem_path}/app/views/govuk_publishing_components/component_guide/")
|
119
|
+
components << components_in_use("#{@component_gem_path}/app/views/layouts/")
|
120
|
+
end
|
113
121
|
end
|
114
122
|
end
|
@@ -6,12 +6,8 @@ body: |
|
|
6
6
|
If the examples below are not showing the banner, make sure the `cookies_preferences_set` cookie is not present or is set to false.
|
7
7
|
accessibility_criteria: |
|
8
8
|
Text in the cookie banner must be clear and unambiguous and should provide a way to dismiss the message.
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
- accept focus
|
13
|
-
- be focusable with a keyboard
|
14
|
-
- indicate when they have focus
|
9
|
+
shared_accessibility_criteria:
|
10
|
+
- link
|
15
11
|
accessibility_excluded_rules:
|
16
12
|
- 'duplicate-id' # a banner should have a unique id for a given page. However, this page contains multiple examples of the banner with the same id.
|
17
13
|
examples:
|
@@ -7,16 +7,6 @@ accessibility_criteria: |
|
|
7
7
|
|
8
8
|
- have a text contrast ratio higher than 4.5:1 against the background colour to meet [WCAG AA](https://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast)
|
9
9
|
|
10
|
-
Links in the Footer must:
|
11
|
-
|
12
|
-
- accept focus
|
13
|
-
- be focusable with a keyboard
|
14
|
-
- be usable with a keyboard
|
15
|
-
- indicate when they have focus
|
16
|
-
- change in appearance when touched (in the touch-down state)
|
17
|
-
- change in appearance when hovered
|
18
|
-
- have visible text
|
19
|
-
|
20
10
|
Images in the Footer must:
|
21
11
|
|
22
12
|
- be presentational when linked to from accompanying text "Open Government Licence (OGL) icon".
|
@@ -36,6 +26,8 @@ accessibility_criteria: |
|
|
36
26
|
Assumption made is that is most predictable for users of assistive technologies.
|
37
27
|
The spec indicates that `contentinfo` is useful for "Examples of information included in this region of the page are copyrights and links to privacy statements.", which may indicate that it might be better placed around the 'meta' section of this component.
|
38
28
|
Should be challenged if user research indicates this is an issue.
|
29
|
+
shared_accessibility_criteria:
|
30
|
+
- link
|
39
31
|
accessibility_excluded_rules:
|
40
32
|
- landmark-contentinfo-is-top-level # The footer element can not be top level in the examples
|
41
33
|
examples:
|
@@ -48,16 +48,6 @@ accessibility_criteria: |
|
|
48
48
|
|
49
49
|
- have a text contrast ratio higher than 4.5:1 against the background colour to meet [WCAG AA](https://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast)
|
50
50
|
|
51
|
-
Links in the Header must:
|
52
|
-
|
53
|
-
- accept focus
|
54
|
-
- be focusable with a keyboard
|
55
|
-
- be usable with a keyboard
|
56
|
-
- indicate when they have focus
|
57
|
-
- change in appearance when touched (in the touch-down state)
|
58
|
-
- change in appearance when hovered
|
59
|
-
- have visible text
|
60
|
-
|
61
51
|
Images in the Header must:
|
62
52
|
|
63
53
|
- be presentational when linked to from accompanying text (crown icon).
|
@@ -65,3 +55,5 @@ accessibility_criteria: |
|
|
65
55
|
Landmarks and Roles in the Header should:
|
66
56
|
|
67
57
|
- have a role of `banner` at the root of the component (<header>) ([ARIA 1.1](https://www.w3.org/TR/wai-aria-1.1/#banner))
|
58
|
+
shared_accessibility_criteria:
|
59
|
+
- link
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_publishing_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 21.
|
4
|
+
version: 21.36.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gds-api-adapters
|