govuk-components 4.1.0 → 4.1.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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/app/components/govuk_component/accordion_component/section_component.html.erb +5 -5
  3. data/app/components/govuk_component/accordion_component/section_component.rb +1 -1
  4. data/app/components/govuk_component/accordion_component.rb +1 -1
  5. data/app/components/govuk_component/back_link_component.rb +2 -2
  6. data/app/components/govuk_component/base.rb +4 -0
  7. data/app/components/govuk_component/breadcrumbs_component.html.erb +1 -1
  8. data/app/components/govuk_component/breadcrumbs_component.rb +6 -6
  9. data/app/components/govuk_component/cookie_banner_component/message_component.rb +7 -7
  10. data/app/components/govuk_component/cookie_banner_component.rb +1 -1
  11. data/app/components/govuk_component/details_component.rb +5 -5
  12. data/app/components/govuk_component/exit_this_page_component.rb +3 -3
  13. data/app/components/govuk_component/footer_component.html.erb +11 -11
  14. data/app/components/govuk_component/footer_component.rb +7 -7
  15. data/app/components/govuk_component/header_component.html.erb +10 -10
  16. data/app/components/govuk_component/header_component.rb +8 -8
  17. data/app/components/govuk_component/inset_text_component.rb +1 -1
  18. data/app/components/govuk_component/notification_banner_component.html.erb +3 -3
  19. data/app/components/govuk_component/notification_banner_component.rb +5 -5
  20. data/app/components/govuk_component/pagination_component/adjacent_page.rb +6 -6
  21. data/app/components/govuk_component/pagination_component/item.rb +4 -4
  22. data/app/components/govuk_component/pagination_component/next_page.rb +1 -1
  23. data/app/components/govuk_component/pagination_component/previous_page.rb +1 -1
  24. data/app/components/govuk_component/pagination_component.rb +4 -4
  25. data/app/components/govuk_component/panel_component.rb +3 -3
  26. data/app/components/govuk_component/phase_banner_component.html.erb +2 -2
  27. data/app/components/govuk_component/phase_banner_component.rb +2 -2
  28. data/app/components/govuk_component/section_break_component.rb +3 -3
  29. data/app/components/govuk_component/start_button_component.rb +8 -10
  30. data/app/components/govuk_component/summary_list_component/action_component.rb +1 -1
  31. data/app/components/govuk_component/summary_list_component/card_component.html.erb +5 -5
  32. data/app/components/govuk_component/summary_list_component/card_component.rb +1 -1
  33. data/app/components/govuk_component/summary_list_component/key_component.rb +1 -1
  34. data/app/components/govuk_component/summary_list_component/row_component.rb +5 -5
  35. data/app/components/govuk_component/summary_list_component/value_component.rb +1 -1
  36. data/app/components/govuk_component/summary_list_component.rb +2 -2
  37. data/app/components/govuk_component/tab_component.html.erb +2 -2
  38. data/app/components/govuk_component/tab_component.rb +5 -5
  39. data/app/components/govuk_component/table_component/body_component.rb +1 -1
  40. data/app/components/govuk_component/table_component/caption_component.rb +2 -2
  41. data/app/components/govuk_component/table_component/cell_component.rb +12 -10
  42. data/app/components/govuk_component/table_component/foot_component.rb +1 -1
  43. data/app/components/govuk_component/table_component/head_component.rb +1 -1
  44. data/app/components/govuk_component/table_component/row_component.rb +1 -1
  45. data/app/components/govuk_component/table_component.rb +1 -1
  46. data/app/components/govuk_component/tag_component.rb +2 -2
  47. data/app/components/govuk_component/warning_text_component.rb +4 -4
  48. data/app/helpers/govuk_back_to_top_link_helper.rb +7 -1
  49. data/app/helpers/govuk_exit_this_page_link_helper.rb +8 -2
  50. data/app/helpers/govuk_link_helper.rb +38 -27
  51. data/app/helpers/govuk_skip_link_helper.rb +2 -2
  52. data/app/helpers/title_with_error_prefix_helper.rb +7 -0
  53. data/lib/govuk/components/engine.rb +4 -2
  54. data/lib/govuk/components/version.rb +1 -1
  55. metadata +15 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c998783ff4cc73621f04a651a6f3ef2f0a19813e5477a99d2676f50d0f5578b
4
- data.tar.gz: 412f8a090cb71ea740c0844721568228a8efaa9cf33c064ef5062848ed326e05
3
+ metadata.gz: 9c2c1a327331508f3762590e9f79d7c75f2acc04b94effdc6149bae3c5f3131e
4
+ data.tar.gz: 4c97e4c60c086848d13c369c5d20af75429fffa7b1ebb8c8da0e2167a0c0fa35
5
5
  SHA512:
