govuk_publishing_components 21.56.0 → 21.58.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +6 -1
  3. data/app/assets/javascripts/govuk_publishing_components/components/details.js +2 -2
  4. data/app/assets/javascripts/govuk_publishing_components/components/print-link.js +14 -0
  5. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +11 -5
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +4 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +9 -5
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_list.scss +1 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +52 -0
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +7 -2
  12. data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +5 -1
  13. data/app/controllers/govuk_publishing_components/component_guide_controller.rb +1 -0
  14. data/app/views/govuk_publishing_components/component_guide/index.html.erb +5 -6
  15. data/app/views/govuk_publishing_components/components/_action_link.html.erb +2 -0
  16. data/app/views/govuk_publishing_components/components/_contextual_breadcrumbs.html.erb +11 -7
  17. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +3 -1
  18. data/app/views/govuk_publishing_components/components/_input.html.erb +3 -4
  19. data/app/views/govuk_publishing_components/components/_list.html.erb +26 -0
  20. data/app/views/govuk_publishing_components/components/_print_link.html.erb +27 -0
  21. data/app/views/govuk_publishing_components/components/docs/action_link.yml +5 -0
  22. data/app/views/govuk_publishing_components/components/docs/input.yml +9 -1
  23. data/app/views/govuk_publishing_components/components/docs/list.yml +64 -0
  24. data/app/views/govuk_publishing_components/components/docs/print_link.yml +24 -0
  25. data/config/locales/en.yml +2 -0
  26. data/lib/govuk_publishing_components.rb +2 -1
  27. data/lib/govuk_publishing_components/presenters/breadcrumb_selector.rb +50 -42
  28. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_ancestors.rb +41 -0
  29. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +1 -0
  30. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_taxons.rb +4 -0
  31. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_topic.rb +38 -0
  32. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +15 -4
  33. data/lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb +3 -1
  34. data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +18 -17
  35. data/lib/govuk_publishing_components/version.rb +1 -1
  36. data/node_modules/axe-core/CHANGELOG.md +11 -0
  37. data/node_modules/axe-core/axe.js +36 -9
  38. data/node_modules/axe-core/axe.min.js +2 -2
  39. data/node_modules/axe-core/bower.json +1 -1
  40. data/node_modules/axe-core/lib/checks/color/color-contrast.js +2 -2
  41. data/node_modules/axe-core/lib/checks/lists/listitem.js +1 -1
  42. data/node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js +3 -0
  43. data/node_modules/axe-core/lib/commons/dom/is-visible.js +37 -19
  44. data/node_modules/axe-core/lib/core/public/configure.js +26 -0
  45. data/node_modules/axe-core/lib/rules/aria-input-field-name.json +1 -1
  46. data/node_modules/axe-core/package.json +12 -12
  47. data/node_modules/axe-core/sri-history.json +4 -0
  48. metadata +25 -3
  49. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_parent.rb +0 -39
@@ -1,39 +0,0 @@
1
- module GovukPublishingComponents
2
- module Presenters
3
- # @private
4
- class ContentBreadcrumbsBasedOnParent
5
- def initialize(content_item)
6
- @content_item = ContentItem.new(content_item)
7
- end
8
-
9
- def breadcrumbs
10
- ordered_parents = all_parents.map do |parent|
11
- { title: parent.title, url: parent.base_path }
12
- end
13
-
14
- ordered_parents << { title: "Home", url: "/" }
15
-
16
- {
17
- breadcrumbs: ordered_parents.reverse,
18
- }
19
- end
20
-
21
- private
22
-
23
- attr_reader :content_item
24
-
25
- def all_parents
26
- parents = []
27
-
28
- direct_parent = content_item.parent
29
- while direct_parent
30
- parents << direct_parent
31
-
32
- direct_parent = direct_parent.parent
33
- end
34
-
35
- parents
36
- end
37
- end
38
- end
39
- end