govuk_publishing_components 24.1.1 → 24.4.1

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.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +28 -0
  3. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +52 -8
  4. data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +26 -6
  5. data/app/assets/javascripts/govuk_publishing_components/components/details.js +1 -1
  6. data/app/assets/javascripts/govuk_publishing_components/components/show-password.js +7 -2
  7. data/app/assets/stylesheets/component_guide/application.scss +0 -8
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +11 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +11 -84
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +17 -13
  11. data/app/models/govuk_publishing_components/audit_applications.rb +1 -1
  12. data/app/models/govuk_publishing_components/audit_comparer.rb +2 -2
  13. data/app/models/govuk_publishing_components/component_example.rb +4 -3
  14. data/app/views/govuk_publishing_components/audit/show.html.erb +211 -199
  15. data/app/views/govuk_publishing_components/components/_accordion.html.erb +3 -3
  16. data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +8 -5
  17. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +1 -1
  18. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +50 -39
  19. data/app/views/govuk_publishing_components/components/_highlight_boxes.html.erb +1 -1
  20. data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -1
  21. data/app/views/govuk_publishing_components/components/_metadata.html.erb +1 -1
  22. data/app/views/govuk_publishing_components/components/_organisation_logo.html.erb +1 -1
  23. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +1 -1
  24. data/app/views/govuk_publishing_components/components/_radio.html.erb +2 -1
  25. data/app/views/govuk_publishing_components/components/_share_links.html.erb +1 -1
  26. data/app/views/govuk_publishing_components/components/_show_password.html.erb +6 -4
  27. data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +1 -1
  28. data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +1 -1
  29. data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +1 -1
  30. data/app/views/govuk_publishing_components/components/_taxonomy_list.html.erb +1 -1
  31. data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +1 -1
  32. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +1 -1
  33. data/app/views/govuk_publishing_components/components/docs/accordion.yml +29 -0
  34. data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +22 -0
  35. data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +9 -0
  36. data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +1 -1
  37. data/app/views/govuk_publishing_components/components/docs/radio.yml +14 -1
  38. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +2 -0
  39. data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +2 -2
  40. data/config/locales/en.yml +7 -5
  41. data/lib/govuk_publishing_components/app_helpers/table_helper.rb +2 -1
  42. data/lib/govuk_publishing_components/presenters/machine_readable/faq_page_schema.rb +1 -1
  43. data/lib/govuk_publishing_components/presenters/machine_readable/html_publication_schema.rb +1 -7
  44. data/lib/govuk_publishing_components/presenters/meta_tags.rb +1 -2
  45. data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +2 -2
  46. data/lib/govuk_publishing_components/version.rb +1 -1
  47. data/lib/tasks/govuk_publishing_components_tasks.rake +1 -1
  48. metadata +7 -7
@@ -184,7 +184,7 @@ examples:
184
184
  text: "Blue"
185
185
  with_custom_heading_size:
186
186
  description: |
187
- This allows the size of the legend to be changed. Valid options are s, m, l, xl, defaulting to m if no option is passed.
187
+ This allows the size of the legend to be changed. Valid options are s, m, l, xl, defaulting to m if no option is passed.
188
188
 
189
189
  If the is_page_heading option is true and heading_size is not set, the text size will be xl.
190
190
  data:
@@ -198,6 +198,19 @@ examples:
198
198
  text: "Green"
199
199
  - value: "blue"
200
200
  text: "Blue"
201
+ with_custom_heading_level:
202
+ description: This allows the heading level to be changed. Heading level will default to `h2` if nothing is passed.
203
+ data:
204
+ name: "radio-group-description"
205
+ heading: "What is your favourite colour?"
206
+ heading_level: 3
207
+ items:
208
+ - value: "red"
209
+ text: "Red"
210
+ - value: "green"
211
+ text: "Green"
212
+ - value: "blue"
213
+ text: "Blue"
201
214
  with_hint_text_on_radios:
202
215
  data:
203
216
  name: "radio-group-hint-text"
@@ -1,3 +1,5 @@
1
+ <% navigation_aria_label ||= "Top level" %>
2
+
1
3
  <% if navigation_items.any? %>
2
4
  <button role="button" class="govuk-header__menu-button gem-c-header__menu-button govuk-js-header-toggle" aria-controls="navigation" aria-label="Show or hide Top Level Navigation">Menu</button>
3
5
  <%= tag.nav class: "gem-c-header__nav", aria: { label: navigation_aria_label } do %>
@@ -16,7 +16,7 @@
16
16
  %>
17
17
  <% end %>
18
18
 
19
- <ul class="gem-c-related-navigation__link-list" data-module="track-click">
19
+ <ul class="gem-c-related-navigation__link-list" data-module="gem-track-click">
20
20
  <% constructed_link_array = [] %>
21
21
 
22
22
  <% section_link_limit = related_nav_helper.calculate_section_link_limit(links) %>