6
- metadata.gz: b169ef4f3972c621d3ea3bd3ff84b7e7c93b232fb53336a896e0b8a3d2f52a04132e4142e7d6e3cf1f32629936e6abace87766b648174c93c1238254ba6bcebf
7
- data.tar.gz: 27354029f86a306d806a763a9a466f247139664261591575c93fab124f2578c7b3ad4d3760b0e51c51f58320ff0bc31d4f997ab1b73d35b8abc82047ed8ecf6c
6
+ metadata.gz: 70b6e520d20d8e0c560312e959e7066d73482c95d1d43936fada0260f4c8d79cf85ffba3f6116fed1c0b8147f3a1651ceb380565d1cdc0c971a6311ed07a9ed0
7
+ data.tar.gz: cbca842a48e2ecf6e35801067a3d1583563231a281711ace6169b60182ba6b432e61303df84f900dd0748fe55ac8a11c64405b6fd077fa32dd9371786e5dbbea
@@ -1,11 +1,11 @@
1
1
  <%= tag.div(id: id(suffix: 'section'), **html_attributes) do %>
2
- <div class="govuk-accordion__section-header">
3
- <%= content_tag(heading_level, class: "govuk-accordion__section-heading") do %>
4
- <%= tag.span(heading_content, id: id, class: "govuk-accordion__section-button", aria: { expanded: expanded?, controls: id(suffix: 'content') }) %>
2
+ <div class="<%= brand %>-accordion__section-header">
3
+ <%= content_tag(heading_level, class: "#{brand}-accordion__section-heading") do %>
4
+ <%= tag.span(heading_content, id: id, class: "#{brand}-accordion__section-button", aria: { expanded: expanded?, controls: id(suffix: 'content') }) %>
5
5
  <% end %>
6
6
  <% if summary_content.present? %>
7
- <%= tag.div(summary_content, id: id(suffix: 'summary'), class: %w(govuk-accordion__section-summary govuk-body)) %>
7
+ <%= tag.div(summary_content, id: id(suffix: 'summary'), class: "#{brand}-accordion__section-summary #{brand}-body") %>
8
8
  <% end %>
9
9
  </div>
10
- <%= tag.div(content, id: id(suffix: 'content'), class: %w(govuk-accordion__section-content), aria: { labelledby: id }) %>
10
+ <%= tag.div(content, id: id(suffix: 'content'), class: "#{brand}-accordion__section-content", aria: { labelledby: id }) %>
11
11
  <% end %>
@@ -37,6 +37,6 @@ class GovukComponent::AccordionComponent::SectionComponent < GovukComponent::Bas
37
37
  private
38
38
 
39
39
  def default_attributes
40
- { class: class_names("govuk-accordion__section", "govuk-accordion__section--expanded" => expanded?).split }
40
+ { class: class_names("#{brand}-accordion__section", "#{brand}-accordion__section--expanded" => expanded?).split }
41
41
  end
42
42
  end
@@ -24,7 +24,7 @@ class GovukComponent::AccordionComponent < GovukComponent::Base
24
24
  private
25
25
 
26
26
  def default_attributes
27
- { class: %w(govuk-accordion), data: { module: 'govuk-accordion' } }.compact
27
+ { class: "#{brand}-accordion", data: { module: "#{brand}-accordion" } }.compact
28
28
  end
29
29
 
30
30
  def heading_tag(level)
@@ -22,8 +22,8 @@ private
22
22
  def default_attributes
23
23
  {
24
24
  class: class_names(
25
- "govuk-back-link",
26
- "govuk-back-link--inverse" => inverse
25
+ "#{brand}-back-link",
26
+ "#{brand}-back-link--inverse" => inverse
27
27
  ).split
28
28
  }
29
29
  end
@@ -25,4 +25,8 @@ class GovukComponent::Base < ViewComponent::Base
25
25
 
26
26
  super
27
27
  end
28
+
29
+ def brand(override = nil)
30
+ override || config.brand
31
+ end
28
32
  end
@@ -1,5 +1,5 @@
1
1
  <%= tag.div(**html_attributes) do %>
2
- <ol class="govuk-breadcrumbs__list">
2
+ <ol class="<%= brand %>-breadcrumbs__list">
3
3
  <% @breadcrumbs.each do |link| %>
4
4
  <%= link %>
5
5
  <% end %>
@@ -21,10 +21,10 @@ private
21
21
  def default_attributes
22
22
  {
23
23
  class: class_names(
24
- "govuk-breadcrumbs",
25
- "govuk-!-display-none-print" => hide_in_print,
26
- "govuk-breadcrumbs--collapse-on-mobile" => collapse_on_mobile,
27
- "govuk-breadcrumbs--inverse" => inverse
24
+ "#{brand}-breadcrumbs",
25
+ "#{brand}-!-display-none-print" => hide_in_print,
26
+ "#{brand}-breadcrumbs--collapse-on-mobile" => collapse_on_mobile,
27
+ "#{brand}-breadcrumbs--inverse" => inverse
28
28
  ).split
29
29
  }
30
30
  end
