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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c53e314e8f0deaf62d18bee2d0ac626c6013c53537f47b35df43878396e51c1c
4
- data.tar.gz: 1ec7190995a08c1b178d43fbdc7a8b872de750557cee746dfdcdcb0dc1500608
3
+ metadata.gz: 72ef6e6f7e0ef3a11b274d2fb91b93c0c3d793869db14f62c40bdd3442b1d75a
4
+ data.tar.gz: 7e26ac63476c3d175219f7cb841008ededf58bb9671a6fc34b4e5e870406cafb
5
5
  SHA512:
6
- metadata.gz: fee872f0ae59164b19a1b344b8011615607a03cfd14b70e96a421af0eb36f6889aca3fec2468f419b247080d36d449137ab13f0c4248318123798348073542dc
7
- data.tar.gz: 58a469a52b1f85a5201958dd4810171bcb6014340a2ac4a84a317789845222cbdcf215fa9e123bbc55b2ae5e2420daf35587427463b5d26fd846799432cda2f3
6
+ metadata.gz: 16f44b2add40459adff96288055e71100ab28ac8ac1fcbba4ed59b50b9c80394c691db73e6eb88ff9e308c970e4d9557648f7a334b91a1f0f8fa0f9ea08c0779
7
+ data.tar.gz: 6b9424c82c0f4c040f8b23064e02d1c9293f1aec8c28e74a97f7f26ebb9268e5ea73f605063755aa4f9fcfd3c6f470e3b8f3b8826e3e25f2df894f8cc04b034b
@@ -7,8 +7,6 @@
7
7
  @import "govuk/helpers/all";
8
8
  @import "govuk/core/all";
9
9
 
10
- @import "govuk_publishing_components/all_components";
11
-
12
10
  $gem-guide-border-width: 1px;
13
11
 
14
12
  .component-list {
@@ -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["#{Rails.root}/app/views/**/*.html.erb"]
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(__dir__ + "/../../assets/stylesheets/govuk_publishing_components/components/#{print_path}_#{component}.scss").exist?
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(Pathname.new(__dir__ + "/../../views/govuk_publishing_components/components/_#{component}.html.erb"))
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
@@ -13,6 +13,7 @@ Links in the component must:
13
13
  - be usable with touch
14
14
  - be usable with [voice commands](https://www.w3.org/WAI/perspectives/voice.html)
15
15
  - have visible text
16
+ - have meaningful text
16
17
  "
17
18
  end
18
19
  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
- Links in the component must:
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
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "21.35.0".freeze
2
+ VERSION = "21.36.0".freeze
3
3
  end
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.35.0
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-25 00:00:00.000000000 Z
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