@@ -26,7 +26,7 @@
26
26
  link_element = link_to(
27
27
  link[:text],
28
28
  link[:path],
29
- class: related_nav_helper.section_css_class("gem-c-related-navigation__section-link", section_title, link, (index >= section_link_limit)),
29
+ class: related_nav_helper.section_css_class("gem-c-related-navigation__section-link", section_title, link: link, link_is_inline: (index >= section_link_limit)),
30
30
  rel: link[:rel],
31
31
  lang: shared_helper.t_locale_check(link[:locale]),
32
32
  data: {
@@ -54,11 +54,6 @@ en:
54
54
  what_wrong: "What went wrong?"
55
55
  send_me_survey: "Send me the survey"
56
56
  send: "Send"
57
- input:
58
- show: Show
59
- hide: Hide
60
- announce_show: Your password is shown
61
- announce_hide: Your password is hidden
62
57
  organisation_schema:
63
58
  all_content_search_description: "Find all content from %{organisation}"
64
59
  radio:
@@ -90,6 +85,13 @@ en:
90
85
  policies: "Policies"
91
86
  statistical_data_sets: "Statistical data sets"
92
87
  topical_events: "Topical events"
88
+ show_password:
89
+ show: Show
90
+ hide: Hide
91
+ show_password: Show password
92
+ hide_password: Hide password
93
+ announce_show: Your password is shown
94
+ announce_hide: Your password is hidden
93
95
  print_link:
94
96
  text: "Print this page"
95
97
  skip_link:
@@ -15,6 +15,7 @@ module GovukPublishingComponents
15
15
  yield(builder)
16
16
  end
17
17
  end
18
+
18
19
  class TableBuilder
19
20
  include ActionView::Helpers::UrlHelper
20
21
  include ActionView::Helpers::TagHelper
@@ -57,7 +58,7 @@ module GovukPublishingComponents
57
58
 
58
59
  def cell(str, opt = {})
59
60
  classes = %w[govuk-table__cell]
60
- classes << "govuk-table__cell--" + opt[:format] if opt[:format]
61
+ classes << "govuk-table__cell--#{opt[:format]}" if opt[:format]
61
62
  classes << "govuk-table__cell--empty" unless str
62
63
  str ||= "Not set"
63
64
  tag.td str, class: classes
@@ -88,7 +88,7 @@ module GovukPublishingComponents
88
88
  end
89
89
 
90
90
  def section_url(anchor)
91
- return page_url + "#" + anchor if anchor.present?
91
+ return "#{page_url}##{anchor}" if anchor.present?
92
92
 
93
93
  page_url
94
94
  end
@@ -1,12 +1,6 @@
1
1
  module GovukPublishingComponents
2
2
  module Presenters
3
3
  class HtmlPublicationSchema < FaqPageSchema
4
- attr_reader :page
5
-
6
- def initialize(page)
7
- @page = page
8
- end
9
-
10
4
  def structured_data
11
5
  return ArticleSchema.new(page).structured_data if less_than_two_headings_of_any_one_type?
12
6
 
@@ -55,7 +49,7 @@ module GovukPublishingComponents
55
49
  # {:a => :b, :b => :c}
56
50
  def pairs_hash(array)
57
51
  all_but_last = array[0..-2]
58
- all_but_first = array[1..-1]
52
+ all_but_first = array[1..]
59
53
  pairs = [all_but_last, all_but_first].transpose
60
54
  Hash[pairs]
61
55
  end
@@ -20,8 +20,7 @@ module GovukPublishingComponents
20
20
  meta_tags = add_organisation_tags(meta_tags)
21
21
  meta_tags = add_political_tags(meta_tags)
22
22
  meta_tags = add_taxonomy_tags(meta_tags)
23
- meta_tags = add_step_by_step_tags(meta_tags)
24
- meta_tags
23
+ add_step_by_step_tags(meta_tags)
25
24
  end
26
25
 
27
26
  private
@@ -58,14 +58,14 @@ module GovukPublishingComponents
58
58
  I18n.t(
59
59
  "components.related_#{@context}_navigation." + section_title,
60
60
  default: [
61
- I18n.t("components.related_navigation." + section_title),
61
+ I18n.t("components.related_navigation.#{section_title}"),
62
62
  section_title.tr("_", " "),
63
63
  ],
64
64
  )
65
65
  end
66
66
  end
67
67
 
68
- def section_css_class(css_class, section_title, link = {}, link_is_inline = false)
68
+ def section_css_class(css_class, section_title, link: {}, link_is_inline: false)
69
69
  css_classes = [css_class]
70
70
  css_classes << "#{css_class}--#{@context}" unless @context.nil?
71
71
  css_classes << "#{css_class}--inline" if link_is_inline
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "24.1.1".freeze
2
+ VERSION = "24.4.1".freeze
3
3
  end
@@ -14,7 +14,7 @@ namespace :component do
14
14
 
15
15
  if components_missing_docs.any?
16
16
  error = "You have components which are missing documentation. These components will not be displayed in the component guide:\n"
17
- components_missing_docs.each { |component| error += "\t" + component + "\n" }
17
+ components_missing_docs.each { |component| error += "\t#{component}\n" }
18
18
  error += "\n"
19
19
  raise NotImplementedError, error
20
20
  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: 24.1.1
4
+ version: 24.4.1
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: 2021-02-15 00:00:00.000000000 Z
11
+ date: 2021-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -238,16 +238,16 @@ dependencies:
238
238
  name: rubocop-govuk
239
239
  requirement: !ruby/object:Gem::Requirement
240
240
  requirements:
241
- - - "~>"
241
+ - - '='
242
242
  - !ruby/object:Gem::Version
243
- version: '3'
243
+ version: 4.0.0.pre.1
244
244
  type: :development
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
- - - "~>"
248
+ - - '='
249
249
  - !ruby/object:Gem::Version
250
- version: '3'
250
+ version: 4.0.0.pre.1
251
251
  - !ruby/object:Gem::Dependency
252
252
  name: sassc-rails
253
253
  requirement: !ruby/object:Gem::Requirement
@@ -1860,7 +1860,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
1860
1860
  requirements:
1861
1861
  - - ">="
1862
1862
  - !ruby/object:Gem::Version
1863
- version: '0'
1863
+ version: '2.6'
1864
1864
  required_rubygems_version: !ruby/object:Gem::Requirement
1865
1865
  requirements:
1866
1866
  - - ">="