@@ -42,13 +42,13 @@ private
42
42
 
43
43
  def build_list_item(text, link = nil)
44
44
  if link.present?
45
- list_item { link_to(text, link, class: "govuk-breadcrumbs__link") }
45
+ list_item { link_to(text, link, class: "#{brand}-breadcrumbs__link") }
46
46
  else
47
47
  list_item(aria: { current: "page" }) { text.to_s }
48
48
  end
49
49
  end
50
50
 
51
51
  def list_item(html_attributes = {}, &block)
52
- tag.li(class: "govuk-breadcrumbs__list-item", **html_attributes, &block)
52
+ tag.li(class: "#{brand}-breadcrumbs__list-item", **html_attributes, &block)
53
53
  end
54
54
  end
@@ -16,8 +16,8 @@ class GovukComponent::CookieBannerComponent::MessageComponent < GovukComponent::
16
16
  def call
17
17
  tag.div(role: role, hidden: hidden, **html_attributes) do
18
18
  safe_join([
19
- tag.div(class: "govuk-grid-row") do
20
- tag.div(class: "govuk-grid-column-two-thirds") { safe_join([heading_element, message_element]) }
19
+ tag.div(class: "#{brand}-grid-row") do
20
+ tag.div(class: "#{brand}-grid-column-two-thirds") { safe_join([heading_element, message_element]) }
21
21
  end,
22
22
  actions_element
23
23
  ])
@@ -27,13 +27,13 @@ class GovukComponent::CookieBannerComponent::MessageComponent < GovukComponent::
27
27
  private
28
28
 
29
29
  def default_attributes
30
- { class: %w(govuk-cookie-banner__message govuk-width-container) }
30
+ { class: "#{brand}-cookie-banner__message #{brand}-width-container" }
31
31
  end
32
32
 
33
33
  def heading_element
34
34
  return if heading_content.blank?
35
35
 
36
- tag.h2(heading_content, class: %w(govuk-cookie-banner__heading govuk-heading-m))
36
+ tag.h2(heading_content, class: "#{brand}-cookie-banner__heading #{brand}-heading-m")
37
37
  end
38
38
 
39
39
  def heading_content
@@ -41,7 +41,7 @@ private
41
41
  end
42
42
 
43
43
  def message_element
44
- tag.div(message_content, class: "govuk-cookie-banner__content")
44
+ tag.div(message_content, class: "#{brand}-cookie-banner__content")
45
45
  end
46
46
 
47
47
  def message_content
@@ -51,12 +51,12 @@ private
51
51
  def wrap_in_p(message_text)
52
52
  return if message_text.blank?
53
53
 
54
- tag.p(message_text, class: "govuk-body")
54
+ tag.p(message_text, class: "#{brand}-body")
55
55
  end
56
56
 
57
57
  def actions_element
58
58
  return if actions.none?
59
59
 
60
- tag.div(class: "govuk-button-group") { safe_join(actions) }
60
+ tag.div(class: "#{brand}-button-group") { safe_join(actions) }
61
61
  end
62
62
  end
@@ -28,7 +28,7 @@ module GovukComponent
28
28
 
29
29
  def default_attributes
30
30
  {
31
- class: class_names("govuk-cookie-banner", "govuk-!-display-none-print" => hide_in_print).split
31
+ class: class_names("#{brand}-cookie-banner", "#{brand}-!-display-none-print" => hide_in_print).split
32
32
  }
33
33
  end
34
34
  end
@@ -13,7 +13,7 @@ class GovukComponent::DetailsComponent < GovukComponent::Base
13
13
  end
14
14
 
15
15
  def call
16
- tag.details(data: { module: "govuk-details" }, id: id, open: open, **html_attributes) do
16
+ tag.details(data: { module: "#{brand}-details" }, id: id, open: open, **html_attributes) do
17
17
  safe_join([summary, description])
18
18
  end
19
19
  end
@@ -21,8 +21,8 @@ class GovukComponent::DetailsComponent < GovukComponent::Base
21
21
  private
22
22
 
23
23
  def summary
24
- tag.summary(class: "govuk-details__summary") do
25
- tag.span(summary_content, class: "govuk-details__summary-text")
24
+ tag.summary(class: "#{brand}-details__summary") do
25
+ tag.span(summary_content, class: "#{brand}-details__summary-text")
26
26
  end
27
27
  end
28
28
 
@@ -31,12 +31,12 @@ private
31
31
  end
32
32
 
33
33
  def description
34
- tag.div(class: "govuk-details__text") do
34
+ tag.div(class: "#{brand}-details__text") do
35
35
  content.presence || text
36
36
  end
37
37
  end
38
38
 
39
39
  def default_attributes
40
- { class: %w(govuk-details) }
40
+ { class: "#{brand}-details" }
41
41
  end
42
42
  end
@@ -36,9 +36,9 @@ private
36
36
 
37
37
  def default_attributes
