govuk_publishing_components 44.4.1 → 44.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +1 -1
  3. data/app/assets/javascripts/govuk_publishing_components/components/govspeak.js +1 -1
  4. data/app/assets/stylesheets/govuk_publishing_components/components/_chart.scss +25 -2
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak-html-publication.scss +2 -2
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak.scss +1 -1
  7. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +1 -1
  8. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +3 -3
  9. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +3 -3
  10. data/app/models/govuk_publishing_components/component_wrapper_helper_options.rb +1 -0
  11. data/app/views/govuk_publishing_components/components/_chart.html.erb +95 -66
  12. data/app/views/govuk_publishing_components/components/_emergency_banner.html.erb +17 -17
  13. data/app/views/govuk_publishing_components/components/_error_alert.html.erb +8 -1
  14. data/app/views/govuk_publishing_components/components/_govspeak.html.erb +11 -11
  15. data/app/views/govuk_publishing_components/components/docs/chart.yml +92 -2
  16. data/app/views/govuk_publishing_components/components/docs/emergency_banner.yml +1 -0
  17. data/app/views/govuk_publishing_components/components/docs/error_alert.yml +1 -0
  18. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +1 -0
  19. data/lib/govuk_publishing_components/presenters/component_wrapper_helper.rb +17 -0
  20. data/lib/govuk_publishing_components/version.rb +1 -1
  21. data/node_modules/axe-core/README.md +3 -3
  22. data/node_modules/axe-core/axe.d.ts +5 -1
  23. data/node_modules/axe-core/axe.js +317 -299
  24. data/node_modules/axe-core/axe.min.js +2 -2
  25. data/node_modules/axe-core/locales/README.md +3 -3
  26. data/node_modules/axe-core/locales/_template.json +14 -14
  27. data/node_modules/axe-core/package.json +2 -1
  28. data/node_modules/axe-core/sri-history.json +4 -0
  29. metadata +2 -2
@@ -12,6 +12,7 @@ module GovukPublishingComponents
12
12
  check_lang_is_valid(@options[:lang]) if @options.include?(:lang)
13
13
  check_open_is_valid(@options[:open]) if @options.include?(:open)
14
14
  check_hidden_is_valid(@options[:hidden]) if @options.include?(:hidden)
15
+ check_tabindex_is_valid(@options[:tabindex]) if @options.include?(:tabindex)
15
16
  end
16
17
 
17
18
  def all_attributes
@@ -25,6 +26,7 @@ module GovukPublishingComponents
25
26
  attributes[:lang] = @options[:lang] unless @options[:lang].blank?
26
27
  attributes[:open] = @options[:open] unless @options[:open].blank?
27
28
  attributes[:hidden] = @options[:hidden] unless @options[:hidden].nil?
29
+ attributes[:tabindex] = @options[:tabindex] unless @options[:tabindex].blank?
28
30
 
29
31
  attributes
30
32
  end
@@ -69,6 +71,11 @@ module GovukPublishingComponents
69
71
  @options[:hidden] = hidden_attribute
70
72
  end
71
73
 
74
+ def set_tabindex(tabindex_attribute)
75
+ check_tabindex_is_valid(tabindex_attribute)
76
+ @options[:tabindex] = tabindex_attribute
77
+ end
78
+
72
79
  private
73
80
 
74
81
  def check_id_is_valid(id)
@@ -146,6 +153,16 @@ module GovukPublishingComponents
146
153
  end
147
154
  end
148
155
 
156
+ def check_tabindex_is_valid(tabindex_attribute)
157
+ return if tabindex_attribute.blank?
158
+
159
+ tabindex_attribute = tabindex_attribute.to_s
160
+
161
+ unless /^-?[0-9]+$/.match?(tabindex_attribute)
162
+ raise(ArgumentError, "tabindex_attribute attribute (#{tabindex_attribute}) is not recognised")
163
+ end
164
+ end
165
+
149
166
  def extend_string(option, string)
150
167
  ((@options[option] ||= "") << " #{string}").strip!
151
168
  end
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "44.4.1".freeze
2
+ VERSION = "44.5.0".freeze
3
3
  end
@@ -1,10 +1,10 @@
1
1
  # axe-core
2
2
 
3
- [![License](https://img.shields.io/npm/l/axe-core.svg)](LICENSE)
3
+ [![License](https://img.shields.io/npm/l/axe-core.svg?color=c41)](LICENSE)
4
4
  [![Version](https://img.shields.io/npm/v/axe-core.svg)](https://www.npmjs.com/package/axe-core)
5
- [![Total npm downloads](https://img.shields.io/npm/dt/axe-core.svg)](https://www.npmjs.com/package/axe-core)
5
+ [![NPM downloads](https://img.shields.io/npm/dw/axe-core.svg?color=080)![](https://img.shields.io/npm/dy/axe-core.svg?color=080&label=)](https://npm-stat.com/charts.html?package=axe-core&from=2017-01-01)
6
6
  [![Commits](https://img.shields.io/github/commit-activity/y/dequelabs/axe-core.svg)](https://github.com/dequelabs/axe-core/commits/develop)
7
- [![GitHub contributors](https://img.shields.io/github/contributors/dequelabs/axe-core.svg)](https://github.com/dequelabs/axe-core/graphs/contributors)
7
+ [![GitHub contributors](https://img.shields.io/github/contributors/dequelabs/axe-core.svg?color=080)](https://github.com/dequelabs/axe-core/graphs/contributors)
8
8
  [![Join our Slack chat](https://img.shields.io/badge/slack-chat-purple.svg?logo=slack)](https://accessibility.deque.com/axe-community)
9
9
  [![Package Quality](https://npm.packagequality.com/shield/axe-core.svg)](https://packagequality.com/#?package=axe-core)
10
10
 
@@ -143,10 +143,14 @@ declare namespace axe {
143
143
  iframes?: boolean;
144
144
  elementRef?: boolean;
145
145
  frameWaitTime?: number;
146
- preload?: boolean;
146
+ preload?: boolean | PreloadOptions;
147
147
  performanceTimer?: boolean;
148
148
  pingWaitTime?: number;
149
149
  }
150
+ interface PreloadOptions {
151
+ assets: string[];
152
+ timeout?: number;
153
+ }
150
154
  interface AxeResults extends EnvironmentData {
151
155
  toolOptions: RunOptions;
152
156
  passes: Result[];