38
38
  {
39
- class: "govuk-exit-this-page",
39
+ class: "#{brand}-exit-this-page",
40
40
  data: {
41
- module: "govuk-exit-this-page",
41
+ module: "#{brand}-exit-this-page",
42
42
  "i18n.activated" => activated_text,
43
43
  "i18n.timed-out" => timed_out_text,
44
44
  "i18n.press-two-more-times" => press_two_more_times_text,
@@ -50,7 +50,7 @@ private
50
50
  def link_attributes
51
51
  {
52
52
  warning: true,
53
- class: %w(govuk-exit-this-page__button govuk-js-exit-this-page-button)
53
+ class: "#{brand}-exit-this-page__button #{brand}-js-exit-this-page-button"
54
54
  }
55
55
  end
56
56
  end
@@ -1,24 +1,24 @@
1
1
  <%= tag.footer(role: 'contentinfo', **html_attributes) do %>
2
2
  <%= tag.div(**container_html_attributes) do %>
3
3
  <% if navigation.present? %>
4
- <div class="govuk-footer__navigation">
4
+ <div class="<%= brand %>-footer__navigation">
5
5
  <%= navigation %>
6
6
  </div>
7
7
 
8
- <hr class="govuk-footer__section-break">
8
+ <hr class="<% brand %>-footer__section-break">
9
9
  <% end %>
10
10
 
11
11
  <%= tag.div(class: meta_classes, **meta_html_attributes) do %>
12
12
  <% if meta.present? %>
13
13
  <%= meta %>
14
14
  <% else %>
15
- <div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
15
+ <div class="<%= brand %>-footer__meta-item <%= brand %>-footer__meta-item--grow">
16
16
  <% if meta_items.any? %>
17
- <h2 class="govuk-visually-hidden"><%= meta_items_title %></h2>
17
+ <h2 class="<%= brand %>-visually-hidden"><%= meta_items_title %></h2>
18
18
 
19
- <ul class="govuk-footer__inline-list">
19
+ <ul class="<%= brand %>-footer__inline-list">
20
20
  <% @meta_items.each do |hyperlink| %>
21
- <li class="govuk-footer__inline-list-item">
21
+ <li class="<%= brand %>-footer__inline-list-item">
22
22
  <%= hyperlink %>
23
23
  </li>
24
24
  <% end %>
@@ -26,23 +26,23 @@
26
26
  <% end %>
27
27
 
28
28
  <% if meta_licence.nil? %>
29
- <svg aria-hidden="true" focusable="false" class="govuk-footer__licence-logo" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 483.2 195.7" height="17" width="41">
29
+ <svg aria-hidden="true" focusable="false" class="<%= brand %>-footer__licence-logo" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 483.2 195.7" height="17" width="41">
30
30
  <path fill="currentColor" d="M421.5 142.8V.1l-50.7 32.3v161.1h112.4v-50.7zm-122.3-9.6A47.12 47.12 0 0 1 221 97.8c0-26 21.1-47.1 47.1-47.1 16.7 0 31.4 8.7 39.7 21.8l42.7-27.2A97.63 97.63 0 0 0 268.1 0c-36.5 0-68.3 20.1-85.1 49.7A98 98 0 0 0 97.8 0C43.9 0 0 43.9 0 97.8s43.9 97.8 97.8 97.8c36.5 0 68.3-20.1 85.1-49.7a97.76 97.76 0 0 0 149.6 25.4l19.4 22.2h3v-87.8h-80l24.3 27.5zM97.8 145c-26 0-47.1-21.1-47.1-47.1s21.1-47.1 47.1-47.1 47.2 21 47.2 47S123.8 145 97.8 145" />
31
31
  </svg>
32
32
 
33
- <%= tag.span(default_licence, class: "govuk-footer__licence-description") %>
33
+ <%= tag.span(default_licence, class: "#{brand}-footer__licence-description") %>
34
34
  <% elsif meta_licence.present? %>
35
- <%= tag.span(meta_licence, class: "govuk-footer__licence-description") %>
35
+ <%= tag.span(meta_licence, class: "#{brand}-footer__licence-description") %>
36
36
  <% end %>
37
37
 
38
38
  <% if meta_content.present? %>
39
- <div class="govuk-footer__meta-custom">
39
+ <div class="<%= brand %>-footer__meta-custom">
40
40
  <%= meta_content %>
41
41
  </div>
42
42
  <% end %>
43
43
  </div>
44
44
 
45
- <%= tag.div(copyright, class: "govuk-footer__meta-item") %>
45
+ <%= tag.div(copyright, class: "#{brand}-footer__meta-item") %>
46
46
  <% end %>
47
47
  <% end %>
48
48
  <% end %>
@@ -37,7 +37,7 @@ class GovukComponent::FooterComponent < GovukComponent::Base
37
37
  private
38
38
 
39
39
  def default_attributes
40
- { class: %w(govuk-footer) }
40
+ { class: "#{brand}-footer" }
41
41
  end
42
42
 
43
43
  def meta_content
@@ -45,7 +45,7 @@ private
45
45
  end
46
46
 
47
47
  def meta_classes
48
- %w(govuk-footer__meta).append(@custom_meta_classes)
48
+ ["#{brand}-footer__meta"].append(@custom_meta_classes)
49
49
  end
50
50
 
51
51
  def meta_html_attributes
@@ -57,7 +57,7 @@ private
57
57
  #
58
58
  # Once we drop classes this extra merging can be dropped along with the
59
59
  # container_classes and meta_classes args
60
- { class: %w(govuk-width-container) }.deep_merge_html_attributes(
60
+ { class: "#{brand}-width-container" }.deep_merge_html_attributes(
61
61
  @custom_container_html_attributes.merge(class: custom_container_classes)
62
62
  )
63
63
  end
@@ -67,21 +67,21 @@ private
67
67
 
68
68
  case links
69
69
  when Array
70
- links.map { |link| raw(link_to(link[:text], link[:href], class: %w(govuk-footer__link), **link.fetch(:attr, {}))) }
70
+ links.map { |link| raw(link_to(link[:text], link[:href], class: "#{brand}-footer__link", **link.fetch(:attr, {}))) }
71
71
  when Hash
72
- links.map { |text, href| raw(link_to(text, href, class: %w(govuk-footer__link))) }
72
+ links.map { |text, href| raw(link_to(text, href, class: "#{brand}-footer__link")) }
73
73
  else
74
74
  fail(ArgumentError, 'meta links must be a hash or array of hashes') unless links.is_a?(Hash)
75
75
  end
76
76
  end
77
77
 
78
78
  def default_licence
79
- link = link_to("Open Government Licence v3.0", "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/", class: %w(govuk-footer__link))
79
+ link = link_to("Open Government Licence v3.0", "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/", class: "#{brand}-footer__link")
80
80
 
81
81
  raw(%(All content is available under the #{link}, except where otherwise stated))
82
82
  end
83
83
 
84
84
  def build_copyright(text, url)
85
- link_to(text, url, class: %w(govuk-footer__link govuk-footer__copyright-logo))
85
+ link_to(text, url, class: "#{brand}-footer__link #{brand}-footer__copyright-logo")
86
86
  end
87
87
  end
@@ -1,14 +1,14 @@
1
- <%= tag.header(role: 'banner', data: { module: 'govuk-header' }, **html_attributes) do %>
1
+ <%= tag.header(role: 'banner', data: { module: "#{brand}-header" }, **html_attributes) do %>
2
2
  <%= tag.div(**container_html_attributes) do %>
3
- <div class="govuk-header__logo">
4
- <%= link_to(homepage_url, class: %w(govuk-header__link govuk-header__link--homepage)) do %>
5
- <span class="govuk-header__logotype">
3
+ <div class="<%= brand %>-header__logo">
4
+ <%= link_to(homepage_url, class: ["#{brand}-header__link", "#{brand}-header__link--homepage"]) do %>
5
+ <span class="<%= brand %>-header__logotype">
6
6
  <% if custom_logo.present? %>
7
7
  <%= custom_logo %>
8
8
  <% else %>
9
9
  <% if crown %>
10
10
  <!--[if gt IE 8]><!-->
11
- <svg aria-hidden="true" focusable="false" class="govuk-header__logotype-crown" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 132 97" height="30" width="36">
11
+ <svg aria-hidden="true" focusable="false" class="<%= brand %>-header__logotype-crown" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 132 97" height="30" width="36">
12
12
  <path fill="currentColor" fill-rule="evenodd" d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM9 39.5c3.6 1.5 7.8-.2 9.2-3.7 1.5-3.6-.2-7.8-3.9-9.1-3.6-1.5-7.6.2-9.1 3.8-1.4 3.5.3 7.5 3.8 9zM4.4 57.2c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.5-1.5-7.6.3-9.1 3.8-1.4 3.5.3 7.6 3.9 9.1zm38.3-21.4c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.6-1.5-7.6.3-9.1 3.8-1.3 3.6.4 7.7 3.9 9.1zm64.4-5.6c-3.6 1.5-7.8-.2-9.1-3.7-1.5-3.6.2-7.8 3.8-9.2 3.6-1.4 7.7.3 9.2 3.9 1.3 3.5-.4 7.5-3.9 9zm15.9 9.3c-3.6 1.5-7.7-.2-9.1-3.7-1.5-3.6.2-7.8 3.7-9.1 3.6-1.5 7.7.2 9.2 3.8 1.5 3.5-.3 7.5-3.8 9zm4.7 17.7c-3.6 1.5-7.8-.2-9.2-3.8-1.5-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.3 3.5-.4 7.6-3.9 9.1zM89.3 35.8c-3.6 1.5-7.8-.2-9.2-3.8-1.4-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.4 3.6-.3 7.7-3.9 9.1zM69.7 17.7l8.9 4.7V9.3l-8.9 2.8c-.2-.3-.5-.6-.9-.9L72.4 0H59.6l3.5 11.2c-.3.3-.6.5-.9.9l-8.8-2.8v13.1l8.8-4.7c.3.3.6.7.9.9l-5 15.4v.1c-.2.8-.4 1.6-.4 2.4 0 4.1 3.1 7.5 7 8.1h.2c.3 0 .7.1 1 .1.4 0 .7 0 1-.1h.2c4-.6 7.1-4.1 7.1-8.1 0-.8-.1-1.7-.4-2.4V34l-5.1-15.4c.4-.2.7-.6 1-.9zM66 92.8c16.9 0 32.8 1.1 47.1 3.2 4-16.9 8.9-26.7 14-33.5l-9.6-3.4c1 4.9 1.1 7.2 0 10.2-1.5-1.4-3-4.3-4.2-8.7L108.6 76c2.8-2 5-3.2 7.5-3.3-4.4 9.4-10 11.9-13.6 11.2-4.3-.8-6.3-4.6-5.6-7.9 1-4.7 5.7-5.9 8-.5 4.3-8.7-3-11.4-7.6-8.8 7.1-7.2 7.9-13.5 2.1-21.1-8 6.1-8.1 12.3-4.5 20.8-4.7-5.4-12.1-2.5-9.5 6.2 3.4-5.2 7.9-2 7.2 3.1-.6 4.3-6.4 7.8-13.5 7.2-10.3-.9-10.9-8-11.2-13.8 2.5-.5 7.1 1.8 11 7.3L80.2 60c-4.1 4.4-8 5.3-12.3 5.4 1.4-4.4 8-11.6 8-11.6H55.5s6.4 7.2 7.9 11.6c-4.2-.1-8-1-12.3-5.4l1.4 16.4c3.9-5.5 8.5-7.7 10.9-7.3-.3 5.8-.9 12.8-11.1 13.8-7.2.6-12.9-2.9-13.5-7.2-.7-5 3.8-8.3 7.1-3.1 2.7-8.7-4.6-11.6-9.4-6.2 3.7-8.5 3.6-14.7-4.6-20.8-5.8 7.6-5 13.9 2.2 21.1-4.7-2.6-11.9.1-7.7 8.8 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"></path>
13
13
  </svg>
14
14
  <!--<![endif]-->
@@ -20,7 +20,7 @@
20
20
  <![endif]-->
21
21
  <% end %>
22
22
 
23
- <%= tag.span(logotype, class: "govuk-header__logotype-text") %>
23
+ <%= tag.span(logotype, class: "#{brand}-header__logotype-text") %>
24
24
  <% end %>
25
25
  </span>
26
26
  <% if product_name.present? %>
@@ -30,15 +30,15 @@
30
30
  </div>
31
31
 
32
32
  <% if service_name.present? || navigation_items.present? %>
33
- <div class="govuk-header__content">
33
+ <div class="<%= brand %>-header__content">
34
34
  <% if service_name.present? %>
35
- <%= link_to(service_name, service_url, class: %w(govuk-header__link govuk-header__service-name)) %>
35
+ <%= link_to(service_name, service_url, class: ["#{brand}-header__link", "#{brand}-header__service-name"]) %>
36
36
  <% end %>
37
37
 
38
38
  <% if navigation_items.any? %>
39
39
  <%= tag.nav(**navigation_html_attributes) do %>
40
- <%= tag.button("Menu", type: "button", class: %w(govuk-header__menu-button govuk-js-header-toggle), hidden: true, aria: { controls: "navigation", label: menu_button_label }) %>
41
- <ul id="navigation" class="govuk-header__navigation-list">
40
+ <%= tag.button("Menu", type: "button", class: ["#{brand}-header__menu-button", "#{brand}-js-header-toggle"], hidden: true, aria: { controls: "navigation", label: menu_button_label }) %>
41
+ <ul id="navigation" class="<%= brand %>-header__navigation-list">
42
42
  <% navigation_items.each do |item| %>
43
43
  <%= item %>
44
44
  <% end %>
@@ -44,22 +44,22 @@ class GovukComponent::HeaderComponent < GovukComponent::Base
44
44
  private
45
45
 
46
46
  def default_attributes
47
- { class: %w(govuk-header) }
47
+ { class: ["#{brand}-header"] }
48
48
  end
49
49
 
50
50
  def navigation_html_attributes
51
- nc = %w(govuk-header__navigation).append(custom_navigation_classes).compact
51
+ nc = ["#{brand}-header__navigation"].append(custom_navigation_classes).compact
52
52
 
53
53
  { class: nc, aria: { label: navigation_label } }
54
54
  end
55
55
 
56
56
  def container_html_attributes
57
- { class: %w(govuk-header__container govuk-width-container).append(custom_container_classes).compact }
57
+ { class: ["#{brand}-header__container", "#{brand}-width-container"].append(custom_container_classes).compact }
58
58
  end
59
59
 
60
60
  def crown_fallback_image_attributes
61
61
  {
62
- class: "govuk-header__logotype-crown-fallback-image",
62
+ class: "#{brand}-header__logotype-crown-fallback-image",
63
63
  width: "36",
64
64
  height: "32",
65
65
  }
@@ -84,7 +84,7 @@ private
84
84
  end
85
85
 
86
86
  def active_class
87
- %w(govuk-header__navigation-item--active) if active?
87
+ ["#{brand}-header__navigation-item--active"] if active?
88
88
  end
89
89
 
90
90
  def link?
@@ -94,7 +94,7 @@ private
94
94
  def call
95
95
  tag.li(**html_attributes) do
96
96
  if link?
97
- link_to(text, href, class: "govuk-header__link", **options)
97
+ link_to(text, href, class: "#{brand}-header__link", **options)
98
98
  else
99
99
  text
100
100
  end
@@ -111,7 +111,7 @@ private
111
111
  end
112
112
 
113
113
  def default_attributes
114
- { class: %w(govuk-header__navigation-item) }
114
+ { class: ["#{brand}-header__navigation-item"] }
115
115
  end
116
116
  end
117
117
 
@@ -139,7 +139,7 @@ private
139
139
  private
140
140
 
141
141
  def default_attributes
142
- { class: %w(govuk-header__product-name) }
142
+ { class: ["#{brand}-header__product-name"] }
143
143
  end
144
144
  end
145
145
  end
@@ -23,6 +23,6 @@ private
23
23
  end
24
24
 
25
25
  def default_attributes
26
- { class: %w(govuk-inset-text) }
26
+ { class: ["#{brand}-inset-text"] }
27
27
  end
28
28
  end
@@ -1,10 +1,10 @@
1
1
  <%= tag.div(**html_attributes) do %>
2
- <div class="govuk-notification-banner__header">
3
- <%= content_tag(title_tag, class: "govuk-notification-banner__title", id: title_id) do %>
2
+ <div class="<%= brand %>-notification-banner__header">
3
+ <%= content_tag(title_tag, class: "#{brand}-notification-banner__title", id: title_id) do %>
4
4
  <%= title_content %>
5
5
  <% end %>
6
6
  </div>
7
- <div class="govuk-notification-banner__content">
7
+ <div class="<%= brand %>-notification-banner__content">
8
8
  <% headings.each do |heading| %>
9
9
  <%= heading %>
10
10
  <% end %>
@@ -52,11 +52,11 @@ class GovukComponent::NotificationBannerComponent < GovukComponent::Base
52
52
  end
53
53
 
54
54
  def link
55
- link_to(link_text, link_href, class: 'govuk-notification-banner__link') if link_text.present? && link_href.present?
55
+ link_to(link_text, link_href, class: "#{brand}-notification-banner__link") if link_text.present? && link_href.present?
56
56
  end
57
57
 
58
58
  def default_attributes
59
- { class: %w(govuk-notification-banner__heading) }
59
+ { class: ["#{brand}-notification-banner__heading"] }
60
60
  end
61
61
  end
62
62
 
@@ -65,11 +65,11 @@ private
65
65
  def default_attributes
66
66
  {
67
67
  class: class_names(
68
- "govuk-notification-banner",
69
- "govuk-notification-banner--success" => success
68
+ "#{brand}-notification-banner",
69
+ "#{brand}-notification-banner--success" => success
70
70
  ),
71
71
  data: {
72
- "module" => "govuk-notification-banner",
72
+ "module" => "#{brand}-notification-banner",
73
73
  "disable-auto-focus" => disable_auto_focus
74
74
  },
75
75
  role: role,
@@ -14,7 +14,7 @@ class GovukComponent::PaginationComponent::AdjacentPage < GovukComponent::Base
14
14
 
15
15
  def call
16
16
  tag.div(**html_attributes) do
17
- tag.a(href: href, class: %w(govuk-link govuk-pagination__link), rel: suffix) do
17
+ tag.a(href: href, class: ["#{brand}-link", "#{brand}-pagination__link"], rel: suffix) do
18
18
  safe_join([body, divider, label_content])
19
19
  end
20
20
  end
@@ -23,7 +23,7 @@ class GovukComponent::PaginationComponent::AdjacentPage < GovukComponent::Base
23
23
  private
24
24
 
25
25
  def default_attributes
26
- { class: ["govuk-pagination__#{suffix}"] }
26
+ { class: ["#{brand}-pagination__#{suffix}"] }
27
27
  end
28
28
 
29
29
  def body
@@ -37,7 +37,7 @@ private
37
37
  def divider
38
38
  return if label_text.blank?
39
39
 
40
- tag.span(":", class: %w(govuk-visually-hidden))
40
+ tag.span(":", class: "#{brand}-visually-hidden")
41
41
  end
42
42
 
43
43
  def label_content
@@ -48,12 +48,12 @@ private
48
48
 
49
49
  def title_classes
50
50
  class_names(
51
- %(govuk-pagination__link-title),
52
- %(govuk-pagination__link-title--decorated) => label_text.blank?
51
+ "#{brand}-pagination__link-title",
52
+ "#{brand}-pagination__link-title--decorated" => label_text.blank?
53
53
  )
54
54
  end
55
55
 
56
56
  def label_classes
57
- %w(govuk-pagination__link-label)
57
+ "#{brand}-pagination__link-label"
58
58
  end
59
59
  end
@@ -53,20 +53,20 @@ private
53
53
  end
54
54
 
55
55
  def link(current: false)
56
- attributes = html_attributes.tap { |ha| ha[:class] << "govuk-pagination__item--current" if current }
56
+ attributes = html_attributes.tap { |ha| ha[:class] << "#{brand}-pagination__item--current" if current }
57
57
 
58
58
  tag.li(**attributes) do
59
- tag.a(href: href, class: %w(govuk-link govuk-pagination__link)) { number.to_s }
59
+ tag.a(href: href, class: ["#{brand}-link", "#{brand}-pagination__link"]) { number.to_s }
60
60
  end
61
61
  end
62
62
 
63
63
  def ellipsis_item
64
- tag.li("⋯", class: %w(govuk-pagination__item govuk-pagination__item--ellipses))
64
+ tag.li("⋯", class: ["#{brand}-pagination__item", "#{brand}-pagination__item--ellipses"])
65
65
  end
66
66
 
67
67
  def default_attributes
68
68
  {
69
- class: %w(govuk-pagination__item),
69
+ class: ["#{brand}-pagination__item"],
70
70
  aria: { label: aria_label }
71
71
  }
72
72
  end
@@ -20,7 +20,7 @@ class GovukComponent::PaginationComponent::NextPage < GovukComponent::Pagination
20
20
  private
21
21
 
22
22
  def arrow
23
- tag.svg(class: "govuk-pagination__icon govuk-pagination__icon--next", xmlns: "http://www.w3.org/2000/svg", height: "13", width: "15", focusable: "false", viewBox: "0 0 15 13", aria: { hidden: "true" }) do
23
+ tag.svg(class: "#{brand}-pagination__icon #{brand}-pagination__icon--next", xmlns: "http://www.w3.org/2000/svg", height: "13", width: "15", focusable: "false", viewBox: "0 0 15 13", aria: { hidden: "true" }) do
24
24
  tag.path(d: "m8.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z")
25
25
  end
26
26
  end
@@ -14,7 +14,7 @@ class GovukComponent::PaginationComponent::PreviousPage < GovukComponent::Pagina
14
14
  private
15
15
 
16
16
  def arrow
17
- tag.svg(class: "govuk-pagination__icon govuk-pagination__icon--prev", xmlns: "http://www.w3.org/2000/svg", height: "13", width: "15", focusable: "false", viewBox: "0 0 15 13", aria: { hidden: "true" }) do
17
+ tag.svg(class: "#{brand}-pagination__icon #{brand}-pagination__icon--prev", xmlns: "http://www.w3.org/2000/svg", height: "13", width: "15", focusable: "false", viewBox: "0 0 15 13", aria: { hidden: "true" }) do
18
18
  tag.path(d: "m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z")
19
19
  end
20
20
  end
@@ -66,12 +66,12 @@ class GovukComponent::PaginationComponent < GovukComponent::Base
66
66
  end
67
67
 
68
68
  def call
69
- attributes = html_attributes.tap { |ha| (ha[:class] << "govuk-pagination--block") if items.empty? }
69
+ attributes = html_attributes.tap { |ha| (ha[:class] << "#{brand}-pagination--block") if items.empty? }
70
70
 
71
71
  tag.nav(**attributes) do
72
72
  safe_join([
73
73
  previous_content,
74
- tag.ul(class: "govuk-pagination__list") { safe_join(page_items) },
74
+ tag.ul(class: "#{brand}-pagination__list") { safe_join(page_items) },
75
75
  next_content
76
76
  ])
77
77
  end
@@ -85,7 +85,7 @@ class GovukComponent::PaginationComponent < GovukComponent::Base
85
85
  private
86
86
 
87
87
  def default_attributes
88
- { role: "navigation", aria: { label: landmark_label }, class: %w(govuk-pagination) }
88
+ { role: "navigation", aria: { label: landmark_label }, class: "#{brand}-pagination" }
89
89
  end
90
90
 
91
91
  def build_previous
@@ -124,6 +124,6 @@ private
124
124
 
125
125
  return visible if hidden.blank?
126
126
 
127
- (visible + tag.span(" #{hidden}", class: "govuk-visually-hidden")).html_safe
127
+ (visible + tag.span(" #{hidden}", class: "#{brand}-visually-hidden")).html_safe
128
128
  end
129
129
  end